Mp3dings 
20100427

de.mospace.swing.icon
Class DoubleArrowIcon

java.lang.Object
  extended by de.mospace.swing.icon.DoubleArrowIcon
All Implemented Interfaces:
Icon

public class DoubleArrowIcon
extends Object
implements Icon

A java icon with two flat arrows pointing up, left, right, or down.

Version:
$Revision: 12 $ ($Date: 2007-07-27 11:48:53 +0200 (Fr, 27 Jul 2007) $)
Author:
Moritz Ringler

Field Summary
static int DIRECTION_DOWN
          Constant for arrows pointing down.
static int DIRECTION_LEFT
          Constant for arrows pointing left.
static int DIRECTION_RIGHT
          Constant for arrows pointing right.
static int DIRECTION_UP
          Constant for arrows pointing up.
 
Constructor Summary
DoubleArrowIcon(int direction)
          Constructs a new double arrow icon that has the default size and arrows that point in the specified direction.
DoubleArrowIcon(int size, int direction)
          Constructs a new double arrow icon with the specified size and arrows that points in the specified direction.
 
Method Summary
 int getDirection()
          Returns the current direction of the arrow.
 int getIconHeight()
          Gets the height of this arrow icon.
 int getIconWidth()
          Gets the width of this arrow icon.
 void paintIcon(Component c, Graphics g, int x, int y)
          Paints this icon on the specified graphics object at the specified location.
 void setDirection(int d)
          Alters the direction of the arrows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTION_UP

public static final int DIRECTION_UP
Constant for arrows pointing up.

See Also:
Constant Field Values

DIRECTION_DOWN

public static final int DIRECTION_DOWN
Constant for arrows pointing down.

See Also:
Constant Field Values

DIRECTION_LEFT

public static final int DIRECTION_LEFT
Constant for arrows pointing left.

See Also:
Constant Field Values

DIRECTION_RIGHT

public static final int DIRECTION_RIGHT
Constant for arrows pointing right.

See Also:
Constant Field Values
Constructor Detail

DoubleArrowIcon

public DoubleArrowIcon(int direction)
Constructs a new double arrow icon that has the default size and arrows that point in the specified direction.

Parameters:
direction - the direction of the arrows. One of DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, or DIRECTION_RIGHTS.

DoubleArrowIcon

public DoubleArrowIcon(int size,
                       int direction)
Constructs a new double arrow icon with the specified size and arrows that points in the specified direction.

Parameters:
size - the size for the new icon in pixels
direction - the direction of the arrows. One of DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, or DIRECTION_RIGHTS
Method Detail

setDirection

public void setDirection(int d)
Alters the direction of the arrows.

Parameters:
d - the new direction. One of DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, or DIRECTION_RIGHTS.

getDirection

public int getDirection()
Returns the current direction of the arrow.

Returns:
the current direction of the arrow. One of DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, or DIRECTION_RIGHTS.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Paints this icon on the specified graphics object at the specified location.

Specified by:
paintIcon in interface Icon
Parameters:
c - ignored, may be null
g - the graphics object to paint on
x - the x-offset for this icon
y - the y-offset for this icon

getIconWidth

public int getIconWidth()
Gets the width of this arrow icon.

Specified by:
getIconWidth in interface Icon
Returns:
the width of this icon

getIconHeight

public int getIconHeight()
Gets the height of this arrow icon.

Specified by:
getIconHeight in interface Icon
Returns:
the height of this icon

Mp3dings 
20100427