Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Philipp Steghöfer2021-04-11 14:10:09 -0400
committerJan-Philipp Steghöfer2021-04-12 08:23:19 -0400
commit4b818a7e9f7e8e50e33f83f55de000c5cc45d81d (patch)
treed145907ba1bfa06e52cc5a6eebe8c99d0ea4bfe7
parent8b5d98c985efeeb00b5b0de4435e8d5efb5220a9 (diff)
downloadorg.eclipse.capra-4b818a7e9f7e8e50e33f83f55de000c5cc45d81d.tar.gz
org.eclipse.capra-4b818a7e9f7e8e50e33f83f55de000c5cc45d81d.tar.xz
org.eclipse.capra-4b818a7e9f7e8e50e33f83f55de000c5cc45d81d.zip
PlantUML view now shows links vertically
This commit changes the layout of the graphs PlantUML renders from a horizontal layout to a vertical one. This improves readability, in particular in cases where an element is linked to a lot of others. Previously, the diagram was cut off after a certain number of pixels and therefore not fully visible. It was also difficult to navigate the diagram. Change-Id: I54f28590fcc7fb0c0a32de0c7c2734aadbf4e310
-rw-r--r--bundles/org.eclipse.capra.ui.plantuml/src/org/eclipse/capra/ui/plantuml/VisualizationHelper.xtend1
-rw-r--r--bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/.VisualizationHelper.xtendbinbin4563 -> 4631 bytes
-rw-r--r--bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/VisualizationHelper.java2
-rw-r--r--tests/org.eclipse.capra.handler.uml.tests/src/org/eclipse/capra/handler/uml/tests/TestUMLInternalLinks.java4
-rw-r--r--tests/org.eclipse.capra.testsuite/src/org/eclipse/capra/testsuite/TestGraphicalVisualization.java16
5 files changed, 14 insertions, 9 deletions
diff --git a/bundles/org.eclipse.capra.ui.plantuml/src/org/eclipse/capra/ui/plantuml/VisualizationHelper.xtend b/bundles/org.eclipse.capra.ui.plantuml/src/org/eclipse/capra/ui/plantuml/VisualizationHelper.xtend
index 857af6ea..c9c29128 100644
--- a/bundles/org.eclipse.capra.ui.plantuml/src/org/eclipse/capra/ui/plantuml/VisualizationHelper.xtend
+++ b/bundles/org.eclipse.capra.ui.plantuml/src/org/eclipse/capra/ui/plantuml/VisualizationHelper.xtend
@@ -33,6 +33,7 @@ class VisualizationHelper {
var helper = new Connections(connections, selectedObjects, artifactModel);
'''
@startuml
+ left to right direction
object "«helper.originLabel()»«IF helper.originHasLocation()» [[«helper.originLocation().replaceAll(" ", "%20")» (Go to)]]«ENDIF»" as «helper.originId()» #pink
«FOR id:helper.objectIdsWithoutOrigin()»
object "«helper.label(id)»«IF helper.hasLocation(id)» [[«helper.location(id).replaceAll(" ", "%20")» (Go to)]]«ENDIF»" as «id»
diff --git a/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/.VisualizationHelper.xtendbin b/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/.VisualizationHelper.xtendbin
index 28d8e8d6..f63143ca 100644
--- a/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/.VisualizationHelper.xtendbin
+++ b/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/.VisualizationHelper.xtendbin
Binary files differ
diff --git a/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/VisualizationHelper.java b/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/VisualizationHelper.java
index 41f834ec..55099679 100644
--- a/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/VisualizationHelper.java
+++ b/bundles/org.eclipse.capra.ui.plantuml/xtend-gen/org/eclipse/capra/ui/plantuml/VisualizationHelper.java
@@ -89,6 +89,8 @@ public class VisualizationHelper {
StringConcatenation _builder = new StringConcatenation();
_builder.append("@startuml");
_builder.newLine();
+ _builder.append("left to right direction");
+ _builder.newLine();
_builder.append("object \"");
String _originLabel = helper.originLabel();
_builder.append(_originLabel);
diff --git a/tests/org.eclipse.capra.handler.uml.tests/src/org/eclipse/capra/handler/uml/tests/TestUMLInternalLinks.java b/tests/org.eclipse.capra.handler.uml.tests/src/org/eclipse/capra/handler/uml/tests/TestUMLInternalLinks.java
index 0297c969..e0d5392c 100644
--- a/tests/org.eclipse.capra.handler.uml.tests/src/org/eclipse/capra/handler/uml/tests/TestUMLInternalLinks.java
+++ b/tests/org.eclipse.capra.handler.uml.tests/src/org/eclipse/capra/handler/uml/tests/TestUMLInternalLinks.java
@@ -54,8 +54,8 @@ public class TestUMLInternalLinks {
private static final String TEST_PROJECT_NAME = "TestProject";
- private static final String EXPECTED_TEXT_FOR_INTERNAL_LINKS = "@startuml\n" + "object \"A : Class\" as o0 #pink\n"
- + "object \"B : Class\" as o1\n" + "object \"C : Class\" as o2\n"
+ private static final String EXPECTED_TEXT_FOR_INTERNAL_LINKS = "@startuml\n" + "left to right direction\n"
+ + "object \"A : Class\" as o0 #pink\n" + "object \"B : Class\" as o1\n" + "object \"C : Class\" as o2\n"
+ "o0--o1: A : Class B : Class : RelatedTo\n" + "o1--o2: true : Generalization\n" + "@enduml\n";
@Before
diff --git a/tests/org.eclipse.capra.testsuite/src/org/eclipse/capra/testsuite/TestGraphicalVisualization.java b/tests/org.eclipse.capra.testsuite/src/org/eclipse/capra/testsuite/TestGraphicalVisualization.java
index 47fb6b71..e3dbe14a 100644
--- a/tests/org.eclipse.capra.testsuite/src/org/eclipse/capra/testsuite/TestGraphicalVisualization.java
+++ b/tests/org.eclipse.capra.testsuite/src/org/eclipse/capra/testsuite/TestGraphicalVisualization.java
@@ -77,15 +77,17 @@ public class TestGraphicalVisualization {
private static final String LINE_SEPARATOR = System.lineSeparator();
private static final String EXPECTED_TEXT_FOR_DIRECT_CONNECTIONS = "@startuml" + LINE_SEPARATOR
- + "object \"A : EClass\" as o0 #pink" + LINE_SEPARATOR + "object \"B : EClass\" as o1" + LINE_SEPARATOR
- + "o0--o1: A : EClass B : EClass : RelatedTo" + LINE_SEPARATOR + "@enduml" + LINE_SEPARATOR;
+ + "left to right direction" + LINE_SEPARATOR + "object \"A : EClass\" as o0 #pink" + LINE_SEPARATOR
+ + "object \"B : EClass\" as o1" + LINE_SEPARATOR + "o0--o1: A : EClass B : EClass : RelatedTo"
+ + LINE_SEPARATOR + "@enduml" + LINE_SEPARATOR;
private static final String EXPECTED_TEXT_FOR_TRANSITIVE_CONNECTIONS = "@startuml" + LINE_SEPARATOR
- + "object \"A : EClass\" as o0 #pink" + LINE_SEPARATOR + "object \"B : EClass\" as o1" + LINE_SEPARATOR
- + "object \"C : EClass\" as o2" + LINE_SEPARATOR + "o0--o1: A : EClass B : EClass : RelatedTo"
- + LINE_SEPARATOR + "o1--o2: B : EClass C : EClass : RelatedTo" + LINE_SEPARATOR + "@enduml"
- + LINE_SEPARATOR;
- private static final String EXPECTED_TEXT_FOR_GOTO_LINKS = "@startuml" + LINE_SEPARATOR
+ + "left to right direction" + LINE_SEPARATOR + "object \"A : EClass\" as o0 #pink" + LINE_SEPARATOR
+ + "object \"B : EClass\" as o1" + LINE_SEPARATOR + "object \"C : EClass\" as o2" + LINE_SEPARATOR
+ + "o0--o1: A : EClass B : EClass : RelatedTo" + LINE_SEPARATOR + "o1--o2: B : EClass C : EClass : RelatedTo"
+ + LINE_SEPARATOR + "@enduml" + LINE_SEPARATOR;
+ private static final String EXPECTED_TEXT_FOR_GOTO_LINKS = "@startuml" + LINE_SEPARATOR + "left to right direction"
+ + LINE_SEPARATOR
+ "object \"TestClass [[platform:/resource/TestProject_java/src/org/eclipse/capra/test/TestClass.java#org.eclipse.capra.test.TestClass (Go to)]]\" as o0 #pink"
+ LINE_SEPARATOR
+ "object \"CClass.c [[platform:/resource/TestProject_C/CClass.c#CClass.c (Go to)]]\" as o1"

Back to the top