本文整理汇总了Java中sun.swing.plaf.synth.SynthIcon.paintIcon方法的典型用法代码示例。如果您正苦于以下问题:Java SynthIcon.paintIcon方法的具体用法?Java SynthIcon.paintIcon怎么用?Java SynthIcon.paintIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.swing.plaf.synth.SynthIcon
的用法示例。
在下文中一共展示了SynthIcon.paintIcon方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例6: 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);
}
示例7: 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);
}
}
示例8: paintCheckIcon
import sun.swing.plaf.synth.SynthIcon; //导入方法依赖的package包/类
static void paintCheckIcon(Graphics g, SeaGlassMenuItemLayoutHelper lh,
MenuItemLayoutHelper.LayoutResult lr) {
if (lh.getCheckIcon() != null) {
Rectangle checkRect = lr.getCheckRect();
SynthIcon.paintIcon(lh.getCheckIcon(), lh.getContext(), g,
checkRect.x, checkRect.y, checkRect.width, checkRect.height);
}
}
示例9: paintArrowIcon
import sun.swing.plaf.synth.SynthIcon; //导入方法依赖的package包/类
static void paintArrowIcon(Graphics g, SeaGlassMenuItemLayoutHelper lh,
MenuItemLayoutHelper.LayoutResult lr) {
if (lh.getArrowIcon() != null) {
Rectangle arrowRect = lr.getArrowRect();
SynthIcon.paintIcon(lh.getArrowIcon(), lh.getContext(), g,
arrowRect.x, arrowRect.y, arrowRect.width, arrowRect.height);
}
}
示例10: 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);
}