de.grogra.imp
Class ObjectInspector
java.lang.Object
de.grogra.imp.ObjectInspector
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.TreeSelectionListener, javax.swing.tree.TreeModel
- Direct Known Subclasses:
- FlatObjectInspector, HierarchicalObjectInspector
public abstract class ObjectInspector
- extends java.lang.Object
- implements javax.swing.tree.TreeModel, javax.swing.event.TreeSelectionListener
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ctx
protected final Context ctx
filter
protected java.util.HashSet<Node.NType> filter
graph
protected final GraphManager graph
hierarchicFilter
protected boolean hierarchicFilter
rootNode
protected ObjectInspector.TreeNode rootNode
ObjectInspector
public ObjectInspector(Context ctx,
GraphManager graph)
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener l)
- Specified by:
addTreeModelListener
in interface javax.swing.tree.TreeModel
buildTree
public abstract void buildTree()
- Implement this method to set
rootNode
and its children.
The method is called in the constructor of ObjectInspector and every time
the GroIMP scene graph changes.
getChild
public java.lang.Object getChild(java.lang.Object parent,
int index)
- Specified by:
getChild
in interface javax.swing.tree.TreeModel
getChildCount
public int getChildCount(java.lang.Object parent)
- Specified by:
getChildCount
in interface javax.swing.tree.TreeModel
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
- Specified by:
getIndexOfChild
in interface javax.swing.tree.TreeModel
getPathToTreeNode
public void getPathToTreeNode(ObjectInspector.TreeNode treeNode,
java.util.LinkedList<ObjectInspector.TreeNode> path)
getRoot
public java.lang.Object getRoot()
- Specified by:
getRoot
in interface javax.swing.tree.TreeModel
getTreeNodeForNode
public ObjectInspector.TreeNode getTreeNodeForNode(Node node)
initialize
public abstract void initialize()
- Use this method for declarations etc. Only called once in constructor.
isActiveGISelection
public boolean isActiveGISelection()
isActiveTreeSelection
public boolean isActiveTreeSelection()
isLeaf
public boolean isLeaf(java.lang.Object node)
- Specified by:
isLeaf
in interface javax.swing.tree.TreeModel
removeFilter
public void removeFilter()
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
- Specified by:
removeTreeModelListener
in interface javax.swing.tree.TreeModel
setActiveGISelection
public void setActiveGISelection(boolean activeGISelection)
setActiveTreeSelection
public void setActiveTreeSelection(boolean activeTreeSelection)
setFilter
public void setFilter(javax.swing.tree.TreePath[] paths,
boolean hierarchic)
valueChanged
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
- Specified by:
valueChanged
in interface javax.swing.event.TreeSelectionListener
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
- Specified by:
valueForPathChanged
in interface javax.swing.tree.TreeModel