Package com.nevergarden.myna.events
Class Event
- java.lang.Object
-
- com.nevergarden.myna.events.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.BooleanbubblesIf Event bubbles up through event listeners.static java.lang.StringCONTEXT_CREATEEvent type for created context.EventDispatchercurrentTargetCurrent target of dispatcher when it bubbles.protected java.lang.ObjectdataData passed by the event.static java.lang.StringLOADEvent type dispatched by loaders when load is complete.static java.lang.StringRENDEREvent type dispatched before drawing.static java.lang.StringRESIZEEvent type dispatched after resizing context.protected static java.util.ArrayList<IEvent>sEventPoolEvent pool.EventDispatchertargetTarget of event dispatcher.static java.lang.StringTOUCHEvent type dispatched when screen is touched.static java.lang.StringTRANSFORM_CHANGEEvent type dispatched when a transform changes in tree.protected java.lang.StringtypeEvent type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEvent(java.lang.String type, java.lang.Boolean bubbles, java.lang.Object data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IEventfromPool(java.lang.String type)Gets a new event from pool with type.static IEventfromPool(java.lang.String type, java.lang.Boolean bubbles)Gets a new event from pool with type and bubbles.static IEventfromPool(java.lang.String type, java.lang.Boolean bubbles, java.lang.Object data)Gets a new event from pool with type and bubbles and data.java.lang.BooleangetBubbles()Get bubbles property.EventDispatchergetCurrentTarget()java.lang.ObjectgetData()Get data of current data.java.lang.BooleangetStopsImmediatePropagation()EventDispatchergetTarget()Get target.java.lang.StringgetType()Get type of current event.IEventreset(java.lang.String type, java.lang.Boolean bubbles, java.lang.Object data)Resets the event data.voidsetBubbles(java.lang.Boolean bubbles)Sets bubbles property.voidsetCurrentTarget(EventDispatcher target)voidsetData(java.lang.Object data)Sets data of current data.voidsetTarget(EventDispatcher target)Set target.voidsetType(java.lang.String type)Sets type of current event.static voidtoPool(IEvent event)Sends an unused event to pool.
-
-
-
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.
-
target
public EventDispatcher target
Target of event dispatcher.
-
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.
-
-
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.
-
getType
public java.lang.String getType()
Description copied from interface:IEventGet type of current event.
-
setType
public void setType(java.lang.String type)
Description copied from interface:IEventSets type of current event.
-
getBubbles
public java.lang.Boolean getBubbles()
Description copied from interface:IEventGet bubbles property.- Specified by:
getBubblesin interfaceIEvent
-
setBubbles
public void setBubbles(java.lang.Boolean bubbles)
Description copied from interface:IEventSets bubbles property.- Specified by:
setBubblesin interfaceIEvent
-
getTarget
public EventDispatcher getTarget()
Description copied from interface:IEventGet target.
-
setTarget
public void setTarget(EventDispatcher target)
Description copied from interface:IEventSet target.
-
getCurrentTarget
public EventDispatcher getCurrentTarget()
- Specified by:
getCurrentTargetin interfaceIEvent
-
setCurrentTarget
public void setCurrentTarget(EventDispatcher target)
- Specified by:
setCurrentTargetin interfaceIEvent
-
getStopsImmediatePropagation
public java.lang.Boolean getStopsImmediatePropagation()
- Specified by:
getStopsImmediatePropagationin interfaceIEvent
-
getData
public java.lang.Object getData()
Description copied from interface:IEventGet data of current data.
-
-