You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by cs...@apache.org on 2012/03/20 16:25:59 UTC
svn commit: r1302940 -
/commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
Author: cs
Date: Tue Mar 20 15:25:59 2012
New Revision: 1302940
URL: http://svn.apache.org/viewvc?rev=1302940&view=rev
Log:
implemented property setters for DOT exporter (withEdgeWeights, withEdgeLabels and withVertexLabels) calling the protected methods (addEdgeProperty, addVertexProperty) of AbstractExporter
Modified:
commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
Modified: commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java?rev=1302940&r1=1302939&r2=1302940&view=diff
==============================================================================
--- commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java (original)
+++ commons/sandbox/graph/branches/exporters-with-mappers/src/main/java/org/apache/commons/graph/export/DotExporter.java Tue Mar 20 15:25:59 2012
@@ -44,6 +44,10 @@ final class DotExporter<V, E>
private static final String CONNECTOR = "--";
private static final String DICONNECTOR = "->";
+
+ private static final String WEIGHT = "weight";
+
+ private static final String LABEL = "label";
DotExporter( Graph<V, E> graph, String name )
{
@@ -160,19 +164,19 @@ final class DotExporter<V, E>
public <N extends Number> DotExporter<V, E> withEdgeWeights( Mapper<E, N> edgeWeights )
{
- // TODO Auto-generated method stub
+ super.addEdgeProperty(WEIGHT, edgeWeights);
return this;
}
public DotExporter<V, E> withEdgeLabels( Mapper<E, String> edgeLabels )
{
- // TODO Auto-generated method stub
+ super.addEdgeProperty(LABEL, edgeLabels);
return this;
}
public DotExporter<V, E> withVertexLabels( Mapper<V, String> vertexLabels )
{
- // TODO Auto-generated method stub
+ super.addVertexProperty(LABEL, vertexLabels);
return this;
}