Class symantec.itools.awt.LabelButton
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.LabelButton
Object
|
+----Component
|
+----Canvas
|
+----ButtonBase
|
+----symantec.itools.awt.LabelButton
- public class LabelButton
- extends ButtonBase
- implements AlignStyle
LabelButton is a 3D looking button that displays a string on it's face.
Use an LabelButton to:
- · Display text in a 3D looking button.
- · Generate a train of action events while the user presses the button.
- Version:
- 1.1, July 8, 1997
- Author:
- Symantec
-
ALIGN_BOTTOM
- Defines the "bottom" label text alignment style.
-
ALIGN_TOP
- Defines the "top" label text alignment style.
-
disabledTextColor
- The color used for text when this component is disabled.
-
errors
- Error strings.
-
hAlignStyle
- The text horizontal alignment style.
-
pressedTextColor
- The color used for text when this component is pressed.
-
sLabelButton
- The button label text.
-
textColor
- The color used for text when this component is enabled.
-
vAlignStyle
- The text vertical alignment style.
-
symantec.itools.awt.LabelButton()
- Constructs an empty LabelButton with center aligned black text.
-
symantec.itools.awt.LabelButton(String)
- Constructs a LabelButton with the specified centered, black text.
-
symantec.itools.awt.LabelButton(String, Color)
- Constructs a LabelButton with the specified centered text,
with the specified color.
-
symantec.itools.awt.LabelButton(String, int)
- Constructs a LabelButton with the specified vertically centered black text, and the
specified horizontal text alignment style.
-
symantec.itools.awt.LabelButton(String, int, int, Color)
- Constructs a LabelButton with the specified attributes.
-
addAlignStyleListener(PropertyChangeListener)
- Adds a listener for the AlignStyle property changes.
-
addAlignStyleListener(VetoableChangeListener)
- Adds a vetoable listener for the AlignStyle property changes.
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVerticalAlignStyleListener(PropertyChangeListener)
- Adds a listener for the VerticalAlignStyle property changes.
-
addVerticalAlignStyleListener(VetoableChangeListener)
- Adds a vetoable listener for the VerticalAlignStyle property changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
getAlignStyle()
- Gets the current text alignment style.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
getText()
- Gets the current label text.
-
getTextColor()
- Gets the current label text color.
-
getVerticalAlignStyle()
- Gets the current text alignment style.
-
isValidHorizontalAlignStyle(int)
- Is the given Horizontal AlignStyle valid for this button.
-
isValidVerticalAlignStyle(int)
- Is the given Vertical AlignStyle valid for this button.
-
removeAlignStyleListener(PropertyChangeListener)
- Removes a listener for the AlignStyle property changes.
-
removeAlignStyleListener(VetoableChangeListener)
- Removes a vetoable listener for the AlignStyle property changes.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVerticalAlignStyleListener(PropertyChangeListener)
- Removes a listener for the VerticalAlignStyle property changes.
-
removeVerticalAlignStyleListener(VetoableChangeListener)
- Removes a vetoable listener for the VerticalAlignStyle property changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
setAlignStyle(int)
- Sets the text horizontal alignment style.
-
setText(String)
- Sets the label text.
-
setTextColor(Color)
- Sets the label text color.
-
setVerticalAlignStyle(int)
- Sets the text vertical alignment style.
-
updateButtonImage()
- Draws the button in the buttonImage offscreen image.
ALIGN_BOTTOM
public static final int ALIGN_BOTTOM
- Defines the "bottom" label text alignment style.
ALIGN_TOP
public static final int ALIGN_TOP
- Defines the "top" label text alignment style.
disabledTextColor
protected java.awt.Color disabledTextColor
- The color used for text when this component is disabled.
This color is automatically determined.
errors
protected transient java.util.ResourceBundle errors
- Error strings.
hAlignStyle
protected int hAlignStyle
- The text horizontal alignment style.
The value is one of: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- getAlignStyle, setAlignStyle, ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
pressedTextColor
protected java.awt.Color pressedTextColor
- The color used for text when this component is pressed.
This color is automatically determined.
sLabelButton
protected java.lang.String sLabelButton
- The button label text.
textColor
protected java.awt.Color textColor
- The color used for text when this component is enabled.
- See Also:
- getTextColor, setTextColor
vAlignStyle
protected int vAlignStyle
- The text vertical alignment style.
The value is one of: ALIGN_TOP, ALIGN_CENTERED, or ALIGN_BOTTOM
- See Also:
- getVerticalAlignStyle, setVerticalAlignStyle, ALIGN_TOP, ALIGN_CENTERED, ALIGN_BOTTOM
LabelButton
public LabelButton()
- Constructs an empty LabelButton with center aligned black text.
LabelButton
public LabelButton(String sText)
- Constructs a LabelButton with the specified centered, black text.
- Parameters:
- sText - the label text
LabelButton
public LabelButton(String sText,
Color color)
- Constructs a LabelButton with the specified centered text,
with the specified color.
- Parameters:
- sText - the label text
LabelButton
public LabelButton(String sText,
int alignStyle)
- Constructs a LabelButton with the specified vertically centered black text, and the
specified horizontal text alignment style.
- Parameters:
- sText - the label text
- alignStyle - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
LabelButton
public LabelButton(String sText,
int hAlignStyle,
int vAlignStyle,
Color color)
- Constructs a LabelButton with the specified attributes.
- Parameters:
- sText - the label text
- hAlignStyle - the text horizontal alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- vAlignStyle - the text vertical alignment style: ALIGN_TOP, ALIGN_CENTERED, or ALIGN_BOTTOM
- color - the label text color
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, ALIGN_TOP, ALIGN_BOTTOM
addAlignStyleListener
public synchronized void addAlignStyleListener(PropertyChangeListener listener)
- Adds a listener for the AlignStyle property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeAlignStyleListener(java.beans.PropertyChangeListener)
addAlignStyleListener
public synchronized void addAlignStyleListener(VetoableChangeListener listener)
- Adds a vetoable listener for the AlignStyle property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeAlignStyleListener(java.beans.VetoableChangeListener)
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
addVerticalAlignStyleListener
public synchronized void addVerticalAlignStyleListener(PropertyChangeListener listener)
- Adds a listener for the VerticalAlignStyle property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeVerticalAlignStyleListener(java.beans.PropertyChangeListener)
addVerticalAlignStyleListener
public synchronized void addVerticalAlignStyleListener(VetoableChangeListener listener)
- Adds a vetoable listener for the VerticalAlignStyle property changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeVerticalAlignStyleListener(java.beans.VetoableChangeListener)
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(java.beans.VetoableChangeListener)
getAlignStyle
public int getAlignStyle()
- Gets the current text alignment style.
- Returns:
- the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- setAlignStyle, ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
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.
The Dimension returned is large enough for the label and a one pixel
space between the label and the button's bevel.
- Overrides:
- getPreferredSize in class ButtonBase
getText
public java.lang.String getText()
- Gets the current label text.
- Returns:
- the current label text
- See Also:
- setText
getTextColor
public java.awt.Color getTextColor()
- Gets the current label text color.
- Returns:
- the current color of the label text
- See Also:
- setTextColor
getVerticalAlignStyle
public int getVerticalAlignStyle()
- Gets the current text alignment style.
- Returns:
- the text alignment style: ALIGN_TOP, ALIGN_CENTERED, or ALIGN_BOTTOM
- See Also:
- setVerticalAlignStyle, ALIGN_TOP, ALIGN_CENTERED, ALIGN_BOTTOM
isValidHorizontalAlignStyle
protected boolean isValidHorizontalAlignStyle(int i)
- Is the given Horizontal AlignStyle valid for this button.
- Parameters:
- i - the given Horizontal AlignStyle
- Returns:
- true if the given Horizontal AlignStyle is acceptable, false if not.
isValidVerticalAlignStyle
protected boolean isValidVerticalAlignStyle(int i)
- Is the given Vertical AlignStyle valid for this button.
- Parameters:
- i - the given Vertical AlignStyle
- Returns:
- true if the given Vertical AlignStyle is acceptable, false if not.
removeAlignStyleListener
public synchronized void removeAlignStyleListener(PropertyChangeListener listener)
- Removes a listener for the AlignStyle property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addAlignStyleListener(java.beans.PropertyChangeListener)
removeAlignStyleListener
public synchronized void removeAlignStyleListener(VetoableChangeListener listener)
- Removes a vetoable listener for the AlignStyle property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addAlignStyleListener(java.beans.VetoableChangeListener)
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
removeVerticalAlignStyleListener
public synchronized void removeVerticalAlignStyleListener(PropertyChangeListener listener)
- Removes a listener for the VerticalAlignStyle property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addVerticalAlignStyleListener(java.beans.PropertyChangeListener)
removeVerticalAlignStyleListener
public synchronized void removeVerticalAlignStyleListener(VetoableChangeListener listener)
- Removes a vetoable listener for the VerticalAlignStyle property changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addVerticalAlignStyleListener(java.beans.VetoableChangeListener)
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(java.beans.VetoableChangeListener)
setAlignStyle
public void setAlignStyle(int style) throws PropertyVetoException
- Sets the text horizontal alignment style.
Causes the component to redraw.
- Parameters:
- style - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getAlignStyle, ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
setText
public void setText(String sText) throws PropertyVetoException
- Sets the label text.
Causes the component to redraw.
- Parameters:
- sText - the new label text
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getText
setTextColor
public void setTextColor(Color color) throws PropertyVetoException
- Sets the label text color.
Causes the component to redraw.
- Parameters:
- color - the new color for the label text
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getTextColor
setVerticalAlignStyle
public void setVerticalAlignStyle(int style) throws PropertyVetoException
- Sets the text vertical alignment style.
Causes the component to redraw.
- Parameters:
- style - the text alignment style: ALIGN_TOP, ALIGN_CENTERED, or ALIGN_BOTTOM
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getVerticalAlignStyle, ALIGN_TOP, ALIGN_CENTERED, ALIGN_BOTTOM
updateButtonImage
protected void updateButtonImage()
- Draws the button in the buttonImage offscreen image.
This should only be called after the component is added to a container,
to avoid a NullPointerException when accessing FontMetrics.
- Overrides:
- updateButtonImage in class ButtonBase
- See Also:
- updateButtonImage
All Packages Class Hierarchy This Package Previous Next Index