Class WindowListenerAdapter

java.lang.Object
com.googlecode.lanterna.gui2.WindowListenerAdapter
All Implemented Interfaces:
BasePaneListener<Window>, WindowListener

public class WindowListenerAdapter extends Object implements WindowListener
Adapter class for WindowListener to make it easier to create listeners without having to implement every interface method.
  • Constructor Details

    • WindowListenerAdapter

      public WindowListenerAdapter()
  • Method Details

    • 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 interface WindowListener
      Parameters:
      window - Window that was resized
      oldSize - Previous size of the window
      newSize - 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 interface WindowListener
      Parameters:
      window - Window that was repositioned
      oldPosition - Previous position of the window
      newPosition - New position of the window
    • onInput

      public void onInput(Window basePane, KeyStroke keyStroke, AtomicBoolean deliverEvent)
      Description copied from interface: BasePaneListener
      Called when a user input is about to be delivered to the focused 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.
      Specified by:
      onInput in interface BasePaneListener<Window>
      Parameters:
      basePane - Base pane that got the input event
      keyStroke - The actual input event
      deliverEvent - 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
    • onUnhandledInput

      public void onUnhandledInput(Window basePane, KeyStroke keyStroke, 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 a BasePane (or Window) level and prevent it from being reported to the TextGUI as an unhandled input event.
      Specified by:
      onUnhandledInput in interface BasePaneListener<Window>
      Parameters:
      basePane - BasePane that got the input event
      keyStroke - The unhandled input event
      hasBeenHandled - Initially set to false, if you change it to true then the event will not be reported as an unhandled input to the TextGUI