Class TextLine

java.lang.Object
  extended byTextLine

public class TextLine
extends Object

A horizontal line of character text.

Version:
3

Constructor Summary
TextLine(String text)
          Construct a TextLine.
 
Method Summary
 int getLength()
          Get the length of this line.
static void main(String[] args)
          Unit test for class.TextLine, assuming Screen and Terminal work.
 void paintOn(Screen s)
          Draw the TextLine to Screen s at position (0,0).
 void paintOn(Screen s, int x, int y)
          Paint this TextLine on Screen s at position (x,y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLine

public TextLine(String text)
Construct a TextLine.

Parameters:
text - the text of the line.
Method Detail

getLength

public int getLength()
Get the length of this line.

Returns:
the length in (character) pixels.

main

public static void main(String[] args)
Unit test for class.TextLine, assuming Screen and Terminal work.


paintOn

public void paintOn(Screen s)
Draw the TextLine to Screen s at position (0,0).

Parameters:
s - the Screen on which this line is to be painted.

paintOn

public void paintOn(Screen s,
                    int x,
                    int y)
Paint this TextLine on Screen s at position (x,y).

Parameters:
s - the Screen on which this line is to be painted.
x - the x position for the line.
y - the y position for the line.