Esempio n. 1
0
  void updateStyle(AbstractButton b) {
    SynthContext context = getContext(b, SynthConstants.ENABLED);
    SynthStyle oldStyle = style;
    style = SynthLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
      if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
        Insets margin = (Insets) style.get(context, getPropertyPrefix() + "margin");

        if (margin == null) {
          // Some places assume margins are non-null.
          margin = SynthLookAndFeel.EMPTY_UIRESOURCE_INSETS;
        }
        b.setMargin(margin);
      }

      Object value = style.get(context, getPropertyPrefix() + "iconTextGap");
      if (value != null) {
        LookAndFeel.installProperty(b, "iconTextGap", value);
      }

      value = style.get(context, getPropertyPrefix() + "contentAreaFilled");
      LookAndFeel.installProperty(b, "contentAreaFilled", value != null ? value : Boolean.TRUE);

      if (oldStyle != null) {
        uninstallKeyboardActions(b);
        installKeyboardActions(b);
      }
    }
  }
  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;
  }
Esempio n. 3
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);
 }
 protected void installDefaults() {
   if (desktop.getBackground() == null || desktop.getBackground() instanceof UIResource) {
     desktop.setBackground(UIManager.getColor("Desktop.background"));
   }
   LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE);
 }
Esempio n. 5
0
  /** {@inheritDoc} */
  @Override
  protected void installDefaults(AbstractButton b) {
    updateStyle(b);

    LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE);
  }