Class symantec.itools.awt.DirectionButton
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.DirectionButton
Object
|
+----Component
|
+----Canvas
|
+----ButtonBase
|
+----symantec.itools.awt.DirectionButton
- public class DirectionButton
- extends ButtonBase
- implements Serializable
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.
- Version:
- 1.1, June 27, 1997
- Author:
- Symantec
-
DOWN
- The point DOWN style constant.
-
LEFT
- The point LEFT style constant.
-
RIGHT
- The point RIGHT style constant.
-
UP
- The point UP style constant.
-
arrowColor
- The color of the arrow in the button.
-
bottom
- The number of pixels to shrink the arrow from the bottom side of the button.
-
direction
- The direction the arrow points.
-
disabledArrowColor
- The color of the arrow when the button is disabled.
-
errors
- Error strings.
-
indent
- The margin around the arrow in pixels.
-
left
- The number of pixels to shrink the arrow from the left side of the button.
-
right
- The number of pixels to shrink the arrow from the right side of the button.
-
tempIndent
- Internal use.
-
top
- The number of pixels to shrink the arrow from the top side of the button.
-
symantec.itools.awt.DirectionButton()
- Constructs a default DirectionButton, which will point left.
-
symantec.itools.awt.DirectionButton(int)
- Constructs a DirectionButton pointing the specified direction.
-
addArrowIndentListener(PropertyChangeListener)
- Adds a listener for the ArrowIndent property changes.
-
addArrowIndentListener(VetoableChangeListener)
- Adds a vetoable listener for the ArrowIndent property changes.
-
addDirectionListener(PropertyChangeListener)
- Adds a listener for the Direction property changes.
-
addDirectionListener(VetoableChangeListener)
- Adds a vetoable listener for the Direction property changes.
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
fillTriangle(Graphics, int, int, int, int, int, int, int)
- Fills a triangle which has at least one side that is straight up and down or left and right.
-
getArrowColor()
- Gets the current color of the direction arrow.
-
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.
-
getMinimumSize()
- Returns the minimum dimensions to properly display this component.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
isValidArrowIndent(int)
- Is the given arrow indent is valid for this button.
-
isValidBevelSize(int)
- Is the given bevel size valid for this button.
-
isValidDirection(int)
- Is the given direction valid for this button.
-
removeArrowIndentListener(PropertyChangeListener)
- Removes a listener for the ArrowIndent property changes.
-
removeArrowIndentListener(VetoableChangeListener)
- Removes a vetoable listener for the ArrowIndent property changes.
-
removeDirectionListener(PropertyChangeListener)
- Removes a listener for the Direction property changes.
-
removeDirectionListener(VetoableChangeListener)
- Removes a vetoable listener for the Direction property changes.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
setArrowColor(Color)
- Sets the color of the direction arrow.
-
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.
-
updateButtonImage()
- Maintains the buttonImage size and draws the
button in the buttonImage offscreen image.
-
verifyContstrainedPropertyValues()
- Called after addNotify to set the internally constrined properties to their
temporary values to validate them now that the component has been added to the form.
DOWN
public static final int DOWN
- The point DOWN style constant.
LEFT
public static final int LEFT
- The point LEFT style constant.
RIGHT
public static final int RIGHT
- The point RIGHT style constant.
UP
public static final int UP
- The point UP style constant.
arrowColor
protected java.awt.Color arrowColor
- The color of the arrow in the button.
bottom
protected int bottom
- The number of pixels to shrink the arrow from the bottom side of the button.
direction
protected int direction
- The direction the arrow points.
One of: LEFT, UP, RIGHT, or DOWN.
- See Also:
- LEFT, UP, RIGHT, DOWN
disabledArrowColor
protected java.awt.Color disabledArrowColor
- The color of the arrow when the button is disabled.
errors
protected transient java.util.ResourceBundle errors
- Error strings.
indent
protected int indent
- The margin around the arrow in pixels. 0 = arrow takes up entire button.
left
protected int left
- The number of pixels to shrink the arrow from the left side of the button.
right
protected int right
- The number of pixels to shrink the arrow from the right side of the button.
tempIndent
protected int tempIndent
- Internal use.
Indent value stored until this component is added to a container.
It is then used to set the real indent value.
This avoids code-gen order dependencies.
top
protected int top
- The number of pixels to shrink the arrow from the top side of the button.
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
addArrowIndentListener
public synchronized void addArrowIndentListener(PropertyChangeListener listener)
- Adds a listener for the ArrowIndent property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeArrowIndentListener
addArrowIndentListener
public synchronized void addArrowIndentListener(VetoableChangeListener listener)
- Adds a vetoable listener for the ArrowIndent property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeArrowIndentListener
addDirectionListener
public synchronized void addDirectionListener(PropertyChangeListener listener)
- Adds a listener for the Direction property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeDirectionListener
addDirectionListener
public synchronized void addDirectionListener(VetoableChangeListener listener)
- Adds a vetoable listener for the Direction property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeDirectionListener
addNotify
public synchronized void addNotify()
- Tells this component that it has been added to a container.
This is a standard Java AWT method which gets called by the AWT when
this component is added to a container. Typically, it is used to
create this component's peer.
It has been overridden here to hook-up event listeners.
- Overrides:
- addNotify in class ButtonBase
- See Also:
- removeNotify
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- listener - the listener to add.
- Overrides:
- addPropertyChangeListener in class ButtonBase
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- listener - the listener to add.
- Overrides:
- addVetoableChangeListener in class ButtonBase
- See Also:
- removeVetoableChangeListener
fillTriangle
protected void fillTriangle(Graphics g,
int tipX,
int tipY,
int aX,
int aY,
int bX,
int bY,
int direction)
- Fills a triangle which has at least one side that is straight up and down or left and right.
- Parameters:
- g - the Graphics to use to draw with.
- tipX - the horizontal coordinate of the point opposite a straight side.
- tipY - the vertical coordinate of the point opposite a straight side.
- aX - the horizontal coordinate of one of the two points defining the straight side.
- aY - the vertical coordinate of one of the two points defining the straight side.
- bX - the horizontal coordinate of one of the two points defining the straight side.
- bY - the vertical coordinate of one of the two points defining the straight side.
- direction - the direction of the straight line UP, DOWN, or LEFT, RIGHT.
aX and bX should be the same for UP or Down. aY and bY should be the same for LEFT or RIGHT.
If not, then the a coordinates are used.
- See Also:
- UP, DOWN, LEFT, RIGHT
getArrowColor
public java.awt.Color getArrowColor()
- Gets the current color of the direction arrow.
- Returns:
- the current arrow color
- See Also:
- setArrowColor
getArrowIndent
public int getArrowIndent()
- Returns the amount of blank space between the arrow and the button
border in pixels.
- See Also:
- setArrowIndent
getDirection
public int getDirection()
- Returns the direction the button is currently pointing.
- See Also:
- setDirection, LEFT, UP, RIGHT, DOWN
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
- Returns:
- a button that has a content area of 3 by 3 pixels.
- Overrides:
- getMinimumSize in class ButtonBase
- See Also:
- getMinimumSize
getPreferredSize
public java.awt.Dimension getPreferredSize()
- 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.
- Returns:
- a button that has a content area of 7 by 7 pixels.
- Overrides:
- getPreferredSize in class ButtonBase
- See Also:
- getMinimumSize
isValidArrowIndent
protected boolean isValidArrowIndent(int i)
- Is the given arrow indent is valid for this button.
- Parameters:
- i - the given bevel size
- Returns:
- true if the given indent size is acceptable, false if not.
isValidBevelSize
protected boolean isValidBevelSize(int i)
- Is the given bevel size valid for this button.
- Parameters:
- i - the given bevel size
- Returns:
- true if the given bevel size is acceptable, false if not.
- Overrides:
- isValidBevelSize in class ButtonBase
isValidDirection
protected boolean isValidDirection(int i)
- Is the given direction valid for this button.
- Parameters:
- i - the given bevel size
- Returns:
- true if the given direction is acceptable, false if not.
removeArrowIndentListener
public synchronized void removeArrowIndentListener(PropertyChangeListener listener)
- Removes a listener for the ArrowIndent property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addArrowIndentListener
removeArrowIndentListener
public synchronized void removeArrowIndentListener(VetoableChangeListener listener)
- Removes a vetoable listener for the ArrowIndent property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addArrowIndentListener
removeDirectionListener
public synchronized void removeDirectionListener(PropertyChangeListener listener)
- Removes a listener for the Direction property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addDirectionListener
removeDirectionListener
public synchronized void removeDirectionListener(VetoableChangeListener listener)
- Removes a vetoable listener for the Direction property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addDirectionListener
removeNotify
public synchronized void removeNotify()
- Tells this component that it is being removed from a container.
This is a standard Java AWT method which gets called by the AWT when
this component is removed from a container. Typically, it is used to
destroy the peers of this component and all its subcomponents.
It has been overridden here to unhook event listeners.
- Overrides:
- removeNotify in class ButtonBase
- See Also:
- addNotify
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- listener - the listener to remove.
- Overrides:
- removePropertyChangeListener in class ButtonBase
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- listener - the listener to remove.
- Overrides:
- removeVetoableChangeListener in class ButtonBase
- See Also:
- addVetoableChangeListener
setArrowColor
public void setArrowColor(Color newValue) throws PropertyVetoException
- Sets the color of the direction arrow.
- Parameters:
- newValue - the new arrow color.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getArrowColor
setArrowIndent
public void setArrowIndent(int ai) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getArrowIndent
setDirection
public void setDirection(int d) throws PropertyVetoException
- Sets the direction of the arrow after construction.
- Parameters:
- d - constant indicating direction to point button
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getDirection, LEFT, UP, RIGHT, DOWN
shrinkTriangle
public void shrinkTriangle(int l,
int r,
int t,
int b)
- Sets the extra amount, in pixels, to shrink the arrow triangle.
Constrains the values such that the arrow will never be less than
three pixels. If a value is entered that would exceed this limit,
the limit will be used instead.
- 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
updateButtonImage
protected void updateButtonImage()
- Maintains the buttonImage size and draws the
button in the buttonImage offscreen image.
- Overrides:
- updateButtonImage in class ButtonBase
- See Also:
- updateButtonImage
verifyContstrainedPropertyValues
protected void verifyContstrainedPropertyValues()
- Called after addNotify to set the internally constrined properties to their
temporary values to validate them now that the component has been added to the form.
This is used to avoid code-gen order dependencies, since VC generates all property
manipulating code before adding the component to its container.
Subclasses should override this function for any internally constrained properties,
and call the super version in the overridden version.
- Overrides:
- verifyContstrainedPropertyValues in class ButtonBase
All Packages Class Hierarchy This Package Previous Next Index