dsto.dfc.swing.icons
Class ArrowIcon

java.lang.Object
  extended by dsto.dfc.swing.icons.ArrowIcon
All Implemented Interfaces:
Serializable, Icon

public class ArrowIcon
extends Object
implements Icon, Serializable

A dynamically drawn auto-scaling arrow icon.

Version:
$Revision$
Author:
Matthew Phillips
See Also:
Serialized Form

Field Summary
protected  Color color
           
protected  int direction
           
static int DOWN
           
protected  int height
           
static int LEFT
           
static int RIGHT
           
static int UP
           
protected  int width
           
 
Constructor Summary
ArrowIcon(int direction, int height)
          Creates a new icon with the arrow pointing in the direction specified.
ArrowIcon(int direction, int height, Color color)
           
 
Method Summary
 Color getColor()
           
 int getDirection()
           
static int getHeightForWidth(int width)
           
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component component, Graphics graphics, int x, int y)
          Draws the icon.
 void setColor(Color color)
           
 void setIconHeight(int height)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP

public static final int UP
See Also:
Constant Field Values

DOWN

public static final int DOWN
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

direction

protected int direction

width

protected int width

height

protected int height

color

protected Color color
Constructor Detail

ArrowIcon

public ArrowIcon(int direction,
                 int height)
Creates a new icon with the arrow pointing in the direction specified.

Parameters:
direction - The direction to draw the arrow.

ArrowIcon

public ArrowIcon(int direction,
                 int height,
                 Color color)
Method Detail

setColor

public void setColor(Color color)

getColor

public Color getColor()

getHeightForWidth

public static int getHeightForWidth(int width)

paintIcon

public void paintIcon(Component component,
                      Graphics graphics,
                      int x,
                      int y)
Draws the icon.

Specified by:
paintIcon in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

getDirection

public int getDirection()

setIconHeight

public void setIconHeight(int height)


Copyright © 2008 Commonwealth of Australia