NodeComponent is the base class for all node components. More...
Public Member Functions | |
void | close () |
Close the object, and release native resources. | |
String | getName () |
Gets the value of NameProperty. More... | |
Node | getNode () |
Returns the node the node component is attached to or null if node component is not attached to a node. More... | |
NodeComponentState | getState () |
Gets the state of node component indicating if component is attached to a node, detached from any node or in process of attaching/detaching. More... | |
boolean | isAttached () |
Indicates whether node component is attached to a node. More... | |
boolean | isAttaching () |
Indicates whether node component is in the process of attaching to a node. More... | |
boolean | isAttachingOrAttached () |
Indicates whether node component is in the process of attaching to a node or already attached. More... | |
boolean | isDetached () |
Indicates whether node component is detached from any node. More... | |
boolean | isDetaching () |
Indicates whether node component currently detaching from the node. More... | |
boolean | isDetachingOrDetached () |
Indicates whether node component is in the process of detaching from the node or already detached. More... | |
void | setName (String value) |
Sets the value of NameProperty. More... | |
Public Member Functions inherited from KanziObject | |
boolean | equals (Object object) |
Domain | getDomain () |
Returns the domain the object belongs to. More... | |
Metaclass | getDynamicMetaclass () |
Returns the metaclass of the dynamic type of the object. More... | |
boolean | isStale () |
Test if the object is stale i.e. More... | |
void | removeLocalValue (PropertyType propertyType) |
Removes the local value associated with the property. More... | |
Static Public Attributes | |
static final Metaclass | metaclass |
The Metaclass for the class. More... | |
Static Public Attributes inherited from KanziObject | |
static final Metaclass | metaclass = new AbstractMetaclass("Kanzi.Object") |
The Metaclass for the class. | |
Protected Member Functions | |
NodeComponent (Domain domain, long handle, Metaclass metaclass) | |
Wraps a given native Node Component. More... | |
Node.MessageSubscriptionToken | addNodeComponentMessageHandler (MessageType messageType, Node.MessageSubscriptionFunction messageHandlerFunction) |
Kanzi calls the message handler that you add using this function when the target name of the incoming message matches the name of the node component, or if the message is broadcast to all node components with an empty target name. More... | |
void | attachOverride () |
Called when the Trigger is attached to a node. | |
void | detachOverride () |
Called when a Trigger is detached from a Node. | |
void | dispatchMessage (MessageType messageType, MessageArguments arguments) |
Adds the name of the node component to the message arguments and dispatches the message to the node of the node component. More... | |
void | initialize () |
Initializes the Node Component. | |
void | removeNodeComponentMessageFilter (Node.MessageSubscriptionToken token) |
Removes message handler added via NodeComponent#addNodeComponentMessageHandler function. More... | |
Static Protected Member Functions | |
static< Derived extends NodeComponent > ObjectRef< Derived > | createDerived (Domain domain, String name, Metaclass metaclass) |
Creates a derived class instance. More... | |
Additional Inherited Members | |
Public Attributes inherited from NodeComponentMetadata | |
AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.NodeComponent") |
Metaclass for NodeComponent. | |
DynamicPropertyType< String > | NameProperty |
Name. More... | |
NodeComponent is the base class for all node components.
Node component is an isolated piece of logic which can be attached to any node in order to add additional functionality to it. Examples of node component could be Trigger which performs specific actions when certain conditions are met or AnimationPlayer which animates specific properties of the node it is attached to and its child nodes.
Node component can only be attached to a single node at a time. After node component is detached from one node, it can be attached to any other node.
Node component starts to perform its logic after it is attached to a certain node. After node component is detached from its node it becomes inactive and stops to perform its logic.
|
protected |
|
protected |
Kanzi calls the message handler that you add using this function when the target name of the incoming message matches the name of the node component, or if the message is broadcast to all node components with an empty target name.
messageType | Type of message to handle. |
messageHandlerFunction | The function invoked when the node that owns the handler receives a matching message. |
|
staticprotected |
|
protected |
Adds the name of the node component to the message arguments and dispatches the message to the node of the node component.
You must derive the message arguments from NodeComponentSourceMessageArguments.
messageType | The type of the dispatched message. |
arguments | The arguments of the dispatched message. |
String getName | ( | ) |
Gets the value of NameProperty.
Node getNode | ( | ) |
Returns the node the node component is attached to or null if node component is not attached to a node.
NodeComponentState getState | ( | ) |
Gets the state of node component indicating if component is attached to a node, detached from any node or in process of attaching/detaching.
boolean isAttached | ( | ) |
Indicates whether node component is attached to a node.
boolean isAttaching | ( | ) |
Indicates whether node component is in the process of attaching to a node.
boolean isAttachingOrAttached | ( | ) |
Indicates whether node component is in the process of attaching to a node or already attached.
boolean isDetached | ( | ) |
Indicates whether node component is detached from any node.
boolean isDetaching | ( | ) |
Indicates whether node component currently detaching from the node.
boolean isDetachingOrDetached | ( | ) |
Indicates whether node component is in the process of detaching from the node or already detached.
|
protected |
Removes message handler added via NodeComponent#addNodeComponentMessageHandler function.
token | Subscription token of message handler to remove. |
void setName | ( | String | value | ) |
Sets the value of NameProperty.
value | New value. |