Search in sources :

Example 26 with ColorUIResource

use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.

the class ColorCustomizationTest method testOverrides.

void testOverrides() {
    Color defaultColor = label.getBackground();
    // override default background
    UIDefaults defs = new UIDefaults();
    defs.put("Label.background", new ColorUIResource(Color.RED));
    label.putClientProperty("Nimbus.Overrides", defs);
    check(Color.RED);
    // change overriding color
    defs = new UIDefaults();
    defs.put("Label.background", new ColorUIResource(Color.GREEN));
    label.putClientProperty("Nimbus.Overrides", defs);
    check(Color.GREEN);
    // remove override
    label.putClientProperty("Nimbus.Overrides", null);
    check(defaultColor);
}
Also used : UIDefaults(javax.swing.UIDefaults) Color(java.awt.Color) ColorUIResource(javax.swing.plaf.ColorUIResource)

Example 27 with ColorUIResource

use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.

the class ColorCustomizationTest method testInheritance.

void testInheritance() {
    Color defaultColor = label.getBackground();
    // more specific setting is in global defaults
    UIManager.put("Label[Enabled].background", new ColorUIResource(Color.RED));
    // less specific one is in overrides
    UIDefaults defs = new UIDefaults();
    defs.put("Label.background", new ColorUIResource(Color.GREEN));
    // global wins
    label.putClientProperty("Nimbus.Overrides", defs);
    check(Color.RED);
    // now override wins
    label.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
    check(Color.GREEN);
    // global is back
    label.putClientProperty("Nimbus.Overrides.InheritDefaults", true);
    check(Color.RED);
    // back to default color
    UIManager.put("Label[Enabled].background", null);
    label.putClientProperty("Nimbus.Overrides.InheritDefaults", false);
    label.putClientProperty("Nimbus.Overrides", null);
    check(defaultColor);
}
Also used : UIDefaults(javax.swing.UIDefaults) Color(java.awt.Color) ColorUIResource(javax.swing.plaf.ColorUIResource)

Example 28 with ColorUIResource

use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.

the class Metacity method parseColorString.

private static Color parseColorString(String str) {
    if (str.charAt(0) == '#') {
        str = str.substring(1);
        int i = str.length();
        if (i < 3 || i > 12 || (i % 3) != 0) {
            return null;
        }
        i /= 3;
        int r;
        int g;
        int b;
        try {
            r = Integer.parseInt(str.substring(0, i), 16);
            g = Integer.parseInt(str.substring(i, i * 2), 16);
            b = Integer.parseInt(str.substring(i * 2, i * 3), 16);
        } catch (NumberFormatException nfe) {
            return null;
        }
        if (i == 4) {
            return new ColorUIResource(r / 65535.0f, g / 65535.0f, b / 65535.0f);
        } else if (i == 1) {
            return new ColorUIResource(r / 15.0f, g / 15.0f, b / 15.0f);
        } else if (i == 2) {
            return new ColorUIResource(r, g, b);
        } else {
            return new ColorUIResource(r / 4095.0f, g / 4095.0f, b / 4095.0f);
        }
    } else {
        return XColors.lookupColor(str);
    }
}
Also used : ColorUIResource(javax.swing.plaf.ColorUIResource)

Example 29 with ColorUIResource

use of javax.swing.plaf.ColorUIResource in project jdk8u_jdk by JetBrains.

the class SynthParser method startColor.

