CyNode click listener in Cytoscape 3 app?

8 views
Skip to first unread message

lindfo...@gmail.com

unread,
Aug 23, 2016, 5:55:44 AM8/23/16
to cytoscape-helpdesk
Hi all,

Is there any explicit way to listen a CyNode click in Cytoscape 3.4.0 app?

So far I have managed to achieve my goal a bit inelegant/bug-prone  way.
I can use the following if-statement in RowsSetListener.handleEvent(RowsSetEvent e)  to investigate if the event came from a node:
if (e.getSource().toString().contains("node")) {
  // It was a CyNode click.
} else {
 // It was not a CyNode click.
}

This idea is based on the assumption that e.getSource().toString() contains a "node" string if and only if the event came from a CyNode.
However I am not really sure if this assumption applies in all cases, perhaps in some specific cases it might contain a "node" string if the event did not come from a CyNode or vice versa.

Any workaround to make this implementation more elegant?
In ideal case I would simply like to check if the event came from a CyNode.

Thanks,
Erno Lindfors

lindfo...@gmail.com

unread,
Aug 23, 2016, 9:12:11 AM8/23/16
to cytoscape-helpdesk
Hi again,

Recently recalled there is a specific group for Cytoscape app related questions:
https://groups.google.com/forum/#!forum/cytoscape-app-dev

Recently posted this question at the above mentioned group, believe it should be shortly visible there.
Apologies for posting it to a wrong group.

Best,
Erno
Reply all
Reply to author
Forward
0 new messages