net.wimpi.telnetd.io.toolkit
Class Component

java.lang.Object
  extended by net.wimpi.telnetd.io.toolkit.Component
Direct Known Subclasses:
ActiveComponent, InertComponent

public abstract class Component
extends java.lang.Object

Class that represents an abstract toolkit component.

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

Field Summary
protected  Dimension m_Dim
           
protected  BasicTerminalIO m_IO
           
protected  java.lang.String m_Name
           
protected  Point m_Position
           
 
Constructor Summary
Component(BasicTerminalIO io, java.lang.String name)
          Constructor for an abstract toolkit component.
 
Method Summary
abstract  void draw()
          Method that draws the component.
 Dimension getDimension()
          Accessor method for a components dimension.
 Point getLocation()
          Accessor method for a components location.
 java.lang.String getName()
          Accessor method for the name property of a component.
protected  void setDimension(Dimension dim)
          Mutator method for a components dimension.
 void setLocation(int col, int row)
          Convenience mutator method for a components location.
 void setLocation(Point pos)
          Mutator method for a components location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Name

protected java.lang.String m_Name

m_IO

protected BasicTerminalIO m_IO

m_Position

protected Point m_Position

m_Dim

protected Dimension m_Dim
Constructor Detail

Component

public Component(BasicTerminalIO io,
                 java.lang.String name)
Constructor for an abstract toolkit component.

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

draw

public abstract void draw()
                   throws java.io.IOException
Method that draws the component.

Throws:
java.io.IOException

getName

public java.lang.String getName()
Accessor method for the name property of a component.

Returns:
String that represents the components name.

getLocation

public Point getLocation()
Accessor method for a components location.

Returns:
Point that encapsulates the location.

setLocation

public void setLocation(Point pos)
Mutator method for a components location.

Parameters:
pos - Point that encapsulates the (new) Location.

setLocation

public void setLocation(int col,
                        int row)
Convenience mutator method for a components location.

Parameters:
col - int that represents a column coordinate.
row - int that represents a row coordinate.

getDimension

public Dimension getDimension()
Accessor method for a components dimension.

Returns:
Dimension that encapsulates the dimension in cols and rows.

setDimension

protected void setDimension(Dimension dim)
Mutator method for a components dimension.

Parameters:
dim - Dimension that encapsulates the dimension in cols and rows.


Copyright © 2010. All Rights Reserved.