Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.gui
Class CollectionPane  view CollectionPane download CollectionPane.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.greenstone.gatherer.gui.CollectionPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class CollectionPane
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.event.FocusListener

The collection pane is analogous with a file manager. It is there that the user chooses which files to include in their collection and what structure the file hierarchy should take. The later aspect is not important for the Greenstone Suite, but is usefull for grouping files for ease of metadata markup. The view essentially consists of two file trees, one denoting the entire source workspace and the other the files within your collection. The trees themselves have a title bar at the top, a filter control at the bottom, and are coloured to indicate activity (grey for disabled). The remainder of the screen is taken by a status area, to indicate current file job progress during copying etc, and three buttons for controlling features of the view.

Version:
2.3

Nested Class Summary
private  class CollectionPane.GPopupMenu
          When a user right-clicks within the trees on the collection pane view they are presented with a small popup menu of context based options.
private  class CollectionPane.KeyListenerImpl
          This class listens for certain key presses, such as [Enter] or [Delete], and responds appropriately.
private  class CollectionPane.MappingPrompt
          This provides a small prompt for gathering addition details about a special directory mapping such as its symbolic name.
private  class CollectionPane.MouseListenerImpl
          This class listens for mouse clicks and responds right mouse button clicks (popup menu).
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.lang.String[] args
          Text fragment arguments used to fill in phrases returned from the dictionary.
private  org.greenstone.gatherer.undo.UndoManager bin_button
          The button used to delete files, which also doubles as a drop target for files from the Trees.
private  javax.swing.tree.TreeModel collection
          The collection model which is used to build, and hold the data of, the collection tree.
private  Filter collection_filter
          The filter currently applied to the collection tree.
private  javax.swing.JLabel collection_label
          The label shown at the top of the collection tree.
private  javax.swing.JPanel collection_pane
          The panel that contains the collection tree.
private  javax.swing.JScrollPane collection_scroll
          The scrollable area into which the collection tree is placed.
private  org.greenstone.gatherer.gui.tree.DragTree collection_tree
          The tree showing the files within the collection.
private  org.greenstone.gatherer.util.TreeSynchronizer collection_tree_sync
          Ensures that expansion and selection events between collection trees based on the same model are synchronized.
private  javax.swing.JPanel control_pane
          The panel that contains the various controls including the status area.
(package private) static java.awt.Dimension DIALOG_SIZE
          The default size of a special mapping dialog.
private  org.greenstone.gatherer.file.FileQueue file_queue
          The threaded queue that handles the actually movement of files, so that the gui remains responsive.
private  javax.swing.JLabel filename_label
          The label shown in the status area explaining the file apon which action is taking place.
private  org.greenstone.gatherer.util.DragGroup group
          The group encompassing all of the components available as drop targets for drag and drop actions.
private static java.awt.Dimension LABEL_SIZE
          The default size of a label in the interface.
private static java.awt.Dimension MIN_SIZE
          The minimum size a gui component can become.
private  javax.swing.JButton new_folder
          The button used to create a new folder in the collection tree.
private  javax.swing.JLabel status_label
          The label shown explaining the current state of the file queue thread.
private static java.awt.Dimension STATUS_SIZE
          The default size of the status area.
private  javax.swing.JButton stop_action
          The button used to cancel all pending file queue jobs.
private  javax.swing.JSplitPane tree_pane
          A split pane seperating the two trees, allowing for the screen real-estate for each to be changed.
private static java.awt.Dimension TREE_SIZE
          The initial size of the trees.
private  javax.swing.tree.TreeModel workspace
          The GTree model used as the data source for the workspace tree.
private  Filter workspace_filter
          The filter currently applied to the workspace tree.
private  javax.swing.JLabel workspace_label
          The label at the top of the workspace tree.
private  javax.swing.JPanel workspace_pane
          The panel that contains the workspace tree.
private  javax.swing.JScrollPane workspace_scroll
          The scrollable area into which the workspace tree is placed.
private  org.greenstone.gatherer.gui.tree.WorkspaceTree workspace_tree
          The tree showing the available source workspace.
private  org.greenstone.gatherer.util.TreeSynchronizer workspace_tree_sync
          Ensures that expansion and selection events between workspace trees based on the same model are synchronized.
 
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.Container
 
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
CollectionPane(org.greenstone.gatherer.util.TreeSynchronizer workspace_tree_sync, org.greenstone.gatherer.util.TreeSynchronizer collection_tree_sync)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Any implementation of ActionListener requires this method so that when an action is performed the appropriate effect can occur.
 void collectionChanged(boolean ready)
          Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed.
 void display()
          Generates the pane on controls used to 'collect' files into the collection.
 java.awt.Rectangle expandPath(javax.swing.tree.TreePath path)
          This method ensures that a certain tree path is visible and selected within the collection tree, expanding nodes if necessary.
 void focusGained(java.awt.event.FocusEvent event)
          Called whenever this pane gains focus, this method ensures that the various tree renderers are correctly colouring the tree (as these settings sometimes get lost).
 void focusLost(java.awt.event.FocusEvent event)
          Implementation side-effect, not used in any way.
 void gainFocus()
          Called to inform this control panel that it has just gained focus as an effect of the user clicking on its tab.
 org.greenstone.gatherer.file.FileNode[] getSelected()
          Retrieve a list of the currently selected file records in the active tree.
 java.lang.String getSelectionDetails()
           
 void refreshCollectionTree(int refresh_reason)
           
 void refreshWorkspaceTree(int refresh_reason)
           
