當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicBorders.MarginBorder方法代碼示例

本文整理匯總了Java中javax.swing.plaf.basic.BasicBorders.MarginBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java BasicBorders.MarginBorder方法的具體用法?Java BasicBorders.MarginBorder怎麽用?Java BasicBorders.MarginBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.plaf.basic.BasicBorders的用法示例。


在下文中一共展示了BasicBorders.MarginBorder方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addCustomEntriesToTable

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
@Override
public void addCustomEntriesToTable(UIDefaults table) {

    Border blackLineBorder =
            new BorderUIResource(new LineBorder(getBlack()));
    Border whiteLineBorder =
            new BorderUIResource(new LineBorder(getWhite()));

    Object textBorder = new BorderUIResource(new CompoundBorder(
            blackLineBorder,
            new BasicBorders.MarginBorder()));

    table.put("ToolTip.border", blackLineBorder);
    table.put("TitledBorder.border", blackLineBorder);
    table.put("Table.focusCellHighlightBorder", whiteLineBorder);
    table.put("Table.focusCellForeground", getWhite());

    table.put("TextField.border", textBorder);
    table.put("PasswordField.border", textBorder);
    table.put("TextArea.border", textBorder);
    table.put("TextPane.font", textBorder);


}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:25,代碼來源:ContrastMetalTheme.java

示例2: addCustomEntriesToTable

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
@Override
public void addCustomEntriesToTable(final UIDefaults table) {

	final Border blackLineBorder = new BorderUIResource(new LineBorder(getBlack()));

	final Object textBorder = new BorderUIResource(new CompoundBorder(blackLineBorder, new BasicBorders.MarginBorder()));

	table.put("ToolTip.border", blackLineBorder);
	table.put("TitledBorder.border", blackLineBorder);

	table.put("TextField.border", textBorder);
	table.put("PasswordField.border", textBorder);
	table.put("TextArea.border", textBorder);
	table.put("TextPane.border", textBorder);
	table.put("EditorPane.border", textBorder);

}
 
開發者ID:marvertin,項目名稱:geokuk,代碼行數:18,代碼來源:ContrastTheme.java

示例3: initComponentDefaults

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
@Override
protected void initComponentDefaults(UIDefaults table) {
	super.initComponentDefaults(table);

	Border lineBorder = new BorderUIResource(new MatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY));
	Object textBorder = new BorderUIResource(new CompoundBorder(lineBorder, new BasicBorders.MarginBorder()));
	
	Object[] defaults = new Object[] { "ComboBox.selectionForeground", getHighlightedTextColor(), "Panel.font", getControlTextFont(), 
	        "ToolTip.border", lineBorder,
	        "TitledBorder.border", lineBorder,
	        "TextField.border", textBorder,
	        "PasswordField.border", textBorder,
	        "TextArea.border", textBorder,
	        "TextPane.border", textBorder,
	        "EditorPane.border", textBorder,
	        "Button.border", lineBorder,
			};
	table.putDefaults(defaults);
}
 
開發者ID:BrunoEberhard,項目名稱:minimal-j,代碼行數:20,代碼來源:PrintLookAndFeel.java

