Package javax.swing

Examples of javax.swing.UIDefaults$ProxyLazyValue


            super.installDefaults();
            scrollbar.setBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) );
        }

        protected void configureScrollBarColors() {
            UIDefaults uidefaults = XToolkit.getUIDefaults();
            Color bg = scrollbar.getBackground();
            if (bg == null || bg instanceof UIResource) {
                scrollbar.setBackground(uidefaults.getColor("ScrollBar.background"));
            }

            Color fg = scrollbar.getForeground();
            if (fg == null || fg instanceof UIResource) {
                scrollbar.setForeground(uidefaults.getColor("ScrollBar.foreground"));
            }

            thumbHighlightColor = uidefaults.getColor("ScrollBar.thumbHighlight");
            thumbLightShadowColor = uidefaults.getColor("ScrollBar.thumbShadow");
            thumbDarkShadowColor = uidefaults.getColor("ScrollBar.thumbDarkShadow");
            thumbColor = uidefaults.getColor("ScrollBar.thumb");
            trackColor = uidefaults.getColor("ScrollBar.track");

            trackHighlightColor = uidefaults.getColor("ScrollBar.trackHighlight");

        }
View Full Code Here


        }


        protected void installDefaults(JScrollPane scrollpane) {
            Border b = scrollpane.getBorder();
            UIDefaults uidefaults = XToolkit.getUIDefaults();
            scrollpane.setBorder(uidefaults.getBorder("ScrollPane.border"));
            scrollpane.setBackground(uidefaults.getColor("ScrollPane.background"));
            scrollpane.setViewportBorder(uidefaults.getBorder("TextField.border"));
            JScrollBar vsb = scrollpane.getVerticalScrollBar();
            if (vsb != null) {
                if (isLeftToRight(scrollpane)) {
                    vsbBorder = new CompoundBorder(vsbMarginBorderR,
                                                   vsb.getBorder());
View Full Code Here

    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);
View Full Code Here

        // 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);
View Full Code Here

public class MageJDesktop extends JDesktopPane {

    @Override
    public void updateUI() {
        if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) {
            UIDefaults map = new UIDefaults();
            Painter painter = new Painter() {

                Color color = null;

                @Override
                public void paint(Graphics2D g, Object c, int w, int h) {
                    g.setColor(color == null ? UIManager.getDefaults().getColor("desktop") : color);
                    g.fillRect(0,0,w,h);
                }
            };
            map.put("DesktopPane[Enabled].backgroundPainter", painter);
            putClientProperty("Nimbus.Overrides", map);
        }
        super.updateUI();
    }
View Full Code Here

        }
        catch (Exception e) {
            e.printStackTrace();
        }

        final UIDefaults defaults = UIManager.getDefaults();

        defaults.put(
            "PopupMenu.border",
            new BorderUIResource.EtchedBorderUIResource(
                EtchedBorder.RAISED, defaults.getColor("controlShadow"),
                defaults.getColor("controlLtHighlight")
            )
        );

        final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
        final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
        final BorderUIResource.CompoundBorderUIResource compBorder
            = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
        final BorderUIResource.EmptyBorderUIResource emptyBorderUI
            = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
        defaults.put("SplitPane.border", emptyBorderUI);
        defaults.put("Table.scrollPaneBorder", emptyBorderUI);
        defaults.put("ComboBox.border", compBorder);
        defaults.put("TextField.border", compBorder);
        defaults.put("TextArea.border", compBorder);
        defaults.put("CheckBox.border", compBorder);
        defaults.put("ScrollPane.border", emptyBorderUI);

    }
View Full Code Here

        Object name = a.getValue(Action.NAME);
        map.put(name, a);
    }

    final void installUIActionMap() {
        UIDefaults uiDefaults = UIManager.getLookAndFeelDefaults();
        String propertyName = getPropertyPrefix() + ".actionMap";
        ActionMap actionMap1 = new ActionMapUIResource();
        putActionToActionMap(focusAction, actionMap1);
        Object actionMap2 = uiDefaults.get(propertyName);
        if (actionMap2 == null) {
            ActionMapUIResource map = new ActionMapUIResource();
            Action[] actions = component.getActions();
            for (int i = 0; i < actions.length; i++) {
                putActionToActionMap(actions[i], map);
            }
            putActionToActionMap(TransferHandler.getPasteAction(), map);
            putActionToActionMap(TransferHandler.getCutAction(), map);
            putActionToActionMap(TransferHandler.getCopyAction(), map);

            actionMap2 = map;
            if (!(component instanceof JEditorPane)) {
                uiDefaults.put(propertyName, map);
            }
        }
        actionMap1.setParent((ActionMap)actionMap2);
        SwingUtilities.replaceUIActionMap(component, actionMap1);
    }
View Full Code Here

        return Boolean.TRUE.equals(docProperty);
    }

    private UIDefaults getUIDefaults() {
        if (uiDefaults == null) {
            uiDefaults = new UIDefaults();
        }

        return uiDefaults;
    }
View Full Code Here

        }
        catch (Exception e) {
            e.printStackTrace();
        }

        final UIDefaults defaults = UIManager.getDefaults();

        defaults.put(
            "PopupMenu.border",
            new BorderUIResource.EtchedBorderUIResource(
                EtchedBorder.RAISED, defaults.getColor("controlShadow"),
                defaults.getColor("controlLtHighlight")
            )
        );

        final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
        final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
        final BorderUIResource.CompoundBorderUIResource compBorder
            = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
        final BorderUIResource.EmptyBorderUIResource emptyBorderUI
            = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
        defaults.put("SplitPane.border", emptyBorderUI);
        defaults.put("Table.scrollPaneBorder", emptyBorderUI);
        defaults.put("ComboBox.border", compBorder);
        defaults.put("TextField.border", compBorder);
        defaults.put("TextArea.border", compBorder);
        defaults.put("CheckBox.border", compBorder);
        defaults.put("ScrollPane.border", emptyBorderUI);

    }
View Full Code Here

        uiDefs.putDefaults(basicComponentUIs);
    }

    public UIDefaults getDefaults() {
        if (uiDefaults == null) {
            uiDefaults = new UIDefaults();
            initClassDefaults(uiDefaults);
            initSystemColorDefaults(uiDefaults);
            initComponentDefaults(uiDefaults);
            uiDefaults.addResourceBundle(RESOURCE_BUNDLE);
        }
View Full Code Here

TOP

Related Classes of javax.swing.UIDefaults$ProxyLazyValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.