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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| StackUIBridge() | Creates a UI bridge with no open UI, for a subclass. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | open(UI ui) | Opens the UI. |
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. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | attachScreen() hook protected | JOID calls it when the first screen or popup of the bridge opens; overlays do not count. |
void | detachScreen() hook protected | JOID 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)
Creation details
Section titled “Creation details”StackUIBridge
Section titled “StackUIBridge”StackUIBridge()
Creates a UI bridge with no open UI, for a subclass.
Method details
Section titled “Method details”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.
remove
Section titled “remove”void remove(UI ui)
Removes the UI; calls detachScreen() when it was the last screen or popup.
canHandle
Section titled “canHandle”boolean canHandle(Class<? extends UI> clazz)
Returns true: the bridge accepts every UI.
forceOpen
Section titled “forceOpen”void forceOpen(UI ui)
Closes every UI and opens this one, without calling detachScreen() and attachScreen() between them when a screen stays open.
replace
Section titled “replace”void replace(UI ui, UI replacement)
Replaces the first UI with the second, without calling detachScreen() and attachScreen() between them.
canReplace
Section titled “canReplace”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.
attachScreen
Section titled “attachScreen”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.
detachScreen
Section titled “detachScreen”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
