GraphStream Users

Archives de la liste Aide


Re: Flickering while adding nodes


Chronologique Discussions 
  • From: Eduardo Lidanski <eduardo.lidanski AT pikolab.net>
  • To: graphstream-users AT litislab.fr, Antoine Dutot <antoine.dutot AT gmail.com>
  • Subject: Re: Flickering while adding nodes
  • Date: Fri, 15 Nov 2013 15:56:35 +0100

Hi Antoine,

thank you for the fix. I tested with the 1.3 release from today and it seems to work better. But with the upgrade from 1.2 -> 1.3 I got a new problem related with the css file, so I cannot tell for 100% sure that the problem is gone.
Attached a testcase.
The node AB should change the color to black and stay black, since g.getEdge("AB").setAttribute("ui.color", 1); is called repeatedly. But it becomes white again and stays white?!
With release 1.2 the behaviour is different (and correct), so something changed with release 1.3.

Thank you
Eduardo


public class Test {

    public static void main(String args[]) {

        DefaultGraph g = new DefaultGraph("Graph");
       
        g.addAttribute("ui.quality");
        g.addAttribute("ui.antialias");
       
        try {

            g.addAttribute("ui.stylesheet",
                    StyleConverter.convert(new File("test.css")));
        } catch (IOException e) {
            System.err.println("CSS File not found");
        }
       

        g.addNode("A");

        g.addNode("B");

        g.addNode("C");

        g.addEdge("AB", "A", "B");

        g.addEdge("AC", "A", "C");

        g.addEdge("BC", "B", "C");

        g.display();
       
        while (true) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            g.getEdge("AB").setAttribute("ui.color", 1);
        }

    }

}

edge {
    fill-mode: dyn-plain;
    fill-color: white, black;
    size: 1px;
    arrow-shape: arrow;
}


Test.css:

Am 14.11.2013 12:14, schrieb Antoine Dutot:
I Eduardo,

The last commit should improve things. It will be available as downloadable packages tomorrow in the nightly builds : http://graphstream-project.org/pub/1.x/nightly-build/last/

Please could you test it and tell us if it works ?

Antoine


2013/11/13 Eduardo Lidanski <eduardo.lidanski AT pikolab.net>
Hi,

attached are three screenshots. When the node 18 is added, the graph becomes smaller, then bigger again (after the edge is added). I hope with the images it is easy to understand what is the problem.

Thank you
Eduardo

Am 13.11.2013 17:18, schrieb Eduardo Lidanski:

Hi,

I have a graph where I add nodes constantly and after some few time after each graph.addNode() operation I add an edge of the node.
So I have:
Node n = graph.addNode()
//some time passes
Edge n_a = graph.addEdge()

Normally, the time between adding the node and adding its edge is less than 1 second, but in my application I cannot know that for advance, since it is possible that no edge is being added.
it works well, but each time a node is added, the whole graph flickers ... so it is very annoying.
I think that is because the node adds itself at the upper right corner of the graph, a second after that it adds its edge, and this causes the flickering.
But do you know what can I do to prevent the flickering ?
I tried to create a thread that adds the node and the edge together after 1 second if an edge has been found in that second. If not, it adds the node alone. This prevents the flickering, but is not good for my application.
What else could I do?

I noticed the node appears at the very far end up, so the graph becomes for a small second very small, and then the graph appears with its normal size again. I think the node is appearing veeery far away, that is why the graph changes its actual size for a second. How can I limit this?

Thanks
Eduardo







Archives gérées par MHonArc 2.6.16.

Top of page