Kanzi 4.1.1
Node2DProxy Class Reference

Node2D is the base class of 2D nodes. More...

Inheritance diagram for Node2DProxy:
[legend]

Public Member Functions

void addChild (Node2D child)
 Adds a child node.
 
void arrange ()
 Performs layout arrangement on a 2D node.
 
Vector2 getActualSize ()
 Gets the actual size of a node.
 
Vector2 getAllocatedSize ()
 Gets the allocated size of a node.
 
Matrix3x3 getArrangeTransform ()
 Gets the arrange transform.
 
Node2D getChild (int index)
 Returns a child from given index from object node.
 
int getChildCount ()
 Gets the number of children of the node.
 
int getChildIndex (Node child)
 Returns the index of a child in an object node.
 
Vector2 getDesiredSize ()
 Gets the desired size of a node.
 
Matrix3x3 getWorldTransform ()
 Gets the world transformation matrix.
 
boolean hasChild (Node child)
 Returns whether the given node is a child of this node.
 
void insertChild (int index, Node2D child)
 Adds a child node for object node to given index.
 
void layout ()
 Does layout pass with no root transformation (identity).
 
void moveToBack ()
 Repositions the node to the beginning of its parent's children, so that it is drawn first.
 
void moveToFront ()
 Repositions the node to the end of its parent's children, so that it is drawn last.
 
void removeAllChildren ()
 Removes all child nodes.
 
void removeChild (int index)
 Removes child node at specified index.
 
void removeChild (Node child)
 Removes child node.
 
void setActualSize (float sizeX, float sizeY)
 Sets the actual size of a node.
 
void setActualSize (Vector2 actualSize)
 Sets the actual size of a node.
 
void setAllocatedSize (Vector2 allocatedSize)
 Sets the allocated size of a node.
 
void setArrangeTransform (Matrix3x3 transform)
 Sets the arrange transform.
 
void setDesiredSize (Vector2 desiredSize)
 Sets the desired size of a node.
 
void transform ()
 Transforms a 2D node.
 
- Public Member Functions inherited from Node
ObjectRef< TResourceTypeacquireResource (ResourceID resourceId) throws ObjectNotFoundException
 Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary.
 
ResourceManager.AcquireTask acquireResourcesAsync (ResourceID resourceId, ResourceManager.AcquireTask.Callback callback)
 Posts an asynchronous task to acquire a resource.
 
boolean addAbstractChild (Node child)
 Adds a node as child of this node.
 
MessageSubscriptionToken addMessageFilter (MessageType< MessageArgumentsType > messageType, MessageSubscriptionFunction< MessageArgumentsType > messageHandlerFunction)
 Adds a message filter where the filter is a function.
 
MessageSubscriptionToken addMessageHandler (MessageType< MessageArgumentsType > messageType, MessageSubscriptionFunction< MessageArgumentsType > messageHandlerFunction)
 Adds a message handler where the handler is a function.
 
MessageSubscriptionToken addMessageHandler (MessageType< MessageArgumentsType > messageType, MessageSubscriptionFunction< MessageArgumentsType > messageHandlerFunction, Node messageSourceFilter)
 Adds a message handler where the handler is a function.
 
void addNodeComponentWithOwner (NodeComponent component, KanziObject owner)
 Transfers the ownership of a node component to an object node and sets the owner of the node component.
 
MessageSubscriptionToken addTunnelingMessageFilter (MessageType< MessageArgumentsType > messageType, MessageSubscriptionFunction< MessageArgumentsType > messageHandlerFunction)
 Adds a message filter where the filter is a function.
 
MessageSubscriptionToken addTunnelingMessageHandler (MessageType< MessageArgumentsType > messageType, MessageSubscriptionFunction< MessageArgumentsType > messageHandlerFunction, Node messageSourceFilter)
 Adds a message handler where the handler is a function and you explicitly define the accepted source.
 
void attachRecursive ()
 Attaches an object node and its children recursively.
 
void clearChangeFlag (PropertyTypeChangeFlag flag)
 Clears a change flag.
 
void dispatchMessage (MessageType< MessageArgumentsType > messageType, MessageArgumentsType arguments)
 Dispatches a message from this node with specified arguments.
 
