Class PageEnumeration
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.PageEnumeration
-
public class PageEnumeration extends java.lang.Object
An enumeration of pages for given print job on the given printer device. Each element in the enumeration has already had the page orientation and page margins applied. Therefore, when calling the paint(GC, int, int) method on each page, the printer's trim should be provided as the x and y arguments. In other words, the trim is taken as a minimum margin while applying calculating margins, but the position where the page's content is drawn is determined solely by the margin, and is not offset by the trim. This behavior is helpful for screen display, and is already compensated for in thePaperClips.print(PrintJob, Printer)
method.- See Also:
PaperClips.getPages(PrintJob, Printer)
-
-
Field Summary
Fields Modifier and Type Field Description private PrintIterator
document
private boolean
hasNext
private org.eclipse.swt.graphics.Rectangle
marginBounds
private org.eclipse.swt.graphics.Rectangle
paperBounds
-
Constructor Summary
Constructors Constructor Description PageEnumeration(PrintJob job, org.eclipse.swt.printing.Printer printer, org.eclipse.swt.graphics.GC gc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static PrintJob
applyOrientation(PrintJob printJob, org.eclipse.swt.printing.Printer printer)
private PrintPiece
createPagePiece(PrintPiece page)
boolean
hasNext()
Returns whether any pages remain.PrintPiece
nextPage()
Returns the next page.private static boolean
notDebugPiece(PrintPiece page)
private static boolean
notNull(PrintPiece page)
-
-
-
Field Detail
-
document
private PrintIterator document
-
marginBounds
private org.eclipse.swt.graphics.Rectangle marginBounds
-
paperBounds
private org.eclipse.swt.graphics.Rectangle paperBounds
-
hasNext
private boolean hasNext
-
-
Constructor Detail
-
PageEnumeration
PageEnumeration(PrintJob job, org.eclipse.swt.printing.Printer printer, org.eclipse.swt.graphics.GC gc)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns whether any pages remain.- Returns:
- whether any pages remain.
-
nextPage
public PrintPiece nextPage()
Returns the next page.- Returns:
- the next page.
-
createPagePiece
private PrintPiece createPagePiece(PrintPiece page)
-
notNull
private static boolean notNull(PrintPiece page)
-
notDebugPiece
private static boolean notDebugPiece(PrintPiece page)
-
-