Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Barbin2014-11-06 14:22:00 +0000
committerFlorian Barbin2014-11-21 09:22:00 +0000
commite75b77da0181d4b6f94347f1278c4417b935dac0 (patch)
treecde818315423f435087c87a60fcb8f136ede2dab
parent5311a5d0f42e5e63ab88f4b76bde637c1195de82 (diff)
downloadorg.eclipse.sirius-e75b77da0181d4b6f94347f1278c4417b935dac0.tar.gz
org.eclipse.sirius-e75b77da0181d4b6f94347f1278c4417b935dac0.tar.xz
org.eclipse.sirius-e75b77da0181d4b6f94347f1278c4417b935dac0.zip
[450067] Fix wrong border node location after resizing.
* This patch fixes the wrong GMF location when resizing a border node toward the parent shape center. * This patch fixes also the wrong feedback when resizing toward the bordered node center. * Add tests. Bug: 450067 Change-Id: I2208c899aad8b996995fa2576357dec44dd4f2dc Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SpecificBorderItemSelectionEditPolicy.java71
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java102
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.html104
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.textile10
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ShapeResizingEdgePositionStabilityTests.java67
5 files changed, 244 insertions, 110 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SpecificBorderItemSelectionEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SpecificBorderItemSelectionEditPolicy.java
index d7d369a8c5..9488c91ac2 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SpecificBorderItemSelectionEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SpecificBorderItemSelectionEditPolicy.java
@@ -629,38 +629,75 @@ public class SpecificBorderItemSelectionEditPolicy extends ResizableEditPolicyEx
@Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
- Command superCommand = super.getResizeCommand(request);
-
EditPart host = getHost();
- if (host instanceof IGraphicalEditPart) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) host).getEditingDomain();
- CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(editingDomain, superCommand.getLabel());
- ctc.add(new CommandProxy(superCommand));
+ if (host instanceof IBorderItemEditPart) {
+ final IBorderItemEditPart borderItemEP = (IBorderItemEditPart) host;
+ Rectangle newBounds = getNewBounds(request);
+
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize,
+ new EObjectAdapter((View) getHost().getModel()), newBounds);
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) borderItemEP).getEditingDomain();
+ CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(editingDomain, setBoundsCommand.getLabel());
+ ctc.add(setBoundsCommand);
ShiftEdgeIdentityAnchorOperation operation = new ShiftEdgeIdentityAnchorOperation(request);
ICommand command = CommandFactory.createICommand(editingDomain, operation);
ctc.add(command);
// we add a command to keep the edges centered (if they should be)
- CenterEditPartEdgesCommand centerEditPartEdgesCommand = new CenterEditPartEdgesCommand((IGraphicalEditPart) host, request);
+ CenterEditPartEdgesCommand centerEditPartEdgesCommand = new CenterEditPartEdgesCommand(borderItemEP, request);
ctc.add(centerEditPartEdgesCommand);
return new ICommandProxy(ctc);
}
- return superCommand;
+ return super.getResizeCommand(request);
}
/**
* Returns the command contribution to a change bounds request.
*
* @param request
- * the change bounds requesgt
+ * the change bounds request
* @return the command contribution to the request
*/
@Override
protected Command getMoveCommand(final ChangeBoundsRequest request) {
+
final IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
- final IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
+ Rectangle newBounds = getNewBounds(request);
+ if (newBounds != null) {
+ final ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), newBounds);
+ Command result = new ICommandProxy(moveCommand);
+
+ if (getHost() instanceof IGraphicalEditPart) {
+ final Point parentOrigin = borderItemEP.getFigure().getParent().getBounds().getTopLeft();
+ Point oldRelativeBounds = borderItemEP.getFigure().getBounds().getTopLeft().translate(parentOrigin.getNegated());
+ PrecisionPoint delta = new PrecisionPoint(newBounds.getLocation().translate(oldRelativeBounds.getNegated()));
+ GraphicalHelper.applyZoomOnPoint((IGraphicalEditPart) getHost(), delta);
+
+ IGraphicalEditPart hostPart = (IGraphicalEditPart) getHost();
+ CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(hostPart.getEditingDomain(), result.getLabel());
+ ctc.add(new CommandProxy(result));
+ ctc.add(new ChangeBendpointsOfEdgesCommand(hostPart, delta));
+ result = new ICommandProxy(ctc);
+ }
+ return result;
+ }
+ return null;
+ }
+
+ /**
+ * Computes the new bounds of the border item.
+ *
+ * @param request
+ * the change bounds request.
+ * @return the new bounds according to the request and the border item
+ * locator.
+ */
+ private Rectangle getNewBounds(final ChangeBoundsRequest request) {
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart) getHost();
+ IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
if (borderItemLocator != null) {
final PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds());
@@ -702,20 +739,8 @@ public class SpecificBorderItemSelectionEditPolicy extends ResizableEditPolicyEx
final Point parentOrigin = borderItemEP.getFigure().getParent().getBounds().getTopLeft();
final Dimension d = realLocation.getTopLeft().getDifference(parentOrigin);
final Point location = new Point(d.width, d.height);
- final ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View) getHost().getModel()), location);
- Command result = new ICommandProxy(moveCommand);
-
- if (getHost() instanceof IGraphicalEditPart) {
- PrecisionPoint delta = new PrecisionPoint(realLocation.getTopLeft().getTranslated(borderItemEP.getFigure().getBounds().getTopLeft().getNegated()));
- GraphicalHelper.applyZoomOnPoint((IGraphicalEditPart) getHost(), delta);
+ return new Rectangle(location, rect.getSize());
- IGraphicalEditPart hostPart = (IGraphicalEditPart) getHost();
- CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(hostPart.getEditingDomain(), result.getLabel());
- ctc.add(new CommandProxy(result));
- ctc.add(new ChangeBendpointsOfEdgesCommand(hostPart, delta));
- result = new ICommandProxy(ctc);
- }
- return result;
}
return null;
}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
index 3c7c5cfd51..67218034b9 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
@@ -199,7 +199,7 @@ public class DBorderItemLocator extends BorderItemLocator {
// if bordered node is moved.
figuresToIgnoreDuringNextRelocate.clear();
}
- final Point ptNewLocation = locateOnBorder(rectSuggested.getLocation(), getCurrentSideOfParent(), 0, borderItem, figuresToIgnoreDuringNextRelocate, new ArrayList<IFigure>());
+ final Point ptNewLocation = locateOnBorder(rectSuggested, getCurrentSideOfParent(), 0, borderItem, figuresToIgnoreDuringNextRelocate, new ArrayList<IFigure>());
borderItem.setLocation(ptNewLocation);
figuresToIgnoreDuringNextRelocate.clear();
borderItem.setSize(size);
@@ -211,7 +211,7 @@ public class DBorderItemLocator extends BorderItemLocator {
protected Point locateOnBorder(Point suggestedLocation, int suggestedSide, int circuitCount, IFigure borderItem) {
List<IFigure> figuresToIgnore = Lists.newArrayList();
figuresToIgnore.add(borderItem);
- return locateOnBorder(suggestedLocation, suggestedSide, circuitCount, borderItem, figuresToIgnore, new ArrayList<IFigure>());
+ return locateOnBorder(new Rectangle(suggestedLocation, getSize(borderItem)), suggestedSide, circuitCount, borderItem, figuresToIgnore, new ArrayList<IFigure>());
}
/**
@@ -236,19 +236,20 @@ public class DBorderItemLocator extends BorderItemLocator {
* must be used for conflict detection
* @return point
*/
- protected Point locateOnBorder(final Point suggestedLocation, final int suggestedSide, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Point locateOnBorder(final Rectangle suggestedLocation, final int suggestedSide, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
Point recommendedLocation = locateOnParent(suggestedLocation, suggestedSide, borderItem);
- if (circuitCount < NB_SIDES && conflicts(recommendedLocation, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection).some()) {
+ Rectangle newRecommendedLocationBounds = new Rectangle(recommendedLocation, suggestedLocation.getSize());
+ if (circuitCount < NB_SIDES && conflicts(newRecommendedLocationBounds, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection).some()) {
if (suggestedSide == PositionConstants.WEST) {
- recommendedLocation = locateOnWestBorder(recommendedLocation, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ recommendedLocation = locateOnWestBorder(newRecommendedLocationBounds, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
} else if (suggestedSide == PositionConstants.SOUTH) {
- recommendedLocation = locateOnSouthBorder(recommendedLocation, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ recommendedLocation = locateOnSouthBorder(newRecommendedLocationBounds, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
} else if (suggestedSide == PositionConstants.EAST) {
- recommendedLocation = locateOnEastBorder(recommendedLocation, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ recommendedLocation = locateOnEastBorder(newRecommendedLocationBounds, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
} else { // NORTH
- recommendedLocation = locateOnNorthBorder(recommendedLocation, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ recommendedLocation = locateOnNorthBorder(newRecommendedLocationBounds, circuitCount, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
}
}
return recommendedLocation;
@@ -276,24 +277,24 @@ public class DBorderItemLocator extends BorderItemLocator {
* must be used for conflict detection
* @return the location where the border item can be put
*/
- protected Point locateOnSouthBorder(final Point recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Point locateOnSouthBorder(final Rectangle recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
- final Dimension borderItemSize = getSize(borderItem);
+ final Dimension borderItemSize = recommendedLocation.getSize();
Point resultLocation = null;
- final Point rightTestPoint = new Point(recommendedLocation);
- final Point leftTestPoint = new Point(recommendedLocation);
+ final Point rightTestPoint = recommendedLocation.getLocation();
+ final Point leftTestPoint = recommendedLocation.getLocation();
boolean isStillFreeSpaceToTheRight = true;
boolean isStillFreeSpaceToTheLeft = true;
int rightVerticalGap = 0;
int leftVerticalGap = 0;
// The recommendedLocationForEast is set when we detected that there is
// not free space on right of south side.
- Point recommendedLocationForEast = recommendedLocation;
+ Point recommendedLocationForEast = recommendedLocation.getLocation();
while (resultLocation == null && (isStillFreeSpaceToTheRight || isStillFreeSpaceToTheLeft)) {
if (isStillFreeSpaceToTheRight) {
// Move to the right on the south side
rightTestPoint.x += rightVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(rightTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(rightTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
rightVerticalGap = (optionalConflictingRectangle.get().x + optionalConflictingRectangle.get().width + 1) - rightTestPoint.x;
if (rightTestPoint.x + rightVerticalGap + borderItemSize.width > getParentBorder().getBottomRight().x) {
@@ -313,7 +314,7 @@ public class DBorderItemLocator extends BorderItemLocator {
if (isStillFreeSpaceToTheLeft && resultLocation == null) {
// Move to the left on the south side
leftTestPoint.x -= leftVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(leftTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(leftTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
leftVerticalGap = leftTestPoint.x - (optionalConflictingRectangle.get().x - borderItemSize.width - 1);
if (leftTestPoint.x - leftVerticalGap < getParentBorder().getTopLeft().x) {
@@ -326,7 +327,8 @@ public class DBorderItemLocator extends BorderItemLocator {
}
if (resultLocation == null) {
// south is full, try east.
- resultLocation = locateOnBorder(recommendedLocationForEast, PositionConstants.EAST, circuitCount + 1, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ resultLocation = locateOnBorder(new Rectangle(recommendedLocationForEast, borderItemSize), PositionConstants.EAST, circuitCount + 1, borderItem, portsFiguresToIgnore,
+ additionalFiguresForConflictDetection);
}
return resultLocation;
}
@@ -353,24 +355,24 @@ public class DBorderItemLocator extends BorderItemLocator {
* must be used for conflict detection
* @return the location where the border item can be put
*/
- protected Point locateOnNorthBorder(final Point recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Point locateOnNorthBorder(final Rectangle recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
- final Dimension borderItemSize = getSize(borderItem);
+ final Dimension borderItemSize = recommendedLocation.getSize();
Point resultLocation = null;
- final Point rightTestPoint = new Point(recommendedLocation);
- final Point leftTestPoint = new Point(recommendedLocation);
+ final Point rightTestPoint = recommendedLocation.getLocation();
+ final Point leftTestPoint = recommendedLocation.getLocation();
boolean isStillFreeSpaceToTheRight = true;
boolean isStillFreeSpaceToTheLeft = true;
int rightVerticalGap = 0;
int leftVerticalGap = 0;
// The recommendedLocationForWest is set when we detected that there is
// not free space on left of north side.
- Point recommendedLocationForWest = recommendedLocation;
+ Point recommendedLocationForWest = recommendedLocation.getLocation();
while (resultLocation == null && (isStillFreeSpaceToTheRight || isStillFreeSpaceToTheLeft)) {
if (isStillFreeSpaceToTheRight) {
// Move to the right on the north side
rightTestPoint.x += rightVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(rightTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(rightTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
rightVerticalGap = (optionalConflictingRectangle.get().x + optionalConflictingRectangle.get().width + 1) - rightTestPoint.x;
if (rightTestPoint.x + rightVerticalGap + borderItemSize.width > getParentBorder().getBottomRight().x) {
@@ -383,7 +385,7 @@ public class DBorderItemLocator extends BorderItemLocator {
if (isStillFreeSpaceToTheLeft && resultLocation == null) {
// Move to the left on the north side
leftTestPoint.x -= leftVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(leftTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(leftTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
leftVerticalGap = leftTestPoint.x - (optionalConflictingRectangle.get().x - borderItemSize.width - 1);
if (leftTestPoint.x - leftVerticalGap < getParentBorder().getTopLeft().x) {
@@ -403,7 +405,8 @@ public class DBorderItemLocator extends BorderItemLocator {
}
if (resultLocation == null) {
// North is full, try west.
- resultLocation = locateOnBorder(recommendedLocationForWest, PositionConstants.WEST, circuitCount + 1, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ resultLocation = locateOnBorder(new Rectangle(recommendedLocationForWest, borderItemSize), PositionConstants.WEST, circuitCount + 1, borderItem, portsFiguresToIgnore,
+ additionalFiguresForConflictDetection);
}
return resultLocation;
}
@@ -429,24 +432,24 @@ public class DBorderItemLocator extends BorderItemLocator {
* must be used for conflict detection
* @return the location where the border item can be put
*/
- protected Point locateOnWestBorder(final Point recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Point locateOnWestBorder(final Rectangle recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
- final Dimension borderItemSize = getSize(borderItem);
+ final Dimension borderItemSize = recommendedLocation.getSize();
Point resultLocation = null;
- final Point belowTestPoint = new Point(recommendedLocation);
- final Point aboveTestPoint = new Point(recommendedLocation);
+ final Point belowTestPoint = recommendedLocation.getLocation();
+ final Point aboveTestPoint = recommendedLocation.getLocation();
boolean isStillFreeSpaceAbove = true;
boolean isStillFreeSpaceBelow = true;
int belowVerticalGap = 0;
int aboveVerticalGap = 0;
// The recommendedLocationForSouth is set when we detected that there is
// not free space on bottom of west side.
- Point recommendedLocationForSouth = recommendedLocation;
+ Point recommendedLocationForSouth = recommendedLocation.getLocation();
while (resultLocation == null && (isStillFreeSpaceAbove || isStillFreeSpaceBelow)) {
if (isStillFreeSpaceBelow) {
// Move down on the west side
belowTestPoint.y += belowVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(belowTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(belowTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
belowVerticalGap = optionalConflictingRectangle.get().y + optionalConflictingRectangle.get().height - belowTestPoint.y + 1;
if (belowTestPoint.y + belowVerticalGap + borderItemSize.height > getParentBorder().getBottomLeft().y) {
@@ -466,7 +469,7 @@ public class DBorderItemLocator extends BorderItemLocator {
if (isStillFreeSpaceAbove && resultLocation == null) {
// Move up on the west side
aboveTestPoint.y -= aboveVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(aboveTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(aboveTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
aboveVerticalGap = aboveTestPoint.y - (optionalConflictingRectangle.get().y - borderItemSize.height - 1);
if (aboveTestPoint.y - aboveVerticalGap < getParentBorder().getTopRight().y) {
@@ -479,7 +482,8 @@ public class DBorderItemLocator extends BorderItemLocator {
}
if (resultLocation == null) {
// west is full, try south.
- resultLocation = locateOnBorder(recommendedLocationForSouth, PositionConstants.SOUTH, circuitCount + 1, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ resultLocation = locateOnBorder(new Rectangle(recommendedLocationForSouth, borderItemSize), PositionConstants.SOUTH, circuitCount + 1, borderItem, portsFiguresToIgnore,
+ additionalFiguresForConflictDetection);
}
return resultLocation;
}
@@ -505,24 +509,24 @@ public class DBorderItemLocator extends BorderItemLocator {
* must be used for conflict detection
* @return the location where the border item can be put
*/
- protected Point locateOnEastBorder(final Point recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Point locateOnEastBorder(final Rectangle recommendedLocation, final int circuitCount, final IFigure borderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
- final Dimension borderItemSize = getSize(borderItem);
+ final Dimension borderItemSize = recommendedLocation.getSize();
Point resultLocation = null;
- final Point belowTestPoint = new Point(recommendedLocation);
- final Point aboveTestPoint = new Point(recommendedLocation);
+ final Point belowTestPoint = recommendedLocation.getLocation();
+ final Point aboveTestPoint = recommendedLocation.getLocation();
boolean isStillFreeSpaceAbove = true;
boolean isStillFreeSpaceBelow = true;
int belowVerticalGap = 0;
int aboveVerticalGap = 0;
// The recommendedLocationForNorth is set when we detected that there is
// not free space on top of east side.
- Point recommendedLocationForNorth = recommendedLocation;
+ Point recommendedLocationForNorth = recommendedLocation.getLocation();
while (resultLocation == null && (isStillFreeSpaceAbove || isStillFreeSpaceBelow)) {
if (isStillFreeSpaceBelow) {
// Move down on the east side
belowTestPoint.y += belowVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(belowTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(belowTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
belowVerticalGap = optionalConflictingRectangle.get().y + optionalConflictingRectangle.get().height - belowTestPoint.y + 1;
if (belowTestPoint.y + belowVerticalGap + borderItemSize.height > getParentBorder().getBottomLeft().y) {
@@ -535,7 +539,7 @@ public class DBorderItemLocator extends BorderItemLocator {
if (isStillFreeSpaceAbove && resultLocation == null) {
// Move up on the east side
aboveTestPoint.y -= aboveVerticalGap;
- Option<Rectangle> optionalConflictingRectangle = conflicts(aboveTestPoint, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ Option<Rectangle> optionalConflictingRectangle = conflicts(new Rectangle(aboveTestPoint, borderItemSize), borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
if (optionalConflictingRectangle.some()) {
aboveVerticalGap = aboveTestPoint.y - (optionalConflictingRectangle.get().y - borderItemSize.height - 1);
if (aboveTestPoint.y - aboveVerticalGap < getParentBorder().getTopRight().y) {
@@ -555,7 +559,8 @@ public class DBorderItemLocator extends BorderItemLocator {
}
if (resultLocation == null) {
// East is full, try north.
- resultLocation = locateOnBorder(recommendedLocationForNorth, PositionConstants.NORTH, circuitCount + 1, borderItem, portsFiguresToIgnore, additionalFiguresForConflictDetection);
+ resultLocation = locateOnBorder(new Rectangle(recommendedLocationForNorth, borderItemSize), PositionConstants.NORTH, circuitCount + 1, borderItem, portsFiguresToIgnore,
+ additionalFiguresForConflictDetection);
}
return resultLocation;
}
@@ -572,13 +577,13 @@ public class DBorderItemLocator extends BorderItemLocator {
* the border item.
* @return point the location point
*/
- protected Point locateOnParent(final Point suggestedLocation, final int suggestedSide, final IFigure borderItem) {
+ protected Point locateOnParent(final Rectangle suggestedLocation, final int suggestedSide, final IFigure borderItem) {
final Rectangle bounds = getParentBorder();
final int parentFigureWidth = bounds.width;
final int parentFigureHeight = bounds.height;
final int parentFigureX = bounds.x;
final int parentFigureY = bounds.y;
- final Dimension borderItemSize = getSize(borderItem);
+ final Dimension borderItemSize = suggestedLocation.getSize();
int newX = suggestedLocation.x;
int newY = suggestedLocation.y;
final int westX = parentFigureX - borderItemSize.width + getBorderItemOffset().width;
@@ -639,7 +644,7 @@ public class DBorderItemLocator extends BorderItemLocator {
* Determine if the the given point conflicts with the position of an
* existing borderItemFigure.
*
- * @param recommendedLocation
+ * @param recommendedRect
* The desired location
* @param targetBorderItem
* the border node for which we detect conflicts.
@@ -651,9 +656,8 @@ public class DBorderItemLocator extends BorderItemLocator {
* @return the optional Rectangle of the border item that is in conflict
* with the given bordered node (a none option)
*/
- protected Option<Rectangle> conflicts(final Point recommendedLocation, final IFigure targetBorderItem, final Collection<IFigure> portsFiguresToIgnore,
+ protected Option<Rectangle> conflicts(final Rectangle recommendedRect, final IFigure targetBorderItem, final Collection<IFigure> portsFiguresToIgnore,
List<IFigure> additionalFiguresForConflictDetection) {
- final Rectangle recommendedRect = new Rectangle(recommendedLocation, getSize(targetBorderItem));
// 1- Detect conflicts with brother figures
Option<Rectangle> conflictedRectangle = conflicts(recommendedRect, getBrotherFigures(targetBorderItem), portsFiguresToIgnore);
@@ -840,9 +844,11 @@ public class DBorderItemLocator extends BorderItemLocator {
*/
@Override
public Rectangle getValidLocation(final Rectangle proposedLocation, final IFigure borderItem) {
- final Rectangle realLocation = new Rectangle(proposedLocation);
final int side = DBorderItemLocator.findClosestSideOfParent(proposedLocation, getParentBorder());
- final Point newTopLeft = locateOnBorder(realLocation.getTopLeft(), side, 0, borderItem);
+ List<IFigure> figuresToIgnore = Lists.newArrayList();
+ figuresToIgnore.add(borderItem);
+ final Point newTopLeft = locateOnBorder(proposedLocation, side, 0, borderItem, figuresToIgnore, new ArrayList<IFigure>());
+ Rectangle realLocation = proposedLocation.getCopy();
realLocation.setLocation(newTopLeft);
return realLocation;
}
@@ -872,7 +878,7 @@ public class DBorderItemLocator extends BorderItemLocator {
public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem, Collection<IFigure> figuresToIgnore, List<IFigure> additionalFiguresForConflictDetection) {
final Rectangle realLocation = new Rectangle(proposedLocation);
final int side = DBorderItemLocator.findClosestSideOfParent(proposedLocation, getParentBorder());
- final Point newTopLeft = locateOnBorder(realLocation.getTopLeft(), side, 0, borderItem, figuresToIgnore, additionalFiguresForConflictDetection);
+ final Point newTopLeft = locateOnBorder(proposedLocation, side, 0, borderItem, figuresToIgnore, additionalFiguresForConflictDetection);
realLocation.setLocation(newTopLeft);
return realLocation;
}
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
index 1e456c42bc..52b20149fa 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
@@ -41,18 +41,48 @@
</ol>
<p>This document contains the release notes for all major releases of Sirius.</p>
<h2 id="sirius3.0.0">Changes in Sirius 3.0.0 (from Sirius 2.0.0)</h2>
- <h3 id="ChangesAPI">Changes API</h3>
+ <h3 id="APIChanges">API Changes</h3>
<h4 id="Changesinorg.eclipse.sirius">Changes in
<code>org.eclipse.sirius</code>
</h4>
<ul>
<li>The method
- <code>org.eclipse.sirius.business.api.migration.IMigrationParticipant.updateCreatedObject(EObject newObject, String loadedVersion)</code> have been added to update explicitly the default value of sizeComputationExpression in VSM (&#171;1&#187;) by the expression (&#171;[eContents()-&gt;size()/]&#187;). This method can be used to update also default values in VSM.
+ <code>org.eclipse.sirius.business.api.migration.IMigrationParticipant.updateCreatedObject(EObject newObject, String loadedVersion)</code> have been added to update object values in VSM before loading this objects from XML file.
+ </li>
+ </ul>
+ <h4 id="Changesinorg.eclipse.sirius.diagram.ui">Changes in
+ <code>org.eclipse.sirius.diagram.ui</code>
+ </h4>
+ <p>The
+ <code>org.eclipse.sirius.diagram.ui.tools.api.figure.locator.DBorderItemLocator</code> did not take into account the rectangle size passed to
+ <code>getValidLocation</code>. To resolve that limitation, several protected methods that took a Point as location now take a Rectangle:
+ </p>
+ <ul>
+ <li>
+ <code>locateOnBorder(Point, int, int, IFigure, Collection&lt;IFigure&gt;, List&lt;IFigure&gt;)</code> Take a Rectangle instead a point:
+ <code>locateOnBorder(Rectangle, int, int, IFigure, Collection&lt;IFigure&gt;, List&lt;IFigure&gt;)</code>
+ </li>
+ <li>
+ <code>locateOnSouthBorder</code>,
+ <code>locateOnNorthBorder</code>,
+ <code>locateOnWestBorder</code> and
+ <code>locateOnEastBorder</code> signature is now
+ <code>(Rectangle, int, IFigure, Collection&lt;IFigure&gt;, List&lt;IFigure&gt;)</code>
+ </li>
+ <li>
+ <code>locateOnParent</code> signature is now
+ <code>locateOnParent(Rectangle, int, IFigure)</code>
+ </li>
+ <li>
+ <code>conflicts</code> signature is now
+ <code>conflicts(Rectangle, IFigure, Collection&lt;IFigure&gt;, List&lt;IFigure&gt;)</code>
</li>
</ul>
<h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
<ul>
- <li>All Acceleo 3 references have been removed in Sirius Metamodels to avoid a dependence to Acceleo 3 but a migration have been added explicitly in VSM to avoid a change of behavior. Customers who want to completly remove this dependency must remove the A3 expressions from there VSM after the migration.</li>
+ <li>All Acceleo 3 references have been removed in Sirius Metamodels to avoid a dependency to Acceleo 3 but an automatic migration have been added during the loading of the VSM to avoid a change of behavior. This migration adds explicitly the old default value (
+ <code>[eContents()-&gt;size()/]</code>) in the VSM, that was implicit before. Customers who want to completely remove this dependency must remove the A3 expressions from there VSM after the migration.
+ </li>
</ul>
<h2 id="sirius2.0.0">Changes in Sirius 2.0.0 (from Sirius 1.0.0)</h2>
<h3 id="UserVisibleChanges">User-Visible Changes</h3>
@@ -71,13 +101,13 @@
<img border="0" src="images/containerResize-changedBehavior.gif"/>
</p>
<ul>
- <li>The &#171;snap to shapes&#187; is now enabled by default (see
+ <li>The &#8220;snap to shapes&#8221; is now enabled by default (see
<em>Sirius &gt; Sirius Diagram &gt; Rulers and Grid</em> preference page). This is true only for new diagrams. The existing diagrams are not impacted.
</li>
- <li>The &#171;Navigate&#187; top-level contextual menu entry with mixed actions for creating new representations and opening existing ones has been changed by two top-level menus:
+ <li>The &#8220;Navigate&#8221; top-level contextual menu entry with mixed actions for creating new representations and opening existing ones has been changed by two top-level menus:
<ul>
- <li>One named &#171;New&#187;, which lists only the available actions to create new representations on the selected element.</li>
- <li>One named &#171;Open&#187;, which lists only the existing representations on the selected element. </li>
+ <li>One named &#8220;New&#8221;, which lists only the available actions to create new representations on the selected element.</li>
+ <li>One named &#8220;Open&#8221;, which lists only the existing representations on the selected element. </li>
</ul>
</li>
<li>When a shape is resized (no matter the direction), the edge(s) connection location (toward or from this one) is kept. Before that, edges connections moved according to the ratio of the resizing.</li>
@@ -102,20 +132,20 @@
<li>Distribute centers vertically</li>
</ul>
</li>
- <li>The end user can now remove all bend-points between the two edge ends. This action is available on edge context menu &#171;Remove Bend-points&#187; or by using the shortcut &#171;Ctrl&#187; + &#171;Shift&#187; + &#171;-&#187;.</li>
+ <li>The end user can now remove all bend-points between the two edge ends. This action is available on edge context menu &#8220;Remove Bend-points&#8221; or by using the shortcut &#8220;Ctrl&#8221; + &#8220;Shift&#8221; + &#8220;-&#8221;.</li>
<li>Reconnection of an edge will only now move the minimum necessary bendpoints instead of reseting it to default.</li>
<li>A new action has been added to reset the diagram (or container) origin: the diagram (or container) bounds (the rectangle formed by the highest, the leftmost, the lowest and the rightmost children elements) can have a negative origin or can be shifted toward the bottom-right with a blank zone at the top-left. This action aims to move all diagram (or container) elements so that the it retrieves its origin while keeping elements layout.</li>
</ul>
<h3 id="SpecifierVisibleChanges2">Specifier-Visible Changes</h3>
<ul>
- <li>The specifier can now choose to hold the edge ends toward the center of the source, target or both. New fields within the &#171;advance&#187; tab of EdgeStyle description have been added to choose for which source or target mappings an edge should be centered. See
+ <li>The specifier can now choose to hold the edge ends toward the center of the source, target or both. New fields within the &#8220;advance&#8221; tab of EdgeStyle description have been added to choose for which source or target mappings an edge should be centered. See
<a href="specifier/diagrams/Diagrams.html#edges_styles">Edges Styles &gt; Edge Centering</a> in the specifier manual for more details.
</li>
<li>When creating a new Viewpoint Specification Project using the supplied wizard:
- <em>New &gt; Viewpoint Specification Project</em>, the VSM name is now given according to the project name. If the project name is suffixed with &#171;design&#187;, the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name.
+ <em>New &gt; Viewpoint Specification Project</em>, the VSM name is now given according to the project name. If the project name is suffixed with &#8220;design&#8221;, the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name.
</li>
</ul>
- <h3 id="APIChanges">API Changes</h3>
+ <h3 id="APIChanges2">API Changes</h3>
<h4 id="Changesinorg.eclipse.sirius2">Changes in
<code>org.eclipse.sirius</code>
</h4>
@@ -269,7 +299,7 @@
<code>org.eclipse.sirius.diagram.description.CenteringStyle</code>, to determine whether the edge target or source ends should be centered.
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram.ui">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram.ui2">Changes in
<code>org.eclipse.sirius.diagram.ui</code>
</h4>
<ul>
@@ -492,7 +522,7 @@
<em>Layer</em>. The corresponding property sections will be shown only for old VSM with reused elements.
</li>
</ul>
- <h3 id="APIChanges2">API Changes</h3>
+ <h3 id="APIChanges3">API Changes</h3>
<h4 id="Changesinorg.eclipse.sirius3">Changes in
<code>org.eclipse.sirius</code>
</h4>
@@ -512,7 +542,7 @@
<code>computeResourcesToSave()</code> method.
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram.ui2">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram.ui3">Changes in
<code>org.eclipse.sirius.diagram.ui</code>
</h4>
<ul>
@@ -524,7 +554,7 @@
<code>org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramListEditPart.createLayoutEditPolicy</code> implementation has been removed.
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram.ui3">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram.ui4">Changes in
<code>org.eclipse.sirius.diagram.ui</code>
</h4>
<ul>
@@ -541,7 +571,7 @@
<h3 id="SpecifierVisibleChanges4">Specifier-Visible Changes</h3>
<ul>
<li>The default value of the
- <em>Semantic Candidates Expression</em> for Tree Items has changed from an empty string (meaning &#171;any compatible element in the session&#187;) to
+ <em>Semantic Candidates Expression</em> for Tree Items has changed from an empty string (meaning &#8220;any compatible element in the session&#8221;) to
<code>feature:eAllContents</code> which only looks for compatible candidates inside the current element (recursively). The new behavior is more efficient on large models and consistent with what happens for diagrams. The change does not affect existing VSMs which continue to work as before whatever was the expression they used. Users who want the old behavior on specific mappings can simply remove the expression in the properties view.
</li>
<li>In the
@@ -550,7 +580,7 @@
<em>Time (ms)</em> column, harder to read/sort, and showed wrongly formatted results.
</li>
</ul>
- <h3 id="APIChanges3">API Changes</h3>
+ <h3 id="APIChanges4">API Changes</h3>
<h4 id="separationOfDiagramSpecificConcept-step3">Move diagram.ecore in its own plugin</h4>
<p>This milestone (Sirius 1.0M7) includes the third, and final, step towards a full separation of the diagram-specific stuff out of the core of Sirius (see
<a href="#separationOfDiagramSpecificConcept-step1">Step1</a> and
@@ -574,7 +604,7 @@
<code>org.eclipse.diagram</code> again.
</p>
<p>Unlike, the
- <a href="#separationOfDiagramSpecificConcept-step1">Step1</a>, a simple &#171;Organize Imports&#187; operation is not enough. First, you will probably need to add dependencies to
+ <a href="#separationOfDiagramSpecificConcept-step1">Step1</a>, a simple &#8220;Organize Imports&#8221; operation is not enough. First, you will probably need to add dependencies to
<code>org.eclipse.sirius.diagram</code>,
<code>org.eclipse.sirius.diagram.ui</code> or
<code>org.eclipse.sirius.editor.diagram</code> in the MANIFEST.MF of your projects that depend on Sirius diagram classes. The dependencies to add depend on what you really use.
@@ -1001,7 +1031,7 @@
<code>Multimap</code>.
</li>
<li>
- <code>org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager.initializeAfterLoad()</code> method has been removed. There is no replacement for this method documented as &#171;Not intended to be used by client&#187;.
+ <code>org.eclipse.sirius.ui.tools.api.project.ModelingProjectManager.initializeAfterLoad()</code> method has been removed. There is no replacement for this method documented as &#8220;Not intended to be used by client&#8221;.
</li>
</ul>
<h4 id="Changesinorg.eclipse.sirius.ecore.extender2">Changes in
@@ -1106,7 +1136,7 @@
</li>
</ul>
<h2 id="sirius1.0M6">Changes in Sirius 1.0.0M6 (from Sirius 1.0M5)</h2>
- <h3 id="APIChanges4">API Changes</h3>
+ <h3 id="APIChanges5">API Changes</h3>
<h4 id="tests">High-level API for Automated Tests Using JUnit and SWTBot</h4>
<p>Starting from version 1.0.0M6, Sirius includes high-level APIs to help creating automated tests using JUnit and/or SWTBot. These can be used either to test Sirius itself or to test Sirius-based modelers. These APIs are provided by two plug-ins:</p>
<ul>
@@ -1245,27 +1275,27 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
<h2 id="sirius1.0M5">Changes in Sirius 1.0.0M5 (from Sirius 1.0M4)</h2>
<h3 id="UserVisibleChanges3">User-Visible Changes</h3>
<ul>
- <li>The table csv export has been improved to handle cropped label. In some specific cases, the cell label is automatically cropped and &#8249;...&#8250; is concatenated to the resulting value. This cropped displayed label was previously exported, now the complete semantic value is exported.</li>
+ <li>The table csv export has been improved to handle cropped label. In some specific cases, the cell label is automatically cropped and &#8216;...&#8217; is concatenated to the resulting value. This cropped displayed label was previously exported, now the complete semantic value is exported.</li>
</ul>
- <h3 id="APIChanges5">API Changes</h3>
+ <h3 id="APIChanges6">API Changes</h3>
<h4 id="LibraryExtensions">Library Extensions</h4>
- <p>This milestone (Sirius 1.0M5) introduces several new plug-ins, collectively called &#171;library extensions&#187;. They are all named
+ <p>This milestone (Sirius 1.0M5) introduces several new plug-ins, collectively called &#8220;library extensions&#8221;. They are all named
<code>org.eclipse.sirius.ext.LIB</code>, where
- <code>LIB</code> is the name of a library or component Sirius depends on. These plug-ins are used to isolate generic code which extends existing libraries with features and helpers needed for Sirius, but which do not depend on Sirius themselves. A relatively large part of the code in Sirius is of this kind: things that could/should be in EMF, GMF, Eclipse itself, etc. and which are not Sirius-specific but which make it easier to build Sirius itself. Sirius 1.0M5 introduces several of these library extensions and starts to fill them with existing classes which were &#171;hidden&#187; inside Sirius and are now exposed in library extensions. Most of the time, existing code which used the Sirius API will only need to:
+ <code>LIB</code> is the name of a library or component Sirius depends on. These plug-ins are used to isolate generic code which extends existing libraries with features and helpers needed for Sirius, but which do not depend on Sirius themselves. A relatively large part of the code in Sirius is of this kind: things that could/should be in EMF, GMF, Eclipse itself, etc. and which are not Sirius-specific but which make it easier to build Sirius itself. Sirius 1.0M5 introduces several of these library extensions and starts to fill them with existing classes which were &#8220;hidden&#8221; inside Sirius and are now exposed in library extensions. Most of the time, existing code which used the Sirius API will only need to:
</p>
<ol>
<li>Add the necessary
<code>Import-Package</code> (recommended) or
<code>Require-Bundle</code> to depend on the library extension(s) where the code they use now lives;
</li>
- <li>Perform a simple &#171;Organize Imports&#187; operation, which should find the classes and interfaces in their new locations.</li>
+ <li>Perform a simple &#8220;Organize Imports&#8221; operation, which should find the classes and interfaces in their new locations.</li>
</ol>
<h4 id="separationOfDiagramSpecificConcept-step1">Move diagram-specific EClasses into a separate EPackage</h4>
<p>For historical reasons, the core Sirius metamodels defined in viewpoint.ecore contain both generic (dialect-independant like Viewpoint, RepresentationDescription, DAnalysis...) concepts and diagram-specific ones (e.g. DNode, EdgeStyle, ContainerCreationDescription...). The table and tree metamodels are more cleanly separated.
<br/>This milestone (Sirius 1.0M5) includes the first step towards a full separation of the diagram-specific stuff out of the core of Sirius. So many EClasses have been moved.
</p>
- <p>Most of the time, existing code which used these Sirius EClasses will only need to perform a simple &#171;Organize Imports&#187; operation, which should find the classes and interfaces in their new locations.
- <br/>The &#171;Organize imports&#187; is not sufficient in case of imported classes existing several time in different packages (
+ <p>Most of the time, existing code which used these Sirius EClasses will only need to perform a simple &#8220;Organize Imports&#8221; operation, which should find the classes and interfaces in their new locations.
+ <br/>The &#8220;Organize imports&#8221; is not sufficient in case of imported classes existing several time in different packages (
<code>EFactory</code> classes for example with
<code>DescriptionFactory</code>, or
<code>EPackage</code> classes for example with
@@ -1383,7 +1413,7 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
<ul>
<li>The ability to print table representations, which had been disabled for the 0.9 release, has been re-enabled.</li>
</ul>
- <h3 id="APIChanges6">API Changes</h3>
+ <h3 id="APIChanges7">API Changes</h3>
<p>Sirius 1.0.0M4 includes a lots of API-breaking changes, as part of a global effort to improve the quality of the Sirius internals. In this milestone in particular, most of the APIs which were marked as deprecated in previous versions of Sirius (and before that of Viewpoint) have been either removed (if a replacement exists) or marked as non-deprecated (if no replacement exists yet).</p>
<h4 id="Changesinorg.eclipse.sirius.common3">Changes in
<code>org.eclipse.sirius.common</code>
@@ -1680,7 +1710,7 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
</li>
</ul>
<h2 id="sirius0.9">Changes in Sirius 0.9.0</h2>
- <p>Version 0.9.0 is the first release under the Sirius name and under the Eclipse Foundation umbrella. Except for the few cases mentioned below (in the &#171;Other API Changes&#187;, &#171;Specifier-Visible Changes&#187; and &#171;User-Visible Changes&#187; sections), Sirius 0.9.0 is functionally equivalent to the latest version of Viewpoint (version 6.10), which was the name of the project before it was open sourced at Eclipse. See the rest of the documentation for the complete list of feature of the Sirius platform.</p>
+ <p>Version 0.9.0 is the first release under the Sirius name and under the Eclipse Foundation umbrella. Except for the few cases mentioned below (in the &#8220;Other API Changes&#8221;, &#8220;Specifier-Visible Changes&#8221; and &#8220;User-Visible Changes&#8221; sections), Sirius 0.9.0 is functionally equivalent to the latest version of Viewpoint (version 6.10), which was the name of the project before it was open sourced at Eclipse. See the rest of the documentation for the complete list of feature of the Sirius platform.</p>
<h3 id="MigratingfromObeoDesignerorViewpointtoSirius">Migrating from Obeo Designer or Viewpoint to Sirius</h3>
<p>If you have existing projects which used this technology before it became Eclipse Sirius and want to migrate to Sirius, you must:</p>
<ol>
@@ -1704,9 +1734,9 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
<code>org.eclipse.sirius.componentization</code> extension point id. The identifier changes for the other extension points follow the same rules as the name changes of the plug-ins they are defined in.
</li>
<li>The migration of your VSMs (
- <code>*.odesign</code> files) is automatic: simply open your files once in the VSM editor, perform some no-op change to make the editor &#171;dirty&#187; and save it. The saved version will have been migrated to Sirius.
+ <code>*.odesign</code> files) is automatic: simply open your files once in the VSM editor, perform some no-op change to make the editor &#8220;dirty&#8221; and save it. The saved version will have been migrated to Sirius.
</li>
- <li>If you had Java code which used the Viewpoint APIs, you will need to update it to use the Sirius APIs. A simple &#171;Source &gt; Organize Imports&#187; on your source folders should find most classes you used in their new namespace. The Viewpoint code base and APIs used the term &#171;Viewpoint&#187; both for the name of the product and for the name of the concept. When it refered to the name of the product, the names were changed to use &#171;Sirius&#187; instead, so you may need to adjust some names in your code beyond just updating the imports (for example,
+ <li>If you had Java code which used the Viewpoint APIs, you will need to update it to use the Sirius APIs. A simple &#8220;Source &gt; Organize Imports&#8221; on your source folders should find most classes you used in their new namespace. The Viewpoint code base and APIs used the term &#8220;Viewpoint&#8221; both for the name of the product and for the name of the concept. When it refered to the name of the product, the names were changed to use &#8220;Sirius&#8221; instead, so you may need to adjust some names in your code beyond just updating the imports (for example,
<code>ViewpointControlCommand</code> is now
<code>SiriusControlCommand</code>).
</li>
@@ -1721,7 +1751,7 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
<h4 id="MigratingModelingProjectsandRepresentationFiles">Migrating Modeling Projects and Representation Files</h4>
<ul>
<li>First migrate any modeler definitions used by your modeling projects and representation files (see the section above).</li>
- <li>Modeling projects created using Viewpoint will not be recognized directly by Sirius, because the nature identfier has changed. You must use the &#171;Configure/Convert to Modeling Project&#187; action in the project&#8217;s context menu to make it a Sirius-compatible modeling project (see the section below for the technical details of the change).</li>
+ <li>Modeling projects created using Viewpoint will not be recognized directly by Sirius, because the nature identfier has changed. You must use the &#8220;Configure/Convert to Modeling Project&#8221; action in the project&#8217;s context menu to make it a Sirius-compatible modeling project (see the section below for the technical details of the change).</li>
<li>The migration of you representation files (
<code>*.aird</code>) is performed automatically when they are loaded in memory. It will become permanent the first time you save it (you can force this by opening a representation, making some arbitrary change and saving the session).
</li>
@@ -1897,20 +1927,20 @@ if (rootPackage != null &amp;&amp; rootPackage.getNsURI().equals(DiagramPackage.
</tr>
</table>
<h4 id="JavaPackagesandClassesNames">Java Packages and Classes Names</h4>
- <p>The Java package names have changed to start with the identifier of the plug-in they are defined in (which has changed). A simple &#171;Source &gt; Organize Imports&#187; on your source folders should find most classes you used in their new namespace.</p>
- <p>The Viewpoint code base and APIs used the term &#171;Viewpoint&#187; both for the name of the product and for the name of the concept. When it refered to the name of the product, the names where changed to use &#171;Sirius&#187; instead (for example,
+ <p>The Java package names have changed to start with the identifier of the plug-in they are defined in (which has changed). A simple &#8220;Source &gt; Organize Imports&#8221; on your source folders should find most classes you used in their new namespace.</p>
+ <p>The Viewpoint code base and APIs used the term &#8220;Viewpoint&#8221; both for the name of the product and for the name of the concept. When it refered to the name of the product, the names where changed to use &#8220;Sirius&#8221; instead (for example,
<code>ViewpointControlCommand</code> is now
<code>SiriusControlCommand</code>).
</p>
<h4 id="ModelsnamespaceURIs">Models namespace URIs</h4>
- <p>All namespace URIs have also been changed from &#171;http://www.obeo.fr/dsl/viewpoint*&#187; to &#171;http://www.eclipse.org/sirius/&#187;.</p>
+ <p>All namespace URIs have also been changed from &#8220;http://www.obeo.fr/dsl/viewpoint*&#8221; to &#8220;http://www.eclipse.org/sirius/&#8221;.</p>
<p>If you have created VSM file (.odesign) or representations file (.aird) with Viewpoint, the changes of the namespace URIs will be automatically migrated during the loading of your VSM or your representations file. These new nsURIs will be stored physically in the file during the first save. If the file is not saved, the automatic migration will be replayed at the next opening.</p>
<h3 id="NatureID">Nature ID</h3>
<p>The modeling project has a specific nature (
<code>org.eclipse.sirius.nature.modelingproject</code>).
- <br/>If you have modeling project created with Viewpoint, you must launch the action &#171;Configure/Convert to Modeling Project&#187; to replace old nature id (
+ <br/>If you have modeling project created with Viewpoint, you must launch the action &#8220;Configure/Convert to Modeling Project&#8221; to replace old nature id (
<code>fr.obeo.dsl.viewpoint.nature.modelingproject</code>) by the new one.
- <br/>If you have many modeling projects to &#171;migrate&#187;, you can easily make a script to replace
+ <br/>If you have many modeling projects to &#8220;migrate&#8221;, you can easily make a script to replace
<code>fr.obeo.dsl.viewpoint.nature.modelingproject</code> by
<code>org.eclipse.sirius.nature.modelingproject</code> in all
<code>.project</code> file of each modeling projects.
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index 4f78881b01..4093690023 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -6,12 +6,20 @@ This document contains the release notes for all major releases of Sirius.
h2(#sirius3.0.0). Changes in Sirius 3.0.0 (from Sirius 2.0.0)
-h3. Changes API
+h3. API Changes
h4. Changes in @org.eclipse.sirius@
* The method @org.eclipse.sirius.business.api.migration.IMigrationParticipant.updateCreatedObject(EObject newObject, String loadedVersion)@ have been added to update object values in VSM before loading this objects from XML file.
+h4. Changes in @org.eclipse.sirius.diagram.ui@
+
+The @org.eclipse.sirius.diagram.ui.tools.api.figure.locator.DBorderItemLocator@ did not take into account the rectangle size passed to @getValidLocation@. To resolve that limitation, several protected methods that took a Point as location now take a Rectangle:
+* @locateOnBorder(Point, int, int, IFigure, Collection<IFigure>, List<IFigure>)@ Take a Rectangle instead a point: @locateOnBorder(Rectangle, int, int, IFigure, Collection<IFigure>, List<IFigure>)@
+* @locateOnSouthBorder@, @locateOnNorthBorder@, @locateOnWestBorder@ and @locateOnEastBorder@ signature is now @(Rectangle, int, IFigure, Collection<IFigure>, List<IFigure>)@
+* @locateOnParent@ signature is now @locateOnParent(Rectangle, int, IFigure)@
+* @conflicts@ signature is now @conflicts(Rectangle, IFigure, Collection<IFigure>, List<IFigure>)@
+
h3. Specifier-Visible Changes
* All Acceleo 3 references have been removed in Sirius Metamodels to avoid a dependency to Acceleo 3 but an automatic migration have been added during the loading of the VSM to avoid a change of behavior. This migration adds explicitly the old default value (@[eContents()->size()/]@) in the VSM, that was implicit before. Customers who want to completely remove this dependency must remove the A3 expressions from there VSM after the migration.
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ShapeResizingEdgePositionStabilityTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ShapeResizingEdgePositionStabilityTests.java
index 18449e90b4..d52d11c073 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ShapeResizingEdgePositionStabilityTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ShapeResizingEdgePositionStabilityTests.java
@@ -16,7 +16,11 @@ import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.sirius.diagram.DDiagram;
+import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIDiagramRepresentation.ZoomLevel;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
@@ -24,10 +28,13 @@ import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckSelectedCondit
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
/**
* Test class that make sure edges do not move during a shape resize. See
- * bugzilla #441424 for more details.
+ * bugzilla #441424 for more details. Also tests that border nodes have correct
+ * GMF location after resizing toward the container center. (see bugzilla
+ * #450067).
*
* @author Florian Barbin
*
@@ -58,6 +65,8 @@ public class ShapeResizingEdgePositionStabilityTests extends AbstractSiriusSwtBo
private static final Dimension NORTH_WEST = new Dimension(-20, -20);
+ private static final Dimension WEST = new Dimension(-20, 0);
+
/*
* (non-Javadoc)
* @see
@@ -487,6 +496,58 @@ public class ShapeResizingEdgePositionStabilityTests extends AbstractSiriusSwtBo
}
/**
+ * Resize BorderNode1 toward North.
+ */
+ public void testResizingB1ToN() {
+ CheckSelectedCondition cS = new CheckSelectedCondition(editor, "border1");
+ Rectangle bounds = editor.clickCentered("border1");
+ bot.waitUntil(cS);
+ resizeToNorth(bounds);
+ checkGMFDraw2DConsistency("border1");
+ }
+
+ /**
+ * Resize BorderNode3 toward South.
+ */
+ public void testResizingB3ToS() {
+ CheckSelectedCondition cS = new CheckSelectedCondition(editor, "border3");
+ Rectangle bounds = editor.clickCentered("border3");
+ bot.waitUntil(cS);
+ resizeToSouth(bounds);
+ checkGMFDraw2DConsistency("border3");
+ }
+
+ /**
+ * Resize BorderNode3 toward West.
+ */
+ public void testResizingB2ToW() {
+ CheckSelectedCondition cS = new CheckSelectedCondition(editor, "border2");
+ Rectangle bounds = editor.clickCentered("border2");
+ bot.waitUntil(cS);
+ resizeToWest(bounds);
+ checkGMFDraw2DConsistency("border2");
+ }
+
+ /**
+ * Check whether the GMF and draw2D coordinates are consistent.
+ *
+ * @param nodeName
+ * the node label.
+ */
+ private void checkGMFDraw2DConsistency(String nodeName) {
+ SWTBotGefEditPart botGefEditPart = editor.getEditPart(nodeName, AbstractDiagramBorderNodeEditPart.class);
+ GraphicalEditPart graphicalEditPart = (GraphicalEditPart) botGefEditPart.part();
+ Rectangle figureBounds = graphicalEditPart.getFigure().getBounds().getCopy();
+ Rectangle parentBounds = graphicalEditPart.getFigure().getParent().getBounds();
+ Bounds bounds = (Bounds) ((Node) graphicalEditPart.getModel()).getLayoutConstraint();
+ figureBounds.translate(-parentBounds.getTopLeft().x, -parentBounds.getTopLeft().y);
+
+ assertEquals("The GMF location is different from the Figure one", figureBounds.getTopLeft(), new Point(bounds.getX(), bounds.getY()));
+ assertEquals("The GMF dimension is different from the Figure one", figureBounds.getSize(), new Dimension(bounds.getWidth(), bounds.getHeight()));
+
+ }
+
+ /**
* Check that the given edge didn't move during the shape resizing.
*
* @param string
@@ -555,6 +616,10 @@ public class ShapeResizingEdgePositionStabilityTests extends AbstractSiriusSwtBo
editor.drag(bounds.getRight(), bounds.getRight().getTranslated(EAST));
}
+ private void resizeToWest(Rectangle bounds) {
+ editor.drag(bounds.getLeft(), bounds.getLeft().getTranslated(WEST));
+ }
+
private void resizeToNorth(Rectangle bounds) {
editor.drag(bounds.getTop(), bounds.getTop().getTranslated(NORTH));
}

Back to the top