Author: Christian Lopes
Date: 2011-05-13 13:18:42 -0700 (Fri, 13 May 2011)
New Revision: 25056

Modified:
   
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/write/xgmml/XGMMLWriter.java
Log:
Fixed error when serializing transparency properties to XGMML graphics (must 
convert transparency values from 0-255 to 0-1.0)

Modified: 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/write/xgmml/XGMMLWriter.java
===================================================================
--- 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/write/xgmml/XGMMLWriter.java
    2011-05-13 20:05:37 UTC (rev 25055)
+++ 
core3/io-impl/trunk/src/main/java/org/cytoscape/io/internal/write/xgmml/XGMMLWriter.java
    2011-05-13 20:18:42 UTC (rev 25056)
@@ -484,7 +484,14 @@
             Object value = view.getVisualProperty(vp);
 
             if (key != null && value != null) {
-                value = vp.toSerializableString(value);
+                if (key.toLowerCase().contains("transparency") && value 
instanceof Integer) {
+                    // Cytoscape's XGMML specifies transparency as between 
0-1.0 when it is a <graphics> attribute!
+                    float transparency  = ((Integer) value).floatValue();
+                    value = transparency / 255;
+                } else {
+                    value = vp.toSerializableString(value);
+                }
+                
                 if (value != null) writeAttributePair(key, value);
             }
         }

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