Author: ruschein
Date: 2009-11-23 16:14:02 -0800 (Mon, 23 Nov 2009)
New Revision: 18552

Modified:
   cytoscape/trunk/src/cytoscape/CyNode.java
Log:
Fixed nested network destruction message firing.

Modified: cytoscape/trunk/src/cytoscape/CyNode.java
===================================================================
--- cytoscape/trunk/src/cytoscape/CyNode.java   2009-11-24 00:12:44 UTC (rev 
18551)
+++ cytoscape/trunk/src/cytoscape/CyNode.java   2009-11-24 00:14:02 UTC (rev 
18552)
@@ -245,10 +245,14 @@
                // Sanity check.
                if (graphPerspective == this.graphPerspective)
                        return;
+
+               // Let listeners know that the previous nested network was 
removed
+               if (this.graphPerspective != null) {
+                       
Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.NESTED_NETWORK_DESTROYED,
 this, this.graphPerspective);
+               }
                
                // create a Node Attribute "nested.network.id" for this Node
-               final String networkID = ((CyNetwork)(graphPerspective == null 
? this.graphPerspective
-                                                                               
        : graphPerspective)).getIdentifier();
+               final String networkID = ((CyNetwork)(graphPerspective == null 
? this.graphPerspective : graphPerspective)).getIdentifier();
                this.graphPerspective = graphPerspective;
                
                
Cytoscape.getNodeAttributes().setAttribute(this.getIdentifier(), 
NESTED_NETWORK_ID_ATTR, networkID);
@@ -256,7 +260,7 @@
                // create or update Network Attribute "parent.node.name.list" 
for the Network   
                final String[] attributeNames = 
Cytoscape.getNetworkAttributes().getAttributeNames();
                boolean attrFound = false;
-               for (String name: attributeNames) {
+               for (String name : attributeNames) {
                        if (name.equals(PARENT_NODES_ATTR)) {
                                attrFound = true;
                                break;
@@ -278,7 +282,6 @@
                
                // Let listeners know nested network was assigned to this node.
                if (this.graphPerspective == null) {
-                       
Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.NESTED_NETWORK_DESTROYED,
 this, null);
                } else {
                        
Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.NESTED_NETWORK_CREATED,
 this, graphPerspective);
                }

--

You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=.


Reply via email to