APIdia Launch Partner
Top Description Fields Constructors Methods
sun.swing.icon

public Class SortArrowIcon

extends Object
implements Icon, UIResource, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.plaf.UIResource, javax.swing.Icon
Annotations
@SuppressWarnings:serial
Imports
java.awt.Color, .Component, .Graphics, java.io.Serializable, javax.swing.Icon, .UIManager, javax.swing.plaf.UIResource

Sorting icon.

Field Summary

Modifier and TypeField and Description
private static final int
private boolean
private Color
private String
private static final int

Constructor Summary

AccessConstructor and Description
public
SortArrowIcon(boolean
if true, icon representing ascending sort, otherwise descending
ascending
,
Color
the color to render the icon
color
)

Creates a SortArrowIcon.

public
SortArrowIcon(boolean
if true, icon representing ascending sort, otherwise descending
ascending
,
String
the key used to find color in UIManager
colorKey
)

Creates a SortArrowIcon.

Method Summary

Modifier and TypeMethod and Description
private Color
public int
getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Returns the icon's height.

public int
getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Returns the icon's width.

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

Implements javax.swing.Icon.paintIcon.

Draw the icon at the specified location.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARROW_HEIGHTback to summary
private static final int ARROW_HEIGHT
ascendingback to summary
private boolean ascending
colorback to summary
private Color color
colorKeyback to summary
private String colorKey
X_PADDINGback to summary
private static final int X_PADDING

Constructor Detail

SortArrowIconback to summary
public SortArrowIcon(boolean ascending, Color color)

Creates a SortArrowIcon.

Parameters
ascending:boolean

if true, icon representing ascending sort, otherwise descending

color:Color

the color to render the icon

SortArrowIconback to summary
public SortArrowIcon(boolean ascending, String colorKey)

Creates a SortArrowIcon.

Parameters
ascending:boolean

if true, icon representing ascending sort, otherwise descending

colorKey:String

the key used to find color in UIManager

Method Detail

getColorback to summary
private Color getColor()
getIconHeightback to summary
public int getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.Icon.getIconHeight.

Returns the icon's height.

getIconWidthback to summary
public int getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.Icon.getIconWidth.

Returns the icon's width.

paintIconback to summary
public 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.