B.Graph.Node() -> B.Std.Listenable

Represents a scene graph node.

To create the object use B.Graph.makeNode().

TYPES:

TraverseHandler

Graph traverse callback.

PARAMETERS:

{B.Graph.Node} node

METHODS:

clone(deep)

Clones this node to a new node.

PARAMETERS:

{boolean} [deep] = false

true if you want to clone the whole hierarchy

RETURNS:

prop(name, value, deep)

Sets property value.

PARAMETERS:

{string} name

{any} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

{B.Graph.Node}

this node

FIRES:

prop(name)

Gets property value.

PARAMETERS:

{string} name

RETURNS:

{any}

props()

Returns array of properties names.

RETURNS:

{Array.<string>}

parent()

Returns parent of this node.

RETURNS:

children()

Returns children of this node.

RETURNS:

{Array.<B.Graph.Node>}

find(propName, propValue, deep, out)

Finds children of this node by specified property name and value.

PARAMETERS:

{string} propName

{any} propValue

{boolean} [deep] = false

true if you want to find through the whole hierarchy

{Array.<B.Graph.Node>} [out]

if you need you can pass an existing array to append

RETURNS:

{Array.<B.Graph.Node>}

traverse(handler, order)

Traverses through the node's hierarchy.

PARAMETERS:

{B.Graph.Node~TraverseHandler} handler

a function to execute when the node is traversed

{B.Graph.Order} [order] = B.Graph.Order.PRE

RETURNS:

{B.Graph.Node}

this

attach(node)

Attaches some node to this node.

PARAMETERS:

{B.Graph.Node} node

RETURNS:

{B.Graph.Node}

this node

FIRES:

detach()

Detaches this node from its parent.

If this node is not attached the function will do nothing.

RETURNS:

{B.Graph.Node}

this node

FIRES:

EVENTS:

{B.Std.Event} prop-changed

Reporting that node's property has been changed.

{name} data.name

property name

{value} data.value

a new value

{B.Std.Event} attached

Reporting that the node has been attached to a new parent.

{B.Std.Event} child-attached

Reporting that a child has been attached to the node.

{B.Std.Event} detached

Reporting that the node has been detached from its parent.

{B.Std.Event} child-detached

Reporting that a child has been detached from the node.

TYPES:

METHODS:

EVENTS: