All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.ArrowButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----tea.set.ImageButton
                           |
                           +----tea.set.ArrowButton

public class ArrowButton
extends ImageButton
ArrowButton is a special image button that displays an arrow. There are eight types of arrows supported: UP, LEFT, DOWN, and RIGHT are arrows pointing to respective directions. A double arrow version of these four: DOUBLE_UP, DOUBLE_LEFT, DOUBLE_DOWN, DOUBLE_RIGHT display two arrows inside the button pointing to the respective direction.

ArrowButton supports the following properties:
Property NameProperty TypeDescription
Directionint Arrow type flag.

See Also:
ImageButton

Variable Index

 o DOUBLE_DOWN
Double down arrow button style.
 o DOUBLE_LEFT
Double left arrow button style.
 o DOUBLE_RIGHT
Double right arrow button style.
 o DOUBLE_UP
Double up arrow button style.
 o DOWN
Down arrow button style.
 o DOWN_MENU
Down arrow and a bar, suitable for using with dropdown menus.
 o LEFT
Left arrow button style.
 o RIGHT
Right arrow button style.
 o UP
Up arrow button style.

Constructor Index

 o ArrowButton()
Construct a left arrow button.
 o ArrowButton(int)
Construct an ArrowButton with the specified style.
 o ArrowButton(int, int)
Construct an ArrowButton with the specified style and button border.
 o ArrowButton(int, int, int)
Construct an ArrowButton with the specified style and button border.
 o ArrowButton(int, int, int, int)
Construct an ArrowButton with the specified style, size, and border.

Method Index

 o getDirection()
Get the arrow direction.
 o getPreferredSize()
Return preferred size of ArrowButton.
 o paint(Graphics)
Paint ArrowButton.
 o setDirection(int)
Change the arrow to the specified style.
 o setEnabled(boolean)
Enable the arrow button.

Variables

 o UP
 public static final int UP
Up arrow button style.

 o LEFT
 public static final int LEFT
Left arrow button style.

 o DOWN
 public static final int DOWN
Down arrow button style.

 o RIGHT
 public static final int RIGHT
Right arrow button style.

 o DOUBLE_UP
 public static final int DOUBLE_UP
Double up arrow button style.

 o DOUBLE_LEFT
 public static final int DOUBLE_LEFT
Double left arrow button style.

 o DOUBLE_DOWN
 public static final int DOUBLE_DOWN
Double down arrow button style.

 o DOUBLE_RIGHT
 public static final int DOUBLE_RIGHT
Double right arrow button style.

 o DOWN_MENU
 public static final int DOWN_MENU
Down arrow and a bar, suitable for using with dropdown menus.

Constructors

 o ArrowButton
 public ArrowButton()
Construct a left arrow button. Use setDirection() to change the type of arrow button.

 o ArrowButton
 public ArrowButton(int direction)
Construct an ArrowButton with the specified style.

Parameters:
direction - arrow direction, one of the direction flag values.
 o ArrowButton
 public ArrowButton(int direction,
                    int w,
                    int h)
Construct an ArrowButton with the specified style and button border. The specified size will be the preferred size of this button.

Parameters:
direction - arrow direction, one of the direction flag values.
w - preferred width of this button.
h - preferred height of this button.
 o ArrowButton
 public ArrowButton(int direction,
                    int border)
Construct an ArrowButton with the specified style and button border. The use of this constructor is intended for toolkit extension, and should not be used in normal usage.

Parameters:
direction - arrow direction, one of the direction flag values.
border - button border width.
 o ArrowButton
 public ArrowButton(int direction,
                    int w,
                    int h,
                    int border)
Construct an ArrowButton with the specified style, size, and border. The use of this constructor is intended for toolkit extension, and should not be used in normal usage.

Parameters:
direction - arrow direction, one of the direction flag values.
border - button border width.

Methods

 o setDirection
 public void setDirection(int direction)
Change the arrow to the specified style. This causes a repaint of the button.

Parameters:
direction - arrow direction, one of the direction flag values.
 o getDirection
 public int getDirection()
Get the arrow direction.

Returns:
arrow direction.
 o setEnabled
 public void setEnabled(boolean f)
Enable the arrow button. This causes the color of the arrow to changed to regular foreground color.

Overrides:
setEnabled in class ImageButton
 o getPreferredSize
 public Dimension getPreferredSize()
Return preferred size of ArrowButton.

Returns:
preferred size of the button.
Overrides:
getPreferredSize in class ImageButton
 o paint
 public void paint(Graphics g)
Paint ArrowButton.

Parameters:
g - Graphics content of this component.
Overrides:
paint in class ImageButton

All Packages  Class Hierarchy  This Package  Previous  Next  Index