- java.lang.Object
-
- com.googlecode.lanterna.gui2.WindowListenerAdapter
-
- All Implemented Interfaces:
BasePaneListener<Window>
,WindowListener
public class WindowListenerAdapter extends java.lang.Object implements WindowListener
Adapter class forWindowListener
to make it easier to create listeners without having to implement every interface method.
-
-
Constructor Summary
Constructors Constructor Description WindowListenerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean deliverEvent)
Called when a user input is about to be delivered to the focusedInteractable
inside theBasePane
, 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 uservoid
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 uservoid
onUnhandledInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean hasBeenHandled)
Called when a user entered some input which wasn't handled by the focused component.
-
-
-
Method Detail
-
onResized
public void onResized(Window window, TerminalSize oldSize, TerminalSize newSize)
Description copied from interface:WindowListener
Called whenever the window's size has changed, no matter if it was done by the window manager or the user- Specified by:
onResized
in interfaceWindowListener
- Parameters:
window
- Window that was resizedoldSize
- Previous size of the windownewSize
- New size of the window
-
onMoved
public void onMoved(Window window, TerminalPosition oldPosition, TerminalPosition newPosition)
Description copied from interface:WindowListener
Called whenever the window's position has changed, no matter if it was done by the window manager or the user- Specified by:
onMoved
in interfaceWindowListener
- Parameters:
window
- Window that was repositionedoldPosition
- Previous position of the windownewPosition
- New position of the window
-
onInput
public void onInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean deliverEvent)
Description copied from interface:BasePaneListener
Called when a user input is about to be delivered to the focusedInteractable
inside theBasePane
, but before it is actually delivered. You can catch it and prevent it from being passed into the component by using thedeliverEvent
parameter and setting it tofalse
.- Specified by:
onInput
in interfaceBasePaneListener<Window>
- Parameters:
basePane
- Base pane that got the input eventkeyStroke
- The actual input eventdeliverEvent
- Set totrue
automatically, if you change it tofalse
it will prevent the GUI from passing the input event on to the focusedInteractable
-
onUnhandledInput
public void onUnhandledInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean hasBeenHandled)
Description copied from interface:BasePaneListener
Called when a user entered some input which wasn't handled by the focused component. This allows you to catch it at aBasePane
(orWindow
) level and prevent it from being reported to theTextGUI
as an unhandled input event.- Specified by:
onUnhandledInput
in interfaceBasePaneListener<Window>
- Parameters:
basePane
-BasePane
that got the input eventkeyStroke
- The unhandled input eventhasBeenHandled
- Initially set tofalse
, if you change it totrue
then the event will not be reported as an unhandled input to theTextGUI
-
-