org.faceless.pdf2.viewer2.feature
Class ThumbnailPanel.View

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.faceless.pdf2.viewer2.feature.ThumbnailPanel.View
All Implemented Interfaces:
Autoscroll, DropTargetListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, Scrollable, DocumentPanelListener
Enclosing class:
ThumbnailPanel

public static class ThumbnailPanel.View
extends JPanel
implements Scrollable, DocumentPanelListener, Autoscroll, PropertyChangeListener, DropTargetListener

This class is the JPanel containing all the thumbnails. It serves as a DropTarget or drag-and-drop, as a the Scrollable content of the SidePanel, and handles actions when the document is updated, when a popup has run on the selected panels, and when a keypress is received (by way of its InputMap and ActionMap. New actions may be registered with this class by adding ThumbnailPanel.ThumbnailSelectionActions to the viewer. These should respect this objects isEditable() flag if they're going to modify the file.

This class fires "selection" PropertyChangeEvents when the list of selected pages is changed, and "selected" events when the current page is changed.

There's no need to acccess this class unless you're implementing your own ThumbnailPanel.ThumbnailSelectionAction

Since:
2.12
See Also:
Serialized Form

Nested Class Summary
 
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 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
 
Method Summary
 void autoscroll(Point p)
           
 void documentUpdated(DocumentPanelEvent event)
          The document has been updated - check for loading, closing or changing the current page.
 void doLayout()
           
 void dragEnter(DropTargetDragEvent event)
           
 void dragExit(DropTargetEvent event)
           
 void dragOver(DropTargetDragEvent event)
           
 void drop(DropTargetDropEvent event)
          Accept a Drop.
 void dropActionChanged(DropTargetDragEvent event)
           
 Insets getAutoscrollInsets()
           
 DocumentPanel getDocumentPanel()
          Get the DocumentPanel this View relates to
 Dimension getPreferredScrollableViewportSize()
           
 Dimension getPreferredSize()
           
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 List getSelectedPages()
          Return a List of selected pages
 String getSelectedPagesDescription()
          Get a String describing the currently selected pages
 boolean isEditable()
          Return true if the PDF in the panel can be edited.
 boolean isFactoryEditable()
          Return true if this ThumbnailPanel will never allow editing.
 void paintComponent(Graphics g)
           
 void propertyChange(PropertyChangeEvent event)
          The PDF fired a property change - document may have had its page list altered.
 void setBounds(int x, int y, int width, int height)
           
 
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, getSize, 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, 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
 

Method Detail

documentUpdated

public void documentUpdated(DocumentPanelEvent event)
The document has been updated - check for loading, closing or changing the current page.

Specified by:
documentUpdated in interface DocumentPanelListener

propertyChange

public void propertyChange(PropertyChangeEvent event)
The PDF fired a property change - document may have had its page list altered.

Specified by:
propertyChange in interface PropertyChangeListener

getSelectedPagesDescription

public String getSelectedPagesDescription()
Get a String describing the currently selected pages


getSelectedPages

public List getSelectedPages()
Return a List of selected pages


doLayout

public void doLayout()
Overrides:
doLayout in class Container

isFactoryEditable

public boolean isFactoryEditable()
Return true if this ThumbnailPanel will never allow editing. This value is fixed over the life of the panel

Since:
2.13

isEditable

public boolean isEditable()
Return true if the PDF in the panel can be edited. This value may vary over the life of the DocumentPanel.


getDocumentPanel

public DocumentPanel getDocumentPanel()
Get the DocumentPanel this View relates to


dragOver

public void dragOver(DropTargetDragEvent event)
Specified by:
dragOver in interface DropTargetListener

dragEnter

public void dragEnter(DropTargetDragEvent event)
Specified by:
dragEnter in interface DropTargetListener

dragExit

public void dragExit(DropTargetEvent event)
Specified by:
dragExit in interface DropTargetListener

drop

public void drop(DropTargetDropEvent event)
Accept a Drop. This method will update the PDF page list, which will fire an event which this class is listening for.

Specified by:
drop in interface DropTargetListener

dropActionChanged

public void dropActionChanged(DropTargetDragEvent event)
Specified by:
dropActionChanged in interface DropTargetListener

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class Component

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface Scrollable

paintComponent

public void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

autoscroll

public void autoscroll(Point p)
Specified by:
autoscroll in interface Autoscroll

getAutoscrollInsets

public Insets getAutoscrollInsets()
Specified by:
getAutoscrollInsets in interface Autoscroll


Copyright © 2001-2013 Big Faceless Organization