net.wimpi.telnetd.io.toolkit
Class Label

java.lang.Object
  extended by net.wimpi.telnetd.io.toolkit.Component
      extended by net.wimpi.telnetd.io.toolkit.InertComponent
          extended by net.wimpi.telnetd.io.toolkit.Label

public class Label
extends InertComponent

Class that represents a label.

Version:
2.0 (16/07/2006)
Author:
Dieter Wimberger

Field Summary
 
Fields inherited from class net.wimpi.telnetd.io.toolkit.Component
m_Dim, m_IO, m_Name, m_Position
 
Constructor Summary
Label(BasicTerminalIO io, java.lang.String name)
          Constructs a Label instance, using the name as visible content.
Label(BasicTerminalIO io, java.lang.String name, java.lang.String text)
          Constructs a Label instance.
 
Method Summary
 void draw()
          Method that draws the label on the screen.
 java.lang.String getText()
          Accessor method for the text property of the label component.
 void setText(java.lang.String text)
          Mutator method for the text property of the label component.
 
Methods inherited from class net.wimpi.telnetd.io.toolkit.Component
getDimension, getLocation, getName, setDimension, setLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Label

public Label(BasicTerminalIO io,
             java.lang.String name,
             java.lang.String text)
Constructs a Label instance.

Parameters:
io - Instance of a class implementing the BasicTerminalIO interface.
name - String that represents the components name.
text - String that represents the visible label.

Label

public Label(BasicTerminalIO io,
             java.lang.String name)
Constructs a Label instance, using the name as visible content.

Parameters:
io - Instance of a class implementing the BasicTerminalIO interface.
name - String that represents the components name.
Method Detail

setText

public void setText(java.lang.String text)
Mutator method for the text property of the label component.

Parameters:
text - String displayed on the terminal.

getText

public java.lang.String getText()
Accessor method for the text property of the label component.

Returns:
String that is displayed when the label is drawn.

draw

public void draw()
          throws java.io.IOException
Method that draws the label on the screen.

Specified by:
draw in class Component
Throws:
java.io.IOException


Copyright © 2010. All Rights Reserved.