private ChangeBoundsRequest initConstrainedRequest(ChangeBoundsRequest request) { ChangeBoundsRequest req = new ChangeBoundsRequest(); req.setConstrainedResize(true); req.setConstrainedMove(true); req.setType(request.getType()); req.setResizeDirection(request.getResizeDirection()); req.getExtendedData().put(REGION_RESIZE_PROPAGATOR, getHost()); req.getExtendedData() .put( SiriusResizeTracker.CHILDREN_MOVE_MODE_KEY, request.getExtendedData().get(SiriusResizeTracker.CHILDREN_MOVE_MODE_KEY)); req.getExtendedData().put(REGION_RESIZE_INITIAL_REQUEST, request); return req; }
/** @see org.eclipse.gef.tools.SimpleDragTracker#updateSourceRequest() */ protected void updateSourceRequest() { ChangeBoundsRequest request = (ChangeBoundsRequest) getSourceRequest(); if (originalLocation == null) { originalLocation = getStartLocation().getCopy(); } Dimension delta = getDragMoveDelta(); request.setConstrainedMove(getCurrentInput().isModKeyDown(MODIFIER_CONSTRAINED_MOVE)); request.setSnapToEnabled(!getCurrentInput().isModKeyDown(MODIFIER_NO_SNAPPING)); Point moveDelta = new Point(delta.width, delta.height); request.getExtendedData().clear(); request.setMoveDelta(moveDelta); snapPoint(request); request.setLocation(getLocation()); request.setType(getCommandName()); }