Package org.eclipse.draw2d
Class PrintFigureOperation
java.lang.Object
org.eclipse.draw2d.PrintOperation
org.eclipse.draw2d.PrintFigureOperation
Class responsible for printing Figures.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
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 final int
A print mode that scales the printer graphics so that the entire printed image fits on one page.static final int
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 final int
The default print mode. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor for PrintFigureOperation.PrintFigureOperation
(Printer p, IFigure srcFigure) Constructor for PrintFigureOperation. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Returns the current print mode.protected IFigure
Returns the printSource.protected void
This method contains all operations performed to sourceFigure prior to being printed.protected void
Prints the pages based on the current print mode.protected void
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.Methods inherited from class org.eclipse.draw2d.PrintOperation
cleanup, getFreshPrinterGraphics, getPrinter, getPrintRegion, run, setPrinter, setPrintMargin, setupGraphicsForPage
-
Field Details
-
TILE
public static final int TILEThe default print mode. Prints at 100% scale and tiles horizontally and/or vertically, if necessary.- See Also:
-
FIT_PAGE
public static final int FIT_PAGEA print mode that scales the printer graphics so that the entire printed image fits on one page.- See Also:
-
FIT_WIDTH
public static final int FIT_WIDTHA print mode that scales the printer graphics so that the width of the printed image fits on one page and tiles vertically, if necessary.- See Also:
-
FIT_HEIGHT
public static final int FIT_HEIGHTA print mode that scales the printer graphics so that the height of the printed image fits on one page and tiles horizontally, if necessary.- See Also:
-
-
Constructor Details
-
PrintFigureOperation
Constructor for PrintFigureOperation.Note: Descendants must call setPrintSource(IFigure) to set the IFigure that is to be printed.
- See Also:
-
PrintFigureOperation
Constructor for PrintFigureOperation.- Parameters:
p
- Printer to print onsrcFigure
- Figure to print
-
-
Method Details
-
getPrintMode
protected int getPrintMode()- Returns:
- the print mode
-
getPrintSource
Returns the printSource.- Returns:
- IFigure The source IFigure
-
preparePrintSource
protected void preparePrintSource()Description copied from class:PrintOperation
This method contains all operations performed to sourceFigure prior to being printed.- Overrides:
preparePrintSource
in classPrintOperation
- See Also:
-
printPages
protected void printPages()Prints the pages based on the current print mode.- Specified by:
printPages
in classPrintOperation
- See Also:
-
restorePrintSource
protected void restorePrintSource()Description copied from class:PrintOperation
This method contains all operations performed to sourceFigure after being printed.- Overrides:
restorePrintSource
in classPrintOperation
- See Also:
-
setPrintMode
public void setPrintMode(int mode) - Parameters:
mode
- the print mode
-
setPrintSource
Sets the printSource.- Parameters:
printSource
- The printSource to set
-
setupPrinterGraphicsFor
Sets up Graphics object for the given IFigure.- Parameters:
graphics
- The Graphics to setupfigure
- The IFigure used to setup graphics
-