001: package org.jvnet.substance.netbeans;
002:
003: import java.awt.Color;
004:
005: import javax.swing.BorderFactory;
006: import javax.swing.UIManager;
007: import javax.swing.border.Border;
008: import javax.swing.border.EmptyBorder;
009: import javax.swing.plaf.BorderUIResource;
010: import org.jvnet.substance.SubstanceLookAndFeel;
011: import org.jvnet.substance.baseline.SubstanceBaseline;
012: import org.netbeans.swing.plaf.LFCustoms;
013: import org.openide.util.Utilities;
014:
015: /**
016: * LAF custom values for NetBeans components. This class is based on code from
017: * <code>org.netbeans.swing.plaf.metal.MetalLFCustoms</code> from NetBeans
018: * source base.
019: *
020: * @author Kirill Grouchnikov
021: */
022: public class SubstanceLFCustoms extends LFCustoms {
023:
024: /*
025: * (non-Javadoc)
026: *
027: * @see org.netbeans.swing.plaf.LFCustoms#createLookAndFeelCustomizationKeysAndValues()
028: */
029: public Object[] createLookAndFeelCustomizationKeysAndValues() {
030: Object[] result = {};
031: return result;
032: }
033:
034: /*
035: * (non-Javadoc)
036: *
037: * @see org.netbeans.swing.plaf.LFCustoms#createApplicationSpecificKeysAndValues()
038: */
039: public Object[] createApplicationSpecificKeysAndValues() {
040: Color unfocusedSelBg = UIManager.getColor("controlShadow");
041: if (!Color.WHITE.equals(unfocusedSelBg.brighter())) { // #57145
042: unfocusedSelBg = unfocusedSelBg.brighter();
043: }
044:
045: Border empty = new BorderUIResource(BorderFactory
046: .createEmptyBorder());
047: Border line = new BorderUIResource(BorderFactory
048: .createLineBorder(SubstanceLookAndFeel
049: .getActiveColorScheme().getUltraLightColor()));
050: Object[] result = {
051: DESKTOP_BORDER,
052: new EmptyBorder(1, 1, 1, 1),
053: SCROLLPANE_BORDER,
054: empty,
055: EXPLORER_STATUS_BORDER,
056: line,
057: EDITOR_STATUS_LEFT_BORDER,
058: line,
059: EDITOR_STATUS_RIGHT_BORDER,
060: line,
061: EDITOR_STATUS_INNER_BORDER,
062: line,
063: EDITOR_STATUS_ONLYONEBORDER,
064: line,
065: EDITOR_TOOLBAR_BORDER,
066: BorderFactory.createEmptyBorder(5, 5, 5, 5),
067:
068: // UI Delegates for the tab control
069: EDITOR_TAB_DISPLAYER_UI,
070: "org.jvnet.substance.netbeans.SubstanceEditorTabDisplayerUI",
071: VIEW_TAB_DISPLAYER_UI,
072: "org.jvnet.substance.netbeans.SubstanceViewTabDisplayerUI",
073: SLIDING_BUTTON_UI,
074: "org.jvnet.substance.netbeans.SubstanceSlidingButtonUI",
075: "ButtonUI",
076: "org.jvnet.substance.netbeans.NetbeansSubstanceButtonUI",
077: "ToggleButtonUI",
078: "org.jvnet.substance.netbeans.NetbeansSubstanceToggleButtonUI",
079:
080: EDITOR_TAB_OUTER_BORDER,
081: empty,
082: VIEW_TAB_OUTER_BORDER,
083: empty,
084:
085: // #48951 invisible unfocused selection background in Metal L&F
086: "nb.explorer.unfocusedSelBg",
087: unfocusedSelBg,
088:
089: PROGRESS_CANCEL_BUTTON_ICON,
090: Utilities
091: .loadImage("org/netbeans/swing/plaf/resources/cancel_task_win_linux_mac.png"),
092:
093: // progress component related
094: "nbProgressBar.Foreground", new Color(49, 106, 197),
095: "nbProgressBar.Background", Color.WHITE,
096: "nbProgressBar.popupDynaText.foreground",
097: new Color(141, 136, 122),
098: "nbProgressBar.popupText.background",
099: new Color(249, 249, 249),
100: "nbProgressBar.popupText.foreground",
101: UIManager.getColor("TextField.foreground"),
102: "nbProgressBar.popupText.selectBackground",
103: UIManager.getColor("List.selectionBackground"),
104: "nbProgressBar.popupText.selectForeground",
105: UIManager.getColor("List.selectionForeground"),
106:
107: "Baseline.instance", new SubstanceBaseline(),
108:
109: }; // NOI18N
110: return result;
111: }
112: }
|