private void startColor(Attributes attributes) throws SAXException {
    Color color = null;
    String id = null;
    _colorTypes.clear();
    for (int i = attributes.getLength() - 1; i >= 0; i--) {
        String key = attributes.getQName(i);
        if (key.equals(ATTRIBUTE_ID)) {
            id = attributes.getValue(i);
        } else if (key.equals(ATTRIBUTE_IDREF)) {
            color = (Color) lookup(attributes.getValue(i), Color.class);
        } else if (key.equals(ATTRIBUTE_NAME)) {
        } else if (key.equals(ATTRIBUTE_VALUE)) {
            String value = attributes.getValue(i);
            if (value.startsWith("#")) {
                try {
                    int argb;
                    boolean hasAlpha;
                    int length = value.length();
                    if (length < 8) {
                        // Just RGB, or some portion of it.
                        argb = Integer.decode(value);
                        hasAlpha = false;
                    } else if (length == 8) {
                        // Single character alpha: #ARRGGBB.
                        argb = Integer.decode(value);
                        hasAlpha = true;
                    } else if (length == 9) {
                        // Color has alpha and is of the form
                        // #AARRGGBB.
                        // The following split decoding is mandatory due to
                        // Integer.decode() behavior which won't decode
                        // hexadecimal values higher than #7FFFFFFF.
                        // Thus, when an alpha channel is detected, it is
                        // decoded separately from the RGB channels.
                        int rgb = Integer.decode('#' + value.substring(3, 9));
                        int a = Integer.decode(value.substring(0, 3));
                        argb = (a << 24) | rgb;
                        hasAlpha = true;
                    } else {
                        throw new SAXException("Invalid Color value: " + value);
                    }
                    color = new ColorUIResource(new Color(argb, hasAlpha));
                } catch (NumberFormatException nfe) {
                    throw new SAXException("Invalid Color value: " + value);
                }
            } else {
                try {
                    color = new ColorUIResource((Color) Color.class.getField(value.toUpperCase()).get(Color.class));
                } catch (NoSuchFieldException nsfe) {
                    throw new SAXException("Invalid color name: " + value);
                } catch (IllegalAccessException iae) {
                    throw new SAXException("Invalid color name: " + value);
                }
            }
        } else if (key.equals(ATTRIBUTE_TYPE)) {
            StringTokenizer tokenizer = new StringTokenizer(attributes.getValue(i));
            while (tokenizer.hasMoreTokens()) {
                String typeName = tokenizer.nextToken();
                int classIndex = typeName.lastIndexOf('.');
                Class typeClass;
                if (classIndex == -1) {
                    typeClass = ColorType.class;
                    classIndex = 0;
                } else {
                    try {
                        typeClass = ReflectUtil.forName(typeName.substring(0, classIndex));
                    } catch (ClassNotFoundException cnfe) {
                        throw new SAXException("Unknown class: " + typeName.substring(0, classIndex));
                    }
                    classIndex++;
                }
                try {
                    _colorTypes.add((ColorType) checkCast(typeClass.getField(typeName.substring(classIndex)).get(typeClass), ColorType.class));
                } catch (NoSuchFieldException nsfe) {
                    throw new SAXException("Unable to find color type: " + typeName);
                } catch (IllegalAccessException iae) {
                    throw new SAXException("Unable to find color type: " + typeName);
                }
            }
        }
    }
    if (color == null) {
        throw new SAXException("color: you must specificy a value");
    }
    register(id, color);
    if (_stateInfo != null && _colorTypes.size() > 0) {
        Color[] colors = _stateInfo.getColors();
        int max = 0;
        for (int counter = _colorTypes.size() - 1; counter >= 0; counter--) {
            max = Math.max(max, _colorTypes.get(counter).getID());
        }
        if (colors == null || colors.length <= max) {
            Color[] newColors = new Color[max + 1];
            if (colors != null) {
                System.arraycopy(colors, 0, newColors, 0, colors.length);
            }
            colors = newColors;
        }
        for (int counter = _colorTypes.size() - 1; counter >= 0; counter--) {
            colors[_colorTypes.get(counter).getID()] = color;
        }
        _stateInfo.setColors(colors);
    }
}
Also used : StringTokenizer(java.util.StringTokenizer) Color(java.awt.Color) ColorUIResource(javax.swing.plaf.ColorUIResource) SAXException(org.xml.sax.SAXException)

Example 30 with ColorUIResource

use of javax.swing.plaf.ColorUIResource in project frostwire by frostwire.

the class ThemeMediator method modifyNimbusDefaults.

