本文整理汇总了Java中sun.swing.plaf.synth.SynthIcon.getIconWidth方法的典型用法代码示例。如果您正苦于以下问题:Java SynthIcon.getIconWidth方法的具体用法?Java SynthIcon.getIconWidth怎么用?Java SynthIcon.getIconWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.swing.plaf.synth.SynthIcon
的用法示例。
在下文中一共展示了SynthIcon.getIconWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例3: 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;
}
示例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: 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);
((SeaGlassContext)context).dispose();
} else {
width = SynthIcon.getIconWidth(expandedIcon, context);
}
return width;
}
示例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);
}