GraphNode

class GraphNode(val title: String, val inputs: List<Port> = emptyList(), val outputs: List<Port> = emptyList(), var position: Vector2 = Vector2.ZERO, val data: Any? = null)(source)

a node of a NodeEditor: its title, its inputs at the left and outputs at the right, at position; under the ports the body that the host draws, and under that the status

Constructors

Link copied to clipboard
constructor(title: String, inputs: List<Port> = emptyList(), outputs: List<Port> = emptyList(), position: Vector2 = Vector2.ZERO, data: Any? = null)

Properties

Link copied to clipboard
var body: (drawer: Drawer, box: Rectangle) -> Unit?

draws the body of the node, in the box of bodyHeight under the ports, in the coordinates of the graph; call NodeEditor.requestRedraw when what it draws changes

Link copied to clipboard
val bodyBounds: Rectangle

the box of the body in the coordinates of the graph, without height when it is not drawn

Link copied to clipboard

the height of the body in the coordinates of the graph

Link copied to clipboard

handles the pointer in the body, like for a toggle or a slider drawn there: called with a press in the body, true takes the press, after which the drags and the release go here too, and the node is neither selected nor moved; false lets the press select and move the node. The editor redraws after every call. Changes made here can be undone by recording them in org.openrndr.panel.editHistory of the editor.

Link copied to clipboard
val bounds: Rectangle
Link copied to clipboard

true when the node is drawn compact: the title and the rows of the ports that are connected only, without its body and its status, whose color still tints the title; null follows NodeEditor.compactNodes. A compact node shows all its ports while a wire is dragged over it. See NodeEditor.setCompact for a change that can be undone

Link copied to clipboard
val data: Any?

whatever the node stands for

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

true when the node is drawn compact now, see compact

Link copied to clipboard
Link copied to clipboard
var position: Vector2
Link copied to clipboard

a line of text under the node, like an error or a value, in statusColor

Link copied to clipboard
var statusColor: ColorRGBa?

the color of the status, which also tints the title bar, like red for an error; none draws neither

Link copied to clipboard
var tint: ColorRGBa?

a color the node is drawn in, like for the kind of node it is: it tints the title bar, the outline when the node is neither selected nor highlighted, and faintly the box; a statusColor still tints the title bar

Link copied to clipboard
Link copied to clipboard

the width of the node in the coordinates of the graph

Functions

Link copied to clipboard
fun inputPosition(i: Int): Vector2

the position of the input i in the coordinates of the graph, at the left of the title bar when it is hidden

Link copied to clipboard

true when the input i is shown, false when the node is compact and the input is not connected

Link copied to clipboard

true when the output i is shown, false when the node is compact and the output is not connected

Link copied to clipboard
fun outputPosition(i: Int): Vector2

the position of the output i in the coordinates of the graph, at the right of the title bar when it is hidden