Class WindowListenerAdapter
java.lang.Object
com.googlecode.lanterna.gui2.WindowListenerAdapter
- All Implemented Interfaces:
BasePaneListener<Window>, WindowListener
Adapter class for
WindowListener to make it easier to create listeners without having to implement every
interface method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonInput(Window basePane, KeyStroke keyStroke, AtomicBoolean deliverEvent) Called when a user input is about to be delivered to the focusedInteractableinside theBasePane, but before it is actually delivered.voidonMoved(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 uservoidonResized(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 uservoidonUnhandledInput(Window basePane, KeyStroke keyStroke, AtomicBoolean hasBeenHandled) Called when a user entered some input which wasn't handled by the focused component.
-
Constructor Details
-
WindowListenerAdapter
public WindowListenerAdapter()
-
-
Method Details
-
onResized
Description copied from interface:WindowListenerCalled whenever the window's size has changed, no matter if it was done by the window manager or the user- Specified by:
onResizedin interfaceWindowListener- Parameters:
window- Window that was resizedoldSize- Previous size of the windownewSize- New size of the window
-
onMoved
Description copied from interface:WindowListenerCalled whenever the window's position has changed, no matter if it was done by the window manager or the user- Specified by:
onMovedin interfaceWindowListener- Parameters:
window- Window that was repositionedoldPosition- Previous position of the windownewPosition- New position of the window
-
onInput
Description copied from interface:BasePaneListenerCalled when a user input is about to be delivered to the focusedInteractableinside theBasePane, but before it is actually delivered. You can catch it and prevent it from being passed into the component by using thedeliverEventparameter and setting it tofalse.- Specified by:
onInputin interfaceBasePaneListener<Window>- Parameters:
basePane- Base pane that got the input eventkeyStroke- The actual input eventdeliverEvent- Set totrueautomatically, if you change it tofalseit will prevent the GUI from passing the input event on to the focusedInteractable
-
onUnhandledInput
Description copied from interface:BasePaneListenerCalled 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 theTextGUIas an unhandled input event.- Specified by:
onUnhandledInputin interfaceBasePaneListener<Window>- Parameters:
basePane-BasePanethat got the input eventkeyStroke- The unhandled input eventhasBeenHandled- Initially set tofalse, if you change it totruethen the event will not be reported as an unhandled input to theTextGUI
-