类javax.swing.plaf.synth.SynthStyle源码实例Demo

下面列出了怎么用javax.swing.plaf.synth.SynthStyle的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: ThemeValue.java
public Font getFont() {
    SynthStyle style = getSynthStyle (aRegion);
    if (Boolean.TRUE.equals(functioning)) {
        try {
            Font result = (Font) synthStyle_getFontForState.invoke (style,
                new Object [] {
                    getSynthContext ()
                });
            if (result == null) {
                result = (Font) fallback;
            }
            return result;
        } catch (Exception e) {
            functioning = Boolean.FALSE;
            if (log) {
                e.printStackTrace();
            }
        }
    }
    //This will only happen once, after which functioning will be false
    return null; 
}
 
源代码2 项目: netbeans   文件: ThemeValue.java
public Color getColor () {
    SynthStyle style = getSynthStyle (aRegion);
    if (Boolean.TRUE.equals(functioning)) {
        try {
            Color result = (Color) synthStyle_getColorForState.invoke (style,
                new Object [] {
                    getSynthContext (),
                    aColorType
                });
            if (result == null) {
                result = (Color) fallback;
            }
            if (darken) {
                result = result.darker();
            }
            return result;
        } catch (Exception e) {
            functioning = Boolean.FALSE;
            if (log) {
                e.printStackTrace();
            }
        }
    }
    //This will only happen once, after which functioning will be false
    return null;
}
 
源代码3 项目: seaglass   文件: SeaGlassLookAndFeel.java
/**
 * Called by UIManager when this look and feel is installed.
 */
@Override
public void initialize() {
    super.initialize();

    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
            @Override
            public SynthStyle getStyle(JComponent c, Region r) {
                SynthStyle style = getSeaGlassStyle(c, r);

                if (!(style instanceof SeaGlassStyle)) {
                    style = new SeaGlassStyleWrapper(style);
                }

                return style;
            }
        });
}
 
源代码4 项目: seaglass   文件: SeaGlassLookAndFeel.java
/**
     * A convience method that will reset the Style of StyleContext if
     * necessary.
     *
     * @return newStyle
     */
   
    public static SynthStyle updateSeaglassStyle(SynthContext context, SeaglassUI ui) {
        SynthStyle newStyle = getStyle(context.getComponent(), context.getRegion());
        // TODO rossi 04.07.2011 this code is now private in the Synth L&F
//        SynthStyle oldStyle = context.getStyle();
//
//        if (newStyle != oldStyle) {
//            if (oldStyle != null) {
//                oldStyle.uninstallDefaults(context);
//            }
//            context.setStyle(newStyle);
//            newStyle.installDefaults(context, ui);
//        }
        return newStyle;
    }
 
源代码5 项目: seaglass   文件: SeaGlassLookAndFeel.java
/**
 * A convience method that will reset the Style of StyleContext if
 * necessary.
 *
 * @param  context the SynthContext corresponding to the current state.
 * @param  ui      the UI delegate.
 *
 * @return the new, updated style.
 */
public static SynthStyle updateStyle(SeaGlassContext context, SeaglassUI ui) {
    SynthStyle newStyle = SynthLookAndFeel.getStyle(context.getComponent(), context.getRegion());
    SynthStyle oldStyle = context.getStyle();

    if (newStyle != oldStyle) {

        if (oldStyle != null) {
            oldStyle.uninstallDefaults(context);
        }

        context.setStyle(newStyle);
        if (newStyle instanceof SeaGlassStyle) {
            ((SeaGlassStyle) newStyle).installDefaults(context, ui);
        }
    }

    return newStyle;
}
 
源代码6 项目: seaglass   文件: SeaGlassEditorPaneUI.java
private void updateStyle(JTextComponent comp) {
    SeaGlassContext context = getContext(comp, ENABLED);
    SynthStyle oldStyle = style;

    style = SeaGlassLookAndFeel.updateStyle(context, this);

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

        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();
}
 
源代码7 项目: seaglass   文件: SeaGlassViewportUI.java
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();
}
 
源代码8 项目: seaglass   文件: SeaGlassButtonUI.java
/**
 * @see javax.swing.plaf.basic.BasicButtonUI#getMinimumSize(javax.swing.JComponent)
 */
public Dimension getMinimumSize(JComponent c) {
    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;
}
 
源代码9 项目: seaglass   文件: SeaGlassButtonUI.java
/**
 * @see javax.swing.plaf.basic.BasicButtonUI#getPreferredSize(javax.swing.JComponent)
 */
