Class sgraphics.figure.FigLabel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sgraphics.figure.FigLabel

java.lang.Object
   |
   +----sgraphics.GlyphImpl
           |
           +----sgraphics.figure.Figure
                   |
                   +----sgraphics.figure.FigLabel

public class FigLabel
extends Figure
implements Runnable
A text label.

Does not scale the point size if the allocation changes, nor does the position scale. If the label is vertical, the alignment is zero instead of the font's ascent.


Variable Index

 o HORIZONTAL
 o VERTICAL

Constructor Index

 o FigLabel(String)
 o FigLabel(String, boolean, boolean)
 o FigLabel(String, boolean, int)

Method Index

 o allocate(Allocation)
 o draw(Painter)
 o length()
 o needRedraw()
This calls up the parent chain which leads to redrawing all the glyphs under the Viewer.
 o pick(Picker)
 o position(float, float)
This will return the character position that would be hit for the given event coordinates.
 o requirements()
Return requirements based on the text.
 o run()
 o setStyle(FigureStyle)

Variables

 o HORIZONTAL
  public final static int HORIZONTAL
 o VERTICAL
  public final static int VERTICAL

Constructors

 o FigLabel
  public FigLabel(String text)
 o FigLabel
  public FigLabel(String text,
                  boolean run,
                  boolean draw)
 o FigLabel
  public FigLabel(String text,
                  boolean draw,
                  int direction)

Methods

 o run
  public void run()
 o requirements
  public Requirements requirements()
Return requirements based on the text.
Returns:
the requirements.
Overrides:
requirements in class GlyphImpl
 o setStyle
  public void setStyle(FigureStyle style)
Overrides:
setStyle in class Figure
 o allocate
  public synchronized void allocate(Allocation allocation)
Overrides:
allocate in class GlyphImpl
 o draw
  public synchronized void draw(Painter painter)
Overrides:
draw in class GlyphImpl
 o pick
  public void pick(Picker pick)
Overrides:
pick in class GlyphImpl
 o needRedraw
  public synchronized void needRedraw()
This calls up the parent chain which leads to redrawing all the glyphs under the Viewer.
Overrides:
needRedraw in class GlyphImpl
 o position
  public int position(float x,
                      float y)
This will return the character position that would be hit for the given event coordinates. For horizontal labels, only x is used. For vertical labels, only y is used. Coordinates are any valid event coordinates, but if the coordinates are outside of the allocation this will return 0.
Parameters:
x - the x coordinate.
y - the y coordinate.
Returns:
the character position hit starting at 0. If nothing is hit, then zero is returned.
Overrides:
position in class Figure
 o length
  public int length()

All Packages  Class Hierarchy  This Package  Previous  Next  Index