GraphStream Users

Archives de la liste Aide


Issue with rendering nodes in a view


Chronologique Discussions 
  • From: Karina Mocinecová <karina.mocinecova AT gmail.com>
  • To: users AT graphstream-project.org, dev AT graphstream-project.org
  • Subject: Issue with rendering nodes in a view
  • Date: Thu, 8 Mar 2018 14:54:59 +0100

Dear sir or madam,

I am using your libraries available online at http://graphstream-project.org/ and I have one issue that I was hoping you can help me with.

I want to render a node in view on mouse-click at the exact same positions where I have clicked. To accomplish that I am using this code snippet:


view.addMouseListener(new MouseListener() {

            @Override
            public void mouseClicked(MouseEvent e) {
                Point3 gu = view.getCamera().transformPxToGu(e.getX(), e.getY());
                Node node = graph.addNode(name);
                node.setAttribute("xyz", gu.x, gu.y, 0);
            }


The problem is, that the node is shifted after rendering from the position where it should have appeard. It's not being shifted for the same constant of pixels. Only time the rendering works properly is when I have set resolution for 1600x900. What influence does the resulution have on setting of xyz attributes of a node? If it is not because of the resolution, do you have any suggestions what should I look into to solve the problem. I am adding the view into my own JPanel. Can that be the cause of my persisting issue?


Thank you for your help.

I am looking forward to hear from you.


Best regards,

Kaniôčka


---
Táto správa bola skontrolovaná na prítomnosť vírusov programom Avast
Antivirus.
https://www.avast.com/antivirus




Archives gérées par MHonArc 2.6.16.

Top of page