public Dimension getPreferredSize(JComponent c) {
    if (c.getComponentCount() > 0 && c.getLayout() != null) {
        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());

    ss.dispose();
    // Make height odd.
    size.height &= ~1;
    return size;
}
 
源代码10 项目: seaglass   文件: SeaGlassButtonUI.java
/**
 * @see javax.swing.plaf.basic.BasicButtonUI#getMaximumSize(javax.swing.JComponent)
 */
public Dimension getMaximumSize(JComponent c) {
    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).getMaximumSize(ss, style2.getFont(ss), b.getText(), getSizingIcon(b),
                                                                         b.getHorizontalAlignment(), b.getVerticalAlignment(),
                                                                         b.getHorizontalTextPosition(), b.getVerticalTextPosition(),
                                                                         b.getIconTextGap(), b.getDisplayedMnemonicIndex());

    ss.dispose();
    return size;
}
 
源代码11 项目: seaglass   文件: SeaGlassToolBarUI.java
private void updateStyle(JToolBar c) {
    SeaGlassContext context = getContext(c, Region.TOOL_BAR_CONTENT, null, ENABLED);
    contentStyle = SeaGlassLookAndFeel.updateStyle(context, this);
    context.getComponent().setOpaque(false);
    context.dispose();

    context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED);
    context.getComponent().setOpaque(false);
    dragWindowStyle = SeaGlassLookAndFeel.updateStyle(context, this);
    context.dispose();

    context = getContext(c, ENABLED);
    context.getComponent().setOpaque(false);
    SynthStyle oldStyle = style;

    style = SeaGlassLookAndFeel.updateStyle(context, this);
    if (oldStyle != style) {
        handleIcon = style.getIcon(context, "ToolBar.handleIcon");
        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();
}
 
源代码12 项目: seaglass   文件: SeaGlassPopupMenuUI.java
private void updateStyle(JComponent c) {
    SeaGlassContext context = getContext(c, ENABLED);
    Window window = SwingUtilities.getWindowAncestor(popupMenu);
    if (PlatformUtils.isMac() && window != null) {
        WindowUtils.makeWindowNonOpaque(window);
    }
    SeaGlassStyle oldStyle = style;
    
    SynthStyle s = SeaGlassLookAndFeel.updateStyle(context, this);
    if (s instanceof SeaGlassStyle) {
        style = (SeaGlassStyle) s;
        if (style != oldStyle) {
            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
        }
    }
    context.dispose();
}
 
源代码13 项目: seaglass   文件: SeaGlassScrollPaneUI.java
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)) {
            scrollpane.setViewportBorder(new ViewportBorder(context));
        }
        if (oldStyle != null) {
            uninstallKeyboardActions(c);
            installKeyboardActions(c);
        }
    }
    context.dispose();
}
 
源代码14 项目: seaglass   文件: SeaGlassInternalFrameUI.java
private void updateStyle(JComponent c) {
    SeaGlassContext context = getContext(c, ENABLED);
    SynthStyle oldStyle = style;

    style = SeaGlassLookAndFeel.updateStyle(context, this);
    if (style != oldStyle) {
        Icon frameIcon = frame.getFrameIcon();
        if (frameIcon == null || frameIcon instanceof UIResource) {
            frame.setFrameIcon(context.getStyle().getIcon(context, "InternalFrame.icon"));
        }
        if (oldStyle != null) {
            uninstallKeyboardActions();
            installKeyboardActions();
        }
    }
    context.dispose();
}
 
源代码15 项目: seaglass   文件: SeaGlassInternalFrameUI.java
public void propertyChange(PropertyChangeEvent evt) {
    SynthStyle oldStyle = style;
    JInternalFrame f = (JInternalFrame) evt.getSource();
    String prop = evt.getPropertyName();

    if (SeaGlassLookAndFeel.shouldUpdateStyle(evt)) {
        updateStyle(f);
    }

    if (style == oldStyle && (prop == JInternalFrame.IS_MAXIMUM_PROPERTY || prop == JInternalFrame.IS_SELECTED_PROPERTY)) {
        // Border (and other defaults) may need to change
        SeaGlassContext context = getContext(f, ENABLED);
        style.uninstallDefaults(context);
        ((SeaGlassStyle) style).installDefaults(context, this);
    }
}
 
源代码16 项目: seaglass   文件: SeaGlassTabbedPaneUI.java
/**
 * Create a SynthContext for the component, subregion, and state.
 *
 * @param  c         the component.
 * @param  subregion the subregion.
 * @param  state     the state.
 *
 * @return the newly created SynthContext.
 */
