APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.nimbus

pack-priv Class NimbusIcon

extends Object
implements SynthIcon, UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource, javax.swing.plaf.synth.SynthIcon, javax.swing.Icon
Imports
javax.swing.JComponent, .JMenu, .JToolBar, .Painter, .UIManager, javax.swing.plaf.UIResource, javax.swing.plaf.synth.SynthContext, .SynthIcon, java.awt.BorderLayout, .Component, .Graphics2D, .Graphics, java.awt.image.BufferedImage

An icon that delegates to a painter.
Author
rbair

Field Summary

Modifier and TypeField and Description
private int
private String
private String
private int

Constructor Summary

AccessConstructor and Description
pack-priv
NimbusIcon(String prefix, String key, int w, int h)

Method Summary

Modifier and TypeMethod and Description
public int
getIconHeight(SynthContext context)

Implements javax.swing.plaf.synth.SynthIcon.getIconHeight.

Returns the icon's height for the given synth context.

public int
getIconWidth(SynthContext context)

Implements javax.swing.plaf.synth.SynthIcon.getIconWidth.

Returns the icon's width for the given synth context.

private static Painter<JComponent>
paintFilter(Painter<T> painter)

public void
paintIcon(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthIcon.paintIcon.

Paints the icon at the specified location for the given synth context.

public void
paintIcon(Component c, Graphics g, int x, int y)

Overrides default javax.swing.plaf.synth.SynthIcon.paintIcon.

Implements the standard Icon interface's paintIcon method as the standard synth stub passes null for the context and this will cause us to not paint any thing, so we override here so that we can paint the enabled state if no synth context is available

private int

Returns:

The scaled size or original if "JComponent.sizeVariant" is not set
scale
(SynthContext
The synthContext to get the component from
context
,
int
The size to scale
size
)

Scale a size based on the "JComponent.sizeVariant" client property of the component that is using this icon

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

heightback to summary
private int height
keyback to summary
private String key
prefixback to summary
private String prefix
widthback to summary
private int width

Constructor Detail

NimbusIconback to summary
pack-priv NimbusIcon(String prefix, String key, int w, int h)

Method Detail

getIconHeightback to summary
public int getIconHeight(SynthContext context)

Implements javax.swing.plaf.synth.SynthIcon.getIconHeight.

Doc from javax.swing.plaf.synth.SynthIcon.getIconHeight.

Returns the icon's height for the given synth context.

Annotations
@Override
getIconWidthback to summary
public int getIconWidth(SynthContext context)

Implements javax.swing.plaf.synth.SynthIcon.getIconWidth.

Doc from javax.swing.plaf.synth.SynthIcon.getIconWidth.

Returns the icon's width for the given synth context.

Annotations
@Override
paintFilterback to summary
private static Painter<JComponent> paintFilter(Painter<T> painter)
Annotations
@SuppressWarnings:unchecked
paintIconback to summary
public void paintIcon(SynthContext context, Graphics g, int x, int y, int w, int h)

Implements javax.swing.plaf.synth.SynthIcon.paintIcon.

Doc from javax.swing.plaf.synth.SynthIcon.paintIcon.

Paints the icon at the specified location for the given synth context.

Annotations
@Override
paintIconback to summary
public void paintIcon(Component c, Graphics g, int x, int y)

Overrides default javax.swing.plaf.synth.SynthIcon.paintIcon.

Implements the standard Icon interface's paintIcon method as the standard synth stub passes null for the context and this will cause us to not paint any thing, so we override here so that we can paint the enabled state if no synth context is available

Annotations
@Override
scaleback to summary
private int scale(SynthContext context, int size)

Scale a size based on the "JComponent.sizeVariant" client property of the component that is using this icon

Parameters
context:SynthContext

The synthContext to get the component from

size:int

The size to scale

Returns:int

The scaled size or original if "JComponent.sizeVariant" is not set