All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.taligent.widget.Caption

java.lang.Object
   |
   +----COM.taligent.widget.Caption

public class Caption
extends Object
implements Serializable, Paintable
A simple class that encapsulates a caption used within CaptionBar. To keep it lightweight, each caption is no longer a separate component. It is now merely a Paintable object that knows how to draw itself.

See Also:
CaptionBar

Variable Index

 o DEFAULT_LENGTH
Default caption length (50).

Constructor Index

 o Caption()
Constructs a caption with a blank label.
 o Caption(String)
Constructs a caption with the specified label and default length.

Method Index

 o getLabel()
Returns the current label.
 o getLength()
Returns the current length of the caption.
 o getSize()
Method required by Paintable interface but not really used.
 o isResizable()
Returns true if this caption is resizable.
 o isSelected()
Returns whether this caption is currently selected.
 o isVisible()
Returns whether the caption is currently being shown or not.
 o paint(Graphics)
Paints the caption in the given graphics context.
 o setLabel(String)
Sets the label displayed on the caption.
 o setLength(int)
Sets the length of the caption.
 o setResizable(boolean)
Sets whether this caption is resizable.
 o setSelected(boolean)
Selects or deselected this caption.
 o setVisible(boolean)
Shows or hides the caption.
 o toString()
Returns a string representation of this Caption.

Variables

 o DEFAULT_LENGTH
 public static final int DEFAULT_LENGTH
Default caption length (50).

Constructors

 o Caption
 public Caption()
Constructs a caption with a blank label.

 o Caption
 public Caption(String label)
Constructs a caption with the specified label and default length.

Parameters:
label - The text string to display on the caption.
See Also:
DEFAULT_LENGTH

Methods

 o setLabel
 public void setLabel(String label)
Sets the label displayed on the caption.

Parameters:
label - The new label.
See Also:
getLabel
 o getLabel
 public String getLabel()
Returns the current label.

See Also:
setLabel
 o setLength
 public void setLength(int length)
Sets the length of the caption. If an invalid length is specified, then the length will be set to the default length.

Parameters:
length - The new length.
See Also:
DEFAULT_LENGTH, getLength
 o getLength
 public int getLength()
Returns the current length of the caption.

See Also:
DEFAULT_LENGTH, setLength
 o setResizable
 public void setResizable(boolean resizable)
Sets whether this caption is resizable.

Parameters:
resizable - Is true if caption is resizable; false if not.
See Also:
isResizable
 o isResizable
 public boolean isResizable()
Returns true if this caption is resizable.

See Also:
setResizable
 o setVisible
 public void setVisible(boolean visible)
Shows or hides the caption. The Component that contains this caption is responsible for repainting the display.

Parameters:
visible - True to show, false to hide.
See Also:
isVisible
 o isVisible
 public boolean isVisible()
Returns whether the caption is currently being shown or not.

See Also:
setVisible
 o setSelected
 public void setSelected(boolean selected)
Selects or deselected this caption. This changes the appearance of caption -- by default, shows the label in a BOLD font.

Parameters:
selected - True if selected, false if not selected.
See Also:
isSelected
 o isSelected
 public boolean isSelected()
Returns whether this caption is currently selected.

See Also:
setSelected
 o getSize
 public Dimension getSize()
Method required by Paintable interface but not really used.

 o paint
 public void paint(Graphics g)
Paints the caption in the given graphics context.

Parameters:
g - The graphics context.
 o toString
 public String toString()
Returns a string representation of this Caption.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index