public interface TextGUI
getGUIThread()
.Modifier and Type | Interface and Description |
---|---|
static interface |
TextGUI.Listener
Listener interface for TextGUI, firing on events related to the overall GUI
|
Modifier and Type | Method and 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() . |
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 |
updateScreen()
Updates the screen, to make any changes visible to the user.
|
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 markervoid 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()
TextGUIThread 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 © 2016. All rights reserved.