public abstract class PrintOperation
extends java.lang.Object
Constructor and Description |
---|
PrintOperation()
Creates a new PrintOperation
|
PrintOperation(Printer p)
Creates a new PrintOperation on Printer p
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup()
Disposes the PrinterGraphics and GC objects associated with this
PrintOperation.
|
protected PrinterGraphics |
getFreshPrinterGraphics()
Returns a new PrinterGraphics setup for the Printer associated with this
PrintOperation.
|
Printer |
getPrinter()
Returns the printer.
|
Rectangle |
getPrintRegion()
Returns a Rectangle that represents the region that can be printed to.
|
protected void |
preparePrintSource()
This method contains all operations performed to sourceFigure prior to
being printed.
|
protected abstract void |
printPages()
This method is responsible for printing pages.
|
protected void |
restorePrintSource()
This method contains all operations performed to sourceFigure after being
printed.
|
void |
run(java.lang.String jobName)
Sets the print job into motion.
|
void |
setPrinter(Printer printer)
Sets the printer.
|
void |
setPrintMargin(Insets margin)
Sets the page margin in pels (logical pixels) to the passed Insets.(72
pels == 1 inch)
|
protected void |
setupGraphicsForPage(PrinterGraphics pg)
Manipulates the PrinterGraphics to position it to paint in the desired
region of the page.
|
public PrintOperation()
public PrintOperation(Printer p)
p
- The printer to print onprotected void cleanup()
protected PrinterGraphics getFreshPrinterGraphics()
public Printer getPrinter()
public Rectangle getPrintRegion()
protected void preparePrintSource()
protected abstract void printPages()
protected void restorePrintSource()
public void run(java.lang.String jobName)
jobName
- A String representing the name of the print jobpublic void setPrinter(Printer printer)
printer
- The printer to setpublic void setPrintMargin(Insets margin)
margin
- The margin to set on the pageprotected void setupGraphicsForPage(PrinterGraphics pg)
pg
- The PrinterGraphics to setupCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.