All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.DirectionButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----symantec.itools.awt.ButtonBase
                           |
                           +----symantec.itools.awt.DirectionButton

public class DirectionButton
extends ButtonBase
The DirectionButton is a button component that has an arrow drawn in it that points one of four ways (left,up,right, or down). At runtime, the button has a raised look and a pressed look.

This component is usually used in conjunction with a combo or list box to indicate a list that the user can view by clicking the arrow, or with spinners to let the user scroll through available values.


Variable Index

 o DOWN
The point DOWN style constant.
 o LEFT
The point LEFT style constant.
 o RIGHT
The point RIGHT style constant.
 o UP
The point UP style constant.

Constructor Index

 o DirectionButton()
Constructs a default DirectionButton, which will point left.
 o DirectionButton(int)
Constructs a DirectionButton pointing the specified direction.

Method Index

 o getArrowIndent()
Returns the amount of blank space between the arrow and the button border in pixels.
 o getDirection()
Returns the direction the button is currently pointing.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o setArrowIndent(int)
Sets the amount of blank space between the arrow and the button border in pixels.
 o setDirection(int)
Sets the direction of the arrow after construction.
 o shrinkTriangle(int, int, int, int)
Sets the extra amount, in pixels, to shrink the arrow triangle.

Variables

 o LEFT
  public final static int LEFT
The point LEFT style constant.

 o RIGHT
  public final static int RIGHT
The point RIGHT style constant.

 o UP
  public final static int UP
The point UP style constant.

 o DOWN
  public final static int DOWN
The point DOWN style constant.

Constructors

 o DirectionButton
  public DirectionButton()
Constructs a default DirectionButton, which will point left.

 o DirectionButton
  public DirectionButton(int d)
Constructs a DirectionButton pointing the specified direction.

Parameters:
d - a style constant indicating which direction to point the button
See Also:
LEFT, UP, RIGHT, DOWN

Methods

 o setDirection
  public void setDirection(int d)
Sets the direction of the arrow after construction.

Parameters:
d - constant indicating direction to point button
See Also:
getDirection, LEFT, UP, RIGHT, DOWN
 o getDirection
  public int getDirection()
Returns the direction the button is currently pointing.

See Also:
setDirection, LEFT, UP, RIGHT, DOWN
 o setArrowIndent
  public void setArrowIndent(int ai)
Sets the amount of blank space between the arrow and the button border in pixels.

Parameters:
ai - the margin around the arrow in pixels. 0=arrow takes up entire button
See Also:
getArrowIndent
 o getArrowIndent
  public int getArrowIndent()
Returns the amount of blank space between the arrow and the button border in pixels.

See Also:
setArrowIndent
 o shrinkTriangle
  public void shrinkTriangle(int l,
                             int r,
                             int t,
                             int b)
Sets the extra amount, in pixels, to shrink the arrow triangle.

Parameters:
left - pixels to shrink from left side
right - pixels to shrink from right side
top - pixels to shrink from top
bottom - pixels to shrink from bottom
 o paint
  public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class ButtonBase
See Also:
repaint, update
 o preferredSize
  public Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Overrides:
preferredSize in class Component
See Also:
minimumSize

All Packages  Class Hierarchy  This Package  Previous  Next  Index