private SeaGlassContext getContext(JComponent c, Region subregion, int state) {
    SynthStyle style = null;
    Class      klass = SeaGlassContext.class;

    if (subregion == Region.TABBED_PANE_TAB) {
        style = tabStyle;
    } else if (subregion == Region.TABBED_PANE_TAB_AREA) {
        style = tabAreaStyle;
    } else if (subregion == Region.TABBED_PANE_CONTENT) {
        style = tabContentStyle;
    } else if (subregion == SeaGlassRegion.TABBED_PANE_TAB_CLOSE_BUTTON) {
        style = tabCloseStyle;
    }

    return SeaGlassContext.getContext(klass, c, subregion, style, state);
}
 
源代码17 项目: seaglass   文件: SeaGlassComboBoxUI.java
private void updateStyle(JComboBox comboBox) {
    SeaGlassStyle oldStyle = style;
    SeaGlassContext context = getContext(comboBox, ENABLED);

    SynthStyle s = SeaGlassLookAndFeel.updateStyle(context, this);
    if (s instanceof SeaGlassStyle) {
        style = (SeaGlassStyle) s;
        if (style != oldStyle) {
            popupInsets = (Insets) style.get(context, "ComboBox.popupInsets");
            useListColors = style.getBoolean(context, "ComboBox.rendererUseListColors", true);
            buttonWhenNotEditable = style.getBoolean(context, "ComboBox.buttonWhenNotEditable", false);
            pressedWhenPopupVisible = style.getBoolean(context, "ComboBox.pressedWhenPopupVisible", false);

            if (oldStyle != null) {
                uninstallKeyboardActions();
                installKeyboardActions();
            }
            forceOpaque = style.getBoolean(context, "ComboBox.forceOpaque", false);
        }
    }
    context.dispose();
}
 
源代码18 项目: seaglass   文件: SeaGlassContext.java
/**
 * Creates a SeaGlassContext with the specified values. This is meant for
 * subclasses and custom UI implementors. You very rarely need to construct
 * a SeaGlassContext, though some methods will take one.
 *
 * @param component JComponent
 * @param region    Identifies the portion of the JComponent
 * @param style     Style associated with the component
 * @param state     State of the component as defined in SynthConstants.
 */
public SeaGlassContext(JComponent component, Region region, SynthStyle style, int state) {
    super(component, region, style, state);

    if (component == fakeComponent) {
        this.component = null;
        this.region    = null;
        this.style     = null;

        return;
    }

    if (component == null || region == null || style == null) {
        throw new NullPointerException("You must supply a non-null component, region and style");
    }

    reset(component, region, style, state);
}
 
源代码19 项目: seaglass   文件: SeaGlassGraphicsUtils.java
public static void paint(SynthContext context, SynthContext accContext, Graphics g, Icon checkIcon, Icon arrowIcon,
    String acceleratorDelimiter, int defaultTextIconGap, String propertyPrefix) {
    JMenuItem mi = (JMenuItem) context.getComponent();
    SynthStyle style = context.getStyle();
    g.setFont(style.getFont(context));

    Rectangle viewRect = new Rectangle(0, 0, mi.getWidth(), mi.getHeight());
    boolean leftToRight = SeaGlassLookAndFeel.isLeftToRight(mi);
    applyInsets(viewRect, mi.getInsets(), leftToRight);

    SeaGlassMenuItemLayoutHelper lh = new SeaGlassMenuItemLayoutHelper(context, accContext, mi, checkIcon, arrowIcon, viewRect,
        defaultTextIconGap, acceleratorDelimiter, leftToRight, MenuItemLayoutHelper.useCheckAndArrow(mi), propertyPrefix);
    MenuItemLayoutHelper.LayoutResult lr = lh.layoutMenuItem();

    paintMenuItem(g, lh, lr);
}
 
源代码20 项目: jdk1.8-source-analysis   文件: NimbusLookAndFeel.java
/** Called by UIManager when this look and feel is installed. */
@Override public void initialize() {
    super.initialize();
    defaults.initialize();
    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
        @Override
        public SynthStyle getStyle(JComponent c, Region r) {
            return defaults.getStyle(c, r);
        }
    });
}
 
