WindowBasedTextGUI
AbstractTextGUI
, MultiWindowTextGUI
public interface TextGUI
getGUIThread()
.Modifier and Type | Interface | Description |
---|---|---|
static interface |
TextGUI.Listener |
Listener interface for TextGUI, firing on events related to the overall GUI
|
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(TextGUI.Listener listener) |
Adds a listener to this TextGUI to fire events on.
|
Interactable |
getFocusedInteractable() |
Returns the interactable component currently in focus
|
TextGUIThread |
getGUIThread() |
The first time this method is called, it will create a new TextGUIThread object that you can use to automatically
manage this TextGUI instead of manually calling
processInput() and updateScreen() . |
Screen |
getScreen() |
Returns the
Screen for this WindowBasedTextGUI |
Theme |
getTheme() |
Returns the theme currently assigned to this
TextGUI |
boolean |
isPendingUpdate() |
This method can be used to determine if any component has requested a redraw.
|
boolean |
processInput() |
Drains the input queue and passes the key strokes to the GUI system for processing.
|
void |
removeListener(TextGUI.Listener listener) |
Removes a listener from this TextGUI so that it will no longer receive events
|
void |
setTheme(Theme theme) |
Sets the global theme to be used by this TextGUI.
|
void |
setVirtualScreenEnabled(boolean virtualScreenEnabled) |
This method controls whether or not the virtual screen should be used.
|
void |
updateScreen() |
Updates the screen, to make any changes visible to the user.
|
Theme getTheme()
TextGUI
Theme
void setTheme(Theme theme)
theme
- Theme to use as the default theme for this TextGUIboolean processInput() throws IOException
true
if at least one key stroke was read and processed, false
if there was nothing on the
input queue (only for non-blocking IO)IOException
- In case there was an underlying I/O errorEOFException
- In the input stream received an EOF markerScreen getScreen()
Screen
for this WindowBasedTextGUI
Screen
used by this WindowBasedTextGUI
void updateScreen() throws IOException
IOException
- In case there was an underlying I/O errorboolean isPendingUpdate()
true
, you may want to call updateScreen()
.true
if this TextGUI has a change and is waiting for someone to call updateScreen()
void setVirtualScreenEnabled(boolean virtualScreenEnabled)
false
, the virtual screen will be bypassed and any content outside of the screen will be cropped. This
property is true
by default.virtualScreenEnabled
- If true
, then virtual screen will be used, otherwise it is bypassedTextGUIThread getGUIThread()
processInput()
and updateScreen()
. After the
initial call, it will return the same object as it was originally returning.TextGUIThread
implementation that can be used to asynchronously manage the GUIInteractable getFocusedInteractable()
void addListener(TextGUI.Listener listener)
listener
- Listener to addvoid removeListener(TextGUI.Listener listener)
listener
- Listener to removeCopyright © 2020. All rights reserved.