Java 2 Platform
v1.3

edu.umich.visualsoar.datamap
Class DataMapTree

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JTree
                          |
                          +--edu.umich.visualsoar.datamap.DataMapTree
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.datatransfer.ClipboardOwner, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class DataMapTree
extends javax.swing.JTree
implements java.awt.datatransfer.ClipboardOwner

A class to implement the behavior of the DataMap

See Also:
Serialized Form

Nested Class Summary
(package private)  class DataMapTree.CopyAction
           
(package private)  class DataMapTree.DMTDragGestureListener
           
(package private)  class DataMapTree.DMTDragSourceListener
           
(package private)  class DataMapTree.DMTDropTargetListener
           
(package private)  class DataMapTree.PasteAction
           
(package private)  class DataMapTree.RemoveInvalidAction
           
(package private)  class DataMapTree.ValidateDataMapAction
           
 
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 javax.swing.JMenuItem AddEnumerationItem
           
private static javax.swing.JMenuItem AddFloatItem
           
private static javax.swing.JMenuItem AddIdentifierItem
           
private static javax.swing.JMenuItem AddIntegerItem
           
private static javax.swing.JMenuItem AddStringItem
           
private static javax.swing.JMenuItem ChangeToEnumerationItem
           
private static javax.swing.JMenuItem ChangeToFloatItem
           
private static javax.swing.JMenuItem ChangeToIdentifierItem
           
private static javax.swing.JMenuItem ChangeToIntegerItem
           
private static javax.swing.JMenuItem ChangeToStringItem
           
private static javax.swing.JMenu ChangeTypeSubMenu
           
static java.awt.datatransfer.Clipboard clipboard
           
private static javax.swing.JPopupMenu contextMenu
           
 javax.swing.Action copyAction
           
static edu.umich.visualsoar.graph.NamedEdge cutEdge
           
(package private)  java.awt.dnd.DragGestureListener dgListener
          Reference to the DragGestureListener for Drag and Drop operations, may be deleted in future.
private  java.awt.dnd.DropTarget dropTarget
          Reference to the DropTarget for Drag and Drop operations, may be deleted in future.
(package private)  java.awt.dnd.DropTargetListener dtListener
          Reference to the DropTargetListener for Drag and Drop operations, may be deleted in future.
private static javax.swing.JMenuItem EditCommentItem
           
private static javax.swing.JMenuItem EditValueItem
           
 javax.swing.Action pasteAction
           
private static javax.swing.JMenuItem RemoveAttributeItem
           
private static javax.swing.JMenuItem RemoveCommentItem
           
 javax.swing.Action removeInvalidAction
           
private static javax.swing.JMenuItem RenameAttributeItem
           
private  edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm
           
private static javax.swing.JMenuItem ValidateAllItem
           
 javax.swing.Action validateDataMapAction
           
private static javax.swing.JMenuItem ValidateEntryItem
           
 
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
DataMapTree(javax.swing.tree.TreeModel model, edu.umich.visualsoar.datamap.SoarWorkingMemoryModel _swmm)
          The lone constructor.
 
Method Summary
 void addEnumeration()
          Add a Soar Enumeration Attribute to the datamap
 void addFloat()
          Add a Soar Float Attribute to the datamap
 void addIdentifier()
          Add a Soar Identifier Attribute to the dataMap
 void addInteger()
          Add a Soar Integer Attribute to the datamap
 void addString()
          Add a Soar String Attribute to the Datamap
 void changeTypeTo(int type)
          Function changeTypeTo() changes the selected DataMap item to another type with the same name.
private  void copy()
          Copies a piece of the datamap to the clipboard
 void editComment()
          This allows the user to add a comment to an edge on the datamap.
 void editValue()
          Can change the values for an enumeration or number attribute
 void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable t)
           
private  void paste()
          Paste a portion of the datamap from the clipboard
 void removeComment()
          This removes a comment from an edge on the datamap.
 void removeEdge()
          Removes an attribute from the datamap
 void removeInvalid()
          Deletes all invalid datamap entries from the datamap
 void renameEdge()
          Attempts to rename an attribute on the datamap
 void suggestShowContextMenu(int x, int y)
          Checks to see if x,y is a valid location on the screen, if it is then it displays the context menu there.
 void validateAll()
          Similar to validateEntry(), but this function validates not only the selected node, but all of that nodes children.
 void validateDataMap()
          Validates the entire datamap
 void validateEntry()
          This function validates the selected node of the datamap, meaning that it makes a single node generated by the datamap generater a valid node and restores its original color.
 
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, getToolTipText, 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, setModel, 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, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clipboard

public static java.awt.datatransfer.Clipboard clipboard

cutEdge

public static edu.umich.visualsoar.graph.NamedEdge cutEdge

copyAction

public javax.swing.Action copyAction

pasteAction

public javax.swing.Action pasteAction

validateDataMapAction

public javax.swing.Action validateDataMapAction

