com.jaxfront.swing.ui.editor
Class NavigationTree

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTree
                  extended by com.jaxfront.swing.ui.editor.NavigationTree
All Implemented Interfaces:
DOMChangeListener, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.PopupMenuListener, javax.swing.Scrollable

public class NavigationTree
extends javax.swing.JTree
implements DOMChangeListener, java.beans.PropertyChangeListener, java.awt.event.ActionListener, javax.swing.event.PopupMenuListener

A NavigationTree is a tree that display the jaxfront types.

Version:
1.60
See Also:
FileFilter, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTree
javax.swing.JTree.DynamicUtilTreeNode
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String ADD_NODE
           
static java.lang.String ADD_RECURSIVE_NODE
           
static java.lang.String COLLAPSE_NODE
           
static java.lang.String COPY_CONTENT
           
static java.lang.String COPY_NODE
           
static java.lang.String COPY_NODES
           
static java.lang.String NODE_NAME_PROPERTY
           
static java.lang.String PASTE_CONTENT
           
static java.lang.String REMOVE_NODE
           
static java.lang.String REMOVE_NODES
           
static java.lang.String SORT_ASC
           
static java.lang.String SORT_DES
           
 
Fields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, LARGE_MODEL_PROPERTY, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, ROW_HEIGHT_PROPERTY, SCROLLS_ON_EXPAND_PROPERTY, SELECTION_MODEL_PROPERTY, SHOWS_ROOT_HANDLES_PROPERTY, TOGGLE_CLICK_COUNT_PROPERTY, TREE_MODEL_PROPERTY, VISIBLE_ROW_COUNT_PROPERTY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
NavigationTree(AbstractEditorPanel editor, java.util.List treeTypes)
          Creates an instance of DocumentNavigationTree with the specified types
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an action occurs.
 void addSelectionPath(javax.swing.tree.TreePath path)
           
 void collapsePath(javax.swing.tree.TreePath path)
           
 void domChanged(DOMChangeEvent event)
          Respond method for a DOM state changed (DOMChangeEvent).
 void doPaste()
           
 Document getDOM()
          Returns the jaxfront DOM that is visualised in the tree
 AbstractEditorPanel getEditor()
           
 TreeNode getNode(Type type)
          Returns the TreeNode from the tree with the specified type
 javax.swing.tree.TreeCellRenderer getRenderer()
           
 Type getRootType()
          Returns the root type that is visualized in the tree
 java.lang.String getSelectedXPath()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
 javax.swing.tree.DefaultMutableTreeNode getTreeNode(Type type)
           
 boolean isMultiSelectOperation()
           
 void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
          This method is called when the popup menu is cancelled
 void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
          This method is called before the popup menu becomes invisible Note that a JPopupMenu can become invisible any time
 void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
          This method is called before the popup menu becomes visible
 void processMouseEvent(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void release()
          Releases all cached data and initialize all global variables of this class.
 void setMultiSelectOperation(boolean multi)
           
 void sortListElements(ListType selectedList, int direction)
           
 void sortListElements(TreeNode selectedNode, int direction)
           
 void stopAllCellEditing()
           
 
Methods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, collapseRow, convertValueToText, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDragEnabled, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, 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, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setEditable, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD_NODE

public static final java.lang.String ADD_NODE
See Also:
Constant Field Values

COPY_NODE

public static final java.lang.String COPY_NODE
See Also:
Constant Field Values

COPY_NODES

public static final java.lang.String COPY_NODES
See Also:
Constant Field Values

SORT_ASC

public static final java.lang.String SORT_ASC
See Also:
Constant Field Values

SORT_DES

public static final java.lang.String SORT_DES
See Also:
Constant Field Values

ADD_RECURSIVE_NODE

public static final java.lang.String ADD_RECURSIVE_NODE
See Also:
Constant Field Values

REMOVE_NODE

public static final java.lang.String REMOVE_NODE
See Also:
Constant Field Values

REMOVE_NODES

public static final java.lang.String REMOVE_NODES
See Also:
Constant Field Values

COLLAPSE_NODE

public static final java.lang.String COLLAPSE_NODE
See Also:
Constant Field Values

COPY_CONTENT

public static final java.lang.String COPY_CONTENT
See Also:
Constant Field Values

PASTE_CONTENT

public static final java.lang.String PASTE_CONTENT
See Also:
Constant Field Values

NODE_NAME_PROPERTY

public static final java.lang.String NODE_NAME_PROPERTY
See Also:
Constant Field Values
Constructor Detail

NavigationTree

public NavigationTree(AbstractEditorPanel editor,
                      java.util.List treeTypes)
Creates an instance of DocumentNavigationTree with the specified types

Parameters:
editor - the AbstractEditorPanel which holds this class
treeTypes - a list of types that should be visualised
showAll - if true all nodes in the tree would be showed
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an action event that occured

doPaste

public void doPaste()

sortListElements

public void sortListElements(TreeNode selectedNode,
                             int direction)

sortListElements

public void sortListElements(ListType selectedList,
                             int direction)

collapsePath

public void collapsePath(javax.swing.tree.TreePath path)
Overrides:
collapsePath in class javax.swing.JTree

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
Overrides:
getToolTipText in class javax.swing.JTree
See Also:
JComponent.getToolTipText(java.awt.event.MouseEvent)

domChanged

public void domChanged(DOMChangeEvent event)
Respond method for a DOM state changed (DOMChangeEvent).

Specified by:
domChanged in interface DOMChangeListener
Parameters:
event - occured DOMChangeEvent

getTreeNode

public javax.swing.tree.DefaultMutableTreeNode getTreeNode(Type type)

getDOM

public Document getDOM()
Returns the jaxfront DOM that is visualised in the tree

Returns:
the jaxfront DOM

getNode

public TreeNode getNode(Type type)
Returns the TreeNode from the tree with the specified type

Returns:
the TreeNode with the specified type

getRootType

public Type getRootType()
Returns the root type that is visualized in the tree

Returns:
the root type

popupMenuCanceled

public void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
This method is called when the popup menu is cancelled

Specified by:
popupMenuCanceled in interface javax.swing.event.PopupMenuListener
Parameters:
e - a popupMenuEvent that occured

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
This method is called before the popup menu becomes invisible Note that a JPopupMenu can become invisible any time

Specified by:
popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener
Parameters:
e - a popupMenuEvent that occured

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
This method is called before the popup menu becomes visible

Specified by:
popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener
Parameters:
e - a popupMenuEvent that occured

processMouseEvent

public void processMouseEvent(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Overrides:
processMouseEvent in class javax.swing.JComponent
Parameters:
e - a mouseEvent that occured

release

public void release()
Releases all cached data and initialize all global variables of this class.


getRenderer

public javax.swing.tree.TreeCellRenderer getRenderer()

propertyChange

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

addSelectionPath

public void addSelectionPath(javax.swing.tree.TreePath path)
Overrides:
addSelectionPath in class javax.swing.JTree

isMultiSelectOperation

public boolean isMultiSelectOperation()

setMultiSelectOperation

public void setMultiSelectOperation(boolean multi)

stopAllCellEditing

public void stopAllCellEditing()

getEditor

public AbstractEditorPanel getEditor()

getSelectedXPath

public java.lang.String getSelectedXPath()