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 intA 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 intA print mode that scales the printer graphics so that the entire printed image fits on one page.static final intA 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 intThe default print mode. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for PrintFigureOperation.PrintFigureOperation(Printer p, IFigure srcFigure) Constructor for PrintFigureOperation. -
Method Summary
Modifier and TypeMethodDescriptionprotected intReturns the current print mode.protected IFigureReturns the printSource.protected voidThis method contains all operations performed to sourceFigure prior to being printed.protected voidPrints the pages based on the current print mode.protected voidThis method contains all operations performed to sourceFigure after being printed.voidsetPrintMode(int mode) Sets the print mode.protected voidsetPrintSource(IFigure printSource) Sets the printSource.protected voidsetupPrinterGraphicsFor(Graphics graphics, IFigure figure) Sets up Graphics object for the given IFigure.Methods inherited from class org.eclipse.draw2d.PrintOperation
cleanup, createGraphics, getFreshGraphics, getFreshPrinterGraphics, getPrinter, getPrintRegion, run, setPrinter, setPrintMargin, setupGraphicsForPage, 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:PrintOperationThis method contains all operations performed to sourceFigure prior to being printed.- Overrides:
preparePrintSourcein classPrintOperation- See Also:
-
printPages
protected void printPages()Prints the pages based on the current print mode.- Specified by:
printPagesin classPrintOperation- See Also:
-
restorePrintSource
protected void restorePrintSource()Description copied from class:PrintOperationThis method contains all operations performed to sourceFigure after being printed.- Overrides:
restorePrintSourcein 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
-