Package javax.swing.plaf.synth

Examples of javax.swing.plaf.synth.SynthStyle


    }

    protected void updateMargin(AbstractButton b) {
        String pp = getPropertyPrefix();
        if (LookAndFeelFactory.isLnfInUse(LookAndFeelFactory.SYNTH_LNF)) {
            SynthStyle ss = SynthLookAndFeel.getStyle(b, Region.BUTTON);
            SynthContext sc = new SynthContext(b, Region.BUTTON, ss, 0);
            Insets insets = ss.getInsets(sc, new InsetsUIResource(0, 0, 0, 0));
            if (insets != null) {
                b.setMargin(insets);
            }
        }
        else if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
View Full Code Here


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

     * @param g must not be null
     * @param the bounds to fill, may be null to indicate the complete size
     */
    public static void update(SynthContext context, Graphics g, Rectangle bounds) {
        JComponent c = context.getComponent();
        SynthStyle style = context.getStyle();
        int x, y, width, height;

        if (bounds == null) {
            x = 0;
            y = 0;
            width = c.getWidth();
            height = c.getHeight();
        } else {
            x = bounds.x;
            y = bounds.y;
            width = bounds.width;
            height = bounds.height;
        }

        // Fill in the background, if necessary.
        boolean subregion = context.getRegion().isSubregion();
        if ((subregion && style.isOpaque(context))
                || (!subregion && c.isOpaque())) {
            g.setColor(style.getColor(context, ColorType.BACKGROUND));
            g.fillRect(x, y, width, height);
        }
    }
View Full Code Here

    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);
View Full Code Here

    private SeaGlassContext getContext(JComponent c, Region region) {
        return getContext(c, region, getComponentState(c, region));
    }

    private SeaGlassContext getContext(JComponent c, Region region, int state) {
        SynthStyle style = trackStyle;

        if (region == Region.SCROLL_BAR_THUMB) {
            style = thumbStyle;
        } else if (region == SeaGlassRegion.SCROLL_BAR_CAP) {
            style = capStyle;
View Full Code Here

     *
     * @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();
View Full Code Here

        }
    }

    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)) {
View Full Code Here

     *
     * @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");
View Full Code Here

            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();
View Full Code Here

            return null;
        }

        AbstractButton     b             = (AbstractButton) c;
        SeaGlassContext    ss            = getContext(c);
        SynthStyle         style2        = ss.getStyle();
        SynthGraphicsUtils graphicsUtils = style2.getGraphicsUtils(ss);
        Dimension          size          = graphicsUtils.getPreferredSize(ss, style2.getFont(ss), b.getText(), getSizingIcon(b),
                                                                          b.getHorizontalAlignment(),
                                                                          b.getVerticalAlignment(), b.getHorizontalTextPosition(),
                                                                          b.getVerticalTextPosition(), b.getIconTextGap(),
                                                                          b.getDisplayedMnemonicIndex());
View Full Code Here

TOP

Related Classes of javax.swing.plaf.synth.SynthStyle

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.