Package org.graphstream.stream.file

Examples of org.graphstream.stream.file.FileSourceGML


    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++) {
View Full Code Here


  }
 
  public void testDynFile() {
    try {
      Graph graph = new MultiGraph("Dynamic !");
      FileSourceGML source = new FileSourceGML();
     
      graph.addAttribute("ui.quality");
      graph.addAttribute("ui.antialias");
      graph.display();
      source.addSink(graph);
      source.begin(TestSourceGML.class.getResourceAsStream("dynamic.gml"));
      int step = 0;
      while(source.nextStep()) {
        System.err.printf("Step %d%n", step);
        step++;
        sleep(1000);
      }
      source.end();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  }
 
  public void testBigFile() {
    try {
      Graph graph = new MultiGraph("foo");
      FileSourceGML source = new FileSourceGML();

      graph.addAttribute("ui.quality");
      graph.addAttribute("ui.antialias");
      graph.addAttribute("ui.stylesheet", "node { text-size:8; text-color: #0008; text-alignment: at-right; } edge { text-size:8; text-color: #0008; }");
      graph.display(false);
      source.addSink(graph);
      source.begin(TestSourceGML.class.getResourceAsStream("example2.sif.gml"));
      while(source.nextEvents()) {}
      source.end();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    }
  }
  public void testSmallFile() {
    try {
      Graph graph = new MultiGraph("foo");
      FileSourceGML source = new FileSourceGML();

      graph.addAttribute("ui.quality");
      graph.addAttribute("ui.antialias");
      //graph.addAttribute("ui.stylesheet", "node { text-size:8; text-color: #0008; text-alignment: at-right; } edge { text-size:8; text-color: #0008; }");
      graph.display();
      source.addSink(graph);
      source.begin(TestSourceGML.class.getResourceAsStream("SmallTest.gml"));
      while(source.nextEvents()) {}
      source.end();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  // Before

  @Before
  public void setUp() {
    graph = new MultiGraph("g1");
    input = new FileSourceGML();
  }
View Full Code Here

TOP

Related Classes of org.graphstream.stream.file.FileSourceGML

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.