源代码21 项目: jdk1.8-source-analysis   文件: NimbusDefaults.java
/**
 * <p>Locate the style associated with the given region, and component.
 * This is called from NimbusLookAndFeel in the SynthStyleFactory
 * implementation.</p>
 *
 * <p>Lookup occurs as follows:<br/>
 * Check the map of styles <code>m</code>. If the map contains no styles at
 * all, then simply return the defaultStyle. If the map contains styles,
 * then iterate over all of the styles for the Region <code>r</code> looking
 * for the best match, based on prefix. If a match was made, then return
 * that SynthStyle. Otherwise, return the defaultStyle.</p>
 *
 * @param comp The component associated with this region. For example, if
 *        the Region is Region.Button then the component will be a JButton.
 *        If the Region is a subregion, such as ScrollBarThumb, then the
 *        associated component will be the component that subregion belongs
 *        to, such as JScrollBar. The JComponent may be named. It may not be
 *        null.
 * @param r The region we are looking for a style for. May not be null.
 */
SynthStyle getStyle(JComponent comp, Region r) {
    //validate method arguments
    if (comp == null || r == null) {
        throw new IllegalArgumentException(
                "Neither comp nor r may be null");
    }

    //if there are no lazy styles registered for the region r, then return
    //the default style
    List<LazyStyle> styles = m.get(r);
    if (styles == null || styles.size() == 0) {
        return defaultStyle;
    }

    //Look for the best SynthStyle for this component/region pair.
    LazyStyle foundStyle = null;
    for (LazyStyle s : styles) {
        if (s.matches(comp)) {
            //replace the foundStyle if foundStyle is null, or
            //if the new style "s" is more specific (ie, its path was
            //longer), or if the foundStyle was "simple" and the new style
            //was not (ie: the foundStyle was for something like Button and
            //the new style was for something like "MyButton", hence, being
            //more specific.) In all cases, favor the most specific style
            //found.
            if (foundStyle == null ||
               (foundStyle.parts.length < s.parts.length) ||
               (foundStyle.parts.length == s.parts.length 
                && foundStyle.simple && !s.simple)) {
                foundStyle = s;
            }
        }
    }

    //return the style, if found, or the default style if not found
    return foundStyle == null ? defaultStyle : foundStyle.getStyle(comp, r);
}
 
源代码22 项目: jdk1.8-source-analysis   文件: NimbusDefaults.java
/**
 * Gets the style. Creates it if necessary.
 * @return the style
 */
SynthStyle getStyle(JComponent c, Region r) {
    // if the component has overrides, it gets its own unique style
    // instead of the shared style.
    if (c.getClientProperty("Nimbus.Overrides") != null) {
        Map<Region, SynthStyle> map = overridesCache.get(c);
        SynthStyle s = null;
        if (map == null) {
            map = new HashMap<Region, SynthStyle>();
            overridesCache.put(c, map);
        } else {
            s = map.get(r);
        }
        if (s == null) {
            s = new NimbusStyle(prefix, c);
            map.put(r, s);
        }
        return s;
    }
    
    // lazily create the style if necessary
    if (style == null)
        style = new NimbusStyle(prefix, null);
    
    // return the style
    return style;
}
 
源代码23 项目: dragonwell8_jdk   文件: NimbusLookAndFeel.java
/** Called by UIManager when this look and feel is installed. */
@Override public void initialize() {
    super.initialize();
    defaults.initialize();
    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
        @Override
        public SynthStyle getStyle(JComponent c, Region r) {
            return defaults.getStyle(c, r);
        }
    });
}
 
源代码24 项目: TencentKona-8   文件: NimbusLookAndFeel.java
/** Called by UIManager when this look and feel is installed. */
@Override public void initialize() {
    super.initialize();
    defaults.initialize();
    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
        @Override
        public SynthStyle getStyle(JComponent c, Region r) {
            return defaults.getStyle(c, r);
        }
    });
}
 
源代码25 项目: jdk8u60   文件: NimbusLookAndFeel.java
/** Called by UIManager when this look and feel is installed. */
@Override public void initialize() {
    super.initialize();
    defaults.initialize();
    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
        @Override
        public SynthStyle getStyle(JComponent c, Region r) {
            return defaults.getStyle(c, r);
        }
    });
}
 
源代码26 项目: JDKSourceCode1.8   文件: NimbusLookAndFeel.java
/** Called by UIManager when this look and feel is installed. */
@Override public void initialize() {
    super.initialize();
    defaults.initialize();
    // create synth style factory
    setStyleFactory(new SynthStyleFactory() {
        @Override
        public SynthStyle getStyle(JComponent c, Region r) {
            return defaults.getStyle(c, r);
        }
    });
}
 