private  void setEnabled(javax.swing.JLabel label, boolean state, java.awt.Color foreground, java.awt.Color background)
          Used to set the enabled state, and hence the colouring, of the two tree labels.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, swapComponents, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

group

private org.greenstone.gatherer.util.DragGroup group
The group encompassing all of the components available as drop targets for drag and drop actions. Required so that only one component renders the ghost and higlights itself as a target, which the other members are restored to their original, pristine, condition.


collection_tree

private org.greenstone.gatherer.gui.tree.DragTree collection_tree
The tree showing the files within the collection.


workspace_tree

private org.greenstone.gatherer.gui.tree.WorkspaceTree workspace_tree
The tree showing the available source workspace.


file_queue

private org.greenstone.gatherer.file.FileQueue file_queue
The threaded queue that handles the actually movement of files, so that the gui remains responsive.


collection_filter

private Filter collection_filter
The filter currently applied to the collection tree.


workspace_filter

private Filter workspace_filter
The filter currently applied to the workspace tree.


collection

private javax.swing.tree.TreeModel collection
The collection model which is used to build, and hold the data of, the collection tree.


workspace

private javax.swing.tree.TreeModel workspace
The GTree model used as the data source for the workspace tree.


stop_action

private javax.swing.JButton stop_action
The button used to cancel all pending file queue jobs.


new_folder

private javax.swing.JButton new_folder
The button used to create a new folder in the collection tree.


collection_label

private javax.swing.JLabel collection_label
The label shown at the top of the collection tree.


filename_label

private javax.swing.JLabel filename_label
The label shown in the status area explaining the file apon which action is taking place.


status_label

private javax.swing.JLabel status_label
The label shown explaining the current state of the file queue thread.


workspace_label

private javax.swing.JLabel workspace_label
The label at the top of the workspace tree.


collection_pane

private javax.swing.JPanel collection_pane
The panel that contains the collection tree.


control_pane

private javax.swing.JPanel control_pane
The panel that contains the various controls including the status area.


workspace_pane

private javax.swing.JPanel workspace_pane
The panel that contains the workspace tree.


collection_scroll

private javax.swing.JScrollPane collection_scroll
The scrollable area into which the collection tree is placed.


workspace_scroll

private javax.swing.JScrollPane workspace_scroll
The scrollable area into which the workspace tree is placed.


tree_pane

private javax.swing.JSplitPane tree_pane
A split pane seperating the two trees, allowing for the screen real-estate for each to be changed.


args

private java.lang.String[] args
Text fragment arguments used to fill in phrases returned from the dictionary.


collection_tree_sync

private org.greenstone.gatherer.util.TreeSynchronizer collection_tree_sync
Ensures that expansion and selection events between collection trees based on the same model are synchronized.


workspace_tree_sync

private org.greenstone.gatherer.util.TreeSynchronizer workspace_tree_sync
Ensures that expansion and selection events between workspace trees based on the same model are synchronized.


bin_button

private org.greenstone.gatherer.undo.UndoManager bin_button
The button used to delete files, which also doubles as a drop target for files from the Trees.


LABEL_SIZE

private static final java.awt.Dimension LABEL_SIZE
The default size of a label in the interface.


DIALOG_SIZE

static final java.awt.Dimension DIALOG_SIZE
The default size of a special mapping dialog.


MIN_SIZE

private static java.awt.Dimension MIN_SIZE
The minimum size a gui component can become.


STATUS_SIZE

private static java.awt.Dimension STATUS_SIZE
The default size of the status area.


TREE_SIZE

private static java.awt.Dimension TREE_SIZE
The initial size of the trees.

Constructor Detail

CollectionPane

public CollectionPane(org.greenstone.gatherer.util.TreeSynchronizer workspace_tree_sync,
                      org.greenstone.gatherer.util.TreeSynchronizer collection_tree_sync)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Any implementation of ActionListener requires this method so that when an action is performed the appropriate effect can occur. In this case there are three valid possibilities. If the action occured on the recycle bin, then delete the current selection from the collection tree. If the action instead occured on the new folder button, then create a new folder under the current (single) selection in the collection tree. And finally if the cancel button was pressed, cancel the current, and remaining, jobs on the file queue.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

collectionChanged

public void collectionChanged(boolean ready)
Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed. Several actions must occur in the GUI to indicate this change to the user, such as en/disabling the collection tree.


display

public void display()
Generates the pane on controls used to 'collect' files into the collection. Resposible for creating, connecting and laying out these controls.


expandPath

public java.awt.Rectangle expandPath(javax.swing.tree.TreePath path)
This method ensures that a certain tree path is visible and selected within the collection tree, expanding nodes if necessary. If the method is successful the bounds of the new selection are returned.


focusGained

public void focusGained(java.awt.event.FocusEvent event)
Called whenever this pane gains focus, this method ensures that the various tree renderers are correctly colouring the tree (as these settings sometimes get lost).

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Implementation side-effect, not used in any way.

Specified by:
focusLost in interface java.awt.event.FocusListener

gainFocus

public void gainFocus()
Called to inform this control panel that it has just gained focus as an effect of the user clicking on its tab.


getSelected

public org.greenstone.gatherer.file.FileNode[] getSelected()
Retrieve a list of the currently selected file records in the active tree.


getSelectionDetails

public java.lang.String getSelectionDetails()

refreshCollectionTree

public void refreshCollectionTree(int refresh_reason)

refreshWorkspaceTree

public void refreshWorkspaceTree(int refresh_reason)

setEnabled

private void setEnabled(javax.swing.JLabel label,
                        boolean state,
                        java.awt.Color foreground,
                        java.awt.Color background)
Used to set the enabled state, and hence the colouring, of the two tree labels.