Class TextAligner

java.lang.Object
  |
  +--TextAligner

public class TextAligner
extends java.lang.Object

TextAligner class. Handles aligning the given text to fit in the applet size


Method Summary
 void init()
          Initialize the object.
 void paint(java.awt.Graphics g)
          Paint the strings on the screen.
 java.lang.String[] parseStrings(java.lang.String str, java.lang.String sep)
          devides the given string into words, based on the separator string passed (space).
 void start()
          The Start function, called from the animation thread.
 void update()
          The update function, called from the animation thread.
 java.lang.String[] wordWrap(java.lang.String str, java.awt.FontMetrics fm, int width)
          devide the given string into smaller set of strings that fit in the width of the applet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init()
Initialize the object.

start

public void start()
The Start function, called from the animation thread.

update

public void update()
The update function, called from the animation thread.

paint

public void paint(java.awt.Graphics g)
Paint the strings on the screen.

parseStrings

public java.lang.String[] parseStrings(java.lang.String str,
                                       java.lang.String sep)
devides the given string into words, based on the separator string passed (space).

wordWrap

public java.lang.String[] wordWrap(java.lang.String str,
                                   java.awt.FontMetrics fm,
                                   int width)
devide the given string into smaller set of strings that fit in the width of the applet.