- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.icepdf.ri.common.AbstractWorkerPanel
-
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,MutableDocument
- Direct Known Subclasses:
FontHandlerPanel,MarkupAnnotationHandlerPanel,SignaturesHandlerPanel
public abstract class AbstractWorkerPanel extends JPanel implements MutableDocument
Base class for management of annotation in a document. This class is used by the annotation, signatures and AcroForm tool handlers to aid in the selection these annotation types in a document. Each panel has a toolbar that contains the respective tool handlers for creating the family of annotations.The annotation's properties panel are located on the right utility pane and can only show the editable properties for one annotation type at a time.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractWorkerPanel.NodeSelectionListenerNodeSelectionListener handles the root node context menu creation display and command execution.-
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 Modifier and Type Field Description protected DefaultTreeCellRenderercellRendererprotected GridBagConstraintsconstraintsprotected Controllercontrollerprotected ResourceBundlemessageBundleprotected AbstractWorkerPanel.NodeSelectionListenernodeSelectionListenerprotected JProgressBarprogressBarprotected JLabelprogressLabelprotected StringrootNodeLabelprotected DefaultMutableTreeNoderootTreeNodeprotected JTreetreeprotected DefaultTreeModeltreeModelprotected AbstractTaskworkerTask-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors Constructor Description AbstractWorkerPanel(Controller controller)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddGB(JPanel panel, Component component, int x, int y, int rowSpan, int colSpan)GridBag constructor helperprotected voidbuildProgressBar()Optionally builds the progress bar and addes to the layout container just after the JTree and parent scroll paneprotected voidbuildUI()Build the tree based on the current implementation of cellRenderer and the given worker task found by the calling implementation ofbuildWorkerTaskUI().protected abstract voidbuildWorkerTaskUI()Builds the tree nodes for the given implementation of the workervoiddisposeDocument()Swing controller is calling dispose and any post document clean up should be made.abstract voidendProgressControls()voidexpandAllNodes()StringgetDocumentTitle()Utility for getting the document title.JProgressBargetProgressBar()voidrefreshDocumentInstance()Set the current document instance.protected voidresetTree()Reset the tree for a new document or a new validation.abstract voidselectTreeNodeUserObject(Object userObject)Travers tree model and try and select a node that has a matching user object.abstract voidstartProgressControls(int lengthOfTask)protected voidstopWorkerTask()abstract voidupdateProgressControls(int progress)abstract voidupdateProgressControls(int progress, String label)abstract voidupdateProgressControls(String label)-
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
controller
protected final Controller controller
-
messageBundle
protected final ResourceBundle messageBundle
-
tree
protected JTree tree
-
rootTreeNode
protected DefaultMutableTreeNode rootTreeNode
-
rootNodeLabel
protected String rootNodeLabel
-
treeModel
protected DefaultTreeModel treeModel
-
cellRenderer
protected DefaultTreeCellRenderer cellRenderer
-
constraints
protected GridBagConstraints constraints
-
workerTask
protected AbstractTask workerTask
-
progressBar
protected JProgressBar progressBar
-
progressLabel
protected JLabel progressLabel
-
nodeSelectionListener
protected AbstractWorkerPanel.NodeSelectionListener nodeSelectionListener
-
-
Constructor Detail
-
AbstractWorkerPanel
public AbstractWorkerPanel(Controller controller)
-
-
Method Detail
-
refreshDocumentInstance
public void refreshDocumentInstance()
Set the current document instance. The method executed is the abstractbuildWorkerTaskUI()method which kicks off the tree creation process. CheckbuildWorkerTaskUI()documentation for the implementing class to see what thread this work is done on.- Specified by:
refreshDocumentInstancein interfaceMutableDocument
-
disposeDocument
public void disposeDocument()
Description copied from interface:MutableDocumentSwing controller is calling dispose and any post document clean up should be made.- Specified by:
disposeDocumentin interfaceMutableDocument
-
buildProgressBar
protected void buildProgressBar()
Optionally builds the progress bar and addes to the layout container just after the JTree and parent scroll pane
-
buildUI
protected void buildUI()
Build the tree based on the current implementation of cellRenderer and the given worker task found by the calling implementation ofbuildWorkerTaskUI(). Before this method is call the following instance variables should be set:- nodeSelectionListener - event handler for node clicks
- cellRenderer - cell render, implements DefaultTreeCellRenderer
- rootNodeLabel - label for root node
-
buildWorkerTaskUI
protected abstract void buildWorkerTaskUI()
Builds the tree nodes for the given implementation of the worker
-
stopWorkerTask
protected void stopWorkerTask()
-
selectTreeNodeUserObject
public abstract void selectTreeNodeUserObject(Object userObject)
Travers tree model and try and select a node that has a matching user object.- Parameters:
userObject- user object to try and find in the tree
-
resetTree
protected void resetTree()
Reset the tree for a new document or a new validation.
-
expandAllNodes
public void expandAllNodes()
-
getProgressBar
public JProgressBar getProgressBar()
-
startProgressControls
public abstract void startProgressControls(int lengthOfTask)
-
updateProgressControls
public abstract void updateProgressControls(int progress)
-
updateProgressControls
public abstract void updateProgressControls(int progress, String label)
-
updateProgressControls
public abstract void updateProgressControls(String label)
-
endProgressControls
public abstract void endProgressControls()
-
getDocumentTitle
public String getDocumentTitle()
Utility for getting the document title.- Returns:
- document title, if no title then a simple search results label is returned;
-
-