return;
}
if (unUsedCursors.contains(m)){ //should always be true here!?
if (unUsedCursors.size() >= 2){ //we can try to resume the gesture
InputCursor firstCursor = unUsedCursors.get(0);
InputCursor secondCursor = unUsedCursors.get(1);
//See if we can obtain a lock on both cursors
if (this.canLock(firstCursor, secondCursor)){
float newDistance = Vector3D.distance(
new Vector3D(firstCursor.getCurrentEvent().getPosX(), firstCursor.getCurrentEvent().getPosY(),0),
new Vector3D(secondCursor.getCurrentEvent().getPosX(), secondCursor.getCurrentEvent().getPosY(),0));
if (newDistance < detectRadius) {//Check if other cursor is in distance
this.getLock(firstCursor, secondCursor);
unUsedCursors.remove(firstCursor);
unUsedCursors.remove(secondCursor);
lockedCursors.add(firstCursor);
lockedCursors.add(secondCursor);
logger.debug(this.getName() + " we could lock cursors: " + firstCursor.getId() +", " + secondCursor.getId());
logger.debug(this.getName() + " continue with different cursors (ID: " + firstCursor.getId() + ")" + " " + "(ID: " + secondCursor.getId() + ")");
//TODO fire start evt?
}else{
logger.debug(this.getName() + " distance was too great between cursors: " + firstCursor.getId() +", " + secondCursor.getId() + " distance: " + newDistance);
}
}else{
logger.debug(this.getName() + " we could NOT lock cursors: " + firstCursor.getId() +", " + secondCursor.getId());
}
}
}else{
logger.error(this.getName() + "hmmm - investigate why is cursor not in unusedList?");
}