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

Quick Search    Search Deep

org.greenstone.gatherer.gui.tree
Class DragTree  view DragTree download DragTree.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTree
                  extended byorg.greenstone.gatherer.gui.tree.DragTree
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.dnd.Autoscroll, org.greenstone.gatherer.util.DragComponent, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TreeSelectionListener
Direct Known Subclasses:
WorkspaceTree

public class DragTree
extends javax.swing.JTree
implements java.awt.dnd.Autoscroll, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, org.greenstone.gatherer.util.DragComponent, javax.swing.event.TreeSelectionListener


Nested Class Summary
 
Nested classes inherited from class javax.swing.JTree
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector
 
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 static int AUTOSCROLL_MARGIN
          The distance from the edge of the current view within the scroll bar which if entered causes the view to scroll.
private  java.awt.Color background_color
          The normal background color.
static int COLLECTION_CONTENTS_CHANGED
           
private  javax.swing.ImageIcon disabled_background
          The image to use for the disabled background.
private  int drag_action
          The default drag action, although its not that important as we provide custom icons during drags.
private  java.awt.Color foreground_color
          The normal foreground color.
private  org.greenstone.gatherer.util.DragGroup group
          The Group this component belongs to.
static int LIBRARY_CONTENTS_CHANGED
           
static int LOADED_COLLECTION_CHANGED
           
private  java.awt.Rectangle lower_cue_line
          The region borderer by the lower cue line.
private  javax.swing.ImageIcon multiple_icon
          The icon to use for multiple node drag'n'drops.
private  java.lang.String name
          The identifying name of this Tree.
private static java.awt.Cursor NO_DRAG_CURSOR
           
private  javax.swing.ImageIcon normal_background
          The image to use for a normal background.
private  javax.swing.tree.TreePath previous_path
          The last tree path the drag was hovered over.
private  java.awt.Point pt_last
          The location of the last ghost drawn, so that we can repair the 'spoilt' area.
private  java.awt.Rectangle ra_ghost
          The region covered by the drag ghost icon.
private static java.awt.Color TRANSPARENT_COLOR
           
static int TREE_DISPLAY_CHANGED
           
private  java.awt.Rectangle upper_cue_line
          The region borderer by the upper cue line.
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
 
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
DragTree(java.lang.String name, java.lang.String background_name, boolean mixed_selection)
           
DragTree(java.lang.String name, javax.swing.tree.TreeModel model, java.lang.String background_name, boolean mixed_selection)
           
 
Method Summary
 void autoscroll(java.awt.Point pt)
          Notify the Component to autoscroll
 void clearGhost()
          In order for the appearance to be consistant, given we may be in the situation where the pointer has left our focus but the ghost remains, this method allows other members of the GGroup to tell this component to clear its ghost.
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
          Any implementation of DragSourceListener must include this method so we can be notified when the drag event ends (somewhere else), which will in turn remove actions.
 void dragEnter(java.awt.dnd.DragSourceDragEvent event)
          Any implementation of DragSourceListener must include this method so we can be notified when the drag focus enters this component.
 void dragEnter(java.awt.dnd.DropTargetDragEvent event)
          Any implementation of DropTargetListener must include this method so we can be notified when the drag focus enters this component, which in this case is to grab focus from within our group.
 void dragExit(java.awt.dnd.DragSourceEvent event)
          Any implementation of DragSourceListener must include this method so we can be notified when the drag focus leaves this component.
 void dragExit(java.awt.dnd.DropTargetEvent event)
          Any implementation of DropTargetListener must include this method so we can be notified when the drag focus leaves this component.
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
          Any implementation of DragGestureListener must include this method so we can be notified when a drag action has been noticed, thus a drag action has begun.
 void dragOver(java.awt.dnd.DragSourceDragEvent event)
          Implementation side-effect.
 void dragOver(java.awt.dnd.DropTargetDragEvent event)
          Any implementation of DropTargetListener must include this method so we can be notified when the drag moves in this component.
 void drop(java.awt.dnd.DropTargetDropEvent event)
          Any implementation of DropTargetListener must include this method so we can be notified when the drag ends, ie the transferable is dropped.
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
          Any implementation of DragSourceListener must include this method so we can be notified when the action to be taken upon drop changes.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
          Any implementation of DropTargetListener must include this method so we can be notified when the action to be taken upon drop changes.
 void gainFocus()
          Used to notify this component that it has gained focus.
 java.awt.Insets getAutoscrollInsets()
          Autoscroll Interface...
 java.lang.String getSelectionDetails()
           
 org.greenstone.gatherer.file.FileSystemModel getTreeModel()
          Retrieve the model associated with this component.
 void init(java.lang.String name, java.lang.String background_name, boolean mixed_selection)
           
private  boolean isValidDrag()
          returns false for dummy nodes (ones without files), and system root nodes
