org.pdfsam.guiclient.commons.panels
Class JVisualPdfPageSelectionPanel

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.pdfsam.guiclient.commons.panels.JVisualPdfPageSelectionPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class JVisualPdfPageSelectionPanel
extends javax.swing.JPanel

Customizable panel for a visual page selection

Author:
Andrea Vacondio
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int DND_SUPPORT_FILES
           
static int DND_SUPPORT_FILES_AND_JAVAOBJECTS
           
static int DND_SUPPORT_JAVAOBJECTS
           
static int DND_SUPPORT_NONE
           
static int HORIZONTAL_ORIENTATION
           
static int MULTIPLE_INTERVAL_SELECTION
           
static java.lang.String OUTPUT_PATH_PROPERTY
           
static int SINGLE_INTERVAL_SELECTION
           
static int SINGLE_SELECTION
           
static int STYLE_TOP_PANEL_FULL
           
static int STYLE_TOP_PANEL_HIDE
           
static int STYLE_TOP_PANEL_MEDIUM
           
static int STYLE_TOP_PANEL_MINIMAL
           
static int VERTICAL_ORIENTATION
           
 
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
JVisualPdfPageSelectionPanel()
          default constructor
JVisualPdfPageSelectionPanel(int orientation)
          draw deleted items default value (true) show button panel default value (true)
JVisualPdfPageSelectionPanel(int orientation, boolean drawDeletedItems, boolean showButtonPanel)
           
JVisualPdfPageSelectionPanel(int orientation, boolean drawDeletedItems, boolean showButtonPanel, boolean showContextMenu, int topPanelStyle)
           
JVisualPdfPageSelectionPanel(int orientation, boolean drawDeletedItems, boolean showButtonPanel, boolean showContextMenu, int topPanelStyle, int dndSupport, int selectionType)
           
 
Method Summary
 void addMenuItem(javax.swing.JMenuItem item)
          Adds a item to the popup menu
 void addToTopPanel(java.awt.Component c)
          Add a component on the left of the top panel
 void appendElements(java.util.Collection<VisualPageListItem> c)
           
 void disableSetOutputPathMenuItem()
          remove the set ouput path menu item
 void enableSetOutputPathMenuItem()
          enables the set output path menu item
 javax.swing.JButton getClearButton()
           
 int getDndSupport()
           
 javax.swing.JButton getLoadFileButton()
           
 javax.swing.JButton getMoveDownButton()
           
 javax.swing.JButton getMoveUpButton()
           
 int getOrientation()
           
 PdfThumbnailsLoader getPdfLoader()
           
 javax.swing.JButton getRemoveButton()
           
 javax.swing.JButton getReverseButton()
           
 javax.swing.JButton getRotateAntiButton()
           
 javax.swing.JButton getRotateButton()
           
 java.lang.String getRotatedElementsString()
           
 VisualPageListItem[] getSelectedElements()
           
 java.io.File getSelectedPdfDocument()
           
 java.lang.String getSelectedPdfDocumentPassword()
           
 JVisualSelectionList getThumbnailList()
           
 javax.swing.JPanel getTopPanel()
           
 javax.swing.JButton getUndeleteButton()
           
 java.util.List<java.lang.String> getValidConsoleParameters()
          A of String List that can be used as input for the console.
 javax.swing.JButton getZoomInButton()
           
 javax.swing.JButton getZoomOutButton()
           
 boolean hasValidElements()
           
 boolean isDrawDeletedItems()
           
 boolean isWrap()
           
 void prependElements(java.util.Collection<VisualPageListItem> c)
           
 void resetPanel()
          reset the panel
 void setDocumentProperties(DocumentInfo documetnInfo)
          Set the document properties to be shown as a tooltip of the documentProperties JLabel
 void setDocumentPropertiesVisible(boolean visible)
          Set the visible the label that shows document properties
 void setDrawDeletedItems(boolean drawDeletedItems)
           
 void setSelectedPdfDocument(java.io.File selectedPdfDocument)
           
 void setSelectedPdfDocumentPassword(java.lang.String selectedPdfDocumentPassword)
           
 
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, getPreferredSize, 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, paintComponent, 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, 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, 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, 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
 

