voji.utils
Class CopyPrintJob

java.lang.Object
  |
  +--java.awt.PrintJob
        |
        +--voji.utils.CopyPrintJob

public class CopyPrintJob
extends java.awt.PrintJob

This class redirects all functions to another PrintJob.


Constructor Summary
CopyPrintJob()
          Creates a new empty instance of CopyPrintJob
CopyPrintJob(java.awt.PrintJob printJob)
          Creates a new empty instance of CopyPrintJob handling the given PrintJob.
 
Method Summary
 void end()
          Ends the print job and does any necessary cleanup
 java.awt.Graphics getGraphics()
          Gets a Graphics object that will draw to the next page.
 java.awt.Dimension getPageDimension()
          Returns the dimensions of the page in pixels
 PageGraphics getPageGraphics()
          Gets a Graphics object that will draw to the next page.
 int getPageResolution()
          Returns the resolution of the page in pixels per inch
 boolean lastPageFirst()
          Returns true if the last page will be printed first
 void setPrintJob(java.awt.PrintJob printJob)
          Sets the current print job
 void setTranslation(double x, double y)
          Sets the initial translation for each page in inches
 void setTranslation(java.util.Properties info)
          Sets the initial translation for each page in inches
 
Methods inherited from class java.awt.PrintJob
finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyPrintJob

public CopyPrintJob()
Creates a new empty instance of CopyPrintJob


CopyPrintJob

public CopyPrintJob(java.awt.PrintJob printJob)
Creates a new empty instance of CopyPrintJob handling the given PrintJob.

Parameters:
printJob - the PrintJob where to redirect all actions to
Method Detail

setPrintJob

public void setPrintJob(java.awt.PrintJob printJob)
Sets the current print job

Parameters:
printJob - the new PrintJob where to redirect all actions to

setTranslation

public void setTranslation(double x,
                           double y)
Sets the initial translation for each page in inches

Parameters:
x - the x coordinate (in inches) where to translate all pages to
y - the y coordinate (in inches) where to translate all pages to

setTranslation

public void setTranslation(java.util.Properties info)
Sets the initial translation for each page in inches

Parameters:
info - the Properties where to take the parameters from. The keys are voji.print.x and voji.print.y.

getGraphics

public java.awt.Graphics getGraphics()
Gets a Graphics object that will draw to the next page. This graphics object will also implement the PrintGraphics interface and will be translated.

Specified by:
getGraphics in class java.awt.PrintJob
Returns:
a Graphics object which draws to the next page.

getPageGraphics

public PageGraphics getPageGraphics()
Gets a Graphics object that will draw to the next page. This graphics object will be translated.

Returns:
a PageGraphics object which draws to the next page.

getPageDimension

public java.awt.Dimension getPageDimension()
Returns the dimensions of the page in pixels

Specified by:
getPageDimension in class java.awt.PrintJob

getPageResolution

public int getPageResolution()
Returns the resolution of the page in pixels per inch

Specified by:
getPageResolution in class java.awt.PrintJob

lastPageFirst

public boolean lastPageFirst()
Returns true if the last page will be printed first

Specified by:
lastPageFirst in class java.awt.PrintJob

end

public void end()
Ends the print job and does any necessary cleanup

Specified by:
end in class java.awt.PrintJob