private  boolean isValidDrop(javax.swing.tree.TreePath target_path)
           
 void loseFocus()
          This method is used to inform this component when it loses focus, and should indicate this somehow.
 void mapDirectory(java.io.File file, java.lang.String title)
           
 void paint(java.awt.Graphics g)
          Paint the component.
 void refresh(javax.swing.tree.TreePath path)
           
 void setBackgroundNonSelectionColor(java.awt.Color color)
           
 void setBackgroundSelectionColor(java.awt.Color color)
           
 void setEnabled(boolean state)
          Override the normal setEnabled so the Tree exhibits a little more change, which in this instance is the background colour changing.
 void setGroup(org.greenstone.gatherer.util.DragGroup group)
          Set the components group.
 void setImmediate(boolean state)
          Determines whether the following selection attempts should go through the normal delayed selection model, or should happen immediately.
 void setModel(javax.swing.tree.TreeModel model)
          Sets the model to use in JTree.
 void setSelection(java.io.File file)
          Ensure that that file node denoted by the given file is selected.
 void setTextNonSelectionColor(java.awt.Color color)
           
 void setTextSelectionColor(java.awt.Color color)
           
 java.lang.String toString()
          Returns a string representation of this component.
 void valueChanged(javax.swing.event.TreeSelectionEvent event)
          Value changed
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, 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, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.greenstone.gatherer.util.DragComponent
addFocusListener
 

Field Detail

background_color

private java.awt.Color background_color
The normal background color.


foreground_color

private java.awt.Color foreground_color
The normal foreground color.


group

private org.greenstone.gatherer.util.DragGroup group
The Group this component belongs to.


disabled_background

private javax.swing.ImageIcon disabled_background
The image to use for the disabled background.


normal_background

private javax.swing.ImageIcon normal_background
The image to use for a normal background.


multiple_icon

private javax.swing.ImageIcon multiple_icon
The icon to use for multiple node drag'n'drops. We decided against using the windows paradigm or a block of x horizontal lines for x files.


drag_action

private int drag_action
The default drag action, although its not that important as we provide custom icons during drags.


pt_last

private java.awt.Point pt_last
The location of the last ghost drawn, so that we can repair the 'spoilt' area.


lower_cue_line

private java.awt.Rectangle lower_cue_line
The region borderer by the lower cue line.


ra_ghost

private java.awt.Rectangle ra_ghost
The region covered by the drag ghost icon.


upper_cue_line

private java.awt.Rectangle upper_cue_line
The region borderer by the upper cue line.


name

private java.lang.String name
The identifying name of this Tree.


previous_path

private javax.swing.tree.TreePath previous_path
The last tree path the drag was hovered over.


NO_DRAG_CURSOR

private static java.awt.Cursor NO_DRAG_CURSOR

TRANSPARENT_COLOR

private static final java.awt.Color TRANSPARENT_COLOR

AUTOSCROLL_MARGIN

private static final int AUTOSCROLL_MARGIN
The distance from the edge of the current view within the scroll bar which if entered causes the view to scroll.

See Also:
Constant Field Values

LIBRARY_CONTENTS_CHANGED

public static int LIBRARY_CONTENTS_CHANGED

LOADED_COLLECTION_CHANGED

public static int LOADED_COLLECTION_CHANGED

COLLECTION_CONTENTS_CHANGED

public static int COLLECTION_CONTENTS_CHANGED

TREE_DISPLAY_CHANGED

public static int TREE_DISPLAY_CHANGED
Constructor Detail

DragTree

public DragTree(java.lang.String name,
                java.lang.String background_name,
                boolean mixed_selection)

DragTree

public DragTree(java.lang.String name,
                javax.swing.tree.TreeModel model,
                java.lang.String background_name,
                boolean mixed_selection)
Method Detail

init

public void init(java.lang.String name,
                 java.lang.String background_name,
                 boolean mixed_selection)

autoscroll

public void autoscroll(java.awt.Point pt)
Description copied from interface: java.awt.dnd.Autoscroll
Notify the Component to autoscroll

Specified by:
autoscroll in interface java.awt.dnd.Autoscroll

clearGhost

public void clearGhost()
In order for the appearance to be consistant, given we may be in the situation where the pointer has left our focus but the ghost remains, this method allows other members of the GGroup to tell this component to clear its ghost.

Specified by:
clearGhost in interface org.greenstone.gatherer.util.DragComponent

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
Any implementation of DragSourceListener must include this method so we can be notified when the drag event ends (somewhere else), which will in turn remove actions.

Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent event)
Any implementation of DragSourceListener must include this method so we can be notified when the drag focus enters this component.

Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent event)
Any implementation of DropTargetListener must include this method so we can be notified when the drag focus enters this component, which in this case is to grab focus from within our group.

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent event)
Any implementation of DragSourceListener must include this method so we can be notified when the drag focus leaves this component.

Specified by:
dragExit in interface java.awt.dnd.DragSourceListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent event)
Any implementation of DropTargetListener must include this method so we can be notified when the drag focus leaves this component.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
Any implementation of DragGestureListener must include this method so we can be notified when a drag action has been noticed, thus a drag action has begun.

Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent event)
Implementation side-effect.

Specified by:
dragOver in interface java.awt.dnd.DragSourceListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent event)
Any implementation of DropTargetListener must include this method so we can be notified when the drag moves in this component.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

drop

public void drop(java.awt.dnd.DropTargetDropEvent event)
Any implementation of DropTargetListener must include this method so we can be notified when the drag ends, ie the transferable is dropped.

Specified by:
drop in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
Any implementation of DragSourceListener must include this method so we can be notified when the action to be taken upon drop changes.

Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
Any implementation of DropTargetListener must include this method so we can be notified when the action to be taken upon drop changes.

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

gainFocus

public void gainFocus()
Used to notify this component that it has gained focus. It should make some effort to inform the user of this.

Specified by:
gainFocus in interface org.greenstone.gatherer.util.DragComponent

getAutoscrollInsets

public java.awt.Insets getAutoscrollInsets()
Autoscroll Interface... The following code was borrowed from the book: Java Swing By Robert Eckstein, Marc Loy & Dave Wood Paperback - 1221 pages 1 Ed edition (September 1998) O'Reilly & Associates; ISBN: 156592455X The relevant chapter of which can be found at: http://www.oreilly.com/catalog/jswing/chapter/dnd.beta.pdf Calculate the insets for the *JTREE*, not the viewport the tree is in. This makes it a bit messy.

Specified by:
getAutoscrollInsets in interface java.awt.dnd.Autoscroll

getSelectionDetails

public java.lang.String getSelectionDetails()

getTreeModel

public org.greenstone.gatherer.file.FileSystemModel getTreeModel()
Description copied from interface: org.greenstone.gatherer.util.DragComponent
Retrieve the model associated with this component.

Specified by:
getTreeModel in interface org.greenstone.gatherer.util.DragComponent

loseFocus

public void loseFocus()
This method is used to inform this component when it loses focus, and should indicate this somehow.

Specified by:
loseFocus in interface org.greenstone.gatherer.util.DragComponent

mapDirectory

public void mapDirectory(java.io.File file,
                         java.lang.String title)

paint

public void paint(java.awt.Graphics g)
Description copied from class: javax.swing.JComponent

Paint the component. This is a delicate process, and should only be called from the repaint thread, under control of the javax.swing.RepaintManager. Client code should usually call Component.repaint()>Component.repaint() 55 to trigger painting.

The body of the paint call involves calling JComponent.paintComponent(java.awt.Graphics)>JComponent.paintComponent(java.awt.Graphics) 55 , JComponent.paintBorder(java.awt.Graphics)>JComponent.paintBorder(java.awt.Graphics) 55 , and JComponent.paintChildren(java.awt.Graphics)>JComponent.paintChildren(java.awt.Graphics) 55 in order. If you want to customize painting behavior, you should override one of these methods rather than paint.

For more details on the painting sequence, see this article.


refresh

public void refresh(javax.swing.tree.TreePath path)

setBackgroundNonSelectionColor

public void setBackgroundNonSelectionColor(java.awt.Color color)

setBackgroundSelectionColor

public void setBackgroundSelectionColor(java.awt.Color color)

setEnabled

public void setEnabled(boolean state)
Override the normal setEnabled so the Tree exhibits a little more change, which in this instance is the background colour changing.


setGroup

public void setGroup(org.greenstone.gatherer.util.DragGroup group)
Description copied from interface: org.greenstone.gatherer.util.DragComponent
Set the components group.

Specified by:
setGroup in interface org.greenstone.gatherer.util.DragComponent

setImmediate

public void setImmediate(boolean state)
Determines whether the following selection attempts should go through the normal delayed selection model, or should happen immediately.


setModel

public void setModel(javax.swing.tree.TreeModel model)
Description copied from class: javax.swing.JTree
Sets the model to use in JTree.


setSelection

public void setSelection(java.io.File file)
Ensure that that file node denoted by the given file is selected.


setTextNonSelectionColor

public void setTextNonSelectionColor(java.awt.Color color)

setTextSelectionColor

public void setTextSelectionColor(java.awt.Color color)

toString

public java.lang.String toString()
Description copied from class: java.awt.Component
Returns a string representation of this component. This is implemented as getClass().getName() + '[' + paramString() + ']'.


valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent event)
Description copied from interface: javax.swing.event.TreeSelectionListener
Value changed

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

isValidDrag

private boolean isValidDrag()
returns false for dummy nodes (ones without files), and system root nodes


isValidDrop

private boolean isValidDrop(javax.swing.tree.TreePath target_path)