Skip to content

TransformNodeEffect

class TransformNodeEffect
Extends: NodeEffect<Node>
Package: dev.joid.lib.ui.node.effect.impl · Module: core · Source: TransformNodeEffect.java

Moves, rotates or scales the drawing of a node and its children without changing the layout.

A blue rectangle rotated by 20 degrees

The effect applies a Transformation to the model-view matrix while the node and its children draw. A rotation or a scale without a pivot of its own turns or scales around the center of the node. Its priority is -100, the lowest of the built-in effects, so it moves the shadow, the mask and the pixel effects with the node. The node still receives the mouse at its layout position.

ReturnsSignatureSummary
TransformNodeEffectcreate(Transformation transformation) factoryCreates an effect that applies the operations of this transformation, in their order.
TransformNodeEffect(Transformation transformation) protectedCalled by a subclass with the same argument as create.

PropertyTypeDefaultSummary
transformationTransformationset at creationOperations applied to the drawing of the node.
Inherited from NodeEffect (2)

priority · scope

ReturnsSignatureSummary
voiddraw(Node node, Runnable body)Saves the model-view matrix, applies the transformation around the center of the node, draws the node, then restores the matrix, even when the drawing throws.
Inherited from NodeEffect (4)

shouldApply · toShaderPass · toShaderPasses · copy

TransformNodeEffect create(Transformation transformation) factory

Creates an effect that applies the operations of this transformation, in their order.

TransformNodeEffect(Transformation transformation) protected

Called by a subclass with the same argument as create.

  • this transformation(Transformation transformation) fluent
  • Transformation getTransformation()

Default: set at creation

Operations applied to the drawing of the node. A rotation that reads a Supplier for its angle follows it, so an animation turns the node without replacing the transformation.

void draw(Node node, Runnable body)

Saves the model-view matrix, applies the transformation around the center of the node, draws the node, then restores the matrix, even when the drawing throws.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page