removeInvalidAction

public javax.swing.Action removeInvalidAction

swmm

private edu.umich.visualsoar.datamap.SoarWorkingMemoryModel swmm

contextMenu

private static javax.swing.JPopupMenu contextMenu

AddIdentifierItem

private static javax.swing.JMenuItem AddIdentifierItem

AddEnumerationItem

private static javax.swing.JMenuItem AddEnumerationItem

AddIntegerItem

private static javax.swing.JMenuItem AddIntegerItem

AddFloatItem

private static javax.swing.JMenuItem AddFloatItem

AddStringItem

private static javax.swing.JMenuItem AddStringItem

RemoveAttributeItem

private static javax.swing.JMenuItem RemoveAttributeItem

RenameAttributeItem

private static javax.swing.JMenuItem RenameAttributeItem

EditValueItem

private static javax.swing.JMenuItem EditValueItem

EditCommentItem

private static javax.swing.JMenuItem EditCommentItem

RemoveCommentItem

private static javax.swing.JMenuItem RemoveCommentItem

ValidateEntryItem

private static javax.swing.JMenuItem ValidateEntryItem

ValidateAllItem

private static javax.swing.JMenuItem ValidateAllItem

ChangeTypeSubMenu

private static javax.swing.JMenu ChangeTypeSubMenu

ChangeToIdentifierItem

private static javax.swing.JMenuItem ChangeToIdentifierItem

ChangeToEnumerationItem

private static javax.swing.JMenuItem ChangeToEnumerationItem

ChangeToIntegerItem

private static javax.swing.JMenuItem ChangeToIntegerItem

ChangeToFloatItem

private static javax.swing.JMenuItem ChangeToFloatItem

ChangeToStringItem

private static javax.swing.JMenuItem ChangeToStringItem

dgListener

java.awt.dnd.DragGestureListener dgListener
Reference to the DragGestureListener for Drag and Drop operations, may be deleted in future.


dtListener

java.awt.dnd.DropTargetListener dtListener
Reference to the DropTargetListener for Drag and Drop operations, may be deleted in future.


dropTarget

private java.awt.dnd.DropTarget dropTarget
Reference to the DropTarget for Drag and Drop operations, may be deleted in future.

Constructor Detail

DataMapTree

public DataMapTree(javax.swing.tree.TreeModel model,
                   edu.umich.visualsoar.datamap.SoarWorkingMemoryModel _swmm)
The lone constructor. Creating new DataMaps and reading in saved DataMaps are the same operation, so there is only one constructor. This constructor sets some data fields as well as specifying the custom cell renderer for italicizing links and add the mouse adapter for right-clicking.

Parameters:
model - the model which specifies the contents of the tree.
See Also:
VSTreeCellRenderer
Method Detail

suggestShowContextMenu

public void suggestShowContextMenu(int x,
                                   int y)
Checks to see if x,y is a valid location on the screen, if it is then it displays the context menu there.

Parameters:
x - the x coordinate of the screen
y - the y coordinate of the screen

addIdentifier

public void addIdentifier()
Add a Soar Identifier Attribute to the dataMap

See Also:
IdentifierDialog

addEnumeration

public void addEnumeration()
Add a Soar Enumeration Attribute to the datamap

See Also:
EnumerationDialog

addInteger

public void addInteger()
Add a Soar Integer Attribute to the datamap

See Also:
NumberDialog

addFloat

public void addFloat()
Add a Soar Float Attribute to the datamap

See Also:
NumberDialog

addString

public void addString()
Add a Soar String Attribute to the Datamap


changeTypeTo

public void changeTypeTo(int type)
Function changeTypeTo() changes the selected DataMap item to another type with the same name. Function takes in an integer representing which type to change to

Parameters:
type - determines what to change it too, 0=identifier, 1=enumeration, 2=integer, 3=float, 4=string

removeEdge

public void removeEdge()
Removes an attribute from the datamap


lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable t)
Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner

renameEdge

public void renameEdge()
Attempts to rename an attribute on the datamap


copy

private void copy()
Copies a piece of the datamap to the clipboard


paste

private void paste()
Paste a portion of the datamap from the clipboard


editValue

public void editValue()
Can change the values for an enumeration or number attribute


editComment

public void editComment()
This allows the user to add a comment to an edge on the datamap. This comment has no bearing on working memory, only to allow the user to comment their datamap.

See Also:
CommentDialog

removeComment

public void removeComment()
This removes a comment from an edge on the datamap.


validateEntry

public void validateEntry()
This function validates the selected node of the datamap, meaning that it makes a single node generated by the datamap generater a valid node and restores its original color.


validateAll

public void validateAll()
Similar to validateEntry(), but this function validates not only the selected node, but all of that nodes children.


validateDataMap

public void validateDataMap()
Validates the entire datamap


removeInvalid

public void removeInvalid()
Deletes all invalid datamap entries from the datamap


Java 2 Platform
v1.3