Package com.seaglasslookandfeel

Examples of com.seaglasslookandfeel.SeaGlassContext


    /**
     * @see javax.swing.plaf.basic.BasicTabbedPaneUI#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


            tabRect.width -= offset;
        } else {
            tabRect.width -= offset;
        }

        SeaGlassContext subcontext = getContext(tabPane, SeaGlassRegion.TABBED_PANE_TAB_CLOSE_BUTTON,
                                                getCloseButtonState(tabPane, tabIndex, (tabContext.getComponentState() & MOUSE_OVER) != 0));

        SeaGlassLookAndFeel.updateSubregion(subcontext, g, bounds);

        SeaGlassSynthPainterImpl painter = (SeaGlassSynthPainterImpl) subcontext.getPainter();

        painter.paintSearchButtonForeground(subcontext, g, bounds.x, bounds.y, bounds.width, bounds.height);

        subcontext.dispose();

        return tabRect;
    }
View Full Code Here

    /**
     * @see javax.swing.plaf.basic.BasicPanelUI#uninstallDefaults(javax.swing.JPanel)
     */
    protected void uninstallDefaults(JPanel p) {
        SeaGlassContext context = getContext(p, ENABLED);

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

        // Restore original opacity if not changed by the code.
        LookAndFeel.installProperty(p, "opaque", originalOpacity);
    }
View Full Code Here

     * Update the Synth style if a property changes.
     *
     * @param c the panel.
     */
    private void updateStyle(JPanel c) {
        SeaGlassContext context = getContext(c, ENABLED);

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

        // Set the opacity according to whether the background has been set.
        // Don't set it if the user has already set it.
        LookAndFeel.installProperty(c, "opaque", !(c.getBackground() instanceof UIResource));
    }
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);

        SeaGlassLookAndFeel.update(context, g);
        context.getPainter().paintPanelBackground(context, g, 0, 0, c.getWidth(), c.getHeight());
        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

    protected void installDefaults() {
        updateStyle(progressBar);
    }

    private void updateStyle(JProgressBar c) {
        SeaGlassContext context = getContext(c, ENABLED);
        // SynthStyle oldStyle = style;
        style = SeaGlassLookAndFeel.updateStyle(context, this);
        setCellLength(style.getInt(context, "ProgressBar.cellLength", 1));
        setCellSpacing(style.getInt(context, "ProgressBar.cellSpacing", 0));
        progressPadding = style.getInt(context, "ProgressBar.progressPadding", 0);
        paintOutsideClip = style.getBoolean(context, "ProgressBar.paintOutsideClip", false);
        rotateText = style.getBoolean(context, "ProgressBar.rotateText", false);
        tileWhenIndeterminate = style.getBoolean(context, "ProgressBar.tileWhenIndeterminate", false);
        trackThickness = style.getInt(context, "ProgressBar.trackThickness", 19);
        tileWidth = style.getInt(context, "ProgressBar.tileWidth", 15);
        bgFillColor = (Color) style.get(context, "ProgressBar.backgroundFillColor");
        if (bgFillColor == null) {
            bgFillColor = Color.white;
        }
        // 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(progressBar);
        if (scaleKey != null) {
            if (SeaGlassStyle.LARGE_KEY.equals(scaleKey)) {
                trackThickness = 24;
                tileWidth *= 1.15;
            } else if (SeaGlassStyle.SMALL_KEY.equals(scaleKey)) {
                trackThickness = 17;
                tileWidth *= 0.857;
            } else if (SeaGlassStyle.MINI_KEY.equals(scaleKey)) {
                trackThickness = 15;
                tileWidth *= 0.784;
            }
        }
        context.dispose();
    }
View Full Code Here

        context.dispose();
    }

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

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

    @Override
    public int getBaseline(JComponent c, int width, int height) {
        super.getBaseline(c, width, height);
        if (progressBar.isStringPainted() && progressBar.getOrientation() == JProgressBar.HORIZONTAL) {
            SeaGlassContext context = getContext(c);
            Font font = context.getStyle().getFont(context);
            FontMetrics metrics = progressBar.getFontMetrics(font);
            context.dispose();
            return (height - metrics.getAscent() - metrics.getDescent()) / 2 + metrics.getAscent();
        }
        return -1;
    }
View Full Code Here

        return boundsRect;
    }

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

        SeaGlassLookAndFeel.update(context, g);
        JProgressBar pBar = (JProgressBar) c;
        Rectangle bounds = calcBounds(pBar);
        context.getPainter().paintProgressBarBackground(context, g, bounds.x, bounds.y, bounds.width, bounds.height, pBar.getOrientation());
        paint(context, g);
        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.