Class DragEvent
java.lang.Object
com.sparshui.common.messages.events.DragEvent
- All Implemented Interfaces:
Event
,Serializable
- See Also:
-
Constructor Details
-
DragEvent
public DragEvent() -
DragEvent
public DragEvent(float dx, float dy, int nPoints, long time) -
DragEvent
public DragEvent(byte[] data) Constructs a dragEvent from a complete serialized version of the drag event. - 4 bytes : dx - 4 bytes : dy - 1 byte: nPoints - 8 bytes : time -17 bytes total- Parameters:
data
- The byte array that represents a serialized Drag Event.
-
-
Method Details
-
getTime
public long getTime() -
getNPoints
public int getNPoints() -
getDx
public float getDx() -
getDy
public float getDy() -
setDx
public void setDx(float dx) -
setDy
public void setDy(float dy) -
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 : dx - 4 bytes : dy - 1 byte : nPoints - 8 bytes : time - 21 bytes total
-