Class RelativeDragEvent
java.lang.Object
com.sparshui.common.messages.events.RelativeDragEvent
- All Implemented Interfaces:
Event
,Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRelativeDragEvent
(byte[] data) Constructs a dragEvent from a complete serialized version of the drag event.RelativeDragEvent
(float changeInX, float changeInY) -
Method Summary
Modifier and TypeMethodDescriptionfloat
float
int
Returns the integer value of this event type.byte[]
Constructs the data packet with this event data.
-
Constructor Details
-
RelativeDragEvent
public RelativeDragEvent() -
RelativeDragEvent
public RelativeDragEvent(float changeInX, float changeInY) -
RelativeDragEvent
public RelativeDragEvent(byte[] data) Constructs a dragEvent from a complete serialized version of the drag event. - 4 bytes : ChangeInX - 4 bytes : ChangeInY - 8 bytes total- Parameters:
data
- The byte array that represents a serialized Drag Event.
-
-
Method Details
-
getChangeInX
public float getChangeInX() -
getChangeInY
public float getChangeInY() -
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
-
serialize
public byte[] serialize()Constructs the data packet with this event data. Message format for this event: - 4 bytes : EventType - 4 bytes : changeInX - 4 bytes : changeInY - 12 bytes total
-