Skip to content

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.

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.

ReturnsSignatureSummary
UIDataObjectcreate() factoryCreates the options with the default values of UIData.

PropertyTypeDefaultSummary
backgroundColorString"#101010C0"Color of the UI backdrop, as a hexadecimal string #RRGGBB or #RRGGBBAA.
zindexint0Order of the UI among the open UIs of its bridge.
zleveldouble0DDepth added along the Z axis before the UI is drawn.
activebooleantrueIf false, the UI is drawn but receives no input.
visiblebooleantrueIf false, the UI is neither drawn nor sent any input.
zoomablebooleantrueIf false, the zoom keys of dev mode leave the zoom of the UI unchanged.
closeablebooleantrueIf false, Escape leaves the UI open.
projectionbooleantrueIf true, the UI sets its own projection over the window.
backgroundbooleanfalseIf true, the UI draws the UI backdrop behind its nodes.
anchorXAlignAlign.CENTERSide of the window that the canvas is pinned to horizontally.
anchorYAlignAlign.CENTERSide of the window that the canvas is pinned to vertically.

ReturnsSignatureSummary
doublegetAnchorPositionX()The horizontal anchor as a position on the canvas: 0, 960 or 1920 design pixels.
doublegetAnchorPositionY()The vertical anchor as a position on the canvas: 0, 540 or 1080 design pixels.
ColorgetBackgroundColor()Returns the color of the UI backdrop as a Color, decoded once when backgroundColor changes.
StringtoString()Returns the class and the value of every option, for logs.

UIDataObject create() factory

Creates the options with the default values of UIData.

  • this backgroundColor(String backgroundColor) fluent
  • String backgroundColor()

Default: "#101010C0"

Color of the UI backdrop, as a hexadecimal string #RRGGBB or #RRGGBBAA.

  • this zindex(int zindex) fluent
  • int zindex()

Default: 0

Order of the UI among the open UIs of its bridge.

  • this zlevel(double zlevel) fluent
  • double zlevel()

Default: 0D

Depth added along the Z axis before the UI is drawn.

  • this active(boolean active) fluent
  • boolean active()

Default: true

If false, the UI is drawn but receives no input.

  • this visible(boolean visible) fluent
  • boolean visible()

Default: true

If false, the UI is neither drawn nor sent any input.

  • this zoomable(boolean zoomable) fluent
  • boolean zoomable()

Default: true

If false, the zoom keys of dev mode leave the zoom of the UI unchanged.

  • this closeable(boolean closeable) fluent
  • boolean closeable()

Default: true

If false, Escape leaves the UI open.

  • this projection(boolean projection) fluent
  • boolean projection()

Default: true

If true, the UI sets its own projection over the window.

  • this background(boolean background) fluent
  • boolean background()

Default: false

If true, the UI draws the UI backdrop behind its nodes.

  • this anchorX(Align anchorX) fluent
  • Align anchorX()

Default: Align.CENTER

Side of the window that the canvas is pinned to horizontally.

  • this anchorY(Align anchorY) fluent
  • Align anchorY()

Default: Align.CENTER

Side of the window that the canvas is pinned to vertically.

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.


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