Examples of TuioCursor


Examples of TUIO.TuioCursor

        }
      }
    }

    // TODO check only if the other were no hits
    TuioCursor toRemoveTC = null;
    for (TuioCursor unusedTuioCursor : unusedTuioCursorStack) {
      if (tuioCursor.getCursorID() == unusedTuioCursor.getCursorID()) {
        toRemoveTC = tuioCursor;
        break;
      }
View Full Code Here

Examples of org.tuio.TuioCursor

        activeCursors.clear();
        // if there are cursors in the map
        if (!sessionIds.isEmpty()) {
          // for all cursors
          for(long sessionId : sessionIds) {
            TuioCursor cursor = cursors.get(sessionId);
            if (cursor == null) continue;
            // get the cursor id (0,1..)
            int CursorID = cursor.getCursorID();
            // add it to the active cursors
            activeCursors.add(CursorID);
            // if the cursor id is not in the availableCursors set then add it and...
            if (availableCursors.add(CursorID)) {
              // for all listeners call onNew
              for (int i = 0; i < listeners.size(); i++) {
                TuioInputListener listener = listeners.get(i);
                listener.onNew(CursorID, cursor.getScreenX(screenWidth), screenHeight-cursor.getScreenY(screenHeight));
              }
            } else {
            // the cursor id is in the availableCursors set
             
              // get or create the cursor store
              TuioCursorStore cstore = null;
              if (store.containsKey(CursorID)) {
                cstore = store.get(CursorID);
              } else {
                cstore = new TuioCursorStore();
              }
             
              // if the cursor has moved (note hasMoved had to be called to recalculate the position)
              if (cstore.hasMoved(cursor.getScreenX(screenWidth), cursor.getScreenY(screenHeight))) {
                for (int i = 0; i < listeners.size(); i++) {
                  // for all listeners call onMove
                  TuioInputListener listener = listeners.get(i);
                  listener.onMove(CursorID, cstore.getDeltaX(), cstore.getDeltaY(), cstore.getX(), screenHeight-cstore.getY());
                }
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.