GroupNode

open class GroupNode(val children: MutableList<CompositionNode> = mutableListOf()) : CompositionNode(source)

Represents a group node in a composition hierarchy. A GroupNode itself does not have explicit contents but serves as a container for managing child nodes. It allows grouping of multiple CompositionNode instances and provides functionalities like calculating the bounds for all its child elements and copying itself with overrides.

Inheritors

Constructors

Link copied to clipboard
constructor(children: MutableList<CompositionNode> = mutableListOf())

Properties

Link copied to clipboard

Custom attributes to be applied to the Node in addition to the Style attributes.

Link copied to clipboard
open override val bounds: Rectangle

a Rectangle that describes the bounding box of the contents

Link copied to clipboard

A mutable list of child nodes belonging to this group. Defaults to an empty list.

Link copied to clipboard
Link copied to clipboard
val effectiveFill: ColorRGBa?
Link copied to clipboard
Link copied to clipboard
val effectiveLineCap: LineCap
Link copied to clipboard
val effectiveLineJoin: LineJoin
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val effectiveShadeStyle: ShadeStyle
Link copied to clipboard
val effectiveStroke: ColorRGBa?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This CompositionNode's computed style. Where every style attribute is obtained by overwriting the Style in the following order:

Link copied to clipboard
val effectiveTransform: Matrix44

Calculates the absolute transformation of the current node.

Link copied to clipboard
Link copied to clipboard
var fill: ColorRGBa?
Link copied to clipboard
Link copied to clipboard
var id: String?
Link copied to clipboard
var lineCap: LineCap
Link copied to clipboard
var lineJoin: LineJoin
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var shadeStyle: ShadeStyle
Link copied to clipboard
var stroke: ColorRGBa?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This CompositionNode's own style.

Link copied to clipboard
var transform: Matrix44
Link copied to clipboard

a map that stores user data

Functions

Link copied to clipboard
fun copy(id: String? = this.id, parent: CompositionNode? = null, style: Style = this.style, children: MutableList<CompositionNode> = this.children): GroupNode
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Filters a CompositionNode and its hierarchy based on the provided filter function. The method recursively applies the filter to the node and its children, creating a new hierarchy that contains only the nodes for which the filter returns true. If the filter condition fails for the root node, null is returned.

Link copied to clipboard

Finds first CompositionNode to match the given predicate.

Link copied to clipboard

Finds all CompositionNode instances in the current node hierarchy that satisfy the given filter. Traverses the hierarchy recursively, evaluating each node and its children.

Link copied to clipboard

find all descendant GroupNode nodes, including potentially this node

Link copied to clipboard

find all descendant ImageNode nodes, including potentially this node

Link copied to clipboard

find all descendant ShapeNode nodes, including potentially this node

Link copied to clipboard

Recursively finds all terminal nodes within the composition tree starting from the current node and applies the provided filter to determine which nodes to include in the result.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard

remove node from its parent CompositionNode

Link copied to clipboard

visit this CompositionNode and all descendant nodes and execute visitor