Mp3dings 
20100427

de.mospace.swing.icon
Class BevelArrowIcon

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

public class BevelArrowIcon
extends Object
implements Icon

A java icon with a triangular shadowed arrow pointing up or down. Original package: jp.gr.java_conf.tame.swing.icon This class is in the public domain.

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

Field Summary
static int DOWN
          Constant for arrows pointing down.
static int UP
          Constant for arrows pointing up.
 
Constructor Summary
BevelArrowIcon(Color edge1, Color edge2, Color fill, int size, int direction)
          Constructs a new bevel arrow icon with the specified colors, size and orientation.
BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView)
          Constructs a default size bevel arrow icon with the specified style and an arrow that points in the specified direction.
 
Method Summary
 int getIconHeight()
          Gets the height of this bevel arrow icon.
 int getIconWidth()
          Gets the width of this bevel 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)
           
 
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
Constant for arrows pointing up.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Constant for arrows pointing down.

See Also:
Constant Field Values
Constructor Detail

BevelArrowIcon

public BevelArrowIcon(int direction,
                      boolean isRaisedView,
                      boolean isPressedView)
Constructs a default size bevel arrow icon with the specified style and an arrow that points in the specified direction.

Parameters:
direction - the direction of the arrow. One of DIRECTION_UP, DIRECTION_DOWN
isRaisedView - whether the icon is raised
isPressedView - whether the icon is pressed

BevelArrowIcon

public BevelArrowIcon(Color edge1,
                      Color edge2,
                      Color fill,
                      int size,
                      int direction)
Constructs a new bevel arrow icon with the specified colors, size and orientation.

Parameters:
direction - the direction of the arrow. One of DIRECTION_UP, DIRECTION_DOWN
edge1 - the hihglight color for the icon edge
edge2 - the shadow color for the icon edge
fill - the background color for the icon
size - the size in pixels for the icon
Method Detail

setDirection

public void setDirection(int d)
Parameters:
d - one of UP or DOWN

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 bevel arrow icon.

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

getIconHeight

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

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

Mp3dings 
20100427