Kanzi 4.1.0
NodeProxy Class Reference

Base class for Kanzi nodes. More...

Inheritance diagram for NodeProxy:
[legend]

Public Member Functions

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 attachRecursive ()
 Attaches an object node and its children recursively.
 
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.
 
KanziObject lookupObject (String relativePath)
 Lookup for an object from a node.
 
void notifyResourceDictionaryModified ()
 Forces the re-evaluation of resource IDs in a node tree.
 
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 Member Functions

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.
 

Static Public Attributes

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

- Public Attributes inherited from NodeMetadata
DynamicPropertyType< FloatActualDepthProperty
 The calculated size of the node in depth direction when used in a layout.
 
DynamicPropertyType< FloatActualHeightProperty
 The calculated height of the node when used in a layout.
 
DynamicPropertyType< FloatActualWidthProperty
 The calculated width of the node when used in a layout.
 
DynamicPropertyType< BooleanClipChildrenProperty
 Sets whether to clip the child nodes of this node.
 
DynamicPropertyType< NodeEnums.ContentStretchContentStretchProperty
 Sets how the content that belongs to this node is stretched (as opposed to manipulating the actual node size).
 
DynamicPropertyType< BooleanCreatedFromKZBProperty
 Kanzi internally uses this property to distinguish objects like bindings and triggers created in code from objects that are loaded from a kzb file.
 
DynamicPropertyType< NodeEnums.DepthAlignmentDepthAlignmentProperty
 The alignment in depth direction the node should use when it resides under a layout.
 
DynamicPropertyType< Vector2DepthMarginProperty
 Sets the depth distance between this node and other nodes that are adjacent to this node in a layout.
 
DynamicPropertyType< FloatDepthProperty = new DynamicPropertyType<>("Node.Depth", Float.class)
 The size of the node in depth direction when used in a layout.
 
DynamicPropertyType< BooleanEffectivelyEnabledProperty
 Indicates whether this node and its ancestor nodes are enabled.
 
DynamicPropertyType< BooleanEnabledProperty
 Whether this node is enabled.
 
DynamicPropertyType< BooleanFocusableProperty
 Indicates whether the node can receive focus.
 
DynamicPropertyType< BooleanFocusedProperty
 Indicates whether the node has the key focus.
 
DynamicPropertyType< FocusStateFocusStateProperty
 Reports the focus state of a node:
 
DynamicPropertyType< ResourceFontFamilyProperty
 The font family used to render the text.
 
DynamicPropertyType< FloatHeightProperty
 The height of the node when used in a layout.
 
DynamicPropertyType< BooleanHitTestableContainerProperty
 When enabled, Kanzi uses the layout bounds as geometry for hit testing.
 
DynamicPropertyType< BooleanHitTestableProperty
 When enabled, the node can be hit tested.
 
DynamicPropertyType< NodeEnums.HorizontalAlignmentHorizontalAlignmentProperty
 The alignment in horizontal direction the node should use when it resides under a layout.
 
DynamicPropertyType< Vector2HorizontalMarginProperty
 Sets the horizontal space between this node and other nodes that are adjacent to this node in a layout.
 
DynamicPropertyType< BooleanHoverProperty
 Indicates whether a node is the foremost hit testable node under the cursor.
 
DynamicPropertyType< String > LocaleProperty
 The locale of the node.
 
AbstractMetaclass metaclass = new AbstractMetaclass("Kanzi.Node")
 Metaclass for Node.
 
DynamicPropertyType< String > NameProperty = new DynamicPropertyType<>("Node.Name", String.class)
 Node name.
 
DynamicPropertyType< FloatOpacityProperty
 Opacity of the node.
 
DynamicPropertyType< String > PathProperty = new DynamicPropertyType<>("Node.Path", String.class)
 Full path to the node.
 
DynamicPropertyType< FloatProjection2DTo3DScaleProperty
 Sets the scale factor to project pixels to 3D size.
 
DynamicPropertyType< ResourceStateManagerProperty
 Sets the State Manager to the node.
 
DynamicPropertyType< ResourceStyleProperty
 Sets a style to the node.
 
DynamicPropertyType< NodeEnums.VerticalAlignmentVerticalAlignmentProperty
 The alignment in vertical direction the node should use when it resides under a layout.
 
DynamicPropertyType< Vector2VerticalMarginProperty
 Sets the vertical space between this node and other nodes that are adjacent to this node in a layout.
 
DynamicPropertyType< FloatVisibleAmountInParentProperty
 Sets the amount the node is inside its parent.
 
DynamicPropertyType< BooleanVisibleProperty
 When disabled, Kanzi does not render the node.
 
DynamicPropertyType< FloatWidthProperty = new DynamicPropertyType<>("Node.Width", Float.class)
 The width of the node when used in a layout.
 

Detailed Description

Base class for Kanzi nodes.

Member Function Documentation

◆ acquireResourceDictionary()

ResourceDictionary acquireResourceDictionary ( )

Gets a resource dictionary of a node.

If a resource dictionary does not exist, the function creates it.

Returns
The resource dictionary of the node.

◆ addInputManipulator()

void addInputManipulator ( InputManipulator inputManipulator)

