Examples of Finger


Examples of com.alderstone.multitouch.mac.touchpad.Finger

     * @param o
     * @param arg
     */
    @Override
    public void update(Observable o, Object arg) {
        Finger finger = (Finger) arg;
        //showRawData(finger);
        int id = finger.getID();
        if (id <= MAX_FINGER_BLOBS) blobs[id-1] = finger;
       
        // blob が1つでも press だったら pressed = true
        pressed = false;
        // 速度は最初に見つかった pressed の finger の値とする
View Full Code Here

Examples of com.alderstone.multitouch.mac.touchpad.Finger

   
    this.fingerIdToCursorId = new HashMap<Integer, Long>();
  }

  public void update(Observable obj, Object arg) {
    Finger finger = (Finger) arg;
    int fingerID = finger.getID();
   
    ActiveCursorPool cursorPool = ActiveCursorPool.getInstance();
    int inputID;
    Long cursorID = fingerIdToCursorId.get(fingerID);
    InputCursor cursor = (cursorID != null)? cursorPool.getActiveCursorByID(cursorID) : null;
   
    if (finger.getState() == FingerState.PRESSED) {
      if (cursor == null) { //new finger
        cursor = new InputCursor();
        fingerIdToCursorId.put(fingerID, cursor.getId());
        cursorPool.putActiveCursor(cursor.getId(), cursor);
        inputID = MTFingerInputEvt.INPUT_DETECTED;
      } else { //updated finger
        inputID = MTFingerInputEvt.INPUT_UPDATED;
      }
    } else { //removed finger
      if (cursorID != null){
        cursorPool.removeCursor(cursorID);
      }
      fingerIdToCursorId.remove(fingerID);
      inputID = MTFingerInputEvt.INPUT_ENDED;
    }
   
    int absoluteX = Math.round(finger.getX()*this.windowWidth);
    int absoluteY = Math.round((1-finger.getY())*this.windowHeight);
    this.enqueueInputEvent(new MTFingerInputEvt(this, absoluteX, absoluteY, inputID, cursor));
  }
View Full Code Here

Examples of com.leapmotion.leap.Finger

    this.lastDetectedFinger = new HashMap<Integer, Finger>();
    this.lastDetectedPointable = new HashMap<Integer, Pointable>();
    this.lastDetectedHand = new HashMap<Integer, Hand>();
    this.lastDetectedTool = new HashMap<Integer, Tool>();

    this.lastDetectedFinger.put(0, new Finger());
    this.lastDetectedPointable.put(0, new Pointable());
    this.lastDetectedHand.put(0, new Hand());
    this.lastDetectedTool.put(0, new Tool());

    // this is neccessary because the velocity of all objects has an offset.
    this.velocityOffsetTestFinger = new Finger();
  }
View Full Code Here

Examples of com.leapmotion.leap.Finger

    Frame frame = getFrame();
    if (frame.hands().isEmpty() == false) {
      Hand hand = frame.hands().get(0);
      if (hand.fingers().isEmpty() == false) {
        Finger finger = hand.fingers().get(0);
        fingerPositionXYPlane.x = transformLeapToScreenX(finger.tipPosition().getX());
        fingerPositionXYPlane.y = transformLeapToScreenY(finger.tipPosition().getY());
      }
    }

    return fingerPositionXYPlane;
  }
View Full Code Here

Examples of com.leapmotion.leap.Finger

   *
   * @param fingerNr
   * @return
   */
  public Finger getFinger(int fingerNr) {
    Finger returnFinger = null;
    if (getFingerList().size() > fingerNr) {
      this.lastDetectedFinger.put(fingerNr, getFingerList().get(fingerNr));
    }
    // returnFinger = lastDetectedFinger.get(fingerNr);
    int downCounter = 0;
View Full Code Here

Examples of com.leapmotion.leap.Finger

   * @param id
   * @param frame
   * @return
   */
  public Finger getFingerById(int id, Frame frame) {
    Finger returnFinger = null;
    for (Finger finger : getFingerList(frame)) {
      if (finger.id() == id) {
        returnFinger = finger;
      }
    }
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.