예제 #1
0
 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);
 }
예제 #2
0
  /** 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]);
    }
  }
예제 #3
0
 /**
  * A utility function that layers on top of the LookAndFeel's isSupportedLookAndFeel() method.
  * Returns true if the LookAndFeel is supported. Returns false if the LookAndFeel is not supported
  * and/or if there is any kind of error checking if the LookAndFeel is supported.
  *
  * <p>The L&F menu will use this method to detemine whether the various L&F options should be
  * active or inactive.
  */
 protected boolean isAvailableLookAndFeel(String laf) {
   try {
     Class lnfClass = Class.forName(laf);
     LookAndFeel newLAF = (LookAndFeel) (lnfClass.newInstance());
     return newLAF.isSupportedLookAndFeel();
   } catch (Exception e) { // If ANYTHING weird happens, return false
     return false;
   }
 }
 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");
 }
예제 #5
0
  /** 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 {
      root.setBorder(new RootPaneBorder());
    }
  }
예제 #6
0
 public AnimatedToolTip(JLabel label) {
   super();
   this.iconlabel = label;
   LookAndFeel.installColorsAndFont(
       iconlabel, "ToolTip.background", "ToolTip.foreground", "ToolTip.font");
   iconlabel.setOpaque(true);
   setLayout(new BorderLayout());
   add(iconlabel);
 }
예제 #7
0
 InputMap getInputMap(int condition) {
   if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
     Object[] bindings =
         (Object[]) DefaultLookup.get(optionPane, this, "OptionPane.windowBindings");
     if (bindings != null) {
       return LookAndFeel.makeComponentInputMap(optionPane, bindings);
     }
   }
   return null;
 }
  InputMap createInputMap(int condition) {
    if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
      Object[] bindings = (Object[]) DefaultLookup.get(desktop, this, "Desktop.windowBindings");

      if (bindings != null) {
        return LookAndFeel.makeComponentInputMap(desktop, bindings);
      }
    }
    return null;
  }
예제 #9
0
 protected void installDefaults(JFileChooser fc) {
   installIcons(fc);
   installStrings(fc);
   usesSingleFilePane = UIManager.getBoolean("FileChooser.usesSingleFilePane");
   readOnly = UIManager.getBoolean("FileChooser.readOnly");
   TransferHandler th = fc.getTransferHandler();
   if (th == null || th instanceof UIResource) {
     fc.setTransferHandler(defaultTransferHandler);
   }
   LookAndFeel.installProperty(fc, "opaque", Boolean.FALSE);
 }
예제 #10
0
 protected void uninstallDefaults() {
   LookAndFeel.uninstallBorder(optionPane);
 }
 protected void installDefaults() {
   if (desktop.getBackground() == null || desktop.getBackground() instanceof UIResource) {
     desktop.setBackground(UIManager.getColor("Desktop.background"));
   }
   LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE);
 }
예제 #12
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));
  }
 protected void uninstallDefaults() {
   LookAndFeel.uninstallBorder(progressBar);
 }
예제 #14
0
 protected void uninstallDefaults(JPanel p) {
   LookAndFeel.uninstallBorder(p);
 }
예제 #15
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);
 }
예제 #16
0
 /** Removes any border that may have been installed. */
 private void uninstallBorder(JRootPane root) {
   LookAndFeel.uninstallBorder(root);
 }
예제 #17
0
 protected void uninstallDefaults(AbstractButton b) {
   LookAndFeel.uninstallBorder(b);
 }