public class Window extends Object
Constructor and Description |
---|
Window(String title)
Creates a new window
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component,
LayoutParameter... layoutParameters) |
void |
addContainerListener(ContainerListener cl) |
void |
addEmptyLine()
Deprecated.
|
void |
addWindowListener(WindowListener listener) |
void |
close() |
Border |
getBorder() |
Component |
getComponentAt(int index) |
int |
getComponentCount() |
protected Interactable |
getInputFocusedComponent() |
GUIScreen |
getOwner() |
TerminalSize |
getWindowSizeOverride()
Returns the current window size override or
null if none is set |
boolean |
isDrawShadow() |
boolean |
isSoloWindow() |
protected void |
onClosed() |
void |
onKeyPressed(Key key) |
protected void |
onVisible() |
void |
removeAllComponents()
Removes all components from the window
|
void |
removeComponent(Component component)
Removes a top-level component from the window
|
void |
removeContainerListener(ContainerListener cl) |
void |
setBorder(Border border) |
void |
setDrawShadow(boolean drawShadow) |
protected void |
setFocus(Interactable newFocus) |
protected void |
setFocus(Interactable newFocus,
Interactable.FocusChangeDirection direction) |
void |
setSoloWindow(boolean soloWindow)
If set to true, when this window is shown, all previous windows are
hidden.
|
void |
setWindowSizeOverride(TerminalSize windowSizeOverride)
Sets the size of the window to a fixed value, rather than using automatic size calculation.
|
String |
toString() |
public Window(String title)
title
- Title for the new windowpublic void addWindowListener(WindowListener listener)
public GUIScreen getOwner()
public Border getBorder()
public void setBorder(Border border)
public TerminalSize getWindowSizeOverride()
null
if none is setnull
public void setWindowSizeOverride(TerminalSize windowSizeOverride)
windowSizeOverride
parameter set to null
, the
automatic size calculation will be activated again.windowSizeOverride
- Size the window should have, or null
if you want to use
automatic size calculation@Deprecated public void addEmptyLine()
addComponent(new EmptySpace(1, 1))
insteadpublic void addComponent(Component component, LayoutParameter... layoutParameters)
public void addContainerListener(ContainerListener cl)
public void removeContainerListener(ContainerListener cl)
public Component getComponentAt(int index)
public int getComponentCount()
public void removeComponent(Component component)
component
- Top-level component to removepublic void removeAllComponents()
public void onKeyPressed(Key key)
public boolean isSoloWindow()
public void setSoloWindow(boolean soloWindow)
public boolean isDrawShadow()
public void setDrawShadow(boolean drawShadow)
protected void setFocus(Interactable newFocus)
protected void setFocus(Interactable newFocus, Interactable.FocusChangeDirection direction)
protected Interactable getInputFocusedComponent()
public void close()
protected void onVisible()
protected void onClosed()
Copyright © 2015. All Rights Reserved.