String findResourceUrl (ResourceID resourceId)
 Tries to find Resource URL for Resource ID from this node.
 
Node getAbstractChild (int index)
 Returns node at given child index.
 
int getAbstractChildCount ()
 Returns number of child nodes.
 
int getAbstractChildIndex (Node node)
 Returns index of given node in list of child nodes.
 
float getActualDepth ()
 Gets the value of NodeMetadata::ActualDepthProperty.
 
float getActualHeight ()
 Gets the value of NodeMetadata::ActualHeightProperty.
 
float getActualWidth ()
 Gets the value of NodeMetadata::ActualWidthProperty.
 
float getDepth ()
 Gets the value of NodeMetadata::DepthProperty.
 
Vector2 getDepthMargin ()
 Gets the value of NodeMetadata::DepthMarginProperty.
 
float getHeight ()
 Gets the value of NodeMetadata::HeightProperty.
 
Vector2 getHorizontalMargin ()
 Gets the value of NodeMetadata::HorizontalMarginProperty.
 
String getLocale ()
 Gets the value of NodeMetadata::LocaleProperty.
 
String getName ()
 Gets the value of NodeMetadata::NameProperty.
 
float getOpacity ()
 Gets the value of NodeMetadata::OpacityProperty.
 
Node getParent ()
 Gets parent of this node.
 
String getPath ()
 Gets the value of NodeMetadata::PathProperty.
 
Resource getStateManager ()
 Gets the value of NodeMetadata::StateManagerProperty.
 
Resource getStyle ()
 Gets the value of NodeMetadata::StyleProperty.
 
Vector2 getVerticalMargin ()
 Gets the value of NodeMetadata::VerticalMarginProperty.
 
float getWidth ()
 Gets the value of NodeMetadata::WidthProperty.
 
void invalidateArrange ()
 Invalidates arrange for the node.
 
void invalidateDraw ()
 Invalidates draw flag for the node.
 
void invalidateFinalTransform ()
 Invalidates final transform for node.
 
void invalidateMeasure ()
 Invalidates measure for the node.
 
void invalidateRender ()
 Invalidates render for the node.
 
boolean isAnyChangeFlagSet (EnumSet< PropertyTypeChangeFlag > flags)
 Checks if any of a set of change flags is set.
 
boolean isAnyChildChangeFlagSet (EnumSet< PropertyTypeChangeFlag > flags)
 Checks if any of a set of change flags is set on a child.
 
boolean isChangeFlagSet (PropertyTypeChangeFlag flag)
 Checks if a change flag is set.
 
boolean isChildChangeFlagSet (PropertyTypeChangeFlag flag)
 Checks if a change flag is set on a child.
 
boolean isClipChildren ()
 Gets the value of NodeMetadata::ClipChildrenProperty.
 
boolean isEnabled ()
 Gets the value of NodeMetadata::EnabledProperty.
 
boolean isFocusable ()
 Gets the value of the NodeMetadata::FocusableProperty.
 
boolean isFocused ()
 Sets whether a node is an active focus node and can receive keyboard messages.
 
boolean isHitTestable ()
 Gets the value of NodeMetadata::HitTestableProperty.
 
boolean isHitTestableContainer ()
 Gets the value of NodeMetadata::HitTestableContainerProperty.
 
boolean isHover ()
 Gets the value of NodeMetadata::HoverProperty.
 
boolean isInvalidArrange ()
 Check if the node needs arrange.
 
boolean isInvalidDraw ()
 Tells if node draw flag is invalid.
 
boolean isInvalidFinalTransform ()
 Tells if final transform flag is invalid for node.
 
boolean isInvalidMeasure ()
 Check if the node needs measure.
 
boolean isInvalidRender ()
 Returns if node render flag is invalid.
 
boolean isVisible ()
 Gets the value of NodeMetadata::VisibleProperty.
 
Iterable< NodeComponentiterateNodeComponents ()
 Gets an Iterable object used to iterate the Node Components.
 
lookupNode (String path)
 Returns a node of specified type by looking it up with specified path or alias.
 
NodeComponent lookupNodeComponentByName (String name)
 Look up a Node Component by Name.
 
KanziObject lookupObject (String path)
 Returns a KanziObject by looking it up with specified path or alias.
 
