All Superinterfaces:
Control
All Known Implementing Classes:
AbstractView, AppView, BoxView, ButtonView, DialogView, GridView, InputView, ListView, MenuBarView, MenuView, ProgressView, StatusBarView, WindowView

public interface View extends Control
Base interface for all views. Represents a visible element that can render itself and contains zero or more nested Views.
  • Method Details

    • init

      void init()
    • setLayer

      void setLayer(int index)
      Sets a layer index this View operates on.
      Parameters:
      index - the layer index
    • focus

      void focus(View view, boolean focus)
      Called when View gets or loses a focus.
      Parameters:
      view - the view receiving focus
      focus - flag if focus is received
    • hasFocus

      boolean hasFocus()
      Gets if this View has a focus.
      Returns:
      true if view has a focus
    • getMouseHandler

      @Nullable MouseHandler getMouseHandler()
      Gets a View mouse MouseHandler. Can be null which indicates view will not handle any mouse events.
      Returns:
      a view mouse handler
      See Also:
    • getKeyHandler

      @Nullable KeyHandler getKeyHandler()
      Gets a View key KeyHandler. Can be null which indicates view will not handle any key events.
      Returns:
      a view key handler
      See Also:
    • getHotKeyHandler

      @Nullable KeyHandler getHotKeyHandler()
      Gets a View hotkey KeyHandler. Can be null which indicates view will not handle any key events.
      Returns:
      a view hotkey handler
      See Also:
    • setEventLoop

      void setEventLoop(@Nullable EventLoop eventLoop)
      Sets an EventLoop.
      Parameters:
      eventLoop - the event loop
    • setViewService

      void setViewService(ViewService viewService)
      Sets a ViewService.
      Parameters:
      viewService - the view service
    • getViewCommands

      Set<String> getViewCommands()
      Get supported commands.
      Returns:
      supported commands
      See Also:
    • runViewCommand

      boolean runViewCommand(String command)
      Run command.
      Parameters:
      command - the command to run
      Returns:
      true if command was succesfully dispatched
      See Also: