Guilhelm,
Thank you for your reply. I found that the .dgs file did not have the first line as "DGS004" when I added that I did not get the error.
I have tried to use .gexf files as a source and am not able to get them to run. Is that expected? Are there some good example graph files out on the web? Are there more example programs one could use?
I am really looking forward to working with your system. I think it is important.
Regards
Bob Garvey
$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
$ uname -a
Linux bob-EL1331G 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 16:26:01 UTC 2012 i
686 athlon i386 GNU/Linux
Quoting guilhelm savin <guilhelm.savin AT gmail.com>:
http://g <http://litis.univ-lehavre.fr/~savin>savin.lewub.orgHi and welcome to GraphStream community.
Can you give me more informations :
- the stack trace of the exception
- the version of your GraphStream jar
- your java version and OS
I try your code and got no exception.
Regards.
Guilhelm
2012/7/4 <bgsrvey AT wordgraph.com>
First try with GraphStream. I can't get over the hump of (FileSource)
source
being null.
I will be grateful for any assistance. gs looks like a great
accomplishment!
public class Tutorial2 {
public static void main(String args[]) {
Graph graph = new SingleGraph("Tutorial2");
String filePath = "tutorial2.dgs";
System.out.println("ID:" + graph.getId());
graph.display();
graph.addAttribute("ui.antialias");
try {
Thread.sleep(1000);
FileInputStream fstream = new
FileInputStream(filePath);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new
InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
System.out.println(strLine);
}
fstream.close();
FileSource source =
FileSourceFactory.sourceFor(filePath);
Thread.sleep(5000);
source.addSink(graph);
source.begin(filePath);
while (source.nextEvents());
source.end();
} catch (InterruptedException ix) {
System.out.println("interrupted while waiting on
invokeAndWait()");
} catch (IOException ioe) {
System.out.println("IOE");
ioe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
--
Guilhelm Savin
PhD Student of Computer Science
LITIS, University of Le Havre
\/\/\/\/\/\/
http://d3-project.org
http://iscn.univ-lehavre.fr
http://graphstream-project.org <http://www.graphstream-project.org>
/\/\/\/\/\/\
Archives gérées par MHonArc 2.6.16.