AFLPgui
Class TextPrinter

java.lang.Object
  |
  +--AFLPgui.TextPrinter

public class TextPrinter
extends java.lang.Object

This class will take a printjob and a string and print that string to the printer, wrapping lines that are to long and moving to a new page when neccessary. It will also add a footer to the bottom of each page saying "Page i of totalNum".

See Also:
PrintJob

Constructor Summary
TextPrinter(java.awt.PrintJob pJob)
          Creates a new textprinter with a font of Sans Serif, 12pt.
 
Method Summary
 void printString(java.lang.String output, java.awt.Graphics firstPage)
          Prints the given string to the destination of the print job given in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPrinter

public TextPrinter(java.awt.PrintJob pJob)
Creates a new textprinter with a font of Sans Serif, 12pt.
Parameters:
pJob - the printer job that will provide the graphics to print to
Method Detail

printString

public void printString(java.lang.String output,
                        java.awt.Graphics firstPage)
Prints the given string to the destination of the print job given in the constructor. If a line is to long, then it will be wrapped by character, not by word. This means that words may be split. It will also print a footer that gives the page number out of the total pages.
Parameters:
output - the text to print. Lines should be seperated with a '\n' character.
firstPage - the first page of the print job.