diff --git a/src/main/java/kieker/analysis/stage/graphoutput/DotGraphWriterOld.java b/src/main/java/kieker/analysis/stage/graphoutput/DotGraphWriterOld.java deleted file mode 100644 index b05226797a372422027969931059e1d97f5a7194..0000000000000000000000000000000000000000 --- a/src/main/java/kieker/analysis/stage/graphoutput/DotGraphWriterOld.java +++ /dev/null @@ -1,53 +0,0 @@ -package kieker.analysis.stage.graphoutput; - -import kieker.analysis.traceanalysisdomain.AbstractOperationCall; -import kieker.analysis.traceanalysisdomain.AbstractTrace; -import kieker.tools.traceAnalysis.filter.visualization.util.dot.DotFactory; - -import teetime.framework.AbstractConsumerStage; - -//TODO: really necessary to have 2 type parameters? -public class DotGraphWriterOld<T extends AbstractTrace<C>, C extends AbstractOperationCall<C>> extends AbstractConsumerStage<T> { - - @Override - protected void execute(final T trace) { - String graph = handleOperationCallsRecurive(trace.getRootOperationCall(), null, 0).toString(); - System.out.println("digraph graphname {"); - System.out.println(graph); - System.out.println("}"); - } - - private StringBuilder handleOperationCallsRecurive(final C operationCall, final C parentOperationCall, final int depth) { - - StringBuilder graph = new StringBuilder(handleOperationCall(operationCall, parentOperationCall, depth)); - - for (C childOperationCall : operationCall.getChildren()) { - graph.append(handleOperationCallsRecurive(childOperationCall, operationCall, depth + 1)); - } - - return graph; - } - - // TODO Maybe change to protected when class is abstract - private StringBuilder handleOperationCall(final C operationCall, final C parentOperationCall, final int depth) { - - StringBuilder output = new StringBuilder(); - - output.append(createDotNode(operationCall.hashCode(), operationCall.getOperation())); - if (parentOperationCall != null) { - output.append(createDotConnection(parentOperationCall.hashCode(), operationCall.hashCode())); - } - - return output; - } - - private StringBuilder createDotNode(final int id, final String label) { - return DotFactory.createNode("", String.valueOf(id), label, null, null, null, null, null, 0, - null, null, null); - } - - private StringBuilder createDotConnection(final int from, final int to) { - return new StringBuilder(DotFactory.createConnection("", String.valueOf(from), String.valueOf(to), 0, 0)); - } - -} diff --git a/src/main/java/kieker/analysis/stage/graphoutput/GraphBuilder.java b/src/main/java/kieker/analysis/stage/graphoutput/GraphBuilder.java deleted file mode 100644 index ebe75b99b374177169c54fbb63385f9f822dbf74..0000000000000000000000000000000000000000 --- a/src/main/java/kieker/analysis/stage/graphoutput/GraphBuilder.java +++ /dev/null @@ -1,49 +0,0 @@ -package kieker.analysis.stage.graphoutput; - -import com.tinkerpop.blueprints.Graph; -import com.tinkerpop.blueprints.Vertex; -import com.tinkerpop.blueprints.impls.tg.TinkerGraph; - -import kieker.analysis.trace.traversal.NamedGraph; -import kieker.analysis.traceanalysisdomain.AbstractOperationCall; -import kieker.analysis.traceanalysisdomain.AbstractTrace; - -import teetime.stage.basic.AbstractTransformation; - -//TODO: really necessary to have 2 type parameters? -public class GraphBuilder<T extends AbstractTrace<C>, C extends AbstractOperationCall<C>> extends AbstractTransformation<T, NamedGraph> { - - @Override - protected void execute(final T trace) { - - Graph graph = new TinkerGraph(); - String graphName = String.valueOf(trace.getRootOperationCall().hashCode()); - - transformOperationCallsRecurive(graph, trace.getRootOperationCall(), null); - - this.getOutputPort().send(new NamedGraph(graphName, graphName, graph)); - } - - private void transformOperationCallsRecurive(final Graph graph, final C operationCall, final Vertex parentVertex) { - - Vertex vertex = transformOperationCall(graph, operationCall, parentVertex); - - for (C childOperationCall : operationCall.getChildren()) { - transformOperationCallsRecurive(graph, childOperationCall, vertex); - } - } - - private Vertex transformOperationCall(final Graph graph, final C operationCall, final Vertex parentVertex) { - - Vertex vertex = graph.addVertex(operationCall.hashCode()); - // TODO exact properties - vertex.setProperty("label", operationCall.getOperation()); - - if (parentVertex != null) { - graph.addEdge(null, parentVertex, vertex, ""); - } - - return vertex; - } - -}