Class ZoomEvent

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

public class ZoomEvent extends Object implements Event
See Also:
  • Constructor Details

    • ZoomEvent

      public ZoomEvent()
    • ZoomEvent

      public ZoomEvent(float scale, Location center, long time)
    • ZoomEvent

      public ZoomEvent(byte[] data)
      Constructs a ZoomEvent from a serialized version of ZoomEvent. - 4 bytes : scale - 4 bytes : center - x coordinate - 4 bytes : center - y coordinate - 12 bytes total
      Parameters:
      data -
  • Method Details

    • getScale

      public float getScale()
    • getTime

      public long getTime()
    • getCenter

      public Location getCenter()
    • setCenter

      public void setCenter(Location center)
    • getX

      public float getX()
    • getY

      public float getY()
    • 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 : event type - 4 bytes : scale - 4 bytes : center - x coordinate - 4 bytes : center - y coordinate - 16 bytes total
      Specified by:
      serialize in interface Event
      Returns:
      serialized data
    • toString

      public String toString()
      Overrides:
      toString in class Object