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.TreeModelSwing Tree Model for Feature Structures.
-
-
Field Summary
Fields Modifier and Type Field Description private CASImplcasThe cas.private static java.lang.StringdefaultRootStringThe Constant defaultRootString.private java.util.List<FSNode>fssThe fss.private FSTreeNoderootThe root.private java.lang.StringrootStringThe root string.private java.util.List<javax.swing.event.TreeModelListener>treeModelListenersThe 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 voidaddTreeModelListener(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) CASImplgetCas()Gets the cas.java.lang.ObjectgetChild(java.lang.Object parent, int index)Gets the child.intgetChildCount(java.lang.Object parent)Gets the child count.java.util.List<FSNode>getFSs()Gets the f ss.intgetIndexOfChild(java.lang.Object parent, java.lang.Object child)Gets the index of child.(package private) intgetNodeType(Type type)Gets the node type.private voidgetPathToNode(int n, java.util.List<FSTreeNode> dtrs, java.util.List<FSTreeNode> path)Gets the path to node.java.lang.ObjectgetRoot()Gets the root.(package private) java.lang.StringgetRootString()Gets the root string.booleanisLeaf(java.lang.Object node)Checks if is leaf.javax.swing.tree.TreePathpathToNode(int fsNum)Path to node.voidremoveTreeModelListener(javax.swing.event.TreeModelListener arg0)Removes the tree model listener.voidreset()Reset.voidupdate(java.lang.String indexName, FSIndex index, CAS cas1)Update.voidvalueForPathChanged(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:
getRootin 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:
getChildin 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:
getChildCountin 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:
isLeafin 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:
valueForPathChangedin 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:
getIndexOfChildin 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:
addTreeModelListenerin 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:
removeTreeModelListenerin 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
-
-