CollapsibleComponent

class CollapsibleComponent(val title: Supplier<GuiComponent>, val body: Supplier<GuiComponent>, val collapsedState: GetSetter<Boolean> = GetSetter.floating( true )) : GuiComponent(source)

Constructors

Link copied to clipboard
constructor(title: Supplier<GuiComponent>, body: Supplier<GuiComponent>, collapsedState: GetSetter<Boolean> = GetSetter.floating( true ))

Types

Link copied to clipboard
object Companion

Properties

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

Functions

Link copied to clipboard
open fun blur()

Unfocus this element only if this element is selected.

Link copied to clipboard
open fun <T : Any> foldChildren(initial: T, @NotNull visitor: @NotNull BiFunction<@NotNull GuiComponent, T, T>): T

Walk over the direct children of this element. A gui element that composites other gui elements should override this method. By default, the initial element is returned without change.

Link copied to clipboard
fun <T : Any> foldRecursive(initial: T, @NotNull visitor: @NotNull BiFunction<@NotNull GuiComponent, T, T>): T

Walk the scene tree of this gui element, including children of children. By default, the visitor is called with only this element.

Link copied to clipboard
open override fun getHeight(): Int

Get the requested y size for this element. This is opposed to the actual size given in the context. Giving this element less space than this may result in misaligned or overlapping rendering.

Link copied to clipboard
open override fun getWidth(): Int

Get the requested x size for this element. This is opposed to the actual size given in the context. Giving this element less space than this may result in misaligned or overlapping rendering.

Link copied to clipboard
open fun isFocused(): Boolean

Test if this element is focused.

Link copied to clipboard
open fun isInFocus(): Boolean

Test if this element is focused, or has a focused child.

Link copied to clipboard
open override fun keyboardEvent(event: KeyboardEvent, context: GuiImmediateContext): Boolean

Called by the parent renderer.

Link copied to clipboard
open override fun mouseEvent(mouseEvent: MouseEvent, context: GuiImmediateContext): Boolean

Called by the parent renderer.

Link copied to clipboard
open fun onGainedFocus()

This method is called by the gui context when an element gains focus. This does only get called if this element specifically is being focused.

Link copied to clipboard
open fun onLostFocus()

This method is called by the gui context when an element loses focus. This does only get called if this element specifically was focused.

Link copied to clipboard
open override fun render(context: GuiImmediateContext)

Called by the parent renderer. The GL matrix stack is pre-transformed, so rendering can begin at (0, 0) and should not render beyond what the context says is available.

Link copied to clipboard
open fun requestFocus()

Call this method to request focus in the current gui context.

Link copied to clipboard
open fun setContext(context: GuiContext)
Link copied to clipboard
open fun setFocus(shouldFocus: Boolean)

Focuses or blurs this element depending on shouldFocus