示例#1
0
  protected void installDefaults(AbstractButton b) {
    // load shared instance defaults
    String pp = getPropertyPrefix();

    defaultTextShiftOffset = UIManager.getInt(pp + "textShiftOffset");

    // set the following defaults on the button
    if (b.isContentAreaFilled()) {
      LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
    } else {
      LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
    }

    if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
      b.setMargin(UIManager.getInsets(pp + "margin"));
    }

    LookAndFeel.installColorsAndFont(b, pp + "background", pp + "foreground", pp + "font");
    LookAndFeel.installBorder(b, pp + "border");

    Object rollover = UIManager.get(pp + "rollover");
    if (rollover != null) {
      LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
    }

    LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
  }
示例#2
0
 /** Sets whether this JInternalFrame is to use a palette border or not */
 public void setPalette(boolean isPalette) {
   if (isPalette) {
     LookAndFeel.installBorder(frame, "InternalFrame.paletteBorder");
   } else {
     LookAndFeel.installBorder(frame, "InternalFrame.border");
   }
   titlePane.setPalette(isPalette);
 }
示例#3
0
 /**
  * Sets the frame type according to the specified type constant. This must be one of the
  * SwingConstants.
  */
 private void setFrameType(String frameType) {
   if (frameType.equals(OPTION_DIALOG)) {
     LookAndFeel.installBorder(frame, "InternalFrame.optionDialogBorder");
     titlePane.setPalette(false);
   } else if (frameType.equals(PALETTE_FRAME)) {
     LookAndFeel.installBorder(frame, "InternalFrame.paletteBorder");
     titlePane.setPalette(true);
   } else {
     LookAndFeel.installBorder(frame, "InternalFrame.border");
     titlePane.setPalette(false);
   }
 }
 protected void installDefaults() {
   LookAndFeel.installColorsAndFont(
       optionPane, "OptionPane.background", "OptionPane.foreground", "OptionPane.font");
   LookAndFeel.installBorder(optionPane, "OptionPane.border");
   minimumSize = UIManager.getDimension("OptionPane.minimumSize");
   LookAndFeel.installProperty(optionPane, "opaque", Boolean.TRUE);
 }
  /** Installs the appropriate <code>Border</code> onto the <code>JRootPane</code>. */
  void installBorder(JRootPane root) {
    int style = root.getWindowDecorationStyle();

    if (style == JRootPane.NONE) {
      LookAndFeel.uninstallBorder(root);
    } else {
      LookAndFeel.installBorder(root, borderKeys[style]);
    }
  }
 protected void installDefaults() {
   LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE);
   LookAndFeel.installBorder(progressBar, "ProgressBar.border");
   LookAndFeel.installColorsAndFont(
       progressBar, "ProgressBar.background", "ProgressBar.foreground", "ProgressBar.font");
   cellLength = UIManager.getInt("ProgressBar.cellLength");
   if (cellLength == 0) cellLength = 1;
   cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");
   selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
   selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
 }
示例#7
0
 protected void installDefaults(JPanel p) {
   LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font");
   LookAndFeel.installBorder(p, "Panel.border");
   LookAndFeel.installProperty(p, "opaque", Boolean.TRUE);
 }