![]() |
Gridarta Editor
|
TreeNode implementation for Named Objects (like arches, faces, animations, artifacts etc.), used for displaying faces in a javax.swing.JTree. More...
Public Member Functions | |
void | append (@NotNull final NamedObject namedObject) throws IllegalNamedObjectException |
Append a node. More... | |
NamedTreeNode () | |
Creates a root node. More... | |
Private Member Functions | |
void | append (@NotNull final String path, @NotNull final NamedObject namedObject) throws IllegalNamedObjectException |
Appends a node. More... | |
void | initLazyArray () |
Makes sure that the variable childNodeArray points to a valid array. More... | |
NamedTreeNode (final boolean dir, @Nullable final NamedTreeNode< E > parent, @NotNull final NamedObject namedObject) | |
Creates a new instance. More... | |
NamedTreeNode (final boolean dir, @Nullable final NamedTreeNode< E > parent, @NotNull final String name) | |
Creates a new instance. More... | |
Private Attributes | |
NamedTreeNode<?>[] | childNodeArray |
The node array. More... | |
final SortedMap< String, NamedTreeNode< E > > | childNodes = new TreeMap<>() |
The children. More... | |
final boolean | dir |
Directory state,. More... | |
final String | name |
The node name. More... | |
final NamedObject | namedObject |
The node object. More... | |
final NamedTreeNode< E > | parent |
The parent node, which may be. More... | |
Static Private Attributes | |
static final long | serialVersionUID = 1L |
The serial version UID. More... | |
TreeNode implementation for Named Objects (like arches, faces, animations, artifacts etc.), used for displaying faces in a javax.swing.JTree.
Definition at line 40 of file NamedTreeNode.java.
net.sf.gridarta.model.data.NamedTreeNode< E extends NamedObject >.NamedTreeNode | ( | ) |
Creates a root node.
All other nodes must be created via {}.
Definition at line 94 of file NamedTreeNode.java.
|
private |
Creates a new instance.
The constructor has been made private to force users on factory methods
dir | set this to true
false
|
parent | the parent node or null
|
name | the name, which is the directory name for directory nodes and the face name for face nodes |
Definition at line 107 of file NamedTreeNode.java.
|
private |
Creates a new instance.
The constructor has been made private to force users on factory methods
dir | set this to true
false
|
parent | the parent node or null
|
namedObject | the abstract named object to show as this tree node |
Definition at line 122 of file NamedTreeNode.java.
void net.sf.gridarta.model.data.NamedTreeNode< E extends NamedObject >.append | ( | @NotNull final NamedObject | namedObject | ) | throws IllegalNamedObjectException |
Append a node.
namedObject | the node to append |
IllegalNamedObjectException | if the named object cannot be added |
Definition at line 134 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.AbstractNamedObjects< FaceObject >.put().
|
private |
Appends a node.
Direct invocation should only occur on the root node.
path | the path of node to append (parent path eventually removed) |
namedObject | the abstract named object to show as this tree node |
IllegalNamedObjectException | if the named object cannot be added |
Definition at line 147 of file NamedTreeNode.java.
|
private |
Makes sure that the variable childNodeArray points to a valid array.
Definition at line 175 of file NamedTreeNode.java.
|
private |
The node array.
It is required for implementing the TreeNode interface with index methods since the TreeMap does not allow indexed access despite the fact that it is ordered. Basically it is redundant. @serial
Definition at line 60 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.NamedTreeNode< E >.initLazyArray().
|
private |
The children.
They are mapped name as key to child node as value. @serial
Definition at line 52 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.NamedTreeNode< E >.initLazyArray().
|
private |
Directory state,.
for directory nodes,
for face nodes. @serial
Definition at line 88 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.NamedTreeNode< E >.NamedTreeNode().
|
private |
The node name.
@serial
Definition at line 74 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.NamedTreeNode().
|
private |
The node object.
@serial
Definition at line 81 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.NamedTreeNode< E >.NamedTreeNode().
|
private |
The parent node, which may be.
for the root node. @serial
Definition at line 67 of file NamedTreeNode.java.
Referenced by net.sf.gridarta.model.data.NamedTreeNode< E >.append(), and net.sf.gridarta.model.data.NamedTreeNode< E >.NamedTreeNode().
|
staticprivate |
The serial version UID.
Definition at line 45 of file NamedTreeNode.java.