Dresden OCL Toolkit

tudresden.ocl.injection.reverseeng
Class RevengTreeNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bytudresden.ocl.injection.reverseeng.RevengTreeNode
All Implemented Interfaces:
AbstractDescriptor.AbstractDescriptorListener, Cloneable, EventListener, MutableTreeNode, Serializable, TreeNode
Direct Known Subclasses:
AbstractFeatureTreeNode, ErrorTreeNode, FileTreeNode, FolderTreeNode

public abstract class RevengTreeNode
extends DefaultMutableTreeNode
implements AbstractDescriptor.AbstractDescriptorListener

Abstract super class for each node in the treeview.

Version:
0.1
Author:
sz9 (Steffen Zschaler)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
private  DefaultTreeModel m_dtmModel
          The model which this node is part of.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
RevengTreeNode(DefaultTreeModel dtmModel)
          Create a new RevengTreeNode.
 
Method Summary
 boolean canRootExplorer()
          True, if RevengGUI can root its explorer in this node.
 void collapsed()
          Called to indicate that the node was just collapsed.
 RevengTreeNode createLogicalParent()
          Return a RevengTreeNode that represents the logical parent layer to this node.
abstract  void fill()
          Fill in the children of this node.
abstract  Icon getIcon(boolean fExpanded)
          Return the icon associated with the tree node.
protected  DefaultTreeModel getModel()
          Retrieve the model to which this node belongs.
 List getPropertyPages()
          Get the property panes to be shown in the right hand panel of the GUI.
 String getToolTip()
          Return the tool tip to be associated with this node.
 boolean isDirty()
          Return true, if the node is part of a file that needs to be saved.
protected  void nodeChanged()
          Thread-safe invocation of getModel().nodeChanged (this);
protected  void nodeStructureChanged()
          Thread-safe invocation of getModel().nodeStructureChanged (this);
 void onDescriptorModified(AbstractDescriptor.AbstractDescriptorEvent ade)
           
 void save()
          Save the file to which this node belongs.
 void setModified()
          Notification that the data underlying this node has changed.
 void startDirtyChangeNotification(RevengGUI rguiObserver)
          Start to call rguiObserver's onDirtyChanged method whenever the dirty state of this node changes.
 void stopDirtyChangeNotification()
          Stop calling rguiObserver's onDirtyChanged method whenever the dirty state of this node changes.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_dtmModel

private DefaultTreeModel m_dtmModel
The model which this node is part of.

Constructor Detail

RevengTreeNode

public RevengTreeNode(DefaultTreeModel dtmModel)
Create a new RevengTreeNode.

Parameters:
dtmModel - the model which this node is part of. Must not be null!
Method Detail

getModel

protected DefaultTreeModel getModel()
Retrieve the model to which this node belongs.


getIcon

public abstract Icon getIcon(boolean fExpanded)
Return the icon associated with the tree node.

Parameters:
fExpanded - if true, the node is currently expanded.

fill

public abstract void fill()
Fill in the children of this node. Called when the node was freshly expanded.


collapsed

public void collapsed()
Called to indicate that the node was just collapsed. By default does nothing.


getPropertyPages

public List getPropertyPages()
Get the property panes to be shown in the right hand panel of the GUI.


setModified

public void setModified()
Notification that the data underlying this node has changed. By default, recursively cascades upward.


nodeChanged

protected void nodeChanged()
Thread-safe invocation of getModel().nodeChanged (this);


nodeStructureChanged

protected void nodeStructureChanged()
Thread-safe invocation of getModel().nodeStructureChanged (this);


getToolTip

public String getToolTip()
Return the tool tip to be associated with this node. Defaults to toString().


isDirty

public boolean isDirty()
Return true, if the node is part of a file that needs to be saved. As a default returns the result of sending isDirty to this node's parent, if a parent exists. Otherwise returns false.


startDirtyChangeNotification

public void startDirtyChangeNotification(RevengGUI rguiObserver)
Start to call rguiObserver's onDirtyChanged method whenever the dirty state of this node changes.


stopDirtyChangeNotification

public void stopDirtyChangeNotification()
Stop calling rguiObserver's onDirtyChanged method whenever the dirty state of this node changes.


save

public void save()
          throws IOException
Save the file to which this node belongs.

Throws:
IOException

onDescriptorModified

public void onDescriptorModified(AbstractDescriptor.AbstractDescriptorEvent ade)
Specified by:
onDescriptorModified in interface AbstractDescriptor.AbstractDescriptorListener

canRootExplorer

public boolean canRootExplorer()
True, if RevengGUI can root its explorer in this node.


createLogicalParent

public RevengTreeNode createLogicalParent()
Return a RevengTreeNode that represents the logical parent layer to this node.


Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.