- 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 forWindowListenerto 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 voidonInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.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, 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: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
public void onMoved(Window window, TerminalPosition oldPosition, TerminalPosition newPosition)
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
public void onInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean deliverEvent)
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
public void onUnhandledInput(Window basePane, KeyStroke keyStroke, java.util.concurrent.atomic.AtomicBoolean hasBeenHandled)
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
-
-