void notifyResourceDictionaryModified ()
 Forces the re-evaluation of resource IDs in a node tree.
 
boolean removeAbstractChild (Node child)
 Removes child node from this node.
 
void removeBinding (AbstractBindingRuntime bindingRuntime)
 Removes a binding runtime added earlier.
 
void removeBindingsWithOwner (KanziObject owner)
 Removes binding runtimes owned by a KanziObject.
 
void removeMessageHandler (MessageSubscriptionToken token)
 Removes a message subscription.
 
void removeNodeComponentWithOwner (KanziObject owner)
 Removes all node component bindings with the specified owner.
 
void setActualDepth (float value)
 Sets the value of NodeMetadata::ActualDepthProperty.
 
void setActualHeight (float value)
 Sets the value of NodeMetadata::ActualHeightProperty.
 
void setActualWidth (float value)
 Sets the value of NodeMetadata::ActualWidthProperty.
 
void setAutoHeight ()
 Sets node to automatically determine height.
 
void setAutoWidth ()
 Sets node to automatically determine width.
 
AbstractBindingRuntime setBinding (AbstractBinding binding)
 Sets a binding.
 
AbstractBindingRuntime setBinding (AbstractBinding binding, PropertyType<?> propertyType)
 Sets a binding.
 
AbstractBindingRuntime setBinding (AbstractBinding binding, PropertyType<?> propertyType, PropertyField propertyField)
 Sets a binding.
 
AbstractBindingRuntime setBindingWithOwner (AbstractBinding binding, KanziObject owner, PropertyType<?> propertyType)
 Sets a binding with owner.
 
AbstractBindingRuntime setBindingWithOwner (AbstractBinding binding, KanziObject owner, PropertyType<?> propertyType, PropertyField propertyField)
 Sets a binding with owner.
 
void setChangeFlag (PropertyTypeChangeFlag flag)
 Sets a change flag.
 
void setClipChildren (boolean value)
 Sets the value of NodeMetadata::ClipChildrenProperty.
 
void setDepth (float value)
 Sets the value of NodeMetadata::DepthProperty.
 
void setDepthMargin (Vector2 value)
 Sets the value of NodeMetadata::DepthMarginProperty.
 
void setEnabled (boolean value)
 Sets the value of the NodeMetadata::EnabledProperty.
 
void setFocusable (boolean value)
 Sets the value of the NodeMetadata::FocusableProperty.
 
void setFocused (boolean value)
 Sets the value of the NodeMetadata::FocusedProperty.
 
void setHeight (float value)
 Sets the value of NodeMetadata::HeightProperty.
 
void setHitTestable (boolean value)
 Sets the value of NodeMetadata::HitTestableProperty.
 
void setHitTestableContainer (boolean value)
 Sets the value of NodeMetadata::HitTestableContainerProperty.
 
void setHorizontalMargin (Vector2 value)
 Sets the value of NodeMetadata::HorizontalMarginProperty.
 
void setHover (boolean value)
 Sets the value of NodeMetadata::HoverProperty.
 
void setLocale (String value)
 Sets the value of NodeMetadata::LocaleProperty.
 
AbstractBindingRuntime setModifierBinding (AbstractBinding binding, PropertyType<?> propertyType)
 Sets a modifier binding.
 
AbstractBindingRuntime setModifierBinding (AbstractBinding binding, PropertyType<?> propertyType, PropertyField propertyField)
 Sets a modifier binding.
 
AbstractBindingRuntime setModifierBindingWithOwner (AbstractBinding binding, KanziObject owner, PropertyType<?> propertyType)
 Sets a modifier binding with owner.
 
AbstractBindingRuntime setModifierBindingWithOwner (AbstractBinding binding, KanziObject owner, PropertyType<?> propertyType, PropertyField propertyField)
 Sets a modifier binding with owner.
 
void setName (String name)
 Sets the value of NodeMetadata::NameProperty.
 
void setOpacity (float value)
 Sets the value of NodeMetadata::OpacityProperty.
 
void setStateManager (Resource value)
 Sets the value of NodeMetadata::StateManagerProperty.
 
void setStyle (Resource value)
 Sets the value of NodeMetadata::StyleProperty.
 
