Author: jm
Date: 2012-05-07 09:34:32 -0700 (Mon, 07 May 2012)
New Revision: 29131

Modified:
   
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/EdgeBendVisualProperty.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/vizmap/VisualStyleSerializer.java
Log:
Fixes #949: EmptyBendImpl now returns reasonable defaults instead of throwing 
exceptions

Modified: 
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/EdgeBendVisualProperty.java
===================================================================
--- 
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/EdgeBendVisualProperty.java
 2012-05-07 16:25:52 UTC (rev 29130)
+++ 
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/EdgeBendVisualProperty.java
 2012-05-07 16:34:32 UTC (rev 29131)
@@ -87,12 +87,12 @@
 
                @Override
                public int getIndex(Handle handle) {
-                       throw new UnsupportedOperationException("This is a 
default immutable Bend object.");
+                       return -1;
                }
 
                @Override
                public String getSerializableString() {
-                       throw new UnsupportedOperationException("This is a 
default immutable Bend object.");
+                       return null;
                }
        }
 }

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/vizmap/VisualStyleSerializer.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/vizmap/VisualStyleSerializer.java
        2012-05-07 16:25:52 UTC (rev 29130)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/util/vizmap/VisualStyleSerializer.java
        2012-05-07 16:34:32 UTC (rev 29131)
@@ -281,11 +281,7 @@
                                if (defValue != null) {
                                        String sValue = null;
                                        
-                                       try {
-                                               sValue = 
vp.toSerializableString(defValue);
-                                       } catch (UnsupportedOperationException 
uoe) {
-                                               // Just ignore
-                                       }
+                                       sValue = 
vp.toSerializableString(defValue);
                                        
                                        if (sValue != null)
                                                vpModel.setDefault(sValue);

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