Java Code Examples for sun.swing.plaf.synth.SynthIcon#getIconWidth()
The following examples show how to use
sun.swing.plaf.synth.SynthIcon#getIconWidth() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SynthToolBarUI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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(); }
Example 2
Source File: SynthToolBarUI.java From Java8CN with Apache License 2.0 | 6 votes |
/** * 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(); }
Example 3
Source File: SynthToolBarUI.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * 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(); }
Example 4
Source File: SynthToolBarUI.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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(); }
Example 5
Source File: SynthToolBarUI.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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(); }
Example 6
Source File: SynthToolBarUI.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * 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(); }
Example 7
Source File: SynthTreeUI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 8
Source File: SynthTreeUI.java From Java8CN with Apache License 2.0 | 5 votes |
/** * {@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); }
Example 9
Source File: SynthTreeUI.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 10
Source File: SynthTreeUI.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 11
Source File: SynthTreeUI.java From Java8CN with Apache License 2.0 | 5 votes |
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; }
Example 12
Source File: SynthTreeUI.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * {@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); }
Example 13
Source File: SynthTreeUI.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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; }
Example 14
Source File: SynthTreeUI.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
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; }
Example 15
Source File: SynthTreeUI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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; }
Example 16
Source File: SynthTreeUI.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 17
Source File: SynthTreeUI.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 18
Source File: SynthTreeUI.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * {@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); }
Example 19
Source File: SynthTreeUI.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
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; }
Example 20
Source File: SynthTreeUI.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
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; }