@SuppressWarnings("rawtypes")
public void dragStart() {
super.dragStart();
WidgetLocation currentDraggableLocation = new WidgetLocation(context.draggable, context.boundaryPanel);
// To provide XY drag feature (BEGIN)
initialDraggableLocation = currentDraggableLocation;
// To provide XY drag feature (END)
if (getBehaviorDragProxy()) {
movablePanel = newDragProxy(context);
context.boundaryPanel.add(movablePanel, currentDraggableLocation.getLeft(), currentDraggableLocation.getTop());
} else {
saveSelectedWidgetsLocationAndStyle();
AbsolutePanel container = new AbsolutePanel();
DOM.setStyleAttribute(container.getElement(), "overflow", "visible");
container.setPixelSize(context.draggable.getOffsetWidth(), context.draggable.getOffsetHeight());
context.boundaryPanel.add(container, currentDraggableLocation.getLeft(), currentDraggableLocation.getTop());
int draggableAbsoluteLeft = context.draggable.getAbsoluteLeft();
int draggableAbsoluteTop = context.draggable.getAbsoluteTop();
for (Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();) {
Widget widget = (Widget) iterator.next();
if (widget != context.draggable) {
int relativeX = widget.getAbsoluteLeft() - draggableAbsoluteLeft;
int relativeY = widget.getAbsoluteTop() - draggableAbsoluteTop;
container.add(widget, relativeX, relativeY);
}
}
container.add(context.draggable, 0, 0);
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(context.boundaryPanel.getElement());
dropTargetClientHeight = DOMUtil.getClientHeight(context.boundaryPanel.getElement());
}