uic.widgets
Class BevelArrowIcon

java.lang.Object
  extended byuic.widgets.BevelArrowIcon
All Implemented Interfaces:
Icon

public class BevelArrowIcon
extends Object
implements Icon

An arrow icon used in (UIC) Table headers to show the sorting direction. The sizing of this arrow is based on the font that is set.


Field Summary
static int DOWN
          Direction for the setDirection method.
static int NONE
          Direction for the setDirection method.
static int UP
          Direction for the setDirection method.
 
Constructor Summary
BevelArrowIcon(Color edge1, Color edge2, Color fill, int direction)
          Create an icon with specific colors; edge1 is left and top, edge2 is right and fill is the center part.
BevelArrowIcon(int direction, boolean isRaisedView, boolean isPressedView)
          Provides an icon using the theme colors based on the arguments.
 
Method Summary
 int getIconHeight()
          Icon Interface method
 int getIconWidth()
          Icon Interface method
 void paintIcon(Component c, Graphics g, int x, int y)
          Icon Interface method
 void setDirection(int direction)
          The direction of the icon can be changed at any time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Direction for the setDirection method.

See Also:
Constant Field Values

UP

public static final int UP
Direction for the setDirection method.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Direction for the setDirection method.

See Also:
Constant Field Values
Constructor Detail

BevelArrowIcon

public BevelArrowIcon(int direction,
                      boolean isRaisedView,
                      boolean isPressedView)
Provides an icon using the theme colors based on the arguments.

Parameters:
direction - see setDirection()
isRaisedView - paint the icon 'raised' instead of sunken
isPressedView - show an icon with a rollover color

BevelArrowIcon

public BevelArrowIcon(Color edge1,
                      Color edge2,
                      Color fill,
                      int direction)
Create an icon with specific colors; edge1 is left and top, edge2 is right and fill is the center part.

Method Detail

setDirection

public void setDirection(int direction)
The direction of the icon can be changed at any time. Use the BevelArrowIcon.UP and BevelArrowIcon.DOWN for the argument direction.
Optionally you can use the BevelArrowIcon.NONE to simply not draw the icon at all.

Parameters:
direction - the direction of the arrow, or NONE for an invisible icon.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Icon Interface method

Specified by:
paintIcon in interface Icon

getIconWidth

public int getIconWidth()
Icon Interface method

Specified by:
getIconWidth in interface Icon

getIconHeight

public int getIconHeight()
Icon Interface method

Specified by:
getIconHeight in interface Icon


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence