private void handleMoveDrag(Canvas canvas, int dx, int dy, int modsEx) {
boolean connect = shouldConnect(canvas, modsEx);
drawConnections = connect;
if (connect) {
MoveGesture gesture = moveGesture;
if (gesture == null) {
gesture = new MoveGesture(new MoveRequestHandler(canvas),
canvas.getCircuit(), canvas.getSelection().getAnchoredComponents());
moveGesture = gesture;
}
if (dx != 0 || dy != 0) {
boolean queued = gesture.enqueueRequest(dx, dy);
if (queued) {
canvas.setErrorMessage(getFromLocale("moveWorkingMsg"), dx, dy, COLOR_COMPUTING);
// maybe CPU scheduled led the request to be satisfied
// just before the "if(queued)" statement. In any case, it
// doesn't hurt to check to ensure the message belongs.
if (gesture.findResult(dx, dy) != null) {
clearCanvasMessage(canvas, dx, dy);
}
}
}
}