diff options
| author | Laurent Redor | 2015-11-16 14:18:55 +0000 |
|---|---|---|
| committer | Laurent Redor | 2015-11-17 07:50:55 +0000 |
| commit | 8b4a01355fdf6e1cf54418f6e5e312f1301c3675 (patch) | |
| tree | f211718ea7da4bbec667dbd5a34cf125a6634665 | |
| parent | de97179eafec898084135daa248e7097986df5a6 (diff) | |
| download | org.eclipse.sirius-8b4a01355fdf6e1cf54418f6e5e312f1301c3675.tar.gz org.eclipse.sirius-8b4a01355fdf6e1cf54418f6e5e312f1301c3675.tar.xz org.eclipse.sirius-8b4a01355fdf6e1cf54418f6e5e312f1301c3675.zip | |
[482124] Fix problem for edge fully contained in source or target
This commit:
* fixes the bug
* adds a test that confirms the fix.
* fixes another minor bug detected by test: the iteration in
SetConnectionBendpointsAccordingToExtremityMoveCommmand.removePointsInViews(PointList,
PrecisionRectangle, Point, PrecisionRectangle, Point) is not symmetrical
for source side and target side.
Bug: 482124
Change-Id: I26f3b281e6a61ea5b35d804c0381152741afebcd
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
4 files changed, 404 insertions, 14 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java index 220c4c47fb..307c423e7c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java @@ -141,7 +141,10 @@ public class SetConnectionBendpointsAccordingToExtremityMoveCommmand extends Set connectionPointList.setPoint(connectionPointList.getPoint(1).translate(moveDelta.x, 0), 1); } normalizeAndStraight(connectionPointList); - removePointsInViews(connectionPointList, (PrecisionRectangle) sourceBounds.getTranslated(moveDelta), sourceRefPoint, targetBounds, targetRefPoint); + if (connectionPointList.size() > 2) { + // This code is not needed if the edge has only 2 points. + removePointsInViews(connectionPointList, (PrecisionRectangle) sourceBounds.getTranslated(moveDelta), sourceRefPoint, targetBounds, targetRefPoint); + } } else { // Compute intersection between the line // (tempSourceRefPoint<-->second point) and the source node @@ -190,7 +193,10 @@ public class SetConnectionBendpointsAccordingToExtremityMoveCommmand extends Set connectionPointList.setPoint(connectionPointList.getPoint(connectionPointList.size() - 1).translate(moveDelta.x, moveDelta.y), connectionPointList.size() - 1); } normalizeAndStraight(connectionPointList); - removePointsInViews(connectionPointList, sourceBounds, sourceRefPoint, (PrecisionRectangle) targetBounds.getTranslated(moveDelta), targetRefPoint); + if (connectionPointList.size() > 2) { + // This code is not needed if the edge has only 2 points. + removePointsInViews(connectionPointList, sourceBounds, sourceRefPoint, (PrecisionRectangle) targetBounds.getTranslated(moveDelta), targetRefPoint); + } } else { // Compute intersection between the line // (tempTargetRefPoint<-->second to last point) and the target node @@ -303,7 +309,7 @@ public class SetConnectionBendpointsAccordingToExtremityMoveCommmand extends Set PointList targetPointList = PointListUtilities.createPointsFromRect(target); if (newLine.size() != 0) { int nbIncludedPoints = 0; - for (int i = newLine.size() - 1; i > 0 && targetPointList.polygonContainsPoint(newLine.getPoint(i).x, newLine.getPoint(i).y); i--) { + for (int i = newLine.size() - 1; i >= 0 && targetPointList.polygonContainsPoint(newLine.getPoint(i).x, newLine.getPoint(i).y); i--) { nbIncludedPoints++; } // Do nothing if there is only one point inside and no other diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.aird index 21f35773bc..b8997754ee 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.aird +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.aird @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="__OXRoD_3EeWEGe6pBhmYQg" selectedViews="_AEoyUD_4EeWEGe6pBhmYQg" version="10.1.0.201507101000"> +<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="__OXRoD_3EeWEGe6pBhmYQg" selectedViews="_AEoyUD_4EeWEGe6pBhmYQg _9YB9sIxMEeWRjpf7ffS9_g" version="10.1.0.201509162000"> <semanticResources>My.ecore</semanticResources> <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_AEoyUD_4EeWEGe6pBhmYQg"> <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_AIKAYD_4EeWEGe6pBhmYQg" name="rectilinearCase1"> @@ -85,4 +85,253 @@ </ownedRepresentations> <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> </ownedViews> + <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_9YB9sIxMEeWRjpf7ffS9_g"> + <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_-s1NcIxMEeWRjpf7ffS9_g" name="newDiag"> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_-s1NcYxMEeWRjpf7ffS9_g" source="DANNOTATION_CUSTOMIZATION_KEY"> + <data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_-s1NcoxMEeWRjpf7ffS9_g"/> + </ownedAnnotationEntries> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_-s77IIxMEeWRjpf7ffS9_g" source="GMF_DIAGRAMS"> + <data xmi:type="notation:Diagram" xmi:id="_-s77IYxMEeWRjpf7ffS9_g" type="Sirius" element="_-s1NcIxMEeWRjpf7ffS9_g" measurementUnit="Pixel"> + <children xmi:type="notation:Node" xmi:id="_-s--cIxMEeWRjpf7ffS9_g" type="2002" element="_-s1Nc4xMEeWRjpf7ffS9_g"> + <children xmi:type="notation:Node" xmi:id="_-tHhUIxMEeWRjpf7ffS9_g" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_-tIIYIxMEeWRjpf7ffS9_g" type="7001"> + <children xmi:type="notation:Node" xmi:id="_-tIvcIxMEeWRjpf7ffS9_g" type="3007" element="_-s1NdYxMEeWRjpf7ffS9_g"> + <children xmi:type="notation:Node" xmi:id="_-tJ9kIxMEeWRjpf7ffS9_g" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_-tJ9kYxMEeWRjpf7ffS9_g" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tLywYxMEeWRjpf7ffS9_g" type="3003" element="_-s1NdoxMEeWRjpf7ffS9_g"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_-tLywoxMEeWRjpf7ffS9_g" fontName="Ubuntu"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tLyw4xMEeWRjpf7ffS9_g"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_-tIvcYxMEeWRjpf7ffS9_g" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tIvcoxMEeWRjpf7ffS9_g" x="25" y="39" width="76" height="30"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tLLsIxMEeWRjpf7ffS9_g" type="3007" element="_-s1Nd4xMEeWRjpf7ffS9_g"> + <children xmi:type="notation:Node" xmi:id="_-tLLs4xMEeWRjpf7ffS9_g" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_-tLywIxMEeWRjpf7ffS9_g" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tMZ0IxMEeWRjpf7ffS9_g" type="3003" element="_-s1NeIxMEeWRjpf7ffS9_g"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_-tMZ0YxMEeWRjpf7ffS9_g" fontName="Ubuntu"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tMZ0oxMEeWRjpf7ffS9_g"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_-tLLsYxMEeWRjpf7ffS9_g" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tLLsoxMEeWRjpf7ffS9_g" x="135" y="39" width="76" height="30"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_-tIIYYxMEeWRjpf7ffS9_g"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_-tIIYoxMEeWRjpf7ffS9_g"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_-s--cYxMEeWRjpf7ffS9_g" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-s--coxMEeWRjpf7ffS9_g" x="55" y="50" width="268" height="119"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_-s77IoxMEeWRjpf7ffS9_g"/> + <edges xmi:type="notation:Edge" xmi:id="_-tOPAIxMEeWRjpf7ffS9_g" type="4001" element="_-s1NeYxMEeWRjpf7ffS9_g" source="_-tIvcIxMEeWRjpf7ffS9_g" target="_-s--cIxMEeWRjpf7ffS9_g"> + <children xmi:type="notation:Node" xmi:id="_-tQEMIxMEeWRjpf7ffS9_g" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tQEMYxMEeWRjpf7ffS9_g" x="15" y="2"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tQrQIxMEeWRjpf7ffS9_g" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tQrQYxMEeWRjpf7ffS9_g" x="28" y="8"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tQrQoxMEeWRjpf7ffS9_g" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tQrQ4xMEeWRjpf7ffS9_g" x="12" y="-15"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_-tOPAYxMEeWRjpf7ffS9_g" routing="Rectilinear"/> + <styles xmi:type="notation:FontStyle" xmi:id="_-tOPAoxMEeWRjpf7ffS9_g" fontName="Ubuntu" fontHeight="8"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_-tOPA4xMEeWRjpf7ffS9_g" points="[30, 24, -44, -38]$[30, 66, -44, 4]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-tTukIxMEeWRjpf7ffS9_g" id="(0.18421052631578946,0.2)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-tTukYxMEeWRjpf7ffS9_g" id="(0.44402985074626866,0.9663865546218487)"/> + </edges> + <edges xmi:type="notation:Edge" xmi:id="_-tUVoIxMEeWRjpf7ffS9_g" type="4001" element="_-s1NfIxMEeWRjpf7ffS9_g" source="_-tLLsIxMEeWRjpf7ffS9_g" target="_-s--cIxMEeWRjpf7ffS9_g"> + <children xmi:type="notation:Node" xmi:id="_-tUVpIxMEeWRjpf7ffS9_g" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tUVpYxMEeWRjpf7ffS9_g" x="-15" y="-2"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tUVpoxMEeWRjpf7ffS9_g" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tUVp4xMEeWRjpf7ffS9_g" x="3" y="4"/> + </children> + <children xmi:type="notation:Node" xmi:id="_-tU8sIxMEeWRjpf7ffS9_g" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-tU8sYxMEeWRjpf7ffS9_g" y="1"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_-tUVoYxMEeWRjpf7ffS9_g" routing="Rectilinear"/> + <styles xmi:type="notation:FontStyle" xmi:id="_-tUVooxMEeWRjpf7ffS9_g" fontName="Ubuntu" fontHeight="8"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_-tUVo4xMEeWRjpf7ffS9_g" points="[22, 15, 8, -13]$[22, 57, 8, 29]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-tU8soxMEeWRjpf7ffS9_g" id="(0.19736842105263158,0.5)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-tU8s4xMEeWRjpf7ffS9_g" id="(0.6380597014925373,0.7522724189390849)"/> + </edges> + </data> + </ownedAnnotationEntries> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_-s1Nc4xMEeWRjpf7ffS9_g" name="root" incomingEdges="_-s1NeYxMEeWRjpf7ffS9_g _-s1NfIxMEeWRjpf7ffS9_g"> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + <semanticElements xmi:type="ecore:EPackage" href="My.ecore#/"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_-s1NdIxMEeWRjpf7ffS9_g" borderSize="1" borderSizeComputationExpression="1"> + <description xmi:type="style:FlatContainerStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_-s1NdYxMEeWRjpf7ffS9_g" name="C1" outgoingEdges="_-s1NeYxMEeWRjpf7ffS9_g" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="My.ecore#//C1"/> + <semanticElements xmi:type="ecore:EClass" href="My.ecore#//C1"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_-s1NdoxMEeWRjpf7ffS9_g" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@subNodeMappings[name='Classes']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@subNodeMappings[name='Classes']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_-s1Nd4xMEeWRjpf7ffS9_g" name="C2" outgoingEdges="_-s1NfIxMEeWRjpf7ffS9_g" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="My.ecore#//C2"/> + <semanticElements xmi:type="ecore:EClass" href="My.ecore#//C2"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_-s1NeIxMEeWRjpf7ffS9_g" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@subNodeMappings[name='Classes']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@subNodeMappings[name='Classes']"/> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_-s1NeYxMEeWRjpf7ffS9_g" sourceNode="_-s1NdYxMEeWRjpf7ffS9_g" targetNode="_-s1Nc4xMEeWRjpf7ffS9_g"> + <target xmi:type="ecore:EClass" href="My.ecore#//C1"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_5sxw8IxtEeWrvMLYFgv1uw" size="2" routingStyle="manhattan"> + <description xmi:type="style:EdgeStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@edgeMappings[name='EContainer']/@style"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_5sxw8YxtEeWrvMLYFgv1uw"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@edgeMappings[name='EContainer']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_-s1NfIxMEeWRjpf7ffS9_g" sourceNode="_-s1Nd4xMEeWRjpf7ffS9_g" targetNode="_-s1Nc4xMEeWRjpf7ffS9_g"> + <target xmi:type="ecore:EClass" href="My.ecore#//C2"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_-s1NfYxMEeWRjpf7ffS9_g" size="2" routingStyle="manhattan"> + <description xmi:type="style:EdgeStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@edgeMappings[name='EContainer']/@style"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_-s1NfoxMEeWRjpf7ffS9_g"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@edgeMappings[name='EContainer']"/> + </ownedDiagramElements> + <description xmi:type="description_1:DiagramDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']"/> + <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_-s1Nf4xMEeWRjpf7ffS9_g"/> + <activatedLayers xmi:type="description_1:Layer" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer"/> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + </ownedRepresentations> + <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_1TqboIxtEeWrvMLYFgv1uw" name="newDiag2"> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_1TqboYxtEeWrvMLYFgv1uw" source="DANNOTATION_CUSTOMIZATION_KEY"> + <data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_1TqbooxtEeWrvMLYFgv1uw"/> + </ownedAnnotationEntries> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_1TutEIxtEeWrvMLYFgv1uw" source="GMF_DIAGRAMS"> + <data xmi:type="notation:Diagram" xmi:id="_1TutEYxtEeWrvMLYFgv1uw" type="Sirius" element="_1TqboIxtEeWrvMLYFgv1uw" measurementUnit="Pixel"> + <children xmi:type="notation:Node" xmi:id="_1TxwYIxtEeWrvMLYFgv1uw" type="2002" element="_1Tqbo4xtEeWrvMLYFgv1uw"> + <children xmi:type="notation:Node" xmi:id="_1T4eEIxtEeWrvMLYFgv1uw" type="5006"/> + <children xmi:type="notation:Node" xmi:id="_1T4eEYxtEeWrvMLYFgv1uw" type="7001"> + <children xmi:type="notation:Node" xmi:id="_1T5sMIxtEeWrvMLYFgv1uw" type="3007" element="_1TqbpYxtEeWrvMLYFgv1uw"> + <children xmi:type="notation:Node" xmi:id="_1T66UIxtEeWrvMLYFgv1uw" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_LNLsooxuEeWrvMLYFgv1uw" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_1T99oIxtEeWrvMLYFgv1uw" type="3003" element="_1TqbpoxtEeWrvMLYFgv1uw"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_1T99oYxtEeWrvMLYFgv1uw" fontName="Ubuntu"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1T99ooxtEeWrvMLYFgv1uw"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_1T5sMYxtEeWrvMLYFgv1uw" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LNLsoYxuEeWrvMLYFgv1uw" x="25" y="39" width="76" height="30"/> + </children> + <children xmi:type="notation:Node" xmi:id="_1T8IcIxtEeWrvMLYFgv1uw" type="3007" element="_1Tqbp4xtEeWrvMLYFgv1uw"> + <children xmi:type="notation:Node" xmi:id="_1T9WkIxtEeWrvMLYFgv1uw" type="5003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_LNMTsIxuEeWrvMLYFgv1uw" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="_1T-ksIxtEeWrvMLYFgv1uw" type="3003" element="_1TqbqIxtEeWrvMLYFgv1uw"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_1T-ksYxtEeWrvMLYFgv1uw" fontName="Ubuntu"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1T-ksoxtEeWrvMLYFgv1uw"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_1T8IcYxtEeWrvMLYFgv1uw" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LNLso4xuEeWrvMLYFgv1uw" x="135" y="39" width="76" height="30"/> + </children> + <styles xmi:type="notation:SortingStyle" xmi:id="_1T5FIIxtEeWrvMLYFgv1uw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_1T5FIYxtEeWrvMLYFgv1uw"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="_1TxwYYxtEeWrvMLYFgv1uw" fontName="Ubuntu" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LNLsoIxuEeWrvMLYFgv1uw" x="55" y="50" width="268" height="119"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_1TutEoxtEeWrvMLYFgv1uw"/> + <edges xmi:type="notation:Edge" xmi:id="_EHbK4IxuEeWrvMLYFgv1uw" type="4001" element="_EHXggIxuEeWrvMLYFgv1uw" source="_1TxwYIxtEeWrvMLYFgv1uw" target="_1T5sMIxtEeWrvMLYFgv1uw"> + <children xmi:type="notation:Node" xmi:id="_EHbx8IxuEeWrvMLYFgv1uw" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHbx8YxuEeWrvMLYFgv1uw" x="10"/> + </children> + <children xmi:type="notation:Node" xmi:id="_EHcZAIxuEeWrvMLYFgv1uw" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHcZAYxuEeWrvMLYFgv1uw" x="11" y="10"/> + </children> + <children xmi:type="notation:Node" xmi:id="_EHdAEIxuEeWrvMLYFgv1uw" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHdAEYxuEeWrvMLYFgv1uw" x="-10"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_EHbK4YxuEeWrvMLYFgv1uw" routing="Rectilinear"/> + <styles xmi:type="notation:FontStyle" xmi:id="_EHbK4oxuEeWrvMLYFgv1uw" fontName="Ubuntu" fontHeight="8"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_EHbK44xuEeWrvMLYFgv1uw" points="[-65, 59, 0, 57]$[-65, 17, 0, 15]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EHdnIIxuEeWrvMLYFgv1uw" id="(0.5,0.4957983193277311)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EHdnIYxuEeWrvMLYFgv1uw" id="(0.5,0.5)"/> + </edges> + <edges xmi:type="notation:Edge" xmi:id="_EHeOMIxuEeWrvMLYFgv1uw" type="4001" element="_EHYHkIxuEeWrvMLYFgv1uw" source="_1TxwYIxtEeWrvMLYFgv1uw" target="_1T8IcIxtEeWrvMLYFgv1uw"> + <children xmi:type="notation:Node" xmi:id="_EHeONIxuEeWrvMLYFgv1uw" type="6001"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHeONYxuEeWrvMLYFgv1uw" x="5" y="-10"/> + </children> + <children xmi:type="notation:Node" xmi:id="_EHeONoxuEeWrvMLYFgv1uw" type="6002"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHeON4xuEeWrvMLYFgv1uw" x="2" y="10"/> + </children> + <children xmi:type="notation:Node" xmi:id="_EHeOOIxuEeWrvMLYFgv1uw" type="6003"> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EHeOOYxuEeWrvMLYFgv1uw" x="-1" y="8"/> + </children> + <styles xmi:type="notation:ConnectorStyle" xmi:id="_EHeOMYxuEeWrvMLYFgv1uw" routing="Rectilinear"/> + <styles xmi:type="notation:FontStyle" xmi:id="_EHeOMoxuEeWrvMLYFgv1uw" fontName="Ubuntu" fontHeight="8"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_EHeOM4xuEeWrvMLYFgv1uw" points="[47, 59, 19, 45]$[47, 17, 19, 3]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EHeOOoxuEeWrvMLYFgv1uw" id="(0.5,0.4957983193277311)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EHeOO4xuEeWrvMLYFgv1uw" id="(0.27631578947368424,0.9)"/> + </edges> + </data> + </ownedAnnotationEntries> + <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_1Tqbo4xtEeWrvMLYFgv1uw" name="root" outgoingEdges="_EHXggIxuEeWrvMLYFgv1uw _EHYHkIxuEeWrvMLYFgv1uw"> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + <semanticElements xmi:type="ecore:EPackage" href="My.ecore#/"/> + <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_1TqbpIxtEeWrvMLYFgv1uw" borderSize="1" borderSizeComputationExpression="1"> + <description xmi:type="style:FlatContainerStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:ContainerMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']"/> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_1TqbpYxtEeWrvMLYFgv1uw" name="C1" incomingEdges="_EHXggIxuEeWrvMLYFgv1uw" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="My.ecore#//C1"/> + <semanticElements xmi:type="ecore:EClass" href="My.ecore#//C1"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:Square" xmi:id="_1TqbpoxtEeWrvMLYFgv1uw" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@subNodeMappings[name='Classes2']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@subNodeMappings[name='Classes2']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_1Tqbp4xtEeWrvMLYFgv1uw" name="C2" incomingEdges="_EHYHkIxuEeWrvMLYFgv1uw" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EClass" href="My.ecore#//C2"/> + <semanticElements xmi:type="ecore:EClass" href="My.ecore#//C2"/> + <ownedStyle xmi:type="diagram:Square" xmi:id="_1TqbqIxtEeWrvMLYFgv1uw" labelPosition="node"> + <description xmi:type="style:SquareDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@subNodeMappings[name='Classes2']/@style"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@subNodeMappings[name='Classes2']"/> + </ownedDiagramElements> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_EHXggIxuEeWrvMLYFgv1uw" sourceNode="_1Tqbo4xtEeWrvMLYFgv1uw" targetNode="_1TqbpYxtEeWrvMLYFgv1uw"> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_EHXggYxuEeWrvMLYFgv1uw" size="2" routingStyle="manhattan"> + <description xmi:type="style:EdgeStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@edgeMappings[name='EContainer2']/@style"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_EHXggoxuEeWrvMLYFgv1uw"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@edgeMappings[name='EContainer2']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_EHYHkIxuEeWrvMLYFgv1uw" sourceNode="_1Tqbo4xtEeWrvMLYFgv1uw" targetNode="_1Tqbp4xtEeWrvMLYFgv1uw"> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_EHYHkYxuEeWrvMLYFgv1uw" size="2" routingStyle="manhattan"> + <description xmi:type="style:EdgeStyleDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@edgeMappings[name='EContainer2']/@style"/> + <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_EHYHkoxuEeWrvMLYFgv1uw"/> + </ownedStyle> + <actualMapping xmi:type="description_1:EdgeMapping" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@edgeMappings[name='EContainer2']"/> + </ownedDiagramElements> + <description xmi:type="description_1:DiagramDescription" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']"/> + <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_1TqbqYxtEeWrvMLYFgv1uw"/> + <activatedLayers xmi:type="description_1:Layer" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer"/> + <target xmi:type="ecore:EPackage" href="My.ecore#/"/> + </ownedRepresentations> + <viewpoint xmi:type="description:Viewpoint" href="My.odesign#//@ownedViewpoints[name='EdgeFromNoteToEContainer']"/> + </ownedViews> </viewpoint:DAnalysis> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.odesign new file mode 100644 index 0000000000..4e9bfb87f4 --- /dev/null +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/bendpointsStability/otherSpecificCases/My.odesign @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" name="My" version="11.0.0.201511131800"> + <ownedViewpoints name="EdgeFromNoteToEContainer" modelFileExtension="ecore"> + <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Diag" domainClass="ecore.EPackage" enablePopupBars="true"> + <defaultLayer name="Default"> + <edgeMappings name="EContainer" sourceMapping="//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']/@subNodeMappings[name='Classes']" targetMapping="//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag']/@defaultLayer/@containerMappings[name='Packages']" targetFinderExpression="feature:eContainer"> + <style sizeComputationExpression="2" routingStyle="manhattan"> + <strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + <centerLabelStyleDescription> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </centerLabelStyleDescription> + </style> + </edgeMappings> + <containerMappings name="Packages" semanticCandidatesExpression="var:self" domainClass="ecore.EPackage"> + <subNodeMappings name="Classes" semanticCandidatesExpression="feature:eClassifiers" domainClass="ecore.EClass"> + <style xsi:type="style:SquareDescription" labelPosition="node" resizeKind="NSEW"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + </style> + </subNodeMappings> + <style xsi:type="style:FlatContainerStyleDescription" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/> + </style> + </containerMappings> + </defaultLayer> + </ownedRepresentations> + <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Diag2" domainClass="ecore.EPackage" enablePopupBars="true"> + <defaultLayer name="Default"> + <edgeMappings name="EContainer2" sourceMapping="//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']" targetMapping="//@ownedViewpoints[name='EdgeFromNoteToEContainer']/@ownedRepresentations[name='Diag2']/@defaultLayer/@containerMappings[name='Packages2']/@subNodeMappings[name='Classes2']" targetFinderExpression="feature:eClassifiers"> + <style sizeComputationExpression="2" routingStyle="manhattan"> + <strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + <centerLabelStyleDescription> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + </centerLabelStyleDescription> + </style> + </edgeMappings> + <containerMappings name="Packages2" semanticCandidatesExpression="var:self" domainClass="ecore.EPackage"> + <subNodeMappings name="Classes2" semanticCandidatesExpression="feature:eClassifiers" domainClass="ecore.EClass"> + <style xsi:type="style:SquareDescription" labelPosition="node" resizeKind="NSEW"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/> + </style> + </subNodeMappings> + <style xsi:type="style:FlatContainerStyleDescription" borderSizeComputationExpression="1"> + <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/> + </style> + </containerMappings> + </defaultLayer> + </ownedRepresentations> + </ownedViewpoints> +</description:Group> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BendpointsStabilityOnMovesSpecificCasesTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BendpointsStabilityOnMovesSpecificCasesTest.java index a9e3a7f8cb..98545bb1b9 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BendpointsStabilityOnMovesSpecificCasesTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BendpointsStabilityOnMovesSpecificCasesTest.java @@ -55,6 +55,8 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS private static final String SESSION_FILE = "My.aird"; + private static final String VSM_FILE = "My.odesign"; + private static final String DIAGRAM_DESCRIPTION_NAME = "Entities"; boolean isOutlineViewOpened; @@ -148,7 +150,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS @Override protected void onSetUpBeforeClosingWelcomePage() throws Exception { - copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE); + copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE, VSM_FILE); } @Override @@ -205,7 +207,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * Test that first point is moved has expected and that draw2d and GMF last * points are consistency. */ - public void testFirstPointConsistency() { + public void _testFirstPointConsistency() { final Point moveDelta = new Point(20, 20); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta); testFirstPointConsistency(moveDelta, 0, assertPointLocationFunction); @@ -216,7 +218,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * points are consistency. In this case, the first segment is merged with * the second one. */ - public void testFirstPointConsistencyWithMergeSegment() { + public void _testFirstPointConsistencyWithMergeSegment() { final Point moveDelta = new Point(0, 99); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta) { Point otherExpectedPoint; @@ -260,7 +262,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * Test that first point is moved has expected and that draw2d and GMF last * points are consistency (when the first segment is inverted). */ - public void testFirstPointConsistencyWithFirstSegmentInverted() { + public void _testFirstPointConsistencyWithFirstSegmentInverted() { final Point moveDelta = new Point(340, 0); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta) { @Override @@ -272,10 +274,38 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS } /** + * Test that first point is moved has expected and that draw2d and GMF last + * points are consistency. + */ + public void testMoveOKWithEdgeFromNodeToItsContainer() { + editor.close(); + SWTBotUtils.waitAllUiEvents(); + // Open the other testing diagram editor + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "Diag", "newDiag", DSemanticDiagram.class, true, true); + final Point moveDelta = new Point(20, 20); + AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta); + testFirstPointConsistency(moveDelta, 0, assertPointLocationFunction, true); + } + + /** + * Test that first point is moved has expected and that draw2d and GMF last + * points are consistency. + */ + public void testMoveOKWithEdgeFromContainerToItsNodes() { + editor.close(); + SWTBotUtils.waitAllUiEvents(); + // Open the other testing diagram editor + editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), "Diag2", "newDiag2", DSemanticDiagram.class, true, true); + final Point moveDelta = new Point(20, 20); + AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta); + testLastPointConsistency(moveDelta, 0, assertPointLocationFunction, true); + } + + /** * Test that last point is moved has expected and that draw2d and GMF last * points are consistency. */ - public void testLastPointConsistency() { + public void _testLastPointConsistency() { Point moveDelta = new Point(-20, 50); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta); testLastPointConsistency(moveDelta, 0, assertPointLocationFunction); @@ -286,7 +316,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * points are consistency. In this case, the last segment is merged with the * previous one. */ - public void testLastPointConsistencyWithMergeSegment() { + public void _testLastPointConsistencyWithMergeSegment() { Point moveDelta = new Point(0, -139); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta) { Point otherExpectedPoint; @@ -315,7 +345,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * Test that last point is moved has expected and that draw2d and GMF last * points are consistency (when the last segment is removed). */ - public void testLastPointConsistencyWithLastSegmentRemoval() { + public void _testLastPointConsistencyWithLastSegmentRemoval() { final Point moveDelta = new Point(-120, 50); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta) { @Override @@ -330,7 +360,7 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * Test that last point is moved has expected and that draw2d and GMF last * points are consistency (when the last segment is inverted). */ - public void testLastPointConsistencyWithLastSegmentInverted() { + public void _testLastPointConsistencyWithLastSegmentInverted() { final Point moveDelta = new Point(-340, 0); AssertPointLocationFunction assertPointLocationFunction = new AssertPointLocationFunction(moveDelta) { @Override @@ -355,6 +385,25 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * after move */ private void testLastPointConsistency(Point moveDelta, int nbGMFPointsDelta, AssertPointLocationFunction assertPointLocationFunction) { + testLastPointConsistency(moveDelta, nbGMFPointsDelta, assertPointLocationFunction, false); + } + + /** + * Test that last point is moved has expected and that draw2d and GMF last + * points are consistency. + * + * @param moveDelta + * The delta from which the source node will be moved + * @param nbGMFPointsDelta + * Number of GMF points that are added (or removed) after the + * move. + * @param assertPointLocationFunction + * the function to use to check the expected last point location + * after move + * @param edgeWithOnly2Points + * true if the edge has only two points, false otherwise + */ + private void testLastPointConsistency(Point moveDelta, int nbGMFPointsDelta, AssertPointLocationFunction assertPointLocationFunction, boolean edgeWithOnly2Points) { String nodeToMoveName = "C2"; editor.reveal(nodeToMoveName); // Step 2: store the previous bendpoints @@ -371,7 +420,11 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS bot.waitUntil(editPartMovedCondition); assertEquals("Drag as failed: selection should be the same before and after drag.", editPartToMove, editor.selectedEditParts().get(0)); // Step 4: Check bendpoints - assertPointLocationFunction.setData(previousPoints.getLastPoint(), previousPoints.getPoint(previousPoints.size() - 3), nodeBounds); + if (edgeWithOnly2Points) { + assertPointLocationFunction.setData(previousPoints.getLastPoint(), previousPoints.getFirstPoint(), nodeBounds); + } else { + assertPointLocationFunction.setData(previousPoints.getLastPoint(), previousPoints.getPoint(previousPoints.size() - 3), nodeBounds); + } compareActualBendpointsWithExpected(editor, connectionEditPart, previousPoints, moveDelta, nodeBounds, false, nbGMFPointsDelta, assertPointLocationFunction); } @@ -389,6 +442,25 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS * after move */ private void testFirstPointConsistency(Point moveDelta, int nbGMFPointsDelta, AssertPointLocationFunction assertPointLocationFunction) { + testFirstPointConsistency(moveDelta, nbGMFPointsDelta, assertPointLocationFunction, false); + } + + /** + * Test that first point is moved has expected and that draw2d and GMF last + * points are consistency. + * + * @param moveDelta + * The delta from which the source node will be moved + * @param nbGMFPointsDelta + * Number of GMF points that are added (or removed) after the + * move. + * @param assertPointLocationFunction + * the function to use to check the expected last point location + * after move + * @param edgeWithOnly2Points + * true if the edge has only two points, false otherwise + */ + private void testFirstPointConsistency(Point moveDelta, int nbGMFPointsDelta, AssertPointLocationFunction assertPointLocationFunction, boolean edgeWithOnly2Points) { String nodeToMoveName = "C1"; editor.reveal(nodeToMoveName); // Step 2: store the previous bendpoints @@ -405,7 +477,11 @@ public class BendpointsStabilityOnMovesSpecificCasesTest extends AbstractSiriusS bot.waitUntil(editPartMovedCondition); assertEquals("Drag as failed: selection should be the same before and after drag.", editPartToMove, editor.selectedEditParts().get(0)); // Step 4: Check bendpoints - assertPointLocationFunction.setData(previousPoints.getFirstPoint(), previousPoints.getPoint(2), nodeBounds); + if (edgeWithOnly2Points) { + assertPointLocationFunction.setData(previousPoints.getFirstPoint(), previousPoints.getLastPoint(), nodeBounds); + } else { + assertPointLocationFunction.setData(previousPoints.getFirstPoint(), previousPoints.getPoint(2), nodeBounds); + } compareActualBendpointsWithExpected(editor, connectionEditPart, previousPoints, moveDelta, nodeBounds, true, nbGMFPointsDelta, assertPointLocationFunction); } |
