APIdia Launch Partner
Top Description Methods
javax.swing.plaf.synth

public Interface SynthIcon

extends Icon
Known Direct Implementers
javax.swing.plaf.synth.SynthTreeUI.IconWrapper, com.sun.java.swing.plaf.gtk.GTKIconFactory.DelegatingIcon, com.sun.java.swing.plaf.gtk.GTKStyle.GTKStockIcon, javax.swing.plaf.nimbus.NimbusIcon
Imports
java.awt.*, javax.swing.*

An icon that is passed a SynthContext. Subclasses need only implement the variants that take a SynthContext, but must be prepared for the SynthContext to be null.
Author
Scott Violet

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

an int specifying the height of the icon.
getIconHeight
(SynthContext
SynthContext requesting the Icon, may be null.
context
)

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

public default int
getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Returns the icon's height.

public int

Returns:

an int specifying the width of the icon.
getIconWidth
(SynthContext
SynthContext requesting the Icon, may be null.
context
)

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

public default int
getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Returns the icon's width.

public void
paintIcon(SynthContext
identifies hosting region, may be null.
context
,
Graphics
the graphics context
g
,
int
the x location to paint to
x
,
int
the y location to paint to
y
,
int
the width of the region to paint to, may be 0
width
,
int
the height of the region to paint to, may be 0
height
)

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

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

Implements javax.swing.Icon.paintIcon.

Draw the icon at the specified location.

Method Detail

getIconHeightback to summary
public int getIconHeight(SynthContext context)

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

Parameters
context:SynthContext

SynthContext requesting the Icon, may be null.

Returns:int

an int specifying the height of the icon.

getIconHeightback to summary
public default int getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.Icon.getIconHeight.

Returns the icon's height.

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

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

Parameters
context:SynthContext

SynthContext requesting the Icon, may be null.

Returns:int

an int specifying the width of the icon.

getIconWidthback to summary
public default int getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.Icon.getIconWidth.

Returns the icon's width.

Annotations
@Override
paintIconback to summary
public void paintIcon(SynthContext context, Graphics g, int x, int y, int width, int height)

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

Parameters
context:SynthContext

identifies hosting region, may be null.

g:Graphics

the graphics context

x:int

the x location to paint to

y:int

the y location to paint to

width:int

the width of the region to paint to, may be 0

height:int

the height of the region to paint to, may be 0

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

Implements javax.swing.Icon.paintIcon.

Doc from javax.swing.Icon.paintIcon.

Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Annotations
@Override