GraphStream Users

Archives de la liste Aide


Re: Stylesheet Only Works Partially After Clear


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, "Jacob M. H. Smith" <jacob.m.h.smith AT gmail.com>
  • Subject: Re: Stylesheet Only Works Partially After Clear
  • Date: Thu, 26 Sep 2013 10:24:57 +0200

Hi Jacob,

Thanks for reporting this bug.
It is fixed now.

Regards.
Guilhelm


2013/9/25 Jacob M. H. Smith <jacob.m.h.smith AT gmail.com>
Hello.

First of all, I want to say that I've been playing around with GraphStream for a bit now and I very much like it. Keep up the great work. I'm also very grateful for the help I have received on this mailing list.

As for my question, I have noticed that calling the clear() method on a graph renders certain parts of the stylesheet I assign to it afterwards ineffective.

Here's an example. The background color of the graph is only set correctly if I comment out the line that clears the graph. Strangely, the color of the nodes does not seem to be affected. What am I missing here?

/* ======================================================== */
Graph graph = new SingleGraph("graph");
graph.display();
graph.clear(); // comment out to make the background red

graph.addAttribute("ui.quality");
graph.addAttribute("ui.antialias");
graph.addAttribute("ui.stylesheet",
    "graph { fill-color: red; } node { fill-color: green; }");

Generator gen = new BarabasiAlbertGenerator();
gen.addSink(graph);
gen.begin();
for (int i = 0; i < 100; i++) {
    gen.nextEvents();
}
gen.end();
/* ======================================================== */

Thank you.

Best regards,
Jacob




--
Guilhelm Savin
PhD Student of Computer Science



Archives gérées par MHonArc 2.6.16.

Top of page