Style Intelligence v12.0

inetsoft.sree.viewer
Class ViewPreviewPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by inetsoft.sree.viewer.ViewPreviewPane
All Implemented Interfaces:
PreviewView, ActionListener, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public abstract class ViewPreviewPane
extends JPanel
implements PreviewView, ItemListener, ActionListener

ViewPreviewPane is a panel to browse one previewed report.

See Also:
Serialized Form

Nested Class Summary
 class ViewPreviewPane.ViewPane
           
 
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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 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
ViewPreviewPane(RepletRepository engine)
          Create an empty previewer.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Triggered when event handler mask is changed.
 void addDisposeListener(ActionListener listener)
          Add dispose listener.
 void addSelectionListener(SelectionListener l)
          Add a selection listener.
 void addToolbarComponent(Component comp)
          Add a component to the toolbar.
 void customize()
          Bring up the customizer for this report.
 void dispose()
          Close this window and inform the repository.
protected  void distroyEngine()
           
protected abstract  void enqueue(ViewPreviewPane.ViewPane pane, int pn)
          Add a page retrieval request to the queue.
protected abstract  void enqueueNow(ViewPreviewPane.ViewPane pane, int pn)
          Add a page retrieval request to the queue.
 void find(SearchCondition cond)
          Perform a search on the search condition.
 void findNext(SearchCondition cond)
          Find the next occurence of the search condition.
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Expose the call.
 int getCurrentPage()
          Get the current page index.
 int getOrientation()
          Returns the orientation of this PageFormat.
 int getPageCount()
          Get the total number of pages.
 double getPageHeight()
          Get the page height in inches.
 int getPageResolution()
          Get the page resolution.
 double getPageWidth()
          Get the page width in inches.
protected abstract  PreviewView getParentView()
          Get the parent preview view, for example ViewFrame or itself;
 Object getRepletID()
          Get the replet ID of the current report.
 ReportSheet getReport()
          Get the style sheet object in this pane.
 Enumeration getStylePages()
          Get all pages of the current report.
 Enumeration getStylePages(int[] printPages)
          Get indicated pages of the current report.
protected  Component getToolbar()
          Get the toolbar.
 double getZoom()
          Get the zoom percentage.
 void gotoPage()
          Prompt for a page number to go to.
protected  void handleRepletEvent(EventObject e)
          Handle the viewer events.
 boolean isCustomizable()
          Check if this report has a customizer.
abstract  boolean isVisible()
          Check if the parent pane is visible.
 void itemStateChanged(ItemEvent e)
          Zoom item changed.
 void pack()
          Causes this Window to be sized to fit the preferred size and layouts of its subcomponents.
 void print()
          Print the report to a printer.
 void print(ReportSheet report)
          Populate the view with a report.
 void printAction()
          Start printing to printer.
 void process(RepletCommand cmd)
          Process a command sequence.
 void processCommand(RepletCommand cmd)
          Process an individual command.
 void refresh()
          Refresh the contents of the pages.
 void removeSelectionListener(SelectionListener l)
          Remove a selection listener.
 void reprint()
          Reprint the contents of the pages.
 void scrollTo(String eid, int row)
          Scroll to specified element and optional row.
 void setCurrentPage(int pn)
          Scroll to the specified page.
 void setEventHandler(EventHandler cmds)
          Set the client-side event handler.
 void setEventMask(int mask)
          Set the event mask.
 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)
          Sets the page orientation.
 void setPageCount(int n)
          Set the total number of pages in this view.
 void setPageCount(int n, boolean checkCompleted)
          Set the total number of pages in this view.
 void setPageHeight(double height)
          Set the page height in inches.
 void setPageResolution(int res)
          Set the page resolution, as number of dots per inch.
 void setPages(int rows, int cols)
          Set the multi-page dimension.
 void setPageWidth(double width)
          Set the page width in inches.
 void setRepletID(Object id)
          Set the replet ID of the current report.
 void setRepletRequest(RepletRequest req)
          Set the replet request used in this frame.
 void setReport(ReportSheet report)
          Set the report in this frame.
 void setShowTOC(boolean toc)
          Set the option to show the Table of Contents view.
 void setStylePages(Enumeration pages)
          Display the StylePages in the preview pane.
 void setTitle(String title)
          Set the preview window title.
 void setToolbarButtons(int buttons)
          Set the buttons on the toolbar.
protected abstract  void showConsoleDialog()
          Show the console dialog.
 void showLocation(PageLocation ploc, boolean hl)
          Show the location as highlighted.
protected abstract  void showMessage(String msg)
          Show a message in a message dialog.
abstract  PreviewView showReplet(String name, RepletRequest req)
          Show a replet in a viewer window.
abstract  PreviewView showReplet(String name, RepletRequest req, PreviewView frame)
          Show a replet in a viewer window using an existing frame.
