Commit fc0ba325 authored by Eric Tobias's avatar Eric Tobias

2.1.2 - Fixed issue with cursors and blobs not being removed from the spatial matrix correctly.

parent e5fe468b
......@@ -379,8 +379,14 @@ public class TuioAdapter extends TuiAdapter implements TuioListener {
tangibleObjectList.remove(object.getObjectId(), object);
logInfo(object, "up"); //$NON-NLS-1$
synchronized (this) {
objectManager.liftObject(object);
/**
* Note that the order is important. As blobs and cursors are added even if they are not
* predefined, removing them by calling the lift function before notifying listeners
* will result in the notification to be aborted prematurely (as the associated widget
* cannot be found). This would lead to unexpected behaviour.
*/
notifyListeners(new SpatialEvent(object, object.getPosition(), SpatialEventType.REMOVE));
objectManager.liftObject(object);
}
}
......
......@@ -43,7 +43,7 @@ import java.util.logging.Logger;
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 2.1
* @version 2.1.0
* @version 2.1.2
*/
public class SpatialPositioningManager implements SpatialEventListener {
......@@ -127,15 +127,18 @@ public class SpatialPositioningManager implements SpatialEventListener {
logger.log(Level.SEVERE, "Spatial event type \"" + event.getType() + "\" not recognized!"); //$NON-NLS-1$ //$NON-NLS-2$
break;
}
// System.out.println(spatialMatrix.printLists());
// System.out.println("Left of " + event.getSource().getObjectId() + ": " +
// spatialMatrix.leftOf(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Right of " + event.getSource().getObjectId() + ": " +
// spatialMatrix.rightOf(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Above " + event.getSource().getObjectId() + ": " +
// spatialMatrix.above(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Below " + event.getSource().getObjectId() + ": " +
// spatialMatrix.below(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(spatialMatrix.printLists());
System.out.println("Left of " + event.getSource().getObjectId() + ": " +
spatialMatrix.leftOf(event.getSource().getObjectId())); // $NON-NLS-1$
// //$NON-NLS-2$
System.out.println("Right of " + event.getSource().getObjectId() + ": " +
spatialMatrix.rightOf(event.getSource().getObjectId())); // $NON-NLS-1$
// //$NON-NLS-2$
System.out.println("Above " + event.getSource().getObjectId() + ": " +
spatialMatrix.above(event.getSource().getObjectId())); // $NON-NLS-1$
// //$NON-NLS-2$
System.out.println("Below " + event.getSource().getObjectId() + ": " +
spatialMatrix.below(event.getSource().getObjectId())); // $NON-NLS-1$
// //$NON-NLS-2$
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment