Author: simonetripodi Date: Thu Mar 8 14:58:57 2012 New Revision: 1298421 URL: http://svn.apache.org/viewvc?rev=1298421&view=rev Log: hide vertices/edges export ATM - once lost supertypes, a different strategy is needed to hadle graph elements properties
Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java?rev=1298421&r1=1298420&r2=1298421&view=diff ============================================================================== --- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java (original) +++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/DotExporter.java Thu Mar 8 14:58:57 2012 @@ -83,7 +83,7 @@ final class DotExporter<V, E, G extends boolean attributesFound = false; - if ( edge instanceof Labeled ) + /*if ( edge instanceof Labeled ) { attributesFound = true; printWriter.format( " [label=\"%s\"", ( (Labeled) edge ).getLabel() ); @@ -104,7 +104,7 @@ final class DotExporter<V, E, G extends printWriter.format( "weight=%f", ( (Number) weight ).doubleValue() ); } - } + }*/ if ( attributesFound ) { Modified: commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java?rev=1298421&r1=1298420&r2=1298421&view=diff ============================================================================== --- commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java (original) +++ commons/sandbox/graph/branches/drop-marker-interfaces-feature/src/main/java/org/apache/commons/graph/export/GraphMLExporter.java Thu Mar 8 14:58:57 2012 @@ -98,7 +98,7 @@ final class GraphMLExporter<V, E, G exte for ( E edge : getGraph().getEdges() ) { - if ( edge instanceof Labeled ) + /* if ( edge instanceof Labeled ) { if ( !edgeKeyTypes.containsKey( LABEL ) ) { @@ -112,7 +112,7 @@ final class GraphMLExporter<V, E, G exte { edgeKeyTypes.put( WEIGHT, getStringType( ( (Weighted<?>) edge ).getWeight() ) ); } - } + } */ } // scan vertices @@ -120,13 +120,13 @@ final class GraphMLExporter<V, E, G exte for ( V vertex : getGraph().getVertices() ) { - if ( vertex instanceof Labeled ) + /* if ( vertex instanceof Labeled ) { if ( !vertexKeyTypes.containsKey( LABEL ) ) { vertexKeyTypes.put( LABEL, getStringType( ( (Labeled) vertex ).getLabel() ) ); } - } + } */ } XMLStreamWriter xmlWriter = XMLOutputFactory.newInstance().createXMLStreamWriter( getWriter() ); @@ -170,14 +170,14 @@ final class GraphMLExporter<V, E, G exte xmlWriter.writeStartElement( NODE ); xmlWriter.writeAttribute( ID, String.valueOf( vertex.hashCode() ) ); - if ( vertex instanceof Labeled ) + /* if ( vertex instanceof Labeled ) { String label = ( (Labeled) vertex ).getLabel(); xmlWriter.writeStartElement( DATA ); xmlWriter.writeAttribute( KEY, LABEL ); xmlWriter.writeCharacters( label ); xmlWriter.writeEndElement(); - } + } */ xmlWriter.writeEndElement(); } @@ -189,14 +189,14 @@ final class GraphMLExporter<V, E, G exte xmlWriter.writeAttribute( SOURCE, String.valueOf( getGraph().getVertices( edge ).getHead().hashCode() ) ); xmlWriter.writeAttribute( TARGET, String.valueOf( getGraph().getVertices( edge ).getTail().hashCode() ) ); - if ( edge instanceof Labeled ) + /* if ( edge instanceof Labeled ) { xmlWriter.writeAttribute( LABEL, ( (Labeled) edge ).getLabel() ); } if ( edge instanceof Weighted ) { xmlWriter.writeAttribute( WEIGHT, ( (Weighted<?>) edge ).getWeight().toString() ); - } + } */ xmlWriter.writeEndElement(); }