Package com.seaglasslookandfeel

Examples of com.seaglasslookandfeel.SeaGlassContext


     * DOCUMENT ME!
     *
     * @param sep DOCUMENT ME!
     */
    private void updateStyle(JSeparator sep) {
        SeaGlassContext context  = getContext(sep, ENABLED);
        SynthStyle      oldStyle = style;

        style = SeaGlassLookAndFeel.updateStyle(context, this);

        if (style != oldStyle) {
            if (sep instanceof JToolBar.Separator) {
                Dimension size = ((JToolBar.Separator) sep).getSeparatorSize();

                if (size == null || size instanceof UIResource) {
                    size = (DimensionUIResource) style.get(context, "ToolBar.separatorSize");
                    if (true || size == null) {
                        size = new DimensionUIResource(10, 10);
                    }

                    ((JToolBar.Separator) sep).setSeparatorSize(size);
                }
            }
        }

        context.dispose();
    }
View Full Code Here


     * DOCUMENT ME!
     *
     * @param c DOCUMENT ME!
     */
    public void uninstallDefaults(JSeparator c) {
        SeaGlassContext context = getContext(c, ENABLED);

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

    /**
     * @see javax.swing.plaf.ComponentUI#update(java.awt.Graphics, javax.swing.JComponent)
     */
    public void update(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

        JSeparator separator = (JSeparator) context.getComponent();

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

    /**
     * @see javax.swing.plaf.ComponentUI#paint(java.awt.Graphics, javax.swing.JComponent)
     */
    public void paint(Graphics g, JComponent c) {
        SeaGlassContext context = getContext(c);

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

    /**
     * @see javax.swing.plaf.ComponentUI#getPreferredSize(javax.swing.JComponent)
     */
    public Dimension getPreferredSize(JComponent c) {
        SeaGlassContext context = getContext(c);

        int       thickness = style.getInt(context, "Separator.thickness", 5);
        Insets    insets    = c.getInsets();
        Dimension size;

        if (((JSeparator) c).getOrientation() == JSeparator.VERTICAL) {
            size = new Dimension(insets.left + insets.right + thickness,
                                 insets.top + insets.bottom);
        } else {
            size = new Dimension(insets.left + insets.right,
                                 insets.top + insets.bottom + thickness);
        }

        context.dispose();
        return size;
    }
View Full Code Here

        updateStyle((JTextComponent)getComponent());
        getComponent().addFocusListener(this);
    }

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

        getComponent().putClientProperty("caretAspectRatio", null);
        getComponent().removeFocusListener(this);

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

    public void installUI(JComponent c) {
        super.installUI(c);
    }

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

        style = (SeaGlassStyle) SeaGlassLookAndFeel.updateStyle(context, this);

        if (style != oldStyle) {
            SeaGlassTextFieldUI.updateStyle(comp, context, getPropertyPrefix());

            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }
        context.dispose();
    }
View Full Code Here

    private int getComponentState(JComponent c) {
        return SeaGlassLookAndFeel.getComponentState(c);
    }

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

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

        super.paint(g, getComponent());
    }

    protected void paintBackground(Graphics g) {
        JTextComponent c = getComponent();
        SeaGlassContext context = getContext(c);
        context.getPainter().paintTextAreaBackground(context,
            g, 0, 0, c.getWidth(), c.getHeight());
   }
View Full Code Here

    protected void installDefaults(JComponent c) {
        updateStyle(c);
    }

    private void updateStyle(JComponent c) {
        SeaGlassContext context = getContext(c, ENABLED);

        // Note: JViewport is special cased as it does not allow for
        // a border to be set. JViewport.setBorder is overriden to throw
        // an IllegalArgumentException. Refer to SynthScrollPaneUI for
        // details of this.
        SynthStyle newStyle = SynthLookAndFeel.getStyle(context.getComponent(), context.getRegion());
        SynthStyle oldStyle = context.getStyle();

        if (newStyle != oldStyle) {
            if (oldStyle != null) {
                oldStyle.uninstallDefaults(context);
            }
            context.setStyle(newStyle);
            newStyle.installDefaults(context);
        }
        this.style = newStyle;
        context.dispose();
    }
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.