public class PrintFigureOperation extends PrintOperation
Modifier and Type | Field and Description |
---|---|
static int |
FIT_HEIGHT
A print mode that scales the printer graphics so that the height of the
printed image fits on one page and tiles horizontally, if necessary.
|
static int |
FIT_PAGE
A print mode that scales the printer graphics so that the entire printed
image fits on one page.
|
static int |
FIT_WIDTH
A print mode that scales the printer graphics so that the width of the
printed image fits on one page and tiles vertically, if necessary.
|
static int |
TILE
The default print mode.
|
Modifier | Constructor and Description |
---|---|
protected |
PrintFigureOperation(Printer p)
Constructor for PrintFigureOperation.
|
|
PrintFigureOperation(Printer p,
IFigure srcFigure)
Constructor for PrintFigureOperation.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getPrintMode()
Returns the current print mode.
|
protected IFigure |
getPrintSource()
Returns the printSource.
|
protected void |
preparePrintSource()
This method contains all operations performed to sourceFigure prior to
being printed.
|
protected void |
printPages()
Prints the pages based on the current print mode.
|
protected void |
restorePrintSource()
This method contains all operations performed to sourceFigure after being
printed.
|
void |
setPrintMode(int mode)
Sets the print mode.
|
protected void |
setPrintSource(IFigure printSource)
Sets the printSource.
|
protected void |
setupPrinterGraphicsFor(Graphics graphics,
IFigure figure)
Sets up Graphics object for the given IFigure.
|
cleanup, getFreshPrinterGraphics, getPrinter, getPrintRegion, run, setPrinter, setPrintMargin, setupGraphicsForPage
public static final int TILE
public static final int FIT_PAGE
public static final int FIT_WIDTH
public static final int FIT_HEIGHT
protected PrintFigureOperation(Printer p)
Note: Descendants must call setPrintSource(IFigure) to set the IFigure that is to be printed.
protected int getPrintMode()
protected IFigure getPrintSource()
protected void preparePrintSource()
PrintOperation
preparePrintSource
in class PrintOperation
PrintOperation.preparePrintSource()
protected void printPages()
printPages
in class PrintOperation
PrintOperation.printPages()
protected void restorePrintSource()
PrintOperation
restorePrintSource
in class PrintOperation
PrintOperation.restorePrintSource()
public void setPrintMode(int mode)
mode
- the print modeprotected void setPrintSource(IFigure printSource)
printSource
- The printSource to setCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.