@Override
public void dragStart() {
super.dragStart();
WidgetLocation currentDraggableLocation = new WidgetLocation(context.draggable,
context.boundaryPanel);
if (getBehaviorDragProxy()) {
movablePanel = newDragProxy(context);
context.boundaryPanel.add(movablePanel, currentDraggableLocation.getLeft(),
currentDraggableLocation.getTop());
checkGWTIssue1813(movablePanel, context.boundaryPanel);
} else {
saveSelectedWidgetsLocationAndStyle();
AbsolutePanel container = new AbsolutePanel();
container.getElement().getStyle().setProperty("overflow", "visible");
container.setPixelSize(context.draggable.getOffsetWidth(),
context.draggable.getOffsetHeight());
context.boundaryPanel.add(container, currentDraggableLocation.getLeft(),
currentDraggableLocation.getTop());
checkGWTIssue1813(container, context.boundaryPanel);
int draggableAbsoluteLeft = context.draggable.getAbsoluteLeft();
int draggableAbsoluteTop = context.draggable.getAbsoluteTop();
HashMap<Widget, CoordinateLocation> widgetLocation = new HashMap<Widget, CoordinateLocation>();
for (Widget widget : context.selectedWidgets) {
widgetLocation.put(widget, new CoordinateLocation(widget.getAbsoluteLeft(),
widget.getAbsoluteTop()));
}
context.dropController = getIntersectDropController(context.mouseX, context.mouseY);
if (context.dropController != null) {
context.dropController.onEnter(context);
}
for (Widget widget : context.selectedWidgets) {
Location location = widgetLocation.get(widget);
int relativeX = location.getLeft() - draggableAbsoluteLeft;
int relativeY = location.getTop() - draggableAbsoluteTop;
container.add(widget, relativeX, relativeY);
}
movablePanel = container;
}
movablePanel.addStyleName(PRIVATE_CSS_MOVABLE_PANEL);
// one time calculation of boundary panel location for efficiency during
// dragging
Location widgetLocation = new WidgetLocation(context.boundaryPanel, null);
boundaryOffsetX = widgetLocation.getLeft()
+ DOMUtil.getBorderLeft(context.boundaryPanel.getElement());
boundaryOffsetY = widgetLocation.getTop()
+ DOMUtil.getBorderTop(context.boundaryPanel.getElement());
dropTargetClientWidth = DOMUtil.getClientWidth(boundaryPanel.getElement());
dropTargetClientHeight = DOMUtil.getClientHeight(boundaryPanel.getElement());
}