com.jrefinery.ui
Class BevelArrowIcon

java.lang.Object
  extended by com.jrefinery.ui.BevelArrowIcon
All Implemented Interfaces:
javax.swing.Icon

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

An arrow icon that can point up or down (usually used to indicate the sort direction in a table).

This class (and also SortButtonRenderer) is based on original code by Nobuo Tamemasa (version 1.0, 26-Feb-1999) posted on www.codeguru.com.


Field Summary
static int DOWN
          Constant indicating that the arrow is pointing down;
static int UP
          Constant indicating that the arrow is pointing up;
 
Constructor Summary
BevelArrowIcon(java.awt.Color edge1, java.awt.Color edge2, java.awt.Color fill, int size, int direction)
          Standard constructor - builds an icon with the specified attributes.
BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView)
          Standard constructor - builds an icon with the specified attributes.
 
Method Summary
 int getIconHeight()
          Returns the height of the icon.
 int getIconWidth()
          Returns the width of the icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paints the icon at the specified position.
 
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 indicating that the arrow is pointing up;

See Also:
Constant Field Values

DOWN

public static final int DOWN
Constant indicating that the arrow is pointing down;

See Also:
Constant Field Values
Constructor Detail

BevelArrowIcon

public BevelArrowIcon(int direction,
                      boolean isRaisedView,
                      boolean isPressedView)
Standard constructor - builds an icon with the specified attributes.

Parameters:
direction - ;
isRaisedView - ;
isPressedView - ;

BevelArrowIcon

public BevelArrowIcon(java.awt.Color edge1,
                      java.awt.Color edge2,
                      java.awt.Color fill,
                      int size,
                      int direction)
Standard constructor - builds an icon with the specified attributes.

Parameters:
edge1 - The color of edge1;
edge2 - The color of edge2;
fill - The fill color;
size - The size of the arrow icon;
direction - The direction that the arrow points;
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paints the icon at the specified position. Supports the Icon interface.

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

getIconWidth

public int getIconWidth()
Returns the width of the icon. Supports the Icon interface.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
The icon width;

getIconHeight

public int getIconHeight()
Returns the height of the icon. Supports the Icon interface.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
The icon height;


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.