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


Java BorderUIResource.CompoundBorderUIResource方法代码示例

本文整理汇总了Java中javax.swing.plaf.BorderUIResource.CompoundBorderUIResource方法的典型用法代码示例。如果您正苦于以下问题:Java BorderUIResource.CompoundBorderUIResource方法的具体用法?Java BorderUIResource.CompoundBorderUIResource怎么用?Java BorderUIResource.CompoundBorderUIResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.plaf.BorderUIResource的用法示例。


在下文中一共展示了BorderUIResource.CompoundBorderUIResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInternalFrameBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border that is composed of a raised bevel border and a
 * one-pixel thick line border.
 *
 * <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
 * alt="[A screen shot of a border returned by this method]" />
 *
 * <p>The colors of the border are retrieved from the
 * <code>UIDefaults</code> of the currently active look and feel
 * using the keys <code>&#x201c;InternalFrame.borderShadow&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderDarkShadow&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderLight&#x201d;</code>,
 * <code>&#x201c;InternalFrame.borderHighlight&#x201d;</code>, and
 * (for the inner one-pixel thick line)
 * <code>&#x201c;InternalFrame.borderColor&#x201d;</code>.
 */
public static Border getInternalFrameBorder()
{
  Color shadow, darkShadow, highlight, lightHighlight, line;

  /* See comment in methods above for why this border is not shared. */
  shadow = UIManager.getColor("InternalFrame.borderShadow");
  darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
  highlight = UIManager.getColor("InternalFrame.borderLight");
  lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
  line = UIManager.getColor("InternalFrame.borderColor");

  return new BorderUIResource.CompoundBorderUIResource(
    /* outer border */
    new BorderUIResource.BevelBorderUIResource(
      BevelBorder.RAISED,
      (highlight != null) ? highlight : Color.lightGray,
      (lightHighlight != null) ? lightHighlight : Color.white,
      (darkShadow != null) ? darkShadow : Color.black,
      (shadow != null) ? shadow : Color.gray),

    /* inner border */
    new BorderUIResource.LineBorderUIResource(
      (line != null) ? line : Color.lightGray));
}
 
开发者ID:vilie,项目名称:javify,代码行数:41,代码来源:BasicBorders.java

