Commit 75a393ec authored by Antoine's avatar Antoine

Changed Layout tests.

parent b0f904e2
......@@ -32,20 +32,28 @@
package org.graphstream.ui.layout.test;
import java.io.IOException;
import org.graphstream.algorithm.generator.BarabasiAlbertGenerator;
import org.graphstream.algorithm.generator.Generator;
import org.graphstream.algorithm.generator.GridGenerator;
import org.graphstream.graph.ElementNotFoundException;
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.MultiGraph;
import org.graphstream.stream.GraphParseException;
public class DemoLayout {
public static void main(String args[]) {
public static void main(String args[]) throws ElementNotFoundException, IOException, GraphParseException {
//System.getProperties().put("gs.ui.layout", "org.graphstream.ui.layout.springbox.implementations.LinLog");
(new DemoLayout()).test();
}
public void test() {
public void test() throws ElementNotFoundException, IOException, GraphParseException {
Graph graph = new MultiGraph("test");
graph.display();
graph.addAttribute("layout.stabilization-limit", 1);
graph.addAttribute("layout.quality", 3);
graph.addAttribute("layout.gravity", 0.01);
// int steps = 50;
// Generator gen = new BarabasiAlbertGenerator(2);
// int steps = 6;
......@@ -58,9 +66,8 @@ public class DemoLayout {
// sleep(10);
// }
// gen.end();
try { graph.read("src-test/org/graphstream/ui/layout/test/data/WorldImport1999.edge"); } catch(Exception e) { e.printStackTrace(); }
// try { graph.write("grid7x7.dgs"); } catch(Exception e) { }
graph.display();
graph.read("src-test/org/graphstream/ui/layout/test/data/fourComponents.dgs");
// graph.read("src-test/org/graphstream/ui/layout/test/data/polbooks.gml");
}
public static void sleep(long ms) {
......
Creator "Mark Newman on Wed Jul 26 15:04:20 2006"
graph
[
directed 0
......
DGS004
null 0 0
an "0"
an "1"
an "2"
an "3"
an "10"
an "11"
an "12"
an "13"
an "20"
an "21"
an "22"
an "23"
an "30"
an "31"
an "32"
an "33"
ae "0-1" "0" "1"
ae "0-2" "0" "2"
ae "0-3" "0" "3"
ae "1-2" "1" "2"
ae "1-3" "1" "3"
ae "2-3" "2" "3"
ae "10-11" "10" "11"
ae "10-12" "10" "12"
ae "10-13" "10" "13"
ae "11-12" "11" "12"
ae "11-13" "11" "13"
ae "12-13" "12" "13"
ae "20-11" "20" "21"
ae "20-12" "20" "22"
ae "20-13" "20" "23"
ae "21-12" "21" "22"
ae "21-13" "21" "23"
ae "22-13" "22" "23"
ae "30-31" "30" "31"
ae "30-32" "30" "32"
ae "30-33" "30" "33"
ae "31-32" "31" "32"
ae "31-33" "31" "33"
ae "32-33" "32" "33"
#ae "inter1" "0" "10"
#ae "inter2" "10" "20"
#ae "inter3" "20" "30"
#ae "inter4" "30" "0"
Creator "Mark Newman on Wed Oct 18 16:42:04 2006"
graph
[
directed 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment