JmolSparshClientAdapter
Date: 2019-10-22

org.jmol.multitouch.sparshui

## Class JmolSparshClientAdapter

- java.lang.Object
- - org.jmol.multitouch.JmolMultiTouchClientAdapter
  - - org.jmol.multitouch.sparshui.JmolSparshClientAdapter

- All Implemented Interfaces:
    com.sparshui.client.SparshClient, JmolMultiTouchAdapter

      public class JmolSparshClientAdapter
      extends JmolMultiTouchClientAdapter
      implements com.sparshui.client.SparshClient

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) boolean` | `doneHere`
    `private JmolGestureServerInterface` | `gestureServer`
    `private com.sparshui.client.ClientServerConnection` | `serverConnection`

    - ### Fields inherited from class org.jmol.multitouch.JmolMultiTouchClientAdapter

      `actionManager, isServer, ptTemp`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmolSparshClientAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()`
    `java.util.List<com.sparshui.GestureType>` | `getAllowedGestures(int groupID)` This method must return the allowed Gestures for the specified group.
    `int` | `getGroupID(com.sparshui.common.Location location)` This method must return an ID for a group of points that should be processed together.
    `void` | `processEvent(int groupID, com.sparshui.common.Event event)` Translate the specialized Sparsh UI information into a format that Jmol's ActionManager can understand without any special classes.
    `boolean` | `setMultiTouchClient(Viewer vwr, JmolMultiTouchClient client, boolean isSimulation)`

    - ### Methods inherited from class org.jmol.multitouch.JmolMultiTouchClientAdapter

      `fixXY, isServer, mouseMoved`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### serverConnection

          private com.sparshui.client.ClientServerConnection serverConnection

    - #### doneHere

          boolean doneHere

    - #### gestureServer

          private JmolGestureServerInterface gestureServer

  - ### Constructor Detail

    - #### JmolSparshClientAdapter

          public JmolSparshClientAdapter()

  - ### Method Detail

    - #### dispose

          public void dispose()

      Specified by:
        `dispose` in interface `JmolMultiTouchAdapter`
      Specified by:
        `dispose` in class `JmolMultiTouchClientAdapter`

    - #### setMultiTouchClient

          public boolean setMultiTouchClient(Viewer vwr,
                                             JmolMultiTouchClient client,
                                             boolean isSimulation)

      Specified by:
        `setMultiTouchClient` in interface `JmolMultiTouchAdapter`
      Overrides:
        `setMultiTouchClient` in class `JmolMultiTouchClientAdapter`

    - #### getAllowedGestures

          public java.util.List<com.sparshui.GestureType> getAllowedGestures(int groupID)

      Description copied from interface: `com.sparshui.client.SparshClient`
      This method must return the allowed Gestures for the specified group. Gestures IDs are given in GestureType.java. This method should construct a list of valid gesture IDs for the specified groupID and return it. The client will then begin receiving events that are appropriate to the list of allowed gestures it returned.
      Specified by:
        `getAllowedGestures` in interface `com.sparshui.client.SparshClient`
      Parameters:
        `groupID` - The groupID we wish to obtain the allowed gestures for.
      Returns:
        A list of allowed Gesture IDs

    - #### getGroupID

          public int getGroupID(com.sparshui.common.Location location)

      Description copied from interface: `com.sparshui.client.SparshClient`
      This method must return an ID for a group of points that should be processed together. If a constant value is returned, all points will be processed together and gestures will be recognized on the entire screen. Otherwise, if a unique ID is returned, gestures will be recognized locally for each ID.
      Specified by:
        `getGroupID` in interface `com.sparshui.client.SparshClient`
      Parameters:
        `location` - The location with coordinate values between 0 and 1 of the point we are requesting the groupID for.
      Returns:
        The groupID that is associated with the current location.

    - #### processEvent

          public void processEvent(int groupID,
                                   com.sparshui.common.Event event)

      Translate the specialized Sparsh UI information into a format that Jmol's ActionManager can understand without any special classes. This allows the applet to modularize the multitouch business into an optional JAR file
      Specified by:
        `processEvent` in interface `com.sparshui.client.SparshClient`
      Parameters:
        `groupID` -
        `event` -