void setVerticalMargin (Vector2 value)
 Sets the value of NodeMetadata::VerticalMarginProperty.
 
void setVisible (boolean value)
 Sets the value of NodeMetadata::VisibleProperty.
 
void setWidth (float value)
 Sets the value of NodeMetadata::WidthProperty.
 
ObjectRef< TResourceTypetryAcquireResource (ResourceID resourceId)
 Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary.
 
void validateArrange ()
 Validates arrange for the node.
 
void validateDraw ()
 Validates draw flags for the node.
 
void validateMeasure ()
 Validates measure for the node.
 
void validateRender ()
 Validates render for the node.
 
- Public Member Functions inherited from NodeProxy
ResourceDictionary acquireResourceDictionary ()
 Gets a resource dictionary of a node.
 
boolean addAbstractChildOverride (Node child)
 
void addAnonymousResource (Resource resource)
 Adds anonymous resource (such as style) for object node resources.
 
void addInputManipulator (InputManipulator inputManipulator)
 Transfers the ownership and attaches an input manipulator to an object node.
 
void addNodeComponent (NodeComponent nodeComponent)
 Transfers the ownership of a node component to an object node.
 
void addResource (ResourceID resourceId, String resourceUrl)
 Adds a resource manager resource to an object node.
 
void addResourceDictionary (ResourceDictionary resourceDictionary)
 Adds a nested resource dictionary to the resource dictionary of a node.
 
void clearChangeFlag (long flag)
 Clears a change flag.
 
boolean containsResource (ResourceID resourceID)
 Returns if object node resource dictionary contains the resource with given ID.
 
void detachRecursive ()
 Detaches a node and its descendants.
 
int getAbstractChildCountOverride ()
 
int getAbstractChildIndexOverride (Node node)
 
Node getAbstractChildOverride (int index)
 
long getChangeFlags ()
 Get current change flags.
 
long getChildChangeFlags ()
 Get current child change flags.
 
ResourceDictionary getResourceDictionary ()
 If a node has a resource dictionary, returns the resource dictionary of that node.
 
boolean isAttached ()
 Gets the attached status.
 
boolean isAttaching ()
 Gets the attaching status.
 
boolean isDetaching ()
 Gets the detaching status.
 
boolean isEffectivelyEnabled ()
 Returns the value of EffectivelyEnabledProperty.
 
boolean isEffectivelyFocusable ()
 Returns whether a node is focusable.
 
boolean isEffectivelyVisible ()
 Returns whether a node and its ancestor nodes are visible.
 
boolean isInitialized ()
 Gets the initialized status.
 
boolean isNamed (String name)
 Checks if the node has the given name.
 
boolean removeAbstractChildOverride (Node child)
 
void removeAnonymousResource (Resource resource)
 Removes anonymous resource from object node resources.
 
void removeInputManipulator (InputManipulator inputManipulator)
 Removes the ownership and detaches an input manipulator from an object node.
 
void removeNodeComponent (NodeComponent nodeComponent)
 Removes the ownership of a node component from an object node.
 
void removeResource (ResourceID resourceId)
 Removes a resource with given ID from object node resource dictionary.
 
void setChangeFlag (long flag)
 Sets a change flag.
 
void setResourceDictionary (ResourceDictionary resourceDictionary)
 Replaces the resource dictionary of a node.
 
Node trySetFocus ()
 Tries to move the focus to this node.
 
Node trySetFocus (FocusFallback fallbackOption)
 Tries to set the focus to the newFocusNode using FocusManager.trySetFocus() but with a fallback behavior in case the node does not gain focus.
 
- Public Member Functions inherited from KanziObject
boolean equals (Object object)
 
Domain getDomain ()
 Returns the domain the object belongs to.
 
Metaclass getDynamicMetaclass ()
 Returns the metaclass of the dynamic type of the object.
 
long getNative ()
 Gets a pointer to the backing C++ instance.
 
TDataType getOptionalProperty (PropertyType< TDataType > propertyType)
 Returns the current value of a property type, but does not use the default value if there are no inputs to the property value.
 
TDataType getProperty (PropertyType< TDataType > propertyType)
 Returns the current value of a property type.
 
int hashCode ()
 