abstract  void showStatus(String msg)
          Show status on the status bar.
 void showTarget(String target)
          Jump to a target (hyperlink anchor).
abstract  void showURL(String url, String target)
          Show the document in a browser window.
 void writeReport(OutputStream os)
          Write the previewed report into a .sro file.
 void zoom(double perc)
          Set the zooming percentage.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface inetsoft.report.PreviewView
setPreferredSize, setVisible
 

Constructor Detail

ViewPreviewPane

public ViewPreviewPane(RepletRepository engine)
Create an empty previewer.

Method Detail

showReplet

public abstract PreviewView showReplet(String name,
                                       RepletRequest req)
Show a replet in a viewer window.

Parameters:
name - replet name.
req - replet request.

showReplet

public abstract PreviewView showReplet(String name,
                                       RepletRequest req,
                                       PreviewView frame)
Show a replet in a viewer window using an existing frame.

Parameters:
name - replet name.
req - replet request.

showURL

public abstract void showURL(String url,
                             String target)
Show the document in a browser window.

Parameters:
url - URL string.
target - target frame.

showStatus

public abstract void showStatus(String msg)
Show status on the status bar.


isVisible

public abstract boolean isVisible()
Check if the parent pane is visible.

Overrides:
isVisible in class Component

enqueue

protected abstract void enqueue(ViewPreviewPane.ViewPane pane,
                                int pn)
Add a page retrieval request to the queue.


enqueueNow

protected abstract void enqueueNow(ViewPreviewPane.ViewPane pane,
                                   int pn)
Add a page retrieval request to the queue.


showMessage

protected abstract void showMessage(String msg)
Show a message in a message dialog.


getParentView

protected abstract PreviewView getParentView()
Get the parent preview view, for example ViewFrame or itself;


showConsoleDialog

protected abstract void showConsoleDialog()
Show the console dialog.


setTitle

public void setTitle(String title)
Set the preview window title.

Specified by:
setTitle in interface PreviewView
Parameters:
title - previewer title.

getToolbar

protected Component getToolbar()
Get the toolbar.


distroyEngine

protected void distroyEngine()

dispose

public void dispose()
Close this window and inform the repository.


addDisposeListener

public void addDisposeListener(ActionListener listener)
Add dispose listener.

Specified by:
addDisposeListener in interface PreviewView

print

public void print(ReportSheet report)
Populate the view with a report.

Specified by:
print in interface PreviewView
Parameters:
report - report.

print

public void print()
Print the report to a printer.


writeReport

public void writeReport(OutputStream os)
Write the previewed report into a .sro file.

Specified by:
writeReport in interface PreviewView

getStylePages

public Enumeration getStylePages()
Get all pages of the current report.

Specified by:
getStylePages in interface PreviewView
Returns:
enumeration of StylePage objects.

getStylePages

public Enumeration getStylePages(int[] printPages)
Get indicated pages of the current report.

Parameters:
printPages - array of page numbers to print
Returns:
enumeration of StylePage objects.

getRepletID

public Object getRepletID()
Get the replet ID of the current report.


setRepletID

public void setRepletID(Object id)
Set the replet ID of the current report. This call will start the report generation process on the server and retrieve the initial page to display in the view.

Parameters:
id - replet ID.

isCustomizable

public boolean isCustomizable()
Check if this report has a customizer.

Returns:
true if customize parameters are defined for this report.

customize

public void customize()
Bring up the customizer for this report.


setEventMask

public void setEventMask(int mask)
Set the event mask. This determines which events are handled.

Parameters:
mask - bitwise-or of the event masks.

setEventHandler

public void setEventHandler(EventHandler cmds)
Set the client-side event handler.

Parameters:
cmds - event handler.

actionPerformed

public void actionPerformed(ActionEvent event)
Triggered when event handler mask is changed.

Specified by:
actionPerformed in interface ActionListener

setPageCount

public void setPageCount(int n)
Set the total number of pages in this view.

Parameters:
n - number of pages.

setPageCount

public void setPageCount(int n,
                         boolean checkCompleted)
Set the total number of pages in this view.

Parameters:
n - number of pages.

getPageCount

public int getPageCount()
Get the total number of pages.


zoom

public void zoom(double perc)
Set the zooming percentage. 100% is 1.0.

Specified by:
zoom in interface PreviewView
Parameters:
perc - zooming percentage.

getZoom

public double getZoom()
Get the zoom percentage.

Specified by:
getZoom in interface PreviewView

setPages

public void setPages(int rows,
                     int cols)
Set the multi-page dimension.

Parameters:
rows - the number of rows.
cols - the number of columns.

gotoPage

public void gotoPage()
Prompt for a page number to go to.


setCurrentPage

public void setCurrentPage(int pn)
Scroll to the specified page.

Parameters:
pn - page number. Starting at 0.

getCurrentPage

public int getCurrentPage()
Get the current page index.


setShowTOC

