INode
interface INode
Extends: IIndexedElement
Known subtypes: Node
Package: dev.joid.lib.ui.node · Module: core · Source: INode.java
The hooks that JOID calls on a node, all empty by default, that a node of your own overrides.
Description
Section titled “Description”Node implements it; override only the hooks you need, and call super to keep the behavior of a built-in node.
Every hook runs on the render thread.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | init(UI ui) hook default | Called when the node is loaded into a UI, after its children and its effects and before onInit. |
void | update() hook default | Called on every frame, after the children are updated and before the node is drawn. |
void | layout() hook default | Called on every frame, after the node is placed and before its children are drawn: place the children and the parts here with layoutPosition and layoutSize. |
void | draw(double mouseX, double mouseY) hook default | Draws the node at getX(), getY(), with the mouse at this point of the canvas, once it is mounted. |
void | drawSkeleton(double mouseX, double mouseY) hook default | Draws the node in place of draw while one of its wait conditions fails and it has no skeleton node. |
void | mousePressed(NodeMouseEvent<?> event) hook default | Called when a mouse press reaches the node, after its handleMousePressed listeners. |
void | mouseReleased(NodeMouseEvent<?> event) hook default | Called when a mouse release reaches the node. |
void | mouseDragged(NodeMouseEvent<?> event) hook default | Called when the mouse moves with a button held. |
void | mouseScroll(NodeMouseScrollEvent<?> event) hook default | Called when a wheel turn reaches the node, after the node has scrolled its own content. |
void | charTyped(NodeCharEvent<?> event) hook default | Called when a typed character reaches the node. |
void | keyPressed(NodeKeyEvent<?> event) hook default | Called when a key press reaches the node. |
void | keyReleased(NodeKeyEvent<?> event) hook default | Called when a key release reaches the node. |
void | detach() hook default | Called when the node leaves its UI, after its children: release here what init started. |
Method details
Section titled “Method details”void init(UI ui) hook default
Called when the node is loaded into a UI, after its children and its effects and before onInit.
update
Section titled “update”void update() hook default
Called on every frame, after the children are updated and before the node is drawn. Measure a size that depends on the content here, so that a layout node sees it on the same frame.
layout
Section titled “layout”void layout() hook default
Called on every frame, after the node is placed and before its children are drawn: place the children and the parts here with layoutPosition and layoutSize.
void draw(double mouseX, double mouseY) hook default
Draws the node at getX(), getY(), with the mouse at this point of the canvas, once it is mounted.
drawSkeleton
Section titled “drawSkeleton”void drawSkeleton(double mouseX, double mouseY) hook default
Draws the node in place of draw while one of its wait conditions fails and it has no skeleton node.
mousePressed
Section titled “mousePressed”void mousePressed(NodeMouseEvent<?> event) hook default
Called when a mouse press reaches the node, after its handleMousePressed listeners.
The event can already be consumed: check it before acting.
mouseReleased
Section titled “mouseReleased”void mouseReleased(NodeMouseEvent<?> event) hook default
Called when a mouse release reaches the node.
mouseDragged
Section titled “mouseDragged”void mouseDragged(NodeMouseEvent<?> event) hook default
Called when the mouse moves with a button held.
mouseScroll
Section titled “mouseScroll”void mouseScroll(NodeMouseScrollEvent<?> event) hook default
Called when a wheel turn reaches the node, after the node has scrolled its own content.
charTyped
Section titled “charTyped”void charTyped(NodeCharEvent<?> event) hook default
Called when a typed character reaches the node.
keyPressed
Section titled “keyPressed”void keyPressed(NodeKeyEvent<?> event) hook default
Called when a key press reaches the node.
keyReleased
Section titled “keyReleased”void keyReleased(NodeKeyEvent<?> event) hook default
Called when a key release reaches the node.
detach
Section titled “detach”void detach() hook default
Called when the node leaves its UI, after its children: release here what init started.
A detach that throws prints a warning, and the node is detached anyway.
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
