|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLayeredPane
org.icepdf.ri.common.views.AbstractPageViewComponent
public abstract class AbstractPageViewComponent
This class contains all the functionality for showing a pages content. This view works closely with the clip provided by a parent JScrollPane component to optimize memory usage. Page content is painted to a back buffer which is painted by the component when ready. The back buffer is scaled on subsequent paints to show content and is later replaced with a new buffer that is painted with the current page properties.
| Nested Class Summary | |
|---|---|
protected class |
AbstractPageViewComponent.PageBufferStore
Synchronized page buffer property store, insures that a page capture occurs using the correct properties. |
class |
AbstractPageViewComponent.PageImageCaptureTask
The worker of any successful page paint. |
| Nested classes/interfaces inherited from class javax.swing.JLayeredPane |
|---|
javax.swing.JLayeredPane.AccessibleJLayeredPane |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected DocumentViewController |
documentViewController
|
protected DocumentViewModel |
documentViewModel
|
protected java.awt.GraphicsConfiguration |
graphicsConfiguration
|
protected static int |
PAGE_BOUNDARY_BOX
|
protected int |
pageBoundaryBox
|
protected static int |
pageBufferPadding
|
protected AbstractPageViewComponent.PageBufferStore |
pageBufferStore
|
protected java.util.concurrent.FutureTask<java.lang.Object> |
pageImageCaptureTask
|
protected int |
pageIndex
|
protected float |
pageRotation
|
protected java.awt.Rectangle |
pageSize
|
protected org.icepdf.core.pobjects.PageTree |
pageTree
|
protected float |
pageZoom
|
protected boolean |
paintAnnotations
|
protected boolean |
paintSearchHighlight
|
protected DocumentView |
parentDocumentView
|
protected javax.swing.JScrollPane |
parentScrollPane
|
protected static boolean |
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 |
|---|
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 | |
|---|---|
AbstractPageViewComponent(DocumentViewModel documentViewModel,
org.icepdf.core.pobjects.PageTree pageTree,
int pageIndex,
javax.swing.JScrollPane parentScrollPane,
int width,
int height)
|
|
| Method Summary | |
|---|---|
protected void |
calculateBufferLocation()
Calculates where we should be painting the new buffer and kicks off the the worker if the buffer is deemed dirty. |
protected void |
calculatePageSize(java.awt.Rectangle pageSize,
float rotation,
float zoom)
Calculates the page size for the rotation and zoom. |
void |
clearSelectedText()
|
void |
clearSelectionRectangle()
Clear any internal data structures that represent selected text and repaint the component. |
org.icepdf.core.pobjects.Page |
getPage()
|
int |
getPageIndex()
Gets the page index which this PageViewComponent is drawing. |
java.awt.Dimension |
getPreferredSize()
|
java.awt.Dimension |
getSize()
|
static boolean |
isAnnotationTool(int displayTool)
|
protected void |
paintComponent(java.awt.Graphics g)
|
void |
setDocumentViewCallback(DocumentView parentDocumentView)
Set the parent Document View class which is responsible for drawing and the general management of PageViewComponents for a particular view. |
void |
setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
Sets the text that is contained in the specified rectangle and the given mouse pointer. |
void |
updateView(java.lang.String propertyConstant,
java.lang.Object oldValue,
java.lang.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 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, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, 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, 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, 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, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, 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 org.icepdf.ri.common.views.PageViewComponent |
|---|
dispose, pageInitializedCallback, pageTeardownCallback |
| Field Detail |
|---|
protected static final int PAGE_BOUNDARY_BOX
protected static int pageBufferPadding
protected static boolean progressivePaint
protected boolean paintAnnotations
protected boolean paintSearchHighlight
protected DocumentView parentDocumentView
protected DocumentViewModel documentViewModel
protected DocumentViewController documentViewController
protected javax.swing.JScrollPane parentScrollPane
protected org.icepdf.core.pobjects.PageTree pageTree
protected int pageIndex
protected java.awt.Rectangle pageSize
protected float pageZoom
protected float pageRotation
protected int pageBoundaryBox
protected AbstractPageViewComponent.PageBufferStore pageBufferStore
protected java.awt.GraphicsConfiguration graphicsConfiguration
protected java.util.concurrent.FutureTask<java.lang.Object> pageImageCaptureTask
| Constructor Detail |
|---|
public AbstractPageViewComponent(DocumentViewModel documentViewModel,
org.icepdf.core.pobjects.PageTree pageTree,
int pageIndex,
javax.swing.JScrollPane parentScrollPane,
int width,
int height)
| Method Detail |
|---|
public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic java.awt.Dimension getSize()
getSize in class java.awt.Componentpublic void clearSelectedText()
public void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
cursorLocation - location of cursor or mouse.selection - rectangle of text to include in selection.public void clearSelectionRectangle()
public int getPageIndex()
PageViewComponent
getPageIndex in interface PageViewComponentpublic org.icepdf.core.pobjects.Page getPage()
public void setDocumentViewCallback(DocumentView parentDocumentView)
PageViewComponent
setDocumentViewCallback in interface PageViewComponentparentDocumentView - type of view, single page, continuous, etc.public static boolean isAnnotationTool(int displayTool)
public void updateView(java.lang.String propertyConstant,
java.lang.Object oldValue,
java.lang.Object newValue)
updateView in interface PageViewComponentpropertyConstant - document view change property.oldValue - old valuenewValue - new value
protected void calculatePageSize(java.awt.Rectangle pageSize,
float rotation,
float zoom)
pageSize - rectangle to update, new rectangle will not be created.rotation - rotation of page.zoom - zoom of pageprotected void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentprotected void calculateBufferLocation()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||