When the NETWORK_DESTROYED event is fired, it is fired before the actual destruction of the network. This is to give listeners a chance to do any cleanup related to the destruction of the network that requires any references held by the network. Once the network is actually destroyed the references are lost.
Are you calling enableForNetworkAndView() directly when you receive the NETWORK_DESTROYED event? That may cause the behavior you see, because the network is still around. It is better to place the call inside the menuSelected() method, that way the code to enable/disable the network item will be done at a time when the menu is selected and the network will have already been destroyed.
This is done in many of the CytoscapeActions, see DestroyNetworkViewAction for details. If you are already embedding the call to enableForNetworkAndView in the menuSelected(), then something else must be going wrong. If that's the case, let me know and I'll see if I can help you track down the problem.
AllanK
Allan Kuchinsky
Principal Project Scientist
Molecular Tools
Agilent Laboratories
Agilent Technologies, Inc.
Santa Clara, CA, USA
408.553.2423
allan_k...@agilent.com
--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To post to this group, send email to
cytoscape...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cytoscape-helpdesk?hl=.