Author: oriol
Date: 2012-10-30 06:19:29 -0700 (Tue, 30 Oct 2012)
New Revision: 30721

Modified:
   
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyRootNetworkImpl.java
Log:
Add remove tables associated to a subnetwork

Modified: 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyRootNetworkImpl.java
===================================================================
--- 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyRootNetworkImpl.java
  2012-10-30 00:26:44 UTC (rev 30720)
+++ 
core3/impl/trunk/model-impl/impl/src/main/java/org/cytoscape/model/internal/CyRootNetworkImpl.java
  2012-10-30 13:19:29 UTC (rev 30721)
@@ -138,6 +138,7 @@
 
        @Override
        public void dispose() {
+               Map<String, CyTable> tableMap;
                serviceRegistrar.unregisterAllServices(columnAdder);
                serviceRegistrar.unregisterAllServices(nameSetListener);
                serviceRegistrar.unregisterAllServices(interactionSetListener);
@@ -147,7 +148,7 @@
                for (CySubNetwork network : subNetworks) {
                        network.dispose();
                }
-               Map<String, CyTable> tableMap = networkTableMgr.getTables(this, 
CyNetwork.class);
+               tableMap = networkTableMgr.getTables(this, CyNetwork.class);
                for(CyTable table : tableMap.values() )
                {
                        tableMgr.deleteTableInternal(table.getSUID(),true);
@@ -336,6 +337,23 @@
 
                // clean up pointers for nodes in subnetwork
                sub.removeNodes(sub.getNodeList());
+               Map<String, CyTable> tableMap;
+               
+               tableMap = networkTableMgr.getTables(sub, CyNetwork.class);
+               for(CyTable table : tableMap.values() )
+               {
+                       tableMgr.deleteTableInternal(table.getSUID(),true);
+               }
+               tableMap = networkTableMgr.getTables(sub, CyNode.class);
+               for(CyTable table : tableMap.values() )
+               {
+                       tableMgr.deleteTableInternal(table.getSUID(),true);
+               }
+           tableMap = networkTableMgr.getTables(sub, CyEdge.class);
+               for(CyTable table : tableMap.values() )
+               {
+                       tableMgr.deleteTableInternal(table.getSUID(),true);
+               }
 
                subNetworks.remove( sub );
                sub.dispose();

-- 
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=en.

Reply via email to