Interface Controller

  • All Known Implementing Classes:
    ControllerRunner

    public interface Controller
    Controller.
    Author:
    Grégory Van den Borre
    • Method Summary

      Modifier and Type Method Description
      void addListener​(ControllerListener l)
      register a listener to receive event from the controller.
      ControllerCurrentState getState()
      Provide the controller current state.
      boolean isConnected()
      Check if the controller is currently plugged in.
      boolean isUsed()
      Check if the controller is in use.
      void map​(ControllerMapper mapper)
      Map the buttons if a change is required.
      void use()
      Use this controller.
    • Method Detail

      • getState

        ControllerCurrentState getState()
        Provide the controller current state. The state can be kept once retrieved, it will always be up to date.
        Returns:
        The state.
      • addListener

        void addListener​(ControllerListener l)
        register a listener to receive event from the controller.
        Parameters:
        l - Controller listener.
      • use

        void use()
        Use this controller.
      • map

        void map​(ControllerMapper mapper)
        Map the buttons if a change is required.
        Parameters:
        mapper - Button mapper.
      • isUsed

        boolean isUsed()
        Check if the controller is in use.
        Returns:
        True if the controller is used, false otherwise.
      • isConnected

        boolean isConnected()
        Check if the controller is currently plugged in.
        Returns:
        True if the controoler is connected, false otherwise.