示例4: testGetToggleButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
public void testGetToggleButtonBorder() {
    JComponent testButton = newJComponent();
    assertTrue(MetalBorders.getToggleButtonBorder() instanceof BorderUIResource.CompoundBorderUIResource);
    BorderUIResource.CompoundBorderUIResource border = (BorderUIResource.CompoundBorderUIResource) MetalBorders
            .getToggleButtonBorder();
    assertTrue(border.getInsideBorder() instanceof BasicBorders.MarginBorder);
    BasicBorders.MarginBorder insideBorder = (BasicBorders.MarginBorder) border
            .getInsideBorder();
    assertTrue(border.getOutsideBorder() instanceof MetalBorders.ToggleButtonBorder);
    MetalBorders.ToggleButtonBorder outsideBorder = (MetalBorders.ToggleButtonBorder) border
            .getOutsideBorder();
    //        assertEquals(new Insets(2, 14, 2, 14), insideBorder.getBorderInsets(testButton));
    assertEquals(new Insets(3, 3, 3, 3), outsideBorder.getBorderInsets(testButton));
    assertFalse(insideBorder.isBorderOpaque());
    assertFalse(outsideBorder.isBorderOpaque());
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:17,代碼來源:MetalBordersTest.java

示例5: testGetTextFieldBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
public void testGetTextFieldBorder() {
    JComponent testButton = newJComponent();
    assertTrue(MetalBorders.getTextFieldBorder() instanceof BorderUIResource.CompoundBorderUIResource);
    BorderUIResource.CompoundBorderUIResource border = (BorderUIResource.CompoundBorderUIResource) MetalBorders
            .getTextFieldBorder();
    assertTrue(border.getInsideBorder() instanceof BasicBorders.MarginBorder);
    BasicBorders.MarginBorder insideBorder = (BasicBorders.MarginBorder) border
            .getInsideBorder();
    assertTrue(border.getOutsideBorder() instanceof MetalBorders.TextFieldBorder);
    MetalBorders.TextFieldBorder outsideBorder = (MetalBorders.TextFieldBorder) border
            .getOutsideBorder();
    //        assertEquals(new Insets(2, 14, 2, 14), insideBorder.getBorderInsets(testButton));
    assertEquals(new Insets(2, 2, 2, 2), outsideBorder.getBorderInsets(testButton));
    assertFalse(insideBorder.isBorderOpaque());
    assertFalse(outsideBorder.isBorderOpaque());
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:17,代碼來源:MetalBordersTest.java

示例6: testGetTextBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
public void testGetTextBorder() {
    JComponent testButton = newJComponent();
    assertTrue(MetalBorders.getTextBorder() instanceof BorderUIResource.CompoundBorderUIResource);
    BorderUIResource.CompoundBorderUIResource border = (BorderUIResource.CompoundBorderUIResource) MetalBorders
            .getTextBorder();
    assertTrue(border.getInsideBorder() instanceof BasicBorders.MarginBorder);
    BasicBorders.MarginBorder insideBorder = (BasicBorders.MarginBorder) border
            .getInsideBorder();
    assertTrue(border.getOutsideBorder() instanceof MetalBorders.Flush3DBorder);
    MetalBorders.Flush3DBorder outsideBorder = (MetalBorders.Flush3DBorder) border
            .getOutsideBorder();
    //        assertEquals(new Insets(2, 14, 2, 14), insideBorder.getBorderInsets(testButton));
    assertEquals(new Insets(2, 2, 2, 2), outsideBorder.getBorderInsets(testButton));
    assertFalse(insideBorder.isBorderOpaque());
    assertFalse(outsideBorder.isBorderOpaque());
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:17,代碼來源:MetalBordersTest.java

示例7: getButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a JButton
 * @since 1.3
 */
public static Border getButtonBorder() {
    if (buttonBorder == null) {
        buttonBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.ButtonBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return buttonBorder;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:MetalBorders.java

示例8: getTextBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a text component
 * @since 1.3
 */
public static Border getTextBorder() {
    if (textBorder == null) {
        textBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.Flush3DBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return textBorder;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:MetalBorders.java

示例9: getTextFieldBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a JTextField
 * @since 1.3
 */
public static Border getTextFieldBorder() {
    if (textFieldBorder == null) {
        textFieldBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.TextFieldBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return textFieldBorder;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:MetalBorders.java

示例10: getToggleButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a JToggleButton
 * @since 1.3
 */
public static Border getToggleButtonBorder() {
    if (toggleButtonBorder == null) {
        toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.ToggleButtonBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return toggleButtonBorder;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:13,代碼來源:MetalBorders.java

示例11: getButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a {@code JButton}.
 *
 * @return a border instance for a {@code JButton}
 * @since 1.3
 */
public static Border getButtonBorder() {
    if (buttonBorder == null) {
        buttonBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.ButtonBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return buttonBorder;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:MetalBorders.java

示例12: getTextBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a text component.
 *
 * @return a border instance for a text component
 * @since 1.3
 */
public static Border getTextBorder() {
    if (textBorder == null) {
        textBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.Flush3DBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return textBorder;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:MetalBorders.java

示例13: getTextFieldBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a {@code JTextField}.
 *
 * @return a border instance for a {@code JTextField}
 * @since 1.3
 */
public static Border getTextFieldBorder() {
    if (textFieldBorder == null) {
        textFieldBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.TextFieldBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return textFieldBorder;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:MetalBorders.java

示例14: getToggleButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
/**
 * Returns a border instance for a {@code JToggleButton}.
 *
 * @return a border instance for a {@code JToggleButton}
 * @since 1.3
 */
public static Border getToggleButtonBorder() {
    if (toggleButtonBorder == null) {
        toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
                                               new MetalBorders.ToggleButtonBorder(),
                                               new BasicBorders.MarginBorder());
    }
    return toggleButtonBorder;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:MetalBorders.java

示例15: getButtonBorder

import javax.swing.plaf.basic.BasicBorders; //導入方法依賴的package包/類
public static Border getButtonBorder() {
  if (ourButtonBorder == null) {
    ourButtonBorder = new BorderUIResource.CompoundBorderUIResource(
      new ButtonBorder(),
      new BasicBorders.MarginBorder());
  }
  return ourButtonBorder;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:BegBorders.java


注:本文中的javax.swing.plaf.basic.BasicBorders.MarginBorder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。