Ascent Phase Corp.

org.ascentphase.suit
Class Label

java.lang.Object
  |
  +--org.ascentphase.suit.Widget
        |
        +--org.ascentphase.suit.Label

public class Label
extends Widget

A simple String Label.

Author:
huyd

Field Summary
protected  int anchor
           
protected  Font font
           
protected  java.lang.String label
           
 
Fields inherited from class org.ascentphase.suit.Widget
cmdToThrow
 
Constructor Summary
Label(java.lang.String l)
          Creates a label with the given string.
Label(java.lang.String l, int anchor)
          Creates a label with the given string and anchor point.
 
Method Summary
 int getAnchor()
           
 java.lang.String getLabel()
           
 void paint(Graphics g)
          Draws the widget.
 void setAnchor(int anchor)
           
 void setLabel(java.lang.String label)
           
 
Methods inherited from class org.ascentphase.suit.Widget
contains, getCommand, keyPressed, keyReleased, pointerDragged, pointerPressed, pointerReleased, setCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

protected java.lang.String label

font

protected Font font

anchor

protected int anchor
Constructor Detail

Label

public Label(java.lang.String l)
Creates a label with the given string. Sets the default anchor of throws Label to Graphics.TOP | Grephics.LEFT.

Parameters:
l - the text of the label.

Label

public Label(java.lang.String l,
             int anchor)
Creates a label with the given string and anchor point.

Parameters:
l - the text of the label.
anchor - the anchor value.
Method Detail

paint

public void paint(Graphics g)
Draws the widget.

Specified by:
paint in class Widget
Parameters:
g - the Graphics object to draw with.

getAnchor

public int getAnchor()
Returns:
Value of property anchor.

setAnchor

public void setAnchor(int anchor)
Parameters:
anchor - New value of property anchor.

getLabel

public java.lang.String getLabel()
Returns:
Value of property label.

setLabel

public void setLabel(java.lang.String label)
Parameters:
label - New value of property label.

Ascent Phase Corp.

Copyright © 2002 Ascent Phase Corp. All Rights Reserved.