diff options
| author | Pierre Guilet | 2018-11-20 15:46:52 +0000 |
|---|---|---|
| committer | Pierre Guilet | 2018-12-03 13:35:03 +0000 |
| commit | 49bdddb2c91f5b55c345bdcea03a69599b8f0cb1 (patch) | |
| tree | dac41b6e43c853c997b7ff90337de8e2b79b2478 | |
| parent | 714cc1e8d975c860fe28468b5f6e093e3cda8afc (diff) | |
| download | org.eclipse.sirius-49bdddb2c91f5b55c345bdcea03a69599b8f0cb1.tar.gz org.eclipse.sirius-49bdddb2c91f5b55c345bdcea03a69599b8f0cb1.tar.xz org.eclipse.sirius-49bdddb2c91f5b55c345bdcea03a69599b8f0cb1.zip | |
[498260] Fix wrapped label not aligned regarding the VSM configuration
Wrapped labels now correctly take in consideration the label alignement
specified in the VSM for each mapping.
Bug: 498260
Change-Id: If7c77cf0e193704928eaafc7710b1cb1cf1ad295
Signed-off-by: Pierre Guilet <pierre.guilet@obeo.fr>
4 files changed, 242 insertions, 195 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java index 9cc604a98b..9cdced7bfd 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2018 THALES GLOBAL SERVICES and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -646,6 +646,8 @@ public final class DiagramElementEditPartOperation { SiriusWrapLabel nodeLabel = ((ViewNodeFigure) figure).getNodeLabel(); if (nodeLabel != null) { nodeLabel.setLabelAlignment(LabelAlignmentHelper.getAsPositionConstant(alignment)); + nodeLabel.setTextAlignment(LabelAlignmentHelper.getAsPositionConstant(alignment)); + nodeLabel.setTextWrapAlignment(LabelAlignmentHelper.getAsPositionConstant(alignment)); } } else if (figure != null) { LayoutManager layoutManager = figure.getLayoutManager(); diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/2321.odesign b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/2321.odesign index 8d8391a87a..e9f36d4c01 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/2321.odesign +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/2321.odesign @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="ASCII"?> -<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" version="10.1.3.201511131800"> +<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" version="12.0.0.2017041100"> <ownedViewpoints name="tc-2321" modelFileExtension="ecore"> <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Diag-2321" domainClass="EPackage"> - <nodeMappings name="NodePackageBorder" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages" domainClass="EPackage"> - <style xsi:type="style:GaugeCompositeStyleDescription" labelExpression="aql:self.name + 'Border'" resizeKind="NSEW"> + <nodeMappings name="NodePackageBorder" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages->select( p | p.name.equalsIgnoreCase('SubPackage1'))" domainClass="EPackage"> + <style xsi:type="style:GaugeCompositeStyleDescription" labelExpression="aql:self.name + 'Border'" labelAlignment="LEFT" 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']"/> <sections maxValueExpression="12" valueExpression="aql:self.eSubpackages->size()"> @@ -16,7 +16,35 @@ </sections> </style> </nodeMappings> - <nodeMappings name="NodePackageNode" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages" domainClass="EPackage"> + <nodeMappings name="NodePackageNode" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages->select( p | p.name.equalsIgnoreCase('SubPackage1'))" domainClass="EPackage"> + <style xsi:type="style:GaugeCompositeStyleDescription" labelAlignment="LEFT" 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']"/> + <sections maxValueExpression="12" valueExpression="aql:self.eSubpackages->size()"> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='green']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/> + </sections> + <sections maxValueExpression="3" valueExpression="aql:self.eSubpackages->size()"> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='orange']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_orange']"/> + </sections> + </style> + </nodeMappings> + <nodeMappings name="NodePackageNode2" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages->select( p | p.name.equalsIgnoreCase('SubPackage2'))" domainClass="EPackage"> + <style xsi:type="style:GaugeCompositeStyleDescription" labelAlignment="RIGHT" 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']"/> + <sections maxValueExpression="12" valueExpression="aql:self.eSubpackages->size()"> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='green']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_green']"/> + </sections> + <sections maxValueExpression="3" valueExpression="aql:self.eSubpackages->size()"> + <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='orange']"/> + <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_orange']"/> + </sections> + </style> + </nodeMappings> + <nodeMappings name="NodePackageNode3" semanticCandidatesExpression="aql:self.oclAsType(ecore::EPackage).eSubpackages->select( p | p.name.equalsIgnoreCase('SubPackage3'))" domainClass="EPackage"> <style xsi:type="style:GaugeCompositeStyleDescription" 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']"/> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/testcase.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/testcase.aird index 5db1c21c1f..f28dc17b14 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/testcase.aird +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/labelPosition/testcase.aird @@ -1,182 +1,116 @@ <?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/1.1.0#//diagram/description http://www.eclipse.org/sirius/diagram/1.1.0 http://www.eclipse.org/sirius/1.1.0#//diagram http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/1.1.0#//diagram/description/style" xmi:id="_iRhg0MCkEd-8Qc9BypkSiw" selectedViews="_lPXK8MCkEd-8Qc9BypkSiw" version="8.0.0"> - <models xmi:type="ecore:EPackage" href="testcase.ecore#/"/> - <ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_lPXK8MCkEd-8Qc9BypkSiw" initialized="true"> - <ownedRepresentations xmi:type="diagram:DSemanticDiagram" xmi:id="_wcj6QMoHEd-XYrtXpovRWQ" name="new Diag-2321"> - <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_wduX4MoHEd-XYrtXpovRWQ" source="GMF_DIAGRAMS"> - <data xmi:type="notation:Diagram" xmi:id="_wduX4coHEd-XYrtXpovRWQ" type="Sirius" element="_wcj6QMoHEd-XYrtXpovRWQ" measurementUnit="Pixel"> - <children xmi:type="notation:Node" xmi:id="_xkS-YMoHEd-XYrtXpovRWQ" type="2001" element="_xeDzgMoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xkl5UMoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xkl5UcoHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xn0McMoHEd-XYrtXpovRWQ" type="3006" element="_xfNqEMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xn0MccoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xn0McsoHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xkS-YcoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkS-YsoHEd-XYrtXpovRWQ" x="96" y="180" width="61" height="81"/> +<xmi:XMI 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"> + <viewpoint:DAnalysis uid="_iRhg0MCkEd-8Qc9BypkSiw" selectedViews="_lPXK8MCkEd-8Qc9BypkSiw" version="14.1.0.201810161215"> + <semanticResources>testcase.ecore</semanticResources> + <ownedViews xmi:type="viewpoint:DView" uid="_lPXK8MCkEd-8Qc9BypkSiw"> + <viewpoint xmi:type="description:Viewpoint" href="2321.odesign#//@ownedViewpoints[name='tc-2321']"/> + <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_NKduAO43Eei5p_6Fkc_TEQ" name="new Diag-2321" repPath="#_wcj6QMoHEd-XYrtXpovRWQ"> + <description xmi:type="description_1:DiagramDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']"/> + <target xmi:type="ecore:EPackage" href="testcase.ecore#/"/> + </ownedRepresentationDescriptors> + </ownedViews> + </viewpoint:DAnalysis> + <diagram:DSemanticDiagram uid="_wcj6QMoHEd-XYrtXpovRWQ" name="new Diag-2321"> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_wduX4MoHEd-XYrtXpovRWQ" source="GMF_DIAGRAMS"> + <data xmi:type="notation:Diagram" xmi:id="_wduX4coHEd-XYrtXpovRWQ" type="Sirius" element="_wcj6QMoHEd-XYrtXpovRWQ" measurementUnit="Pixel"> + <children xmi:type="notation:Node" xmi:id="_xkS-YMoHEd-XYrtXpovRWQ" type="2001" element="_xeDzgMoHEd-XYrtXpovRWQ"> + <children xmi:type="notation:Node" xmi:id="_xkl5UMoHEd-XYrtXpovRWQ" type="5002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_xkl5UcoHEd-XYrtXpovRWQ" y="5"/> </children> - <children xmi:type="notation:Node" xmi:id="_xknHcMoHEd-XYrtXpovRWQ" type="2001" element="_xgk8AMoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xkoVkMoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xkoVkcoHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xo05EMoHEd-XYrtXpovRWQ" type="3006" element="_xgmKIMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xo05EcoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xo05EsoHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xknHccoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xknHcsoHEd-XYrtXpovRWQ" x="280" y="40" width="61" height="81"/> + <children xmi:type="notation:Node" xmi:id="_xn0McMoHEd-XYrtXpovRWQ" type="3006" element="_xfNqEMoHEd-XYrtXpovRWQ"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_xn0MccoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xn0McsoHEd-XYrtXpovRWQ"/> </children> - <children xmi:type="notation:Node" xmi:id="_xkpjsMoHEd-XYrtXpovRWQ" type="2001" element="_xgpNcMoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xkqx0MoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xkqx0coHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xpQ98MoHEd-XYrtXpovRWQ" type="3006" element="_xgrCoMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xpQ98coHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xpQ98soHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xkpjscoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkpjssoHEd-XYrtXpovRWQ" x="500" y="40" width="61" height="81"/> + <styles xmi:type="notation:ShapeStyle" xmi:id="_xkS-YcoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkS-YsoHEd-XYrtXpovRWQ" x="96" y="180" width="61" height="81"/> + </children> + <children xmi:type="notation:Node" xmi:id="_xkrY4MoHEd-XYrtXpovRWQ" type="2001" element="_xgv7IMoHEd-XYrtXpovRWQ"> + <children xmi:type="notation:Node" xmi:id="_xksnAMoHEd-XYrtXpovRWQ" type="5002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_xktOEMoHEd-XYrtXpovRWQ" y="5"/> </children> - <children xmi:type="notation:Node" xmi:id="_xkrY4MoHEd-XYrtXpovRWQ" type="2001" element="_xgv7IMoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xksnAMoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xktOEMoHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xpx7UMoHEd-XYrtXpovRWQ" type="3006" element="_xgwiMMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xpx7UcoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xpx7UsoHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xkrY4coHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkrY4soHEd-XYrtXpovRWQ" x="20" y="20" width="61" height="81"/> + <children xmi:type="notation:Node" xmi:id="_xpx7UMoHEd-XYrtXpovRWQ" type="3006" element="_xgwiMMoHEd-XYrtXpovRWQ"> + <styles xmi:type="notation:ShapeStyle" xmi:id="_xpx7UcoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xpx7UsoHEd-XYrtXpovRWQ"/> </children> - <children xmi:type="notation:Node" xmi:id="_xkt1IMoHEd-XYrtXpovRWQ" type="2001" element="_xgxJRsoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xkvDQMoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xkvDQcoHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xqiJQMoHEd-XYrtXpovRWQ" type="3006" element="_xgxwUMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xqiJQcoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xqiJQsoHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xkt1IcoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkt1IsoHEd-XYrtXpovRWQ" x="280" y="180" width="61" height="81"/> + <styles xmi:type="notation:ShapeStyle" xmi:id="_xkrY4coHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkrY4soHEd-XYrtXpovRWQ" x="20" y="20" width="91" height="111"/> + </children> + <children xmi:type="notation:Node" xmi:id="__tIM4O47EeigWu1oOdJZiw" type="2001" element="__s-b4O47EeigWu1oOdJZiw"> + <children xmi:type="notation:Node" xmi:id="__tJbAO47EeigWu1oOdJZiw" type="5002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="__tJbAe47EeigWu1oOdJZiw" y="5"/> </children> - <children xmi:type="notation:Node" xmi:id="_xkvqUMoHEd-XYrtXpovRWQ" type="2001" element="_xgyXZsoHEd-XYrtXpovRWQ"> - <children xmi:type="notation:Node" xmi:id="_xkxfgMoHEd-XYrtXpovRWQ" type="5002"> - <layoutConstraint xmi:type="notation:Location" xmi:id="_xkxfgcoHEd-XYrtXpovRWQ" y="5"/> - </children> - <children xmi:type="notation:Node" xmi:id="_xq9AAMoHEd-XYrtXpovRWQ" type="3006" element="_xgy-cMoHEd-XYrtXpovRWQ"> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xq9AAcoHEd-XYrtXpovRWQ" fontName="Sans" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xq9AAsoHEd-XYrtXpovRWQ"/> - </children> - <styles xmi:type="notation:ShapeStyle" xmi:id="_xkvqUcoHEd-XYrtXpovRWQ" fontName="Sans" fontHeight="8" fillColor="2631912"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xkvqUsoHEd-XYrtXpovRWQ" x="500" y="180" width="61" height="81"/> + <children xmi:type="notation:Node" xmi:id="__tKCEu47EeigWu1oOdJZiw" type="3006" element="__s-b4e47EeigWu1oOdJZiw"> + <styles xmi:type="notation:ShapeStyle" xmi:id="__tKCE-47EeigWu1oOdJZiw" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__tKCFO47EeigWu1oOdJZiw"/> </children> - <styles xmi:type="notation:DiagramStyle" xmi:id="_wduX4soHEd-XYrtXpovRWQ"/> - </data> - </ownedAnnotationEntries> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xeDzgMoHEd-XYrtXpovRWQ" name="SubPackage1" width="3" height="3" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xfNqEMoHEd-XYrtXpovRWQ"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xfVl4MoHEd-XYrtXpovRWQ" min="0" max="12" value="3"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xfVl4coHEd-XYrtXpovRWQ" red="114" green="159" blue="207"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xfVl4soHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xfVl48oHEd-XYrtXpovRWQ" min="0" max="3" value="3"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xfVl5MoHEd-XYrtXpovRWQ" red="233" green="185" blue="110"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xfVl5coHEd-XYrtXpovRWQ" red="252" green="233" blue="79"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']"/> - </ownedDiagramElements> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xgk8AMoHEd-XYrtXpovRWQ" name="SubPackage2" width="3" height="3" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xgmKIMoHEd-XYrtXpovRWQ"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgomYMoHEd-XYrtXpovRWQ" min="0" max="12" value="1"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgomYcoHEd-XYrtXpovRWQ" red="114" green="159" blue="207"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgomYsoHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgomY8oHEd-XYrtXpovRWQ" min="0" max="3" value="1"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgomZMoHEd-XYrtXpovRWQ" red="233" green="185" blue="110"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgomZcoHEd-XYrtXpovRWQ" red="252" green="233" blue="79"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']"/> - </ownedDiagramElements> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xgpNcMoHEd-XYrtXpovRWQ" name="SubPackage3" width="3" height="3" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xgrCoMoHEd-XYrtXpovRWQ"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgs30MoHEd-XYrtXpovRWQ" min="0" max="12" value="0"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgs30coHEd-XYrtXpovRWQ" red="114" green="159" blue="207"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgs30soHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgs308oHEd-XYrtXpovRWQ" min="0" max="3" value="0"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgs31MoHEd-XYrtXpovRWQ" red="233" green="185" blue="110"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgs31coHEd-XYrtXpovRWQ" red="252" green="233" blue="79"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']"/> - </ownedDiagramElements> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xgv7IMoHEd-XYrtXpovRWQ" name="SubPackage1" width="3" height="3" labelPosition="node" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xgwiMMoHEd-XYrtXpovRWQ" labelPosition="node"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgxJQMoHEd-XYrtXpovRWQ" min="0" max="12" value="3"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgxJQcoHEd-XYrtXpovRWQ" red="138" green="226" blue="52"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgxJQsoHEd-XYrtXpovRWQ" red="204" green="242" blue="166"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgxJQ8oHEd-XYrtXpovRWQ" min="0" max="3" value="3"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgxJRMoHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgxJRcoHEd-XYrtXpovRWQ" red="253" green="206" blue="137"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']"/> - </ownedDiagramElements> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xgxJRsoHEd-XYrtXpovRWQ" name="SubPackage2" width="3" height="3" labelPosition="node" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xgxwUMoHEd-XYrtXpovRWQ" labelPosition="node"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgyXYMoHEd-XYrtXpovRWQ" min="0" max="12" value="1"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgyXYcoHEd-XYrtXpovRWQ" red="138" green="226" blue="52"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgyXYsoHEd-XYrtXpovRWQ" red="204" green="242" blue="166"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgyXY8oHEd-XYrtXpovRWQ" min="0" max="3" value="1"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgyXZMoHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgyXZcoHEd-XYrtXpovRWQ" red="253" green="206" blue="137"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']"/> - </ownedDiagramElements> - <ownedDiagramElements xmi:type="diagram:DNode" xmi:id="_xgyXZsoHEd-XYrtXpovRWQ" name="SubPackage3" width="3" height="3" labelPosition="node" resizeKind="NSEW"> - <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> - <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> - <ownedStyle xmi:type="diagram:GaugeCompositeStyle" xmi:id="_xgy-cMoHEd-XYrtXpovRWQ" labelPosition="node"> - <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']/@style"/> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgzlgMoHEd-XYrtXpovRWQ" min="0" max="12" value="0"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgzlgcoHEd-XYrtXpovRWQ" red="138" green="226" blue="52"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgzlgsoHEd-XYrtXpovRWQ" red="204" green="242" blue="166"/> - </sections> - <sections xmi:type="diagram:GaugeSection" xmi:id="_xgzlg8oHEd-XYrtXpovRWQ" min="0" max="3" value="0"> - <backgroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgzlhMoHEd-XYrtXpovRWQ" red="252" green="175" blue="62"/> - <foregroundColor xmi:type="viewpoint:RGBValues" xmi:id="_xgzlhcoHEd-XYrtXpovRWQ" red="253" green="206" blue="137"/> - </sections> - </ownedStyle> - <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']"/> - </ownedDiagramElements> - <description xmi:type="description_1:DiagramDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']"/> - <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_wcj6QcoHEd-XYrtXpovRWQ"/> - <target xmi:type="ecore:EPackage" href="testcase.ecore#/"/> - </ownedRepresentations> - <viewpoint xmi:type="description:Viewpoint" href="2321.odesign#//@ownedViewpoints[name='tc-2321']"/> - <diagramSet xmi:type="diagram:DDiagramSet" xmi:id="_mc58IMCkEd-8Qc9BypkSiw"> - <description xmi:type="description_1:DiagramDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']"/> - </diagramSet> - </ownedViews> -</viewpoint:DAnalysis> + <styles xmi:type="notation:ShapeStyle" xmi:id="__tIz8O47EeigWu1oOdJZiw" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__tIz8e47EeigWu1oOdJZiw" x="182" y="19" width="89" height="111"/> + </children> + <children xmi:type="notation:Node" xmi:id="__tJbAu47EeigWu1oOdJZiw" type="2001" element="__tCGQO47EeigWu1oOdJZiw"> + <children xmi:type="notation:Node" xmi:id="__tKCEO47EeigWu1oOdJZiw" type="5002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="__tKCEe47EeigWu1oOdJZiw" y="5"/> + </children> + <children xmi:type="notation:Node" xmi:id="__tKpIO47EeigWu1oOdJZiw" type="3006" element="__tCGQe47EeigWu1oOdJZiw"> + <styles xmi:type="notation:ShapeStyle" xmi:id="__tKpIe47EeigWu1oOdJZiw" fontName="Segoe UI"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__tKpIu47EeigWu1oOdJZiw"/> + </children> + <styles xmi:type="notation:ShapeStyle" xmi:id="__tJbA-47EeigWu1oOdJZiw" fontName="Segoe UI" fontHeight="8"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="__tJbBO47EeigWu1oOdJZiw" x="363" y="19" width="89" height="111"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_wduX4soHEd-XYrtXpovRWQ"/> + </data> + </ownedAnnotationEntries> + <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_NLK4oO43Eei5p_6Fkc_TEQ" source="DANNOTATION_CUSTOMIZATION_KEY"> + <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_NLN78O43Eei5p_6Fkc_TEQ"/> + </ownedAnnotationEntries> + <ownedDiagramElements xmi:type="diagram:DNode" uid="_xeDzgMoHEd-XYrtXpovRWQ" name="SubPackage1Border" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> + <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> + <ownedStyle xmi:type="diagram:GaugeCompositeStyle" uid="_xfNqEMoHEd-XYrtXpovRWQ" labelAlignment="LEFT"> + <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']/@style"/> + <sections xmi:type="diagram:GaugeSection" uid="_xfVl4MoHEd-XYrtXpovRWQ" min="0" max="12" value="3" backgroundColor="114,159,207" foregroundColor="252,175,62"/> + <sections xmi:type="diagram:GaugeSection" uid="_xfVl48oHEd-XYrtXpovRWQ" min="0" max="3" value="3" backgroundColor="233,185,110" foregroundColor="252,233,79"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageBorder']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNode" uid="_xgv7IMoHEd-XYrtXpovRWQ" name="SubPackage1" width="3" height="3" labelPosition="node" resizeKind="NSEW"> + <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> + <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage1"/> + <ownedStyle xmi:type="diagram:GaugeCompositeStyle" uid="_xgwiMMoHEd-XYrtXpovRWQ" labelAlignment="LEFT" labelPosition="node"> + <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']/@style"/> + <sections xmi:type="diagram:GaugeSection" uid="_xgxJQMoHEd-XYrtXpovRWQ" min="0" max="12" value="3" backgroundColor="138,226,52" foregroundColor="204,242,166"/> + <sections xmi:type="diagram:GaugeSection" uid="_xgxJQ8oHEd-XYrtXpovRWQ" min="0" max="3" value="3" backgroundColor="252,175,62" foregroundColor="253,206,137"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNode" uid="__s-b4O47EeigWu1oOdJZiw" name="SubPackage2" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> + <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage2"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:GaugeCompositeStyle" uid="__s-b4e47EeigWu1oOdJZiw" labelAlignment="RIGHT" labelPosition="node"> + <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode2']/@style"/> + <sections xmi:type="diagram:GaugeSection" uid="__s_C8O47EeigWu1oOdJZiw" min="0" max="12" value="1" backgroundColor="138,226,52" foregroundColor="204,242,166"/> + <sections xmi:type="diagram:GaugeSection" uid="__s_C8e47EeigWu1oOdJZiw" min="0" max="3" value="1" backgroundColor="252,175,62" foregroundColor="253,206,137"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode2']"/> + </ownedDiagramElements> + <ownedDiagramElements xmi:type="diagram:DNode" uid="__tCGQO47EeigWu1oOdJZiw" name="SubPackage3" width="3" height="3" resizeKind="NSEW"> + <target xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> + <semanticElements xmi:type="ecore:EPackage" href="testcase.ecore#//SubPackage3"/> + <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> + <arrangeConstraints>KEEP_SIZE</arrangeConstraints> + <arrangeConstraints>KEEP_RATIO</arrangeConstraints> + <ownedStyle xmi:type="diagram:GaugeCompositeStyle" uid="__tCGQe47EeigWu1oOdJZiw" labelPosition="node"> + <description xmi:type="style:GaugeCompositeStyleDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode3']/@style"/> + <sections xmi:type="diagram:GaugeSection" uid="__tCtUO47EeigWu1oOdJZiw" min="0" max="12" value="0" backgroundColor="138,226,52" foregroundColor="204,242,166"/> + <sections xmi:type="diagram:GaugeSection" uid="__tCtUe47EeigWu1oOdJZiw" min="0" max="3" value="0" backgroundColor="252,175,62" foregroundColor="253,206,137"/> + </ownedStyle> + <actualMapping xmi:type="description_1:NodeMapping" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']/@nodeMappings[name='NodePackageNode3']"/> + </ownedDiagramElements> + <description xmi:type="description_1:DiagramDescription" href="2321.odesign#//@ownedViewpoints[name='tc-2321']/@ownedRepresentations[name='Diag-2321']"/> + <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_wcj6QcoHEd-XYrtXpovRWQ"/> + <target xmi:type="ecore:EPackage" href="testcase.ecore#/"/> + </diagram:DSemanticDiagram> +</xmi:XMI> diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NodeLabelPositionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NodeLabelPositionTest.java index 8fc1133106..2d74417a77 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NodeLabelPositionTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/NodeLabelPositionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2018 THALES GLOBAL SERVICES. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -13,14 +13,17 @@ package org.eclipse.sirius.tests.swtbot; import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.GraphicalEditPart; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramNodeEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeEditPart; import org.eclipse.sirius.diagram.ui.tools.api.figure.WorkspaceImageFigure; import org.eclipse.sirius.diagram.ui.tools.internal.figure.ViewNodeFigure; +import org.eclipse.sirius.ext.gmf.runtime.gef.ui.figures.SiriusWrapLabel; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource; import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor; @@ -30,8 +33,7 @@ import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; import com.google.common.collect.Iterables; /** - * Test class which checks if label is well positioned when it is node label - * position. + * Test class which checks if label is well positioned when it is node label position. * * @author nlepine */ @@ -72,23 +74,85 @@ public class NodeLabelPositionTest extends AbstractSiriusSwtBotGefTestCase { } /** - * Test the node label position in gauge figure + * Tests that the left alignment is taken in consideration with wrapped label. * * @throws Exception * In case of problem */ - public void testNodeLabelPosition() throws Exception { + public void testNodeWrappedLabelPositionWithLeftAlignement() throws Exception { SWTBotGefEditPart editPart1 = editor.getEditPart("SubPackage1", AbstractDiagramNodeEditPart.class); assertNotNull(editPart1); - checkNodeLabelPosition(editPart1, new Point(20, 20), new Point(0, 0)); - editor.drag(editPart1, 50, 50); - SWTBotUtils.waitAllUiEvents(); - checkNodeLabelPosition(editPart1, new Point(50, 50), new Point(0, 0)); + checkLabelAlignment(editPart1, PositionConstants.LEFT); + } - // resize the edit part - editor.drag(111, 131, 150, 150); - SWTBotUtils.waitAllUiEvents(); - checkNodeLabelPosition(editPart1, new Point(50, 50), new Point(0, 0)); + /** + * Tests that the right alignment is taken in consideration with wrapped label. + * + * @throws Exception + * In case of problem + */ + public void testNodeWrappedLabelPositionWithRightAlignement() throws Exception { + SWTBotGefEditPart editPart1 = editor.getEditPart("SubPackage2", AbstractDiagramNodeEditPart.class); + assertNotNull(editPart1); + checkLabelAlignment(editPart1, PositionConstants.RIGHT); + } + + /** + * Tests that the center alignment is taken in consideration with wrapped label. + * + * @throws Exception + * In case of problem + */ + public void testNodeWrappedLabelPositionWithCenterAlignement() throws Exception { + SWTBotGefEditPart editPart = editor.getEditPart("SubPackage3", AbstractDiagramNodeEditPart.class); + assertNotNull(editPart); + checkLabelAlignment(editPart, PositionConstants.CENTER); + } + + /** + * Verifies that the label is aligned correctly regarding the value set in VSM. + * + * @param editPart + * the edit part to check its alignment. + * @param alignment + * alignment that should be active. + */ + private void checkLabelAlignment(SWTBotGefEditPart editPart, int alignment) { + DNodeEditPart part = (DNodeEditPart) editPart.part(); + SiriusWrapLabel nodeLabel = part.getPrimaryShape().getNodeLabel(); + int textWrapAlignment = nodeLabel.getTextWrapAlignment(); + + checkAlignment("wrong text wrap alignment.", alignment, textWrapAlignment); + int textAlignment = nodeLabel.getTextAlignment(); + checkAlignment("wrong text alignment.", alignment, textAlignment); + int labelAlignment = nodeLabel.getLabelAlignment2(); + checkAlignment("wrong label alignment.", alignment, labelAlignment); + } + + /** + * Verifies the alignment is the expected one. + * + * @param errorMessage + * error message if not equals + * @param expectedAlignment + * expected alignment + * @param actualAlignment + * tested alignment + */ + private void checkAlignment(String errorMessage, int expectedAlignment, int actualAlignment) { + switch (expectedAlignment) { + case PositionConstants.LEFT: + assertEquals(errorMessage, PositionConstants.LEFT, actualAlignment); + break; + case PositionConstants.RIGHT: + assertEquals(errorMessage, PositionConstants.RIGHT, actualAlignment); + break; + case PositionConstants.CENTER: + assertEquals(errorMessage, PositionConstants.CENTER, actualAlignment); + break; + default: + break; + }; } /** @@ -113,6 +177,26 @@ public class NodeLabelPositionTest extends AbstractSiriusSwtBotGefTestCase { } /** + * Test the node label position in gauge figure + * + * @throws Exception + * In case of problem + */ + public void testNodeLabelPosition() throws Exception { + SWTBotGefEditPart editPart1 = editor.getEditPart("SubPackage1", AbstractDiagramNodeEditPart.class); + assertNotNull(editPart1); + checkNodeLabelPosition(editPart1, new Point(20, 20), new Point(0, 0)); + editor.drag(editPart1, 50, 50); + SWTBotUtils.waitAllUiEvents(); + checkNodeLabelPosition(editPart1, new Point(50, 50), new Point(0, 0)); + + // resize the edit part + editor.drag(111, 131, 150, 150); + SWTBotUtils.waitAllUiEvents(); + checkNodeLabelPosition(editPart1, new Point(89, 69), new Point(0, 0)); + } + + /** * Check the node label position of the edit part * * @param editPart1 @@ -128,8 +212,7 @@ public class NodeLabelPositionTest extends AbstractSiriusSwtBotGefTestCase { } /** - * Check the border label position of the edit part is centered and under - * its parent. + * Check the border label position of the edit part is centered and under its parent. * * @param editPart1 * The parent |
