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:

Version:
1.1, July 8, 1997
Author:
Symantec

Variable Index

 o ALIGN_BOTTOM
Defines the "bottom" label text alignment style.
 o ALIGN_TOP
Defines the "top" label text alignment style.
 o disabledTextColor
The color used for text when this component is disabled.
 o errors
Error strings.
 o hAlignStyle
The text horizontal alignment style.
 o pressedTextColor
The color used for text when this component is pressed.
 o sLabelButton
The button label text.
 o textColor
The color used for text when this component is enabled.
 o vAlignStyle
The text vertical alignment style.

Constructor Index

 o symantec.itools.awt.LabelButton()
Constructs an empty LabelButton with center aligned black text.
 o symantec.itools.awt.LabelButton(String)
Constructs a LabelButton with the specified centered, black text.
 o symantec.itools.awt.LabelButton(String, Color)
Constructs a LabelButton with the specified centered text, with the specified color.
 o symantec.itools.awt.LabelButton(String, int)
Constructs a LabelButton with the specified vertically centered black text, and the specified horizontal text alignment style.
 o symantec.itools.awt.LabelButton(String, int, int, Color)
Constructs a LabelButton with the specified attributes.

Method Index

 o addAlignStyleListener(PropertyChangeListener)
Adds a listener for the AlignStyle property changes.
 o addAlignStyleListener(VetoableChangeListener)
Adds a vetoable listener for the AlignStyle property changes.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addVerticalAlignStyleListener(PropertyChangeListener)
Adds a listener for the VerticalAlignStyle property changes.
 o addVerticalAlignStyleListener(VetoableChangeListener)
Adds a vetoable listener for the VerticalAlignStyle property changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o getAlignStyle()
Gets the current text alignment style.
 o getPreferredSize()
Returns the recommended dimensions to properly display this component.
 o getText()
Gets the current label text.
 o getTextColor()
Gets the current label text color.
 o getVerticalAlignStyle()
Gets the current text alignment style.
 o isValidHorizontalAlignStyle(int)
Is the given Horizontal AlignStyle valid for this button.
 o isValidVerticalAlignStyle(int)
Is the given Vertical AlignStyle valid for this button.
 o removeAlignStyleListener(PropertyChangeListener)
Removes a listener for the AlignStyle property changes.
 o removeAlignStyleListener(VetoableChangeListener)
Removes a vetoable listener for the AlignStyle property changes.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeVerticalAlignStyleListener(PropertyChangeListener)
Removes a listener for the VerticalAlignStyle property changes.
 o removeVerticalAlignStyleListener(VetoableChangeListener)
Removes a vetoable listener for the VerticalAlignStyle property changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o setAlignStyle(int)
Sets the text horizontal alignment style.
 o setText(String)
Sets the label text.
 o setTextColor(Color)
Sets the label text color.
 o setVerticalAlignStyle(int)
Sets the text vertical alignment style.
 o updateButtonImage()
Draws the button in the buttonImage offscreen image.

Variables

 o ALIGN_BOTTOM
public static final int ALIGN_BOTTOM
Defines the "bottom" label text alignment style.

 o ALIGN_TOP
public static final int ALIGN_TOP
Defines the "top" label text alignment style.

 o disabledTextColor
protected java.awt.Color disabledTextColor
The color used for text when this component is disabled. This color is automatically determined.

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o 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
 o pressedTextColor
protected java.awt.Color pressedTextColor
The color used for text when this component is pressed. This color is automatically determined.

 o sLabelButton
protected java.lang.String sLabelButton
The button label text.

 o textColor
protected java.awt.Color textColor
The color used for text when this component is enabled.

See Also:
getTextColor, setTextColor
 o 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

Constructors

 o LabelButton
public LabelButton()
Constructs an empty LabelButton with center aligned black text.

 o LabelButton
public LabelButton(String sText)
Constructs a LabelButton with the specified centered, black text.

Parameters:
sText - the label text
 o LabelButton
public LabelButton(String sText,
                   Color color)
Constructs a LabelButton with the specified centered text, with the specified color.

Parameters:
sText - the label text
 o 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
 o 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

Methods

 o 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)
 o 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)
 o 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
 o 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
 o 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)
 o 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)
 o 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)
 o 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
 o 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
 o getText
public java.lang.String getText()
Gets the current label text.

Returns:
the current label text
See Also:
setText
 o getTextColor
public java.awt.Color getTextColor()
Gets the current label text color.

Returns:
the current color of the label text
See Also:
setTextColor
 o 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
 o 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.
 o 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.
 o 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)
 o 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)
 o 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
 o 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
 o 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)
 o 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)
 o 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)
 o 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
 o 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
 o 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
 o 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
 o 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