com.jstatcom.project
Class ProjectTreeNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- com.jstatcom.project.ProjectTreeNode
-
- All Implemented Interfaces:
- SettingsElement, java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
public final class ProjectTreeNode extends javax.swing.tree.DefaultMutableTreeNode implements SettingsElement
A tree node that represents a project. It is used as element for theProjectTree.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static XmlFormat<ProjectTreeNode>ProjectTreeNode_XML
-
Constructor Summary
Constructors Constructor and Description ProjectTreeNode(Project project, java.io.File projectFile, boolean isCurrent)Creates a tree node for a project.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Overwritessuperclass method to make sure that two project nodes are considered equal if they reference the same project file.inthashCode()Overwritten becauseequalswas overwritten.voidsetElement()Interface method fromSettingsElementto restore a setting.java.lang.StringtoString()Gets a string representation of this node.-
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, 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
-
-
-
-
Field Detail
-
ProjectTreeNode_XML
public static final XmlFormat<ProjectTreeNode> ProjectTreeNode_XML
-
-
Constructor Detail
-
ProjectTreeNode
public ProjectTreeNode(Project project, java.io.File projectFile, boolean isCurrent)
Creates a tree node for a project.- Parameters:
project- the project that this node stands forprojectFile- the file where the project is storedisCurrent- whether this node is the currently loaded project- Throws:
java.lang.IllegalArgumentException-if (project == null || projectFile == null)
-
-
Method Detail
-
equals
public final boolean equals(java.lang.Object o)
Overwritessuperclass method to make sure that two project nodes are considered equal if they reference the same project file.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare- Returns:
trueifois aProjectTreeNodethat points to the same project file,falseotherwise
-
hashCode
public int hashCode()
Overwritten becauseequalswas overwritten.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode of the project file
-
toString
public java.lang.String toString()
Gets a string representation of this node.- Overrides:
toStringin classjavax.swing.tree.DefaultMutableTreeNode- Returns:
- descriptive string
-
setElement
public void setElement()
Interface method fromSettingsElementto restore a setting. It adds this node to the project tree if the project file still exists.- Specified by:
setElementin interfaceSettingsElement
-
-
DMelt 3.0 © DataMelt by jWork.ORG