Examples of SeaGlassContext


Examples of com.seaglasslookandfeel.SeaGlassContext

    protected void configureScrollBarColors() {
    }

    private void updateStyle(JScrollBar c) {
        SynthStyle oldStyle = style;
        SeaGlassContext context = getContext(c, ENABLED);
        style = SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            scrollBarWidth = style.getInt(context, "ScrollBar.thumbHeight", 14);

            minimumThumbSize = (Dimension) style.get(context, "ScrollBar.minimumThumbSize");
            if (minimumThumbSize == null) {
                minimumThumbSize = new Dimension();
                validMinimumThumbSize = false;
            } else {
                validMinimumThumbSize = true;
            }
            maximumThumbSize = (Dimension) style.get(context, "ScrollBar.maximumThumbSize");
            if (maximumThumbSize == null) {
                maximumThumbSize = new Dimension(4096, 4097);
            }

            incrGap = style.getInt(context, "ScrollBar.incrementButtonGap", 0);
            decrGap = style.getInt(context, "ScrollBar.decrementButtonGap", 0);
            capSize = style.getInt(context, "ScrollBar.capSize", 0);

            /*
             * Handle scaling for sizeVarients for special case components. The
             * key "JComponent.sizeVariant" scales for large/small/mini
             * components are based on Apples LAF
             */
            String scaleKey = SeaGlassStyle.getSizeVariant(scrollbar);
            if (scaleKey != null) {
                if (SeaGlassStyle.LARGE_KEY.equals(scaleKey)) {
                    scrollBarWidth *= 1.15;
                    incrGap *= 1.15;
                    decrGap *= 1.15;
                } else if (SeaGlassStyle.SMALL_KEY.equals(scaleKey)) {
                    scrollBarWidth *= 0.857;
                    incrGap *= 0.857;
                    decrGap *= 0.857;
                } else if (SeaGlassStyle.MINI_KEY.equals(scaleKey)) {
                    scrollBarWidth *= 0.714;
                    incrGap *= 0.714;
                    decrGap *= 0.714;
                }
            }

            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }
        context.dispose();

        context = getContext(c, Region.SCROLL_BAR_TRACK, ENABLED);
        trackStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();

        context = getContext(c, Region.SCROLL_BAR_THUMB, ENABLED);
        thumbStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();

        context = getContext(c, SeaGlassRegion.SCROLL_BAR_CAP, ENABLED);
        capStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

        scrollbar.removePropertyChangeListener(this);
        scrollbar.removeMouseListener(mouseButtonListener);
    }

    protected void uninstallDefaults() {
        SeaGlassContext context = getContext(scrollbar, ENABLED);
        style.uninstallDefaults(context);
        context.dispose();
        style = null;

        context = getContext(scrollbar, Region.SCROLL_BAR_TRACK, ENABLED);
        trackStyle.uninstallDefaults(context);
        context.dispose();
        trackStyle = null;

        context = getContext(scrollbar, Region.SCROLL_BAR_THUMB, ENABLED);
        thumbStyle.uninstallDefaults(context);
        context.dispose();
        thumbStyle = null;

        context = getContext(scrollbar, SeaGlassRegion.SCROLL_BAR_CAP, ENABLED);
        capStyle.uninstallDefaults(context);
        context.dispose();
        capStyle = null;

        super.uninstallDefaults();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

        }
        return SeaGlassLookAndFeel.getComponentState(c);
    }

    public boolean getSupportsAbsolutePositioning() {
        SeaGlassContext context = getContext(scrollbar);
        boolean value = style.getBoolean(context, "ScrollBar.allowsAbsolutePositioning", false);
        context.dispose();
        return value;
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

        context.dispose();
        return value;
    }

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

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

Examples of com.seaglasslookandfeel.SeaGlassContext

        paint(context, g);
        context.dispose();
    }

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

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

Examples of com.seaglasslookandfeel.SeaGlassContext

        paint(context, g);
        context.dispose();
    }

    protected void paint(SeaGlassContext context, Graphics g) {
        SeaGlassContext subcontext = getContext(scrollbar, Region.SCROLL_BAR_TRACK);
        paintTrack(subcontext, g, getTrackBounds());
        subcontext.dispose();

        if (buttonsTogether.isInState(context.getComponent())) {
            subcontext = getContext(scrollbar, SeaGlassRegion.SCROLL_BAR_CAP);
            paintCap(subcontext, g, getCapBounds());
            subcontext.dispose();
        }

        subcontext = getContext(scrollbar, Region.SCROLL_BAR_THUMB);
        paintThumb(subcontext, g, getThumbBounds());
        subcontext.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

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

        style = SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }

        context.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

    protected void uninstallDefaults() {
        if (header.getDefaultRenderer() instanceof HeaderRenderer) {
            header.setDefaultRenderer(prevRenderer);
        }

        SeaGlassContext context = getContext(header, ENABLED);

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

Examples of com.seaglasslookandfeel.SeaGlassContext

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

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

Examples of com.seaglasslookandfeel.SeaGlassContext

    /**
     * @see javax.swing.plaf.basic.BasicTableHeaderUI#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
TOP
Copyright © 2018 www.massapi.com. 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.