UIDataObject
final class UIDataObject
Package: dev.joid.lib.ui.core.data · Module: core · Source: UIDataObject.java
The options of @UIData for a running UI, read from the annotation and changed by its setters.
Description
Section titled “Description”UI.getData returns it.
Each option has a getter and a setter of the same name, such as closeable() and closeable(boolean), and the setter returns the object for chaining; UIData gives the meaning of each option.
A change applies from the next frame; reload() reads the annotation again and keeps the options that the annotation did not change.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
UIDataObject | create() factory | Creates the options with the default values of UIData. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| backgroundColor | String | "#101010C0" | Color of the UI backdrop, as a hexadecimal string #RRGGBB or #RRGGBBAA. |
| zindex | int | 0 | Order of the UI among the open UIs of its bridge. |
| zlevel | double | 0D | Depth added along the Z axis before the UI is drawn. |
| active | boolean | true | If false, the UI is drawn but receives no input. |
| visible | boolean | true | If false, the UI is neither drawn nor sent any input. |
| zoomable | boolean | true | If false, the zoom keys of dev mode leave the zoom of the UI unchanged. |
| closeable | boolean | true | If false, Escape leaves the UI open. |
| projection | boolean | true | If true, the UI sets its own projection over the window. |
| background | boolean | false | If true, the UI draws the UI backdrop behind its nodes. |
| anchorX | Align | Align.CENTER | Side of the window that the canvas is pinned to horizontally. |
| anchorY | Align | Align.CENTER | Side of the window that the canvas is pinned to vertically. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
double | getAnchorPositionX() | The horizontal anchor as a position on the canvas: 0, 960 or 1920 design pixels. |
double | getAnchorPositionY() | The vertical anchor as a position on the canvas: 0, 540 or 1080 design pixels. |
Color | getBackgroundColor() | Returns the color of the UI backdrop as a Color, decoded once when backgroundColor changes. |
String | toString() | Returns the class and the value of every option, for logs. |
Creation details
Section titled “Creation details”create
Section titled “create”UIDataObject create() factory
Creates the options with the default values of UIData.
Property details
Section titled “Property details”backgroundColor
Section titled “backgroundColor”this backgroundColor(String backgroundColor)fluentString backgroundColor()
Default: "#101010C0"
Color of the UI backdrop, as a hexadecimal string #RRGGBB or #RRGGBBAA.
zindex
Section titled “zindex”this zindex(int zindex)fluentint zindex()
Default: 0
Order of the UI among the open UIs of its bridge.
zlevel
Section titled “zlevel”this zlevel(double zlevel)fluentdouble zlevel()
Default: 0D
Depth added along the Z axis before the UI is drawn.
active
Section titled “active”this active(boolean active)fluentboolean active()
Default: true
If false, the UI is drawn but receives no input.
visible
Section titled “visible”this visible(boolean visible)fluentboolean visible()
Default: true
If false, the UI is neither drawn nor sent any input.
zoomable
Section titled “zoomable”this zoomable(boolean zoomable)fluentboolean zoomable()
Default: true
If false, the zoom keys of dev mode leave the zoom of the UI unchanged.
closeable
Section titled “closeable”this closeable(boolean closeable)fluentboolean closeable()
Default: true
If false, Escape leaves the UI open.
projection
Section titled “projection”this projection(boolean projection)fluentboolean projection()
Default: true
If true, the UI sets its own projection over the window.
background
Section titled “background”this background(boolean background)fluentboolean background()
Default: false
If true, the UI draws the UI backdrop behind its nodes.
anchorX
Section titled “anchorX”this anchorX(Align anchorX)fluentAlign anchorX()
Default: Align.CENTER
Side of the window that the canvas is pinned to horizontally.
anchorY
Section titled “anchorY”this anchorY(Align anchorY)fluentAlign anchorY()
Default: Align.CENTER
Side of the window that the canvas is pinned to vertically.
Method details
Section titled “Method details”getAnchorPositionX
Section titled “getAnchorPositionX”double getAnchorPositionX()
The horizontal anchor as a position on the canvas: 0, 960 or 1920 design pixels.
getAnchorPositionY
Section titled “getAnchorPositionY”double getAnchorPositionY()
The vertical anchor as a position on the canvas: 0, 540 or 1080 design pixels.
getBackgroundColor
Section titled “getBackgroundColor”Color getBackgroundColor()
Returns the color of the UI backdrop as a Color, decoded once when backgroundColor changes.
toString
Section titled “toString”String toString()
Returns the class and the value of every option, for logs.
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
