Class RelativeDragEvent

java.lang.Object
com.sparshui.common.messages.events.RelativeDragEvent
All Implemented Interfaces:
Event, Serializable

public class RelativeDragEvent extends Object implements Event
See Also:
  • 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 interface Event
      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
      Specified by:
      serialize in interface Event
      Returns:
      serialized data