Class Command


  • public class Command
    extends EventGenerator
    Command is an event generator that generates application-level events. Unlike io generators that are related to some hardware input format, the command generator defines its own input format. Basically input and output event are the same. This allows the generation of commands from within MicroUI without relying on an underlying input event format.

    This class defines constants for a set of basic commands. The commands defined in this class are typical application-level effects of input events. The advantage of using commands rather than specific input events in an application is that the application can be more portable: it is not tied to specific input devices.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ANTICLOCKWISE
      Constant for "anti-clockwise" command.
      static int BACK
      Constant for "back" command.
      static int CANCEL
      Constant for "cancel" command.
      static int CLOCKWISE
      Constant for "clockwise" command.
      static int COPY
      Constant for "copy" command.
      static int CUT
      Constant for "cut" command.
      static int DISPLAY
      Constant for "display" command.
      static int DOWN
      Constant for "down" command.
      static int ESC
      Constant for "escape" command.
      static int EVENT_TYPE
      The COMMAND event type returned by getEventType().
      static int EXIT
      Constant for "exit" command.
      static int HELP
      Constant for "help" command.
      static int LEFT
      Constant for "left" command.
      static int MENU
      Constant for "menu" command.
      static int NEXT
      Constant for "next" command.
      static int PASTE
      Constant for "paste" command.
      static int PAUSE
      Constant for "pause" command.
      static int PREVIOUS
      Constant for "previous" command.
      static int RESUME
      Constant for "resume" command.
      static int RIGHT
      Constant for "right" command.
      static int SELECT
      Constant for "select" command.
      static int START
      Constant for "start" command.
      static int STOP
      Constant for "stop" command.
      static int UP
      Constant for "up" command.
    • Constructor Summary

      Constructors 
      Constructor Description
      Command()
      Creates a new command event generator.
    • Constructor Detail

      • Command

        public Command()
        Creates a new command event generator.
    • Method Detail

      • getEventType

        public int getEventType()
        Gets the event generator's type. Default value is EVENT_TYPE.
        Specified by:
        getEventType in class EventGenerator
        Returns:
        the command generator's type
      • buildEvent

        public int buildEvent​(int command)
        Builds a MicroUI event for the given command.
        Parameters:
        command - the command to be sent
        Returns:
        the MicroUI event
      • send

        public void send​(int command)
        Sends the given command to the event generator's listener
        Parameters:
        command - the command to be sent