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.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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IEvent
fromPool(java.lang.String type)
Gets a new event from pool with type.static IEvent
fromPool(java.lang.String type, java.lang.Boolean bubbles)
Gets a new event from pool with type and bubbles.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.java.lang.Boolean
getBubbles()
Get bubbles property.EventDispatcher
getCurrentTarget()
java.lang.Object
getData()
Get data of current data.java.lang.Boolean
getStopsImmediatePropagation()
EventDispatcher
getTarget()
Get target.java.lang.String
getType()
Get type of current event.IEvent
reset(java.lang.String type, java.lang.Boolean bubbles, java.lang.Object data)
Resets the event data.void
setBubbles(java.lang.Boolean bubbles)
Sets bubbles property.void
setCurrentTarget(EventDispatcher target)
void
setData(java.lang.Object data)
Sets data of current data.void
setTarget(EventDispatcher target)
Set target.void
setType(java.lang.String type)
Sets type of current event.static void
toPool(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:IEvent
Get type of current event.
-
setType
public void setType(java.lang.String type)
Description copied from interface:IEvent
Sets type of current event.
-
getBubbles
public java.lang.Boolean getBubbles()
Description copied from interface:IEvent
Get bubbles property.- Specified by:
getBubbles
in interfaceIEvent
-
setBubbles
public void setBubbles(java.lang.Boolean bubbles)
Description copied from interface:IEvent
Sets bubbles property.- Specified by:
setBubbles
in interfaceIEvent
-
getTarget
public EventDispatcher getTarget()
Description copied from interface:IEvent
Get target.
-
setTarget
public void setTarget(EventDispatcher target)
Description copied from interface:IEvent
Set target.
-
getCurrentTarget
public EventDispatcher getCurrentTarget()
- Specified by:
getCurrentTarget
in interfaceIEvent
-
setCurrentTarget
public void setCurrentTarget(EventDispatcher target)
- Specified by:
setCurrentTarget
in interfaceIEvent
-
getStopsImmediatePropagation
public java.lang.Boolean getStopsImmediatePropagation()
- Specified by:
getStopsImmediatePropagation
in interfaceIEvent
-
getData
public java.lang.Object getData()
Description copied from interface:IEvent
Get data of current data.
-
-