switch (posEvt.getId()) {
case AbstractCursorInputEvt.INPUT_DETECTED:{
// logger.debug("Finger DOWN-> " + " ID:" + posEvt.getId() + "; X:" + posEvt.getPosX() + " Y:" + posEvt.getPosY() + "; Source: " + posEvt.getSource());
// System.out.println("Finger DOWN-> " + " ID:" + posEvt.getId() + "; X:" + posEvt.getPosX() + " Y:" + posEvt.getPosY() + "; Source: " + posEvt.getSource()+ " CursorID: " + m.getId() + " appInfoProv: " + appInfoProvider);
//Check if there is an object under the cursor and save it to a hashtable with the event if so
IMTComponent3D obj = appInfoProvider.getComponentAt(posEvt.getPosX(), posEvt.getPosY());
if (obj != null){
motionToObjectMap.put(m, obj);
posEvt.setTargetComponent(obj);
this.fireInputEvent(posEvt);
}
}
break;
case AbstractCursorInputEvt.INPUT_UPDATED:{
// logger.debug("Finger UPDATE-> " + " ID:" + posEvt.getId() + "; X:" + posEvt.getPositionX() + " Y:" + posEvt.getPositionY() + "; Source: " + posEvt.getSource());
IMTComponent3D associatedObj = motionToObjectMap.get(m);
if (associatedObj != null){
posEvt.setTargetComponent(associatedObj);
this.fireInputEvent(posEvt);
}
}
break;
case AbstractCursorInputEvt.INPUT_ENDED:{
// logger.debug("Finger UP-> " + " ID:" + posEvt.getId() + "; X:" + posEvt.getPositionX() + " Y:" + posEvt.getPositionY() + "; Source: " + posEvt.getSource());
// IMTComponent3D associatedObj = motionToObjectMap.get(m);
IMTComponent3D associatedObj = motionToObjectMap.remove(m);
if (associatedObj != null){
posEvt.setTargetComponent(associatedObj);
this.fireInputEvent(posEvt);
// motionToObjectMap.remove(m);
}