Package org.jboss.errai.ui.cordova.events.touch

Examples of org.jboss.errai.ui.cordova.events.touch.TouchPoint


          state = State.FOUND_DIRECTION;

          direction = touch.getPageX() - x > 0 ? Direction.LEFT_TO_RIGHT : Direction.RIGHT_TO_LEFT;

          SwipeStartEvent swipeStartEvent =
                  new SwipeStartEvent(new TouchPoint(touch), touch.getPageX() - x, direction);

          source.fireEvent(swipeStartEvent);

        } else {
          if (Math.abs(touch.getPageY() - y) >= threshold) {
            state = State.FOUND_DIRECTION;

            direction = touch.getPageY() - y > 0 ? Direction.TOP_TO_BOTTOM : Direction.BOTTOM_TO_TOP;

            SwipeStartEvent swipeStartEvent =
                    new SwipeStartEvent(new TouchPoint(touch), touch.getPageY() - y, direction);

            source.fireEvent(swipeStartEvent);

          }

        }
        break;

      case FOUND_DIRECTION:

        switch (direction) {
          case TOP_TO_BOTTOM:
          case BOTTOM_TO_TOP:
            lastDistance = Math.abs(touch.getPageY() - y);
            source.fireEvent(
                    new SwipeMoveEvent(new TouchPoint(touch), lastDistance > minDistance,
                            lastDistance, direction));
            break;

          case LEFT_TO_RIGHT:
          case RIGHT_TO_LEFT:
            lastDistance = Math.abs(touch.getPageX() - x);
            source.fireEvent(
                    new SwipeMoveEvent(new TouchPoint(touch), lastDistance > minDistance,
                            lastDistance, direction));

            break;

          default:
View Full Code Here


    switch (state) {
    case INVALID:
      break;
    case READY:
      startPositions.add(new TouchPoint(touches.get(touchCount - 1)));
      state = State.FINGERS_DOWN;
      break;
    case FINGERS_DOWN:
      startPositions.add(new TouchPoint(touches.get(touchCount - 1)));
      break;
    case FINGERS_UP:
    default:
      state = State.INVALID;
      break;
View Full Code Here

TOP

Related Classes of org.jboss.errai.ui.cordova.events.touch.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.