diff --git a/TULIP/src/lu/list/itis/dkd/tui/adapter/TuioAdapter.java b/TULIP/src/lu/list/itis/dkd/tui/adapter/TuioAdapter.java index dc6f738545878d6fe45b0bfac7b4b7f631cc2bfa..7fc065d32ca6dea0ac5b9474d87a5ce6db994e14 100644 --- a/TULIP/src/lu/list/itis/dkd/tui/adapter/TuioAdapter.java +++ b/TULIP/src/lu/list/itis/dkd/tui/adapter/TuioAdapter.java @@ -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); } } diff --git a/TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java b/TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java index e8a412c750195702ad60059a15d4831441f4d8bc..265d7004547db0fbb1bc31fe4a3d04be264ff910 100644 --- a/TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java +++ b/TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java @@ -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