Cy3 node selected event

77 views
Skip to first unread message

Jiao, Dazhi

unread,
Jun 24, 2012, 9:56:00 PM6/24/12
to cytoscap...@googlegroups.com

Hi,

 

In Cy3 is there any new way for capture the node selected event? I know in Cy2 one can use the GraphViewChangeEvent in giny but wonder if there is any new method in Cy3 for this types of events.

 

Thanks,


Dazhi

Mike Smoot

unread,
Jun 25, 2012, 12:20:37 AM6/25/12
to cytoscap...@googlegroups.com
Since selected state is now stored as an attribute of the node in the default node table, you can listen to the RowsSetEvent.  When you hear the event, check to see if it's from the table you care about and whether that particular event contains selection events.  Something like this:

void handleEvent(RowsSetEvent e) {
if (e.getSource() != tableICareAbout)
return;
if (!e.containsColumn(CyNetwork.SELECTED)
return;
for (RowSetRecord record : e.getColumnRecords(CyNetwork.SELECTED)) {
// do something for the nodes you care about!
}
}

Mike

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.



--
____________________________________________________________
Michael Smoot, Ph.D.              
UCSD Department of Medicine
tel: 858-822-4756

Jiao, Dazhi

unread,
Jul 2, 2012, 1:49:39 PM7/2/12
to cytoscap...@googlegroups.com

Thanks for the answer. One more question: how do I register a RowsSetListener to listen to the RowsSetEvent? I looked around in the Cy3 API but couldn’t find an “addRowsSetListener” method in any class.

Peng-Liang Wang

unread,
Jul 2, 2012, 2:36:35 PM7/2/12
to cytoscap...@googlegroups.com
There is a cookbook at
http://wiki.cytoscape.org/Cytoscape_3/AppDeveloper/Cytoscape_3_App_Cookbook

Look at sample08.

Peng
Reply all
Reply to author
Forward
0 new messages