Package org.jfree.ui
Class BevelArrowIcon
java.lang.Object
org.jfree.ui.BevelArrowIcon
- All Implemented Interfaces:
Icon
An arrow icon that can point up or down (usually used to indicate the sort direction in a table).
This class (and also SortButtonRenderer) is based on original code by Nobuo Tamemasa (version 1.0, 26-Feb-1999) posted on www.codeguru.com.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
The default arrow size.private int
The direction that the arrow is pointing (UP or DOWN).static final int
Constant indicating that the arrow is pointing down.private Color
Edge color 1.private Color
Edge color 2.private Color
The fill color for the arrow icon.private int
The size of the icon.static final int
Constant indicating that the arrow is pointing up. -
Constructor Summary
ConstructorsConstructorDescriptionBevelArrowIcon
(int direction, boolean isRaisedView, boolean isPressedView) Standard constructor - builds an icon with the specified attributes.BevelArrowIcon
(Color edge1, Color edge2, Color fill, int size, int direction) Standard constructor - builds an icon with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
drawDownArrow
(Graphics g, int xo, int yo) Draws the arrow pointing down.private void
drawUpArrow
(Graphics g, int xo, int yo) Draws the arrow pointing up.int
Returns the height of the icon.int
Returns the width of the icon.private void
Initialises the attributes of the arrow icon.void
Paints the icon at the specified position.
-
Field Details
-
UP
public static final int UPConstant indicating that the arrow is pointing up.- See Also:
-
DOWN
public static final int DOWNConstant indicating that the arrow is pointing down.- See Also:
-
DEFAULT_SIZE
private static final int DEFAULT_SIZEThe default arrow size.- See Also:
-
edge1
Edge color 1. -
edge2
Edge color 2. -
fill
The fill color for the arrow icon. -
size
private int sizeThe size of the icon. -
direction
private int directionThe direction that the arrow is pointing (UP or DOWN).
-
-
Constructor Details
-
BevelArrowIcon
public BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView) Standard constructor - builds an icon with the specified attributes.- Parameters:
direction
- .isRaisedView
- .isPressedView
- .
-
BevelArrowIcon
Standard constructor - builds an icon with the specified attributes.- Parameters:
edge1
- the color of edge1.edge2
- the color of edge2.fill
- the fill color.size
- the size of the arrow icon.direction
- the direction that the arrow points.
-
-
Method Details
-
paintIcon
Paints the icon at the specified position. Supports the Icon interface. -
getIconWidth
public int getIconWidth()Returns the width of the icon. Supports the Icon interface.- Specified by:
getIconWidth
in interfaceIcon
- Returns:
- the icon width.
-
getIconHeight
public int getIconHeight()Returns the height of the icon. Supports the Icon interface.- Specified by:
getIconHeight
in interfaceIcon
- Returns:
- the icon height.
-
init
Initialises the attributes of the arrow icon.- Parameters:
edge1
- the color of edge1.edge2
- the color of edge2.fill
- the fill color.size
- the size of the arrow icon.direction
- the direction that the arrow points.
-
drawDownArrow
Draws the arrow pointing down.- Parameters:
g
- the graphics device.xo
- ??yo
- ??
-
drawUpArrow
Draws the arrow pointing up.- Parameters:
g
- the graphics device.xo
- ??yo
- ??
-