Commit 7fca47bb authored by Eric Tobias's avatar Eric Tobias

Minor changes

parent 93b096f2
......@@ -233,6 +233,9 @@ public class SpatialMatrix {
*/
public synchronized List<TangibleObject> below(int objectId) {
int index = findVerticalIndexFor(objectId) + 1;
// BUG if nothing is beloww, the index might be greater than the size of the array.
return new ArrayList<>(vertical.subList(index, vertical.size()));
}
......
......@@ -141,19 +141,19 @@ 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$
}
/**
......
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