Package org.graphstream.ui.layout.springbox.implementations

Examples of org.graphstream.ui.layout.springbox.implementations.LinLog


  graph = new MultiGraph("Communities", false, true);
  viewer = graph.display(false);
  fromViewer = viewer.newThreadProxyOnGraphicGraph();

  layout = new LinLog(false);
  layout.configure(a, r, true, force);
  layout.addSink(graph);
  graph.addSink(layout);
  fromViewer.addSink(graph);
View Full Code Here


  public DemoLayoutAndViewer() {
    boolean loop = true;
    Graph graph = new MultiGraph("test");
    Viewer viewer = new Viewer(new ThreadProxyPipe(graph));
    ProxyPipe fromViewer = viewer.newThreadProxyOnGraphicGraph();
    LinLog layout = new LinLog(false);
   
    layout.configure(a, r, true, force);

    graph.addAttribute("ui.antialias");
    graph.addAttribute("ui.stylesheet", styleSheet);
    fromViewer.addSink(graph);
    viewer.addDefaultView(true);
    graph.addSink(layout);
    layout.addAttributeSink(graph);

    FileSource dgs = GRAPH.endsWith(".gml") ? new FileSourceGML() : new FileSourceDGS();

    dgs.addSink(graph);
    try {
      dgs.begin(getClass().getResourceAsStream(GRAPH));
      for (int i = 0; i < 5000 && dgs.nextEvents(); i++) {
//        fromViewer.pump();
//        layout.compute();
//        sleep(100);
      }
      dgs.end();
    } catch (IOException e1) {
      e1.printStackTrace();
      System.exit(1);
    }
   
    System.out.println("Finished creating the graph.");

    while (loop) {
      fromViewer.pump();

      if (graph.hasAttribute("ui.viewClosed")) {
        loop = false;
      } else {
        //sleep(1000);       
        layout.compute();
        findCommunities(graph, 1.3);
      }
    }

    System.exit(0);
View Full Code Here

TOP

Related Classes of org.graphstream.ui.layout.springbox.implementations.LinLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.