return;
}
DraggableHandler initialDragHandler = DraggableHandler
.getInstance(initialDraggable);
GQuery $initialDraggable = $(initialDraggable);
GroupingMode groupingMode = handler.getOptions().getGroupingMode();
int groupSpacing = handler.getOptions().getGroupSpacing();
Offset newPosition = null;
switch (groupingMode) {
case DOWN:
HelperInfo lastDown = $initialDraggable.data(LAST_DOWN, HelperInfo.class);
if (lastDown == null) {
lastDown = new HelperInfo(initialDragHandler.getAbsolutePosition(),
initialDragHandler.getHelper());
}
newPosition = lastDown.offset.add(0, lastDown.height + groupSpacing);
HelperInfo newLastDown = new HelperInfo(newPosition, handler.getHelper());
$initialDraggable.data(LAST_DOWN, newLastDown);
break;
case UP:
HelperInfo lastUp = $initialDraggable.data(LAST_UP, HelperInfo.class);
if (lastUp == null) {
lastUp = new HelperInfo(initialDragHandler.getAbsolutePosition(),
initialDragHandler.getHelper());
}
newPosition = lastUp.offset.add(0, -handler.getHelperDimension()
.getHeight()
- groupSpacing);
HelperInfo newLastUp = new HelperInfo(newPosition, handler.getHelper());
$initialDraggable.data(LAST_UP, newLastUp);
break;
case LEFT:
HelperInfo lastLeft = $initialDraggable.data(LAST_LEFT, HelperInfo.class);
if (lastLeft == null) {
lastLeft = new HelperInfo(initialDragHandler.getAbsolutePosition(),
initialDragHandler.getHelper());
}
newPosition = lastLeft.offset.add(-handler.getHelperDimension()
.getWidth()
- groupSpacing, 0);
HelperInfo newLastLeft = new HelperInfo(newPosition, handler.getHelper());
$initialDraggable.data(LAST_LEFT, newLastLeft);
break;
case RIGHT:
HelperInfo lastRight = $initialDraggable.data(LAST_RIGHT,
HelperInfo.class);
if (lastRight == null) {
lastRight = new HelperInfo(initialDragHandler.getAbsolutePosition(),
initialDragHandler.getHelper());
}
newPosition = lastRight.offset.add(lastRight.width + groupSpacing, 0);
HelperInfo newLastRight = new HelperInfo(newPosition, handler.getHelper());
$initialDraggable.data(LAST_RIGHT, newLastRight);
break;
default:
break;