From 5582690ce34fd5d982738c3861d6fa29237535e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <stu114708@informatik.uni-kiel.de>
Date: Tue, 31 May 2016 15:07:21 +0200
Subject: [PATCH] updated DOT styling for deployment dependency graphs

---
 .../DeploymentDependencyGraphCreator.java                 | 4 ++--
 .../DotComponentsDependencyExportStage.java               | 7 ++++---
 .../DotContainersDependencyExportStage.java               | 8 +++++---
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/DeploymentDependencyGraphCreator.java b/src/main/java/kieker/analysis/dev/dependencygraphs/DeploymentDependencyGraphCreator.java
index af458a80..63524dea 100644
--- a/src/main/java/kieker/analysis/dev/dependencygraphs/DeploymentDependencyGraphCreator.java
+++ b/src/main/java/kieker/analysis/dev/dependencygraphs/DeploymentDependencyGraphCreator.java
@@ -54,9 +54,9 @@ public class DeploymentDependencyGraphCreator {
 			containerVertex.setProperty("MeanDuration", container.getMeanDuration());
 			containerVertex.setProperty("MedianDuration", container.getMedianDuration());
 			containerVertex.setProperty("TotalDuration", container.getTotalDuration());
-			Graph componentGraph = containerVertex.addChildGraph();
 
 			if (this.depth.compareTo(DeploymentDependencyGraphLevel.COMPONENT) <= 0) {
+				Graph componentGraph = containerVertex.addChildGraph();
 
 				for (Component component : container.getComponents()) {
 
@@ -68,9 +68,9 @@ public class DeploymentDependencyGraphCreator {
 					componentVertex.setProperty("MeanDuration", component.getMeanDuration());
 					componentVertex.setProperty("MedianDuration", component.getMedianDuration());
 					componentVertex.setProperty("TotalDuration", component.getTotalDuration());
-					Graph operationsGraph = componentVertex.addChildGraph();
 
 					if (this.depth.compareTo(DeploymentDependencyGraphLevel.OPERATION) <= 0) {
+						Graph operationsGraph = componentVertex.addChildGraph();
 
 						for (Operation operation : component.getOperations()) {
 							Vertex operationVertex = operationsGraph.addVertex(operation.getIdentifier());
diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/DotComponentsDependencyExportStage.java b/src/main/java/kieker/analysis/dev/dependencygraphs/DotComponentsDependencyExportStage.java
index 40c4f453..e8f40c97 100644
--- a/src/main/java/kieker/analysis/dev/dependencygraphs/DotComponentsDependencyExportStage.java
+++ b/src/main/java/kieker/analysis/dev/dependencygraphs/DotComponentsDependencyExportStage.java
@@ -14,9 +14,9 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage {
 	public DotComponentsDependencyExportStage(final String outputDirectory) {
 		super(outputDirectory);
 		this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR");
-		this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "oval");
+		this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box");
 		this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper());
-		this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new OperationVertexMapper());
+		this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ComponentVertexMapper());
 		this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString()));
 		// Styling
 		// Something like this would be cool:
@@ -25,12 +25,13 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage {
 
 	// TODO Consider if nested class is useful
 
-	private class OperationVertexMapper implements Function<Vertex, String> {
+	private class ComponentVertexMapper implements Function<Vertex, String> {
 
 		@Override
 		public String apply(final Vertex vertex) {
 			// TODO missing temporal unit
 			final StringBuilder statistics = new StringBuilder();
+			statistics.append("<<deployment component>>\\n");
 			statistics.append(vertex.getProperty("Name").toString());
 			statistics.append("\\n min: ");
 			statistics.append(vertex.getProperty("MinDuration").toString());
diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/DotContainersDependencyExportStage.java b/src/main/java/kieker/analysis/dev/dependencygraphs/DotContainersDependencyExportStage.java
index 2877a16f..b7dd6439 100644
--- a/src/main/java/kieker/analysis/dev/dependencygraphs/DotContainersDependencyExportStage.java
+++ b/src/main/java/kieker/analysis/dev/dependencygraphs/DotContainersDependencyExportStage.java
@@ -14,9 +14,9 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
 	public DotContainersDependencyExportStage(final String outputDirectory) {
 		super(outputDirectory);
 		this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR");
-		this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "oval");
+		this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box3d");
 		this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper());
-		this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new OperationVertexMapper());
+		this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ContainerVertexMapper());
 		this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString()));
 		// Styling
 		// Something like this would be cool:
@@ -25,12 +25,13 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
 
 	// TODO Consider if nested class is useful
 
-	private class OperationVertexMapper implements Function<Vertex, String> {
+	private class ContainerVertexMapper implements Function<Vertex, String> {
 
 		@Override
 		public String apply(final Vertex vertex) {
 			// TODO missing temporal unit
 			final StringBuilder statistics = new StringBuilder();
+			statistics.append("<<execution container>>\\n");
 			statistics.append(vertex.getProperty("Name").toString());
 			statistics.append("\\n min: ");
 			statistics.append(vertex.getProperty("MinDuration").toString());
@@ -48,6 +49,7 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
 
 	}
 
+	// Not used in this class
 	private class ClusterMapper implements Function<Vertex, String> {
 
 		@Override
-- 
GitLab