Package com.sparshui.server

Examples of com.sparshui.server.TouchPoint


          + changedTouchPoint.getState() + " ncurrent=" + _nCurrent
          + " nMoves=" + _nMoves);
    switch (changedTouchPoint.getState()) {
    case TouchState.BIRTH:
      _myId = id;
      _birth = new TouchPoint(changedTouchPoint);
      _nCurrent = 1;
      _nMoves = 0;
      break;
    case TouchState.MOVE:
      if (id != _myId)
View Full Code Here


    retEvents.add(new TouchEvent(changedTouchPoint));
    return retEvents;
  }

  private boolean checkClick(TouchPoint tpNew, List retEvents, boolean isDeath) {
    TouchPoint tp;
    long dt = tpNew.getTime() - _birth.getTime();
    boolean isSingleClick = (isDeath && dt < MAXIMUM_CLICK_TIME);
    if (dt < 500 && !isSingleClick)
      return false;
    _nMoves += 2;
    // long (1/2 sec) pause and drag == double-click-drag ==> _translate
    tp = new TouchPoint(_birth);
    tp.setState(TouchState.DEATH);
    retEvents.add(new TouchEvent(tp));
    tp.setState(TouchState.CLICK);
    retEvents.add(new TouchEvent(tp));
    if (isSingleClick)
      return true;
    tp.setState(TouchState.BIRTH);
    retEvents.add(new TouchEvent(tp));
    if (!isDeath)
      return true;
    tp.setState(TouchState.DEATH);
    retEvents.add(new TouchEvent(tp));
    tp.setState(TouchState.CLICK);
    retEvents.add(new TouchEvent(tp));
    return true;
  }
View Full Code Here

TOP

Related Classes of com.sparshui.server.TouchPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.