当前位置: 首页>>代码示例>>Java>>正文


Java SynthIcon类代码示例

本文整理汇总了Java中sun.swing.plaf.synth.SynthIcon的典型用法代码示例。如果您正苦于以下问题:Java SynthIcon类的具体用法?Java SynthIcon怎么用?Java SynthIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SynthIcon类属于sun.swing.plaf.synth包,在下文中一共展示了SynthIcon类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paint

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
/**
 * Paints the toolbar.
 *
 * @param context context for the component being painted
 * @param g the {@code Graphics} object used for painting
 * @see #update(Graphics,JComponent)
 */
protected void paint(SynthContext context, Graphics g) {
    if (handleIcon != null && toolBar.isFloatable()) {
        int startX = toolBar.getComponentOrientation().isLeftToRight() ?
            0 : toolBar.getWidth() -
                SynthIcon.getIconWidth(handleIcon, context);
        SynthIcon.paintIcon(handleIcon, context, g, startX, 0,
                SynthIcon.getIconWidth(handleIcon, context),
                SynthIcon.getIconHeight(handleIcon, context));
    }

    SynthContext subcontext = getContext(
            toolBar, Region.TOOL_BAR_CONTENT, contentStyle);
    paintContent(subcontext, g, contentRect);
    subcontext.dispose();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:SynthToolBarUI.java

示例2: paintIcon

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
static void paintIcon(Graphics g, SeaGlassMenuItemLayoutHelper lh,
                      MenuItemLayoutHelper.LayoutResult lr) {
    if (lh.getIcon() != null) {
        Icon icon;
        JMenuItem mi = lh.getMenuItem();
        ButtonModel model = mi.getModel();
        if (!model.isEnabled()) {
            icon = mi.getDisabledIcon();
        } else if (model.isPressed() && model.isArmed()) {
            icon = mi.getPressedIcon();
            if (icon == null) {
                // Use default icon
                icon = mi.getIcon();
            }
        } else {
            icon = mi.getIcon();
        }

        if (icon != null) {
            Rectangle iconRect = lr.getIconRect();
            SynthIcon.paintIcon(icon, lh.getContext(), g, iconRect.x,
                    iconRect.y, iconRect.width, iconRect.height);
        }
    }
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:26,代码来源:SeaGlassGraphicsUtils.java

示例3: getDisabledIcon

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
@Override
public Icon getDisabledIcon(JComponent component, Icon icon) {
    if (icon instanceof SynthIcon) {
        SynthIcon si = (SynthIcon)icon;
        BufferedImage img = EffectUtils.createCompatibleTranslucentImage(
                si.getIconWidth(), si.getIconHeight());
        Graphics2D gfx = img.createGraphics();
        si.paintIcon(component, gfx, 0, 0);
        gfx.dispose();
        return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
    } else {
        return super.getDisabledIcon(component, icon);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:NimbusLookAndFeel.java

示例4: drawCentered

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void drawCentered(Component c, Graphics graphics, Icon icon,
                            int x, int y) {
    int w = SynthIcon.getIconWidth(icon, paintContext);
    int h = SynthIcon.getIconHeight(icon, paintContext);

    SynthIcon.paintIcon(icon, paintContext, graphics,
                        findCenteredX(x, w),
                        y - h/2, w, h);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:SynthTreeUI.java

示例5: paintIcon

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
public void paintIcon(SynthContext context, Graphics g, int x,
                      int y, int w, int h) {
    if (context == null) {
        context = getContext(tree);
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
        context.dispose();
    }
    else {
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SynthTreeUI.java

示例6: getIconWidth

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
public int getIconWidth(SynthContext context) {
    int width;
    if (context == null) {
        context = getContext(tree);
        width = SynthIcon.getIconWidth(expandedIcon, context);
        context.dispose();
    }
    else {
        width = SynthIcon.getIconWidth(expandedIcon, context);
    }
    return width;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:SynthTreeUI.java

示例7: getIconHeight

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
public int getIconHeight(SynthContext context) {
    int height;
    if (context == null) {
        context = getContext(tree);
        height = SynthIcon.getIconHeight(expandedIcon, context);
        context.dispose();
    }
    else {
        height = SynthIcon.getIconHeight(expandedIcon, context);
    }
    return height;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:SynthTreeUI.java

示例8: drawCentered

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
/**
 * @inheritDoc
 */
@Override
protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y) {
    int w = SynthIcon.getIconWidth(icon, paintContext);
    int h = SynthIcon.getIconHeight(icon, paintContext);

    SynthIcon.paintIcon(icon, paintContext, graphics, findCenteredX(x, w), y - h / 2, w, h);
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:11,代码来源:SeaGlassTreeUI.java

示例9: paintIcon

import sun.swing.plaf.synth.SynthIcon; //导入依赖的package包/类
public void paintIcon(SynthContext context, Graphics g, int x, int y, int w, int h) {
    if (context == null) {
        context = getContext(tree);
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
        ((SeaGlassContext)context).dispose();
    } else {
        SynthIcon.paintIcon(expandedIcon, context, g, x, y, w, h);
    }
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:10,代码来源:SeaGlassTreeUI.java


注:本文中的sun.swing.plaf.synth.SynthIcon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。