public void setShowTOC(boolean toc)
Set the option to show the Table of Contents view.

Parameters:
toc - true to show table of contents.

find

public void find(SearchCondition cond)
Perform a search on the search condition.

Parameters:
cond - search conditions.

findNext

public void findNext(SearchCondition cond)
Find the next occurence of the search condition.

Parameters:
cond - search conditions.

scrollTo

public void scrollTo(String eid,
                     int row)
Scroll to specified element and optional row.

Parameters:
eid - element ID.
row - row number. Ignored if the element is not a table.

showTarget

public void showTarget(String target)
Jump to a target (hyperlink anchor).


itemStateChanged

public void itemStateChanged(ItemEvent e)
Zoom item changed.

Specified by:
itemStateChanged in interface ItemListener

showLocation

public void showLocation(PageLocation ploc,
                         boolean hl)
Show the location as highlighted.

Parameters:
ploc - page location.
hl - true to highlight the area.

handleRepletEvent

protected void handleRepletEvent(EventObject e)
Handle the viewer events.

Parameters:
e - event object.

setRepletRequest

public void setRepletRequest(RepletRequest req)
Set the replet request used in this frame. This does not affect the reports. It's only used for administrative purposes.


process

public void process(RepletCommand cmd)
Process a command sequence.


refresh

public void refresh()
Refresh the contents of the pages.


reprint

public void reprint()
Reprint the contents of the pages.


processCommand

public void processCommand(RepletCommand cmd)
Process an individual command.


getReport

public ReportSheet getReport()
Get the style sheet object in this pane.

Specified by:
getReport in interface PreviewView

setReport

public void setReport(ReportSheet report)
Set the report in this frame. This does not cause the report to be processed and is normally only used for information purpose.


setStylePages

public void setStylePages(Enumeration pages)
Display the StylePages in the preview pane.

Specified by:
setStylePages in interface PreviewView
Parameters:
pages - return a collection of StylePage objects.

setToolbarButtons

public void setToolbarButtons(int buttons)
Set the buttons on the toolbar.

Specified by:
setToolbarButtons in interface PreviewView
Parameters:
buttons - bit-wise OR of the button masks.

addToolbarComponent

public void addToolbarComponent(Component comp)
Add a component to the toolbar.

Specified by:
addToolbarComponent in interface PreviewView

setPageWidth

public void setPageWidth(double width)
Set the page width in inches. This is the width after the orientation is taken into account.

Specified by:
setPageWidth in interface PreviewView
Parameters:
width - page width.

getPageWidth

public double getPageWidth()
Get the page width in inches.

Specified by:
getPageWidth in interface PreviewView
Returns:
page width.

setPageHeight

public void setPageHeight(double height)
Set the page height in inches. This is the height after the orientation is taken into account.

Specified by:
setPageHeight in interface PreviewView
Parameters:
height - page height.

getPageHeight

public double getPageHeight()
Get the page height in inches.

Specified by:
getPageHeight in interface PreviewView
Returns:
page height.

setOrientation

public void setOrientation(int orientation)
Sets the page orientation. orientation must be one of the constants: PORTRAIT, LANDSCAPE.

Specified by:
setOrientation in interface PreviewView
Parameters:
orientation - the new orientation for the page

getOrientation

public int getOrientation()
Returns the orientation of this PageFormat.

Specified by:
getOrientation in interface PreviewView
Returns:
this PageFormat object's orientation.

setPageResolution

public void setPageResolution(int res)
Set the page resolution, as number of dots per inch. The default is 72.

Specified by:
setPageResolution in interface PreviewView
Parameters:
res - page resolution.

getPageResolution

public int getPageResolution()
Get the page resolution.

Specified by:
getPageResolution in interface PreviewView
Returns:
page resolution.

printAction

public void printAction()
Start printing to printer. This will popup the print dialog. It has the same effect as an user clicking on the 'printer' button.

Specified by:
printAction in interface PreviewView

addSelectionListener

public void addSelectionListener(SelectionListener l)
Add a selection listener. The listener is notified if an user clicks inside a table or a chart.

Specified by:
addSelectionListener in interface PreviewView

removeSelectionListener

public void removeSelectionListener(SelectionListener l)
Remove a selection listener.

Specified by:
removeSelectionListener in interface PreviewView

setExitOnClose

public void setExitOnClose(boolean exitit)
If the ExitOnClose is set to true, the Previewer exits from the application when the previewer window is closed.

Specified by:
setExitOnClose in interface PreviewView

pack

public void pack()
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The Window will be validated after the preferredSize is calculated.

Specified by:
pack in interface PreviewView
See Also:
Component.isDisplayable()

firePropertyChange

public void firePropertyChange(String propertyName,
                               Object oldValue,
                               Object newValue)
Expose the call. Otherwise java generates an illegal access error.

Overrides:
firePropertyChange in class Component

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.