Class Event

    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean consumed
      Set to true to break the event propagation up to the parents
      java.lang.Object target
      The target of the event.
      int timeStamp
      The event's timestamp.
      int type
      The type of event.
    • Constructor Summary

      Constructors 
      Constructor Description
      Event()
      Constructs a new event with the current time stamp
      Event​(int type, java.lang.Object target, int timeStamp)
      Constructs a new event based in the given parameters.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearQueue​(int type)
      Clears the event queue.
      static int getNextAvailableEventId()
      Register a new event with the system.
      static boolean isAvailable()
      Returns true if there is an event available in the VM event queue.
      java.lang.String toString()  
      void touch()
      Updates the timeStamp parameter with the current time
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • type

        public int type
        The type of event.
      • target

        public java.lang.Object target
        The target of the event. For user-interface events, this is the control the event is associated with.
      • consumed

        public boolean consumed
        Set to true to break the event propagation up to the parents
    • Constructor Detail

      • Event

        public Event​(int type,
                     java.lang.Object target,
                     int timeStamp)
        Constructs a new event based in the given parameters.
      • Event

        public Event()
        Constructs a new event with the current time stamp
    • Method Detail

      • touch

        public void touch()
        Updates the timeStamp parameter with the current time
      • getNextAvailableEventId

        public static int getNextAvailableEventId()
        Register a new event with the system. Use it to avoid conflict of events created by multiple Applications.
      • isAvailable

        public static boolean isAvailable()
        Returns true if there is an event available in the VM event queue.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clearQueue

        public static void clearQueue​(int type)
        Clears the event queue.
        Parameters:
        type - The Event type to be ignored, or 0 to ignore all types.
        Since:
        TotalCross 1.2