|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwo.utils.gui.PrintUtilities
Handles the printing of any printable object.
Constructor Summary | |
PrintUtilities()
Sets up the print services for possible printing. |
|
PrintUtilities(DocFlavor flavour)
Sets up the print services for possible printing. |
Method Summary | |
static Paper |
createA3()
Returns an object representing A3 paper with 2cm margins. |
static Paper |
createA4()
Returns an object representing A4 paper with 2cm margins. |
float |
getScale(Dimension objectSize,
PageFormat pageFormat)
Reports the scaling that would be applied if an object of the given size was to be printed using the supplied page format. |
void |
print(Printable printableObject,
boolean showDialogue)
Prints the given printable object. |
void |
printDataTransferCompleted(PrintJobEvent e)
Reports that the transfer of data to print job has been completed, but currently ignored. |
void |
printJobCanceled(PrintJobEvent e)
Reports that the print job has been cancelled for some reason. |
void |
printJobCompleted(PrintJobEvent e)
Reports that the print job has been completed, but currently ignored. |
void |
printJobFailed(PrintJobEvent e)
Reports that there has been some problem with the print job. |
void |
printJobNoMoreEvents(PrintJobEvent e)
Reports that there will be no more events generated by this print job, but currently ignored. |
void |
printJobRequiresAttention(PrintJobEvent e)
Reports that print job requires attention of some kind. |
void |
printPreview(Frame parent,
Printable printableObject)
Provides a print preview of the given printable object. |
void |
run()
Queries the available print services. |
Graphics2D |
scale(Graphics g,
Dimension objectSize,
PageFormat pageFormat,
int pageIndex)
Scales the given graphics to the required printer page dimensions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PrintUtilities()
public PrintUtilities(DocFlavor flavour)
flavour
- Type of document to print.Method Detail |
public void run()
run
in interface Runnable
public void print(Printable printableObject, boolean showDialogue)
printableObject
- Printable object.showDialogue
- Will ask for printer type if true.public void printPreview(Frame parent, Printable printableObject)
parent
- Parent GUI requesting print preview.printableObject
- Printable object.public Graphics2D scale(Graphics g, Dimension objectSize, PageFormat pageFormat, int pageIndex)
g
- Graphics context to print.objectSize
- Size of object to print.pageFormat
- Page format for printing.pageIndex
- Page index (for multiple pages).
public float getScale(Dimension objectSize, PageFormat pageFormat)
objectSize
- Size of object to print.pageFormat
- Page format for printing.
public void printDataTransferCompleted(PrintJobEvent e)
printDataTransferCompleted
in interface PrintJobListener
e
- Event monitoring print job.public void printJobCompleted(PrintJobEvent e)
printJobCompleted
in interface PrintJobListener
e
- Event monitoring print job.public void printJobFailed(PrintJobEvent e)
printJobFailed
in interface PrintJobListener
e
- Event monitoring print job.public void printJobCanceled(PrintJobEvent e)
printJobCanceled
in interface PrintJobListener
e
- Event monitoring print job.public void printJobNoMoreEvents(PrintJobEvent e)
printJobNoMoreEvents
in interface PrintJobListener
e
- Event monitoring print job.public void printJobRequiresAttention(PrintJobEvent e)
printJobRequiresAttention
in interface PrintJobListener
e
- Event monitoring print job.public static Paper createA4()
public static Paper createA3()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |