public class GUIScreen extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GUIScreen.Position
Where to position a window that is to be put on the screen
|
Modifier and Type | Field and Description |
---|---|
protected Queue<Action> |
actionToRunInEventThread |
Constructor and Description |
---|
GUIScreen(Screen screen) |
GUIScreen(Screen screen,
GUIScreenBackgroundRenderer backgroundRenderer) |
GUIScreen(Screen screen,
String title) |
Modifier and Type | Method and Description |
---|---|
void |
closeWindow()
Deprecated.
Call getActiveWindow().close() instead
|
protected void |
closeWindow(Window window)
Used internally to close a window; API users should call Window.close() instead
|
protected void |
doEventLoop() |
protected Queue<Action> |
getActionsToRunInEventThreadQueue() |
Window |
getActiveWindow()
Returns the top window in the window stack, the one which currently has user input focus.
|
GUIScreenBackgroundRenderer |
getBackgroundRenderer() |
Screen |
getScreen()
Gets the underlying screen, which can be used for starting, stopping,
querying for size and much more
|
void |
invalidate()
Signals the the entire screen needs to be re-drawn
|
boolean |
isInEventThread() |
void |
runInEventThread(Action codeToRun)
Since Lanterna isn't thread safe, here's a way to run code on the same
thread as the GUI system is using.
|
void |
setBackgroundRenderer(GUIScreenBackgroundRenderer backgroundRenderer) |
void |
setTheme(Theme newTheme)
Sets a new Theme for the entire GUI
|
void |
setTitle(String title)
Deprecated.
Use a GUI background renderer instead
|
void |
showWindow(Window window)
Same as calling showWindow(window, Position.OVERLAPPING)
|
void |
showWindow(Window window,
GUIScreen.Position position)
This method starts the GUI system with an initial window.
|
protected boolean |
update() |
public GUIScreen(Screen screen)
public GUIScreen(Screen screen, GUIScreenBackgroundRenderer backgroundRenderer)
@Deprecated public void setTitle(String title)
title
- Title to be displayed in the top-left cornerpublic void setTheme(Theme newTheme)
public void setBackgroundRenderer(GUIScreenBackgroundRenderer backgroundRenderer)
public GUIScreenBackgroundRenderer getBackgroundRenderer()
public Screen getScreen()
protected boolean update()
public void invalidate()
protected void doEventLoop()
public void showWindow(Window window)
window
- Window to be shownpublic void showWindow(Window window, GUIScreen.Position position)
window
- Window to displayposition
- Where to position the new window@Deprecated public void closeWindow()
protected void closeWindow(Window window)
public Window getActiveWindow()
public void runInEventThread(Action codeToRun)
codeToRun
- Code to be executed on the same thread as the GUIpublic boolean isInEventThread()
Copyright © 2015. All Rights Reserved.