|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.ArrowIcon
public class ArrowIcon
ArrowIcon is used by the SpinButton
to paint the up/down
arrows on the buttons. ArrowIcon implements Icon
so it can be used on any
AbstractButton
. The constructor for the ArrowIcon can take a direction
that the arrow is supposed to be painted in, using the SwingConstants
NORTH, SOUTH, WEST, and EAST as valid values. Also, you can set whether the arrow should be painted
pressed (just translates the arrow down and to the right 1 pixel). This functionality is added as
a convenience to the user if they want a more visual appearance of the button being pressed. The default
direction the Arrow faces is down (south).
Icon
,
SpinBox
,
Field Summary | |
---|---|
protected int |
arrowDirection
|
protected boolean |
pressed
|
Constructor Summary | |
---|---|
ArrowIcon()
Default constructor, creates a arrow facing down (south). |
|
ArrowIcon(boolean pressed)
Creates a arrow facing down (south), and if pressed is true, the arrow will be moved down and to the right one pixel. |
|
ArrowIcon(int direction)
Creates a arrow facing in the direction specified. |
|
ArrowIcon(int direction,
boolean pressed)
Creates a arrow facing in the direction specified. |
Method Summary | |
---|---|
int |
getDirection()
Returns the SwingConstants representing the direction the arrow is facing. |
int |
getIconHeight()
Stubbed to statify the interface. |
int |
getIconWidth()
Stubbed to statify the interface. |
boolean |
isPressed()
Returns whether the arrow is to be painted in pressed mode, that is, move the arrow down and to the right one pixel. |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints the arrow in the specified direction. |
void |
setDirection(int newValue)
Sets the direction the arrow is to face when painted. |
void |
setPressed(boolean newValue)
Sets whether the arrow is to be painted in pressed mode, that is, move the arrow down and to the right one pixel. |
Field Detail |
---|
protected int arrowDirection
protected boolean pressed
Constructor Detail |
---|
public ArrowIcon()
SwingConstants
public ArrowIcon(int direction)
direction
- The direction the arrow is to faceSwingConstants
public ArrowIcon(boolean pressed)
pressed
- true to have the arrow moved down and to the right one pixel, false otherwiseSwingConstants
public ArrowIcon(int direction, boolean pressed)
direction
- The direction the arrow is to facepressed
- true to have the arrow moved down and to the right one pixel, false otherwiseSwingConstants
Method Detail |
---|
public void setDirection(int newValue)
newValue
- The direction the arrow is to faceSwingConstants
public int getDirection()
SwingConstants
public void setPressed(boolean newValue)
newValue
- true to have the arrow moved down and to the right one pixel, false otherwisepublic boolean isPressed()
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |