Author: thully
Date: 2012-12-06 16:56:33 -0800 (Thu, 06 Dec 2012)
New Revision: 30917

Removed:
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributes.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributeTaskTest.java
Modified:
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/CyActivator.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/AbstractLoadAttributesTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/CombineReaderAndMappingTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImpl.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImpl.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTaskFactoryImpl.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImplTest.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImplTest.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MapTableToNetworkTableTaskTest.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MappingIntegrationTest.java
Log:
Fix for #1579 - removed no-longer-needed class UpdateAddedNetworkAttributes and 
its hooks in core-task-impl

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/CyActivator.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/CyActivator.java
  2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/CyActivator.java
  2012-12-07 00:56:33 UTC (rev 30917)
@@ -45,13 +45,11 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyNetworkTableManager;
 import org.cytoscape.model.CyTableManager;
-import org.cytoscape.model.events.NetworkAddedListener;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
 import org.cytoscape.property.CyProperty;
 import org.cytoscape.service.util.AbstractCyActivator;
 import org.cytoscape.session.CyNetworkNaming;
 import org.cytoscape.session.CySessionManager;
-import org.cytoscape.session.events.SessionLoadedListener;
 import org.cytoscape.task.NetworkCollectionTaskFactory;
 import org.cytoscape.task.NetworkTaskFactory;
 import org.cytoscape.task.NetworkViewCollectionTaskFactory;
@@ -140,7 +138,6 @@
 import org.cytoscape.task.internal.table.MapGlobalToLocalTableTaskFactoryImpl;
 import 
org.cytoscape.task.internal.table.MapTableToNetworkTablesTaskFactoryImpl;
 import org.cytoscape.task.internal.table.RenameColumnTaskFactoryImpl;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.task.internal.title.EditNetworkTitleTaskFactoryImpl;
 import org.cytoscape.task.internal.vizmap.ApplyVisualStyleTaskFactoryimpl;
 import org.cytoscape.task.internal.vizmap.ClearEdgeBendTaskFactory;
@@ -297,16 +294,10 @@
                
                DynamicTaskFactoryProvisionerImpl 
dynamicTaskFactoryProvisionerImpl = new 
DynamicTaskFactoryProvisionerImpl(cyApplicationManagerServiceRef);
                registerAllServices(bc, dynamicTaskFactoryProvisionerImpl, new 
Properties());
-               
 
-               UpdateAddedNetworkAttributes updateAddedNetworkAttributes = new 
UpdateAddedNetworkAttributes(mapGlobal, synchronousTaskManagerServiceRef);
-               registerService(bc, updateAddedNetworkAttributes, 
NetworkAddedListener.class, new Properties());
-               registerService(bc, updateAddedNetworkAttributes, 
SessionLoadedListener.class, new Properties());
+               LoadAttributesFileTaskFactoryImpl loadAttrsFileTaskFactory = 
new LoadAttributesFileTaskFactoryImpl(cyDataTableReaderManagerServiceRef, 
tunableSetterServiceRef,cyNetworkManagerServiceRef, cyTableManagerServiceRef, 
rootNetworkManagerServiceRef );
+               LoadAttributesURLTaskFactoryImpl loadAttrsURLTaskFactory = new 
LoadAttributesURLTaskFactoryImpl(cyDataTableReaderManagerServiceRef, 
tunableSetterServiceRef, cyNetworkManagerServiceRef, cyTableManagerServiceRef, 
rootNetworkManagerServiceRef);
                
-
-               LoadAttributesFileTaskFactoryImpl loadAttrsFileTaskFactory = 
new LoadAttributesFileTaskFactoryImpl(cyDataTableReaderManagerServiceRef, 
tunableSetterServiceRef,cyNetworkManagerServiceRef, cyTableManagerServiceRef, 
updateAddedNetworkAttributes,rootNetworkManagerServiceRef );
-               LoadAttributesURLTaskFactoryImpl loadAttrsURLTaskFactory = new 
LoadAttributesURLTaskFactoryImpl(cyDataTableReaderManagerServiceRef, 
tunableSetterServiceRef, cyNetworkManagerServiceRef, cyTableManagerServiceRef, 
updateAddedNetworkAttributes, rootNetworkManagerServiceRef);
-               
                // Apply Visual Style Task
                ApplyVisualStyleTaskFactoryimpl applyVisualStyleTaskFactory = 
new ApplyVisualStyleTaskFactoryimpl(visualMappingManagerServiceRef);
                Properties applyVisualStyleProps = new Properties();
@@ -1073,7 +1064,7 @@
 
                // TODO: remove from group...
 
-               MapTableToNetworkTablesTaskFactoryImpl mapNetworkToTables = new 
MapTableToNetworkTablesTaskFactoryImpl(cyNetworkManagerServiceRef, 
tunableSetterServiceRef, updateAddedNetworkAttributes, 
rootNetworkManagerServiceRef);
+               MapTableToNetworkTablesTaskFactoryImpl mapNetworkToTables = new 
MapTableToNetworkTablesTaskFactoryImpl(cyNetworkManagerServiceRef, 
tunableSetterServiceRef, rootNetworkManagerServiceRef);
                Properties mapNetworkToTablesProps = new Properties();
                registerService(bc, mapNetworkToTables, 
MapTableToNetworkTablesTaskFactory.class, mapNetworkToTablesProps);
                

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/AbstractLoadAttributesTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/AbstractLoadAttributesTask.java
     2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/AbstractLoadAttributesTask.java
     2012-12-07 00:56:33 UTC (rev 30917)
@@ -8,7 +8,6 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.AbstractTask;
 import org.cytoscape.work.TaskMonitor;
 
@@ -18,15 +17,13 @@
        private final CyTableReaderManager mgr;
        private final CyNetworkManager netMgr;
        private final CyTableManager tableMgr;
-       private final UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
        private final CyRootNetworkManager rootNetMgr;
        
        public AbstractLoadAttributesTask(final CyTableReaderManager mgr, final 
CyNetworkManager netMgr, final CyTableManager tabelMgr, 
-                       final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes,  final CyRootNetworkManager rootNetMgr) {
+                       final CyRootNetworkManager rootNetMgr) {
                this.mgr = mgr;
                this.netMgr = netMgr;
                this.tableMgr = tabelMgr;
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetMgr = rootNetMgr;
        }
 
@@ -41,7 +38,7 @@
 
                taskMonitor.setStatusMessage("Importing Data Table...");
                
-               insertTasksAfterCurrentTask(new CombineReaderAndMappingTask( 
reader, netMgr, updateAddedNetworkAttributes, rootNetMgr));
+               insertTasksAfterCurrentTask(new CombineReaderAndMappingTask( 
reader, netMgr, rootNetMgr));
                //, new AddImportedTableTask(tableMgr, reader)); //imported 
tables are not getting registered anymore
                
        }

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/CombineReaderAndMappingTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/CombineReaderAndMappingTask.java
    2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/CombineReaderAndMappingTask.java
    2012-12-07 00:56:33 UTC (rev 30917)
@@ -1,18 +1,16 @@
 package org.cytoscape.task.internal.loaddatatable;
 
+import static org.cytoscape.work.TunableValidator.ValidationState.OK;
+
 import org.cytoscape.io.read.CyTableReader;
 import org.cytoscape.model.CyNetworkManager;
-import org.cytoscape.model.CyTable;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.MapTableToNetworkTablesTask;
 import org.cytoscape.task.internal.table.JoinTablesTask;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.AbstractTask;
 import org.cytoscape.work.ContainsTunables;
 import org.cytoscape.work.ProvidesTitle;
 import org.cytoscape.work.TaskMonitor;
 import org.cytoscape.work.TunableValidator;
-import static org.cytoscape.work.TunableValidator.ValidationState.OK;
 
 public class CombineReaderAndMappingTask extends AbstractTask implements 
TunableValidator {
 
@@ -35,7 +33,7 @@
        public CyTableReader readerTask;
 
        
-       public CombineReaderAndMappingTask(CyTableReader readerTask , 
CyNetworkManager networkManager, final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes, final CyRootNetworkManager rootNetMgr){
+       public CombineReaderAndMappingTask(CyTableReader readerTask , 
CyNetworkManager networkManager, final CyRootNetworkManager rootNetMgr){
                this.readerTask = readerTask;
                this.mergeTablesTask = new JoinTablesTask(readerTask, 
rootNetMgr, networkManager);
        //      this.mappingTask = new 
MapTableToNetworkTablesTask(networkManager, readerTask, 
updateAddedNetworkAttributes, rootNetMgr);

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTask.java
 2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTask.java
 2012-12-07 00:56:33 UTC (rev 30917)
@@ -7,7 +7,6 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.TaskMonitor;
 import org.cytoscape.work.Tunable;
 
@@ -17,8 +16,8 @@
        public File file;
 
        public LoadAttributesFileTask(final CyTableReaderManager mgr,  final 
CyNetworkManager netMgr, final CyTableManager tabelMgr, 
-                       final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes, final CyRootNetworkManager rootNetMgr) {
-               super(mgr, netMgr, tabelMgr, updateAddedNetworkAttributes, 
rootNetMgr);
+                       final CyRootNetworkManager rootNetMgr) {
+               super(mgr, netMgr, tabelMgr, rootNetMgr);
        }
 
        /**

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImpl.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImpl.java
      2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImpl.java
      2012-12-07 00:56:33 UTC (rev 30917)
@@ -9,7 +9,6 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.task.read.LoadTableFileTaskFactory;
 import org.cytoscape.work.AbstractTaskFactory;
 import org.cytoscape.work.TaskIterator;
@@ -22,21 +21,19 @@
        private final TunableSetter tunableSetter; 
        private final CyNetworkManager netMgr;
        private final CyTableManager tableMgr;
-       private final UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
        private final CyRootNetworkManager rootNetMgr;
        
        public LoadAttributesFileTaskFactoryImpl(CyTableReaderManager mgr, 
TunableSetter tunableSetter,  final CyNetworkManager netMgr, 
-                       final CyTableManager tabelMgr, final 
UpdateAddedNetworkAttributes updateAddedNetworkAttributes, final 
CyRootNetworkManager rootNetMgr) {
+                       final CyTableManager tabelMgr,final 
CyRootNetworkManager rootNetMgr) {
                this.mgr = mgr;
                this.tunableSetter = tunableSetter;
                this.netMgr = netMgr;
                this.tableMgr = tabelMgr;
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetMgr = rootNetMgr;
        }
 
        public TaskIterator createTaskIterator() {
-               return new TaskIterator(2, new LoadAttributesFileTask(mgr, 
netMgr, tableMgr, updateAddedNetworkAttributes, rootNetMgr));
+               return new TaskIterator(2, new LoadAttributesFileTask(mgr, 
netMgr, tableMgr, rootNetMgr));
        }
 
        @Override

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTask.java
  2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTask.java
  2012-12-07 00:56:33 UTC (rev 30917)
@@ -7,7 +7,6 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.ProvidesTitle;
 import org.cytoscape.work.TaskMonitor;
 import org.cytoscape.work.Tunable;
@@ -19,8 +18,8 @@
        public URL url;
 
        public LoadAttributesURLTask(final CyTableReaderManager mgr,  final 
CyNetworkManager netMgr, final CyTableManager tableMgr, 
-                       final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes, final CyRootNetworkManager rootNetMgr) {
-               super(mgr, netMgr, tableMgr, updateAddedNetworkAttributes, 
rootNetMgr);
+                       final CyRootNetworkManager rootNetMgr) {
+               super(mgr, netMgr, tableMgr, rootNetMgr);
        }
 
        /**

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImpl.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImpl.java
       2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImpl.java
       2012-12-07 00:56:33 UTC (rev 30917)
@@ -9,8 +9,6 @@
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
-import org.cytoscape.task.read.LoadTableFileTaskFactory;
 import org.cytoscape.task.read.LoadTableURLTaskFactory;
 import org.cytoscape.work.AbstractTaskFactory;
 import org.cytoscape.work.TaskIterator;
@@ -24,21 +22,19 @@
        private final TunableSetter tunableSetter; 
        private  final CyNetworkManager netMgr;
        private final CyTableManager tableMgr;
-       private final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes; 
        private final CyRootNetworkManager rootNetMgr;
        
        public LoadAttributesURLTaskFactoryImpl(CyTableReaderManager mgr, 
TunableSetter tunableSetter,  final CyNetworkManager netMgr,
-                       final CyTableManager tabelMgr, final 
UpdateAddedNetworkAttributes updateAddedNetworkAttributes, final 
CyRootNetworkManager rootNetMgr) {
+                       final CyTableManager tabelMgr, final 
CyRootNetworkManager rootNetMgr) {
                this.mgr = mgr;
                this.tunableSetter = tunableSetter;
                this.netMgr = netMgr;
                this.tableMgr = tabelMgr;
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetMgr = rootNetMgr;
        }
 
        public TaskIterator createTaskIterator() {
-               return new TaskIterator(2, new LoadAttributesURLTask(mgr, 
netMgr, tableMgr, updateAddedNetworkAttributes, rootNetMgr));
+               return new TaskIterator(2, new LoadAttributesURLTask(mgr, 
netMgr, tableMgr, rootNetMgr));
        }
 
        @Override

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTask.java
    2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTask.java
    2012-12-07 00:56:33 UTC (rev 30917)
@@ -55,7 +55,6 @@
        private final  CyTableReader reader;
        private final boolean byReader;
        private Map<String, CyNetwork> name2NetworkMap;
-       private final UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
 
 
        @Tunable(description = "Import Data To:")
@@ -75,26 +74,24 @@
        }
 
 
-       public MapTableToNetworkTablesTask(final CyNetworkManager 
networkManager, final CyTableReader reader, final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes, final CyRootNetworkManager rootNetworkManager ){
+       public MapTableToNetworkTablesTask(final CyNetworkManager 
networkManager, final CyTableReader reader, final CyRootNetworkManager 
rootNetworkManager ){
                this.reader = reader;
                globalTable = null;
                this.byReader = true;
                this.networkManager = networkManager;
                this.name2NetworkMap = new HashMap<String, CyNetwork>();
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetworkManager = rootNetworkManager;
                
                initTunable(networkManager);
 
        }
 
-       public MapTableToNetworkTablesTask(final CyNetworkManager 
networkManager, final CyTable globalTable, final UpdateAddedNetworkAttributes 
updateAddedNetworkAttributes, final CyRootNetworkManager rootNetworkManager){
+       public MapTableToNetworkTablesTask(final CyNetworkManager 
networkManager, final CyTable globalTable, final CyRootNetworkManager 
rootNetworkManager){
                this.networkManager = networkManager;
                this.globalTable = globalTable;
                this.byReader = false;
                this.reader = null;
                this.name2NetworkMap = new HashMap<String, CyNetwork>();
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetworkManager = rootNetworkManager;
 
                initTunable(networkManager);
@@ -126,25 +123,10 @@
                if (tableType == TableType.GLOBAL )
                        return;
 
-               List<CyNetwork> networks = new ArrayList<CyNetwork>();
-
                if (!selectedNetworksOnly)
                        mapTableToDefaultAttrs (tableType);
                else
-                       mapTableToLocalAttrs (tableType);
-
-               
-                       if(!selectedNetworksOnly){ //if table should be mapped 
to all of the tables
-                               //add each mapped table to the list for mapping 
to networks going to be added later
-                               if(byReader){
-                                       if (reader.getTables() != null && 
reader.getTables().length >0)
-                                               for(CyTable sourceTable : 
reader.getTables())
-                                                       
updateAddedNetworkAttributes.addMappingToList(sourceTable, tableType.getType());
-                               }else
-                                       
updateAddedNetworkAttributes.addMappingToList(globalTable, tableType.getType());
-
-                       }
-                
+                       mapTableToLocalAttrs (tableType);                
        }
 
 

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTaskFactoryImpl.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTaskFactoryImpl.java
 2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/MapTableToNetworkTablesTaskFactoryImpl.java
 2012-12-07 00:56:33 UTC (rev 30917)
@@ -23,20 +23,18 @@
        
        private final CyNetworkManager networkManager;
        private final TunableSetter tunableSetter; 
-       private final UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
        private final CyRootNetworkManager rootNetMgr;
        
-       public MapTableToNetworkTablesTaskFactoryImpl( final CyNetworkManager 
networkManager, final TunableSetter tunableSetter, final 
UpdateAddedNetworkAttributes updateAddedNetworkAttributes, final 
CyRootNetworkManager rootNetMgr ){
+       public MapTableToNetworkTablesTaskFactoryImpl( final CyNetworkManager 
networkManager, final TunableSetter tunableSetter, final CyRootNetworkManager 
rootNetMgr ){
        
                this.networkManager = networkManager;
                this.tunableSetter = tunableSetter;
-               this.updateAddedNetworkAttributes = 
updateAddedNetworkAttributes;
                this.rootNetMgr = rootNetMgr;
        }
 
        @Override
        public TaskIterator createTaskIterator(CyTable globalTable) {
-               return new TaskIterator(new 
MapTableToNetworkTablesTask(networkManager, globalTable, 
updateAddedNetworkAttributes, rootNetMgr));
+               return new TaskIterator(new 
MapTableToNetworkTablesTask(networkManager, globalTable, rootNetMgr));
        }
 
        @Override

Deleted: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributes.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributes.java
   2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributes.java
   2012-12-07 00:56:33 UTC (rev 30917)
@@ -1,90 +0,0 @@
-package org.cytoscape.task.internal.table;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.cytoscape.model.events.NetworkAddedEvent;
-import org.cytoscape.model.events.NetworkAddedListener;
-import org.cytoscape.model.CyColumn;
-import org.cytoscape.model.CyEdge;
-import org.cytoscape.model.CyIdentifiable;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTable;
-import org.cytoscape.session.events.SessionLoadedEvent;
-import org.cytoscape.session.events.SessionLoadedListener;
-import org.cytoscape.task.edit.MapGlobalToLocalTableTaskFactory;
-import org.cytoscape.work.SynchronousTaskManager;
-
-/**
- * This class is for updating the tables for a newly added network 
- * and map the global tables that are required to to the specified
- * tables. The core-task-impl package may not be the best place for
- * this class. In case this class needs to be moved to another package
- * an event needs to be added which is fired when an imported table
- * is mapped to all network related tables.
- * @author rozagh
- *
- */
-
-public class UpdateAddedNetworkAttributes implements NetworkAddedListener, 
SessionLoadedListener{
-
-       private final Map<CyTable, List< Class<? extends CyIdentifiable>>> 
tableMappings;
-       private final MapGlobalToLocalTableTaskFactory mappingTF;
-       private final SynchronousTaskManager<?> syncTaskManager;
-
-       public UpdateAddedNetworkAttributes(MapGlobalToLocalTableTaskFactory 
mappingTF, final SynchronousTaskManager<?> syncTaskManager){
-               tableMappings = new HashMap<CyTable, List<Class<? extends 
CyIdentifiable>>>();
-               this.mappingTF = mappingTF;
-               this.syncTaskManager = syncTaskManager;
-       }
-
-       @Override
-       public void handleEvent(NetworkAddedEvent e) {
-               for (CyTable mappedTable: tableMappings.keySet()){
-                       for( Class<? extends CyIdentifiable> tableType: 
tableMappings.get(mappedTable)){
-                               if(! tableAlreadyMapped( 
getTable(e.getNetwork(),tableType), mappedTable )){
-                                       List<CyTable> targetTables = new 
ArrayList<CyTable>();
-                                       targetTables.add( 
getTable(e.getNetwork(),tableType));
-                                       
syncTaskManager.execute(mappingTF.createTaskIterator(mappedTable, 
targetTables));
-                                       }
-                       }
-               }
-
-       }
-
-       private boolean tableAlreadyMapped(CyTable sourceTable, CyTable 
mappedTable) {
-               for(CyColumn col:sourceTable.getColumns() ){
-                       if (col.getVirtualColumnInfo().isVirtual())
-                               if 
(col.getVirtualColumnInfo().getSourceTable().equals(mappedTable))
-                                       return true;
-               }
-               return false;
-       }
-
-       final void addMappingToList(CyTable importedTable,  Class<? extends 
CyIdentifiable> mappedTableType){
-               //When an imported table is mapped add it to the list with the 
type of table it has been mapped to.
-               if (!tableMappings.containsKey(importedTable))
-                       tableMappings.put(importedTable, new ArrayList< Class<? 
extends CyIdentifiable>>());
-
-               tableMappings.get(importedTable).add(mappedTableType);
-       }
-
-       private CyTable getTable(CyNetwork network,  Class<? extends 
CyIdentifiable> tableType){
-               if (tableType == CyNode.class)
-                       return network.getDefaultNodeTable();
-               if (tableType == CyEdge.class)
-                       return network.getDefaultEdgeTable();
-               if (tableType == CyNetwork.class)
-                       return network.getDefaultNetworkTable();
-               return null;
-       }
-
-       @Override
-       public void handleEvent(SessionLoadedEvent e) {
-               tableMappings.clear();
-       }
-
-}

Modified: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImplTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImplTest.java
  2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesFileTaskFactoryImplTest.java
  2012-12-07 00:56:33 UTC (rev 30917)
@@ -2,16 +2,13 @@
 
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
 
 import java.io.File;
 
-import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.io.read.CyTableReaderManager;
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.Task;
 import org.cytoscape.work.TaskIterator;
 import org.cytoscape.work.TaskMonitor;
@@ -36,9 +33,7 @@
        
        @Mock
        CyTableManager tabMgr;
-       @Mock 
-       UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
-
+       
        @Mock
        CyRootNetworkManager rootNetMgr;
        
@@ -51,7 +46,7 @@
        @Test(expected = NullPointerException.class)
        public void testLoadAttributesFileTaskFactory() throws Exception {
 
-               final LoadAttributesFileTaskFactoryImpl factory = new 
LoadAttributesFileTaskFactoryImpl(rmgr, ts, netMgr, tabMgr, 
updateAddedNetworkAttributes, rootNetMgr);
+               final LoadAttributesFileTaskFactoryImpl factory = new 
LoadAttributesFileTaskFactoryImpl(rmgr, ts, netMgr, tabMgr, rootNetMgr);
                TaskIterator ti = factory.createTaskIterator();
                assertNotNull(ti);
 

Modified: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImplTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImplTest.java
   2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/loaddatatable/LoadAttributesURLTaskFactoryImplTest.java
   2012-12-07 00:56:33 UTC (rev 30917)
@@ -5,12 +5,10 @@
 
 import java.net.URL;
 
-import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.io.read.CyTableReaderManager;
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyTableManager;
 import org.cytoscape.model.subnetwork.CyRootNetworkManager;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.Task;
 import org.cytoscape.work.TaskIterator;
 import org.cytoscape.work.TaskMonitor;
@@ -36,9 +34,6 @@
        
        @Mock
        CyTableManager tabMgr;
-       
-       @Mock 
-       UpdateAddedNetworkAttributes updateAddedNetworkAttributes;
 
        @Mock
        CyRootNetworkManager rootNetMgr;
@@ -52,7 +47,7 @@
        @Test(expected = NullPointerException.class)
        public void testLoadAttributesURLTaskFactory() throws Exception {
 
-               final LoadAttributesURLTaskFactoryImpl factory = new 
LoadAttributesURLTaskFactoryImpl(rmgr, ts, netMgr, tabMgr, 
updateAddedNetworkAttributes, rootNetMgr);
+               final LoadAttributesURLTaskFactoryImpl factory = new 
LoadAttributesURLTaskFactoryImpl(rmgr, ts, netMgr, tabMgr, rootNetMgr);
                
                final TaskIterator ti = factory.createTaskIterator();
                assertNotNull(ti);

Modified: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MapTableToNetworkTableTaskTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MapTableToNetworkTableTaskTest.java
 2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MapTableToNetworkTableTaskTest.java
 2012-12-07 00:56:33 UTC (rev 30917)
@@ -1,6 +1,11 @@
 package org.cytoscape.task.internal.table;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
@@ -19,21 +24,18 @@
 import org.cytoscape.model.internal.CyRootNetworkManagerImpl;
 import org.cytoscape.model.internal.CyTableImpl;
 import org.cytoscape.model.subnetwork.CyRootNetwork;
-import org.cytoscape.task.internal.table.MapGlobalToLocalTableTaskFactoryImpl;
-import 
org.cytoscape.task.internal.table.MapTableToNetworkTablesTaskFactoryImpl;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.work.Task;
 import org.cytoscape.work.TaskIterator;
 import org.cytoscape.work.TaskMonitor;
+import org.cytoscape.work.internal.sync.SyncTaskManager;
+import org.cytoscape.work.internal.sync.SyncTunableHandlerFactory;
+import org.cytoscape.work.internal.sync.SyncTunableMutator;
+import org.cytoscape.work.internal.sync.SyncTunableMutatorFactory;
+import org.cytoscape.work.internal.sync.TunableRecorderManager;
+import org.cytoscape.work.internal.sync.TunableSetterImpl;
 import org.junit.Test;
 
-import static org.mockito.Mockito.mock;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import org.cytoscape.work.internal.sync.*;
 
-
 public class MapTableToNetworkTableTaskTest {
 
 
@@ -93,8 +95,7 @@
        
        
        public static void mapping(CyTable table, CyNetwork net, boolean 
selectedOnly) throws Exception{
-               UpdateAddedNetworkAttributes up = new 
UpdateAddedNetworkAttributes(new 
MapGlobalToLocalTableTaskFactoryImpl(mock(CyTableManager.class), netMgr, ts), 
new SyncTaskManager(stm));
-               MapTableToNetworkTablesTaskFactoryImpl mappingTF = new 
MapTableToNetworkTablesTaskFactoryImpl(netMgr, ts, up , rootNetMgr);
+               MapTableToNetworkTablesTaskFactoryImpl mappingTF = new 
MapTableToNetworkTablesTaskFactoryImpl(netMgr, ts, rootNetMgr);
                List<CyNetwork> nets = new ArrayList<CyNetwork>();
                nets.add(net);
                

Modified: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MappingIntegrationTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MappingIntegrationTest.java
 2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/MappingIntegrationTest.java
 2012-12-07 00:56:33 UTC (rev 30917)
@@ -34,12 +34,8 @@
 import org.cytoscape.model.internal.CySubNetworkImpl;
 import org.cytoscape.model.internal.CyTableImpl;
 import org.cytoscape.model.internal.CyTableManagerImpl;
-import org.cytoscape.model.subnetwork.CyRootNetworkManager;
 import org.cytoscape.session.CyNetworkNaming;
 import org.cytoscape.task.internal.creation.NewNetworkSelectedNodesOnlyTask;
-import org.cytoscape.task.internal.table.MapGlobalToLocalTableTaskFactoryImpl;
-import 
org.cytoscape.task.internal.table.MapTableToNetworkTablesTaskFactoryImpl;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
 import org.cytoscape.view.model.CyNetworkViewManager;
 import org.cytoscape.view.model.View;
 import org.cytoscape.view.presentation.RenderingEngineManager;
@@ -47,8 +43,6 @@
 import org.cytoscape.work.Task;
 import org.cytoscape.work.TaskIterator;
 import org.cytoscape.work.TaskMonitor;
-import org.cytoscape.work.TunableHandlerFactory;
-import org.cytoscape.work.internal.sync.SyncTaskManager;
 import org.cytoscape.work.internal.sync.SyncTunableHandlerFactory;
 import org.cytoscape.work.internal.sync.SyncTunableMutator;
 import org.cytoscape.work.internal.sync.SyncTunableMutatorFactory;
@@ -74,7 +68,6 @@
 
        private TunableSetterImpl ts = new TunableSetterImpl(new 
SyncTunableMutatorFactory(syncTunableHandlerFactory),  new 
TunableRecorderManager());
        CyTableManager tabMgr = new CyTableManagerImpl(eventHelper, new 
CyNetworkTableManagerImpl(), netMgr);
-       private UpdateAddedNetworkAttributes up = new 
UpdateAddedNetworkAttributes(new MapGlobalToLocalTableTaskFactoryImpl(tabMgr, 
netMgr, ts), new SyncTaskManager(stm));
        Properties syncFactoryProp = new Properties();
        
        private CyGroupManager groupMgr = mock(CyGroupManager.class);
@@ -223,7 +216,7 @@
        
        public void mapping(CyTable table, CyNetwork net, boolean selectedOnly) 
throws Exception{
                
-               MapTableToNetworkTablesTaskFactoryImpl mappingTF = new 
MapTableToNetworkTablesTaskFactoryImpl(netMgr, ts, up, rootNetMgr);
+               MapTableToNetworkTablesTaskFactoryImpl mappingTF = new 
MapTableToNetworkTablesTaskFactoryImpl(netMgr, ts, rootNetMgr);
                List<CyNetwork> nets = new ArrayList<CyNetwork>();
                nets.add(net);
                

Deleted: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributeTaskTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributeTaskTest.java
    2012-12-07 00:50:43 UTC (rev 30916)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/table/UpdateAddedNetworkAttributeTaskTest.java
    2012-12-07 00:56:33 UTC (rev 30917)
@@ -1,195 +0,0 @@
-package org.cytoscape.task.internal.table;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.cytoscape.ding.NetworkViewTestSupport;
-import org.cytoscape.equations.internal.interpreter.InterpreterImpl;
-import org.cytoscape.event.CyEventHelper;
-import org.cytoscape.event.DummyCyEventHelper;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyRow;
-import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableManager;
-import org.cytoscape.model.NetworkTestSupport;
-import org.cytoscape.model.SavePolicy;
-import org.cytoscape.model.TableTestSupport;
-import org.cytoscape.model.events.NetworkAddedEvent;
-import org.cytoscape.model.internal.CyNetworkManagerImpl;
-import org.cytoscape.model.internal.CyNetworkTableManagerImpl;
-import org.cytoscape.model.internal.CyRootNetworkManagerImpl;
-import org.cytoscape.model.internal.CySubNetworkImpl;
-import org.cytoscape.model.internal.CyTableImpl;
-import org.cytoscape.model.internal.CyTableManagerImpl;
-import org.cytoscape.task.internal.table.MapGlobalToLocalTableTaskFactoryImpl;
-import 
org.cytoscape.task.internal.table.MapTableToNetworkTablesTaskFactoryImpl;
-import org.cytoscape.task.internal.table.UpdateAddedNetworkAttributes;
-import org.cytoscape.work.Task;
-import org.cytoscape.work.TaskIterator;
-import org.cytoscape.work.TaskMonitor;
-import org.cytoscape.work.TunableHandlerFactory;
-import org.cytoscape.work.internal.sync.SyncTaskManager;
-import org.cytoscape.work.internal.sync.SyncTunableHandlerFactory;
-import org.cytoscape.work.internal.sync.SyncTunableMutator;
-import org.cytoscape.work.internal.sync.SyncTunableMutatorFactory;
-import org.cytoscape.work.internal.sync.TunableRecorderManager;
-import org.cytoscape.work.internal.sync.TunableSetterImpl;
-import org.junit.Before;
-import org.junit.Test;
-
-public class UpdateAddedNetworkAttributeTaskTest {
-
-       
-       private final NetworkTestSupport support = new NetworkTestSupport();
-       private final NetworkViewTestSupport viewSupport = new 
NetworkViewTestSupport();
-       private final TableTestSupport tableSupport = new TableTestSupport();
-
-
-       private CyEventHelper eventHelper = new DummyCyEventHelper();
-       private CyNetworkManagerImpl netMgr = new 
CyNetworkManagerImpl(eventHelper);
-       private CyRootNetworkManagerImpl rootNetMgr = new 
CyRootNetworkManagerImpl();
-       
-       private SyncTunableMutator stm = new SyncTunableMutator();
-       SyncTunableHandlerFactory syncTunableHandlerFactory = new 
SyncTunableHandlerFactory();
-       private TunableSetterImpl ts = new TunableSetterImpl(new 
SyncTunableMutatorFactory(syncTunableHandlerFactory),  new 
TunableRecorderManager());
-       CyTableManager tabMgr = new CyTableManagerImpl(eventHelper, new 
CyNetworkTableManagerImpl(), netMgr);
-       private UpdateAddedNetworkAttributes up = new 
UpdateAddedNetworkAttributes(new MapGlobalToLocalTableTaskFactoryImpl(tabMgr, 
netMgr, ts), new SyncTaskManager(stm));
-       Properties syncFactoryProp = new Properties();
-
-       @Test
-       public void testUpdatingAddedNetwork() throws Exception{
-               //set up tunable mutator
-               stm.addTunableHandlerFactory(syncTunableHandlerFactory, 
syncFactoryProp);
-               
-               CyNetwork net1;
-               CyNetwork net2;
-               CyNetwork net3;
-
-               String node1Name = "node1";
-               String node2Name = "node2";
-
-               CyTableImpl table1;
-               CyTableImpl table2;
-               
-               String tabel1sCol = "col1";
-               String table2sCol = "col2";
-               
-               String table1sRow1 = "col1 row1";
-               String table1sRow2 = "col1 row2";
-
-               String table2sRow1 = "col2 row2";
-               String table2sRow2 = "col2 row2";
-               
-               
-               
-               //creating first network with 2 nodes
-               net1 = support.getNetwork();
-               net1.getRow(net1).set(CyNetwork.NAME, "net1");
-               final CyNode node1 =  net1.addNode();
-               final CyNode node2 =  net1.addNode();
-               net1.addEdge(node1, node2, true);
-               
-               
net1.getDefaultNodeTable().getRow(node1.getSUID()).set(CyNetwork.NAME, 
node1Name);
-               
net1.getDefaultNodeTable().getRow(node2.getSUID()).set(CyNetwork.NAME, 
node2Name);
-               
-               netMgr.addNetwork(net1);
-       
-               ((CySubNetworkImpl) net1).handleEvent(new 
NetworkAddedEvent(netMgr, net1));
-       
-               //creating a table for mapping to all networks
-               table1 = new CyTableImpl("dummy table", "ID", String.class, 
true, true, 
-                               SavePolicy.DO_NOT_SAVE , eventHelper, new 
InterpreterImpl(), 2);
-               table1.createColumn(tabel1sCol, String.class, false);
-               
-               CyRow row1 = table1.getRow(node1Name);
-               row1.set(tabel1sCol, table1sRow1);
-               CyRow row2 = table1.getRow(node2Name);
-               row2.set(tabel1sCol, table1sRow2);
-               
-               mapping(table1, net1, false);
-               //check the mapping by task
-               assertNotNull(net1.getDefaultNodeTable().getColumn(tabel1sCol));
-               assertEquals(table1sRow1, 
net1.getDefaultNodeTable().getRow(node1.getSUID()).get(tabel1sCol, 
String.class) );
-               
-               //creating a second network to check if gets updated or not
-               net2 = support.getNetwork();
-               net2.getRow(net2).set(CyNetwork.NAME, "net2");
-
-               final CyNode node3 =  net2.addNode();
-               final CyNode node4 =  net2.addNode();
-               net2.addEdge(node3, node4, true);
-               
-               
net2.getDefaultNodeTable().getRow(node3.getSUID()).set(CyNetwork.NAME, 
node1Name);
-               
net2.getDefaultNodeTable().getRow(node4.getSUID()).set(CyNetwork.NAME, 
node2Name);
-               
-               netMgr.addNetwork(net2);
-               ((CySubNetworkImpl) net2).handleEvent(new 
NetworkAddedEvent(netMgr, net2));
-               tabMgr.addTable(net2.getDefaultNodeTable());
-               
-               up.handleEvent(new NetworkAddedEvent(netMgr, net2));
-               //check if the mapping is done and if the table is updated
-       //      assertNotNull(net2.getDefaultNodeTable().getColumn(tabel1sCol));
-       //      assertEquals(table1sRow1, 
net2.getDefaultNodeTable().getRow(node3.getSUID()).get(tabel1sCol, 
String.class) );
-               
-               //creating another table to map to the second network only
-               table2 = new CyTableImpl("dummy table", "ID", String.class, 
true, true, 
-                               SavePolicy.DO_NOT_SAVE , eventHelper, new 
InterpreterImpl(), 2);
-               table2.createColumn(table2sCol, String.class, false);
-               
-               CyRow row3 = table2.getRow(node1Name);
-               row3.set(table2sCol, table2sRow1);
-               CyRow row4 = table2.getRow(node2Name);
-               row4.set(table2sCol,table2sRow2);
-               
-               mapping(table2, net2, true);
-               //check the mapping by task
-               assertNotNull(net2.getDefaultNodeTable().getColumn(table2sCol));
-               assertEquals(table2sRow1, 
net2.getDefaultNodeTable().getRow(node3.getSUID()).get(table2sCol, 
String.class) );
-               assertNull(net1.getDefaultNodeTable().getColumn(table2sCol)); 
//net1 should not be mapped
-
-               //creating another network to check that updater will add the 
first table but not the second to it
-               net3 = support.getNetwork();
-               net3.getRow(net3).set(CyNetwork.NAME, "net3");
-
-               final CyNode node5 =  net3.addNode();
-               final CyNode node6 =  net3.addNode();
-               net3.addEdge(node5, node6, true);
-               
-               
net3.getDefaultNodeTable().getRow(node5.getSUID()).set(CyNetwork.NAME, 
node1Name);
-               
net3.getDefaultNodeTable().getRow(node6.getSUID()).set(CyNetwork.NAME, 
node2Name);
-               
-               netMgr.addNetwork(net3);
-               ((CySubNetworkImpl) net3).handleEvent(new 
NetworkAddedEvent(netMgr, net3));
-               tabMgr.addTable(net3.getDefaultNodeTable());
-               up.handleEvent(new NetworkAddedEvent(netMgr, net3));
-               //check the mappings
-               
//assertNotNull(net3.getDefaultNodeTable().getColumn(tabel1sCol));
-               //assertEquals(table1sRow1, 
net3.getDefaultNodeTable().getRow(node5.getSUID()).get(tabel1sCol, 
String.class) );
-               //assertNull(net3.getDefaultNodeTable().getColumn(table2sCol)); 
//net3 should not be mapped to table2
-
-
-       }
-       
-       
-       public void mapping(CyTable table, CyNetwork net, boolean selectedOnly 
) throws Exception{
-               
-               MapTableToNetworkTablesTaskFactoryImpl mappingTF = new 
MapTableToNetworkTablesTaskFactoryImpl(netMgr, ts, up, rootNetMgr);
-               List<CyNetwork> nets = new ArrayList<CyNetwork>();
-               nets.add(net);
-               
-               TaskIterator ti = mappingTF.createTaskIterator(table, 
selectedOnly, nets , CyNode.class);
-               assertNotNull("task iterator is null", ti);
-               
-               assertTrue(ti.hasNext());
-               Task t = ti.next();
-               assertNotNull("task is null", t);
-               t.run(mock(TaskMonitor.class));
-       
-       }
-       
-}

-- 
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