Author: clopes
Date: 2012-08-24 14:43:53 -0700 (Fri, 24 Aug 2012)
New Revision: 30272

Modified:
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/AttributeValueUtil.java
   
core3/impl/trunk/io-impl/impl/src/test/resources/testData/xgmml/hiddenAtt.xgmml
Log:
Fixed XGMML Parser bug: "1" not parsed as true for cy:equation and cy:hidden 
attributes.

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/AttributeValueUtil.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/AttributeValueUtil.java
    2012-08-24 21:38:46 UTC (rev 30271)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/AttributeValueUtil.java
    2012-08-24 21:43:53 UTC (rev 30272)
@@ -173,10 +173,8 @@
        
        final String name = atts.getValue("name");
        final String type = atts.getValue("type");
-       final String equationStr = atts.getValue("cy:equation");
-       final boolean isEquation = equationStr != null ? 
Boolean.parseBoolean(equationStr) : false;
-       final String hiddenStr = atts.getValue("cy:hidden");
-       final boolean isHidden = hiddenStr != null ? 
Boolean.parseBoolean(hiddenStr) : false;
+       final boolean isEquation = 
ObjectTypeMap.fromXGMMLBoolean(atts.getValue("cy:equation"));
+       final boolean isHidden = 
ObjectTypeMap.fromXGMMLBoolean(atts.getValue("cy:hidden"));
         
                final CyIdentifiable curElement = manager.getCurrentElement();
                CyNetwork curNet = manager.getCurrentNetwork();

Modified: 
core3/impl/trunk/io-impl/impl/src/test/resources/testData/xgmml/hiddenAtt.xgmml
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/test/resources/testData/xgmml/hiddenAtt.xgmml 
    2012-08-24 21:38:46 UTC (rev 30271)
+++ 
core3/impl/trunk/io-impl/impl/src/test/resources/testData/xgmml/hiddenAtt.xgmml 
    2012-08-24 21:43:53 UTC (rev 30272)
@@ -4,12 +4,12 @@
        xmlns:cy="http://www.cytoscape.org"; xmlns="http://www.cs.rpi.edu/XGMML";
        directed="1">
        
-       <att type="boolean" name="test" value="1" cy:hidden="false" />
-       <att type="integer" name="_private_int" value="1" cy:hidden="true" />
+       <att type="boolean" name="test" value="1" cy:hidden="0" />
+       <att type="integer" name="_private_int" value="1" cy:hidden="1" />
        
        <node label="node1" id="-1">
-               <att type="string" name="name" value="node 1" />
-               <att type="string" name="_private_str" value="_v1" 
cy:hidden="true" />
+               <att type="string" name="name" value="node 1" cy:hidden="false" 
/>
+               <att type="string" name="_private_str" value="_v1" 
cy:hidden="true" /> <!-- should also accept true/false -->
                <att type="list" name="list_1">
                        <att type="string" value="a" />
                        <att type="string" value="b" />
@@ -17,14 +17,14 @@
        </node>
        <node label="node2" id="-2">
                <att type="string" name="name" value="node 2" />
-               <att type="string" name="_private_str" value="_v2" 
cy:hidden="true" />
-               <att type="list" name="_private_list" cy:hidden="true">
+               <att type="string" name="_private_str" value="_v2" 
cy:hidden="1" />
+               <att type="list" name="_private_list" cy:hidden="1">
                        <att type="string" value="c" />
                        <att type="string" value="d" />
                </att>
        </node>
        <edge label="node1 (DirectedEdge) node2" source="-1" target="-2">
                <att type="string" name="name" value="node1 (DirectedEdge) 
node2" />
-               <att type="real" name="_private_real" value="0.1" 
cy:hidden="true" />
+               <att type="real" name="_private_real" value="0.1" cy:hidden="1" 
/>
        </edge>
 </graph>

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