|
Style Intelligence v12.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
inetsoft.report.Previewer
public class Previewer
The Previewer class can be used to preview a document before it's actually printed. The Previewer is very easy to use. Its main API is consisted of one method, Previewer.print(ReportSheet). To add preview capability to your application, simply create a Previewer, pack and set it to visible like any window, and call the print() method with the created report.
Previewer implements the PreviewView interface, which defines the API used for previewing a report. The Style Report supports three variations of previewer. The Previewer class is AWT based and has no dependency on the Swing package, and uses JDK1.1 only API. The JPreviewer is JDK1.1 based previewer but uses Swing for the GUI components. The Previewer2D is JDK1.2 based and supports the advanced Java2D API.
The Previewer provides a convenience method, createPreviewer() to create a previewer based on the program's runtime. If a program is running in JDK1.2, the createPreviewer() constructs a Previewer2D object. Otherwise, if Swing is accessible in the runtime, it constructs a JPreviewer object. If none of the above condition is satisfied, it creates a plain Previewer that only requires the core JDK1.1 support. Since all three previewer variants implements the PreviewView interface, it should be used to access the previewer API.
PreviewView previewer = Previewer.createPreviewer();
previewer.pack();
previewer.setVisible(true);
previewer.print(report);
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected PreviewPane |
pane
|
protected ReportSheet |
sheet
|
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface inetsoft.report.PreviewView |
|---|
CLOSE_BUTTON, FULL_SCREEN_BUTTON, N_PAGE_BUTTON, ONE_PAGE_BUTTON, PRINT_BUTTON, ZOOM_BUTTON |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Previewer()
Create an empty previewer. |
|
Previewer(String title)
Create a previewer with specified title. |
|
Previewer(String title,
boolean fullpage)
Create a previewer with specified title. |
|
Previewer(String title,
int w,
int h)
Create a previewer with specified title and size. |
|
Previewer(String title,
PrintJob job,
boolean fullpage)
Create a previewer with specified title. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Start printing. |
void |
addDisposeListener(ActionListener listener)
Add a dispose listener which will be notified when the preview view be disposed. |
void |
addSelectionListener(SelectionListener l)
Add a selection listener. |
void |
addToolbarComponent(Component comp)
Add a component to the toolbar. |
protected PreviewPane |
createPane()
Create the main preview pane. |
static PreviewView |
createPreviewer()
Create a new PreviewView object according to the runtime environment. |
void |
dispose()
Dispose the preview window. |
int |
getOrientation()
Returns the orientation of this PageFormat. |
double |
getPageHeight()
Get the page height in inches. |
int |
getPageResolution()
Deprecated. as of 5.1. |
double |
getPageWidth()
Get the page width in inches. |
Dimension |
getPreferredSize()
The previewer defaults to full screen size. |
ReportSheet |
getReport()
Get the report displayed in this previewer. |
Enumeration |
getStylePages()
Get the style pages in the preview frame. |
double |
getZoom()
Get the zoom percentage. |
static void |
main(String[] args)
Run previewer as a standalone program to view a saved report. |
void |
print(ReportSheet sheet)
Print the report in this previewer. |
void |
printAction()
Start printing to printer. |
void |
removeSelectionListener(SelectionListener l)
Remove a selection listener. |
void |
setExitOnClose(boolean exitit)
If the ExitOnClose is set to true, the Previewer exits from the application when the previewer window is closed. |
void |
setOrientation(int orientation)
Deprecated. as of 5.1. |
void |
setPageHeight(double height)
Deprecated. as of 5.1. |
void |
setPageResolution(int res)
Deprecated. as of 5.1. |
void |
setPages(int rows,
int cols)
Set the multi-page dimension. |
void |
setPageWidth(double width)
Deprecated. as of 5.1. |
void |
setPreferredSize(Dimension size)
Set the preferred size of the previewer window. |
void |
setStylePages(Enumeration pages)
Display the StylePages in the preview pane. |
void |
setToolbarButtons(int buttons)
Set the buttons on the toolbar. |
void |
update(Graphics g)
|
void |
writeReport(OutputStream os)
Writes the previewed report into a .sro file. |
void |
zoom(double perc)
Set the zooming percentage. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface inetsoft.report.PreviewView |
|---|
pack, setTitle, setVisible |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected PreviewPane pane
protected ReportSheet sheet
| Constructor Detail |
|---|
public Previewer()
public Previewer(String title,
boolean fullpage)
title - previewer title.fullpage - true to show pages in one pg/screen.
public Previewer(String title,
PrintJob job,
boolean fullpage)
The PrintJob is used for printing when the previewer print button is pressed. The page size information is also extracted from the PrintJob object.
title - previewer title.job - print job.fullpage - true to show pages in one pg/screen.public Previewer(String title)
title - previewer title.
public Previewer(String title,
int w,
int h)
title - window title.w - window width.h - window height.| Method Detail |
|---|
public static PreviewView createPreviewer()
protected PreviewPane createPane()
public void printAction()
printAction in interface PreviewViewpublic void setToolbarButtons(int buttons)
setToolbarButtons in interface PreviewViewbuttons - bit-wise OR of the button masks.public void addToolbarComponent(Component comp)
addToolbarComponent in interface PreviewViewpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic Dimension getPreferredSize()
getPreferredSize in class Containerpublic void setPreferredSize(Dimension size)
setPreferredSize in interface PreviewViewsetPreferredSize in class Componentpublic void setPageWidth(double width)
setPageWidth in interface PreviewViewwidth - page width.public double getPageWidth()
getPageWidth in interface PreviewViewpublic void setPageHeight(double height)
setPageHeight in interface PreviewViewheight - page height.public double getPageHeight()
getPageHeight in interface PreviewViewpublic void setOrientation(int orientation)
orientation must be
one of the constants: PORTRAIT, LANDSCAPE.
setOrientation in interface PreviewVieworientation - the new orientation for the pagepublic int getOrientation()
PageFormat.
getOrientation in interface PreviewViewPageFormat object's orientation.public void setPageResolution(int res)
setPageResolution in interface PreviewViewres - page resolution.public int getPageResolution()
getPageResolution in interface PreviewViewpublic Enumeration getStylePages()
getStylePages in interface PreviewViewpublic void setStylePages(Enumeration pages)
setStylePages in interface PreviewViewpages - return a collection of StylePage objects.public void print(ReportSheet sheet)
print in interface PreviewViewsheet - report.public ReportSheet getReport()
getReport in interface PreviewViewpublic void zoom(double perc)
zoom in interface PreviewViewperc - zooming percentage.public double getZoom()
getZoom in interface PreviewViewpublic void setExitOnClose(boolean exitit)
setExitOnClose in interface PreviewViewpublic void addSelectionListener(SelectionListener l)
addSelectionListener in interface PreviewViewpublic void removeSelectionListener(SelectionListener l)
removeSelectionListener in interface PreviewView
public void setPages(int rows,
int cols)
rows - the number of rows.cols - the number of columns.public void update(Graphics g)
update in class Containerpublic void dispose()
dispose in class Windowpublic void addDisposeListener(ActionListener listener)
PreviewView
addDisposeListener in interface PreviewViewpublic void writeReport(OutputStream os)
writeReport in interface PreviewViewpublic static void main(String[] args)
Usage: java inetsoft.report.Previewer report
|
Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||