Class sunsoft.jws.visual.rt.awt.LabelBar
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.awt.LabelBar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----sunsoft.jws.visual.rt.awt.LabelBar

public class LabelBar
extends Canvas
Displays a 3D bar with text within it. Useful as a divider between different parts of a panel. Uses the java.awt.Label contants for its alignment settings (LEFT, CENTER, RIGHT.)

When the alignment is set to LEFT, the label looks something like this:

   ----label---------------------------
Set the edge offset attribute to control how far from the edge the text in the label rests. When the alignment is CENTER, the offset is the distance on both sides on the label. You may set the label text to null to get a label bar that acts merely as a separator.

Variable Index

 o CENTER
The center alignment.
 o LEFT
The left alignment.
 o RIGHT
The right alignment.

Constructor Index

 o LabelBar()
 o LabelBar(String)

Method Index

 o disable()
Disables this component.
 o enable()
Enables this component.
 o getAlignment()
 o getLabel()
 o getLabelOffsetFromEdge()
 o minimumSize()
 o paint(Graphics)
Paints LabelBar contents.
 o preferredSize()
 o setAlignment(int)
 o setForeground(Color)
Sets the foreground color (the label bar text.) This overrides the setForeground call in Component in order to get an immediate repaint when the foreground color setting is changed.
 o setLabel(String)
 o setLabelOffsetFromEdge(int)

Variables

 o LEFT
  public final static int LEFT
The left alignment.
 o CENTER
  public final static int CENTER
The center alignment.
 o RIGHT
  public final static int RIGHT
The right alignment.

Constructors

 o LabelBar
  public LabelBar()
 o LabelBar
  public LabelBar(String label)

Methods

 o setLabel
  public void setLabel(String label)
 o getLabel
  public String getLabel()
 o setLabelOffsetFromEdge
  public void setLabelOffsetFromEdge(int offset)
 o getLabelOffsetFromEdge
  public int getLabelOffsetFromEdge()
 o setAlignment
  public void setAlignment(int alignment)
 o getAlignment
  public int getAlignment()
 o preferredSize
  public Dimension preferredSize()
Overrides:
preferredSize in class Component
 o minimumSize
  public Dimension minimumSize()
Overrides:
minimumSize in class Component
 o setForeground
  public void setForeground(Color c)
Sets the foreground color (the label bar text.) This overrides the setForeground call in Component in order to get an immediate repaint when the foreground color setting is changed.
Overrides:
setForeground in class Component
 o disable
  public void disable()
Disables this component. This overrides the same call in Component in order to get an immediate repaint when it is called.
Overrides:
disable in class Component
 o enable
  public void enable()
Enables this component. This overrides the same call in Component in order to get an immediate repaint when it is called.
Overrides:
enable in class Component
 o paint
  public void paint(Graphics g)
Paints LabelBar contents.
Overrides:
paint in class Canvas

All Packages  Class Hierarchy  This Package  Previous  Next  Index