Author: mes
Date: 2010-08-17 15:03:20 -0700 (Tue, 17 Aug 2010)
New Revision: 21413

Modified:
   
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyDataTableImpl.java
   core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyDataTableTest.java
Log:
added support for row set microlistener

Modified: 
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyDataTableImpl.java
===================================================================
--- 
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyDataTableImpl.java
      2010-08-17 22:02:48 UTC (rev 21412)
+++ 
core3/model-impl/trunk/src/main/java/org/cytoscape/model/internal/CyDataTableImpl.java
      2010-08-17 22:03:20 UTC (rev 21413)
@@ -43,10 +43,10 @@
 import org.cytoscape.event.CyEventHelper;
 import org.cytoscape.model.CyDataTable;
 import org.cytoscape.model.CyRow;
-import org.cytoscape.model.CyRowListener;
 import org.cytoscape.model.SUIDFactory;
 import org.cytoscape.model.events.ColumnCreatedEvent;
 import org.cytoscape.model.events.ColumnDeletedEvent;
+import org.cytoscape.model.events.RowSetMicroListener;
 
 /**
  * 
@@ -55,7 +55,6 @@
 
        private final Map<String, Map<Long, Object>> attributes;
        private final Map<Long, CyRow> rows;
-       private final Map<Long, List<CyRowListener>> rowListeners;
 
        private final Map<String, Class<?>> types;
        private final Map<String, Boolean> unique;
@@ -91,7 +90,6 @@
                this.eventHelper = eventHelper;
                attributes = new HashMap<String, Map<Long, Object>>();
                rows = new HashMap<Long, CyRow>();
-               rowListeners = new HashMap<Long, List<CyRowListener>>();
 
                if (typeMap == null) {
                        types = new HashMap<String, Class<?>>();
@@ -316,10 +314,7 @@
                        // TODO this is an implicit addRow - not sure if we 
want to refactor
                        // this or not
                        vls.put(suid, value);
-                       final List<CyRowListener> lrl = rowListeners.get(suid);
-                       if (lrl != null)
-                               for (CyRowListener rl : lrl)
-                                       rl.rowSet(attrName, value);
+                       eventHelper.getMicroListener(RowSetMicroListener.class, 
this).handleRowSet(getRow(suid), attrName,value);
                } else
                        throw new IllegalArgumentException("value is not of 
type: "
                                        + types.get(attrName));
@@ -491,21 +486,6 @@
                        return table;
                }
 
-               public void addRowListener(CyRowListener rl) {
-                       List<CyRowListener> list = rowListeners.get(suid);
-                       if (list == null) {
-                               list = new ArrayList<CyRowListener>();
-                               rowListeners.put(suid, list);
-                       }
-                       list.add(rl);
-               }
-
-               public void removeRowListener(CyRowListener rl) {
-                       List<CyRowListener> list = rowListeners.get(suid);
-                       if (list != null)
-                               list.remove(rl);
-               }
-               
                @Override
                public String toString() {
                        final StringBuilder builder = new StringBuilder();

Modified: 
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyDataTableTest.java
===================================================================
--- 
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyDataTableTest.java   
    2010-08-17 22:02:48 UTC (rev 21412)
+++ 
core3/model-impl/trunk/src/test/java/org/cytoscape/model/CyDataTableTest.java   
    2010-08-17 22:03:20 UTC (rev 21413)
@@ -39,6 +39,7 @@
 import org.cytoscape.event.DummyCyEventHelper;
 import org.cytoscape.model.internal.CyDataTableImpl;
 
+
 /**
  * DOCUMENT ME!
  */
@@ -48,9 +49,9 @@
         * DOCUMENT ME!
         */
        public void setUp() {
-               
-               CyEventHelper helper = new DummyCyEventHelper(); 
-               mgr = new CyDataTableImpl(null, "homer", true, helper);
+
+               eventHelper = new DummyCyEventHelper();
+               mgr = new CyDataTableImpl(null, "homer", true, eventHelper);
                attrs = mgr.getRow(1);
        }
 

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