Package org.jfree.ui
Class BevelArrowIcon
- java.lang.Object
-
- org.jfree.ui.BevelArrowIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class BevelArrowIcon extends java.lang.Object implements javax.swing.IconAn 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
Fields Modifier and Type Field Description private static intDEFAULT_SIZEThe default arrow size.private intdirectionThe direction that the arrow is pointing (UP or DOWN).static intDOWNConstant indicating that the arrow is pointing down.private java.awt.Coloredge1Edge color 1.private java.awt.Coloredge2Edge color 2.private java.awt.ColorfillThe fill color for the arrow icon.private intsizeThe size of the icon.static intUPConstant indicating that the arrow is pointing up.
-
Constructor Summary
Constructors Constructor Description BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView)Standard constructor - builds an icon with the specified attributes.BevelArrowIcon(java.awt.Color edge1, java.awt.Color edge2, java.awt.Color fill, int size, int direction)Standard constructor - builds an icon with the specified attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddrawDownArrow(java.awt.Graphics g, int xo, int yo)Draws the arrow pointing down.private voiddrawUpArrow(java.awt.Graphics g, int xo, int yo)Draws the arrow pointing up.intgetIconHeight()Returns the height of the icon.intgetIconWidth()Returns the width of the icon.private voidinit(java.awt.Color edge1, java.awt.Color edge2, java.awt.Color fill, int size, int direction)Initialises the attributes of the arrow icon.voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)Paints the icon at the specified position.
-
-
-
Field Detail
-
UP
public static final int UP
Constant indicating that the arrow is pointing up.- See Also:
- Constant Field Values
-
DOWN
public static final int DOWN
Constant indicating that the arrow is pointing down.- See Also:
- Constant Field Values
-
DEFAULT_SIZE
private static final int DEFAULT_SIZE
The default arrow size.- See Also:
- Constant Field Values
-
edge1
private java.awt.Color edge1
Edge color 1.
-
edge2
private java.awt.Color edge2
Edge color 2.
-
fill
private java.awt.Color fill
The fill color for the arrow icon.
-
size
private int size
The size of the icon.
-
direction
private int direction
The direction that the arrow is pointing (UP or DOWN).
-
-
Constructor Detail
-
BevelArrowIcon
public BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView)Standard constructor - builds an icon with the specified attributes.- Parameters:
direction- .isRaisedView- .isPressedView- .
-
BevelArrowIcon
public BevelArrowIcon(java.awt.Color edge1, java.awt.Color edge2, java.awt.Color fill, int size, int direction)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 Detail
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)Paints the icon at the specified position. Supports the Icon interface.- Specified by:
paintIconin interfacejavax.swing.Icon- Parameters:
c- .g- .x- .y- .
-
getIconWidth
public int getIconWidth()
Returns the width of the icon. Supports the Icon interface.- Specified by:
getIconWidthin interfacejavax.swing.Icon- Returns:
- the icon width.
-
getIconHeight
public int getIconHeight()
Returns the height of the icon. Supports the Icon interface.- Specified by:
getIconHeightin interfacejavax.swing.Icon- Returns:
- the icon height.
-
init
private void init(java.awt.Color edge1, java.awt.Color edge2, java.awt.Color fill, int size, int direction)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
private void drawDownArrow(java.awt.Graphics g, int xo, int yo)Draws the arrow pointing down.- Parameters:
g- the graphics device.xo- ??yo- ??
-
drawUpArrow
private void drawUpArrow(java.awt.Graphics g, int xo, int yo)Draws the arrow pointing up.- Parameters:
g- the graphics device.xo- ??yo- ??
-
-