001: /*
002: * Copyright 2005 Patrick Gotthardt
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package com.pagosoft.plaf;
017:
018: import com.pagosoft.swing.ColorUtils;
019:
020: import javax.swing.*;
021: import javax.swing.plaf.*;
022: import javax.swing.plaf.metal.*;
023: import java.awt.*;
024: import java.io.IOException;
025: import java.io.InputStream;
026: import java.util.Properties;
027: import java.util.Set;
028: import java.util.Iterator;
029: import java.util.logging.Logger;
030:
031: import org.jvnet.lafplugin.PluginManager;
032: import org.jvnet.lafplugin.LafPlugin;
033: import org.jvnet.lafplugin.ComponentPluginManager;
034:
035: public class PgsLookAndFeel extends MetalLookAndFeel {
036: public static final String PLUGIN_XML = "META-INF/pgslookandfeel-plugin.xml";
037: protected static ComponentPluginManager componentPlugins;
038:
039: private static MetalTheme currentTheme;
040:
041: static {
042: loadUserSettings();
043: }
044:
045: private static Logger logger = Logger.getLogger("PgsLookAndFeel");
046:
047: protected static void loadUserSettings() {
048: InputStream in = PgsLookAndFeel.class
049: .getResourceAsStream("/pgs.properties");
050:
051: if (in != null) {
052: try {
053: logger
054: .info("Found a pgs.properties! Going to setup from pgs.properties!");
055: Properties props = new Properties();
056: props.load(in);
057:
058: PlafOptions.useShadowBorder(getPropertyBoolValue(props,
059: "pgs.shadowBorder", "false"));
060: PlafOptions.useBoldFonts(getPropertyBoolValue(props,
061: "swing.boldMetal", "false"));
062: PlafOptions.useBoldMenuFonts(getPropertyBoolValue(
063: props, "pgs.boldMenuFonts", "true"));
064: PlafOptions.useExtraMargin(getPropertyBoolValue(props,
065: "pgs.extraMargin", "true"));
066: PlafOptions.useDisabledIcon(getPropertyBoolValue(props,
067: "pgs.useDisabledIcon", "true"));
068: PlafOptions.useToolBarIcon(getPropertyBoolValue(props,
069: "pgs.useToolBarIcon", "true"));
070: PlafOptions
071: .setAntialiasingEnabled(getPropertyBoolValue(
072: props, "pgs.aaEnabled", "false"));
073: PlafOptions.setClearBorderEnabled(getPropertyBoolValue(
074: props, "pgs.clearBorderEnabled", "false"));
075: PlafOptions
076: .setFixHtmlDisplayEnabled(getPropertyBoolValue(
077: props, "pgs.fixHtmlDisplayEnabled",
078: "true"));
079: PlafOptions
080: .setWheelTabbedPaneEnabled(getPropertyBoolValue(
081: props, "pgs.wheelTabEnabled", "true"));
082: PlafOptions
083: .setTabbedPaneRightClickSelectionEnabled(getPropertyBoolValue(
084: props,
085: "pgs.tabbedPaneRightClickSelectionEnabled",
086: "false"));
087: PlafOptions
088: .setTabReorderingEnabled(getPropertyBoolValue(
089: props, "pgs.tabReorderingEnabled",
090: "false"));
091: PlafOptions
092: .setPaintRolloverButtonBorder(getPropertyBoolValue(
093: props, "pgs.paintRolloverButtonBorder",
094: "true"));
095: PlafOptions
096: .setOfficeScrollBarEnabled(getPropertyBoolValue(
097: props, "pgs.officeScrollBarEnabled",
098: "false"));
099: PlafOptions.setVistaStyle(getPropertyBoolValue(props,
100: "pgs.vistaStyle", "false"));
101:
102: PlafOptions.setStyle(PlafOptions.MENUBAR,
103: getPropertyStyleValue(props,
104: "pgs.style.menuBar", "flat"));
105: PlafOptions.setStyle(PlafOptions.MENU_ITEM,
106: getPropertyStyleValue(props,
107: "pgs.style.menuitem", "flat"));
108: PlafOptions.setStyle(PlafOptions.MENUBARMENU,
109: getPropertyStyleValue(props,
110: "pgs.style.menuBarMenu", "flat"));
111: PlafOptions.setStyle(PlafOptions.TOOLBAR,
112: getPropertyStyleValue(props,
113: "pgs.style.toolBar", "gradient"));
114: PlafOptions.setStyle(PlafOptions.TOOLBARBUTTON,
115: getPropertyStyleValue(props,
116: "pgs.style.toolBarButton", "gradient"));
117: PlafOptions.setStyle(PlafOptions.BUTTON,
118: getPropertyStyleValue(props,
119: "pgs.style.button", "gradient"));
120:
121: PgsTheme theme = ThemeFactory.createTheme(props);
122:
123: if (theme != null) {
124: setCurrentTheme(theme);
125: } else {
126: logger
127: .warning("Could not create theme from pgs.properties");
128: }
129: logger.info("pgs.properties have been loaded.");
130: } catch (IOException ex) {
131: logger
132: .warning("Unexpected exception happened while loading properties: "
133: + ex.toString());
134: }
135: }
136: }
137:
138: private static boolean getPropertyBoolValue(Properties props,
139: String key, String def) {
140: return "true".equals(props.getProperty(key, def).trim()
141: .toLowerCase());
142: }
143:
144: private static int getPropertyStyleValue(Properties props,
145: String key, String def) {
146: return "flat".equals(props.getProperty(key, def).trim()
147: .toLowerCase()) ? PlafOptions.FLAT_STYLE
148: : PlafOptions.GRADIENT_STYLE;
149: }
150:
151: public PgsLookAndFeel() {
152: super ();
153: UIManager.put("swing.boldMetal",
154: PlafOptions.useBoldFonts() ? Boolean.TRUE
155: : Boolean.FALSE);
156: }
157:
158: public void initialize() {
159: super .initialize();
160: componentPlugins = new ComponentPluginManager(PLUGIN_XML);
161:
162: MetalLookAndFeel.setCurrentTheme(getCurrentTheme());
163: componentPlugins.initializeAll();
164: }
165:
166: public static void setAsLookAndFeel() {
167: try {
168: UIManager
169: .setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel");
170: } catch (Exception e) {
171: e.printStackTrace();
172: }
173: }
174:
175: public static void updateAllUIs() {
176: Frame[] frames = Frame.getFrames();
177: for (int i = 0; i < frames.length; i++) {
178: if (frames[i] instanceof JFrame) {
179: SwingUtilities.updateComponentTreeUI(frames[i]);
180: }
181: }
182: }
183:
184: public static void setCurrentTheme(MetalTheme theme) {
185: if (theme == null) {
186: throw new IllegalArgumentException(
187: "theme must not be null!");
188: }
189: currentTheme = theme;
190: MetalLookAndFeel.setCurrentTheme(theme);
191: }
192:
193: public static MetalTheme getCurrentTheme() {
194: if (currentTheme == null) {
195: String theme = null;
196: try {
197: theme = System.getProperty("pgs.theme");
198: } catch (Exception e) {
199: logger
200: .warning("Could not read system property 'pgs.theme'");
201: }
202: if (theme == null) {
203: currentTheme = ThemeFactory.getDefaultTheme();
204: } else {
205: currentTheme = ThemeFactory.getTheme(theme);
206: }
207: }
208: return currentTheme;
209: }
210:
211: public String getID() {
212: return "com.pagosoft.plaf.PgsLookAndFeel";
213: }
214:
215: public String getName() {
216: return "PgsLookAndFeel";
217: }
218:
219: public String getDescription() {
220: return "Much like the original MetalLookAndFeel, but with gradients on menus, buttons, etc.";
221: }
222:
223: public boolean isNativeLookAndFeel() {
224: return false;
225: }
226:
227: public boolean isSupportedLookAndFeel() {
228: return true;
229: }
230:
231: protected void initClassDefaults(UIDefaults table) {
232: super .initClassDefaults(table);
233: String prefix = "com.pagosoft.plaf.Pgs";
234: Object[] def = { "ButtonUI", prefix + "ButtonUI",
235: "ToggleButtonUI", prefix + "ToggleButtonUI",
236: "CheckBoxUI", prefix + "CheckBoxUI", "RadioButtonUI",
237: prefix + "RadioButtonUI", "ComboBoxUI",
238: prefix + "ComboBoxUI", "ToolBarUI",
239: prefix + "ToolBarUI", "MenuUI", prefix + "MenuUI",
240: "MenuBarUI", prefix + "MenuBarUI", "MenuItemUI",
241: prefix + "MenuItemUI", "CheckBoxMenuItemUI",
242: prefix + "CheckBoxMenuItemUI", "RadioButtonMenuItemUI",
243: prefix + "RadioButtonMenuItemUI", "TabbedPaneUI",
244: prefix + "TabbedPaneUI", "ProgressBarUI",
245: prefix + "ProgressBarUI", "ScrollBarUI",
246: prefix + "ScrollBarUI", "SplitPaneUI",
247: prefix + "SplitPaneUI", "LabelUI", prefix + "LabelUI",
248: "TextFieldUI", prefix + "TextFieldUI", "ToolTipUI",
249: prefix + "ToolTipUI", "EditorPaneUI",
250: prefix + "EditorPaneUI", "FormattedTextFieldUI",
251: prefix + "FormattedTextFieldUI", "PasswordFieldUI",
252: prefix + "PasswordFieldUI", "TextAreaUI",
253: prefix + "TextAreaUI", "ScrollPaneUI",
254: prefix + "ScrollPaneUI" };
255: table.putDefaults(def);
256: }
257:
258: protected void initComponentDefaults(UIDefaults table) {
259: super .initComponentDefaults(table);
260: // Get the MetalTheme
261: MetalTheme theme = getCurrentTheme();
262: // Often used objects
263: Insets menuInsets = new InsetsUIResource(0, 2, 0, 3);
264: Insets buttonMargin = PlafOptions.useExtraMargin() ? new InsetsUIResource(
265: 1, 14, 1, 14)
266: : new InsetsUIResource(1, 4, 1, 4);
267: Color gradientStart = ColorUtils.getSimiliarColor(theme
268: .getControl(), 1.4f); // was: theme.getControlHighlight()
269: Color gradientEnd = ColorUtils.getSimiliarColor(theme
270: .getControl(), 0.9f); // was: theme.getControlShadow()
271: Color specialGradientStart = ColorUtils.getSimiliarColor(theme
272: .getPrimaryControlShadow(), 1.4f);
273: Color specialGradientEnd = ColorUtils.getSimiliarColor(theme
274: .getPrimaryControlShadow(), 0.9f);
275:
276: Object[] uiDefaults = {
277: "glow",
278: ColorUtils.getTranslucentColor(theme
279: .getPrimaryControl(), 175),
280:
281: "Button.border",
282: PgsBorders.getButtonBorder(),
283: "Button.margin",
284: buttonMargin,
285: "Button.rolloverBackground",
286: theme.getControlShadow(),
287: "Button.isFlat",
288: PlafOptions.isFlat("Button"),
289: "Button.gradientStart",
290: gradientStart,
291: "Button.gradientEnd",
292: gradientEnd,
293: "Button.rolloverGradientStart",
294: gradientStart,
295: "Button.rolloverGradientEnd",
296: gradientEnd,
297: "Button.selectedGradientStart",
298: gradientEnd,
299: "Button.selectedGradientEnd",
300: gradientStart,
301: "Button.rolloverVistaStyle",
302: Boolean.FALSE,
303:
304: "ToggleButton.border",
305: PgsBorders.getButtonBorder(),
306: "ToggleButton.margin",
307: buttonMargin,
308: "ToggleButton.rolloverBackground",
309: theme.getControlShadow(),
310: "ToggleButton.isFlat",
311: PlafOptions.isFlat("Button"),
312: "ToggleButton.gradientStart",
313: gradientStart,
314: "ToggleButton.gradientEnd",
315: gradientEnd,
316: "ToggleButton.rolloverGradientStart",
317: gradientStart,
318: "ToggleButton.rolloverGradientEnd",
319: gradientEnd,
320: "ToggleButton.selectedGradientStart",
321: ColorUtils.getSimiliarColor(theme.getControl(), 0.5f),
322: "ToggleButton.selectedGradientEnd",
323: ColorUtils.getSimiliarColor(theme.getControl(), 0.9f),
324:
325: "RadioButton.border",
326: PgsBorders.getButtonBorder(),
327: "RadioButton.icon",
328: PgsIconFactory.getRadioButtonIcon(),
329:
330: "CheckBox.border",
331: PgsBorders.getButtonBorder(),
332: "CheckBox.icon",
333: PgsIconFactory.getCheckBoxIcon(),
334:
335: "TabbedPane.tabGradientStart",
336: gradientStart,
337: "TabbedPane.tabGradientEnd",
338: gradientEnd,
339: "TabbedPane.focusPainted",
340: Boolean.FALSE,
341: "TabbedPane.buttonStyle.background",
342: theme.getControl(),
343: "TabbedPane.buttonStyle.selectedBackground",
344: new ColorUIResource(ColorUtils.getTranslucentColor(
345: theme.getPrimaryControlDarkShadow(), 100)),
346: //new ColorUIResource(new Color(theme.getPrimaryControlDarkShadow().getRed(), theme.getPrimaryControlDarkShadow().getGreen(), theme.getPrimaryControlDarkShadow().getBlue(), 100)),
347: "TabbedPane.buttonStyle.rolloverBackground",
348: new ColorUIResource(ColorUtils.getTranslucentColor(
349: theme.getPrimaryControlShadow(), 100)),
350: //new ColorUIResource(new Color(theme.getPrimaryControlShadow().getRed(), theme.getPrimaryControlShadow().getGreen(), theme.getPrimaryControlShadow().getBlue(), 100)),
351: "TabbedPane.buttonStyle.selectedBorder",
352: theme.getPrimaryControlDarkShadow(),
353: "TabbedPane.buttonStyle.rolloverBorder",
354: theme.getPrimaryControlDarkShadow(),
355:
356: "ToolBar.gradientStart",
357: gradientStart,
358: "ToolBar.gradientEnd",
359: gradientEnd,
360: "ToolBar.border",
361: PgsBorders.getToolBarBorder(),
362: "ToolBar.borderColor",
363: theme.getControlShadow(),
364:
365: "ToolBarButton.margin",
366: new InsetsUIResource(3, 3, 3, 3),
367: "ToolBarButton.rolloverBackground",
368: theme.getPrimaryControl(),
369: "ToolBarButton.rolloverBorderColor",
370: theme.getPrimaryControlDarkShadow(),
371: "ToolBarButton.isFlat",
372: PlafOptions.isFlat("ToolBarButton"),
373: "ToolBarButton.gradientStart",
374: gradientStart,
375: "ToolBarButton.gradientEnd",
376: gradientEnd,
377: "ToolBarButton.rolloverGradientStart",
378: specialGradientStart,//theme.getPrimaryControl(),
379: "ToolBarButton.rolloverGradientEnd",
380: specialGradientEnd,//theme.getPrimaryControlShadow(),
381: "ToolBarButton.selectedGradientStart",
382: specialGradientEnd, //theme.getPrimaryControl(),
383: "ToolBarButton.selectedGradientEnd",
384: specialGradientStart, //theme.getPrimaryControlDarkShadow(),
385:
386: "ComboBox.border",
387: PgsBorders.getComponentBorder(),
388: "ComboBox.editorBorder",
389: null,
390: "ComboBox.selectionBackground",
391: theme.getPrimaryControl(),
392:
393: "Menu.submenuPopupOffsetX",
394: new Integer(0),
395: "Menu.selectionBackground",
396: theme.getPrimaryControl(),
397: "Menu.selectedBorderMargin",
398: menuInsets,
399: "Menu.selectedBorderColor",
400: theme.getPrimaryControlDarkShadow(),
401: "Menu.gradientStart",
402: specialGradientStart, //theme.getPrimaryControl(),
403: "Menu.gradientEnd",
404: specialGradientEnd, //theme.getPrimaryControlDarkShadow(),
405: "Menu.borderPainted",
406: Boolean.FALSE,
407:
408: "MenuItem.selectionBackground",
409: theme.getPrimaryControl(),
410: "MenuItem.selectedBorderMargin",
411: menuInsets,
412: "MenuItem.selectedBorderColor",
413: theme.getPrimaryControlDarkShadow(),
414: "MenuItem.gradientStart",
415: specialGradientStart, //theme.getPrimaryControl(),
416: "MenuItem.gradientEnd",
417: specialGradientEnd, //theme.getPrimaryControlDarkShadow(),
418: "MenuItem.isFlat",
419: PlafOptions.isFlat("MenuItem"),
420: "MenuItem.borderPainted",
421: Boolean.FALSE,
422:
423: "CheckBoxMenuItem.selectionBackground",
424: theme.getPrimaryControl(),
425: "CheckBoxMenuItem.selectedBorderMargin",
426: menuInsets,
427: "CheckBoxMenuItem.selectedBorderColor",
428: theme.getPrimaryControlDarkShadow(),
429: "CheckBoxMenuItem.gradientStart",
430: specialGradientStart, //theme.getPrimaryControl(),
431: "CheckBoxMenuItem.gradientEnd",
432: specialGradientEnd, //theme.getPrimaryControlDarkShadow(),
433: "CheckBoxMenuItem.isFlat",
434: PlafOptions.isFlat("MenuItem"),
435: "CheckBoxMenuItem.borderPainted",
436: Boolean.FALSE,
437: "CheckBoxMenuItem.checkIcon",
438: PgsIconFactory.getCheckBoxMenuItemIcon(),
439:
440: "RadioButtonMenuItem.selectionBackground",
441: theme.getPrimaryControl(),
442: "RadioButtonMenuItem.selectedBorderMargin",
443: menuInsets,
444: "RadioButtonMenuItem.selectedBorderColor",
445: theme.getPrimaryControlDarkShadow(),
446: "RadioButtonMenuItem.gradientStart",
447: specialGradientStart, //theme.getPrimaryControl(),
448: "RadioButtonMenuItem.gradientEnd",
449: specialGradientEnd, //theme.getPrimaryControlDarkShadow(),
450: "RadioButtonMenuItem.isFlat",
451: PlafOptions.isFlat("MenuItem"),
452: "RadioButtonMenuItem.borderPainted",
453: Boolean.FALSE,
454: "RadioButtonMenuItem.checkIcon",
455: PgsIconFactory.getRadioButtonMenuItemIcon(),
456:
457: "MenuBar.isFlat",
458: PlafOptions.isFlat("MenuBar"),
459: "MenuBar.gradientStart",
460: gradientStart,
461: "MenuBar.gradientEnd",
462: gradientEnd,
463:
464: "MenuBarMenu.isFlat",
465: PlafOptions.isFlat("MenuBarMenu"),
466: "MenuBarMenu.foreground",
467: theme.getMenuForeground(),
468: "MenuBarMenu.rolloverBorderColor",
469: theme.getControlTextColor(),
470: "MenuBarMenu.selectedBorderColor",
471: theme.getPrimaryControlDarkShadow(),
472: "MenuBarMenu.rolloverBackground",
473: theme.getControlShadow(),
474: "MenuBarMenu.selectedBackground",
475: theme.getPrimaryControl(),
476: "MenuBarMenu.rolloverBackgroundGradientStart",
477: specialGradientStart, //theme.getPrimaryControl(),
478: "MenuBarMenu.rolloverBackground.gradientStart",
479: specialGradientStart,
480: "MenuBarMenu.rolloverBackgroundGradientEnd",
481: specialGradientEnd, //theme.getPrimaryControlDarkShadow(),
482: "MenuBarMenu.rolloverBackground.gradientEnd",
483: specialGradientEnd,
484: "MenuBarMenu.selectedBackgroundGradientStart",
485: specialGradientEnd,//theme.getPrimaryControlDarkShadow(),
486: "MenuBarMenu.selectedBackgroundGradientEnd",
487: specialGradientStart, //theme.getPrimaryControl(),
488: "MenuBarMenu.selectedBackground.gradientStart",
489: specialGradientEnd,
490: //theme.getPrimaryControlDarkShadow(),
491: "MenuBarMenu.selectedBackground.gradientEnd",
492: specialGradientStart, //theme.getPrimaryControl(),
493:
494: "ProgressBar.border",
495: PgsBorders.getComponentBorder(),
496: "ProgressBar.gradientStart",
497: gradientStart, //theme.getControl(),
498: "ProgressBar.gradientEnd",
499: gradientEnd, //theme.getControlShadow(),
500: "ProgressBar.innerGradientStart",
501: specialGradientStart, //theme.getPrimaryControl(),
502: "ProgressBar.innerGradientEnd",
503: specialGradientEnd, //theme.getPrimaryControlShadow(),
504: "ProgressBar.innerDisabledGradientStart",
505: gradientStart, //theme.getControl(),
506: "ProgressBar.innerDisabledGradientEnd",
507: gradientEnd, //theme.getControlShadow(),
508: "ProgressBar.innerBorderColor",
509: theme.getPrimaryControlDarkShadow(),
510: "ProgressBar.innerDisabledBorderColor",
511: theme.getControlDarkShadow(),
512:
513: "ScrollBar.track",
514: theme.getControlShadow(),
515: "ScrollBar.trackHighlight",
516: theme.getControl(),
517:
518: "TextField.border",
519: PgsBorders.getTextFieldBorder(),
520: "TextField.margin",
521: new InsetsUIResource(2, 2, 2, 2),//new InsetsUIResource(0, 4, 0, 4),
522:
523: "FormattedTextField.border",
524: PgsBorders.getTextFieldBorder(),
525: "FormattedTextField.margin",
526: new InsetsUIResource(2, 2, 2, 2),
527: "PasswordField.border",
528: PgsBorders.getTextFieldBorder(),
529: "PasswordField.margin",
530: new InsetsUIResource(2, 2, 2, 2),
531: //"TextArea.border", PgsBorders.getTextFieldBorder(),
532: "TextArea.margin", new InsetsUIResource(2, 2, 2, 2),
533: "EditorPane.border", PgsBorders.getTextFieldBorder(),
534: "EditorPane.margin", new InsetsUIResource(2, 2, 2, 2),
535: "TextPane.border", PgsBorders.getTextFieldBorder(),
536: "TextPane.margin", new InsetsUIResource(2, 2, 2, 2),
537:
538: "Table.scrollPaneBorder",
539: PgsBorders.getComponentBorder(),
540:
541: "TabbedPane.background",
542: PgsLookAndFeel.getControlShadow(), "SplitPane.border",
543: null, "SplitPaneDivider.border", null,
544:
545: "OptionPane.errorIcon",
546: makeIcon(getClass(), "icons/Error.png"),
547: "OptionPane.informationIcon",
548: makeIcon(getClass(), "icons/Inform.png"),
549: "OptionPane.warningIcon",
550: makeIcon(getClass(), "icons/Warn.png"),
551: "OptionPane.questionIcon",
552: makeIcon(getClass(), "icons/Question.png"),
553:
554: "FileView.computerIcon",
555: makeIcon(getClass(), "icons/Computer.png"),
556: "FileView.directoryIcon",
557: makeIcon(getClass(), "icons/TreeClosed.png"),
558: "FileView.fileIcon",
559: makeIcon(getClass(), "icons/File.png"),
560: "FileView.floppyDriveIcon",
561: makeIcon(getClass(), "icons/FloppyDrive.png"),
562: "FileView.hardDriveIcon",
563: makeIcon(getClass(), "icons/HardDrive.png"),
564: "FileChooser.homeFolderIcon",
565: makeIcon(getClass(), "icons/HomeFolder.png"),
566: "FileChooser.newFolderIcon",
567: makeIcon(getClass(), "icons/NewFolder.png"),
568: "FileChooser.upFolderIcon",
569: makeIcon(getClass(), "icons/UpFolder.png"),
570:
571: "Tree.closedIcon",
572: makeIcon(getClass(), "icons/TreeClosed.png"),
573: "Tree.openIcon",
574: makeIcon(getClass(), "icons/TreeOpen.png"),
575: "Tree.leafIcon",
576: makeIcon(getClass(), "icons/TreeLeaf.png") };
577: table.putDefaults(uiDefaults);
578: componentPlugins.processAllDefaultsEntries(table, theme);
579: }
580:
581: public Icon getDisabledSelectedIcon(JComponent component, Icon icon) {
582: if ((icon instanceof ImageIcon)) {
583: return PgsUtils.getDisabledButtonIcon(((ImageIcon) icon)
584: .getImage());
585: }
586: return null;
587: }
588:
589: public static Color getGlow() {
590: return UIManager.getColor("glow");
591: }
592: }
|