qat.gui
Class PrintManager

java.lang.Object
  extended byqat.gui.PrintManager

public class PrintManager
extends java.lang.Object


Constructor Summary
PrintManager(java.lang.String printJobTitle, javax.swing.JFrame f)
           
 
Method Summary
 void endPrint()
          This function must be called to end the print job correctly.
static java.lang.String fill(char c, int len)
           
 boolean getBorder()
           
 java.awt.Color getColor()
          This function returns the color text is currently being printed in
 java.awt.Font getFont()
           
 int getFontSize()
           
 int getFontStyle()
           
 java.awt.Graphics getGraphics()
          This function returns the Graphics object of the current page, to allow direct manipulation or printing onto the printer canvas
 int getPageHeight()
           
 int getPageNumber()
           
 int getPageWidth()
           
 boolean getWrap()
           
 void newLine()
          This prints a blank line
 void newPage()
          This function generates a new page, and sends the previous one to the printer.
static java.lang.String padLeft(java.lang.String s, char c, int len)
           
static java.lang.String padRight(java.lang.String s, char c, int len)
           
 void print(int x, int y, java.lang.String s)
          This function prints the string s at the co-ord (x,y).
 void print(java.lang.String s)
          This function prints text, continuing from position of the last text printed.
 void printHeader()
           
 void printLine(char c)
           
 void println(java.lang.String s)
          This writes out the string s at the current position, and then positions output to start on the next line.
 void setBorder(boolean val)
          This function prints a border around the current page
 void setColor(java.awt.Color c)
          This functions sets the color of the text to print
 void setFont(java.awt.Font f)
          This method sets the font used to print the text.
 void setFontSize(int size)
           
 void setFontStyle(int style)
           
 void setHeader(java.lang.String h)
           
 void setHeader(java.lang.String[] h)
           
 void setWrap(boolean wrap)
          This function sets whether text too long for the current line is wrapped or not
 boolean startPrint()
          Returns true if the print is Okayed by the user, else if user selected cancel, this function returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintManager

public PrintManager(java.lang.String printJobTitle,
                    javax.swing.JFrame f)
Method Detail

println

public void println(java.lang.String s)
This writes out the string s at the current position, and then positions output to start on the next line. If there is not enough room on the current page, a new page is started. No text wrapping occurs, so text too long to be printed on one line will be lost!


print

public void print(java.lang.String s)
This function prints text, continuing from position of the last text printed. If wrap is set to true, text longer than the page size will be wrapped to a new line.


print

public void print(int x,
                  int y,
                  java.lang.String s)
This function prints the string s at the co-ord (x,y). It has no effect on where the next call to println produces it's output.


setBorder

public void setBorder(boolean val)
This function prints a border around the current page


getBorder

public boolean getBorder()

setWrap

public void setWrap(boolean wrap)
This function sets whether text too long for the current line is wrapped or not


getWrap

public boolean getWrap()

newLine

public void newLine()
This prints a blank line


newPage

public void newPage()
This function generates a new page, and sends the previous one to the printer.


printHeader

public void printHeader()

printLine

public void printLine(char c)

setHeader

public void setHeader(java.lang.String[] h)

setHeader

public void setHeader(java.lang.String h)

fill

public static java.lang.String fill(char c,
                                    int len)

padRight

public static java.lang.String padRight(java.lang.String s,
                                        char c,
                                        int len)

padLeft

public static java.lang.String padLeft(java.lang.String s,
                                       char c,
                                       int len)

startPrint

public boolean startPrint()
Returns true if the print is Okayed by the user, else if user selected cancel, this function returns false.


endPrint

public void endPrint()
This function must be called to end the print job correctly.


setColor

public void setColor(java.awt.Color c)
This functions sets the color of the text to print


getColor

public java.awt.Color getColor()
This function returns the color text is currently being printed in


setFont

public void setFont(java.awt.Font f)
This method sets the font used to print the text.


getFont

public java.awt.Font getFont()

setFontStyle

public void setFontStyle(int style)

getFontStyle

public int getFontStyle()

setFontSize

public void setFontSize(int size)

getFontSize

public int getFontSize()

getPageNumber

public int getPageNumber()

getPageHeight

public int getPageHeight()

getPageWidth

public int getPageWidth()

getGraphics

public java.awt.Graphics getGraphics()
This function returns the Graphics object of the current page, to allow direct manipulation or printing onto the printer canvas



See QAT project for licensing details