org.jscience.swing.spinner.icons
Class ArrowIcon

java.lang.Object
  extended by org.jscience.swing.spinner.icons.ArrowIcon
All Implemented Interfaces:
javax.swing.Icon

public class ArrowIcon
extends java.lang.Object
implements javax.swing.Icon

An Icon showing an arrow with a specifiable direction and size. For example you can use it as the Icon for a start button of a timer.

See Also:
SquareIcon

Constructor Summary
ArrowIcon(int direction)
          Creates a new ArrowIcon with the specified direction and the default size of 8 pixels.
ArrowIcon(int direction, int iconSize)
          Creates a new ArrowIcon with the specified direction and size.
 
Method Summary
 int getIconHeight()
          Returns the specified or default size depending on the chosen constructor.
 int getIconWidth()
          Returns the specified or default size depending on the chosen constructor.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          DOCUMENT ME!
 void paintTriangle(java.awt.Graphics g, int x, int y, int size, boolean isEnabled, java.awt.Color foreground)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrowIcon

public ArrowIcon(int direction)
Creates a new ArrowIcon with the specified direction and the default size of 8 pixels. For the direction you choose one of the following SwingConstants final fields:

SwingConstants.WEST
SwingConstants.EAST
SwingConstants.NORTH
SwingConstants.SOUTH


ArrowIcon

public ArrowIcon(int direction,
                 int iconSize)
Creates a new ArrowIcon with the specified direction and size. Note that the size of the Icon is its width AND height, the arrow displayed by this Icon lies within that square. For the direction you choose one of the following SwingConstants final fields:

SwingConstants.WEST
SwingConstants.EAST
SwingConstants.NORTH
SwingConstants.SOUTH

Method Detail

getIconHeight

public int getIconHeight()
Returns the specified or default size depending on the chosen constructor.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
DOCUMENT ME!

getIconWidth

public int getIconWidth()
Returns the specified or default size depending on the chosen constructor.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
DOCUMENT ME!

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
DOCUMENT ME!

Specified by:
paintIcon in interface javax.swing.Icon
Parameters:
c - DOCUMENT ME!
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!

paintTriangle

public void paintTriangle(java.awt.Graphics g,
                          int x,
                          int y,
                          int size,
                          boolean isEnabled,
                          java.awt.Color foreground)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
size - DOCUMENT ME!
isEnabled - DOCUMENT ME!
foreground - DOCUMENT ME!