jaxx.runtime.swing.navigation
Class AbstractNavigationModel<E extends NavigationNode<E>>

java.lang.Object
  extended by jaxx.runtime.swing.navigation.AbstractNavigationModel<E>
Type Parameters:
E - the type of nodes in model
All Implemented Interfaces:
NavigationModel<E>
Direct Known Subclasses:
NavigationTreeModel, NavigationTreeTableModel

Deprecated. since 2.1, prefer use the simplify api jaxx.runtime.swing.tree.

@Deprecated
public abstract class AbstractNavigationModel<E extends NavigationNode<E>>
extends Object
implements NavigationModel<E>

Model of the tree used for a navigation tree. It is composed of E nodes.

Since:
2.0.1
Author:
letellier

Field Summary
protected  boolean adjustingValue
          Deprecated. if sets to true will not fires any event (this is a convinient state when we are building the tree to avoid reload of nodes)
protected  TreeModel delegate
          Deprecated. the delegate model
protected  String pathSeparator
          Deprecated. The path separator used to build the NavigationNode.getFullPath().
 
Constructor Summary
AbstractNavigationModel(TreeModel delegate, String pathSeparator, JAXXContext context)
          Deprecated.  
 
Method Summary
 void addTreeModelListener(TreeModelListener l)
          Deprecated. Adds a listener for the TreeModelEvent posted after the tree changes.
 E findNode(E root, String path)
          Deprecated. Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().
 E findNode(E root, String path, Pattern regex)
          Deprecated. Apply first the regex pattern to obtain the searched node.
 E findNode(E root, String path, String regex)
          Deprecated. Apply first the regex pattern to obtain the searched node.
 E findNode(String path)
          Deprecated. Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by dot.
 E findNode(String path, Pattern regex)
          Deprecated. Apply first the regex pattern to obtain the searched node.
 E findNode(String path, String regex)
          Deprecated. Apply first the regex pattern to obtain the searched node fi the given regex is not null.
 Object getBean(E node)
          Deprecated. Obtain the associated bean value from context corresponding to node
 Object getBean(String navigationPath)
          Deprecated. Obtain the associated bean value from context corresponding to node from given navigation path.
 Object getChild(Object parent, int index)
          Deprecated. Returns the child of parent at index index in the parent's child array.
 int getChildCount(Object parent)
          Deprecated. Returns the number of children of parent.
 JAXXContext getContext()
          Deprecated.  
 TreeModel getDelegate()
          Deprecated.  
 int getIndexOfChild(Object parent, Object child)
          Deprecated. Returns the index of child in parent.
 String getPathSeparator()
          Deprecated.  
 E getRoot()
          Deprecated.  
 boolean isAdjustingValue()
          Deprecated.  
 boolean isLeaf(Object node)
          Deprecated. Returns true if node is a leaf.
 void nodeChanged(E node)
          Deprecated.  
protected  void reload(E node)
          Deprecated.  
protected  void reload(E node, boolean deep)
          Deprecated.  
 void removeTreeModelListener(TreeModelListener l)
          Deprecated. Removes a listener previously added with addTreeModelListener.
 void setAdjustingValue(boolean adjustingValue)
          Deprecated. Sets the new internal state adjustingValue.
 void valueForPathChanged(TreePath path, Object newValue)
          Deprecated. Messaged when the user has altered the value for the item identified by path to newValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jaxx.runtime.swing.navigation.NavigationModel
getPathToRoot, nodeChanged, nodeStructureChanged, removeNodeFromParent, setRoot
 

Field Detail

delegate

protected final TreeModel delegate
Deprecated. 
the delegate model


pathSeparator

protected final String pathSeparator
Deprecated. 
The path separator used to build the NavigationNode.getFullPath().

See Also:
NavigationNode.getNodePath(), NavigationNode.getFullPath()

adjustingValue

protected boolean adjustingValue
Deprecated. 
if sets to true will not fires any event (this is a convinient state when we are building the tree to avoid reload of nodes)

Constructor Detail

AbstractNavigationModel

public AbstractNavigationModel(TreeModel delegate,
                               String pathSeparator,
                               JAXXContext context)
Deprecated. 
Method Detail

isAdjustingValue

public boolean isAdjustingValue()
Deprecated. 
Specified by:
isAdjustingValue in interface NavigationModel<E extends NavigationNode<E>>
Returns:
true if no event should be fired

setAdjustingValue

public void setAdjustingValue(boolean adjustingValue)
Deprecated. 
Description copied from interface: NavigationModel
Sets the new internal state adjustingValue. If the value is true, no more event will be fired, otherwise will not block events firing.

Specified by:
setAdjustingValue in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
adjustingValue - the new value of valueAdjusting state

getContext

public JAXXContext getContext()
Deprecated. 
Specified by:
getContext in interface NavigationModel<E extends NavigationNode<E>>

getDelegate

public TreeModel getDelegate()
Deprecated. 

getPathSeparator

public final String getPathSeparator()
Deprecated. 
Specified by:
getPathSeparator in interface NavigationModel<E extends NavigationNode<E>>

getRoot

public final E getRoot()
Deprecated. 
Specified by:
getRoot in interface NavigationModel<E extends NavigationNode<E>>

getBean

public final Object getBean(String navigationPath)
Deprecated. 
Description copied from interface: NavigationModel
Obtain the associated bean value from context corresponding to node from given navigation path.

Specified by:
getBean in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
navigationPath - the current context path of the node
Returns:
the value associated in context with the given navigation path

getBean

