Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.common.gui
Class ArrowIcon

java.lang.Object
  extended by com.citra.common.gui.ArrowIcon
All Implemented Interfaces:
Icon

public class ArrowIcon
extends Object
implements Icon

An icon that draws an arrow in one of the cardinal directions. The direction is specified with the SwingConstants EAST, WEST, SOUTH and NORTH.


Field Summary
protected  Color arrowColor
          the color of the arrow.
protected  int direction
          the direction of the arrow.
 
Constructor Summary
ArrowIcon()
          Constructs an ArrowIcon.
ArrowIcon(Color arrowColor)
          Constructs an ArrowIcon.
ArrowIcon(int direction)
          Constructs an ArrowIcon.
ArrowIcon(int direction, Color arrowColor)
          Constructs an ArrowIcon.
 
Method Summary
 Color getArrowColor()
          Returns the color of the arrow.
 int getDirection()
          Returns the direction of the arrow.
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 void paintIcon(Component c, Graphics g, int x, int y)
          Draw the icon at the specified location.
 void setArrowColor(Color c)
          Set's the arrow's color.
 void setDirection(int dir)
          Sets the arrow's direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrowColor

protected Color arrowColor
the color of the arrow.


direction

protected int direction
the direction of the arrow. Can either be NORTH, SOUTH, WEST or EAST.

Constructor Detail

ArrowIcon

public ArrowIcon()
Constructs an ArrowIcon.


ArrowIcon

public ArrowIcon(Color arrowColor)
Constructs an ArrowIcon.


ArrowIcon

public ArrowIcon(int direction)
Constructs an ArrowIcon.


ArrowIcon

public ArrowIcon(int direction,
                 Color arrowColor)
Constructs an ArrowIcon.

Method Detail

getIconHeight

public int getIconHeight()
Returns the icon's height.

Specified by:
getIconHeight in interface Icon
Returns:
an int specifying the fixed height of the icon.

getIconWidth

public int getIconWidth()
Returns the icon's width.

Specified by:
getIconWidth in interface Icon
Returns:
an int specifying the fixed width of the icon.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Specified by:
paintIcon in interface Icon

getArrowColor

public Color getArrowColor()
Returns the color of the arrow.

Returns:
the arrow's color

getDirection

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

Returns:
the direction of the arrow

setArrowColor

public void setArrowColor(Color c)
Set's the arrow's color.

Parameters:
c - the color of the arrow

setDirection

public void setDirection(int dir)
Sets the arrow's direction.

Parameters:
dir - the direction

Copyright © 2011 Citra Technologies. All Rights Reserved.