How to create a graphic file in Java. Gephi, JGraph, Prefuse, etc.

Help! I am looking to create a Java application that creates a graph in any of these formats:

  • .graphml
  • .ygf
  • .gml
  • .tgf

I need to be able to open the file in the graph editor " yEd " .

So far I have found these solutions:

  • yFiles for Java
    • Pro: Exporting to a graph that can be opened in yEd, based on Java, is excellent.
    • Why can't I use it: would it cost me more than $ 2000 to use: (this is exactly what I need, however
  • Gephi
    • Pro: FREE, Export to Java based graphics!
    • : yEd, : - , :
    • enter image description here
    • , .
    • , ,
  • JGraphX
    • Pro: Java,
    • : ? ...
  • Prefuse
    • Pro: , , Java
    • : , , . , demos fine build.sh, , demos.jar, " Main-Class"...
  • Blueprints GraphML ( Tinkerpop?)
    • Pro: Java, Free, , .
    • : , ""? ?
  • JGraphT GraphMLExporter
    • Pro: , Java, , .
    • : , ! yed, " yEd : test.graphml." :

JGraphT, :

UndirectedGraph<String, DefaultEdge> g = new SimpleGraph<String, DefaultEdge>(DefaultEdge.class);

String v1 = "v1";
String v2 = "v2";
String v3 = "v3";
String v4 = "v4";

// add the vertices
g.addVertex(v1);
g.addVertex(v2);
g.addVertex(v3);
g.addVertex(v4);

// add edges to create a circuit
g.addEdge(v1, v2);
g.addEdge(v2, v3);
g.addEdge(v3, v4);
g.addEdge(v4, v1);


FileWriter w;
try {
GmlExporter<String, DefaultEdge> exporter = 
    new GmlExporter<String, DefaultEdge>(); 
    w = new FileWriter("test.graphml");
    exporter.export(w, g);
} catch (IOException e) {
    e.printStackTrace();
}

? !

+4
5

JgraphT yED, . GMLWriter, GML- yED (, , ,...).

GML-Writer-for-yED

+1

, , : yEd "" . yed , .

+4
+2

GmlExporter GraphMLExporter . .

+1

Prefuse, GraphML Graph GraphMLWriter.

+1

Source: https://habr.com/ru/post/1538469/


All Articles