VASSAL.configure
Class ConfigureTree

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JTree
                          |
                          +--VASSAL.configure.ConfigureTree
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, javax.swing.Scrollable, java.io.Serializable
Direct Known Subclasses:
ExtensionTree

public class ConfigureTree
extends javax.swing.JTree
implements java.beans.PropertyChangeListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This is the Configuration Tree that appears in the Configuration window when editing a VASSAL module. Each node in the tree structure is a Configurable object, whose child nodes are obtained via Configurable.getConfigureComponents()

See Also:
Serialized Form

Inner 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
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  javax.swing.tree.DefaultMutableTreeNode copyData
           
protected  javax.swing.tree.DefaultMutableTreeNode cutData
           
protected  HelpWindow helpWindow
           
static java.awt.Font POPUP_MENU_FONT
           
 
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.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
ConfigureTree(Configurable root, HelpWindow helpWindow)
          Creates new ConfigureTree
 
Method Summary
protected  void addAction(javax.swing.JPopupMenu menu, javax.swing.Action a)
           
protected  javax.swing.Action buildAddAction(Configurable target, java.lang.Class newConfig)
           
protected  java.util.Enumeration buildAddActions(Configurable target)
           
protected  javax.swing.Action buildCloneAction(Configurable target)
           
protected  javax.swing.Action buildCopyAction(Configurable target)
           
protected  javax.swing.Action buildCutAction(Configurable target)
           
protected  javax.swing.Action buildDeleteAction(Configurable target)
           
protected  javax.swing.Action buildEditAction(Configurable target)
           
protected  javax.swing.Action buildEditPiecesAction(Configurable target)
           
protected  javax.swing.Action buildHelpAction(Configurable target)
           
protected  javax.swing.Action buildImportAction(Configurable target)
           
protected  javax.swing.Action buildMoveAction(Configurable target)
           
protected  javax.swing.Action buildPasteAction(Configurable target)
           
protected  javax.swing.JPopupMenu buildPopupMenu(Configurable target)
           
protected  VASSAL.configure.ConfigureTree.Renderer buildRenderer()
           
protected  javax.swing.tree.DefaultMutableTreeNode buildTreeNode(Configurable c)
           
 boolean canContainGamePiece(Configurable target)
           
static java.lang.String getConfigureName(java.lang.Class c)
           
static java.lang.String getConfigureName(Configurable c)
           
protected  Configurable getParent(javax.swing.tree.DefaultMutableTreeNode targetNode)
           
protected  Configurable getTarget(int x, int y)
           
 javax.swing.tree.DefaultMutableTreeNode getTreeNode(Configurable target)
           
protected  Configurable importConfigurable()
           
protected  boolean insert(Configurable parent, Configurable child, int index)
           
protected  boolean isValidParent(Configurable parent, Configurable child)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
protected  boolean remove(Configurable parent, Configurable child)
           
 
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, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, 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, 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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyData

protected javax.swing.tree.DefaultMutableTreeNode copyData

cutData

protected javax.swing.tree.DefaultMutableTreeNode cutData

helpWindow

protected HelpWindow helpWindow

POPUP_MENU_FONT

public static java.awt.Font POPUP_MENU_FONT
Constructor Detail

ConfigureTree

public ConfigureTree(Configurable root,
                     HelpWindow helpWindow)
Creates new ConfigureTree
Method Detail

buildRenderer

protected VASSAL.configure.ConfigureTree.Renderer buildRenderer()

getTarget

protected Configurable getTarget(int x,
                                 int y)

buildTreeNode

protected javax.swing.tree.DefaultMutableTreeNode buildTreeNode(Configurable c)

addAction

protected void addAction(javax.swing.JPopupMenu menu,
                         javax.swing.Action a)

buildPopupMenu

protected javax.swing.JPopupMenu buildPopupMenu(Configurable target)

buildMoveAction

protected javax.swing.Action buildMoveAction(Configurable target)

buildCutAction

protected javax.swing.Action buildCutAction(Configurable target)

buildCopyAction

protected javax.swing.Action buildCopyAction(Configurable target)

buildPasteAction

protected javax.swing.Action buildPasteAction(Configurable target)

buildImportAction

protected javax.swing.Action buildImportAction(Configurable target)

buildAddActions

protected java.util.Enumeration buildAddActions(Configurable target)

buildAddAction

protected javax.swing.Action buildAddAction(Configurable target,
                                            java.lang.Class newConfig)

buildHelpAction

protected javax.swing.Action buildHelpAction(Configurable target)

buildCloneAction

protected javax.swing.Action buildCloneAction(Configurable target)

getParent

protected Configurable getParent(javax.swing.tree.DefaultMutableTreeNode targetNode)

buildDeleteAction

protected javax.swing.Action buildDeleteAction(Configurable target)

buildEditPiecesAction

protected javax.swing.Action buildEditPiecesAction(Configurable target)

buildEditAction

protected javax.swing.Action buildEditAction(Configurable target)

canContainGamePiece

public boolean canContainGamePiece(Configurable target)

remove

protected boolean remove(Configurable parent,
                         Configurable child)

insert

protected boolean insert(Configurable parent,
                         Configurable child,
                         int index)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

getConfigureName

public static java.lang.String getConfigureName(java.lang.Class c)

getConfigureName

public static java.lang.String getConfigureName(Configurable c)

importConfigurable

protected Configurable importConfigurable()

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

getTreeNode

public javax.swing.tree.DefaultMutableTreeNode getTreeNode(Configurable target)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

isValidParent

protected boolean isValidParent(Configurable parent,
                                Configurable child)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener