Skip to content

StackUIBridge

abstract class StackUIBridge
Extends: UIBridge
Known subtypes: WindowUIBridge
Package: dev.joid.lib.bridge.ui · Module: core · Source: StackUIBridge.java

A UI bridge in which opening a screen closes the open screens and popups, while overlays and popups stack above them.

It is the usual base of a UI bridge of your own: you keep the usual opening and closing and override what your host needs. UI bridge shows one that takes every overlay.

ReturnsSignatureSummary
StackUIBridge()Creates a UI bridge with no open UI, for a subclass.

ReturnsSignatureSummary
voidopen(UI ui)Opens the UI.
voidclose(UI ui)Removes the UI; when it was leaving for a screen waiting behind its transition, that screen opens.
voidadd(UI ui)Adds the UI and lays it out at the size of the window; calls attachScreen() when it is the first screen or popup.
voidremove(UI ui)Removes the UI; calls detachScreen() when it was the last screen or popup.
booleancanHandle(Class<? extends UI> clazz)Returns true: the bridge accepts every UI.
voidforceOpen(UI ui)Closes every UI and opens this one, without calling detachScreen() and attachScreen() between them when a screen stays open.
voidreplace(UI ui, UI replacement)Replaces the first UI with the second, without calling detachScreen() and attachScreen() between them.
booleancanReplace(UI ui)If true, opening a screen closes this open screen or popup; it returns true by default.
ReturnsSignatureSummary
voidattachScreen() hook protectedJOID calls it when the first screen or popup of the bridge opens; overlays do not count.
voiddetachScreen() hook protectedJOID calls it when the last screen or popup of the bridge closes; overlays do not count.
Inherited from UIBridge (17)

load · update · mouseMoved · mousePressed · mouseReleased · mouseScroll · charTyped · keyPressed · keyReleased · isKeyConsumed · draw · isOpen · isOnTop · getUiList · isScreenOpen · isOverlayHidden · drawHover

Inherited from IUIBridge (2)

getInterfaceScale · closeAll

StackUIBridge()

Creates a UI bridge with no open UI, for a subclass.

void open(UI ui)

Opens the UI. An open UI moves to the front and its closing transition stops; an overlay or a popup is added; a screen first closes every open screen and popup that canReplace accepts, and waits for their closing transition before it is added. A UI that refuses to close keeps the screen from opening, with a dev warning.

void close(UI ui)

Removes the UI; when it was leaving for a screen waiting behind its transition, that screen opens.

void add(UI ui)

Adds the UI and lays it out at the size of the window; calls attachScreen() when it is the first screen or popup.

void remove(UI ui)

Removes the UI; calls detachScreen() when it was the last screen or popup.

boolean canHandle(Class<? extends UI> clazz)

Returns true: the bridge accepts every UI.

void forceOpen(UI ui)

Closes every UI and opens this one, without calling detachScreen() and attachScreen() between them when a screen stays open.

void replace(UI ui, UI replacement)

Replaces the first UI with the second, without calling detachScreen() and attachScreen() between them.

boolean canReplace(UI ui)

If true, opening a screen closes this open screen or popup; it returns true by default. Return false to keep the UI below the new screen.

void attachScreen() hook protected

JOID calls it when the first screen or popup of the bridge opens; overlays do not count. Override it to free the cursor of the host or pause its input, as in Follow the screens that JOID opens; it does nothing by default.

void detachScreen() hook protected

JOID calls it when the last screen or popup of the bridge closes; overlays do not count. Override it to give the cursor and the input back to the host; it does nothing by default.


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