diff options
author | Vincent Lorenzo | 2014-03-17 14:10:06 +0000 |
---|---|---|
committer | Vincent Lorenzo | 2014-03-17 14:10:06 +0000 |
commit | 50afef61286ac7f97ca665187bcb31c43d3882a3 (patch) | |
tree | 413e443a7e245c0f7ad09bc6b8d56b303c13cc77 | |
parent | f533d8cc06c3d9a6ba0f4040fa62c7a83162406f (diff) | |
download | org.eclipse.papyrus-50afef61286ac7f97ca665187bcb31c43d3882a3.tar.gz org.eclipse.papyrus-50afef61286ac7f97ca665187bcb31c43d3882a3.tar.xz org.eclipse.papyrus-50afef61286ac7f97ca665187bcb31c43d3882a3.zip |
424942: [Diagram] Papyrus shall ease resizing of model elements owning children
424942: [Diagram] Papyrus shall ease resizing of model elements owning children
https://bugs.eclipse.org/bugs/show_bug.cgi?id=424942
2 files changed, 21 insertions, 1 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/XYLayoutWithConstrainedResizedEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/XYLayoutWithConstrainedResizedEditPolicy.java index aa77b8fa7f1..9a1b7cd8e35 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/XYLayoutWithConstrainedResizedEditPolicy.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpolicies/XYLayoutWithConstrainedResizedEditPolicy.java @@ -136,7 +136,7 @@ public class XYLayoutWithConstrainedResizedEditPolicy extends XYLayoutEditPolicy final List<?> children = request.getEditParts();
final int direction = request.getResizeDirection();
boolean isConstrainedResize = request.isConstrainedResize();
- boolean forceLocation = isConstrainedResize && (direction == PositionConstants.WEST || direction == PositionConstants.NORTH || direction == PositionConstants.NORTH_WEST);
+ boolean forceLocation = isConstrainedResize ;//&& (direction == PositionConstants.WEST || direction == PositionConstants.NORTH || direction == PositionConstants.NORTH_WEST );//|| direction == PositionConstants.NORTH_EAST || direction == PositionConstants.SOUTH_WEST);
for(int i = 0; i < children.size(); i++) {
child = (IGraphicalEditPart)children.get(i);
resize.add(createChangeConstraintCommand(request, child, translateToModelConstraint(getConstraintFor(request, child))));
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java index 75aa0112aa7..f1c4ae65108 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java @@ -168,6 +168,26 @@ public class UpdatePortLocationCommand extends AbstractTransactionalCommand { //nothing to do break; } + }else if(resizeDirection==PositionConstants.SOUTH_WEST){ + switch(borderItemSide) { + case PositionConstants.SOUTH: + case PositionConstants.NORTH: + borderItemBounds.setX(borderItemBounds.getX() - delta.x); + break; + default: + //nothing to do + break; + } + }else if(resizeDirection==PositionConstants.NORTH_EAST){ + switch(borderItemSide) { + case PositionConstants.EAST: + case PositionConstants.WEST: + borderItemBounds.setY(borderItemBounds.getY() - delta.y); + break; + default: + //nothing to do + break; + } } } return CommandResult.newOKCommandResult(); |