Field Detail

HORIZONTAL_ORIENTATION

public static final int HORIZONTAL_ORIENTATION
See Also:
Constant Field Values

VERTICAL_ORIENTATION

public static final int VERTICAL_ORIENTATION
See Also:
Constant Field Values

SINGLE_INTERVAL_SELECTION

public static final int SINGLE_INTERVAL_SELECTION
See Also:
Constant Field Values

MULTIPLE_INTERVAL_SELECTION

public static final int MULTIPLE_INTERVAL_SELECTION
See Also:
Constant Field Values

SINGLE_SELECTION

public static final int SINGLE_SELECTION
See Also:
Constant Field Values

STYLE_TOP_PANEL_HIDE

public static final int STYLE_TOP_PANEL_HIDE
See Also:
Constant Field Values

STYLE_TOP_PANEL_MINIMAL

public static final int STYLE_TOP_PANEL_MINIMAL
See Also:
Constant Field Values

STYLE_TOP_PANEL_MEDIUM

public static final int STYLE_TOP_PANEL_MEDIUM
See Also:
Constant Field Values

STYLE_TOP_PANEL_FULL

public static final int STYLE_TOP_PANEL_FULL
See Also:
Constant Field Values

DND_SUPPORT_NONE

public static final int DND_SUPPORT_NONE
See Also:
Constant Field Values

DND_SUPPORT_FILES

public static final int DND_SUPPORT_FILES
See Also:
Constant Field Values

DND_SUPPORT_JAVAOBJECTS

public static final int DND_SUPPORT_JAVAOBJECTS
See Also:
Constant Field Values

DND_SUPPORT_FILES_AND_JAVAOBJECTS

public static final int DND_SUPPORT_FILES_AND_JAVAOBJECTS
See Also:
Constant Field Values

OUTPUT_PATH_PROPERTY

public static final java.lang.String OUTPUT_PATH_PROPERTY
See Also:
Constant Field Values
Constructor Detail

JVisualPdfPageSelectionPanel

public JVisualPdfPageSelectionPanel()
default constructor


JVisualPdfPageSelectionPanel

public JVisualPdfPageSelectionPanel(int orientation)
draw deleted items default value (true) show button panel default value (true)

Parameters:
orientation - panel orientation

JVisualPdfPageSelectionPanel

public JVisualPdfPageSelectionPanel(int orientation,
                                    boolean drawDeletedItems,
                                    boolean showButtonPanel)
Parameters:
orientation - panel orientation
drawDeletedItems - if true deleted items appear with a red cross over
showButtonPanel - true=shows button panel

JVisualPdfPageSelectionPanel

public JVisualPdfPageSelectionPanel(int orientation,
                                    boolean drawDeletedItems,
                                    boolean showButtonPanel,
                                    boolean showContextMenu,
                                    int topPanelStyle)
Parameters:
orientation - panel orientation
drawDeletedItems - if true deleted items appear with a red cross over
showButtonPanel - true=shows button panel
showContextMenu -
topPanelStyle -

JVisualPdfPageSelectionPanel

public JVisualPdfPageSelectionPanel(int orientation,
                                    boolean drawDeletedItems,
                                    boolean showButtonPanel,
                                    boolean showContextMenu,
                                    int topPanelStyle,
                                    int dndSupport,
                                    int selectionType)
Parameters:
orientation - panel orientation
drawDeletedItems - if true deleted items appear with a red cross over
showButtonPanel - true=shows button panel
showContextMenu -
topPanelStyle - top panel style
selectionType - selection type
Method Detail

resetPanel

public void resetPanel()
reset the panel


setDocumentPropertiesVisible

public void setDocumentPropertiesVisible(boolean visible)
Set the visible the label that shows document properties

Parameters:
visible -

setDocumentProperties

public void setDocumentProperties(DocumentInfo documetnInfo)
Set the document properties to be shown as a tooltip of the documentProperties JLabel

