Package org.apache.uima.tools.cvd
Class FSTreeModel
- java.lang.Object
-
- org.apache.uima.tools.cvd.FSTreeModel
-
- All Implemented Interfaces:
javax.swing.tree.TreeModel
public class FSTreeModel extends java.lang.Object implements javax.swing.tree.TreeModel
Swing Tree Model for Feature Structures.
-
-
Field Summary
Fields Modifier and Type Field Description private CASImpl
cas
The cas.private static java.lang.String
defaultRootString
The Constant defaultRootString.private java.util.List<FSNode>
fss
The fss.private FSTreeNode
root
The root.private java.lang.String
rootString
The root string.private java.util.List<javax.swing.event.TreeModelListener>
treeModelListeners
The tree model listeners.
-
Constructor Summary
Constructors Constructor Description FSTreeModel()
Constructor for FSTreeModel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeModelListener(javax.swing.event.TreeModelListener arg0)
Adds the tree model listener.(package private) static java.util.List<FSTreeNode>
createArrayChildren(int start, int end, java.util.List<FSNode> array, FSTreeModel model)
Creates the array children.(package private) CASImpl
getCas()
Gets the cas.java.lang.Object
getChild(java.lang.Object parent, int index)
Gets the child.int
getChildCount(java.lang.Object parent)
Gets the child count.java.util.List<FSNode>
getFSs()
Gets the f ss.int
getIndexOfChild(java.lang.Object parent, java.lang.Object child)
Gets the index of child.(package private) int
getNodeType(Type type)
Gets the node type.private void
getPathToNode(int n, java.util.List<FSTreeNode> dtrs, java.util.List<FSTreeNode> path)
Gets the path to node.java.lang.Object
getRoot()
Gets the root.(package private) java.lang.String
getRootString()
Gets the root string.boolean
isLeaf(java.lang.Object node)
Checks if is leaf.javax.swing.tree.TreePath
pathToNode(int fsNum)
Path to node.void
removeTreeModelListener(javax.swing.event.TreeModelListener arg0)
Removes the tree model listener.void
reset()
Reset.void
update(java.lang.String indexName, FSIndex index, CAS cas1)
Update.void
valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
Value for path changed.
-
-
-
Field Detail
-
root
private FSTreeNode root
The root.
-
cas
private CASImpl cas
The cas.
-
treeModelListeners
private java.util.List<javax.swing.event.TreeModelListener> treeModelListeners
The tree model listeners.
-
fss
private java.util.List<FSNode> fss
The fss.
-
defaultRootString
private static final java.lang.String defaultRootString
The Constant defaultRootString.- See Also:
- Constant Field Values
-
rootString
private java.lang.String rootString
The root string.
-
-
Method Detail
-
update
public void update(java.lang.String indexName, FSIndex index, CAS cas1)
Update.- Parameters:
indexName
- the index nameindex
- the indexcas1
- the cas 1
-
reset
public void reset()
Reset.
-
getFSs
public java.util.List<FSNode> getFSs()
Gets the f ss.- Returns:
- the f ss
-
getRoot
public java.lang.Object getRoot()
Gets the root.- Specified by:
getRoot
in interfacejavax.swing.tree.TreeModel
- Returns:
- the root
- See Also:
TreeModel.getRoot()
-
getChild
public java.lang.Object getChild(java.lang.Object parent, int index)
Gets the child.- Specified by:
getChild
in interfacejavax.swing.tree.TreeModel
- Parameters:
parent
- the parentindex
- the index- Returns:
- the child
- See Also:
TreeModel.getChild(java.lang.Object, int)
-
getNodeType
int getNodeType(Type type)
Gets the node type.- Parameters:
type
- the type- Returns:
- the node type
-
getChildCount
public int getChildCount(java.lang.Object parent)
Gets the child count.- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeModel
- Parameters:
parent
- the parent- Returns:
- the child count
- See Also:
TreeModel.getChildCount(java.lang.Object)
-
isLeaf
public boolean isLeaf(java.lang.Object node)
Checks if is leaf.- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeModel
- Parameters:
node
- the node- Returns:
- true, if is leaf
- See Also:
TreeModel.isLeaf(java.lang.Object)
-
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
Value for path changed.- Specified by:
valueForPathChanged
in interfacejavax.swing.tree.TreeModel
- Parameters:
path
- the pathnewValue
- the new value- See Also:
TreeModel.valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
-
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
Gets the index of child.- Specified by:
getIndexOfChild
in interfacejavax.swing.tree.TreeModel
- Parameters:
parent
- the parentchild
- the child- Returns:
- the index of child
- See Also:
TreeModel.getIndexOfChild(java.lang.Object, java.lang.Object)
-
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener arg0)
Adds the tree model listener.- Specified by:
addTreeModelListener
in interfacejavax.swing.tree.TreeModel
- Parameters:
arg0
- the arg 0- See Also:
TreeModel.addTreeModelListener(javax.swing.event.TreeModelListener)
-
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener arg0)
Removes the tree model listener.- Specified by:
removeTreeModelListener
in interfacejavax.swing.tree.TreeModel
- Parameters:
arg0
- the arg 0- See Also:
TreeModel.removeTreeModelListener(javax.swing.event.TreeModelListener)
-
getCas
CASImpl getCas()
Gets the cas.- Returns:
- CASImpl
-
getRootString
java.lang.String getRootString()
Gets the root string.- Returns:
- String
-
createArrayChildren
static java.util.List<FSTreeNode> createArrayChildren(int start, int end, java.util.List<FSNode> array, FSTreeModel model)
Creates the array children.- Parameters:
start
- the startend
- the endarray
- the arraymodel
- the model- Returns:
- the list
-
pathToNode
public javax.swing.tree.TreePath pathToNode(int fsNum)
Path to node.- Parameters:
fsNum
- the fs num- Returns:
- the tree path
-
getPathToNode
private void getPathToNode(int n, java.util.List<FSTreeNode> dtrs, java.util.List<FSTreeNode> path)
Gets the path to node.- Parameters:
n
- the ndtrs
- the dtrspath
- the path
-
-