Examples of MotionEvent


Examples of com.google.glass.companion.Proto.MotionEvent

        // TODO Auto-generated method stub
    }

    @Override
    public void onMouseEvent(int action, int x, int y, long downTime) {
        MotionEvent glassMotionEvent = GlassMessagingUtil.convertMouseEvent2MotionEvent(action, 100.0f * (float) x
                / (float) mScreencastPanel.getWidth(), 100.0f * (float) y / (float) mScreencastPanel.getHeight(),
                downTime);
        Envelope envelope = CompanionMessagingUtil.newEnvelope();
        envelope.motionC2G = glassMotionEvent;
        mGlassConnection.writeAsync(envelope);
View Full Code Here

Examples of com.google.glass.companion.Proto.MotionEvent

    public static final int ACTION_DOWN = 0;
    public static final int ACTION_MOVE = 2;
    public static final int ACTION_UP = 1;

    public static MotionEvent convertMouseEvent2MotionEvent(int action, float x, float y, long downTime) {
        MotionEvent me = new MotionEvent();
        me.downTime = downTime;
        me.eventTime = System.currentTimeMillis();
        me.action = action;
        me.metaState = 0;
        me.buttonState = 0;
View Full Code Here

Examples of com.google.glass.companion.Proto.MotionEvent

        float stepX = (endX - startX) / (float) SWIPE_STEP_COUNT;
        float stepY = (endY - startY) / (float) SWIPE_STEP_COUNT;

        long downTime = System.currentTimeMillis() - SWIPE_DURATION;
        long eventTime = downTime;
        MotionEvent downEvent = convertMouseEvent2MotionEvent(ACTION_DOWN, x, y, downTime);
        res.add(newMotionEventEnvelope(downEvent));
        for (int i = 0; i < SWIPE_STEP_COUNT - 1; i++) {
            x += stepX;
            y += stepY;
            eventTime += SWIPE_STEP_DURATION;
            MotionEvent moveEvent = convertMouseEvent2MotionEvent(ACTION_MOVE, x, y, downTime);
            moveEvent.eventTime = eventTime;
            res.add(newMotionEventEnvelope(moveEvent));
        }
        x += stepX;
        y += stepY;
        eventTime += SWIPE_STEP_DURATION;
        MotionEvent upEvent = convertMouseEvent2MotionEvent(ACTION_UP, x, y, downTime);
        upEvent.eventTime = eventTime;
        res.add(newMotionEventEnvelope(upEvent));
        return res;
    }
View Full Code Here

Examples of com.google.glass.companion.Proto.MotionEvent

    public static final List<Envelope> getTapEvents() {
        List<Envelope> res = new ArrayList<Envelope>();
        float x = 33.3F;
        float y = 50.0F;
        long downTime = System.currentTimeMillis();
        MotionEvent downEvent = convertMouseEvent2MotionEvent(ACTION_DOWN, x, y, downTime);
        res.add(newMotionEventEnvelope(downEvent));
        MotionEvent upEvent = convertMouseEvent2MotionEvent(ACTION_UP, x, y, downTime);
        res.add(newMotionEventEnvelope(upEvent));
        return res;
    }
View Full Code Here

Examples of com.jme3.cinematic.events.MotionEvent

        path1.addWayPoint(new Vector3f(-271.03436f, 274.78607f, 166.41858f));
        path1.addWayPoint(new Vector3f(-282.98575f, 198.66827f, -62.538017f));
        path1.addWayPoint(new Vector3f(-141.32166f, 241.95816f, -299.23657f));
        path1.addWayPoint(new Vector3f(69.37767f, 282.1654f, -395.867f));
        path1.setCurveTension(0.5f);
        seagullCamMotion1 = new MotionEvent(seagull, path1, 10f);
        seagullCamMotion1.setLookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
        seagullCamMotion1.setDirectionType(MotionEvent.Direction.LookAt);
        seagullCamMotion1.setLoopMode(LoopMode.DontLoop);

        //Motion2
        MotionPath path2 = new MotionPath();
        path2.addWayPoint(new Vector3f(69.37767f, 282.1654f, -395.867f));
        path2.addWayPoint(new Vector3f(49.096973f, 199.68199f, -280.14606f));
        path2.addWayPoint(new Vector3f(69.881424f, 80.421936f, -153.33533f));
        path2.addWayPoint(new Vector3f(92.93746f, 41.409966f, -79.42096f));
        path2.addWayPoint(new Vector3f(135.33469f, 37.869682f, -40.803993f));
        path2.addWayPoint(new Vector3f(232.73439f, 62.335537f, 4.7981267f));
        path2.addWayPoint(new Vector3f(151.06522f, 40.954773f, 108.32132f));
        path2.addWayPoint(new Vector3f(70.51622f, 30.993803f, 89.91843f));
        path2.addWayPoint(new Vector3f(-52.995872f, 27.911129f, 33.102673f));
        path2.addWayPoint(new Vector3f(-96.421425f, 27.326252f, -49.235554f));
        path2.addWayPoint(new Vector3f(-186.47707f, 19.662216f, -72.307915f));
        path2.addWayPoint(new Vector3f(-187f, 19.808556f, -72.36449f));

        path2.setCurveTension(0.6f);
        path2.setPathSplineType(SplineType.CatmullRom);
        seagullCamMotion2 = new MotionEvent(seagull, path2, 24f);
        seagullCamMotion2.setDirectionType(MotionEvent.Direction.Path);
        seagullCamMotion2.setLoopMode(LoopMode.DontLoop);
    }
View Full Code Here

Examples of fr.umlv.zen2.MotionEvent

   * Update the point list representing a possible gesture
   * @param context The application context to handle event
   */
  public void update(ApplicationContext context) {
        while (true) {
            final MotionEvent event = context.pollMotion();
            if (event == null)
              break;

            if (this.capturing == false && event.getKind() == MotionEvent.Kind.ACTION_DOWN) {
            this.points = new ArrayList<>();
            this.capturing = true;
            this.setGesture(GestureID.UNKNOWN);
            this.points.add(new Point(event.getX(), event.getY()));
          } else if (this.capturing == true && event.getKind() == MotionEvent.Kind.ACTION_UP) {
            this.capturing = false;
            this.analyze();
          } else if (this.capturing == true && event.getKind() == MotionEvent.Kind.ACTION_MOVE) {
            this.points.add(new Point(event.getX(), event.getY()));
          }
        }
  }
View Full Code Here

Examples of muito.motion.MotionEvent

 
  /* (non-Javadoc)
   * @see muito.motion.MotionProviderListener#newMotionProvided(muito.motion.Motion)
   */
  public void newMotionProvided(Motion motion) {
    MotionEvent me = motion.getLastEvent();
   
    InputCursor m = new InputCursor();
    MTFingerInputEvt touchEvt = new MTFingerInputEvt(this, me.getXAbs(), me.getYAbs(), MTFingerInputEvt.INPUT_DETECTED, m);
//    m.addEvent(touchEvt);
   
    long motionID = motion.getId();
    ActiveCursorPool.getInstance().putActiveCursor(motionID, m);
    muitoIDToInputMotionID.put(motionID, motionID);
View Full Code Here

Examples of serverMessages.MotionEvent

        case Enums.sendMoveUnit:
          System.out.print("messageIn\n");
          int ID=in.readInt();
          int x=in.readInt();
          int y=in.readInt();
          ServerMain.enQueue(new MotionEvent(PlayerID,Time,ID,x,y) );
          break;
         
        case Enums.sendCastSpell:
          int type=in.readInt();
          int sourceID=in.readInt();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.