- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JLayeredPane
-
- org.icepdf.ri.common.views.AbstractPageViewComponent
-
- org.icepdf.ri.common.views.PageViewComponentImpl
-
- All Implemented Interfaces:
FocusListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,PageViewComponent
public class PageViewComponentImpl extends AbstractPageViewComponent implements FocusListener
- Since:
- 6.2 heavily modified behaviour for cpu and memory enhancements.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.icepdf.ri.common.views.AbstractPageViewComponent
AbstractPageViewComponent.PageBufferStore, AbstractPageViewComponent.PageImageCaptureTask
-
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
-
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 ArrayList<AbstractAnnotationComponent>annotationComponentsprotected ObjectannotationComponentsLockprotected Map<Reference,AnnotationComponent>annotationToComponentprotected ToolHandlercurrentToolHandlerprotected ArrayList<DestinationComponent>destinationComponentsprotected TextSelectionPageHandlertextSelectionPageHandler-
Fields inherited from class org.icepdf.ri.common.views.AbstractPageViewComponent
documentViewController, documentViewModel, graphicsConfiguration, PAGE_BOUNDARY_BOX, pageBoundaryBox, pageBufferPadding, pageBufferStore, pageImageCaptureTask, pageIndex, pageRotation, pageSize, pageTree, pageZoom, paintAnnotations, paintSearchHighlight, parentDocumentView, progressivePaint
-
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
-
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 PageViewComponentImpl(DocumentViewModel documentViewModel, PageTree pageTree, int pageIndex, int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(AnnotationComponent annotation)Add a new annotation object to this page view component.voidclearSearchHighlights()voiddispose()Called to free resources used by this component.voidfocusGained(FocusEvent e)voidfocusLost(FocusEvent e)ArrayList<AbstractAnnotationComponent>getAnnotationComponents()Gets a list of the annotation components used in this page view.AnnotationComponentgetComponentFor(Annotation annot)Returns the annotation component linked to the given annotationToolHandlergetCurrentToolHandler()ArrayList<DestinationComponent>getDestinationComponents()Gets a list of the annotation components used in this page view.TextSelectionPageHandlergetTextSelectionPageHandler()Gets the page components TextSelectionPageHandler.voidpageInitializedCallback(Page page)This callback is called when the page is successfully initialized at which point an implementation may like to work with the page object before the parent method turns.voidpageTeardownCallback()This callback is called when a page is scheduled for dispose.protected voidpaintComponent(Graphics g)voidrefreshAnnotationComponents(Page page)voidrefreshAnnotationComponents(Page page, boolean invokeLater)voidrefreshDestinationComponents(Page page)voidrefreshDestinationComponents(Page page, boolean invokeLater)voidremoveAnnotation(AnnotationComponent annotationComp)Remove the specified annotation from this page view.voidremoveDestination(DestinationComponent destinationComponent)voidsetDocumentViewCallback(DocumentView parentDocumentView)Set the parent Document View class which is responsible for drawing and the general management of PageViewComponents for a particular view.voidsetToolMode(int viewToolMode)Sets the tool mode for the current page component implementation.voidupdateView(String propertyConstant, Object oldValue, Object newValue)Called from parent controls when a UI control has manipulated the view, property change is picked up and the view is updated accordingly.-
Methods inherited from class org.icepdf.ri.common.views.AbstractPageViewComponent
calculateBufferLocation, calculatePageSize, calculateScaleForDefaultScreen, clearSelectedText, clearSelectionRectangle, getPage, getPageIndex, getParentDocumentView, getPreferredSize, getSize, isAnnotationTool, reinitialize, setSelectionRectangle
-
Methods inherited from class javax.swing.JLayeredPane
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition
-
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, 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, updateUI
-
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, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, 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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.icepdf.ri.common.views.PageViewComponent
getParent
-
-
-
-
Field Detail
-
currentToolHandler
protected ToolHandler currentToolHandler
-
textSelectionPageHandler
protected final TextSelectionPageHandler textSelectionPageHandler
-
annotationComponentsLock
protected final Object annotationComponentsLock
-
annotationComponents
protected ArrayList<AbstractAnnotationComponent> annotationComponents
-
annotationToComponent
protected Map<Reference,AnnotationComponent> annotationToComponent
-
destinationComponents
protected ArrayList<DestinationComponent> destinationComponents
-
-
Constructor Detail
-
PageViewComponentImpl
public PageViewComponentImpl(DocumentViewModel documentViewModel, PageTree pageTree, int pageIndex, int width, int height)
-
-
Method Detail
-
setDocumentViewCallback
public void setDocumentViewCallback(DocumentView parentDocumentView)
Description copied from interface:PageViewComponentSet the parent Document View class which is responsible for drawing and the general management of PageViewComponents for a particular view.- Specified by:
setDocumentViewCallbackin interfacePageViewComponent- Overrides:
setDocumentViewCallbackin classAbstractPageViewComponent- Parameters:
parentDocumentView- type of view, single page, continuous, etc.
-
clearSearchHighlights
public void clearSearchHighlights()
-
paintComponent
protected void paintComponent(Graphics g)
- Overrides:
paintComponentin classAbstractPageViewComponent
-
dispose
public void dispose()
Description copied from interface:PageViewComponentCalled to free resources used by this component.- Specified by:
disposein interfacePageViewComponent
-
setToolMode
public void setToolMode(int viewToolMode)
Sets the tool mode for the current page component implementation. When a tool mode is assigned the respective tool handler is registered and various event listeners are registered.- Parameters:
viewToolMode- view tool modes as defined in DocumentViewMode.DISPLAY_TOOL_*
-
getAnnotationComponents
public ArrayList<AbstractAnnotationComponent> getAnnotationComponents()
Gets a list of the annotation components used in this page view.- Returns:
- list of annotation components, can be null.
-
getComponentFor
public AnnotationComponent getComponentFor(Annotation annot)
Returns the annotation component linked to the given annotation- Parameters:
annot- The annotation- Returns:
- The annotation component, or null if there is no match
-
getDestinationComponents
public ArrayList<DestinationComponent> getDestinationComponents()
Gets a list of the annotation components used in this page view.- Returns:
- list of annotation components, can be null.
-
getTextSelectionPageHandler
public TextSelectionPageHandler getTextSelectionPageHandler()
Gets the page components TextSelectionPageHandler. Each page has one and it directly accessed by the TextSelectionViewHandler. All other tools are created/disposed as the tools are selected.- Returns:
- page's instance of the text selection handler.
-
getCurrentToolHandler
public ToolHandler getCurrentToolHandler()
-
focusGained
public void focusGained(FocusEvent e)
- Specified by:
focusGainedin interfaceFocusListener
-
focusLost
public void focusLost(FocusEvent e)
- Specified by:
focusLostin interfaceFocusListener
-
updateView
public void updateView(String propertyConstant, Object oldValue, Object newValue)
Description copied from class:AbstractPageViewComponentCalled from parent controls when a UI control has manipulated the view, property change is picked up and the view is updated accordingly. Responds to PropertyConstants.DOCUMENT_VIEW_ROTATION_CHANGE and PropertyConstants.DOCUMENT_VIEW_ZOOM_CHANGE. If the worker is currently working is cancel with interrupts.- Specified by:
updateViewin interfacePageViewComponent- Overrides:
updateViewin classAbstractPageViewComponent- Parameters:
propertyConstant- document view change property.oldValue- old valuenewValue- new value
-
addAnnotation
public void addAnnotation(AnnotationComponent annotation)
Add a new annotation object to this page view component.- Parameters:
annotation- annotation to add.
-
removeAnnotation
public void removeAnnotation(AnnotationComponent annotationComp)
Remove the specified annotation from this page view.- Parameters:
annotationComp- annotation to be removed.
-
removeDestination
public void removeDestination(DestinationComponent destinationComponent)
-
pageInitializedCallback
public void pageInitializedCallback(Page page)
Description copied from interface:PageViewComponentThis callback is called when the page is successfully initialized at which point an implementation may like to work with the page object before the parent method turns. This method should return as quickly as possible.- Specified by:
pageInitializedCallbackin interfacePageViewComponent- Parameters:
page- page that was just initialized.
-
pageTeardownCallback
public void pageTeardownCallback()
Description copied from interface:PageViewComponentThis callback is called when a page is scheduled for dispose. This generally only happens when the page goes out of view and it and it's resources are no longer needed. This method in the default implementation is executed on a worker thread. Any AWT work should be queued to run on the AWT thread.- Specified by:
pageTeardownCallbackin interfacePageViewComponent
-
refreshDestinationComponents
public void refreshDestinationComponents(Page page)
-
refreshDestinationComponents
public void refreshDestinationComponents(Page page, boolean invokeLater)
-
refreshAnnotationComponents
public void refreshAnnotationComponents(Page page)
-
refreshAnnotationComponents
public void refreshAnnotationComponents(Page page, boolean invokeLater)
-
-