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); } } }
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 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); }
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() { 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"); }
protected void installListeners() { super.installListeners(); handler = new AquaFocusHandler(); final JTextComponent c = getComponent(); c.addFocusListener(handler); c.addPropertyChangeListener(handler); LookAndFeel.installProperty(c, "opaque", UIManager.getBoolean(getPropertyPrefix() + "opaque")); AquaUtilControlSize.addSizePropertyListener(c); AquaTextFieldSearch.installSearchFieldListener(c); }
protected void installDefaults() { if (desktop.getBackground() == null || desktop.getBackground() instanceof UIResource) { desktop.setBackground(UIManager.getColor("Desktop.background")); } LookAndFeel.installProperty(desktop, "opaque", Boolean.TRUE); }
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); }
/** {@inheritDoc} */ @Override protected void installDefaults(AbstractButton b) { updateStyle(b); LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE); }