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