コード例 #1
0
 /**
  * Gets the border used around {@link javax.swing.JMenuBar}'s.
  *
  * @return the border used around {@link javax.swing.JMenuBar}'s
  */
 public BorderUIResource getMenuBarBorder() {
   return menuBarBorder.getBorder();
 }
コード例 #2
0
 /**
  * Gets the border used around {@link javax.swing.JTextField} (including spinners etc.).
  *
  * @return the border used around {@link javax.swing.JTextField}
  */
 public BorderUIResource getTextFieldBorder() {
   return textFieldBorder.getBorder();
 }
コード例 #3
0
 /**
  * Gets the border around cells in {@link javax.swing.table.JTableHeader}'s.
  *
  * @return the border around cells in {@link javax.swing.table.JTableHeader}'s
  */
 public BorderUIResource getTableHeaderCellBorder() {
   return tableHeaderCellBorder.getBorder();
 }
コード例 #4
0
  private void updateColors() {
    focusColor.setDefaultColor(
        ColorUtil.blend(controlColor.getColor(), textColor.getColor(), 0.5f));

    inactiveTextColor.setDefaultColor(focusColor);

    double invShadeAmount = 1.0 / (1 + shadingFactor * 1.2);
    double invShadeAmount2 = 1.0 / (1 + shadingFactor / 2);
    double invShadeAmount3 = 1.0 / (1 + shadingFactor / 7);

    controlHighlightColor =
        new ColorUIResource(ColorUtil.mult(controlColor.getColor(), 1 + shadingFactor));
    controlLightShadowColor =
        new ColorUIResource(ColorUtil.mult(controlColor.getColor(), invShadeAmount3));
    controlShadowColor =
        new ColorUIResource(ColorUtil.mult(controlColor.getColor(), invShadeAmount2));
    controlDarkShadowColor =
        new ColorUIResource(ColorUtil.mult(controlColor.getColor(), invShadeAmount));

    primaryControlHighlightColor = controlHighlightColor;
    primaryControlShadowColor =
        new ColorUIResource(ColorUtil.mult(primaryControlColor.getColor(), invShadeAmount2));
    primaryControlDarkShadowColor =
        new ColorUIResource(ColorUtil.mult(primaryControlColor.getColor(), invShadeAmount));

    scrollBarBackgroundColor.setDefaultColor(controlLightShadowColor);
    scrollBarBackgroundShadowColor =
        new ColorUIResource(ColorUtil.mult(scrollBarBackgroundColor.getColor(), invShadeAmount));

    selectedMenuBackgroundColor.setDefaultColor(selectedTextBackgroundColor);
    selectedMenuForegroundColor.setDefaultColor(selectedTextColor);

    treeIconBackgroundColor.setDefaultColor(
        ColorUtil.blend(backgroundColor.getColor(), primaryControlColor.getColor(), 0.15f));

    activeInternalFrameTitleBackgroundColor.setDefaultColor(
        ColorUtil.blend(
            primaryControlColor.getColor(), ColorUtil.getOpposite(getTextColor()), 0.5f));
    activeInternalFrameTitleForegroundColor.setDefaultColor(getTextColor());
    activeInternalFrameTitleGradientColor.setDefaultColor(
        ColorUtil.mult(activeInternalFrameTitleBackgroundColor.getColor(), 1.2));
    inactiveInternalFrameTitleBackgroundColor.setDefaultColor(controlLightShadowColor);
    inactiveInternalFrameTitleForegroundColor.setDefaultColor(getTextColor());
    inactiveInternalFrameTitleGradientColor.setDefaultColor(
        ColorUtil.mult(inactiveInternalFrameTitleBackgroundColor.getColor(), 1.2));

    menuBarBorder.setDefaultBorder(
        new BorderUIResource(
            new EtchedLineBorder(
                false, false, true, false, controlHighlightColor, controlDarkShadowColor)));
    popupMenuBorder.setDefaultBorder(
        new BorderUIResource(new PopupMenuBorder(controlHighlightColor, controlDarkShadowColor)));
    textFieldBorder.setDefaultBorder(
        new BorderUIResource(
            new CompoundBorder(
                new LineBorder(controlDarkShadowColor), new EmptyBorder(1, 2, 1, 2))));

    tableHeaderCellBorder.setDefaultBorder(
        new BorderUIResource(
            new CompoundBorder(
                new CompoundBorder(
                    new EdgeBorder(controlDarkShadowColor, false, true, false, true),
                    new HighlightBorder(false, controlHighlightColor)),
                new EmptyBorder(1, 4, 1, 4))));

    listFocusedItemBorder.setDefaultBorder(
        new CompoundBorder(new LineBorder(focusColor.getColor()), new EmptyBorder(0, 3, 0, 3)));
  }
コード例 #5
0
 /**
  * Gets the border used around the focused list item in {@link javax.swing.JList}'s and {@link
  * javax.swing.JComboBox}'s.
  *
  * @return the border used around the focused list item in {@link javax.swing.JList}'s and {@link
  *     javax.swing.JComboBox}'s
  */
 public BorderUIResource getListFocusedItemBorder() {
   return listFocusedItemBorder.getBorder();
 }
コード例 #6
0
 /**
  * Gets the border of a {@link javax.swing.JPopupMenu}.
  *
  * @return the border of a {@link javax.swing.JPopupMenu}
  */
 public BorderUIResource getPopupMenuBorder() {
   return popupMenuBorder.getBorder();
 }