Dresden OCL Toolkit

tudresden.ocl.injection.reverseeng
Class FileTreeNode

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

public class FileTreeNode
extends RevengTreeNode

A tree node representing a Java Source file.

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  AnalysisConsumer m_acAnalysisResults
          Results of parsing.
private  boolean m_fDirty
          Flag indicating whether the file needs to be saved.
private  boolean m_fHadError
          Did parsing yield any errors?
private  boolean m_fParsed
          Has the associated file already been parsed?
private  boolean m_fUseDefaultIcon
          If true, use s_iFileWait.
private  RevengGUI m_rguiDirtyObserver
          If non-null, will be notified whenever m_fDirty changes.
private  String m_sErrorMessage
          If any errors occurred: error message to be presented to user.
(package private) static Icon s_iFileError
          Icon associated with file that could not be parsed.
(package private) static Icon s_iFileWait
          Icon associated with file until the correct icon has been computed.
(package private) static Icon s_iFileWithCollections
          Icon associated with file that contains completely documented collections only.
(package private) static Icon s_iFileWithCollectionsAndMaps
          Icon associated with file that contains completely documented collections and maps.
(package private) static Icon s_iFileWithCollectionsAndMapsInComplete
          Icon associated with file that contains collections and maps, which may be incompletely documented.
(package private) static Icon s_iFileWithCollectionsInComplete
          Icon associated with file that contains collections only, which may be incompletely documented.
(package private) static Icon s_iFileWithMaps
          Icon associated with file that contains completely documented maps only.
(package private) static Icon s_iFileWithMapsInComplete
          Icon associated with file that contains maps only, which may be incompletely documented.
(package private) static Icon s_iNormalFile
          Icon associated with normal file without any maps or collections.
(package private) static ThreadPool s_tpIconComputers
          ThreadPool managing the threads used to calculate the correct icons.
 
Fields inherited from class tudresden.ocl.injection.reverseeng.RevengTreeNode
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
FileTreeNode(DefaultTreeModel dtmModel)
           
FileTreeNode(DefaultTreeModel dtmModel, File f)
           
 
Method Summary
protected  void ensureParsed(boolean fUpdateChildren)
          Make sure the associated file was parsed, if it is not a directory.
 void fill()
          Fill in the children of this node.
 File getFile()
          Get the file associated with this node.
 Icon getIcon(boolean fExpanded)
          Return the icon associated with the tree node.
 boolean isDirty()
          Return true if this file has been modified since it has last been saved.
 void save()
          Save the associated file.
 void setFile(File f)
          Set the file associated to this node.
 void setModified()
          Notification that underlying file was modified.
 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.
 String toString()
           
private  void updateIcon()
           
 
Methods inherited from class tudresden.ocl.injection.reverseeng.RevengTreeNode
canRootExplorer, collapsed, createLogicalParent, getModel, getPropertyPages, getToolTip, nodeChanged, nodeStructureChanged, onDescriptorModified
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_tpIconComputers

static ThreadPool s_tpIconComputers
ThreadPool managing the threads used to calculate the correct icons.


s_iNormalFile

static Icon s_iNormalFile
Icon associated with normal file without any maps or collections.


s_iFileWait

static Icon s_iFileWait
Icon associated with file until the correct icon has been computed.


s_iFileError

static Icon s_iFileError
Icon associated with file that could not be parsed.


s_iFileWithCollections

static Icon s_iFileWithCollections
Icon associated with file that contains completely documented collections only.


s_iFileWithCollectionsInComplete

static Icon s_iFileWithCollectionsInComplete
Icon associated with file that contains collections only, which may be incompletely documented.


s_iFileWithCollectionsAndMaps

static Icon s_iFileWithCollectionsAndMaps
Icon associated with file that contains completely documented collections and maps.


s_iFileWithCollectionsAndMapsInComplete

static Icon s_iFileWithCollectionsAndMapsInComplete
Icon associated with file that contains collections and maps, which may be incompletely documented.


s_iFileWithMaps

static Icon s_iFileWithMaps
Icon associated with file that contains completely documented maps only.


s_iFileWithMapsInComplete

static Icon s_iFileWithMapsInComplete
Icon associated with file that contains maps only, which may be incompletely documented.


m_fUseDefaultIcon

private boolean m_fUseDefaultIcon
If true, use s_iFileWait.


m_fParsed

private boolean m_fParsed
Has the associated file already been parsed?


m_fHadError

private boolean m_fHadError
Did parsing yield any errors?


m_sErrorMessage

private String m_sErrorMessage
If any errors occurred: error message to be presented to user.


m_acAnalysisResults

private AnalysisConsumer m_acAnalysisResults
Results of parsing.


m_fDirty

private boolean m_fDirty
Flag indicating whether the file needs to be saved.


m_rguiDirtyObserver

private RevengGUI m_rguiDirtyObserver
If non-null, will be notified whenever m_fDirty changes.

Constructor Detail

FileTreeNode

public FileTreeNode(DefaultTreeModel dtmModel)

FileTreeNode

public FileTreeNode(DefaultTreeModel dtmModel,
                    File f)
Method Detail

setFile

public void setFile(File f)
Set the file associated to this node.


getFile

public File getFile()
Get the file associated with this node.


ensureParsed

protected void ensureParsed(boolean fUpdateChildren)
Make sure the associated file was parsed, if it is not a directory.

Parameters:
fUpdateChildren - if true, reflect the results of parsing in the node's children.

getIcon

public Icon getIcon(boolean fExpanded)
Description copied from class: RevengTreeNode
Return the icon associated with the tree node.

Specified by:
getIcon in class RevengTreeNode
Parameters:
fExpanded - if true, the node is currently expanded.

fill

public void fill()
Description copied from class: RevengTreeNode
Fill in the children of this node. Called when the node was freshly expanded.

Specified by:
fill in class RevengTreeNode

toString

public String toString()

setModified

public void setModified()
Notification that underlying file was modified. Checks the icon and remembers dirty state.

Overrides:
setModified in class RevengTreeNode

updateIcon

private void updateIcon()

isDirty

public boolean isDirty()
Return true if this file has been modified since it has last been saved.

Overrides:
isDirty in class RevengTreeNode

startDirtyChangeNotification

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

Overrides:
startDirtyChangeNotification in class RevengTreeNode

stopDirtyChangeNotification

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

Overrides:
stopDirtyChangeNotification in class RevengTreeNode

save

public void save()
          throws IOException
Save the associated file.

Overrides:
save in class RevengTreeNode
Throws:
IOException

Dresden OCL Toolkit

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