Skip to content

Commit

Permalink
Modification on Layout tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant01n3 committed Jul 11, 2012
1 parent 75a393e commit fae4e2a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src-test/org/graphstream/ui/layout/test/DemoLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.MultiGraph;
import org.graphstream.stream.GraphParseException;
import org.graphstream.ui.spriteManager.Sprite;
import org.graphstream.ui.spriteManager.SpriteManager;

public class DemoLayout {
public static void main(String args[]) throws ElementNotFoundException, IOException, GraphParseException {
Expand All @@ -50,7 +52,12 @@ public static void main(String args[]) throws ElementNotFoundException, IOExcept

public void test() throws ElementNotFoundException, IOException, GraphParseException {
Graph graph = new MultiGraph("test");
SpriteManager sm = new SpriteManager(graph);
Sprite C = sm.addSprite("C");
C.setPosition(0, 0, 0);
C.setAttribute("ui.label", "(0,0)");
graph.display();
graph.addAttribute("ui.stylesheet", styleSheet);
graph.addAttribute("layout.stabilization-limit", 1);
graph.addAttribute("layout.quality", 3);
graph.addAttribute("layout.gravity", 0.01);
Expand All @@ -66,11 +73,15 @@ public void test() throws ElementNotFoundException, IOException, GraphParseExcep
// sleep(10);
// }
// gen.end();
graph.read("src-test/org/graphstream/ui/layout/test/data/fourComponents.dgs");
// graph.read("src-test/org/graphstream/ui/layout/test/data/polbooks.gml");
// graph.read("src-test/org/graphstream/ui/layout/test/data/fourComponents.dgs");
graph.read("src-test/org/graphstream/ui/layout/test/data/polbooks.gml");
// graph.read("src-test/org/graphstream/ui/layout/test/data/dolphins.gml");
}

public static void sleep(long ms) {
try { Thread.sleep(ms); } catch(Exception e) {}
}

protected static final String styleSheet =
"sprite#C { fill-color: red; text-color: red; }";
}

0 comments on commit fae4e2a

Please sign in to comment.