org.jpedal.examples.simpleviewer.gui.swing
Class SwingThumbnailPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JScrollPane
                  extended by org.jpedal.examples.simpleviewer.gui.swing.SwingThumbnailPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.ScrollPaneConstants, GUIThumbnailPanel

public class SwingThumbnailPanel
extends javax.swing.JScrollPane
implements GUIThumbnailPanel

Used in GUI example code.
adds thumbnail capabilities to viewer,
shows pages as thumbnails within this panel,
So this panel can be added to the viewer

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 boolean drawing
          flag to show drawig taking place
 boolean interrupt
          flag to allow interruption in orderly manner
 org.jpedal.ThumbnailDecoder thumbDecoder
          custom decoder to create Thumbnails
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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 javax.swing.ScrollPaneConstants
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingThumbnailPanel(Values commonValues, PdfDecoder decode_pdf)
           
 
Method Summary
 void addComponentListener()
           
 void addDisplayedPageAsThumbnail(int currentPage, org.jpedal.render.DynamicVectorRenderer currentDisplay)
          add any new thumbnails needed to display
 void drawThumbnails()
          redraw thumbnails if scrolled
 void generateOtherThumbnails(java.lang.String[] imageFiles, Vector_Object thumbnailsStored)
          create thumbnails of general images
 void generateOtherVisibleThumbnails(int currentPage)
          setup thumbnails if needed
 java.lang.Object[] getButtons()
          return a button holding the image,so we can add listener
 boolean isShownOnscreen()
           
 void refreshDisplay()
           
 void removeAllListeners()
           
 void resetHighlightedThumbnail(int item)
          reset the highlights
 void resetToDefault()
           
 void setIsDisplayedOnscreen(boolean b)
           
 void setThumbnailsEnabled()
          Deprecated.  
 void setThumbnailsEnabled(boolean newValue)
           
 void setupThumbnails(int pages, java.awt.Font textFont, java.lang.String message, PdfPageData pageData)
          setup thumbnails at start - use when adding pages
 void setupThumbnails(int pages, int[] pageUsed, int pageCount)
          setup thumbnails at start - use for general images
 void terminateDrawing()
          stop any drawing
 
Methods inherited from class javax.swing.JScrollPane
createHorizontalScrollBar, createVerticalScrollBar, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jpedal.examples.simpleviewer.gui.generic.GUIThumbnailPanel
removeAll
 

Field Detail

interrupt

public boolean interrupt
flag to allow interruption in orderly manner


drawing

public boolean drawing
flag to show drawig taking place


thumbDecoder

public org.jpedal.ThumbnailDecoder thumbDecoder
custom decoder to create Thumbnails

Constructor Detail

SwingThumbnailPanel

public SwingThumbnailPanel(Values commonValues,
                           PdfDecoder decode_pdf)
Method Detail

generateOtherThumbnails

public void generateOtherThumbnails(java.lang.String[] imageFiles,
                                    Vector_Object thumbnailsStored)
create thumbnails of general images

Specified by:
generateOtherThumbnails in interface GUIThumbnailPanel
Parameters:
thumbnailsStored -

generateOtherVisibleThumbnails

public void generateOtherVisibleThumbnails(int currentPage)
setup thumbnails if needed

Specified by:
generateOtherVisibleThumbnails in interface GUIThumbnailPanel

drawThumbnails

public void drawThumbnails()
redraw thumbnails if scrolled


addDisplayedPageAsThumbnail

public void addDisplayedPageAsThumbnail(int currentPage,
                                        org.jpedal.render.DynamicVectorRenderer currentDisplay)
add any new thumbnails needed to display

Specified by:
addDisplayedPageAsThumbnail in interface GUIThumbnailPanel

setupThumbnails

public void setupThumbnails(int pages,
                            int[] pageUsed,
                            int pageCount)
setup thumbnails at start - use for general images

Specified by:
setupThumbnails in interface GUIThumbnailPanel

resetHighlightedThumbnail

public void resetHighlightedThumbnail(int item)
reset the highlights

Specified by:
resetHighlightedThumbnail in interface GUIThumbnailPanel

setupThumbnails

public void setupThumbnails(int pages,
                            java.awt.Font textFont,
                            java.lang.String message,
                            PdfPageData pageData)
setup thumbnails at start - use when adding pages

Specified by:
setupThumbnails in interface GUIThumbnailPanel

getButtons

public java.lang.Object[] getButtons()
return a button holding the image,so we can add listener

Specified by:
getButtons in interface GUIThumbnailPanel

setThumbnailsEnabled

public void setThumbnailsEnabled()
Deprecated. 

old method

Specified by:
setThumbnailsEnabled in interface GUIThumbnailPanel

setThumbnailsEnabled

public void setThumbnailsEnabled(boolean newValue)
Specified by:
setThumbnailsEnabled in interface GUIThumbnailPanel

isShownOnscreen

public boolean isShownOnscreen()
Specified by:
isShownOnscreen in interface GUIThumbnailPanel

resetToDefault

public void resetToDefault()
Specified by:
resetToDefault in interface GUIThumbnailPanel

setIsDisplayedOnscreen

public void setIsDisplayedOnscreen(boolean b)
Specified by:
setIsDisplayedOnscreen in interface GUIThumbnailPanel

addComponentListener

public void addComponentListener()
Specified by:
addComponentListener in interface GUIThumbnailPanel

removeAllListeners

public void removeAllListeners()
Specified by:
removeAllListeners in interface GUIThumbnailPanel

terminateDrawing

public void terminateDrawing()
stop any drawing

Specified by:
terminateDrawing in interface GUIThumbnailPanel

refreshDisplay

public void refreshDisplay()
Specified by:
refreshDisplay in interface GUIThumbnailPanel