|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.moneydance.awt.ArrowIcon
public class ArrowIcon
ArrowIcon is an icon with given arrow shape, defined by the direction, enable status, and size (length and width).
Here's a diagram:
A |\ | \ C--E | / |/ B
where distance C - E is the length of the arrow, while distance A - B is the width of the arrow. A width of zero is not allowed, but a length of zero is allowed and creates a bar of the specified width.
When a triangle shape is selected, the ArrowHead
class is used to draw the
triangle.
Field Summary | |
---|---|
static int |
EAST
The arrow should point to the east. |
static int |
NORTH
The arrow should point to the north. |
static int |
SOUTH
The arrow should point to the south. |
static int |
WEST
The arrow should point to the west. |
Constructor Summary | |
---|---|
ArrowIcon(int direction,
boolean isEnabled)
Create an ArrowIcon with the given direction and enablement status and the default size and length. |
|
ArrowIcon(int direction,
boolean isEnabled,
int length,
int width)
Create an ArrowIcon with given direction, enable status, shape, and size. |
Method Summary | |
---|---|
int |
getDirection()
Get the arrow icon direction. |
int |
getIconHeight()
Returns the icon's height. |
int |
getIconWidth()
Returns the icon's width. |
void |
paintIcon(java.awt.Component comp,
java.awt.Graphics graphics,
int xValue,
int yValue)
Draw the icon. |
void |
setEnabled(boolean isEnabled)
Set the enable status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SOUTH
public static final int NORTH
public static final int EAST
public static final int WEST
Constructor Detail |
---|
public ArrowIcon(int direction, boolean isEnabled)
direction
- Direction of the arrow, could be SwingConstants.SOUTH, SwingConstants.NORTH,
SwingConstants.EAST, or SwingConstants.WESTisEnabled
- Represents the enable status of the ArrowIcon. Paint in foreground text
color if true, or disabled color if false.public ArrowIcon(int direction, boolean isEnabled, int length, int width)
Create an ArrowIcon with given direction, enable status, shape, and size.
To get the real height and width of the icon need to use getIconHeight()
and
getIconWidth()
.
direction
- direction of the arrow, could be SwingConstants.SOUTH, SwingConstants.NORTH,
SwingConstants.EAST, or SwingConstants.WESTisEnabled
- Represents the enable status of the ArrowIcon. Paint in foreground
text color if true, or disabled color if false.length
- The length of the icon, see the class notes
. If less than
zero, length is set to zero.width
- The width of the icon, see the class notes
. If less than one,
width is set to one.Method Detail |
---|
public void paintIcon(java.awt.Component comp, java.awt.Graphics graphics, int xValue, int yValue)
paintIcon
in interface javax.swing.Icon
comp
- Component parameter.graphics
- Graphics.xValue
- Left position.yValue
- Top position.public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getDirection()
public void setEnabled(boolean isEnabled)
isEnabled
- true if enabled, false otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |