Author: ruschein
Date: 2011-03-24 15:59:24 -0700 (Thu, 24 Mar 2011)
New Revision: 24592

Modified:
   
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/EqnSupport.java
   
core3/table-browser-impl/trunk/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
Log:
Fixed a couple of column-type vs. equation-type incompatibility bugs.

Modified: 
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/EqnSupport.java
===================================================================
--- 
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/EqnSupport.java
      2011-03-24 22:55:11 UTC (rev 24591)
+++ 
core3/model-impl/trunk/impl/src/main/java/org/cytoscape/model/internal/EqnSupport.java
      2011-03-24 22:59:24 UTC (rev 24592)
@@ -108,6 +108,12 @@
                if (columnType == Boolean.class && resultType == Double.class)
                        return (Double)result == 0.0 ? Boolean.FALSE : 
Boolean.TRUE;
 
+               if (columnType == Integer.class && resultType == Double.class)
+                       return ((Double)result).intValue();
+
+               if (columnType == Integer.class && resultType == Long.class)
+                       return ((Long)result).intValue();
+
                throw new IllegalArgumentException("unexpected equation result 
type " + resultType
                                                   + " for a column of type " + 
columnType + "!");
        }

Modified: 
core3/table-browser-impl/trunk/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
===================================================================
--- 
core3/table-browser-impl/trunk/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
  2011-03-24 22:55:11 UTC (rev 24591)
+++ 
core3/table-browser-impl/trunk/src/main/java/org/cytoscape/browser/internal/BrowserTableModel.java
  2011-03-24 22:59:24 UTC (rev 24592)
@@ -442,7 +442,7 @@
                        return true;
                if (columnType == String.class) // Anything can be trivially 
converted to a string.
                        return true;
-               if (columnType == Integer.class && eqnType == Long.class)
+               if (columnType == Integer.class && (eqnType == Long.class || 
eqnType == Double.class))
                        return true;
                if (columnType == Double.class && eqnType == Long.class)
                        return true;

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