BasePaneListener<Window>
, WindowListener
public class WindowListenerAdapter extends Object implements WindowListener
WindowListener
to make it easier to create listeners without having to implement every
interface method.Constructor | Description |
---|---|
WindowListenerAdapter() |
Modifier and Type | Method | Description |
---|---|---|
void |
onInput(Window basePane,
KeyStroke keyStroke,
AtomicBoolean deliverEvent) |
Called when a user input is about to be delivered to the focused
Interactable inside the
BasePane , but before it is actually delivered. |
void |
onMoved(Window window,
TerminalPosition oldPosition,
TerminalPosition newPosition) |
Called whenever the window's position has changed, no matter if it was done by the window manager or the user
|
void |
onResized(Window window,
TerminalSize oldSize,
TerminalSize newSize) |
Called whenever the window's size has changed, no matter if it was done by the window manager or the user
|
void |
onUnhandledInput(Window basePane,
KeyStroke keyStroke,
AtomicBoolean hasBeenHandled) |
Called when a user entered some input which wasn't handled by the focused component.
|
public void onResized(Window window, TerminalSize oldSize, TerminalSize newSize)
WindowListener
onResized
in interface WindowListener
window
- Window that was resizedoldSize
- Previous size of the windownewSize
- New size of the windowpublic void onMoved(Window window, TerminalPosition oldPosition, TerminalPosition newPosition)
WindowListener
onMoved
in interface WindowListener
window
- Window that was repositionedoldPosition
- Previous position of the windownewPosition
- New position of the windowpublic void onInput(Window basePane, KeyStroke keyStroke, AtomicBoolean deliverEvent)
BasePaneListener
Interactable
inside the
BasePane
, but before it is actually delivered. You can catch it and prevent it from being passed into
the component by using the deliverEvent
parameter and setting it to false
.onInput
in interface BasePaneListener<Window>
basePane
- Base pane that got the input eventkeyStroke
- The actual input eventdeliverEvent
- Set to true
automatically, if you change it to false
it will prevent the GUI
from passing the input event on to the focused Interactable
public void onUnhandledInput(Window basePane, KeyStroke keyStroke, AtomicBoolean hasBeenHandled)
BasePaneListener
BasePane
(or Window
) level and prevent it from being reported to the TextGUI
as an
unhandled input event.onUnhandledInput
in interface BasePaneListener<Window>
basePane
- BasePane
that got the input eventkeyStroke
- The unhandled input eventhasBeenHandled
- Initially set to false
, if you change it to true
then the event
will not be reported as an unhandled input to the TextGUI
Copyright © 2020. All rights reserved.