Examples of SeaGlassContext


Examples of com.seaglasslookandfeel.SeaGlassContext

        viewRect.y      = i.top;
        viewRect.width  = width - (i.right + viewRect.x);
        viewRect.height = height - (i.bottom + viewRect.y);

        // layout the text and icon
        SeaGlassContext context = getContext(b);
        FontMetrics     fm = context.getComponent().getFontMetrics(context.getStyle().getFont(context));

        context.getStyle().getGraphicsUtils(context).layoutText(context, fm, b.getText(), b.getIcon(), b.getHorizontalAlignment(),
                                                                b.getVerticalAlignment(), b.getHorizontalTextPosition(),
                                                                b.getVerticalTextPosition(), viewRect, iconRect, textRect,
                                                                b.getIconTextGap());
        View view     = (View) b.getClientProperty(BasicHTML.propertyKey);
        int  baseline;

        if (view != null) {
            baseline = BasicHTML.getHTMLBaseline(view, textRect.width, textRect.height);
            if (baseline >= 0) {
                baseline += textRect.y;
            }
        } else {
            baseline = textRect.y + fm.getAscent();
        }

        context.dispose();
        return baseline;
    }
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);
        paintBackground(context, g, c);
        paint(context, g);
        context.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

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

Examples of com.seaglasslookandfeel.SeaGlassContext

     *
     * @return the default icon.
     */

    protected Icon getDefaultIcon(AbstractButton b) {
        SeaGlassContext context = getContext(b);
        Icon            icon    = context.getStyle().getIcon(context, getPropertyPrefix() + "icon");

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

Examples of com.seaglasslookandfeel.SeaGlassContext

        if (c.getComponentCount() > 0 && c.getLayout() != null) {
            return null;
        }

        AbstractButton   b      = (AbstractButton) c;
        SeaGlassContext  ss     = getContext(c);
        final SynthStyle style2 = ss.getStyle();
        Dimension        size   = style2.getGraphicsUtils(ss).getMinimumSize(ss, style2.getFont(ss), b.getText(), getSizingIcon(b),
                                                                             b.getHorizontalAlignment(), b.getVerticalAlignment(),
                                                                             b.getHorizontalTextPosition(), b.getVerticalTextPosition(),
                                                                             b.getIconTextGap(), b.getDisplayedMnemonicIndex());

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

Examples of com.seaglasslookandfeel.SeaGlassContext

            }
        }

        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
            JComponent jc = (JComponent) c;
            SeaGlassContext context = getContext(jc);
            SynthStyle style = context.getStyle();
            if (style == null) {
                assert false : "SynthBorder is being used outside after the " + " UI has been uninstalled";
                return;
            }
            context.getPainter().paintViewportBorder(context, g, x, y, width, height);
            context.dispose();
        }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

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

        style = SeaGlassLookAndFeel.updateStyle(context, this);

        updateSearchStyle(c, context, getPropertyPrefix());

        if (style != oldStyle) {
            updateStyle(c, context, getPropertyPrefix());

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

        context.dispose();

        context   = getContext(c, SeaGlassRegion.SEARCH_FIELD_FIND_BUTTON, ENABLED);
        findStyle = SeaGlassLookAndFeel.updateStyle(context, this);
        context.dispose();

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

Examples of com.seaglasslookandfeel.SeaGlassContext

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

        SeaGlassLookAndFeel.update(context, g);
        paintBackground(context, g, c);
        paint(context, g);
        context.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

            bounds = getFindButtonBounds();
        } else {
            bounds = getCancelButtonBounds();
        }

        SeaGlassContext subcontext = getContext(c, region);

        SeaGlassLookAndFeel.updateSubregion(subcontext, g, bounds);

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

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

        subcontext.dispose();
    }
View Full Code Here

Examples of com.seaglasslookandfeel.SeaGlassContext

    /**
     * @see javax.swing.plaf.basic.BasicTextUI#uninstallDefaults()
     */
    protected void uninstallDefaults() {
        JTextComponent  c       = getComponent();
        SeaGlassContext context = getContext(c, ENABLED);

        // Remove the search border, if present.
        Border          border  = c.getBorder();

        if (border instanceof TextFieldBorder) {
            c.setBorder(null);
        }

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

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

        super.uninstallDefaults();
    }
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.