boolean hasValue (PropertyType< TDataType > propertyType)
 Evaluates whether there are any inputs into the property value.
 
boolean isStale ()
 Test if the object is stale i.e.
 
void removeLocalValue (PropertyType< TDataType > propertyType)
 Removes the local value associated with the property.
 
void setFlagKeepDuringPatching (PropertyType< TDataType > propertyType)
 Sets the flag to indicate that the property was loaded from KZB.
 
void setProperty (PropertyType< TDataType > propertyType, TDataType value)
 Sets the local value of a property type.
 
ObjectRef< TTypetryCreateObjectRef (Class< TType > clazz)
 Tries to create an owning ObjectRef instance to this KanziObject.
 

Static Public Attributes

static final Metaclass metaclass = com.rightware.kanzi.metadata.Node2DMetadata.metaclass
 The Metaclass for the class.
 
- Static Public Attributes inherited from Node
static final Metaclass metaclass = com.rightware.kanzi.metadata.NodeMetadata.metaclass
 The Metaclass for the class.
 
- Static Public Attributes inherited from NodeProxy
static final Metaclass metaclass = com.rightware.kanzi.metadata.NodeMetadata.metaclass
 The Metaclass for the class.
 
- Static Public Attributes inherited from KanziObject
static final Metaclass metaclass = new AbstractMetaclass("Kanzi.Object")
 The Metaclass for the class.
 

Additional Inherited Members

- Static Public Member Functions inherited from NodeProxy
static boolean isUnboundedLayoutValue (float layoutValue)
 Indicates whether a value is an unbound layout value.
 
static boolean isValidLayoutValue (float value)
 Indicates whether a value is valid layout value.
 
static float unboundedLayoutValue ()
 Returns an unbounded layout value.
 

Detailed Description

Node2D is the base class of 2D nodes.

Member Function Documentation

◆ addChild()

void addChild ( Node2D child)

Adds a child node.

Adding a 3D node node as a child of a 2D node is only allowed when adding a scene to a viewport. Screens can have only one child which is a 2D node.

◆ getActualSize()

Vector2 getActualSize ( )

Gets the actual size of a node.

Returns
Size vector.

◆ getAllocatedSize()

Vector2 getAllocatedSize ( )

Gets the allocated size of a node.

Returns
Size vector.

◆ getArrangeTransform()

Matrix3x3 getArrangeTransform ( )

Gets the arrange transform.

Returns
Transformation matrix.

◆ getDesiredSize()

Vector2 getDesiredSize ( )

Gets the desired size of a node.

Returns
Size vector.

◆ getWorldTransform()

Matrix3x3 getWorldTransform ( )

Gets the world transformation matrix.

Returns
Transformation matrix.

◆ hasChild()

boolean hasChild ( Node child)

Returns whether the given node is a child of this node.

Parameters
childThe node to check.

◆ insertChild()

void insertChild ( int index,
Node2D child )

Adds a child node for object node to given index.

Adding a 3D node node as a child of a 2D node is only allowed when adding a scene to a viewport. Screens can have only one child which is a 2D node.

◆ layout()

void layout ( )

Does layout pass with no root transformation (identity).

Otherwise same as layout() with optional Matrix3x3.

Reimplemented in Node2D.

◆ setActualSize() [1/2]

void setActualSize ( float sizeX,
float sizeY )

Sets the actual size of a node.

Parameters
sizeXThe x component of the size.
sizeYThe y component of the size.

◆ setActualSize() [2/2]

void setActualSize ( Vector2 actualSize)

Sets the actual size of a node.

Parameters
actualSizeA vector that contains the size to set.

◆ setAllocatedSize()

void setAllocatedSize ( Vector2 allocatedSize)

Sets the allocated size of a node.

If the allocated size differs from the existing allocated size, calling this function invalidates the arrange.

Parameters
allocatedSizeA vector that contains the size to set.

◆ setArrangeTransform()

void setArrangeTransform ( Matrix3x3 transform)

Sets the arrange transform.

If the layout transform differs from the existing transform, calling this function invalidates the arrange.

Parameters
transformTransformation matrix.

◆ setDesiredSize()

void setDesiredSize ( Vector2 desiredSize)

Sets the desired size of a node.

Parameters
desiredSizeA vector that contains the size to set.