|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
net.sf.paperclips.ui.PrintPreview
public class PrintPreview
A WYSIWYG (what you see is what you get) print preview panel. This control displays a preview of what a PrintJob will look like on paper, depending on the selected printer.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.swt.widgets.Control |
|---|
handle |
| Constructor Summary | |
|---|---|
PrintPreview(org.eclipse.swt.widgets.Composite parent,
int style)
Constructs a PrintPreview control. |
|
| Method Summary | |
|---|---|
org.eclipse.swt.graphics.Point |
computeSize(double scale)
Returns the control size needed to display a full page at the given scale. |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed)
|
float |
getAbsoluteScale()
Calculates the absolute scale that the print preview is displaying at. |
int |
getHorizontalPageCount()
Returns how many pages will be displayed in the horizontal direction. |
org.eclipse.swt.graphics.Rectangle |
getMargins()
Returns a Rectangle whose x, y, width, and height fields respectively indicate the margin at the left, top, right, and bottom edges of the control. |
int |
getPageCount()
Returns the known number of pages in the print job. |
int |
getPageIndex()
Returns the index of the first visible page. |
org.eclipse.swt.graphics.Point |
getPageSpacing()
Returns a Point whose x and y fields respectively indicate the horizontal and vertical spacing between pages on the control. |
org.eclipse.swt.printing.PrinterData |
getPrinterData()
Returns the PrinterData for the printer to preview on. |
PrintJob |
getPrintJob()
Returns the print job. |
float |
getScale()
Returns the view scale. |
int |
getVerticalPageCount()
Returns how many pages will be displayed in the vertical direction. |
boolean |
isFitHorizontal()
Returns whether the page scales to fit the document horizontally. |
boolean |
isFitVertical()
Returns whether the page scales to fit the document vertically. |
boolean |
isLazyPageLayout()
Returns whether the preview lays out pages lazily. |
boolean |
isPageLayoutComplete()
Returns whether all pages have been laid out. |
void |
setFitHorizontal(boolean fitHorizontal)
Sets whether the page scales to fit the document horizontally. |
void |
setFitVertical(boolean fitVertical)
Sets whether the page scales to fit the document vertically. |
void |
setHorizontalPageCount(int horizontalPages)
Sets how many pages will be displayed in the horizontal direction. |
void |
setLazyPageLayout(boolean lazy)
Sets whether the preview lays out pages lazily. |
void |
setMargins(org.eclipse.swt.graphics.Rectangle margins)
Sets the margins at each edge of the control to the argument. |
void |
setPageIndex(int pageIndex)
Sets the index of the first visible page to the argument. |
void |
setPageSpacing(org.eclipse.swt.graphics.Point pageSpacing)
Sets the horizontal and vertical spacing between pages to the argument. |
void |
setPrinterData(org.eclipse.swt.printing.PrinterData printerData)
Sets the PrinterData for the printer to preview on. |
void |
setPrintJob(PrintJob printJob)
Sets the print job to preview. |
void |
setScale(float scale)
Sets the view scale. |
void |
setVerticalPageCount(int verticalPages)
Sets how many pages will be displayed in the vertical direction. |
| Methods inherited from class org.eclipse.swt.widgets.Canvas |
|---|
drawBackground, getCaret, scroll, setCaret, setFont |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
|---|
changed, checkSubclass, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
|---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
|---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
|---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrintPreview(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the parent control.style - the control style.| Method Detail |
|---|
public PrintJob getPrintJob()
public void setPrintJob(PrintJob printJob)
printJob - the print job to preview.public org.eclipse.swt.printing.PrinterData getPrinterData()
public void setPrinterData(org.eclipse.swt.printing.PrinterData printerData)
printerData - the PrinterData for the printer to preview on.public int getPageIndex()
public void setPageIndex(int pageIndex)
pageIndex - the page index.public int getPageCount()
setLazyPageLayout(boolean) is set to
true, this method returns the number of pages laid out so far. This method returns 0 when
getPrintJob() is null or getPrinterData() is null.
public boolean isPageLayoutComplete()
public boolean isFitHorizontal()
public void setFitHorizontal(boolean fitHorizontal)
fitHorizontal - whether the page scales to fit the document horizontally.public boolean isFitVertical()
public void setFitVertical(boolean fitVertical)
fitVertical - whether the page scales to fit the document vertically.public float getScale()
public void setScale(float scale)
scale - the view scale. A scale of 1.0 causes the document to appear at full size on the computer
screen.public int getHorizontalPageCount()
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
public void setHorizontalPageCount(int horizontalPages)
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
horizontalPages - how many pages will be displayed in the horizontal direction.public int getVerticalPageCount()
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
public void setVerticalPageCount(int verticalPages)
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
verticalPages - how many pages will be displayed in the vertical direction.public boolean isLazyPageLayout()
public void setLazyPageLayout(boolean lazy)
lazy - whether the preview lays out pages lazily.public float getAbsoluteScale()
public org.eclipse.swt.graphics.Rectangle getMargins()
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
public void setMargins(org.eclipse.swt.graphics.Rectangle margins)
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
margins - a Rectangle whose x, y, width, and height fields respectively indicate the margin at the
left, top, right, and bottom edges of the control.public org.eclipse.swt.graphics.Point getPageSpacing()
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
public void setPageSpacing(org.eclipse.swt.graphics.Point pageSpacing)
THIS API IS EXPERIMENTAL AND MAY BE REMOVED OR CHANGED IN THE FUTURE.
pageSpacing - a Point whose x and y fields respectively indicate the horizontal and vertical
spacing between pages on the control.
public org.eclipse.swt.graphics.Point computeSize(int wHint,
int hHint,
boolean changed)
computeSize in class org.eclipse.swt.widgets.Compositepublic org.eclipse.swt.graphics.Point computeSize(double scale)
scale - the absolute scale. A scale of 1, for example, yields a "life size" preview.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||