目录

Node

Class Info

public class Node

A node class that manages component operations and node relationships.

Public Method Summary

Qualifier and Type

Method Name and Description

public long

getHandle()

Obtains a node handle.

public String

getName()

Obtains a node name.

<T extends Component>

public T

addComponent(Component.Descriptor<T> descriptor)

Adds a component of type T.

<T extends Component>

public T

getComponent(Component.Descriptor<T> descriptor)

Obtains a component of type T.

<T extends Component>

public Node

removeComponent(Component.Descriptor<T> descriptor)

Removes a component of type T.

public Node

setActive(boolean isActive)

Sets whether to activate a node.

public boolean

isActive()

Checks whether a node is activated.

public Node

getParent()

Obtains a parent node.

public Node

addChild(Node child)

Adds a child node.

public List<Node>

getChildren()

Obtains all child nodes.

public void

traverseChildren(Consumer<Node> consumer)

Traverses all child nodes.

public void

tarverseDescendants(Consumer<Node> consumer)

Traverses all descendant nodes.

public Box

getBoundingBox()

Obtains the bounding box corresponding to a node.

Public Methods

[h2]getHandle

Method

public long getHandle()

Obtains a node handle.

Returns

Type

Description

long

Handle of a node.

[h2]getName

Method

public String getName()

Obtains a node name.

Returns

Type

Description

String

Name of a node.

[h2]addComponent

Method

<T extends Component>

public T addComponent(Component.Descriptor<T> descriptor)

Adds a component of type T.

Templates

Type

Description

T extends Component

Component type.

Parameters

Name

Description

descriptor

Component descriptor.

Returns

Type

Description

T

Instance of a component of type T that is added.

[h2]getComponent

Method

<T extends Component>

public T getComponent(Component.Descriptor<T> descriptor)

Obtains a component of type T.

Templates

Type

Description

T extends Component

Component type.

Parameters

Name

Description

descriptor

Component descriptor.

Returns

Type

Description

T

Instance of a component of type T.

[h2]removeComponent

Method

<T extends Component>

public Node removeComponent(Component.Descriptor<T> descriptor)

Removes a component of type T.

Templates

Type

Description

T extends Component

Component type.

Parameters

Name

Description

descriptor

Component descriptor.

Returns

Type

Description

Node

Instance of this class.

[h2]setActive

Method

public Node setActive(boolean isActive)

Sets whether to activate a node. Only activated nodes are displayed.

Parameters

Name

Description

isActive

Indicates whether to activate a node.

  • true: yes
  • false: no

Returns

Type

Description

Node

Instance of this class.

[h2]isActive

Method

public boolean isActive()

Checks whether a node is activated.

Returns

Type

Description

boolean

Whether a node is activated.

  • true: yes
  • false: no

[h2]getParent

Method

public Node getParent()

Obtains a parent node.

Returns

Type

Description

Node

Parent node.

[h2]addChild

Method

public Node addChild(Node child)

Adds a child node.

Parameters

Name

Description

child

Child node.

Returns

Type

Description

Node

Instance of this class.

[h2]getChildren

Method

public List<Node> getChildren()

Obtains all child nodes.

Returns

Type

Description

List<Node>

List of all child nodes.

[h2]traverseChildren

Method

public void tarverseChildren(Consumer<Node> consumer)

Traverses all child nodes.

Parameters

Name

Description

consumer

Consumer of all child nodes.

[h2]tarverseDescendants

Method

public void tarverseDescendants(Consumer<Node> consumer)

Traverses all descendant nodes.

Parameters

Name

Description

consumer

Consumer of all descendant nodes.

[h2]getBoundingBox

Method

public Box getBoundingBox()

Obtains the bounding box corresponding to a node.

Returns

Type

Description

Box

Bounding box.