Class Event

  • All Implemented Interfaces:
    IEvent
    Direct Known Subclasses:
    TouchEvent

    public class Event
    extends java.lang.Object
    implements IEvent
    Event Data Structure.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Boolean bubbles
      If Event bubbles up through event listeners.
      static java.lang.String CONTEXT_CREATE
      Event type for created context.
      EventDispatcher currentTarget
      Current target of dispatcher when it bubbles.
      protected java.lang.Object data
      Data passed by the event.
      static java.lang.String LOAD
      Event type dispatched by loaders when load is complete.
      static java.lang.String RENDER
      Event type dispatched before drawing.
      static java.lang.String RESIZE
      Event type dispatched after resizing context.
      protected static java.util.ArrayList<IEvent> sEventPool
      Event pool.
      EventDispatcher target
      Target of event dispatcher.
      static java.lang.String TOUCH
      Event type dispatched when screen is touched.
      static java.lang.String TRANSFORM_CHANGE
      Event type dispatched when a transform changes in tree.
      protected java.lang.String type
      Event type.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Event​(java.lang.String type, java.lang.Boolean bubbles, java.lang.Object data)  
    • Field Detail

      • CONTEXT_CREATE

        public static final java.lang.String CONTEXT_CREATE
        Event type for created context.
        See Also:
        Constant Field Values
      • RENDER

        public static final java.lang.String RENDER
        Event type dispatched before drawing.
        See Also:
        Constant Field Values
      • RESIZE

        public static final java.lang.String RESIZE
        Event type dispatched after resizing context.
        See Also:
        Constant Field Values
      • TRANSFORM_CHANGE

        public static final java.lang.String TRANSFORM_CHANGE
        Event type dispatched when a transform changes in tree.
        See Also:
        Constant Field Values
      • TOUCH

        public static final java.lang.String TOUCH
        Event type dispatched when screen is touched.
        See Also:
        Constant Field Values
      • LOAD

        public static final java.lang.String LOAD
        Event type dispatched by loaders when load is complete.
        See Also:
        Constant Field Values
      • sEventPool

        protected static final java.util.ArrayList<IEvent> sEventPool
        Event pool.
      • currentTarget

        public EventDispatcher currentTarget
        Current target of dispatcher when it bubbles.
      • type

        protected java.lang.String type
        Event type.
      • bubbles

        protected java.lang.Boolean bubbles
        If Event bubbles up through event listeners.
      • data

        protected java.lang.Object data
        Data passed by the event.
    • Constructor Detail

      • Event

        protected Event​(java.lang.String type,
                        java.lang.Boolean bubbles,
                        java.lang.Object data)
    • Method Detail

      • fromPool

        public static IEvent fromPool​(java.lang.String type)
        Gets a new event from pool with type.
      • fromPool

        public static IEvent fromPool​(java.lang.String type,
                                      java.lang.Boolean bubbles)
        Gets a new event from pool with type and bubbles.
      • fromPool

        public static IEvent fromPool​(java.lang.String type,
                                      java.lang.Boolean bubbles,
                                      java.lang.Object data)
        Gets a new event from pool with type and bubbles and data.
      • toPool

        public static void toPool​(IEvent event)
        Sends an unused event to pool.
      • reset

        public IEvent reset​(java.lang.String type,
                            java.lang.Boolean bubbles,
                            java.lang.Object data)
        Resets the event data.
        Specified by:
        reset in interface IEvent
      • getType

        public java.lang.String getType()
        Description copied from interface: IEvent
        Get type of current event.
        Specified by:
        getType in interface IEvent
      • setType

        public void setType​(java.lang.String type)
        Description copied from interface: IEvent
        Sets type of current event.
        Specified by:
        setType in interface IEvent
      • getBubbles

        public java.lang.Boolean getBubbles()
        Description copied from interface: IEvent
        Get bubbles property.
        Specified by:
        getBubbles in interface IEvent
      • setBubbles

        public void setBubbles​(java.lang.Boolean bubbles)
        Description copied from interface: IEvent
        Sets bubbles property.
        Specified by:
        setBubbles in interface IEvent
      • getData

        public java.lang.Object getData()
        Description copied from interface: IEvent
        Get data of current data.
        Specified by:
        getData in interface IEvent
      • setData

        public void setData​(java.lang.Object data)
        Description copied from interface: IEvent
        Sets data of current data.
        Specified by:
        setData in interface IEvent