Class FlickEvent
java.lang.Object
com.sparshui.common.messages.events.FlickEvent
- All Implemented Interfaces:
Event
,Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFlickEvent
(byte[] data) Constructs a flickEvent from a complete serialized version of the drag event.FlickEvent
(float absx, float absy) FlickEvent
(int _speedLevel, int _xDirection, int _yDirection) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the integer value of this event type.float
float
float
byte[]
Constructs the data packet with this event data.toString()
-
Constructor Details
-
FlickEvent
public FlickEvent() -
FlickEvent
public FlickEvent(float absx, float absy) - Parameters:
absx
-absy
-
-
FlickEvent
public FlickEvent(int _speedLevel, int _xDirection, int _yDirection) -
FlickEvent
public FlickEvent(byte[] data) Constructs a flickEvent from a complete serialized version of the drag event. - 4 bytes : dx - 4 bytes : dy - 8 bytes total- Parameters:
data
- The byte array that represents a serialized Drag Event.
-
-
Method Details
-
getSpeedLevel
public float getSpeedLevel() -
getXdirection
public float getXdirection() -
getYdirection
public float getYdirection() -
getEventType
public int getEventType()Description copied from interface:Event
Returns the integer value of this event type. Event type values are defined in the enumeration com.sparshui.common.messages.events.EventType.java- Specified by:
getEventType
in interfaceEvent
- Returns:
- The event type
-
toString
-
serialize
public byte[] serialize()Constructs the data packet with this event data. Message format for this event: - 4 bytes : EventType - 4 bytes : SpeedLevel - 4 bytes : X Direction - 4 bytes : Y Direction - 16 bytes total
-