|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.ibm.mm.viewer.CMBGenericDocViewer
CMBGenericDocViewer implements the primary graphical user interface of the document viewer. It is a JFC based user interface. It allows many properties for customizing the look and feel of the document viewer. It handles all page and document navigation, page viewing operations rotating, zooming and scaling, annotations editing and so forth.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
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 | |
CMBGenericDocViewer(CMBStreamingDocServices docServices,
CMBAnnotationServices annoServices,
java.util.Properties configProps)
Constructs the generic document viewer. |
Method Summary | |
void |
activateDocument(CMBDocument document)
Brings the specified document's tab to the front to be viewed. |
void |
addDocClosedListener(CMBGenericDocClosedListener listener)
Adds a listener to the list of document closed event listeners. |
void |
addDocOpenedListener(CMBGenericDocOpenedListener listener)
Adds a listener to the list of document opened event listeners. |
void |
addDocSelectedListener(CMBGenericDocSelectedListener listener)
Adds a listener to the list of document selected event listeners. |
void |
addDocStateChangedListener(CMBDocStateChangedListener listener)
|
void |
addToolbar(javax.swing.JToolBar toolbar,
java.lang.String name,
java.lang.String position)
Adds a new toolbar. |
void |
annotationCreated(CMBAnnotationCreatedEvent event)
Annotation event handlers |
void |
annotationDeleted(CMBAnnotationDeletedEvent event)
Invoked when an annotation is deleted. |
void |
annotationMoved(CMBAnnotationMovedEvent event)
Invoked when an annotation is moved. |
void |
annotationPropertiesUpdated(CMBAnnotationPropertiesUpdatedEvent event)
Invoked when the properties of an annotation is changed. |
void |
annotationReordered(CMBAnnotationReorderedEvent event)
Invoked when an annotation is reordered. |
void |
annotationResized(CMBAnnotationResizedEvent event)
Invoked when an annotation is resized. |
void |
annotationSelected(CMBAnnotationSelectedEvent event)
Invoked when an annotation is selected. |
void |
closeAllDocuments()
Closes all the documents that are currently being viewed. |
void |
closeDocument()
Closes the specified document. |
void |
copyAnnotation()
|
javax.swing.Action |
createAction(java.lang.String name)
Creates the action corresponding to the specified name. |
void |
cutAnnotation()
Clipboard support |
void |
fireCMBDocClosedEvent(CMBDocument document)
Notifies all the listeners that a document was closed. |
void |
fireCMBDocOpenedEvent(CMBDocument document)
Notifies all the listeners that a document was opened. |
void |
fireCMBDocSelectedEvent(CMBDocument document)
Notifies all the listeners that a document was selected. |
javax.swing.Action |
getAction(java.lang.String name)
Gets the action corresponding to the specified name. |
javax.swing.Action[] |
getAllActions()
Gets all the action objects that have been loaded into the viewer from the configuration file. |
javax.swing.JToolBar[] |
getAllToolbars()
Returns an array of all the toolbars. |
java.util.Properties |
getConfigProperties()
Gets the configuration properties file. |
javax.swing.JPanel |
getDocViewPanel()
Gets the currently active tab. |
java.awt.Frame |
getOwningFrame()
|
CMBAnnotationSet |
getSelectedAnnotationSet()
Gets the current annotation set associated with the selected tab in the tabbed panel. |
CMBDocument |
getSelectedDocument()
Gets the current document associated with the selected tab in the tabbed panel. |
javax.swing.JPanel |
getThumbnailsPanel()
Returns the Thumbnails panel for more customization purposes. |
java.lang.String |
getThumbnailsPosition()
Gets the position of the thumbnails panel. |
javax.swing.JToolBar |
getToolBar(java.lang.String name)
Gets the toolbar with the specified name. |
void |
handleDocStateChangedEvent(CMBDocument document)
Handle the page navigation events. |
CMBAnnotationSet |
loadAnnotations(java.io.InputStream annotations,
java.lang.String format,
int documentResolution,
int numberOfParts)
Loads the annotations for the document. |
CMBAnnotationSet |
loadAnnotations(java.io.InputStream annotations,
java.lang.String format,
int documentResolution,
int numberOfParts,
int partNumber)
Loads the annotations for the document. |
CMBDocument |
loadDocument(java.io.InputStream firstPart,
int numberOfParts,
java.lang.String docMimeType,
java.lang.String firstPartMimeType,
java.io.InputStream resources)
|
CMBDocument |
loadDocument(java.io.InputStream firstPart,
int numberOfParts,
java.lang.String docMimeType,
java.lang.String firstPartMimeType,
java.io.InputStream annoStream,
java.io.InputStream resources)
Loads a document into the generic doc viewer. |
void |
pageSetup()
Page setup dialog |
void |
pasteAnnotation()
|
void |
printDocument()
Prints the currently active document This method should be used only with viewing. |
void |
printDocument(CMBDocument document,
CMBAnnotationSet annotationSet)
Sets up the document model and view and prints the specified document and annotationSet. |
void |
printPreview()
|
void |
removeDocClosedListener(CMBGenericDocClosedListener listener)
Removes the document closed event listener from the list. |
void |
removeDocOpenedListener(CMBGenericDocOpenedListener listener)
Removes the document opened event listener from the list. |
void |
removeDocSelectedListener(CMBGenericDocSelectedListener listener)
Removes the document selected event listener from the list. |
void |
removeDocStateChangedListener(CMBDocStateChangedListener listener)
|
javax.swing.JToolBar |
removeToolbar(java.lang.String name)
Removes the toolbar with the specified name. |
void |
saveAllAnnotations()
Saves all the annotation sets that have been loaded so far for the currently active documents. |
void |
saveAnnotations()
Saves the annotations that have been modified for the active document. |
void |
setAllToolbarsVisible(boolean visible)
Shows/hides all the toolbars. |
void |
setAnnoPopupMenu(javax.swing.JPopupMenu popupMenu)
|
void |
setConfigProperties(java.util.Properties properties)
Sets the configuration properties file. |
void |
setTabPlacement(int position)
Set the position of the tabs in the viewer Value of position can be 1 - top, 2 - left, 3 - bottom or 4 - right |
void |
setThumbnailsPosition(java.lang.String position)
Changes the position of the thumbnails panel. |
void |
showDocument(CMBDocument document,
CMBAnnotationSet annoSet,
java.lang.String docName)
This method has to be called before viewing any document. |
void |
showThumbnails()
Toggles the state the thumbnails panel. |
void |
showThumbnails(boolean bShowThumbnails)
Shows or hides the thumbnails panel. |
void |
stateChanged(javax.swing.event.ChangeEvent event)
Handle the document navigation events. |
void |
terminate()
Terminates the viewer. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CMBGenericDocViewer(CMBStreamingDocServices docServices, CMBAnnotationServices annoServices, java.util.Properties configProps)
docServices
- The CMBStreamingDocServices instance used for
loading and conversion of documents.annoServices
- The CMBAnnotationServices instance used
for loading, conversion and editing of annotations.configProperties
- The Properties file that will override the default
configuration file used by the generic doc viewer.
Pass null to use the default one.Method Detail |
public java.awt.Frame getOwningFrame()
public void addDocOpenedListener(CMBGenericDocOpenedListener listener)
listener
- An instance of a class implementing the CMBGenericDocOpenedListener interface.public void removeDocOpenedListener(CMBGenericDocOpenedListener listener)
listener
- An instance of a class implementing the CMBGenericDocOpenedListener interface.public void fireCMBDocOpenedEvent(CMBDocument document)
document
- The document that is opened.public void addDocSelectedListener(CMBGenericDocSelectedListener listener)
listener
- An instance of a class implementing the CMBGenericDocSelectedListener interface.public void removeDocSelectedListener(CMBGenericDocSelectedListener listener)
listener
- An instance of a class implementing the CMBGenericDocSelectedListener interface.public void fireCMBDocSelectedEvent(CMBDocument document)
document
- The document that is selected.public void addDocClosedListener(CMBGenericDocClosedListener listener)
listener
- An instance of a class implementing the CMBGenericDocClosedListener interface.public void removeDocClosedListener(CMBGenericDocClosedListener listener)
listener
- An instance of a class implementing the CMBGenericDocClosedListener interface.public void fireCMBDocClosedEvent(CMBDocument document)
document
- The document that is closed.public CMBDocument loadDocument(java.io.InputStream firstPart, int numberOfParts, java.lang.String docMimeType, java.lang.String firstPartMimeType, java.io.InputStream annoStream, java.io.InputStream resources) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
firstPart
- a stream containing the first part of the document.numberOfParts
- the number of parts of the documentdocMimeType
- the MIME content type of the documentfirstPartMimeType
- the MIME content type of the first part of the document.resources
- a stream containing resources for the document.public CMBDocument loadDocument(java.io.InputStream firstPart, int numberOfParts, java.lang.String docMimeType, java.lang.String firstPartMimeType, java.io.InputStream resources) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
public CMBAnnotationSet loadAnnotations(java.io.InputStream annotations, java.lang.String format, int documentResolution, int numberOfParts, int partNumber) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
annotations
- InputStream containing the annotations of document pages.format
- A String representing the annotations format. For ex. 'CM' or 'OD' or 'EIP'.numberOfParts
- Number of additional annotation parts.public CMBAnnotationSet loadAnnotations(java.io.InputStream annotations, java.lang.String format, int documentResolution, int numberOfParts) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
annotations
- InputStream containing the annotations of document pages.format
- A String representing the annotations format. For ex. 'CM' or 'OD' or 'EIP'.numberOfParts
- Number of additional annotation parts.public void saveAnnotations()
public void saveAllAnnotations()
public void showDocument(CMBDocument document, CMBAnnotationSet annoSet, java.lang.String docName)
public void closeDocument()
document
- The document to be closed.public void closeAllDocuments()
public void terminate()
public void addDocStateChangedListener(CMBDocStateChangedListener listener)
public void removeDocStateChangedListener(CMBDocStateChangedListener listener)
public void handleDocStateChangedEvent(CMBDocument document)
handleDocStateChangedEvent
in interface CMBDocStateChangedListener
com.ibm.mm.viewer.CMBDocStateChangedListener
model
- The model whose state has changed. The model's view should be
notified of the change and the view updated accordingly.public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged
in interface javax.swing.event.ChangeListener
public CMBDocument getSelectedDocument()
public CMBAnnotationSet getSelectedAnnotationSet()
public void activateDocument(CMBDocument document)
public java.util.Properties getConfigProperties()
public void setConfigProperties(java.util.Properties properties)
properties
- The properties file that is used to setup toolbars and other
customization of the viewer.public void addToolbar(javax.swing.JToolBar toolbar, java.lang.String name, java.lang.String position)
toolbar
- A JToolBar to be added.name
- A name to be used to access the toolbar later.position
- The position to place the toolbar - "north", "south", "west" or "east".public javax.swing.JToolBar removeToolbar(java.lang.String name)
name
- The name of the toolbar.public javax.swing.JToolBar getToolBar(java.lang.String name)
public void setAllToolbarsVisible(boolean visible)
visible
- If true shows all the toolbars,
false hides all the toolbars.public javax.swing.JToolBar[] getAllToolbars()
public javax.swing.Action createAction(java.lang.String name)
public javax.swing.Action getAction(java.lang.String name)
public javax.swing.Action[] getAllActions()
public void setTabPlacement(int position)
position
- public void setThumbnailsPosition(java.lang.String position)
position
- The new position "north" "south" "east" or "west"public java.lang.String getThumbnailsPosition()
public javax.swing.JPanel getThumbnailsPanel()
public void showThumbnails(boolean bShowThumbnails)
bShowThumbnails
- The boolean deciding whether to show thumbnails or notpublic void showThumbnails()
public javax.swing.JPanel getDocViewPanel()
public void setAnnoPopupMenu(javax.swing.JPopupMenu popupMenu)
public void annotationCreated(CMBAnnotationCreatedEvent event)
annotationCreated
in interface CMBAnnotationCreatedListener
public void annotationDeleted(CMBAnnotationDeletedEvent event)
CMBAnnotationDeletedListener
annotationDeleted
in interface CMBAnnotationDeletedListener
public void annotationMoved(CMBAnnotationMovedEvent event)
CMBAnnotationMovedListener
annotationMoved
in interface CMBAnnotationMovedListener
public void annotationResized(CMBAnnotationResizedEvent event)
CMBAnnotationResizedListener
annotationResized
in interface CMBAnnotationResizedListener
public void annotationReordered(CMBAnnotationReorderedEvent event)
CMBAnnotationReorderedListener
annotationReordered
in interface CMBAnnotationReorderedListener
public void annotationPropertiesUpdated(CMBAnnotationPropertiesUpdatedEvent event)
CMBAnnotationPropertiesUpdatedListener
annotationPropertiesUpdated
in interface CMBAnnotationPropertiesUpdatedListener
public void annotationSelected(CMBAnnotationSelectedEvent event)
CMBAnnotationSelectedListener
annotationSelected
in interface CMBAnnotationSelectedListener
public void pageSetup()
public void printPreview()
public void printDocument()
public void printDocument(CMBDocument document, CMBAnnotationSet annotationSet)
document
- The document to be printed.annotationSet
- The annotationSet to be printed on top of the documentpublic void cutAnnotation()
public void copyAnnotation()
public void pasteAnnotation()
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |