Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2016-06-14 12:49:59 +0000
committerLaurent Redor2016-07-06 16:24:14 +0000
commit3b2488e0431ace464eac0efde9730f887e7b9035 (patch)
tree6afbf7e6f1fbaf20e41acd7c8cc501e28c86d143
parentd8d1444dbf900ffae942cb2c820771b4338d995a (diff)
downloadorg.eclipse.sirius-3b2488e0431ace464eac0efde9730f887e7b9035.tar.gz
org.eclipse.sirius-3b2488e0431ace464eac0efde9730f887e7b9035.tar.xz
org.eclipse.sirius-3b2488e0431ace464eac0efde9730f887e7b9035.zip
[497398] Add specific tests to reveal problem
The new tests need to change the use case data. The package "az" is now revealed in "Diag with HStack" and "Diag with VStack" diagrams (without both width and height auto-sized). Bug: 497398 Cherry-picked-from: 495707 Change-Id: I768dea5fd4b51eb662e58cd73ad71f3dd32c6fc4 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/data/unit/compartments/My.aird128
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsLayoutTest.java66
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsTest.java4
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/ICompartmentTests.java6
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java204
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java2
6 files changed, 290 insertions, 120 deletions
diff --git a/plugins/org.eclipse.sirius.tests.junit/data/unit/compartments/My.aird b/plugins/org.eclipse.sirius.tests.junit/data/unit/compartments/My.aird
index c6ae710e4e..b508fec8e4 100644
--- a/plugins/org.eclipse.sirius.tests.junit/data/unit/compartments/My.aird
+++ b/plugins/org.eclipse.sirius.tests.junit/data/unit/compartments/My.aird
@@ -1,7 +1,8 @@
<?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="_e3qcoZa7EeK0jbLdcLCXjQ" selectedViews="_fQZFsJa7EeK0jbLdcLCXjQ _prQiEJa7EeK0jbLdcLCXjQ" version="10.1.0.201509162000">
+<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="_e3qcoZa7EeK0jbLdcLCXjQ" selectedViews="_fQZFsJa7EeK0jbLdcLCXjQ _prQiEJa7EeK0jbLdcLCXjQ" version="11.0.0.201604141600">
<semanticResources>My.ecore</semanticResources>
- <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_fQZFsJa7EeK0jbLdcLCXjQ">
+ <ownedViews xmi:type="viewpoint:DView" xmi:id="_fQZFsJa7EeK0jbLdcLCXjQ">
+ <viewpoint xmi:type="description:Viewpoint" href="compartments.odesign#//@ownedViewpoints[name='Compartments']"/>
<ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_xGk0UEgKEeWO8ekbzmZQXg" name="VStackDiag">
<ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_xGk0UUgKEeWO8ekbzmZQXg" source="DANNOTATION_CUSTOMIZATION_KEY">
<data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_xGk0UkgKEeWO8ekbzmZQXg"/>
@@ -157,10 +158,10 @@
<styles xmi:type="notation:ShapeStyle" xmi:id="_x1rWAUgKEeWO8ekbzmZQXg" fontName=".SF NS Text" fontHeight="8"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_x1rWAkgKEeWO8ekbzmZQXg" x="64" y="16"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_x1rWB0gKEeWO8ekbzmZQXg" visible="false" type="2002" element="_x0r3gEgKEeWO8ekbzmZQXg">
+ <children xmi:type="notation:Node" xmi:id="_x1rWB0gKEeWO8ekbzmZQXg" type="2002" element="_x0r3gEgKEeWO8ekbzmZQXg">
<children xmi:type="notation:Node" xmi:id="_x1r9EEgKEeWO8ekbzmZQXg" type="5006"/>
<children xmi:type="notation:Node" xmi:id="_x1r9EUgKEeWO8ekbzmZQXg" type="7001">
- <children xmi:type="notation:Node" xmi:id="_x16mkEgKEeWO8ekbzmZQXg" visible="false" type="3008" element="_x1csgEgKEeWO8ekbzmZQXg">
+ <children xmi:type="notation:Node" xmi:id="_x16mkEgKEeWO8ekbzmZQXg" type="3008" element="_x1csgEgKEeWO8ekbzmZQXg">
<children xmi:type="notation:Node" xmi:id="_x16mk0gKEeWO8ekbzmZQXg" type="5005"/>
<children xmi:type="notation:Node" xmi:id="_x16mlEgKEeWO8ekbzmZQXg" type="7002">
<styles xmi:type="notation:SortingStyle" xmi:id="_x16mlUgKEeWO8ekbzmZQXg"/>
@@ -168,9 +169,9 @@
<styles xmi:type="notation:DrawerStyle" xmi:id="_x16ml0gKEeWO8ekbzmZQXg"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_x16mkUgKEeWO8ekbzmZQXg" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x16mkkgKEeWO8ekbzmZQXg" y="80"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x16mkkgKEeWO8ekbzmZQXg" y="80" width="154" height="40"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_x17NoEgKEeWO8ekbzmZQXg" visible="false" type="3008" element="_x1ehsEgKEeWO8ekbzmZQXg">
+ <children xmi:type="notation:Node" xmi:id="_x17NoEgKEeWO8ekbzmZQXg" type="3008" element="_x1ehsEgKEeWO8ekbzmZQXg">
<children xmi:type="notation:Node" xmi:id="_x17No0gKEeWO8ekbzmZQXg" type="5005"/>
<children xmi:type="notation:Node" xmi:id="_x17NpEgKEeWO8ekbzmZQXg" type="7002">
<styles xmi:type="notation:SortingStyle" xmi:id="_x17NpUgKEeWO8ekbzmZQXg"/>
@@ -178,9 +179,9 @@
<styles xmi:type="notation:DrawerStyle" xmi:id="_x17Np0gKEeWO8ekbzmZQXg"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_x17NoUgKEeWO8ekbzmZQXg" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x17NokgKEeWO8ekbzmZQXg" y="120"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x17NokgKEeWO8ekbzmZQXg" y="120" width="154" height="40"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_1BaWkFuwEeWZQLQxIrHbCA" visible="false" type="3009" element="_1A3kAFuwEeWZQLQxIrHbCA">
+ <children xmi:type="notation:Node" xmi:id="_1BaWkFuwEeWZQLQxIrHbCA" type="3009" element="_1A3kAFuwEeWZQLQxIrHbCA">
<children xmi:type="notation:Node" xmi:id="_1Ba9oFuwEeWZQLQxIrHbCA" visible="false" type="5004"/>
<children xmi:type="notation:Node" xmi:id="_1Ba9oVuwEeWZQLQxIrHbCA" type="7003">
<styles xmi:type="notation:SortingStyle" xmi:id="_1Ba9oluwEeWZQLQxIrHbCA"/>
@@ -188,9 +189,9 @@
<styles xmi:type="notation:DrawerStyle" xmi:id="_1Ba9pFuwEeWZQLQxIrHbCA"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_1BaWkVuwEeWZQLQxIrHbCA" fontColor="2697711" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1BaWkluwEeWZQLQxIrHbCA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1BaWkluwEeWZQLQxIrHbCA" width="154" height="40"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_1Ba9pVuwEeWZQLQxIrHbCA" visible="false" type="3009" element="_1A6AQVuwEeWZQLQxIrHbCA">
+ <children xmi:type="notation:Node" xmi:id="_1Ba9pVuwEeWZQLQxIrHbCA" type="3009" element="_1A6AQVuwEeWZQLQxIrHbCA">
<children xmi:type="notation:Node" xmi:id="_1BbksFuwEeWZQLQxIrHbCA" visible="false" type="5004"/>
<children xmi:type="notation:Node" xmi:id="_1BbksVuwEeWZQLQxIrHbCA" type="7003">
<styles xmi:type="notation:SortingStyle" xmi:id="_1BbksluwEeWZQLQxIrHbCA"/>
@@ -198,13 +199,13 @@
<styles xmi:type="notation:DrawerStyle" xmi:id="_1BbktFuwEeWZQLQxIrHbCA"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_1Ba9pluwEeWZQLQxIrHbCA" fontColor="2697711" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1Ba9p1uwEeWZQLQxIrHbCA" y="40"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1Ba9p1uwEeWZQLQxIrHbCA" y="40" width="154" height="40"/>
</children>
<styles xmi:type="notation:SortingStyle" xmi:id="_x1r9EkgKEeWO8ekbzmZQXg"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_x1r9E0gKEeWO8ekbzmZQXg"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_x1rWCEgKEeWO8ekbzmZQXg" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x1rWCUgKEeWO8ekbzmZQXg" x="628" y="92"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x1rWCUgKEeWO8ekbzmZQXg" x="338" y="66" width="166"/>
</children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_xGlbYkgKEeWO8ekbzmZQXg"/>
</data>
@@ -370,15 +371,14 @@
</ownedDiagramElements>
</ownedDiagramElements>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x0r3gEgKEeWO8ekbzmZQXg" name="az" visible="false" width="5" height="5" childrenPresentation="VerticalStack">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x0r3gEgKEeWO8ekbzmZQXg" name="az" width="5" height="5" childrenPresentation="VerticalStack">
<target xmi:type="ecore:EPackage" href="My.ecore#//az"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az"/>
- <graphicalFilters xmi:type="diagram:HideFilter" xmi:id="_Y90RoFVdEeWPBvASMVA0xg"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_x0r3gUgKEeWO8ekbzmZQXg" borderSize="5" borderSizeComputationExpression="5" borderColor="156,12,12">
<description xmi:type="style:FlatContainerStyleDescription" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20VStack']/@defaultLayer/@containerMappings[name='VStack']/@style"/>
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20VStack']/@defaultLayer/@containerMappings[name='VStack']"/>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x1csgEgKEeWO8ekbzmZQXg" name="aaa" visible="false" width="-1" height="-1">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x1csgEgKEeWO8ekbzmZQXg" name="aaa">
<target xmi:type="ecore:EPackage" href="My.ecore#//az/aaa"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az/aaa"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_x1d6oEgKEeWO8ekbzmZQXg" labelColor="252,175,62" labelAlignment="RIGHT" borderSize="1" borderSizeComputationExpression="1" borderColor="252,175,62" backgroundColor="114,159,207" foregroundColor="114,159,207">
@@ -386,7 +386,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20VStack']/@defaultLayer/@containerMappings[name='VStack']/@subContainerMappings[name='FreeFormRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x1ehsEgKEeWO8ekbzmZQXg" name="aaaa" visible="false" width="-1" height="-1">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_x1ehsEgKEeWO8ekbzmZQXg" name="aaaa">
<target xmi:type="ecore:EPackage" href="My.ecore#//az/aaaa"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az/aaaa"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_x1fv0EgKEeWO8ekbzmZQXg" labelColor="252,175,62" labelAlignment="RIGHT" borderSize="1" borderSizeComputationExpression="1" borderColor="252,175,62" backgroundColor="114,159,207" foregroundColor="114,159,207">
@@ -394,7 +394,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20VStack']/@defaultLayer/@containerMappings[name='VStack']/@subContainerMappings[name='FreeFormRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1A3kAFuwEeWZQLQxIrHbCA" name="cl1" visible="false" tooltipText="cl1">
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1A3kAFuwEeWZQLQxIrHbCA" name="cl1" tooltipText="cl1">
<target xmi:type="ecore:EClass" href="My.ecore#//az/cl1"/>
<semanticElements xmi:type="ecore:EClass" href="My.ecore#//az/cl1"/>
<graphicalFilters xmi:type="diagram:HideLabelFilter" xmi:id="_1A6AQFuwEeWZQLQxIrHbCA"/>
@@ -403,7 +403,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20VStack']/@defaultLayer/@containerMappings[name='VStack']/@subContainerMappings[name='ListRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1A6AQVuwEeWZQLQxIrHbCA" name="cl2" visible="false" tooltipText="cl2">
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1A6AQVuwEeWZQLQxIrHbCA" name="cl2" tooltipText="cl2">
<target xmi:type="ecore:EClass" href="My.ecore#//az/cl2"/>
<semanticElements xmi:type="ecore:EClass" href="My.ecore#//az/cl2"/>
<graphicalFilters xmi:type="diagram:HideLabelFilter" xmi:id="_1A71cFuwEeWZQLQxIrHbCA"/>
@@ -573,54 +573,54 @@
<styles xmi:type="notation:ShapeStyle" xmi:id="_RkNpMUvNEeWf576mnYm4XQ" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_RkNpMkvNEeWf576mnYm4XQ"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_RkQsg0vNEeWf576mnYm4XQ" visible="false" type="2002" element="_Rh24wEvNEeWf576mnYm4XQ">
- <children xmi:type="notation:Node" xmi:id="_RkRTkEvNEeWf576mnYm4XQ" type="5006"/>
- <children xmi:type="notation:Node" xmi:id="_RkRTkUvNEeWf576mnYm4XQ" type="7001">
- <children xmi:type="notation:Node" xmi:id="_RkxC1UvNEeWf576mnYm4XQ" visible="false" type="3008" element="_Rj0AkEvNEeWf576mnYm4XQ">
- <children xmi:type="notation:Node" xmi:id="_Rkxp4EvNEeWf576mnYm4XQ" type="5005"/>
- <children xmi:type="notation:Node" xmi:id="_Rkxp4UvNEeWf576mnYm4XQ" type="7002">
- <styles xmi:type="notation:SortingStyle" xmi:id="_Rkxp4kvNEeWf576mnYm4XQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_Rkxp40vNEeWf576mnYm4XQ"/>
- <styles xmi:type="notation:DrawerStyle" xmi:id="_RkyQ8EvNEeWf576mnYm4XQ"/>
+ <children xmi:type="notation:Node" xmi:id="_BCggoDIrEeaYYdAEhPAPlw" type="2002" element="_Rh24wEvNEeWf576mnYm4XQ">
+ <children xmi:type="notation:Node" xmi:id="_BCggozIrEeaYYdAEhPAPlw" type="5006"/>
+ <children xmi:type="notation:Node" xmi:id="_BCggpDIrEeaYYdAEhPAPlw" type="7001">
+ <children xmi:type="notation:Node" xmi:id="_Fqh0oDIrEeaYYdAEhPAPlw" type="3009" element="_1ALAcFuwEeWZQLQxIrHbCA">
+ <children xmi:type="notation:Node" xmi:id="_Fqh0ozIrEeaYYdAEhPAPlw" type="5004"/>
+ <children xmi:type="notation:Node" xmi:id="_Fqh0pDIrEeaYYdAEhPAPlw" type="7003">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Fqh0pTIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Fqh0pjIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_FqibsDIrEeaYYdAEhPAPlw"/>
</children>
- <styles xmi:type="notation:ShapeStyle" xmi:id="_RkxC1kvNEeWf576mnYm4XQ" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RkxC10vNEeWf576mnYm4XQ" x="80" width="40" height="83"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_Fqh0oTIrEeaYYdAEhPAPlw" fontColor="2697711" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fqh0ojIrEeaYYdAEhPAPlw" width="40" height="222"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_RkyQ8UvNEeWf576mnYm4XQ" visible="false" type="3008" element="_Rj11wEvNEeWf576mnYm4XQ">
- <children xmi:type="notation:Node" xmi:id="_Rky4AEvNEeWf576mnYm4XQ" type="5005"/>
- <children xmi:type="notation:Node" xmi:id="_Rky4AUvNEeWf576mnYm4XQ" type="7002">
- <styles xmi:type="notation:SortingStyle" xmi:id="_Rky4AkvNEeWf576mnYm4XQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_Rky4A0vNEeWf576mnYm4XQ"/>
- <styles xmi:type="notation:DrawerStyle" xmi:id="_RkzfEEvNEeWf576mnYm4XQ"/>
+ <children xmi:type="notation:Node" xmi:id="_FqibsTIrEeaYYdAEhPAPlw" type="3009" element="_1AMOkFuwEeWZQLQxIrHbCA">
+ <children xmi:type="notation:Node" xmi:id="_FqibtDIrEeaYYdAEhPAPlw" type="5004"/>
+ <children xmi:type="notation:Node" xmi:id="_FqibtTIrEeaYYdAEhPAPlw" type="7003">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_FqibtjIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_FqibtzIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_FqibuDIrEeaYYdAEhPAPlw"/>
</children>
- <styles xmi:type="notation:ShapeStyle" xmi:id="_RkyQ8kvNEeWf576mnYm4XQ" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RkyQ80vNEeWf576mnYm4XQ" x="120" width="40" height="83"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_FqibsjIrEeaYYdAEhPAPlw" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FqibszIrEeaYYdAEhPAPlw" x="40" width="40" height="222"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_1BeA8FuwEeWZQLQxIrHbCA" visible="false" type="3009" element="_1ALAcFuwEeWZQLQxIrHbCA">
- <children xmi:type="notation:Node" xmi:id="_1BeoAFuwEeWZQLQxIrHbCA" type="5004"/>
- <children xmi:type="notation:Node" xmi:id="_1BeoAVuwEeWZQLQxIrHbCA" type="7003">
- <styles xmi:type="notation:SortingStyle" xmi:id="_1BeoAluwEeWZQLQxIrHbCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_1BeoA1uwEeWZQLQxIrHbCA"/>
- <styles xmi:type="notation:DrawerStyle" xmi:id="_1BeoBFuwEeWZQLQxIrHbCA"/>
+ <children xmi:type="notation:Node" xmi:id="_FqjCwDIrEeaYYdAEhPAPlw" type="3008" element="_Rj0AkEvNEeWf576mnYm4XQ">
+ <children xmi:type="notation:Node" xmi:id="_Fqjp0DIrEeaYYdAEhPAPlw" type="5005"/>
+ <children xmi:type="notation:Node" xmi:id="_Fqjp0TIrEeaYYdAEhPAPlw" type="7002">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_Fqjp0jIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Fqjp0zIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_Fqjp1DIrEeaYYdAEhPAPlw"/>
</children>
- <styles xmi:type="notation:ShapeStyle" xmi:id="_1BeA8VuwEeWZQLQxIrHbCA" fontColor="2697711" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1BeA8luwEeWZQLQxIrHbCA"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_FqjCwTIrEeaYYdAEhPAPlw" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FqjCwjIrEeaYYdAEhPAPlw" x="80" width="40" height="222"/>
</children>
- <children xmi:type="notation:Node" xmi:id="_1BeoBVuwEeWZQLQxIrHbCA" visible="false" type="3009" element="_1AMOkFuwEeWZQLQxIrHbCA">
- <children xmi:type="notation:Node" xmi:id="_1BeoCFuwEeWZQLQxIrHbCA" type="5004"/>
- <children xmi:type="notation:Node" xmi:id="_1BfPEFuwEeWZQLQxIrHbCA" type="7003">
- <styles xmi:type="notation:SortingStyle" xmi:id="_1BfPEVuwEeWZQLQxIrHbCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_1BfPEluwEeWZQLQxIrHbCA"/>
- <styles xmi:type="notation:DrawerStyle" xmi:id="_1BfPE1uwEeWZQLQxIrHbCA"/>
+ <children xmi:type="notation:Node" xmi:id="_Fqjp1TIrEeaYYdAEhPAPlw" type="3008" element="_Rj11wEvNEeWf576mnYm4XQ">
+ <children xmi:type="notation:Node" xmi:id="_FqkQ4DIrEeaYYdAEhPAPlw" type="5005"/>
+ <children xmi:type="notation:Node" xmi:id="_FqkQ4TIrEeaYYdAEhPAPlw" type="7002">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_FqkQ4jIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_FqkQ4zIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_FqkQ5DIrEeaYYdAEhPAPlw"/>
</children>
- <styles xmi:type="notation:ShapeStyle" xmi:id="_1BeoBluwEeWZQLQxIrHbCA" fontColor="2697711" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1BeoB1uwEeWZQLQxIrHbCA" x="40"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_Fqjp1jIrEeaYYdAEhPAPlw" fontColor="4108284" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fqjp1zIrEeaYYdAEhPAPlw" x="120" width="103" height="222"/>
</children>
- <styles xmi:type="notation:SortingStyle" xmi:id="_RkRTkkvNEeWf576mnYm4XQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_RkRTk0vNEeWf576mnYm4XQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_BCggpTIrEeaYYdAEhPAPlw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_BCggpjIrEeaYYdAEhPAPlw"/>
</children>
- <styles xmi:type="notation:ShapeStyle" xmi:id="_RkQshEvNEeWf576mnYm4XQ" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_RkQshUvNEeWf576mnYm4XQ" x="1076"/>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_BCggoTIrEeaYYdAEhPAPlw" fontName=".Helvetica Neue DeskInterface" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BCggojIrEeaYYdAEhPAPlw" x="940" y="125"/>
</children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_Qj9tIkvNEeWf576mnYm4XQ"/>
</data>
@@ -794,15 +794,14 @@
</ownedDiagramElements>
</ownedDiagramElements>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rh24wEvNEeWf576mnYm4XQ" name="az" visible="false" childrenPresentation="HorizontalStack">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rh24wEvNEeWf576mnYm4XQ" name="az" childrenPresentation="HorizontalStack">
<target xmi:type="ecore:EPackage" href="My.ecore#//az"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az"/>
- <graphicalFilters xmi:type="diagram:HideFilter" xmi:id="_BHd2AFWpEeWed_P9Y9XnRA"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_i0dpAEvNEeWf576mnYm4XQ" borderSize="4" borderSizeComputationExpression="4" borderColor="156,12,12">
<description xmi:type="style:FlatContainerStyleDescription" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20HStack']/@defaultLayer/@containerMappings[name='HStack']/@style"/>
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20HStack']/@defaultLayer/@containerMappings[name='HStack']"/>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rj0AkEvNEeWf576mnYm4XQ" name="aaa" visible="false">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rj0AkEvNEeWf576mnYm4XQ" name="aaa">
<target xmi:type="ecore:EPackage" href="My.ecore#//az/aaa"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az/aaa"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_Rj0noEvNEeWf576mnYm4XQ" labelColor="252,175,62" labelAlignment="RIGHT" borderSize="2" borderSizeComputationExpression="2" borderColor="252,175,62" backgroundColor="114,159,207" foregroundColor="114,159,207">
@@ -810,7 +809,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20HStack']/@defaultLayer/@containerMappings[name='HStack']/@subContainerMappings[name='FreeFormRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rj11wEvNEeWf576mnYm4XQ" name="aaaa" visible="false">
+ <ownedDiagramElements xmi:type="diagram:DNodeContainer" xmi:id="_Rj11wEvNEeWf576mnYm4XQ" name="aaaa">
<target xmi:type="ecore:EPackage" href="My.ecore#//az/aaaa"/>
<semanticElements xmi:type="ecore:EPackage" href="My.ecore#//az/aaaa"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_Rj2c0EvNEeWf576mnYm4XQ" labelColor="252,175,62" labelAlignment="RIGHT" borderSize="2" borderSizeComputationExpression="2" borderColor="252,175,62" backgroundColor="114,159,207" foregroundColor="114,159,207">
@@ -818,7 +817,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20HStack']/@defaultLayer/@containerMappings[name='HStack']/@subContainerMappings[name='FreeFormRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1ALAcFuwEeWZQLQxIrHbCA" name="cl1" visible="false">
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1ALAcFuwEeWZQLQxIrHbCA" name="cl1">
<target xmi:type="ecore:EClass" href="My.ecore#//az/cl1"/>
<semanticElements xmi:type="ecore:EClass" href="My.ecore#//az/cl1"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_1ALngFuwEeWZQLQxIrHbCA" labelColor="239,41,41" labelAlignment="RIGHT" borderSize="2" borderSizeComputationExpression="2" borderColor="239,41,41" borderLineStyle="dash" backgroundStyle="Liquid" backgroundColor="122,181,155" foregroundColor="122,181,155">
@@ -826,7 +825,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20HStack']/@defaultLayer/@containerMappings[name='HStack']/@subContainerMappings[name='HListRegions']"/>
</ownedDiagramElements>
- <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1AMOkFuwEeWZQLQxIrHbCA" name="cl2" visible="false">
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_1AMOkFuwEeWZQLQxIrHbCA" name="cl2">
<target xmi:type="ecore:EClass" href="My.ecore#//az/cl2"/>
<semanticElements xmi:type="ecore:EClass" href="My.ecore#//az/cl2"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_1AM1oFuwEeWZQLQxIrHbCA" labelColor="239,41,41" labelAlignment="RIGHT" borderSize="2" borderSizeComputationExpression="2" borderColor="239,41,41" borderLineStyle="dash" backgroundStyle="Liquid" backgroundColor="130,203,103" foregroundColor="130,203,103">
@@ -1468,9 +1467,8 @@
<activatedLayers xmi:type="description_1:Layer" href="compartments.odesign#//@ownedViewpoints[name='Compartments']/@ownedRepresentations[name='Diag%20with%20Image']/@defaultLayer"/>
<target xmi:type="ecore:EPackage" href="My.ecore#/"/>
</ownedRepresentations>
- <viewpoint xmi:type="description:Viewpoint" href="compartments.odesign#//@ownedViewpoints[name='Compartments']"/>
</ownedViews>
- <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_prQiEJa7EeK0jbLdcLCXjQ">
+ <ownedViews xmi:type="viewpoint:DView" xmi:id="_prQiEJa7EeK0jbLdcLCXjQ">
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
</ownedViews>
</viewpoint:DAnalysis>
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsLayoutTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsLayoutTest.java
index 06728d2147..e156773354 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsLayoutTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsLayoutTest.java
@@ -104,8 +104,8 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
private final static int[] VSTACK_LAST_REGION_SPECIFIC_CORNERS = { PositionConstants.SOUTH_WEST, PositionConstants.SOUTH_EAST };
- private final static Collection<Integer> CORNERS = Collections.unmodifiableList(Lists.newArrayList(PositionConstants.NORTH_WEST, PositionConstants.NORTH_EAST, PositionConstants.SOUTH_WEST,
- PositionConstants.SOUTH_EAST));
+ private final static Collection<Integer> CORNERS = Collections
+ .unmodifiableList(Lists.newArrayList(PositionConstants.NORTH_WEST, PositionConstants.NORTH_EAST, PositionConstants.SOUTH_WEST, PositionConstants.SOUTH_EAST));
private DDiagram diagram;
@@ -152,7 +152,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
}
private void doTestLabelAlignment() {
- checkAndChangeLabelAlignment(REGION_CONTAINER_NAME, LabelAlignment.CENTER, LabelAlignment.LEFT);
+ checkAndChangeLabelAlignment(FIRST_REGION_CONTAINER_NAME, LabelAlignment.CENTER, LabelAlignment.LEFT);
checkAndChangeLabelAlignment(LEFT_CLASS_NAME, LabelAlignment.LEFT, LabelAlignment.RIGHT);
checkAndChangeLabelAlignment(CENTER_CLASS_NAME, LabelAlignment.CENTER, LabelAlignment.LEFT);
checkAndChangeLabelAlignment(RIGHT_CLASS_NAME, LabelAlignment.RIGHT, LabelAlignment.CENTER);
@@ -202,10 +202,10 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
diagram = (DDiagram) getRepresentations(HORIZONTAL_STACK_REPRESENTATION_NAME).iterator().next();
editor = (DiagramEditor) DialectUIManager.INSTANCE.openEditor(session, diagram, new NullProgressMonitor());
TestsUtil.synchronizationWithUIThread();
-
+
assertEquals("Session should not be dirty.", SessionStatus.SYNC, session.getStatus());
-
- checkBounds(REGION_CONTAINER_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 831, 247));
+
+ checkBounds(FIRST_REGION_CONTAINER_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 831, 247));
checkBounds(LEFT_CLASS_NAME, new Rectangle(0, 0, 165, 211), new Rectangle(0, 0, 165, 211));
checkBounds(CENTER_CLASS_NAME, new Rectangle(165, 0, 136, 211), new Rectangle(165, 0, 136, 211));
checkBounds(RIGHT_CLASS_NAME, new Rectangle(301, 0, 130, 211), new Rectangle(301, 0, 130, 211));
@@ -225,8 +225,8 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
TestsUtil.synchronizationWithUIThread();
assertEquals("Session should not be dirty.", SessionStatus.SYNC, session.getStatus());
-
- checkBounds(REGION_CONTAINER_NAME, new Rectangle(64, 16, -1, -1), new Rectangle(64, 16, 141, 414));
+
+ checkBounds(FIRST_REGION_CONTAINER_NAME, new Rectangle(64, 16, -1, -1), new Rectangle(64, 16, 141, 414));
checkBounds(LEFT_CLASS_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 129, 91));
checkBounds(CENTER_CLASS_NAME, new Rectangle(0, 91, -1, -1), new Rectangle(0, 91, 129, 92));
checkBounds(RIGHT_CLASS_NAME, new Rectangle(0, 183, -1, -1), new Rectangle(0, 183, 129, 44));
@@ -277,7 +277,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
private void doTestInitialLayout(ContainerLayout stackDirection, int regionContainerBorderSize, int regionContainerCorners, int regionBorderSize) {
int regionCorners = 0;
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -333,10 +333,10 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
private void doTestBorderChanges(ContainerLayout stackDirection, int regionContainerBorderSize, int regionContainerCorners, int regionBorderSize) {
int regionCorners = 0;
- changeBorderSpecification(REGION_CONTAINER_NAME, 10, LineStyle.DASH_DOT_LITERAL);
+ changeBorderSpecification(FIRST_REGION_CONTAINER_NAME, 10, LineStyle.DASH_DOT_LITERAL);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, 10, LineStyle.DASH_DOT_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, 10, LineStyle.DASH_DOT_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -344,12 +344,12 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
checkRegion(CENTER_PKG_NAME, 4, regionBorderSize, LineStyle.DASH_DOT_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_PKG_NAME, 5, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getLastRegionExpectedSpecificCorners(stackDirection));
- changeBorderSpecification(REGION_CONTAINER_NAME, 10, LineStyle.DOT_LITERAL);
+ changeBorderSpecification(FIRST_REGION_CONTAINER_NAME, 10, LineStyle.DOT_LITERAL);
changeBorderSpecification(CENTER_CLASS_NAME, 10, LineStyle.DASH_DOT_LITERAL);
changeBorderSpecification(RIGHT_PKG_NAME, 10, LineStyle.DASH_DOT_LITERAL);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, 10, LineStyle.DOT_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, 10, LineStyle.DOT_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(CENTER_CLASS_NAME, 1, 10, LineStyle.DASH_DOT_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -357,12 +357,12 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
checkRegion(CENTER_PKG_NAME, 4, regionBorderSize, LineStyle.DASH_DOT_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_PKG_NAME, 5, 10, LineStyle.DASH_DOT_LITERAL, regionCorners, regionContainerCorners, getLastRegionExpectedSpecificCorners(stackDirection));
- changeBorderSpecification(REGION_CONTAINER_NAME, 0, LineStyle.SOLID_LITERAL);
+ changeBorderSpecification(FIRST_REGION_CONTAINER_NAME, 0, LineStyle.SOLID_LITERAL);
changeBorderSpecification(CENTER_CLASS_NAME, 0, LineStyle.SOLID_LITERAL);
changeBorderSpecification(RIGHT_PKG_NAME, 0, LineStyle.SOLID_LITERAL);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, 0, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, 0, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(CENTER_CLASS_NAME, 1, 0, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -403,7 +403,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
// tested in initial layout tests.
// Step 1: no rounded corner at all: no overlap
- changeCornerSpecification(REGION_CONTAINER_NAME, false, regionContainerCorners);
+ changeCornerSpecification(FIRST_REGION_CONTAINER_NAME, false, regionContainerCorners);
changeCornerSpecification(LEFT_CLASS_NAME, false, regionCorners);
changeCornerSpecification(CENTER_CLASS_NAME, false, regionCorners);
changeCornerSpecification(RIGHT_CLASS_NAME, false, regionCorners);
@@ -412,7 +412,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
changeCornerSpecification(RIGHT_PKG_NAME, false, regionCorners);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -430,7 +430,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
changeCornerSpecification(RIGHT_PKG_NAME, true, regionCorners);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -442,10 +442,10 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
// pix): first/last region should not overlap the region container
// corners.
regionContainerCorners = 20;
- changeCornerSpecification(REGION_CONTAINER_NAME, true, regionContainerCorners);
+ changeCornerSpecification(FIRST_REGION_CONTAINER_NAME, true, regionContainerCorners);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -457,7 +457,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
// pix): no specific corner
regionContainerCorners = 10;
regionCorners = 20;
- changeCornerSpecification(REGION_CONTAINER_NAME, true, regionContainerCorners);
+ changeCornerSpecification(FIRST_REGION_CONTAINER_NAME, true, regionContainerCorners);
changeCornerSpecification(LEFT_CLASS_NAME, true, regionCorners);
changeCornerSpecification(CENTER_CLASS_NAME, true, regionCorners);
changeCornerSpecification(RIGHT_CLASS_NAME, true, regionCorners);
@@ -466,7 +466,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
changeCornerSpecification(RIGHT_PKG_NAME, true, regionCorners);
TestsUtil.synchronizationWithUIThread();
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(CENTER_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -499,7 +499,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
private void doTestContentPanes(ContainerLayout verticalStack) {
// Step 1: no rounded corner at all : no overlap
- checkContentPanes(REGION_CONTAINER_NAME, true, true);
+ checkContentPanes(FIRST_REGION_CONTAINER_NAME, true, true);
checkContentPanes(LEFT_CLASS_NAME, true, true);
checkContentPanes(CENTER_CLASS_NAME, true, false);
checkContentPanes(LEFT_PKG_NAME, false, false);
@@ -519,7 +519,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
changeElementName(CENTER_PKG_NAME, newPkg4Name);
TestsUtil.synchronizationWithUIThread();
- checkContentPanes(REGION_CONTAINER_NAME, true, true);
+ checkContentPanes(FIRST_REGION_CONTAINER_NAME, true, true);
checkContentPanes(newClass1Name, true, false);
checkContentPanes(newClass2Name, true, true);
checkContentPanes(newPkg3Name, true, true);
@@ -541,7 +541,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
doTestReorderedLayout(ContainerLayout.HORIZONTAL_STACK, 4, 20, 2);
- checkBounds(REGION_CONTAINER_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 831, 247));
+ checkBounds(FIRST_REGION_CONTAINER_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 831, 247));
checkBounds(LEFT_CLASS_NAME, new Rectangle(136, 0, 165, 211), new Rectangle(136, 0, 165, 211));
checkBounds(CENTER_CLASS_NAME, new Rectangle(0, 0, 136, 211), new Rectangle(0, 0, 136, 211));
checkBounds(RIGHT_CLASS_NAME, new Rectangle(301, 0, 130, 211), new Rectangle(301, 0, 130, 211));
@@ -565,7 +565,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
doTestReorderedLayout(ContainerLayout.VERTICAL_STACK, 5, 10, 1);
- checkBounds(REGION_CONTAINER_NAME, new Rectangle(64, 16, -1, -1), new Rectangle(64, 16, 141, 414));
+ checkBounds(FIRST_REGION_CONTAINER_NAME, new Rectangle(64, 16, -1, -1), new Rectangle(64, 16, 141, 414));
checkBounds(LEFT_CLASS_NAME, new Rectangle(0, 92, -1, -1), new Rectangle(0, 91, 129, 92));
checkBounds(CENTER_CLASS_NAME, new Rectangle(0, 0, -1, -1), new Rectangle(0, 0, 129, 91));
checkBounds(RIGHT_CLASS_NAME, new Rectangle(0, 183, -1, -1), new Rectangle(0, 183, 129, 44));
@@ -592,7 +592,7 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
private void doTestReorderedLayout(ContainerLayout stackDirection, int regionContainerBorderSize, int regionContainerCorners, int regionBorderSize) {
int regionCorners = 0;
- checkRegionContainer(REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
+ checkRegionContainer(FIRST_REGION_CONTAINER_NAME, regionContainerBorderSize, LineStyle.SOLID_LITERAL, regionContainerCorners);
checkRegion(LEFT_CLASS_NAME, 1, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners);
checkRegion(CENTER_CLASS_NAME, 0, regionBorderSize, LineStyle.SOLID_LITERAL, regionCorners, regionContainerCorners, getFirstRegionExpectedSpecificCorners(stackDirection));
checkRegion(RIGHT_CLASS_NAME, 2, regionBorderSize, LineStyle.DASH_LITERAL, regionCorners, regionContainerCorners);
@@ -744,8 +744,8 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
AbstractDiagramElementContainerEditPart editPart = (AbstractDiagramElementContainerEditPart) getEditPart(region);
View notationView = editPart.getNotationView();
- assertEquals("The " + label + " notation view index does not correspond to expected order (mapping order and semantic candidates order).", expectedIndex, ((View) notationView.eContainer())
- .getChildren().indexOf(notationView));
+ assertEquals("The " + label + " notation view index does not correspond to expected order (mapping order and semantic candidates order).", expectedIndex,
+ ((View) notationView.eContainer()).getChildren().indexOf(notationView));
assertEquals("The " + label + " edit part index does not correspond to model order (mapping order and semantic candidates order).", expectedIndex,
editPart.getParent().getChildren().indexOf(editPart));
@@ -768,8 +768,8 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
if (PositionConstants.NONE == parentStackDirection) {
// RegionContainer case
assertTrue(ddec.getName() + " is not a region, its primary shape should have a MarginBorder border.", primaryShapeBorder.getClass() == MarginBorder.class);
- assertEquals("Wrong insets detected for " + ddec.getName() + " non-region primary shape.", new Insets(5 + expectedBorderSize - 1, expectedBorderSize, expectedBorderSize,
- expectedBorderSize), primaryShape.getInsets());
+ assertEquals("Wrong insets detected for " + ddec.getName() + " non-region primary shape.",
+ new Insets(5 + expectedBorderSize - 1, expectedBorderSize, expectedBorderSize, expectedBorderSize), primaryShape.getInsets());
checkShapeLineStyle(ddec, primaryShape, expectedBorderSize, expectedBorderStyle, true);
} else {
checkShapeLineStyle(ddec, primaryShape, expectedBorderSize, expectedBorderStyle, false);
@@ -804,8 +804,8 @@ public class CompartmentsLayoutTest extends SiriusDiagramTestCase implements ICo
Shape shape = (Shape) primaryShape;
assertEquals("Wrong line width for " + ddec.getName(), expectedBorderSize, shape.getLineWidth());
assertEquals("Wrong line style for " + ddec.getName(), getSwtLineStyle(expectedBorderStyle), shape.getLineStyle());
- assertEquals("Wrong outline shape mode for " + ddec.getName(), expectedBorderSize != 0 && regionContainer, ((Boolean) ReflectionHelper.getFieldValueWithoutException(shape, "outline")
- .get()).booleanValue());
+ assertEquals("Wrong outline shape mode for " + ddec.getName(), expectedBorderSize != 0 && regionContainer,
+ ((Boolean) ReflectionHelper.getFieldValueWithoutException(shape, "outline").get()).booleanValue());
} else if (primaryShape instanceof NodeFigure) {
fail("Needs to be completed");
}
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsTest.java
index 90e10271db..1112d4a749 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsTest.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/CompartmentsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2016 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -79,7 +79,7 @@ public class CompartmentsTest extends SiriusDiagramTestCase implements ICompartm
}
private void doTestStackDetection(ContainerLayout stackDirection) {
- checkQueries(REGION_CONTAINER_NAME, true, false, stackDirection, false);
+ checkQueries(FIRST_REGION_CONTAINER_NAME, true, false, stackDirection, false);
checkQueries(LEFT_CLASS_NAME, false, true, stackDirection, true);
checkQueries(CENTER_CLASS_NAME, false, true, stackDirection, true);
checkQueries(RIGHT_CLASS_NAME, false, true, stackDirection, true);
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/ICompartmentTests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/ICompartmentTests.java
index 1058e67a35..31ab1804b9 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/ICompartmentTests.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/compartment/ICompartmentTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2016 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,7 +50,9 @@ public interface ICompartmentTests {
public static final String ATTRIBUTE_CREATION_TOOL_NAME = "EAttribute";
- public static final String REGION_CONTAINER_NAME = "P1";
+ public static final String FIRST_REGION_CONTAINER_NAME = "P1";
+
+ public static final String SECOND_REGION_CONTAINER_NAME = "az";
public static final String NEW_REGION_CONTAINER_NAME = "p3";
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
index fca95df97f..807da88bfd 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Obeo.
+ * Copyright (c) 2015, 2016 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,35 @@
*******************************************************************************/
package org.eclipse.sirius.tests.swtbot.compartment;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
+import org.eclipse.gmf.runtime.notation.LayoutConstraint;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.Size;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.sirius.business.api.session.SessionStatus;
+import org.eclipse.sirius.common.tools.internal.resource.ResourceSyncClientNotifier;
import org.eclipse.sirius.diagram.ContainerLayout;
import org.eclipse.sirius.diagram.DDiagramElementContainer;
import org.eclipse.sirius.diagram.DNodeContainer;
@@ -22,9 +46,14 @@ import org.eclipse.sirius.diagram.DNodeList;
import org.eclipse.sirius.diagram.description.ContainerMapping;
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramElementContainerEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramNodeEditPart;
+import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramContainerEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart;
+import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramListEditPart;
import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeListElementEditPart;
+import org.eclipse.sirius.ecore.extender.tool.api.ModelUtils;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.ui.PlatformUI;
/**
* Tests defined to ensure that elements are created in compartments and regions
@@ -53,44 +82,44 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private void childrenPresentationTest(String representationName, String representationInstanceName, ContainerLayout initialContainerLayout) {
openRepresentation(representationName, representationInstanceName);
-
- ContainerMapping rcMapping = getActualMapping(REGION_CONTAINER_NAME);
- checkChildrenPresentation(REGION_CONTAINER_NAME, rcMapping, initialContainerLayout);
-
+
+ ContainerMapping rcMapping = getActualMapping(FIRST_REGION_CONTAINER_NAME);
+ checkChildrenPresentation(FIRST_REGION_CONTAINER_NAME, rcMapping, initialContainerLayout);
+
ContainerMapping listRegionMapping = getActualMapping(LEFT_CLASS_NAME);
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
-
+
ContainerMapping freeFormRegionMapping = getActualMapping(LEFT_PKG_NAME);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
-
+
// Change list region presentation to free form
changeChildrenPresentation(listRegionMapping, ContainerLayout.FREE_FORM);
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.FREE_FORM);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
-
+
undo(localSession.getOpenedSession());
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
-
+
// Change free form region presentation to list
changeChildrenPresentation(freeFormRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.LIST);
-
+
undo(localSession.getOpenedSession());
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
-
+
// Change region container children presentation from VStack to HStack
// or from HStack to VStack
ContainerLayout newRCPresentation = initialContainerLayout == ContainerLayout.VERTICAL_STACK ? ContainerLayout.HORIZONTAL_STACK : ContainerLayout.VERTICAL_STACK;
changeChildrenPresentation(rcMapping, newRCPresentation);
- checkChildrenPresentation(REGION_CONTAINER_NAME, rcMapping, newRCPresentation);
+ checkChildrenPresentation(FIRST_REGION_CONTAINER_NAME, rcMapping, newRCPresentation);
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
-
+
undo(localSession.getOpenedSession());
- checkChildrenPresentation(REGION_CONTAINER_NAME, rcMapping, initialContainerLayout);
+ checkChildrenPresentation(FIRST_REGION_CONTAINER_NAME, rcMapping, initialContainerLayout);
checkChildrenPresentation(LEFT_CLASS_NAME, listRegionMapping, ContainerLayout.LIST);
checkChildrenPresentation(LEFT_PKG_NAME, freeFormRegionMapping, ContainerLayout.FREE_FORM);
}
@@ -113,8 +142,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private void doTestContainerListCreation(String representationName, String representationInstanceName) {
openRepresentation(representationName, representationInstanceName);
- createElement(CLASS_LIST_CREATION_TOOL_NAME, REGION_CONTAINER_NAME);
- checkElement(NEW_CLASS_LIST_4_NAME, REGION_CONTAINER_NAME, CLASS_LIST_CREATION_TOOL_NAME);
+ createElement(CLASS_LIST_CREATION_TOOL_NAME, FIRST_REGION_CONTAINER_NAME);
+ checkElement(NEW_CLASS_LIST_4_NAME, FIRST_REGION_CONTAINER_NAME, CLASS_LIST_CREATION_TOOL_NAME);
}
/**
@@ -130,7 +159,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
* created.
*/
public void testCompartmentCreationInVerticalStack() {
- compartmentCreationTest(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 200));
+ compartmentCreationTest(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 300));
}
private void compartmentCreationTest(String representationName, String representationInstanceName, Point regionContainerLocation) {
@@ -322,4 +351,145 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
});
}
+ /**
+ * Test that the refresh of a diagram caused by an external change (and that
+ * creates a new regions container) does not impact existing regions
+ * container (no layout of them).
+ *
+ * @throws Exception
+ * In case of problem during semantic modification outside the
+ * editor.
+ */
+ public void testCreationOfNewHorizontalRegionContainerOutsideEditor() throws Exception {
+ openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
+
+ assertEquals("Session should not be dirty.", SessionStatus.SYNC, localSession.getOpenedSession().getStatus());
+
+ // Check that the existing container is as expected
+ checkBounds(SECOND_REGION_CONTAINER_NAME, new Rectangle(940, 125, -1, -1), new Rectangle(940, 125, 233, 258));
+
+ // Create a new ePackage (that causes creation of new region container
+ // region at refresh) outside of the current session (as from an
+ // external editor).
+ modifySemanticModelOutsideDiagram();
+
+ // Check that the existing container has not changed
+ checkBounds(SECOND_REGION_CONTAINER_NAME, new Rectangle(940, 125, -1, -1), new Rectangle(940, 125, 233, 258));
+ }
+
+ /**
+ * Test that the refresh of a diagram caused by an external change (and that
+ * creates a new regions container) does not impact existing regions
+ * container (no layout of them).
+ *
+ * @throws Exception
+ * In case of problem during semantic modification outside the
+ * editor.
+ */
+ public void testCreationOfNewVerticalRegionContainerOutsideEditor() throws Exception {
+ openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
+
+ assertEquals("Session should not be dirty.", SessionStatus.SYNC, localSession.getOpenedSession().getStatus());
+
+ // Check that the existing region is as expected
+ checkBounds("aaa", new Rectangle(0, 80, 154, 40), new Rectangle(0, 80, 154, 40));
+
+ // Create a new ePackage (that causes creation of new region container
+ // region at refresh) outside of the current session (as from an
+ // external editor).
+ modifySemanticModelOutsideDiagram();
+
+ // Check that the existing container has not changed (or at least one of
+ // its region in current case)
+ checkBounds("aaa", new Rectangle(0, 80, 154, 40), new Rectangle(0, 80, 154, 40));
+ }
+
+ private void checkSize(String label, Dimension expectedGmfSize, Dimension expectedFigureSize) {
+ checkBounds(label, new Rectangle(0, 0, expectedGmfSize.width(), expectedGmfSize.height()), new Rectangle(0, 0, expectedFigureSize.width(), expectedFigureSize.height()), true);
+ }
+
+ private void checkBounds(String label, Rectangle expectedGmfBounds, Rectangle expectedFigureBounds) {
+ checkBounds(label, expectedGmfBounds, expectedFigureBounds, false);
+ }
+
+ private void checkBounds(String label, Rectangle expectedGmfBounds, Rectangle expectedFigureBounds, boolean onlyCheckSize) {
+ SWTBotGefEditPart swtBotEditPart = editor.getEditPart(label, AbstractDiagramElementContainerEditPart.class);
+ AbstractDiagramElementContainerEditPart editPart = (AbstractDiagramElementContainerEditPart) swtBotEditPart.part();
+
+ IFigure mainFigure = editPart.getMainFigure();
+
+ if (onlyCheckSize) {
+ assertEquals("Wrong GMF size for " + label, expectedGmfBounds.getSize(), getBounds((Node) editPart.getNotationView()).getSize());
+ assertEquals("Wrong Draw2D size for " + label, expectedFigureBounds.getSize(), mainFigure.getBounds().getSize());
+ } else {
+ assertEquals("Wrong GMF bounds for " + label, expectedGmfBounds, getBounds((Node) editPart.getNotationView()));
+ assertEquals("Wrong Draw2D bounds for " + label, expectedFigureBounds, mainFigure.getBounds());
+ }
+
+ ResizableCompartmentEditPart compartmentEditPart = (ResizableCompartmentEditPart) editPart.getChildren().get(1);
+ Border border = compartmentEditPart.getContentPane().getBorder();
+
+ if (editPart instanceof IDiagramListEditPart) {
+ assertEquals("Wrong border margin for " + label, new Insets(0, 4, editPart.isRegion() ? 0 : 1, 4), border.getInsets(null));
+ } else if (editPart instanceof IDiagramContainerEditPart) {
+ assertNull("Wrong border for " + label + ": the BorderItemsAwareFreeFormLayer used as content pane of a freeform region should not have a border.", border);
+ }
+ }
+
+ private Rectangle getBounds(Node notationView) {
+ Rectangle bounds = new Rectangle();
+ LayoutConstraint layoutConstraint = notationView.getLayoutConstraint();
+ if (layoutConstraint instanceof Location) {
+ Location location = (Location) layoutConstraint;
+ bounds.setLocation(location.getX(), location.getY());
+ }
+ if (layoutConstraint instanceof Size) {
+ Size size = (Size) layoutConstraint;
+ bounds.setSize(size.getWidth(), size.getHeight());
+ }
+ return bounds;
+ }
+
+ /**
+ * Add a new package p3 in the root package. The modification is not made in
+ * the same resourceSet, as if this modification is made in another editor
+ * not in Sirius.
+ */
+ private void modifySemanticModelOutsideDiagram() throws Exception {
+ // Load the semantic resource in another resource set, delete the
+ // elements and save the resource.
+ TransactionalEditingDomain domain = new TransactionalEditingDomainImpl(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ ResourceSet set = domain.getResourceSet();
+ try {
+ final EPackage ePackageInAnotherResourceSet = (EPackage) ModelUtils.load(localSession.getOpenedSession().getSemanticResources().iterator().next().getURI(), set);
+ assertFalse("The editing domain of each root semantic must be different.", domain.equals(localSession.getOpenedSession().getTransactionalEditingDomain()));
+
+ domain.getCommandStack().execute(new RecordingCommand(domain, "Add new package") {
+
+ @Override
+ protected void doExecute() {
+ // Remove the package subRoot
+ EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ ePackage.setName(NEW_REGION_CONTAINER_NAME);
+ ePackageInAnotherResourceSet.getESubpackages().add(ePackage);
+ }
+ });
+ ePackageInAnotherResourceSet.eResource().save(Collections.EMPTY_MAP);
+ } catch (IOException e) {
+ fail("Pb when saving the resource in another resourceSet : " + e.getMessage());
+ }
+ // Wait job ResourceSyncClientNotifier to ensure the session has been
+ // reloaded.
+ if (Display.getCurrent() != null) {
+ PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
+
+ @Override
+ public void run(IProgressMonitor monitor) throws InterruptedException {
+ Job.getJobManager().join(ResourceSyncClientNotifier.FAMILY, monitor);
+ }
+ });
+ } else {
+ Job.getJobManager().join(ResourceSyncClientNotifier.FAMILY, new NullProgressMonitor());
+ }
+ }
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
index 5fcf4c16a8..d774d256af 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
@@ -140,6 +140,7 @@ public class AllTestSuite extends TestCase {
suite.addTestSuite(ShowTypeActionButtonTest.class);
suite.addTestSuite(SpecificClosedOrNotClosedEditorTest.class);
suite.addTestSuite(LineStyleTest.class);
+ suite.addTestSuite(CompartmentsCreationTest.class);
}
/**
@@ -278,7 +279,6 @@ public class AllTestSuite extends TestCase {
suite.addTestSuite(EdgeMappingTestCase.class);
suite.addTestSuite(InvalidMetamodelRessourceTest.class);
suite.addTestSuite(ExtensionActivationOrderTest.class);
- suite.addTestSuite(CompartmentsCreationTest.class);
}
/**

Back to the top