|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.yale.gui.operatortree.OperatorTreeModel
public class OperatorTreeModel
A TreeModel hiding an operator (which itself already has a tree-like structure). Most of the method calls delegate to an operator. Events can be fired when operators are inserted or removed. Operator trees are the main experiment editor of the Yale GUI.
Field Summary | |
---|---|
private OperatorTree |
operatorTree
The operator tree. |
private Operator |
root
The root operator of the model (usually an experiment operator). |
private boolean |
showDisabledOperators
Indicates if disabled operators should be shown by the model (default: true). |
private java.util.List<javax.swing.event.TreeModelListener> |
treeModelListeners
The list of all tree model listeners. |
Constructor Summary | |
---|---|
OperatorTreeModel(Operator root,
OperatorTree tree)
Creates a new operator tree model. |
Method Summary | |
---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener l)
Adds a tree model listener. |
void |
fireOperatorChanged(java.lang.Object source,
javax.swing.tree.TreePath path)
Must be used to indicate that an operator was changed in some way. |
void |
fireOperatorInserted(java.lang.Object source,
javax.swing.tree.TreePath path,
int index,
Operator operator)
Must be used to indicate that a new operator was added. |
void |
fireOperatorRemoved(java.lang.Object source,
javax.swing.tree.TreePath path,
int index,
Operator operator)
Must be used to indicate that an operator was removed. |
void |
fireOperatorRenamed(java.lang.Object source,
javax.swing.tree.TreePath path)
Must be used to indicate that an operator was renamed. |
void |
fireStructureChanged(java.lang.Object source,
javax.swing.tree.TreePath path)
Must be used to indicate that the tree structure has changed. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child with the given index. |
int |
getChildCount(java.lang.Object parent)
Returns the number of children operators. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Returns the index of the child operator with respect to the given parent. |
java.lang.Object |
getRoot()
Returns the root operator. |
boolean |
isLeaf(java.lang.Object node)
Returns true if the operator is a leaf node, i.e. it does not have any children. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l)
Removes the tree model listener. |
void |
setShowDisabledOperators(boolean show)
Sets the state of showing diabled operators. |
boolean |
showDisabledOperators()
Indicates if disabled operators should be displayed by the tree. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object node)
Will be invoked after editing changes of nodes, i.e. after renaming. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Operator root
private java.util.List<javax.swing.event.TreeModelListener> treeModelListeners
private OperatorTree operatorTree
private boolean showDisabledOperators
Constructor Detail |
---|
public OperatorTreeModel(Operator root, OperatorTree tree)
Method Detail |
---|
public boolean showDisabledOperators()
public void setShowDisabledOperators(boolean show)
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object node)
valueForPathChanged
in interface javax.swing.tree.TreeModel
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
addTreeModelListener
in interface javax.swing.tree.TreeModel
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener
in interface javax.swing.tree.TreeModel
public void fireOperatorInserted(java.lang.Object source, javax.swing.tree.TreePath path, int index, Operator operator)
public void fireOperatorRemoved(java.lang.Object source, javax.swing.tree.TreePath path, int index, Operator operator)
public void fireOperatorRenamed(java.lang.Object source, javax.swing.tree.TreePath path)
public void fireOperatorChanged(java.lang.Object source, javax.swing.tree.TreePath path)
public void fireStructureChanged(java.lang.Object source, javax.swing.tree.TreePath path)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |