Package org.graphstream.stream.file

Examples of org.graphstream.stream.file.FileSource


   * @throws IOException
   * @see org.graphstream.stream.file.FileSourceFactory
   */
  public static int countStepInFile(String path) throws IOException {
    StepCounter counter = new StepCounter();
    FileSource source = FileSourceFactory.sourceFor(path);

    source.addElementSink(counter);
    source.readAll(path);

    return counter.getStepCount();
  }
View Full Code Here


    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);
    }
   
View Full Code Here

    input.readAll(filename);
  }

  public void read(String filename) throws IOException, GraphParseException,
      ElementNotFoundException {
    FileSource input = FileSourceFactory.sourceFor(filename);
    if (input != null) {
      input.addSink(this);
      read(input, filename);
      input.removeSink(this);
    } else {
      throw new IOException("No source reader for " + filename);
    }
  }
View Full Code Here

TOP

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

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.