|
@@ -12,9 +12,7 @@ package org.yakindu.sct.statechart.diagram.policies;
|
|
|
|
|
|
import org.eclipse.draw2d.geometry.Rectangle;
|
|
|
import org.eclipse.gef.EditPart;
|
|
|
-import org.eclipse.gef.GraphicalEditPart;
|
|
|
import org.eclipse.gef.commands.Command;
|
|
|
-import org.eclipse.gef.requests.ChangeBoundsRequest;
|
|
|
import org.eclipse.gmf.runtime.common.core.command.ICommand;
|
|
|
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
|
|
|
import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
|
|
@@ -28,6 +26,8 @@ import org.eclipse.gmf.runtime.notation.View;
|
|
|
import org.yakindu.sct.statechart.diagram.editparts.RegionCompartmentEditPart;
|
|
|
import org.yakindu.sct.statechart.diagram.editparts.StateEditPart;
|
|
|
|
|
|
+import de.itemis.gmf.runtime.commons.editparts.FixedXYLayoutEditPolicy;
|
|
|
+
|
|
|
/**
|
|
|
* Special implementation of {@link XYLayoutEditPolicy} for the
|
|
|
* {@link RegionCompartmentEditPart}.
|
|
@@ -41,7 +41,7 @@ import org.yakindu.sct.statechart.diagram.editparts.StateEditPart;
|
|
|
* @author muelder
|
|
|
*
|
|
|
*/
|
|
|
-public class RegionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy {
|
|
|
+public class RegionCompartmentXYLayoutEditPolicy extends FixedXYLayoutEditPolicy {
|
|
|
|
|
|
@Override
|
|
|
protected Command createChangeConstraintCommand(EditPart child,
|
|
@@ -70,24 +70,7 @@ public class RegionCompartmentXYLayoutEditPolicy extends XYLayoutEditPolicy {
|
|
|
public IGraphicalEditPart getHost() {
|
|
|
return (IGraphicalEditPart) super.getHost();
|
|
|
}
|
|
|
- /**
|
|
|
- * TODO
|
|
|
- * This is a workaround for GMF bug #349042
|
|
|
- * This method can be removed entirely if the provided patch
|
|
|
- * is applied in GMF
|
|
|
- */
|
|
|
- @Override
|
|
|
- protected Object getConstraintFor(
|
|
|
- ChangeBoundsRequest request,
|
|
|
- GraphicalEditPart child) {
|
|
|
- Rectangle rect = (Rectangle) super.getConstraintFor(request, child);
|
|
|
- Rectangle cons = getCurrentConstraintFor(child);
|
|
|
- if(cons != null){
|
|
|
- if (request.getSizeDelta().width == 0)
|
|
|
- rect.width = cons.width;
|
|
|
- if (request.getSizeDelta().height == 0)
|
|
|
- rect.height = cons.height;
|
|
|
- }
|
|
|
- return rect;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|