Skip to content

Commit

Permalink
[333] Add tests to reveal the edge routing problem
Browse files Browse the repository at this point in the history
- 5 new representations have been added in tests data:
    - one with oblique edges,
    - one with rectilinear edges,
    - one with a mix of them and same number of oblique and rectilinear
edges,
    - one with a mix of them and more oblique edges,
    - and one with a mix of them more rectilinear edges.
- 5 tests corresponding to these representations have been added to
check the routing style before and after the arrange all with ELK.

Bug: #333
  • Loading branch information
lredor committed Jun 26, 2024
1 parent 84259f8 commit e1ffc9d
Show file tree
Hide file tree
Showing 4 changed files with 1,894 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,24 @@
</eSubpackages>
</eSubpackages>
</eSubpackages>
<eSubpackages name="routingStyleCases">
<eClassifiers xsi:type="ecore:EClass" name="MyClass1">
<eStructuralFeatures xsi:type="ecore:EReference" name="to2" eType="#//routingStyleCases/MyClass2"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="to3" eType="#//routingStyleCases/MyClass3"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MyClass2"/>
<eClassifiers xsi:type="ecore:EClass" name="MyClass3">
<eStructuralFeatures xsi:type="ecore:EReference" name="to4" eType="#//routingStyleCases/MyClass4"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MyClass4"/>
<eClassifiers xsi:type="ecore:EClass" name="MyClassA1">
<eStructuralFeatures xsi:type="ecore:EReference" name="toA2" eType="#//routingStyleCases/MyClassA2"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="toA3" eType="#//routingStyleCases/MyClassA3"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MyClassA2"/>
<eClassifiers xsi:type="ecore:EClass" name="MyClassA3">
<eStructuralFeatures xsi:type="ecore:EReference" name="toA4" eType="#//routingStyleCases/MyClassA4"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MyClassA4"/>
</eSubpackages>
</ecore:EPackage>
Original file line number Diff line number Diff line change
Expand Up @@ -1276,5 +1276,109 @@
</containerMappings>
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="SimpleDiagramWithMixRoutingEdges" domainClass="ecore::EPackage" enablePopupBars="true">
<metamodel href="http://www.eclipse.org/emf/2002/Ecore#/"/>
<layout xsi:type="description_1:CustomLayoutConfiguration" id="org.eclipse.elk.layered" label="ELK Layered" description="Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level.">
<layoutOptions xsi:type="description_1:EnumLayoutOption" id="org.eclipse.elk.hierarchyHandling">
<targets>NODE</targets>
<targets>PARENT</targets>
<value name="INCLUDE_CHILDREN"/>
</layoutOptions>
<layoutOptions xsi:type="description_1:EnumSetLayoutOption" id="org.eclipse.elk.nodeSize.constraints">
<targets>NODE</targets>
<values name="NODE_LABELS"/>
<values name="MINIMUM_SIZE"/>
</layoutOptions>
</layout>
<defaultLayer name="Default">
<nodeMappings name="Classes" semanticCandidatesExpression="feature:eClassifiers" domainClass="ecore::EClass">
<style xsi:type="style:SquareDescription" labelSize="12" labelPosition="node" resizeKind="NSEW">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
</style>
</nodeMappings>
<edgeMappings name="straightRedReferences" semanticCandidatesExpression="aql:self.eAllContents()->filter(ecore::EReference)->&#xD;select(s | s.name.startsWith('toA'))" sourceMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithMixRoutingEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithMixRoutingEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetFinderExpression="aql:self.eReferenceType" sourceFinderExpression="aql:self.eContainer()" domainClass="ecore::EReference" useDomainElement="true">
<style sizeComputationExpression="2">
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='red']"/>
<centerLabelStyleDescription labelSize="12" labelExpression="aql:self.name">
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</centerLabelStyleDescription>
</style>
</edgeMappings>
<edgeMappings name="rectilinearBlueReferences" semanticCandidatesExpression="aql:self.eAllContents()->filter(ecore::EReference)->select(s | not(s.name.startsWith('toA')))" sourceMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithMixRoutingEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithMixRoutingEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetFinderExpression="aql:self.eReferenceType" sourceFinderExpression="aql:self.eContainer()" domainClass="ecore::EReference" useDomainElement="true">
<style sizeComputationExpression="2" routingStyle="manhattan">
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
<centerLabelStyleDescription labelSize="12" labelExpression="aql:self.name">
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</centerLabelStyleDescription>
</style>
</edgeMappings>
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="SimpleDiagramWithObliqueEdges" domainClass="ecore::EPackage" enablePopupBars="true">
<metamodel href="http://www.eclipse.org/emf/2002/Ecore#/"/>
<layout xsi:type="description_1:CustomLayoutConfiguration" id="org.eclipse.elk.layered" label="ELK Layered" description="Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level.">
<layoutOptions xsi:type="description_1:EnumLayoutOption" id="org.eclipse.elk.hierarchyHandling">
<targets>NODE</targets>
<targets>PARENT</targets>
<value name="INCLUDE_CHILDREN"/>
</layoutOptions>
<layoutOptions xsi:type="description_1:EnumSetLayoutOption" id="org.eclipse.elk.nodeSize.constraints">
<targets>NODE</targets>
<values name="NODE_LABELS"/>
<values name="MINIMUM_SIZE"/>
</layoutOptions>
</layout>
<defaultLayer name="Default">
<nodeMappings name="Classes" semanticCandidatesExpression="feature:eClassifiers" domainClass="ecore::EClass">
<style xsi:type="style:SquareDescription" labelSize="12" labelPosition="node" resizeKind="NSEW">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
</style>
</nodeMappings>
<edgeMappings name="straightRedReferences" sourceMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithObliqueEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithObliqueEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetFinderExpression="aql:self.eReferenceType" sourceFinderExpression="aql:self.eContainer()" domainClass="ecore::EReference" useDomainElement="true">
<style sizeComputationExpression="2">
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='red']"/>
<centerLabelStyleDescription labelSize="12" labelExpression="aql:self.name">
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</centerLabelStyleDescription>
</style>
</edgeMappings>
</defaultLayer>
</ownedRepresentations>
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="SimpleDiagramWithRectilinearEdges" domainClass="ecore::EPackage" enablePopupBars="true">
<metamodel href="http://www.eclipse.org/emf/2002/Ecore#/"/>
<layout xsi:type="description_1:CustomLayoutConfiguration" id="org.eclipse.elk.layered" label="ELK Layered" description="Layer-based algorithm provided by the Eclipse Layout Kernel. Arranges as many edges as possible into one direction by placing nodes into subsequent layers. This implementation supports different routing styles (straight, orthogonal, splines); if orthogonal routing is selected, arbitrary port constraints are respected, thus enabling the layout of block diagrams such as actor-oriented models or circuit schematics. Furthermore, full layout of compound graphs with cross-hierarchy edges is supported when the respective option is activated on the top level.">
<layoutOptions xsi:type="description_1:EnumLayoutOption" id="org.eclipse.elk.hierarchyHandling">
<targets>NODE</targets>
<targets>PARENT</targets>
<value name="INCLUDE_CHILDREN"/>
</layoutOptions>
<layoutOptions xsi:type="description_1:EnumSetLayoutOption" id="org.eclipse.elk.nodeSize.constraints">
<targets>NODE</targets>
<values name="NODE_LABELS"/>
<values name="MINIMUM_SIZE"/>
</layoutOptions>
</layout>
<defaultLayer name="Default">
<nodeMappings name="Classes" semanticCandidatesExpression="feature:eClassifiers" domainClass="ecore::EClass">
<style xsi:type="style:SquareDescription" labelSize="12" labelPosition="node" resizeKind="NSEW">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
</style>
</nodeMappings>
<edgeMappings name="rectilinearBlueReferences" sourceMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithRectilinearEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetMapping="//@ownedViewpoints[name='ElkTestViewpoint']/@ownedRepresentations[name='SimpleDiagramWithRectilinearEdges']/@defaultLayer/@nodeMappings[name='Classes']" targetFinderExpression="aql:self.eReferenceType" sourceFinderExpression="aql:self.eContainer()" domainClass="ecore::EReference" useDomainElement="true">
<style sizeComputationExpression="2" routingStyle="manhattan">
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
<centerLabelStyleDescription labelSize="12" labelExpression="aql:self.name">
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</centerLabelStyleDescription>
</style>
</edgeMappings>
</defaultLayer>
</ownedRepresentations>
</ownedViewpoints>
</description:Group>
Loading

0 comments on commit e1ffc9d

Please sign in to comment.