Transfers the ownership and attaches an input manipulator to an object node.

Parameters
inputManipulatorThe input manipulator to add.

◆ addResource()

void addResource ( ResourceID resourceId,
String resourceUrl )

Adds a resource manager resource to an object node.

If resourceID already exists in object, removes the existing entry. If resourceURL is NULL, error is thrown.

◆ addResourceDictionary()

void addResourceDictionary ( ResourceDictionary resourceDictionary)

Adds a nested resource dictionary to the resource dictionary of a node.

Updates all the resource references of the child nodes.

Parameters
resourceDictionaryThe nested resource dictionary.

◆ attachRecursive()

void attachRecursive ( )

Attaches an object node and its children recursively.

Deprecated
In Kanzi 3.9.6.

Reimplemented in Node.

◆ containsResource()

boolean containsResource ( ResourceID resourceID)

Returns if object node resource dictionary contains the resource with given ID.

Resource can be any type: style, alias or resource manager resource.

◆ getChangeFlags()

long getChangeFlags ( )

Get current change flags.

Returns
Change flags directly.

◆ getChildChangeFlags()

long getChildChangeFlags ( )

Get current child change flags.

Returns
Child change flags directly.

◆ getResourceDictionary()

ResourceDictionary getResourceDictionary ( )

If a node has a resource dictionary, returns the resource dictionary of that node.

Returns
The resource dictionary of the node. If the node does not have a resource dictionary, returns nullptr.

◆ isAttached()

boolean isAttached ( )

Gets the attached status.

Returns
true if the node is attached to a screen or one of its descendants, false otherwise.

◆ isAttaching()

boolean isAttaching ( )

Gets the attaching status.

Returns
true if node is currently in the process of attaching, false otherwise.

◆ isDetaching()

boolean isDetaching ( )

Gets the detaching status.

Returns
true if the node currently in the process of detaching, false otherwise.

◆ isEffectivelyFocusable()

boolean isEffectivelyFocusable ( )

Returns whether a node is focusable.

A node is focusable when it is a focus scope node or has FocusableProperty attached and set to true, or both.

Returns
If the node is focusable, returns true, otherwise false.

◆ isInitialized()

boolean isInitialized ( )

Gets the initialized status.

Returns
true if initialize() has been called, false otherwise.

◆ isNamed()

boolean isNamed ( String name)

Checks if the node has the given name.

Parameters
nameName to compare against.
Returns
If the name matches true, false otherwise.

◆ isUnboundedLayoutValue()

static boolean isUnboundedLayoutValue ( float layoutValue)
static

Indicates whether a value is an unbound layout value.

Parameters
layoutValueValue to test if it is unbound layout value.
Returns
true if the layoutValue is unbound layout value, false otherwise.

◆ isValidLayoutValue()

static boolean isValidLayoutValue ( float value)
static

Indicates whether a value is valid layout value.

Valid layout value is a non-negative floating point number. Valid layout value can be positive infinity (unbounded layout value).

Parameters
valueValue to test if it is unbound layout value.
Returns
true if the value if valid layout value, false otherwise.

◆ lookupObject()

KanziObject lookupObject ( String relativePath)

Lookup for an object from a node.

Object found may be another node or a resource within a node.

Parameters
relativePathRelative path to use for lookup.
Returns
handle referencing object. May be empty if no object found.

Reimplemented in Node.

◆ notifyResourceDictionaryModified()

void notifyResourceDictionaryModified ( )

Forces the re-evaluation of resource IDs in a node tree.

If you modify a resource dictionary of a node that is already attached, you can use this function to update the resource properties. Note that you need to use this function only if you modify the dictionary directly through getResourceDictionary or acquireResourceDictionary. If you use other Node class functions like addResource or setResourceDictionary, you do not need to call this function.

Reimplemented in Node.

◆ removeInputManipulator()

void removeInputManipulator ( InputManipulator inputManipulator)

Removes the ownership and detaches an input manipulator from an object node.

Parameters
inputManipulatorThe input manipulator to remove.

◆ removeResource()

void removeResource ( ResourceID resourceId)

Removes a resource with given ID from object node resource dictionary.

Does not do anything if resourceID was not found.

◆ setResourceDictionary()

void setResourceDictionary ( ResourceDictionary resourceDictionary)

Replaces the resource dictionary of a node.

Updates all the resource references of the child nodes.

Parameters
resourceDictionaryThe resource dictionary.

◆ trySetFocus() [1/2]

Node trySetFocus ( )

Tries to move the focus to this node.

If this node is a focus scope node, this method tries to focus the preserved focus of the focus scope, or tries to focus on the first focusable descendant node of this node. This is a convenience function of the FocusManager.trySetFocus(), that uses the node as target node.

Returns
If this method successfully moved focus, returns this node or a descendant node of this node. If this method did not move focus, returns nullptr.

◆ trySetFocus() [2/2]

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.

Parameters
fallbackOptionThe fallback behavior: This moves the focus to the last-focused node of that overlay.
Returns
The node that has focus.

◆ unboundedLayoutValue()

static float unboundedLayoutValue ( )
static

Returns an unbounded layout value.

Returns
Unbounded layout value.