示例2: addMetalDefaults

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
@Override
    protected void addMetalDefaults(LookAndFeelAddons addon,
            DefaultsList defaults) {
        super.addMetalDefaults(addon, defaults);
        String key = "TableHeader.cellBorder";
        Border border = UIManager.getBorder(key);
        if (border instanceof MetalBorders.TableHeaderBorder) {
            border = new BorderUIResource.CompoundBorderUIResource(border, 
                    BorderFactory.createEmptyBorder());
            // PENDING JW: this is fishy ... adding to lookAndFeelDefaults is taken
            UIManager.getLookAndFeelDefaults().put(key, border);
            // adding to defaults is not
//            defaults.add(key, border);
        }
        
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:TableHeaderAddon.java

示例3: setupUI

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Set up the user interface.
 */
public static void setupUI() {
    try {
        final String classname = UIManager.getSystemLookAndFeelClassName();
        UIManager.setLookAndFeel(classname);
    }
    catch (Exception e) { 
        e.printStackTrace();
    }

    final UIDefaults defaults = UIManager.getDefaults();

    defaults.put(
        "PopupMenu.border", 
        new BorderUIResource.EtchedBorderUIResource(
            EtchedBorder.RAISED, defaults.getColor("controlShadow"), 
            defaults.getColor("controlLtHighlight")
        )
    );

    final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
    final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
    final BorderUIResource.CompoundBorderUIResource compBorder
        = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
    final BorderUIResource.EmptyBorderUIResource emptyBorderUI
        = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
    defaults.put("SplitPane.border", emptyBorderUI);
    defaults.put("Table.scrollPaneBorder", emptyBorderUI);
    defaults.put("ComboBox.border", compBorder);
    defaults.put("TextField.border", compBorder);
    defaults.put("TextArea.border", compBorder);
    defaults.put("CheckBox.border", compBorder);
    defaults.put("ScrollPane.border", emptyBorderUI);

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:38,代码来源:UIUtilities.java

示例4: getButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for Swing buttons in the Metal Look &amp; Feel.
 *
 * @return a border for Swing buttons in the Metal Look &amp; Feel
 */
public static Border getButtonBorder()
{
  if (buttonBorder == null)
    {
      Border outer = new ButtonBorder();
      Border inner = getMarginBorder();
      buttonBorder = new BorderUIResource.CompoundBorderUIResource(outer,
          inner);
    }
  return buttonBorder;
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:MetalBorders.java

示例5: getToggleButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for use with {@link JToggleButton} components.
 *
 * @return A border.
 *
 * @since 1.3
 */
public static Border getToggleButtonBorder()
{
  if (toggleButtonBorder == null)
    {
      Border outer = new ToggleButtonBorder();
      Border inner = getMarginBorder();
      toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
          outer, inner);
    }
  return toggleButtonBorder;
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:MetalBorders.java

示例6: getTextFieldBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for use by the {@link JTextField} component.
 *
 * @return A border.
 *
 * @since 1.3
 */
public static Border getTextFieldBorder()
{
  if (textFieldBorder == null)
    {
      Border inner = getMarginBorder();
      Border outer = new TextFieldBorder();
      textFieldBorder =
        new BorderUIResource.CompoundBorderUIResource(outer, inner);
    }
  return textFieldBorder;
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:MetalBorders.java

示例7: getTextBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns the border that is used for text components (except text fields,
 * which use {@link #getTextFieldBorder}.
 *
 * @return the border that is used for text components
 *
 * @since 1.3
 */
public static Border getTextBorder()
{
  if (textBorder == null)
    {
      Border inner = getMarginBorder();
      Border outer = new Flush3DBorder();
      textBorder =
        new BorderUIResource.CompoundBorderUIResource(outer, inner);
    }
  return textBorder;
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:MetalBorders.java

示例8: getRolloverBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a shared instance of a compound border for rollover buttons.
 *
 * @return A shared border instance.
 */
static Border getRolloverBorder()
{
  if (rolloverBorder == null)
    {
      Border outer = new MetalBorders.RolloverButtonBorder();
      Border inner = MetalBorders.getMarginBorder();
      rolloverBorder = new BorderUIResource.CompoundBorderUIResource(outer,
          inner);
    }
  return rolloverBorder;
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:MetalBorders.java

示例9: getButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for drawing push buttons.
 *
 * <p>The colors of the border are retrieved from the
 * <code>UIDefaults</code> of the currently active look and feel
 * using the keys <code>&#x201c;Button.shadow&#x201d;</code>,
 * <code>&#x201c;Button.darkShadow&#x201d;</code>,
 * <code>&#x201c;Button.light&#x201d;</code>, and
 * <code>&#x201c;Button.highlight&#x201d;</code>.
 *
 * <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
 * height="170" alt="[A screen shot of the returned border]" />
 *
 * @return a {@link
 *         javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
 *         whose outer border is a {@link ButtonBorder} and whose
 *         inner border is a {@link MarginBorder}.
 */
public static Border getButtonBorder()
{
  Border outer;

  /* The keys for UIDefaults have been determined by writing a
   * test program that dumps the UIDefaults to stdout; that program
   * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
   * the key "light" is usually called "highlight", and "highlight"
   * is usually called "lightHighlight".
   */
  outer = new ButtonBorder(UIManager.getColor("Button.shadow"),
                           UIManager.getColor("Button.darkShadow"),
                           UIManager.getColor("Button.light"),
                           UIManager.getColor("Button.highlight"));

  /* While the inner border is shared between multiple buttons,
   * we do not share the outer border because ButtonBorders store
   * their border colors. We cannot guarantee that the colors
   * (which come from UIDefaults) are unchanged between invocations
   * of getButtonBorder. We could store the last colors, and share
   * the button border if the colors are the same as in the last
   * invocation, but it probably is not worth the effort.
   */
  return new BorderUIResource.CompoundBorderUIResource(
    outer,
    /* inner */ getMarginBorder());
}
 
开发者ID:vilie,项目名称:javify,代码行数:46,代码来源:BasicBorders.java

示例10: getRadioButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for drawing radio buttons.
 *
 * <p>The colors of the border are retrieved from the
 * <code>UIDefaults</code> of the currently active look and feel
 * using the keys <code>&#x201c;RadioButton.shadow&#x201d;</code>,
 * <code>&#x201c;RadioButton.darkShadow&#x201d;</code>,
 * <code>&#x201c;RadioButton.light&#x201d;</code>, and
 * <code>&#x201c;RadioButton.highlight&#x201d;</code>.
 *
 * <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
 * height="135" alt="[A screen shot of the returned border]" />
 *
 * @return a {@link
 *         javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
 *         whose outer border is a {@link RadioButtonBorder} and whose
 *         inner border is a {@link MarginBorder}.
 */
public static Border getRadioButtonBorder()
{
  Border outer;

  /* The keys for UIDefaults have been determined by writing a
   * test program that dumps the UIDefaults to stdout; that program
   * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
   * the key "light" is usually called "highlight", and "highlight"
   * is usually called "lightHighlight".
   */
  outer = new RadioButtonBorder(
    UIManager.getColor("RadioButton.shadow"),
    UIManager.getColor("RadioButton.darkShadow"),
    UIManager.getColor("RadioButton.light"),
    UIManager.getColor("RadioButton.highlight"));

  /* While the inner border is shared between multiple buttons, we
   * do not share the outer border because RadioButtonBorders, being
   * ButtonBorders, store their border colors. We cannot guarantee
   * that the colors (which come from UIDefaults) are unchanged
   * between invocations of getButtonBorder. We could store the last
   * colors, and share the button border if the colors are the same
   * as in the last invocation, but it probably is not worth the
   * effort.
   */
  return new BorderUIResource.CompoundBorderUIResource(
    outer,
    /* inner */ getMarginBorder());
}
 
开发者ID:vilie,项目名称:javify,代码行数:48,代码来源:BasicBorders.java

示例11: getToggleButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
 * Returns a border for drawing toggle buttons.
 *
 * <p>The colors of the border are retrieved from the
 * <code>UIDefaults</code> of the currently active look and feel
 * using the keys <code>&#x201c;ToggleButton.shadow&#x201d;</code>,
 * <code>&#x201c;ToggleButton.darkShadow&#x201d;</code>,
 * <code>&#x201c;ToggleButton.light&#x201d;</code>, and
 * <code>&#x201c;ToggleButton.highlight&#x201d;</code>.
 *
 * <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png" width="270"
 * height="135" alt="[A screen shot of the returned border]" />
 *
 * @return a {@link
 *         javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
 *         whose outer border is a {@link ToggleButtonBorder} and whose
 *         inner border is a {@link MarginBorder}.
 */
public static Border getToggleButtonBorder()
{
  Border outer;

  /* The keys for UIDefaults have been determined by writing a
   * test program that dumps the UIDefaults to stdout; that program
   * was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
   * the key "light" is usually called "highlight", and "highlight"
   * is usually called "lightHighlight".
   */
  outer = new ToggleButtonBorder(
    UIManager.getColor("ToggleButton.shadow"),
    UIManager.getColor("ToggleButton.darkShadow"),
    UIManager.getColor("ToggleButton.light"),
    UIManager.getColor("ToggleButton.highlight"));

  /* While the inner border is shared between multiple buttons, we
   * do not share the outer border because ToggleButtonBorders, being
   * ButtonBorders, store their border colors. We cannot guarantee
   * that the colors (which come from UIDefaults) are unchanged
   * between invocations of getButtonBorder. We could store the last
   * colors, and share the button border if the colors are the same
   * as in the last invocation, but it probably is not worth the
   * effort.
   */
  return new BorderUIResource.CompoundBorderUIResource(
    outer,
    /* inner */ getMarginBorder());
}
 
开发者ID:vilie,项目名称:javify,代码行数:48,代码来源:BasicBorders.java

示例12: getButtonBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的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

示例13: getTextFieldBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
public static Border getTextFieldBorder() {
  if (ourTextFieldBorder == null) {
    ourTextFieldBorder = new BorderUIResource.CompoundBorderUIResource(
      new TextFieldBorder(),
      //new FlatLineBorder(),
      BorderFactory.createEmptyBorder(2, 2, 2, 2));
  }
  return ourTextFieldBorder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:BegBorders.java

示例14: getEtchedBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
static Border getEtchedBorder()
/*  65:    */   {
/*  66:130 */     if (etchedBorder == null) {
/*  67:131 */       etchedBorder = new BorderUIResource.CompoundBorderUIResource(new EtchedBorder(null), new BasicBorders.MarginBorder());
/*  68:    */     }
/*  69:135 */     return etchedBorder;
/*  70:    */   }
 
开发者ID:xiwc,项目名称:confluence.keygen,代码行数:8,代码来源:PlasticBorders.java

示例15: getMenuBarHeaderBorder

import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
static Border getMenuBarHeaderBorder()
/*  86:    */   {
/*  87:166 */     if (menuBarHeaderBorder == null) {
/*  88:167 */       menuBarHeaderBorder = new BorderUIResource.CompoundBorderUIResource(new MenuBarHeaderBorder(null), new BasicBorders.MarginBorder());
/*  89:    */     }
/*  90:171 */     return menuBarHeaderBorder;
/*  91:    */   }
 
开发者ID:xiwc,项目名称:confluence.keygen,代码行数:8,代码来源:PlasticBorders.java


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