public class NamedTreeNode<E extends NamedObject> extends java.lang.Object implements javax.swing.tree.TreeNode, java.lang.Comparable<NamedTreeNode<E>>, java.io.Serializable
JTree
.Constructor and Description |
---|
NamedTreeNode()
Creates a root node.
|
Modifier and Type | Method and Description |
---|---|
void |
append(@NotNull NamedObject namedObject)
Append a node.
|
@NotNull java.util.Enumeration<NamedTreeNode<E>> |
children() |
int |
compareTo(@NotNull NamedTreeNode<E> o) |
boolean |
equals(@Nullable java.lang.Object obj) |
boolean |
getAllowsChildren() |
@NotNull javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
int |
getIndex(@NotNull javax.swing.tree.TreeNode node) |
@NotNull java.lang.String |
getName()
Returns the name.
|
@Nullable NamedObject |
getNamedObject()
Returns the AbstractNamedObject of this node.
|
@Nullable NamedTreeNode<E> |
getParent() |
@NotNull javax.swing.tree.TreePath |
getPathFor(@NotNull java.lang.String path)
Get the path for a node.
|
int |
hashCode() |
boolean |
isLeaf() |
@NotNull java.lang.String |
toString() |
public NamedTreeNode()
append(NamedObject)
.public void append(@NotNull @NotNull NamedObject namedObject) throws IllegalNamedObjectException
namedObject
- the node to appendIllegalNamedObjectException
- if the named object cannot be added@Nullable public @Nullable NamedObject getNamedObject()
null
null
for dir
nodes@NotNull public @NotNull java.lang.String getName()
@NotNull public @NotNull java.util.Enumeration<NamedTreeNode<E>> children()
children
in interface javax.swing.tree.TreeNode
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
isDir()
@NotNull public @NotNull javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
public int getIndex(@NotNull @NotNull javax.swing.tree.TreeNode node)
getIndex
in interface javax.swing.tree.TreeNode
@Nullable public @Nullable NamedTreeNode<E> getParent()
getParent
in interface javax.swing.tree.TreeNode
public boolean isLeaf()
isLeaf
in interface javax.swing.tree.TreeNode
true
for face nodes, false
for directory nodespublic boolean equals(@Nullable @Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(@NotNull @NotNull NamedTreeNode<E> o)
compareTo
in interface java.lang.Comparable<NamedTreeNode<E extends NamedObject>>
@NotNull public @NotNull javax.swing.tree.TreePath getPathFor(@NotNull @NotNull java.lang.String path)
path
- the String specifying the node@NotNull public @NotNull java.lang.String toString()
toString
in class java.lang.Object