Modifier and Type | Class | Description |
---|---|---|
protected class |
AbstractBasePane.ContentHolder |
Modifier and Type | Field | Description |
---|---|---|
protected AbstractBasePane.ContentHolder |
contentHolder |
|
protected InteractableLookupMap |
interactableLookupMap |
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractBasePane() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
addBasePaneListener(BasePaneListener<T> basePaneListener) |
|
void |
draw(TextGUIGraphics graphics) |
Called by the GUI system (or something imitating the GUI system) to draw the root container.
|
protected List<BasePaneListener<T>> |
getBasePaneListeners() |
|
Component |
getComponent() |
Returns the component that is the content of the BasePane.
|
TerminalPosition |
getCursorPosition() |
Returns the position of where to put the terminal cursor according to this root container.
|
Interactable |
getFocusedInteractable() |
Returns the component in the root container that currently has input focus.
|
Theme |
getTheme() |
Returns the text GUI
Theme associated with this base pane/window. |
boolean |
handleInput(KeyStroke key) |
Called by the GUI system to delegate a keyboard input event.
|
void |
invalidate() |
Invalidates the whole root container (including all of its child components) which will cause them all to be
recalculated (for containers) and redrawn.
|
boolean |
isInvalid() |
Checks if this root container (i.e. any of its child components) has signaled that what it's currently displaying
is out of date and needs re-drawing.
|
protected void |
removeBasePaneListener(BasePaneListener<T> basePaneListener) |
|
void |
setComponent(Component component) |
Sets the top-level component inside this BasePane.
|
void |
setEnableDirectionBasedMovements(boolean enableDirectionBasedMovements) |
If set to false, using the keyboard arrows keys will have the same effect as using the tab and reverse tab.
|
void |
setFocusedInteractable(Interactable toFocus) |
Sets the component currently in focus within this root container, or sets no component in focus if
null
is passed in. |
protected void |
setFocusedInteractable(Interactable toFocus,
Interactable.FocusChangeDirection direction) |
|
void |
setStrictFocusChange(boolean strictFocusChange) |
If set to true, up/down array keys will not translate to next/previous if there are no more components
above/below.
|
void |
setTheme(Theme theme) |
fromGlobal, getTextGUI, toGlobal
protected final AbstractBasePane.ContentHolder contentHolder
protected InteractableLookupMap interactableLookupMap
public boolean isInvalid()
BasePane
public void invalidate()
BasePane
invalidate
in interface BasePane
public void draw(TextGUIGraphics graphics)
BasePane
public boolean handleInput(KeyStroke key)
BasePane
false
so that the GUI system can take further decisions on what to do with it.handleInput
in interface BasePane
key
- Keyboard inputtrue
If the root container could handle the input, false otherwisepublic Component getComponent()
BasePane
getComponent
in interface BasePane
getComponent
in interface Composite
public void setComponent(Component component)
BasePane
setComponent
in interface BasePane
setComponent
in interface Composite
component
- Component which this BasePane is using as it's contentpublic Interactable getFocusedInteractable()
BasePane
getFocusedInteractable
in interface BasePane
public TerminalPosition getCursorPosition()
BasePane
null
if no component has focus or if the root container doesn't
want the cursor to be visible. Note that the coordinates are in local coordinate space, relative to the top-left
corner of the root container. You can use your TextGUI implementation to translate these to global coordinates.getCursorPosition
in interface BasePane
null
if the cursor shouldn't be visiblepublic void setFocusedInteractable(Interactable toFocus)
BasePane
null
is passed in.setFocusedInteractable
in interface BasePane
toFocus
- Interactable to focus, or null
to clear focusprotected void setFocusedInteractable(Interactable toFocus, Interactable.FocusChangeDirection direction)
public void setStrictFocusChange(boolean strictFocusChange)
BasePane
setStrictFocusChange
in interface BasePane
strictFocusChange
- Will not allow relaxed navigation if set to true
public void setEnableDirectionBasedMovements(boolean enableDirectionBasedMovements)
BasePane
In Lanterna 2, direction based movements were not available.
setEnableDirectionBasedMovements
in interface BasePane
enableDirectionBasedMovements
- Should direction based focus movements be enabled?public Theme getTheme()
BasePane
Theme
associated with this base pane/window. This is either coming from the
TextGUI
this object is associated with, the theme set as the override through BasePane.setTheme(Theme)
or null
if this base pane/window isn't added to any TextGUI
and doesn't have any override.protected void addBasePaneListener(BasePaneListener<T> basePaneListener)
protected void removeBasePaneListener(BasePaneListener<T> basePaneListener)
protected List<BasePaneListener<T>> getBasePaneListeners()
Copyright © 2020. All rights reserved.