Skip to content
Snippets Groups Projects
Commit 65db0cfa authored by Sören Henning's avatar Sören Henning
Browse files

fixed #39

parent 9f0a5f6a
No related branches found
No related tags found
1 merge request!19Trace aggr analysis
package kieker.analysis.util.graph.export.dot; package kieker.analysis.util.graph.export.dot;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors;
import kieker.analysis.util.graph.Direction; import kieker.analysis.util.graph.Direction;
import kieker.analysis.util.graph.Edge; import kieker.analysis.util.graph.Edge;
...@@ -13,6 +13,8 @@ import kieker.analysis.util.graph.Vertex; ...@@ -13,6 +13,8 @@ import kieker.analysis.util.graph.Vertex;
import kieker.analysis.util.graph.export.AbstractTransformer; import kieker.analysis.util.graph.export.AbstractTransformer;
import kieker.analysis.util.graph.util.dot.DotGraphWriter; import kieker.analysis.util.graph.util.dot.DotGraphWriter;
import kieker.analysis.util.graph.util.dot.attributes.DotClusterAttribute; import kieker.analysis.util.graph.util.dot.attributes.DotClusterAttribute;
import kieker.analysis.util.graph.util.dot.attributes.DotEdgeAttribute;
import kieker.analysis.util.graph.util.dot.attributes.DotNodeAttribute;
class DotElementExporter extends AbstractTransformer<Void> { class DotElementExporter extends AbstractTransformer<Void> {
...@@ -42,7 +44,7 @@ class DotElementExporter extends AbstractTransformer<Void> { ...@@ -42,7 +44,7 @@ class DotElementExporter extends AbstractTransformer<Void> {
dotGraphWriter.addClusterStop(); dotGraphWriter.addClusterStop();
} else { } else {
// dotGraphWriter.addNode(vertex.getId().toString(), getAttributes(vertex)); dotGraphWriter.addNode(vertex.getId().toString(), getAttributes(vertex));
} }
} catch (IOException e) { } catch (IOException e) {
handleIOException(e); handleIOException(e);
...@@ -67,19 +69,25 @@ class DotElementExporter extends AbstractTransformer<Void> { ...@@ -67,19 +69,25 @@ class DotElementExporter extends AbstractTransformer<Void> {
} }
protected Map<String, String> getAttributes(final Edge edge) { protected Map<String, String> getAttributes(final Edge edge) {
// System.out.println("Hi!" + configuration.getEdgeAttributes().entrySet().stream().collect(Collectors.toMap( final Map<String, String> attributes = new HashMap<>();
// e -> e.getKey().toString(), for (Entry<DotEdgeAttribute, Function<Edge, String>> entry : configuration.getEdgeAttributes().entrySet()) {
// e -> null))); final String value = entry.getValue().apply(edge);
// return null; // TODO temp if (value != null) {
return configuration.getEdgeAttributes().entrySet().stream().collect(Collectors.toMap( attributes.put(entry.getKey().toString(), value);
e -> e.getKey().toString(), }
e -> e.getValue().apply(edge))); }
return attributes;
} }
protected Map<String, String> getAttributes(final Vertex vertex) { protected Map<String, String> getAttributes(final Vertex vertex) {
return configuration.getNodeAttributes().entrySet().stream().collect(Collectors.toMap( final Map<String, String> attributes = new HashMap<>();
e -> e.getKey().toString(), for (Entry<DotNodeAttribute, Function<Vertex, String>> entry : configuration.getNodeAttributes().entrySet()) {
e -> e.getValue().apply(vertex))); final String value = entry.getValue().apply(vertex);
if (value != null) {
attributes.put(entry.getKey().toString(), value);
}
}
return attributes;
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment