|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel y.view.PrintPreviewPanel
public class PrintPreviewPanel
A generic print preview panel that can be used to
preview printing results. To preview printed diagrams,
this class is most effectively used in conjunction with the
Printable implementation Graph2DPrinter
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
PAGE_FORMAT_ACTION
Constant passed to initAction(javax.swing.Action, String) for I18n. |
static String |
PRINT_ACTION
Constant passed to initAction(javax.swing.Action, String) for I18n. |
static String |
ZOOM_IN_ACTION
Constant passed to initAction(javax.swing.Action, String) for I18n. |
static String |
ZOOM_OUT_ACTION
Constant passed to initAction(javax.swing.Action, String) for I18n. |
static String |
ZOOM_TO_FIT
Constant passed to getString(String) for I18n. |
static String |
ZOOM_TO_FIT_WIDTH
Constant passed to getString(String) for I18n. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PrintPreviewPanel(PrinterJob pj,
Printable p,
int columns,
int maxPages,
PageFormat pf)
Creates a new instance of PrintPreviewPanel |
Method Summary | |
---|---|
void |
addControlComponent(JComponent comp)
Adds a new control component to the toolbar of this preview panel. |
PageFormat |
getPageFormat()
Returns the currently used PageFormat |
protected String |
getString(String s)
Internationalization method, that translates the given string according to the currently set locale. |
protected void |
initAction(Action action,
String type)
Initializes an action that gets triggered by one of the predefined control components. |
void |
setPageFormat(PageFormat newFormat)
Sets the new PageFormat to be used in the Preview |
void |
setPages(int offset,
int columns,
int maxPages)
Specifies the range of pages to be previewed and the number of pages per row to be displayed. |
void |
zoomToFit()
Zooms the document to make it fit the preview panel. |
void |
zoomToFitWidth()
Zooms the document to make its width fit the preview panel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ZOOM_TO_FIT
getString(String)
for I18n.
public static final String ZOOM_TO_FIT_WIDTH
getString(String)
for I18n.
public static final String PAGE_FORMAT_ACTION
initAction(javax.swing.Action, String)
for I18n.
public static final String PRINT_ACTION
initAction(javax.swing.Action, String)
for I18n.
public static final String ZOOM_IN_ACTION
initAction(javax.swing.Action, String)
for I18n.
public static final String ZOOM_OUT_ACTION
initAction(javax.swing.Action, String)
for I18n.
Constructor Detail |
---|
public PrintPreviewPanel(PrinterJob pj, Printable p, int columns, int maxPages, PageFormat pf)
pj
- the printer job to be used for printingp
- printable to be printedcolumns
- number of columns to display per rowmaxPages
- maximum number of pages to be displayedpf
- default page format to be usedMethod Detail |
---|
public PageFormat getPageFormat()
PageFormat
public void setPageFormat(PageFormat newFormat)
PageFormat
to be used in the Preview
protected String getString(String s)
public void setPages(int offset, int columns, int maxPages)
offset
- number of the first page to be previewedcolumns
- number of pages per row to be displayed.maxPages
- maximum number of pages to displayed.public void zoomToFit()
public void zoomToFitWidth()
public void addControlComponent(JComponent comp)
protected void initAction(Action action, String type)
type
- action specifier. One of the predefined constants
PAGE_FORMAT_ACTION
, PRINT_ACTION
, ZOOM_IN_ACTION
and ZOOM_OUT_ACTION
.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |