org.jurvis.swing.explorer
Class JvExplorer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JSplitPane
                  extended by org.jurvis.swing.JvSplitPane
                      extended by org.jurvis.swing.explorer.JvExplorer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, JvModifiable

public class JvExplorer
extends JvSplitPane
implements JvModifiable

A control modeled after the obligatory Windows Explorer-style interface. The control displays a set of hierarchial data as an outline in the left panel with the details of the currently selected data in the right panel. An JvExplorer maintains an active node and an active object. The active node is set when the user selects a node in the tree hierarchy. This action also sets the selected node as the active object too. The user may select a row or something in the details panel. This action sets the active object, but does not affect the active node.

Author:
Neil W. Weber
See Also:
JvExplorerModel, JvExplorerNode, JvExplorerDetails, Serialized Form

Nested Class Summary
protected  class JvExplorer.LocalSelectionListener
          A TreeSelectionListener that listens to selection changes in the explorer tree and makes the selected node the active node.
 
Nested classes/interfaces inherited from class javax.swing.JSplitPane
JSplitPane.AccessibleJSplitPane
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  PropertyChangeListener propertyChangeListener
          Our local property change listener.
protected  JvExplorerTree tree
          The JvExplorerTree displaying the data hierarchy.
protected  JScrollPane treeScrollPane
          The JScrollPane containing the JvExplorerTree.
 
Fields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLIT
 
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
JvExplorer(String name, JvExplorerTree tree, JvExplorerDetails details)
          Construct a JvExplorer with the given name.
 
Method Summary
 void addLeftComponent(JComponent component)
           
 void addRightComponent(JComponent component)
           
 void captureModifications(Preferences preferences)
          Save any modifications needing to be persisted across application invocations in preferences.
 JvExplorerNode getActiveNode()
          Return the active explorer node.
 Object getActiveObject()
          Return the active object.
 JvExplorerDetails getDetails()
          Return the node's details.
 JvExplorerModel getModel()
          Return the explorer's model.
 JvExplorerNode getSelectedNode()
          Return the selected explorer node.
 JvExplorerTree getTree()
          Return the explorer's tree.
 void loadModifications(Preferences preferences)
          Load any modifications that were persisted in the previous application invocation from preferences.
 void removeLeftComponent(JComponent component)
           
 void removeRightComponent(JComponent component)
           
 void setActiveNode(JvExplorerNode activeNode)
          Set the active node in the JvExplorer.
 void setActiveObject(Object activeObject)
          Set the active object in the JvExplorer.
 void setDetails(JvExplorerDetails details)
          Set the details panel to be displayed for this explorer.
 void startEditingNode(JvExplorerNode node)
          Selects the node identified by the specified node and initiates editing.
 
Methods inherited from class org.jurvis.swing.JvSplitPane
updateUI
 
Methods inherited from class javax.swing.JSplitPane
addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, setUI
 
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, 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, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, 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, 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, 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

tree

protected JvExplorerTree tree
The JvExplorerTree displaying the data hierarchy.


treeScrollPane

protected JScrollPane treeScrollPane
The JScrollPane containing the JvExplorerTree.


propertyChangeListener

protected PropertyChangeListener propertyChangeListener
Our local property change listener.

Constructor Detail

JvExplorer

public JvExplorer(String name,
                  JvExplorerTree tree,
                  JvExplorerDetails details)
Construct a JvExplorer with the given name.

Method Detail

getModel

public JvExplorerModel getModel()
Return the explorer's model.

Returns:
the explorer's model

getTree

public JvExplorerTree getTree()
Return the explorer's tree.

Returns:
the explorer's tree

addLeftComponent

public void addLeftComponent(JComponent component)

removeLeftComponent

public void removeLeftComponent(JComponent component)

addRightComponent

public void addRightComponent(JComponent component)

removeRightComponent

public void removeRightComponent(JComponent component)

setActiveNode

public void setActiveNode(JvExplorerNode activeNode)
Set the active node in the JvExplorer. This method automatically updates the activeNode property of the JvExplorerTree and the current JvExplorerDetails component. This method automatically sets the active node to be the active object.

Parameters:
activeNode - the new active node

getActiveNode

public JvExplorerNode getActiveNode()
Return the active explorer node.

Returns:
the active explorer node

setActiveObject

public void setActiveObject(Object activeObject)
Set the active object in the JvExplorer. This method automatically updates the activeObject property of the current JvExplorerDetails component.

Parameters:
activeObject - the new active object

getActiveObject

public Object getActiveObject()
Return the active object.

Returns:
the active object

getSelectedNode

public JvExplorerNode getSelectedNode()
Return the selected explorer node.

Returns:
the selected explorer node

setDetails

public void setDetails(JvExplorerDetails details)
Set the details panel to be displayed for this explorer.

Parameters:
details - the node's details

getDetails

public JvExplorerDetails getDetails()
Return the node's details.

Returns:
the node's details

startEditingNode

public void startEditingNode(JvExplorerNode node)
Selects the node identified by the specified node and initiates editing.

Parameters:
node - the JvExplorerNode identifying the node to edit

captureModifications

public void captureModifications(Preferences preferences)
Save any modifications needing to be persisted across application invocations in preferences.

Specified by:
captureModifications in interface JvModifiable
Parameters:
preferences - the container holding the modifications

loadModifications

public void loadModifications(Preferences preferences)
Load any modifications that were persisted in the previous application invocation from preferences.

Specified by:
loadModifications in interface JvModifiable
Parameters:
preferences - the Preferences containing the application preferences


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.