public final Object getBean(E node)
Deprecated. 
Description copied from interface: NavigationModel
Obtain the associated bean value from context corresponding to node

Specified by:
getBean in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
node - the current node
Returns:
the value associated in context with the given node.

findNode

public final E findNode(String path)
Deprecated. 
Description copied from interface: NavigationModel
Search from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by dot.

Example :

$root.child1.leaf1

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
path - the fully path of the searched node.
Returns:
the node matching the fully context from the root node, or null if not find.

findNode

public final E findNode(String path,
                        String regex)
Deprecated. 
Description copied from interface: NavigationModel
Apply first the regex pattern to obtain the searched node fi the given regex is not null.

Search then from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Example :

$root.child1.leaf1

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
path - the fully path of the searched node.
regex - a optional regex to apply to path before searching
Returns:
the node matching the fully context from the root node, or null if not found.

findNode

public final E findNode(String path,
                        Pattern regex)
Deprecated. 
Description copied from interface: NavigationModel
Apply first the regex pattern to obtain the searched node.

Search then from the root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Example :

$root.child1.leaf1

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
path - the fully path of the searched node.
regex - a optional regex to apply to path before searching
Returns:
the node matching the fully context from the root node, or null if not found.

findNode

public final E findNode(E root,
                        String path)
Deprecated. 
Description copied from interface: NavigationModel
Search from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
root - root node to be used
path - the fully path of the searched node.
Returns:
the node matching the fully context from the given root node, or null if not found.

findNode

public final E findNode(E root,
                        String path,
                        String regex)
Deprecated. 
Description copied from interface: NavigationModel
Apply first the regex pattern to obtain the searched node.

Search then from a given root node a node named by his fully path (concatenation of nodes) NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
root - root node to be used
path - the fully path of the searched node.
regex - a previous regex to apply to path : must have a matches
Returns:
the node matching the fully context from the given root node, or null if not found.

findNode

public final E findNode(E root,
                        String path,
                        Pattern regex)
Deprecated. 
Description copied from interface: NavigationModel
Apply first the regex pattern to obtain the searched node.

Search then from a given root node a node named by his fully path (concatenation of nodes NavigationTreeNode.path valued separated by NavigationModel.getPathSeparator().

Specified by:
findNode in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
root - root node to be used
path - the fully path of the searched node.
regex - a previous regex to apply to path : must have a matches
Returns:
the node matching the fully context from the given root node, or null if not found.

nodeChanged

public final void nodeChanged(E node)
Deprecated. 
Specified by:
nodeChanged in interface NavigationModel<E extends NavigationNode<E>>

reload

protected final void reload(E node)
Deprecated. 

reload

protected final void reload(E node,
                            boolean deep)
Deprecated. 

getChild

public final Object getChild(Object parent,
                             int index)
Deprecated. 
Description copied from interface: NavigationModel
Returns the child of parent at index index in the parent's child array. parent must be a node previously obtained from this data source. This should not return null if index is a valid index for parent (that is index >= 0 && index < getChildCount(parent)).

Specified by:
getChild in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
parent - a node in the tree, obtained from this data source
index - index of the node
Returns:
the child of parent at index index

getChildCount

public final int getChildCount(Object parent)
Deprecated. 
Description copied from interface: NavigationModel
Returns the number of children of parent. Returns 0 if the node is a leaf or if it has no children. parent must be a node previously obtained from this data source.

Specified by:
getChildCount in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
parent - a node in the tree, obtained from this data source
Returns:
the number of children of the node parent

isLeaf

public final boolean isLeaf(Object node)
Deprecated. 
Description copied from interface: NavigationModel
Returns true if node is a leaf. It is possible for this method to return false even if node has no children. A directory in a filesystem, for example, may contain no files; the node representing the directory is not a leaf, but it also has no children.

Specified by:
isLeaf in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
node - a node in the tree, obtained from this data source
Returns:
true if node is a leaf

valueForPathChanged

public final void valueForPathChanged(TreePath path,
                                      Object newValue)
Deprecated. 
Description copied from interface: NavigationModel
Messaged when the user has altered the value for the item identified by path to newValue. If newValue signifies a truly new value the model should post a treeNodesChanged event.

Specified by:
valueForPathChanged in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
path - path to the node that the user has altered
newValue - the new value from the TreeCellEditor

getIndexOfChild

public final int getIndexOfChild(Object parent,
                                 Object child)
Deprecated. 
Description copied from interface: NavigationModel
Returns the index of child in parent. If either parent or child is null, returns -1. If either parent or child don't belong to this tree model, returns -1.

Specified by:
getIndexOfChild in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
parent - a node in the tree, obtained from this data source
child - the node we are interested in
Returns:
the index of the child in the parent, or -1 if either child or parent are null or don't belong to this tree model

addTreeModelListener

public final void addTreeModelListener(TreeModelListener l)
Deprecated. 
Description copied from interface: NavigationModel
Adds a listener for the TreeModelEvent posted after the tree changes.

Specified by:
addTreeModelListener in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
l - the listener to add
See Also:
NavigationModel.removeTreeModelListener(javax.swing.event.TreeModelListener)

removeTreeModelListener

public final void removeTreeModelListener(TreeModelListener l)
Deprecated. 
Description copied from interface: NavigationModel
Removes a listener previously added with addTreeModelListener.

Specified by:
removeTreeModelListener in interface NavigationModel<E extends NavigationNode<E>>
Parameters:
l - the listener to remove
See Also:
NavigationModel.addTreeModelListener(javax.swing.event.TreeModelListener)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.