public interface INode
Interface representation of a node in a scene. A node is an element in a scene that can contain other nodes, such: as child nodes, attachments which provide new capabilities (rendering, control, etc.) and properties which can be used to define node specific attributes.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RENDERER_NODE_PROP
Property key for accessing the associated renderer node.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(INode node)
Adds a node to this node as a child node.
|
void |
attach(IAttachment attachment)
Adds the supplied attachment to this node.
|
void |
detach(IAttachment attachment)
Removes the supplied attachment to this node.
|
java.util.Map<java.lang.Class<?>,java.util.List<IAttachment>> |
getAttachments()
Returns a Map of all the node's attachments.
|
java.util.List<IAttachment> |
getAttachments(java.lang.Class<?> clazz)
Returns a List of the node's attachments that are of the supplied type.
|
java.util.List<INode> |
getChildren(boolean copy)
Returns a List of this node's children, optionally returning a copy of
the List.
|
java.lang.String |
getName()
Returns the human readable name of the node.
|
INode |
getParent()
Returns the parent of the node, or null if the node is not associated
with a parent.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Returns a Map of the node's current properties.
|
java.lang.Object |
getProperty(java.lang.String key)
Returns the node property of the specified type or null if the property
doesn't exist.
|
boolean |
hasAttachment(java.lang.Class<?> attachmentClass)
Returns true if this node has an attachment of the supplied class type.
|
boolean |
hasProperty(java.lang.String key)
Returns true if the property has been set on this object, false
otherwise.
|
boolean |
isVisible()
Returns if the node is visible.
|
void |
removeAllChildren()
Removes all children from this node.
|
void |
removeChild(INode node)
Removes the supplied node as a child from this node.
|
void |
setParent(INode parent)
Sets the parent of the node.
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets the property identified by the key String to the supplied value.
|
void |
setVisible(boolean visible)
Sets the visibility of the node.
|
boolean |
supports(IAttachment attachment)
Returns true if the node supports the supplied attachment.
|
static final java.lang.String RENDERER_NODE_PROP
INode getParent()
Returns the parent of the node, or null if the node is not associated with a parent.
void setParent(INode parent)
Sets the parent of the node.
parent
- the parent of the node to setjava.lang.String getName()
Returns the human readable name of the node.
void addChild(INode node)
Adds a node to this node as a child node. Once the child has been added, the child node will be linked to the parent for transforms and other operations.
node
- node to add as childvoid removeChild(INode node)
Removes the supplied node as a child from this node. If node is not currently a child, this is a no-op.
node
- node to remove as childvoid removeAllChildren()
Removes all children from this node.
node
- removes all children from this node.java.util.List<INode> getChildren(boolean copy)
Returns a List of this node's children, optionally returning a copy of the List.
void setVisible(boolean visible)
Sets the visibility of the node. If the node is not visible, it will not show up in a viewport.
visible
- if true, the node will be rendered in visualizations. if
false, the node will not be rendered.boolean isVisible()
Returns if the node is visible.
void attach(IAttachment attachment)
Adds the supplied attachment to this node. The attachment's functionality will be applied to this node.
attachment
- the attachment to attachvoid detach(IAttachment attachment)
Removes the supplied attachment to this node. The attachment's functionality with be removed from this node.
If the attachment is not currently attached, this is a no-op.
attachment
- the attachment to remove.boolean hasAttachment(java.lang.Class<?> attachmentClass)
Returns true if this node has an attachment of the supplied class type.
attachmentClass
- the attachment class to check for.boolean supports(IAttachment attachment)
Returns true if the node supports the supplied attachment. Some attachments may not be used together.
attachment
- the attachment to check forjava.util.Map<java.lang.Class<?>,java.util.List<IAttachment>> getAttachments()
Returns a Map of all the node's attachments.
java.util.List<IAttachment> getAttachments(java.lang.Class<?> clazz)
Returns a List of the node's attachments that are of the supplied type.
clazz
- the attachment class type to retrievejava.util.Map<java.lang.String,java.lang.Object> getProperties()
Returns a Map of the node's current properties.
java.lang.Object getProperty(java.lang.String key)
Returns the node property of the specified type or null if the property doesn't exist.
void setProperty(java.lang.String key, java.lang.Object value)
Sets the property identified by the key String to the supplied value.
key
- the String identifier of the propertyvalue
- the value of the propertyboolean hasProperty(java.lang.String key)
Returns true if the property has been set on this object, false otherwise.
key
- the property key to check for