Package org.mt4j.input.inputProcessors.componentProcessors.tapAndHoldProcessor

Examples of org.mt4j.input.inputProcessors.componentProcessors.tapAndHoldProcessor.TapAndHoldEvent


    tapAndHold.setMaxFingerUpDist(10);
    tapAndHold.setHoldTime(3000);
    tails.registerInputProcessor(tapAndHold);
    tails.addGestureListener(TapAndHoldProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapAndHoldEvent t = (TapAndHoldEvent)ge;
        if (t.getId() == TapAndHoldEvent.GESTURE_ENDED && t.isHoldComplete()){
          tails.clearTails()
        }
        return false;
      }
    });
View Full Code Here


    this.clearAllGestures(tapAndHoldOnly);
    tapAndHoldOnly.registerInputProcessor(new TapAndHoldProcessor(app, 2000));
    tapAndHoldOnly.addGestureListener(TapAndHoldProcessor.class, new TapAndHoldVisualizer(app, getCanvas()));
    tapAndHoldOnly.addGestureListener(TapAndHoldProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapAndHoldEvent th = (TapAndHoldEvent)ge;
        switch (th.getId()) {
        case TapAndHoldEvent.GESTURE_DETECTED:
          break;
        case TapAndHoldEvent.GESTURE_UPDATED:
          break;
        case TapAndHoldEvent.GESTURE_ENDED:
          if (th.isHoldComplete()){
            if (tapAndHoldOnly.getText().endsWith("--"))
              tapAndHoldOnly.setText("Tap&Hold me!  -|-");
            else
              tapAndHoldOnly.setText("Tap&Hold me!  ---")
          }
View Full Code Here

  /* (non-Javadoc)
   * @see org.mt4j.input.inputProcessors.IGestureEventListener#processGestureEvent(org.mt4j.input.inputProcessors.MTGestureEvent)
   */
  public boolean processGestureEvent(MTGestureEvent ge) {
    TapAndHoldEvent t = (TapAndHoldEvent)ge;

    float d = 360f * t.getElapsedTimeNormalized();
   
//    float a = 255 * t.getElapsedTimeNormalized();
    float a = 205 * t.getElapsedTimeNormalized();
   
    switch (t.getId()) {
    case TapAndHoldEvent.GESTURE_DETECTED:
      parent.addChild(e);
      e.setDegrees(0);
      e.recreate(false);
      e.setPositionGlobal(new Vector3D(t.getLocationOnScreen().x, t.getLocationOnScreen().y));
      break;
    case TapAndHoldEvent.GESTURE_UPDATED:
      e.setVisible(true);
     
      if (d >= 350){ //FIXME HACK to display the circle really closed before the end
View Full Code Here

TOP

Related Classes of org.mt4j.input.inputProcessors.componentProcessors.tapAndHoldProcessor.TapAndHoldEvent

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.