|
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
inetsoft.report.PreviewPane
public class PreviewPane
The PreviewPane class can be used to preview a document before it's actually printed. The PreviewPane is very easy to use. Its main API is consisted of one method, PreviewPane.print(ReportSheet). To add preview capability to your application, simple create a PreviewPane, pack and set it to visible like any window, and call the print() method with the created report.
PreviewPane previewer = new PreviewPane();
previewer.print(report);
The PreviewPane supports user interactions through selection events. If a mouse clicks inside an element on a preview pane, a SelectionEvent is generated. The SelectionEvent is generated for the following types of elements:
| Element Type | Source | Item |
| Table,Form | TableLens | Point contains cell location, (column, row) |
| Chart | ChartLens | Point contains data point location, (data index, dataset index) |
| Text | TextLens | Text contents |
| TextBox | TextLens | Text contents |
| Image | Image Painter | Image |
| Component | Component Painter | Component |
| Painter | Painter | Painter |
| Nested Class Summary | |
|---|---|
class |
PreviewPane.Constraints
Constraints object can be used to define the layout constraints of child components. |
protected class |
PreviewPane.StatusScrollBar
|
protected class |
PreviewPane.StatusScrollPane
|
| 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 inetsoft.util.Catalog |
catalog
|
static int |
PAGE_WIDTH
Zoom flag. |
protected Container |
scrollpane
Scroll pane. |
protected ReportSheet |
sheet
The report object in preview. |
static int |
TWO_PAGES
Zoom flag. |
static int |
WHOLE_PAGE
Zoom flag. |
| 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 | |
|---|---|
PreviewPane()
Create a previewer with specified title. |
|
| Method Summary | |
|---|---|
protected PreviewPage |
addPage(StylePage stylepage,
double w,
double h)
Add a page to the container. |
void |
addSelectionListener(SelectionListener l)
Add a selection listener. |
protected void |
addToScrollPane(Component comp)
Add the component to the scrollpane. |
void |
cancel()
Cancel the report processing if one is under way. |
protected PreviewPage |
createPage(double w,
double h,
int resolution)
Create a page component to hold a page. |
protected Container |
createScrollPane()
Create a scrollpane to handle the scrolling. |
void |
fireSelectionChange(Object src,
String eid,
Object item,
MouseEvent e,
Object userObj)
Fire a selection event. |
protected int |
getBlockIncrement(Adjustable adj)
Get the block increment amount of the scrollbar. |
Adjustable |
getHAdjustable()
Get the horizontal scrollbar. |
int |
getOrientation()
Returns the orientation of this PageFormat. |
PreviewPage |
getPage(int idx)
Get the specified preview page. |
int |
getPageCount()
Get the number of pages in the preview pane. |
double |
getPageHeight()
Get the page height in inches. |
protected int |
getPageMarginHeight()
Get the height between page to page. |
int |
getPageNumber()
Get the current page number. |
int |
getPageResolution()
Deprecated. as of 5.1. |
double |
getPageWidth()
Get the page width in inches. |
ReportSheet |
getReport()
Get the style sheet object in this pane. |
KeyListener |
getScrollListener()
Get the key listener for handling scrolling. |
Container |
getScrollPane()
Get the scroll pane used by this pane. |
Enumeration |
getStylePages()
Get the style pages in the preview frame. |
Adjustable |
getVAdjustable()
Get the vertical scrollbar. |
protected Container |
getViewport()
Return the scrollpane's viewport. |
Dimension |
getViewportSize()
Get the scroller viewport size. |
double |
getZoom()
Get the zoom percentage. |
void |
gotoPage()
Prompt for a page number to go to. |
void |
gotoPage(int pn)
Jump to the specified page. |
boolean |
isCancelled()
Check if printing is canceled. |
boolean |
isShowRuler()
Check if rulers are show at the pages. |
protected void |
pagingAction(AdjustmentEvent e)
Called when scrollbar used to page up and down. |
void |
paint(Graphics g)
|
void |
print(ReportSheet sheet)
Print the report in this preview pane. |
void |
print(ReportSheet sheet,
boolean reset)
Print the report in this preview pane. |
void |
printAction(PrintJob printjob)
Start printing to printer. |
void |
removeAll()
Clean up preview pane. |
protected void |
removeAllPages()
Remove all pages in the preview pane. |
void |
removeSelectionListener(SelectionListener l)
Remove a selection listener. |
protected void |
saveReport()
Save the current report. |
void |
setFocusPage(int page)
Set the current page that has the focus. |
protected void |
setHorizontalRulerLines(int[] hline)
Set the moving line on the horizontal ruler. |
void |
setOrientation(int orientation)
Deprecated. as of 5.1. |
protected void |
setPageCount(int cnt)
Add the number of blank pages to the preview pane. |
void |
setPageHeight(double height)
Deprecated. as of 5.1. |
protected void |
setPageNumberDisplay(boolean pgnumDisplay)
Controls whether the page number should be displayed as a tooltip when scrolling the vertical scrollbar |
void |
setPageResolution(int res)
Deprecated. as of 5.1. |
void |
setPages(int rows,
int cols)
Set the multi-page dimension. |
void |
setPageSize(Size pagesize)
Set the page size. |
void |
setPageWidth(double width)
Deprecated. as of 5.1. |
void |
setShowRuler(boolean ruler)
Set whether to show the rulers at the left and top of page. |
void |
setStylePages(Enumeration stylepages)
Display the StylePages in the preview pane. |
protected void |
setVerticalRulerLines(int[] vline)
Set the moving line on the vertical ruler. |
void |
showPageNumber(int pn)
Set the current page number shown on the status bar. |
void |
showPageSize(Size psize)
Set the page size information. |
void |
showStatus(String status)
Set the status text on status bar. |
protected void |
syncScrollPane()
Make sure the scrollpane reflects the current scrollbar values. |
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.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PAGE_WIDTH
public static final int WHOLE_PAGE
public static final int TWO_PAGES
protected ReportSheet sheet
protected Container scrollpane
protected inetsoft.util.Catalog catalog
| Constructor Detail |
|---|
public PreviewPane()
| Method Detail |
|---|
public void printAction(PrintJob printjob)
protected void removeAllPages()
public void removeAll()
removeAll in class Containerpublic void setPageWidth(double width)
width - page width.public double getPageWidth()
public void setPageHeight(double height)
height - page height.public double getPageHeight()
public void setPageSize(Size pagesize)
pagesize - page size in inches.public void setOrientation(int orientation)
orientation must be
one of the constants: PORTRAIT, LANDSCAPE.
orientation - the new orientation for the pagepublic int getOrientation()
PageFormat.
PageFormat object's orientation.public void setPageResolution(int res)
res - page resolution.public int getPageResolution()
public void setShowRuler(boolean ruler)
ruler - true to show rulers.public boolean isShowRuler()
public Container getScrollPane()
public ReportSheet getReport()
public void print(ReportSheet sheet)
sheet - report.public void cancel()
public boolean isCancelled()
public void print(ReportSheet sheet,
boolean reset)
sheet - report.reset - true to reset the report before printing.public void writeReport(OutputStream os)
protected PreviewPage addPage(StylePage stylepage,
double w,
double h)
public void setStylePages(Enumeration stylepages)
stylepages - return a collection of StylePage objects.public int getPageCount()
public PreviewPage getPage(int idx)
idx - page index.public Enumeration getStylePages()
public void showPageNumber(int pn)
public void showPageSize(Size psize)
public void showStatus(String status)
protected PreviewPage createPage(double w,
double h,
int resolution)
protected void setPageCount(int cnt)
cnt - number of pages.protected Container createScrollPane()
protected void addToScrollPane(Component comp)
comp - managed component.protected Container getViewport()
protected int getBlockIncrement(Adjustable adj)
public Dimension getViewportSize()
public Adjustable getVAdjustable()
public Adjustable getHAdjustable()
protected void syncScrollPane()
public void setPages(int rows,
int cols)
rows - the number of rows.cols - the number of columns.public double getZoom()
public void zoom(double perc)
perc - zooming percentage.public void gotoPage()
public void gotoPage(int pn)
public int getPageNumber()
public void setFocusPage(int page)
public void addSelectionListener(SelectionListener l)
public void removeSelectionListener(SelectionListener l)
protected void setPageNumberDisplay(boolean pgnumDisplay)
public void fireSelectionChange(Object src,
String eid,
Object item,
MouseEvent e,
Object userObj)
public KeyListener getScrollListener()
protected void saveReport()
protected void pagingAction(AdjustmentEvent e)
protected void setHorizontalRulerLines(int[] hline)
protected void setVerticalRulerLines(int[] vline)
protected int getPageMarginHeight()
public void paint(Graphics g)
paint in class Containerpublic void update(Graphics g)
update in class Container
|
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 | ||||||||