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.
-
DOWN
- The point DOWN style constant.
-
LEFT
- The point LEFT style constant.
-
RIGHT
- The point RIGHT style constant.
-
UP
- The point UP style constant.
-
DirectionButton()
- Constructs a default DirectionButton, which will point left.
-
DirectionButton(int)
- Constructs a DirectionButton pointing the specified direction.
-
getArrowIndent()
- Returns the amount of blank space between the arrow and the button
border in pixels.
-
getDirection()
- Returns the direction the button is currently pointing.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
setArrowIndent(int)
- Sets the amount of blank space between the arrow and the button
border in pixels.
-
setDirection(int)
- Sets the direction of the arrow after construction.
-
shrinkTriangle(int, int, int, int)
- Sets the extra amount, in pixels, to shrink the arrow triangle.
LEFT
public final static int LEFT
- The point LEFT style constant.
RIGHT
public final static int RIGHT
- The point RIGHT style constant.
UP
public final static int UP
- The point UP style constant.
DOWN
public final static int DOWN
- The point DOWN style constant.
DirectionButton
public DirectionButton()
- Constructs a default DirectionButton, which will point left.
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
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
getDirection
public int getDirection()
- Returns the direction the button is currently pointing.
- See Also:
- setDirection, LEFT, UP, RIGHT, DOWN
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
getArrowIndent
public int getArrowIndent()
- Returns the amount of blank space between the arrow and the button
border in pixels.
- See Also:
- setArrowIndent
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
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
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