Parameters:
documetnInfo - bean containing document informations

getOrientation

public int getOrientation()
Returns:
the orientation

getSelectedPdfDocument

public java.io.File getSelectedPdfDocument()
Returns:
the selectedPdfDocument

isWrap

public boolean isWrap()
Returns:
the wrap

getThumbnailList

public JVisualSelectionList getThumbnailList()
Returns:
the thumbnailList

setSelectedPdfDocument

public void setSelectedPdfDocument(java.io.File selectedPdfDocument)
Parameters:
selectedPdfDocument - the selectedPdfDocument to set

getDndSupport

public int getDndSupport()
Returns:
the dndSupport

isDrawDeletedItems

public boolean isDrawDeletedItems()
Returns:
the drawDeletedItems

setDrawDeletedItems

public void setDrawDeletedItems(boolean drawDeletedItems)
Parameters:
drawDeletedItems - the drawDeletedItems to set

getPdfLoader

public PdfThumbnailsLoader getPdfLoader()
Returns:
the pdfLoader

getTopPanel

public javax.swing.JPanel getTopPanel()
Returns:
the topPanel

getValidConsoleParameters

public java.util.List<java.lang.String> getValidConsoleParameters()
A of String List that can be used as input for the console. It contains the -f and -u parameters for this panel

Returns:

hasValidElements

public boolean hasValidElements()
Returns:
true if the panel has valid elements

getRotatedElementsString

public java.lang.String getRotatedElementsString()
Returns:
a String that can be used as a -r param for the pdfsam-console

addToTopPanel

public void addToTopPanel(java.awt.Component c)
Add a component on the left of the top panel

Parameters:
c -

getSelectedElements

public VisualPageListItem[] getSelectedElements()
Returns:
Returns an array of all the selected values, in increasing order based on their indices in the list or an empty array if nothing is selected

appendElements

public void appendElements(java.util.Collection<VisualPageListItem> c)
Parameters:
c -
See Also:
VisualListModel.appendAllElements(Collection)

prependElements

public void prependElements(java.util.Collection<VisualPageListItem> c)
Parameters:
c -
See Also:
VisualListModel.prependAllElements(Collection)

addMenuItem

public void addMenuItem(javax.swing.JMenuItem item)
Adds a item to the popup menu

Parameters:
item -

enableSetOutputPathMenuItem

public void enableSetOutputPathMenuItem()
enables the set output path menu item


disableSetOutputPathMenuItem

public void disableSetOutputPathMenuItem()
remove the set ouput path menu item


getSelectedPdfDocumentPassword

public java.lang.String getSelectedPdfDocumentPassword()
Returns:
the selectedPdfDocumentPassword

setSelectedPdfDocumentPassword

public void setSelectedPdfDocumentPassword(java.lang.String selectedPdfDocumentPassword)
Parameters:
selectedPdfDocumentPassword - the selectedPdfDocumentPassword to set

getClearButton

public javax.swing.JButton getClearButton()
Returns:
the clearButton

getZoomInButton

public javax.swing.JButton getZoomInButton()
Returns:
the zoomInButton

getZoomOutButton

public javax.swing.JButton getZoomOutButton()
Returns:
the zoomOutButton

getUndeleteButton

public javax.swing.JButton getUndeleteButton()
Returns:
the undeleteButton

getRemoveButton

public javax.swing.JButton getRemoveButton()
Returns:
the removeButton

getMoveUpButton

public javax.swing.JButton getMoveUpButton()
Returns:
the moveUpButton

getMoveDownButton

public javax.swing.JButton getMoveDownButton()
Returns:
the moveDownButton

getRotateButton

public javax.swing.JButton getRotateButton()
Returns:
the rotateButton

getRotateAntiButton

public javax.swing.JButton getRotateAntiButton()
Returns:
the rotateAntiButton

getLoadFileButton

public javax.swing.JButton getLoadFileButton()
Returns:
the loadFileButton

getReverseButton

public javax.swing.JButton getReverseButton()
Returns:
the reverseButton