Package com.seaglasslookandfeel

Examples of com.seaglasslookandfeel.SeaGlassContext


        updateStyle(comboBox);
    }

    private void updateStyle(JComboBox comboBox) {
        SeaGlassStyle oldStyle = style;
        SeaGlassContext context = getContext(comboBox, ENABLED);

        style = (SeaGlassStyle) SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            popupInsets = (Insets) style.get(context, "ComboBox.popupInsets");
            useListColors = style.getBoolean(context, "ComboBox.rendererUseListColors", true);
            buttonWhenNotEditable = style.getBoolean(context, "ComboBox.buttonWhenNotEditable", false);
            pressedWhenPopupVisible = style.getBoolean(context, "ComboBox.pressedWhenPopupVisible", false);
           
            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
            forceOpaque = style.getBoolean(context, "ComboBox.forceOpaque", false);
        }
        context.dispose();
    }
View Full Code Here


        buttonHandler = null;
    }

    @Override
    protected void uninstallDefaults() {
        SeaGlassContext context = getContext(comboBox, ENABLED);

        style.uninstallDefaults(context);
        context.dispose();
        style = null;
    }
View Full Code Here

    // =================================
    // begin ComponentUI Implementation

    @Override
    public void update(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

        SeaGlassLookAndFeel.update(context, g);
        context.getPainter().paintComboBoxBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
        paint(context, g);
        context.dispose();
    }
View Full Code Here

        context.dispose();
    }

    @Override
    public void paint(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

        paint(context, g);
        context.dispose();
    }
View Full Code Here

        LookAndFeel.installProperty(scrollpane, "opaque", Boolean.TRUE);
        updateStyle(scrollpane);
    }

    protected void uninstallDefaults(JScrollPane c) {
        SeaGlassContext context = getContext(c, ENABLED);

        style.uninstallDefaults(context);
        context.dispose();

        if (scrollpane.getViewportBorder() instanceof UIResource) {
            scrollpane.setViewportBorder(null);
        }
    }
View Full Code Here

            scrollpane.setViewportBorder(null);
        }
    }

    private void updateStyle(JScrollPane c) {
        SeaGlassContext context = getContext(c, ENABLED);
        SynthStyle oldStyle = style;

        style = SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            Border vpBorder = scrollpane.getViewportBorder();
            if ((vpBorder == null) || (vpBorder instanceof UIResource)) {
                scrollpane.setViewportBorder(new ViewportBorder(context));
            }
            if (oldStyle != null) {
                uninstallKeyboardActions(c);
                installKeyboardActions(c);
            }
        }
        context.dispose();
    }
View Full Code Here

            updateStyle(scrollpane);
        }
    }

    public void update(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

        SeaGlassLookAndFeel.update(context, g);
        context.getPainter().paintScrollPaneBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
        paintScrollPaneCorner(g, c);
        paint(context, g);
        context.dispose();
    }
View Full Code Here

        }
        cornerPainter.paint(g2, c, 15, 15);
    }

    public void paint(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

        paint(context, g);
        context.dispose();
    }
View Full Code Here

     * Update the style of the button.
     *
     * @param b the button.
     */
    public void updateStyle(AbstractButton b) {
        SeaGlassContext context  = getContext(b, SynthConstants.ENABLED);
        SynthStyle      oldStyle = style;

        style = SeaGlassLookAndFeel.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 = SeaGlassLookAndFeel.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);

            value = b.getClientProperty(APPLE_PREFIX + "buttonType");
            if (value != null) {
                if ("segmented".equals(value)) {
                    b.setMargin(SeaGlassLookAndFeel.EMPTY_UIRESOURCE_INSETS);
                }
            }

            if (oldStyle != null) {
                uninstallKeyboardActions(b);
                installKeyboardActions(b);
            }
        }

        context.dispose();
    }
View Full Code Here

    /**
     * @see javax.swing.plaf.basic.BasicButtonUI#uninstallDefaults(javax.swing.AbstractButton)
     */
    protected void uninstallDefaults(AbstractButton b) {
        SeaGlassContext context = getContext(b, ENABLED);

        style.uninstallDefaults(context);
        context.dispose();
        style = null;
    }
View Full Code Here

TOP

Related Classes of com.seaglasslookandfeel.SeaGlassContext

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.