|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.node.Node
Node is an abstract parent of all node types supported by the node system. Project, FileNode, and LightweightNode are its immediate descendants, and all other nodes should derive from one of these three types.
All nodes share a number of common public characteristics. All nodes except project nodes have an associated project which is invariant for the lifetime of the node object. With the exception of project nodes, whose parent is always null, all nodes may also have a parent node. All nodes may have zero or more immediate children, and any node may list an entirely different set of "display children" for browsing purposes. Nodes have an icon, a short and long display name, and a natural grouping sequence for sorting purposes. Lastly, all nodes can store an unlimited number of named, categorized property values.
Project
,
FileNode
,
LightweightNode
Field Summary | |
static Node[] |
EMPTY_ARRAY
|
protected java.util.ArrayList |
nodeListeners
|
Method Summary | |
void |
addNodeListener(NodeListener listener)
Adds a listener to events fired in this Node. |
void |
check()
Performs any periodic task required to keep the node's state up to date. |
int |
compareTo(java.lang.Object other)
Provides a node ordering for display purposes. |
void |
dumpNodes()
Provided for debugging purposes to dump output from getChildren(). |
void |
dumpNodes(boolean useDisplayChildren)
Provided for debugging purposes. |
void |
dumpNodes(java.lang.String indent,
boolean useDisplayChildren)
Provided for debugging purposes. |
boolean |
equals(java.lang.Object other)
Compare this Node with another for equality. |
void |
fireNodeRenamed()
Notifies all registered NodeListeners that this node has been renamed. |
Node[] |
getChildren()
Returns a collection of all nodes that list this node as their parent, sorted in an order suitable for display. |
Node[] |
getDisplayChildren()
Returns a collection of nodes that should be displayed beneath this node in a project browser, sorted in an order suitable for display. |
abstract javax.swing.Icon |
getDisplayIcon()
Provides an image to be used for graphical representation of the node. |
abstract java.lang.String |
getDisplayName()
Get display name for this Node. |
int |
getDisplaySequence()
Describes the logical group the node belongs to for ordering purposes. |
java.lang.String |
getLongDisplayName()
Get long display name for this Node. |
int |
getNodeID()
Returns a node's internal unique node ID. |
Node |
getParent()
Returns the node's immediate parent in the node hierarchy. |
Project |
getProject()
Returns a reference to the project associated with this node. |
java.util.SortedMap |
getProperties()
Returns a Map relating NodePropertyDescriptor instances to property values. |
java.lang.String |
getProperty(java.lang.String property)
Gets a categorized string property value associated with the node as stored in the project file using an assumed category of "sys" and a default value of null. |
java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaultValue)
Gets a categorized string property value associated with the node as stored in the project file using an assumed category of "sys". |
java.lang.String |
getProperty(java.lang.String category,
java.lang.String property,
java.lang.String defaultValue)
Gets a categorized string property value associated with the node as stored in the project file. |
boolean |
hasChildren()
Describes whether or not this node has one or more children. |
boolean |
hasDisplayChildren()
Describes whether or not this node has one or more display children. |
int |
hashCode()
Returns a computed hash code which include information from the Node parent. |
boolean |
isModified()
Describes the modified state of the node's underlying storage. |
boolean |
isPersistant()
Determines whether or not the node definition and its properties will be saved with in a project file. |
void |
makePersistant()
Forces the node to save its properties in the project file by creating an arbitrary parent folder for nodes that have no natural parentage. |
void |
removeNodeListener(NodeListener listener)
Removes a listener to events fired in this Node. |
void |
setParent(Node parent)
Changes the parent of a node to alter the node hierarchy. |
void |
setProperty(java.lang.String property,
java.lang.String value)
Sets a categorized string property value associated with the node for subsequent storage with the project file using an assumed default value of null and a category of "sys". |
void |
setProperty(java.lang.String category,
java.lang.String property,
java.lang.String value)
Sets a categorized string property value associated with the node for subsequent storage with the project file using an assumed default value of null. |
void |
setProperty(java.lang.String category,
java.lang.String property,
java.lang.String value,
java.lang.String defaultValue)
Sets a categorized string property value associated with the node for subsequent storage with the project file. |
java.lang.String |
toString()
Returns a representation of this Node with display name and internal identifiers. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Node[] EMPTY_ARRAY
protected java.util.ArrayList nodeListeners
Method Detail |
public abstract javax.swing.Icon getDisplayIcon()
public abstract java.lang.String getDisplayName()
public java.lang.String getLongDisplayName()
public int getDisplaySequence()
public Project getProject()
public boolean isModified()
public int getNodeID()
public void check()
public void dumpNodes(java.lang.String indent, boolean useDisplayChildren)
indent
- Indentation for System.out.println().useDisplayChildren
- True to use getDisplayChildren(), false for getChildren().public void dumpNodes(boolean useDisplayChildren)
useDisplayChildren
- True to use getDisplayChildren(), false for getChildren().public void dumpNodes()
public Node getParent()
public void setParent(Node parent)
WARNING: The parent of a node must not in turn be a child of the same node. Loops in the child hierarchy can lead to endless loops at run time. When necessary, distinguish between getDisplayChildren and getChildren by using the former to return the list of conceptual children that may violate this rule.
parent
- The new parent for this node. The parent must belong to the
same project as this node.public Node[] getChildren()
public boolean hasChildren()
public Node[] getDisplayChildren()
By default, a nodes display children are the same as its actual children. Subclasses may decide to augment this list or replace it altogether.
public boolean hasDisplayChildren()
public boolean isPersistant()
public void makePersistant()
public java.lang.String getProperty(java.lang.String category, java.lang.String property, java.lang.String defaultValue)
category
- the name of the category that the property belongs to.property
- the property name for which a value is desired.defaultValue
- the value to return if no value currently exists.public java.lang.String getProperty(java.lang.String property, java.lang.String defaultValue)
property
- the property name for which a value is desired.defaultValue
- the value to return if no value currently exists.public java.lang.String getProperty(java.lang.String property)
property
- the property name for which a value is desired.public void setProperty(java.lang.String category, java.lang.String property, java.lang.String value, java.lang.String defaultValue)
category
- the name of the category that the property belongs to.property
- the property name for which a value is to be stored.value
- the value to be stored.defaultValue
- the value for which no storage is necessary.public void setProperty(java.lang.String category, java.lang.String property, java.lang.String value)
category
- the name of the category that the property belongs to.property
- the property name for which a value is to be stored.value
- the value to be stored.public void setProperty(java.lang.String property, java.lang.String value)
property
- the property name for which a value is to be stored.value
- the value to be stored.public java.util.SortedMap getProperties()
public void addNodeListener(NodeListener listener)
listener
- A NodeListener to register.public void removeNodeListener(NodeListener listener)
listener
- A NodeListener to remove.public void fireNodeRenamed()
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- Another object to compare to, must be a Node.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Another object to compare to.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |