All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.LabelButton
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----symantec.itools.awt.ButtonBase
|
+----symantec.itools.awt.LabelButton
- public class LabelButton
- extends ButtonBase
- implements AlignStyle, BevelStyle
Creates a text string that initiates an action when clicked. A LabelButton
appears outlined when it possesses input focus. This indicates that the
component can receive a user event. When the user clicks the button, it
appears depressed to indicate that it has detected the click event.
When a LabelButton is disabled, it is ægrayed out.Æ This indicates that
it can not receive user input.
The LabelButton accepts clicked events automatically by default.
Use a LabelButton to:
- ╖ Accept or yield focus.
- ╖ Respond to a user event.
- ╖ Send a train of action events to another component.
To define an interaction with another component, use the Interaction Wizard.
-
INDENT_ONE
- Constant indicating a drawing margin of 1 pixel around the outside of
a BEVEL_LINE border.
-
INDENT_TWO
- Constant indicating a drawing margin of 2 pixels around the outside of
a BEVEL_LINE border.
-
INDENT_ZERO
- Constant indicating a drawing margin of 0 pixels around the outside of
a BEVEL_LINE border.
-
showLabel
- Indicates whether to display the label text.
-
sLabelButton
- The button label text.
-
LabelButton()
- Constructs an empty LabelButton with center aligned black text and a
raised border with zero border indent.
-
LabelButton(String, int, int)
- Constructs a LabelButton with black text, zero border indent, and the
specified text alignment and bevel styles.
-
LabelButton(String, int, int, Color)
- Constructs a LabelButton with a zero border indent and the specified attributes.
-
LabelButton(String, int, int, Color, int, boolean)
- Constructs a Label3D with the specified attributes.
-
LabelButton(String, int, int, int)
- Constructs a Label3D with black label text and the specified attributes.
-
getAlignStyle()
- Gets the current text alignment style.
-
getBevelStyle()
- Gets the current border style.
-
getBorderIndent()
- Gets the current border indent amount.
-
getShowLabel()
- Gets whether the label will be shown.
-
getText()
- Gets the current label text.
-
getTextColor()
- Gets the current label text color.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
setAlignStyle(int)
- Sets the text alignment style.
-
setBevelStyle(int)
- Sets the border style.
-
setBorderedColor(Color)
- Sets the border color.
-
setBorderIndent(int)
- Sets the border indent amount.
-
setFont(Font)
- Sets this component's text font.
-
setShowLabel(boolean)
- Sets whether the label will be shown.
-
setText(String)
- Sets the label text.
-
setTextColor(Color)
- Sets the label text color.
-
update(Graphics)
- Handles redrawing of this component on the screen.
INDENT_ZERO
public final static int INDENT_ZERO
- Constant indicating a drawing margin of 0 pixels around the outside of
a BEVEL_LINE border.
INDENT_ONE
public final static int INDENT_ONE
- Constant indicating a drawing margin of 1 pixel around the outside of
a BEVEL_LINE border.
INDENT_TWO
public final static int INDENT_TWO
- Constant indicating a drawing margin of 2 pixels around the outside of
a BEVEL_LINE border.
sLabelButton
protected String sLabelButton
- The button label text.
showLabel
protected boolean showLabel
- Indicates whether to display the label text.
LabelButton
public LabelButton()
- Constructs an empty LabelButton with center aligned black text and a
raised border with zero border indent.
LabelButton
public LabelButton(String sText,
int alignStyle,
int bevelStyle)
- Constructs a LabelButton with black text, zero border indent, and the
specified text alignment and bevel styles.
- Parameters:
- sText - the label text
- alignStyle - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- bevelStyle - the bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
LabelButton
public LabelButton(String sText,
int alignStyle,
int bevelStyle,
Color color)
- Constructs a LabelButton with a zero border indent and the specified attributes.
- Parameters:
- sText - the label text
- alignStyle - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- bevelStyle - the bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- color - the label text color
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
LabelButton
public LabelButton(String sText,
int alignStyle,
int bevelStyle,
int indent)
- Constructs a Label3D with black label text and the specified attributes.
- Parameters:
- sText - the label text
- alignStyle - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- bevelStyle - the bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- indent - the amount to indent the border: INDENT_ZERO,
INDENT_ONE, or INDENT_TWO
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE, INDENT_ZERO, INDENT_ONE, INDENT_TWO
LabelButton
public LabelButton(String sText,
int alignStyle,
int bevelStyle,
Color color,
int indent,
boolean f)
- Constructs a Label3D with the specified attributes.
- Parameters:
- sText - text of the Label3D
- alignStyle - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- bevelStyle - the bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- color - the label text color
- indent - the amount to indent the border: INDENT_ZERO,
INDENT_ONE, or INDENT_TWO
- f - show the label text if true
- See Also:
- ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE, INDENT_ZERO, INDENT_ONE, INDENT_TWO
setAlignStyle
public void setAlignStyle(int style)
- Sets the text alignment style.
- Parameters:
- style - the text alignment style: ALIGN_LEFT, ALIGN_CENTERED, or ALIGN_RIGHT
- See Also:
- getAlignStyle, ALIGN_LEFT, ALIGN_CENTERED, ALIGN_RIGHT
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
setBevelStyle
public void setBevelStyle(int style)
- Sets the border style.
- Parameters:
- style - the border bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- See Also:
- getBevelStyle, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
getBevelStyle
public int getBevelStyle()
- Gets the current border style.
- Returns:
- the border bevel style: BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, or BEVEL_NONE
- See Also:
- setBevelStyle, BEVEL_RAISED, BEVEL_LOWERED, BEVEL_LINE, BEVEL_NONE
setBorderIndent
public void setBorderIndent(int indent)
- Sets the border indent amount.
Note that the border indent only applies to borders of BEVEL_LINE style.
- Parameters:
- indent - the amount to indent the border: INDENT_ZERO,
INDENT_ONE, or INDENT_TWO
- See Also:
- getBorderIndent, INDENT_ZERO, INDENT_ONE, INDENT_TWO
getBorderIndent
public int getBorderIndent()
- Gets the current border indent amount.
Note that the border indent only applies to borders of BEVEL_LINE style.
- Returns:
- the amount the border is currently indented: INDENT_ZERO,
INDENT_ONE, or INDENT_TWO
- See Also:
- setBorderIndent, INDENT_ZERO, INDENT_ONE, INDENT_TWO
setBorderedColor
public void setBorderedColor(Color color)
- Sets the border color.
- Parameters:
- color - the color to use for the border
setText
public void setText(String sText)
- Sets the label text.
- Parameters:
- sText - the new label text
- See Also:
- getText
getText
public String getText()
- Gets the current label text.
- Returns:
- the current label text
- See Also:
- setText
setTextColor
public void setTextColor(Color color)
- Sets the label text color.
- Parameters:
- color - the new color for the label text
- See Also:
- getTextColor
getTextColor
public Color getTextColor()
- Gets the current label text color.
- Returns:
- the current color of the label text
- See Also:
- setTextColor
setShowLabel
public void setShowLabel(boolean f)
- Sets whether the label will be shown.
- Parameters:
- f - true to show the label, false otherwise
- See Also:
- getShowLabel
getShowLabel
public boolean getShowLabel()
- Gets whether the label will be shown.
- Returns:
- true if the lable will be shown, false otherwise
- See Also:
- setShowLabel
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
setFont
public void setFont(Font f)
- Sets this component's text font.
This is a standard Java AWT method which gets called to change
the font used for drawing text in this component.
- Parameters:
- f - the new font to use for drawing text
- Overrides:
- setFont in class Component
- See Also:
- getFont
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.
For each axis, the preferred size is the maximum of the current size
and the minimum size needed to display the entire label text.
- Overrides:
- preferredSize in class Component
- See Also:
- minimumSize
minimumSize
public Dimension minimumSize()
- 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.
The minimum size is that size needed to display the entire label text.
- Overrides:
- minimumSize in class Component
- See Also:
- preferredSize
reshape
public synchronized void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
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.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
It is overridden here to prevent the flicker associated with the standard
update() method's repainting of the background before painting the component
itself.
- Parameters:
- g - the graphics context
- Overrides:
- update in class ButtonBase
- See Also:
- repaint, paint
All Packages Class Hierarchy This Package Previous Next Index