Style Intelligence v12.0

inetsoft.sree.viewer
Class ViewFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by inetsoft.sree.viewer.ViewFrame
All Implemented Interfaces:
PreviewView, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ViewFrame
extends JInternalFrame
implements PreviewView, ItemListener

ViewFrame is a window to browse one report. It must be added to the Viewer's mdi to be managed by the viewer.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon
 
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.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ViewFrame(String title, RepletRepository engine, ViewerPane viewer)
          Create an empty previewer.
 
Method Summary
 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.
 void find(SearchCondition cond)
          Perform a search on the search condition.
 void findNext(SearchCondition cond)
          Find the next occurence of the search condition.
 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.
 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.
 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 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 setToolbarButtons(int buttons)
          Set the buttons on the toolbar.
 void showLocation(PageLocation ploc, boolean hl)
          Show the location as highlighted.
 void showTarget(String target)
          Jump to a target (hyperlink anchor).
 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.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, 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, 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, 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, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, 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, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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, setTitle, setVisible
 

Constructor Detail

ViewFrame

public ViewFrame(String title,
                 RepletRepository engine,
                 ViewerPane viewer)
Create an empty previewer.

Method Detail

getToolbar

protected Component getToolbar()
Get the toolbar.


dispose

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

Overrides:
dispose in class JInternalFrame

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.

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.


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
Overrides:
pack in class JInternalFrame
See Also:
Component.isDisplayable()

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