当前位置: 首页>>代码示例>>Java>>正文


Java BasicBorders类代码示例

本文整理汇总了Java中javax.swing.plaf.basic.BasicBorders的典型用法代码示例。如果您正苦于以下问题:Java BasicBorders类的具体用法?Java BasicBorders怎么用?Java BasicBorders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BasicBorders类属于javax.swing.plaf.basic包,在下文中一共展示了BasicBorders类的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: IGVMenuBar

import javax.swing.plaf.basic.BasicBorders; //导入依赖的package包/类
private IGVMenuBar(IGV igv) {
    this.igv = igv;
    setBorder(new BasicBorders.MenuBarBorder(Color.GRAY, Color.GRAY));
    setBorderPainted(true);

    for (AbstractButton menu : createMenus()) {
        add(menu);
    }

    //This is for Macs, so showing the about dialog
    //from the command bar does what we want.
    if (Globals.IS_MAC) {
        try {
            OSXAdapter.setAboutHandler(this, getClass().getDeclaredMethod("showAboutDialog", (Class[]) null));
            OSXAdapter.setQuitHandler(ShutdownThread.class, ShutdownThread.class.getDeclaredMethod("runS", (Class[]) null));
        } catch (Exception e) {
            log.error("Error setting apple-specific about and quit handlers", e);
        }

    }
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:22,代码来源:IGVMenuBar.java

示例4: 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

示例5: 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:shannah,项目名称:cn1,代码行数:17,代码来源:MetalBordersTest.java

示例6: 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:shannah,项目名称:cn1,代码行数:17,代码来源:MetalBordersTest.java

示例7: 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:shannah,项目名称:cn1,代码行数:17,代码来源:MetalBordersTest.java

示例8: initComponentDefaultsClassic

import javax.swing.plaf.basic.BasicBorders; //导入依赖的package包/类
/**
  * Initializes component defaults required in classic mode only.
  */
 private void initComponentDefaultsClassic(UIDefaults table) {
     Object checkBoxIcon = new SimpleProxyLazyValue(
             "com.jgoodies.looks.windows.WindowsLookAndFeel",
             "getCheckBoxIcon");

     Object radioButtonIcon = new SimpleProxyLazyValue(
             "com.jgoodies.looks.windows.WindowsLookAndFeel",
             "getRadioButtonIcon");

     Border winInsetBorder = new BasicBorders.FieldBorder(table
             .getColor("controlShadow"), table
             .getColor("controlDkShadow"),
             table.getColor("controlHighlight"), table
                     .getColor("controlLtHighlight"));

     Object[] defaults = {
         "CheckBox.checkColor",    table.get("controlText"), // kind-of black
         "CheckBox.icon",          checkBoxIcon,
"RadioButton.checkColor", table.get("controlText"), // kind-of black
         "RadioButton.icon",       radioButtonIcon,
         "Table.scrollPaneBorder", winInsetBorder, // 1.4.1 Bug

     };
     table.putDefaults(defaults);
 }
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:29,代码来源:WindowsLookAndFeel.java

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的javax.swing.plaf.basic.BasicBorders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。