org.icepdf.ri.common
Class PageThumbnailComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by org.icepdf.ri.common.views.AbstractPageViewComponent
                      extended by org.icepdf.ri.common.PageThumbnailComponent
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, PageViewComponent

public class PageThumbnailComponent
extends AbstractPageViewComponent
implements java.awt.event.MouseListener

The PageThumbnailComponent represents one page thumbnail preview in the larger ThumbnailsPanel. The Component when visible will try to load a thumbnail from the Page object, the size of this thumbnail is defined by the document and is displayed as is. If no embedded thumbnail is found the page is initialized and page thumbnail is captured and cached. The size of this thumbnail can be configure with the system property:

org.icepdf.vi.views.buffersize.vertical

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
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
 
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, parentScrollPane, 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
PageThumbnailComponent(SwingController controller, javax.swing.JScrollPane parentScrollPane, org.icepdf.core.pobjects.PageTree pageTree, int pageNumber, float thumbNailZoom)
           
PageThumbnailComponent(SwingController controller, javax.swing.JScrollPane parentScrollPane, org.icepdf.core.pobjects.PageTree pageTree, int pageNumber, int width, int height, float thumbNailZoom)
           
 
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.
 void clearSelectedText()
           
 void dispose()
          Called to free resources used by this component.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void pageInitializedCallback(org.icepdf.core.pobjects.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.
 void pageTeardownCallback()
          This callback is called when a page is scheduled for dispose.
 
Methods inherited from class org.icepdf.ri.common.views.AbstractPageViewComponent
calculatePageSize, clearSelectionRectangle, getPage, getPageIndex, getPreferredSize, getSize, isAnnotationTool, paintComponent, setDocumentViewCallback, setSelectionRectangle, updateView
 
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
 

Constructor Detail

PageThumbnailComponent

public PageThumbnailComponent(SwingController controller,
                              javax.swing.JScrollPane parentScrollPane,
                              org.icepdf.core.pobjects.PageTree pageTree,
                              int pageNumber,
                              float thumbNailZoom)

PageThumbnailComponent

public PageThumbnailComponent(SwingController controller,
                              javax.swing.JScrollPane parentScrollPane,
                              org.icepdf.core.pobjects.PageTree pageTree,
                              int pageNumber,
                              int width,
                              int height,
                              float thumbNailZoom)
Method Detail

calculateBufferLocation

protected void calculateBufferLocation()
Description copied from class: AbstractPageViewComponent
Calculates where we should be painting the new buffer and kicks off the the worker if the buffer is deemed dirty. The Parent scrollpane viewport is taken into account to setup the clipping.

Overrides:
calculateBufferLocation in class AbstractPageViewComponent

dispose

public void dispose()
Description copied from interface: PageViewComponent
Called to free resources used by this component.

Specified by:
dispose in interface PageViewComponent

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

pageInitializedCallback

public void pageInitializedCallback(org.icepdf.core.pobjects.Page page)
Description copied from interface: PageViewComponent
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. This method should return as quickly as possible.

Specified by:
pageInitializedCallback in interface PageViewComponent
Parameters:
page - page that was just initialized.

pageTeardownCallback

public void pageTeardownCallback()
Description copied from interface: PageViewComponent
This 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:
pageTeardownCallback in interface PageViewComponent

clearSelectedText

public void clearSelectedText()
Overrides:
clearSelectedText in class AbstractPageViewComponent