源代码27 项目: JDKSourceCode1.8   文件: NimbusDefaults.java
/**
 * <p>Locate the style associated with the given region, and component.
 * This is called from NimbusLookAndFeel in the SynthStyleFactory
 * implementation.</p>
 *
 * <p>Lookup occurs as follows:<br/>
 * Check the map of styles <code>m</code>. If the map contains no styles at
 * all, then simply return the defaultStyle. If the map contains styles,
 * then iterate over all of the styles for the Region <code>r</code> looking
 * for the best match, based on prefix. If a match was made, then return
 * that SynthStyle. Otherwise, return the defaultStyle.</p>
 *
 * @param comp The component associated with this region. For example, if
 *        the Region is Region.Button then the component will be a JButton.
 *        If the Region is a subregion, such as ScrollBarThumb, then the
 *        associated component will be the component that subregion belongs
 *        to, such as JScrollBar. The JComponent may be named. It may not be
 *        null.
 * @param r The region we are looking for a style for. May not be null.
 */
SynthStyle getStyle(JComponent comp, Region r) {
    //validate method arguments
    if (comp == null || r == null) {
        throw new IllegalArgumentException(
                "Neither comp nor r may be null");
    }

    //if there are no lazy styles registered for the region r, then return
    //the default style
    List<LazyStyle> styles = m.get(r);
    if (styles == null || styles.size() == 0) {
        return defaultStyle;
    }

    //Look for the best SynthStyle for this component/region pair.
    LazyStyle foundStyle = null;
    for (LazyStyle s : styles) {
        if (s.matches(comp)) {
            //replace the foundStyle if foundStyle is null, or
            //if the new style "s" is more specific (ie, its path was
            //longer), or if the foundStyle was "simple" and the new style
            //was not (ie: the foundStyle was for something like Button and
            //the new style was for something like "MyButton", hence, being
            //more specific.) In all cases, favor the most specific style
            //found.
            if (foundStyle == null ||
               (foundStyle.parts.length < s.parts.length) ||
               (foundStyle.parts.length == s.parts.length 
                && foundStyle.simple && !s.simple)) {
                foundStyle = s;
            }
        }
    }

    //return the style, if found, or the default style if not found
    return foundStyle == null ? defaultStyle : foundStyle.getStyle(comp, r);
}
 
源代码28 项目: JDKSourceCode1.8   文件: NimbusDefaults.java
/**
 * Gets the style. Creates it if necessary.
 * @return the style
 */
SynthStyle getStyle(JComponent c, Region r) {
    // if the component has overrides, it gets its own unique style
    // instead of the shared style.
    if (c.getClientProperty("Nimbus.Overrides") != null) {
        Map<Region, SynthStyle> map = overridesCache.get(c);
        SynthStyle s = null;
        if (map == null) {
            map = new HashMap<Region, SynthStyle>();
            overridesCache.put(c, map);
        } else {
            s = map.get(r);
        }
        if (s == null) {
            s = new NimbusStyle(prefix, c);
            map.put(r, s);
        }
        return s;
    }
    
    // lazily create the style if necessary
    if (style == null)
        style = new NimbusStyle(prefix, null);
    
    // return the style
    return style;
}
 
源代码29 项目: consulo   文件: LafManagerImpl.java
private static void patchOptionPaneIcons(final UIDefaults defaults) {
  if (UIUtil.isUnderGTKLookAndFeel() && defaults.get(ourOptionPaneIconKeys[0]) == null) {
    // GTK+ L&F keeps icons hidden in style
    final SynthStyle style = SynthLookAndFeel.getStyle(new JOptionPane(""), Region.DESKTOP_ICON);
    if (style != null) {
      for (final String key : ourOptionPaneIconKeys) {
        final Object icon = style.get(null, key);
        if (icon != null) defaults.put(key, icon);
      }
    }
  }
}
 
源代码30 项目: netbeans   文件: ToolbarContainer.java
/** Paint bumps to specific Graphics. */
@Override
public void paint (Graphics g) {
    Icon icon = UIManager.getIcon("ToolBar.handleIcon");
    Region region = Region.TOOL_BAR;
    SynthStyleFactory sf = SynthLookAndFeel.getStyleFactory();
    SynthStyle style = sf.getStyle(toolbar, region);
    SynthContext context = new SynthContext(toolbar, region, style, SynthConstants.DEFAULT);

    SynthGraphicsUtils sgu = context.getStyle().getGraphicsUtils(context);
    sgu.paintText(context, g, null, icon, SwingConstants.LEADING, SwingConstants.LEADING, 0, 0, 0, -1, 0);
}
 
 类所在包
 类方法
 同包方法