private static UIDefaults modifyNimbusDefaults(UIDefaults defaults) {
    defaults.put("control", SkinColors.LIGHT_BACKGROUND_COLOR);
    // defaults.put("nimbusBase", new Color(SkinColors.GENERAL_BORDER_COLOR.getRGB()));
    defaults.put("nimbusSelection", SkinColors.TABLE_SELECTED_BACKGROUND_ROW_COLOR);
    // font color
    defaults.put("text", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("controlText", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("infoText", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("menuText", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("textForeground", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    FontUIResource font = getControlFont();
    if (font != null) {
        defaults.put("defaultFont", font);
    }
    defaults.put("Panel.background", SkinColors.LIGHT_BACKGROUND_COLOR);
    // progressbar
    int paddingEnabled = defaults.getInt("ProgressBar[Enabled+Indeterminate].progressPadding");
    int paddingDisabled = defaults.getInt("ProgressBar[Disabled+Indeterminate].progressPadding");
    defaults.put("ProgressBar[Enabled].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.Enabled, paddingEnabled));
    defaults.put("ProgressBar[Enabled+Finished].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.Enabled, paddingEnabled));
    defaults.put("ProgressBar[Enabled+Indeterminate].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.EnabledIndeterminate, paddingEnabled));
    defaults.put("ProgressBar[Disabled].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.Disabled, paddingDisabled));
    defaults.put("ProgressBar[Disabled+Finished].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.Disabled, paddingDisabled));
    defaults.put("ProgressBar[Disabled+Indeterminate].foregroundPainter", new SkinProgressBarPainter(SkinProgressBarPainter.State.DisabledIndeterminate, paddingDisabled));
    // scrollbar
    defaults.put("ScrollBar:\"ScrollBar.button\".size", 18);
    defaults.put("ScrollBar:\"ScrollBar.button\"[Disabled].foregroundPainter", new SkinScrollBarButtonPainter(SkinScrollBarButtonPainter.State.Disabled));
    defaults.put("ScrollBar:\"ScrollBar.button\"[Enabled].foregroundPainter", new SkinScrollBarButtonPainter(SkinScrollBarButtonPainter.State.Enabled));
    defaults.put("ScrollBar:\"ScrollBar.button\"[MouseOver].foregroundPainter", new SkinScrollBarButtonPainter(SkinScrollBarButtonPainter.State.MouseOver));
    defaults.put("ScrollBar:\"ScrollBar.button\"[Pressed].foregroundPainter", new SkinScrollBarButtonPainter(SkinScrollBarButtonPainter.State.Pressed));
    defaults.put("ScrollBar:ScrollBarTrack[Disabled].backgroundPainter", new SkinScrollBarTrackPainter(SkinScrollBarTrackPainter.State.Disabled));
    defaults.put("ScrollBar:ScrollBarTrack[Enabled].backgroundPainter", new SkinScrollBarTrackPainter(SkinScrollBarTrackPainter.State.Enabled));
    defaults.put("ScrollBar:ScrollBarThumb[Enabled].backgroundPainter", new SkinScrollBarThumbPainter(SkinScrollBarThumbPainter.State.Enabled));
    defaults.put("ScrollBar:ScrollBarThumb[MouseOver].backgroundPainter", new SkinScrollBarThumbPainter(SkinScrollBarThumbPainter.State.MouseOver));
    defaults.put("ScrollBar:ScrollBarThumb[Pressed].backgroundPainter", new SkinScrollBarThumbPainter(SkinScrollBarThumbPainter.State.Pressed));
    // table header
    defaults.put("TableHeader.background", SkinColors.LIGHT_BACKGROUND_COLOR);
    defaults.put("TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter", new SkinTableHeaderPainter(SkinTableHeaderPainter.State.Enabled));
    defaults.put("TableHeader:\"TableHeader.renderer\"[MouseOver].backgroundPainter", new SkinTableHeaderPainter(SkinTableHeaderPainter.State.MouseOver));
    defaults.put("TableHeader:\"TableHeader.renderer\"[Pressed].backgroundPainter", new SkinTableHeaderPainter(SkinTableHeaderPainter.State.Pressed));
    // table
    defaults.put("Table.cellNoFocusBorder", new InsetsUIResource(0, 0, 0, 0));
    defaults.put("Table.focusCellHighlightBorder", new InsetsUIResource(0, 0, 0, 0));
    defaults.put("Table.alternateRowColor", new Color(SkinColors.TABLE_ALTERNATE_ROW_COLOR.getRGB()));
    defaults.put("Table[Enabled+Selected].textBackground", new Color(SkinColors.TABLE_SELECTED_BACKGROUND_ROW_COLOR.getRGB()));
    defaults.put("Table[Enabled+Selected].textForeground", SkinColors.TABLE_SELECTED_FOREGROUND_ROW_COLOR);
    // table row setting
    setupTableFont(defaults);
    // splitter
    defaults.put("SplitPane:SplitPaneDivider[Enabled].backgroundPainter", new SkinSplitPaneDividerBackgroundPainter(SkinSplitPaneDividerBackgroundPainter.State.Enabled));
    // tabbed pane tab
    defaults.put("TabbedPane:TabbedPaneTabArea.contentMargins", new InsetsUIResource(3, 4, 0, 4));
    defaults.put("TabbedPane:TabbedPaneTabArea[Disabled].backgroundPainter", new SkinTabbedPaneTabAreaBackgroundPainter(SkinTabbedPaneTabAreaBackgroundPainter.State.Disabled));
    defaults.put("TabbedPane:TabbedPaneTabArea[Enabled+MouseOver].backgroundPainter", new SkinTabbedPaneTabAreaBackgroundPainter(SkinTabbedPaneTabAreaBackgroundPainter.State.EnableMouseOver));
    defaults.put("TabbedPane:TabbedPaneTabArea[Enabled+Pressed].backgroundPainter", new SkinTabbedPaneTabAreaBackgroundPainter(SkinTabbedPaneTabAreaBackgroundPainter.State.EnablePressed));
    defaults.put("TabbedPane:TabbedPaneTabArea[Enabled].backgroundPainter", new SkinTabbedPaneTabAreaBackgroundPainter(SkinTabbedPaneTabAreaBackgroundPainter.State.Enable));
    defaults.put("TabbedPane:TabbedPaneTab.contentMargins", new InsetsUIResource(3, 4, 4, 8));
    defaults.put("TabbedPane:TabbedPaneTab[Disabled+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.DisabledSelected));
    defaults.put("TabbedPane:TabbedPaneTab[Disabled].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.Disabled));
    defaults.put("TabbedPane:TabbedPaneTab[Enabled+MouseOver].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.EnabledMouseOver));
    defaults.put("TabbedPane:TabbedPaneTab[Enabled+Pressed].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.EnabledPressed));
    defaults.put("TabbedPane:TabbedPaneTab[Enabled].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.Enabled));
    defaults.put("TabbedPane:TabbedPaneTab[Focused+MouseOver+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.FocusedMouseOverSelected));
    defaults.put("TabbedPane:TabbedPaneTab[Focused+Pressed+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.FocusedPressedSelected));
    defaults.put("TabbedPane:TabbedPaneTab[Focused+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.FocusedSelected));
    defaults.put("TabbedPane:TabbedPaneTab[MouseOver+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.MouseOverSelected));
    defaults.put("TabbedPane:TabbedPaneTab[Pressed+Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.PressedSelected));
    defaults.put("TabbedPane:TabbedPaneTab[Selected].backgroundPainter", new SkinTabbedPaneTabBackgroundPainter(SkinTabbedPaneTabBackgroundPainter.State.Selected));
    // tree
    defaults.put("Tree.closedIcon", null);
    defaults.put("Tree.openIcon", null);
    defaults.put("Tree.leafIcon", null);
    defaults.put("Tree.selectionForeground", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("Tree:TreeCell[Enabled+Selected].textForeground", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("Tree:TreeCell[Focused+Selected].textForeground", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    // defaults.put("Tree.rendererFillBackground", Boolean.TRUE);
    // list
    defaults.put("List.cellNoFocusBorder", new InsetsUIResource(0, 0, 0, 0));
    defaults.put("List.focusCellHighlightBorder", new InsetsUIResource(0, 0, 0, 0));
    defaults.put("List[Selected].textBackground", new Color(SkinColors.TABLE_SELECTED_BACKGROUND_ROW_COLOR.getRGB()));
    defaults.put("List[Selected].textForeground", new Color(SkinColors.TEXT_FONT_FOREGROUND_COLOR.getRGB()));
    // popup
    defaults.put("PopupMenu[Disabled].backgroundPainter", new SkinPopupMenuBackgroundPainter(SkinPopupMenuBackgroundPainter.State.Disabled));
    defaults.put("PopupMenu[Enabled].backgroundPainter", new SkinPopupMenuBackgroundPainter(SkinPopupMenuBackgroundPainter.State.Enabled));
    // menuitem
    defaults.put("MenuItem[Enabled].textForeground", SkinColors.TEXT_FONT_FOREGROUND_COLOR);
    defaults.put("MenuItem[MouseOver].backgroundPainter", new SkinMenuItemBackgroundPainter(SkinMenuItemBackgroundPainter.State.MouseOver));
    // textfield
    // defaults.put("TextField.contentMargins", new InsetsUIResource(0, 0, 0, 0));
    defaults.put("TextField[Disabled].borderPainter", new SkinTextFieldBorderPainter(SkinTextFieldBorderPainter.State.Disabled));
    defaults.put("TextField[Enabled].borderPainter", new SkinTextFieldBorderPainter(SkinTextFieldBorderPainter.State.Enabled));
    defaults.put("TextField[Focused].borderPainter", new SkinTextFieldBorderPainter(SkinTextFieldBorderPainter.State.Focused));
    defaults.put("TextField[Disabled].backgroundPainter", new SkinTextFieldBackgroundPainter(SkinTextFieldBackgroundPainter.State.Disabled));
    defaults.put("TextField[Enabled].backgroundPainter", new SkinTextFieldBackgroundPainter(SkinTextFieldBackgroundPainter.State.Enabled));
    defaults.put("TextField[Focused].backgroundPainter", new SkinTextFieldBackgroundPainter(SkinTextFieldBackgroundPainter.State.Focused));
    // scrollpane
    defaults.put("ScrollPane.background", new ColorUIResource(Color.WHITE));
    // editorpane
    defaults.put("EditorPane[Enabled].backgroundPainter", SkinColors.LIGHT_BACKGROUND_COLOR);
    // radio buttons
    // defaults.put("RadioButton.icon", new IconUIResource());
    defaults.put("RadioButton[Disabled+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.DisabledSelected));
    defaults.put("RadioButton[Disabled].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.Disabled));
    defaults.put("RadioButton[Enabled].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.Enabled));
    defaults.put("RadioButton[Focused+MouseOver+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.FocusedMouseOverSelected));
    defaults.put("RadioButton[Focused+MouseOver].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.FocusedMouseOver));
    defaults.put("RadioButton[Focused+Pressed+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.FocusedPressedSelected));
    defaults.put("RadioButton[Focused+Pressed].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.FocusedPressed));
    defaults.put("RadioButton[Focused+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.FocusedSelected));
    defaults.put("RadioButton[Focused].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.Focused));
    defaults.put("RadioButton[MouseOver+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.MouseOverSelected));
    defaults.put("RadioButton[MouseOver].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.MouseOver));
    defaults.put("RadioButton[Pressed+Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.PressedSelected));
    defaults.put("RadioButton[Pressed].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.Pressed));
    defaults.put("RadioButton[Selected].iconPainter", new SkinRadioButtonIconPainter(SkinRadioButtonIconPainter.State.Selected));
    // checkbox
    defaults.put("CheckBox[Disabled+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.DisabledSelected));
    defaults.put("CheckBox[Disabled].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.Disabled));
    defaults.put("CheckBox[Enabled].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.Enabled));
    defaults.put("CheckBox[Focused+MouseOver+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.FocusedMouseOverSelected));
    defaults.put("CheckBox[Focused+MouseOver].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.FocusedMouseOver));
    defaults.put("CheckBox[Focused+Pressed+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.FocusedPressedSelected));
    defaults.put("CheckBox[Focused+Pressed].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.FocusedPressed));
    defaults.put("CheckBox[Focused+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.FocusedSelected));
    defaults.put("CheckBox[Focused].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.Focused));
    defaults.put("CheckBox[MouseOver+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.MouseOverSelected));
    defaults.put("CheckBox[MouseOver].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.MouseOver));
    defaults.put("CheckBox[Pressed+Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.PressedSelected));
    defaults.put("CheckBox[Pressed].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.Pressed));
    defaults.put("CheckBox[Selected].iconPainter", new SkinCheckBoxIconPainter(SkinCheckBoxIconPainter.State.Selected));
    // slider
    defaults.put("Slider:SliderThumb[Disabled].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.Disabled));
    defaults.put("Slider:SliderThumb[Enabled].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.Enabled));
    defaults.put("Slider:SliderThumb[Focused+MouseOver].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.FocusedMouseOver));
    defaults.put("Slider:SliderThumb[Focused+Pressed].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.FocusedPressed));
    defaults.put("Slider:SliderThumb[Focused].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.Focused));
    defaults.put("Slider:SliderThumb[MouseOver].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.MouseOver));
    defaults.put("Slider:SliderThumb[Pressed].backgroundPainter", new SkinSliderThumbPainter(SkinSliderThumbPainter.State.Pressed));
    // popupmenuseparator
    defaults.put("PopupMenuSeparator[Enabled].backgroundPainter", new SkinPopupMenuSeparatorPainter(SkinPopupMenuSeparatorPainter.State.Enabled));
    return defaults;
}
Also used : InsetsUIResource(javax.swing.plaf.InsetsUIResource) FontUIResource(javax.swing.plaf.FontUIResource) ColorUIResource(javax.swing.plaf.ColorUIResource)

Aggregations

ColorUIResource (javax.swing.plaf.ColorUIResource)36 Color (java.awt.Color)9 FontUIResource (javax.swing.plaf.FontUIResource)4 Dimension (java.awt.Dimension)3 UIDefaults (javax.swing.UIDefaults)3 BorderLayout (java.awt.BorderLayout)2 Insets (java.awt.Insets)2 MouseEvent (java.awt.event.MouseEvent)2 IOException (java.io.IOException)2 StringTokenizer (java.util.StringTokenizer)2 ImageIcon (javax.swing.ImageIcon)2 JScrollPane (javax.swing.JScrollPane)2 Border (javax.swing.border.Border)2 InsetsUIResource (javax.swing.plaf.InsetsUIResource)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)2 ColumnInfo (org.compiere.minigrid.ColumnInfo)2 DarculaButtonPainter (com.intellij.ide.ui.laf.darcula.ui.DarculaButtonPainter)1 DarculaButtonUI (com.intellij.ide.ui.laf.darcula.ui.DarculaButtonUI)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1