Author: kono
Date: 2012-06-11 18:28:07 -0700 (Mon, 11 Jun 2012)
New Revision: 29530

Modified:
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/DVisualLexicon.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/BendImpl.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/AbstractXGMMLReader.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeAttribute.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeGraphics.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandle.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleDone.java
   
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleList.java
Log:
fixes #1058 Bend file information in old session file (created in 2.x) will be 
restored in 3.

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/DVisualLexicon.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/DVisualLexicon.java
      2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/DVisualLexicon.java
      2012-06-12 01:28:07 UTC (rev 29530)
@@ -447,6 +447,8 @@
 
                addIdentifierMapping(CyEdge.class, "edgeSourceArrowColor", 
EDGE_SOURCE_ARROW_UNSELECTED_PAINT);
                addIdentifierMapping(CyEdge.class, "edgeTargetArrowColor", 
EDGE_TARGET_ARROW_UNSELECTED_PAINT);
+               addIdentifierMapping(CyEdge.class, "edgeHandleList", EDGE_BEND);
+               
                // TODO: missing edge properties
                // 
addIdentifierMapping(CyEdge.class,"edgeLabelOpacity",EDGE_LABEL_TRANSPARENCY);
                // 
addIdentifierMapping(CyEdge.class,"edgeLabelWidth",EDGE_LABEL_WIDTH);

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/BendImpl.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/BendImpl.java
       2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/BendImpl.java
       2012-06-12 01:28:07 UTC (rev 29530)
@@ -73,8 +73,6 @@
        
        public static Bend parseSerializableString(String strRepresentation) {
                
-               //System.out.println("Parsing String: " + strRepresentation);
-               
                final Bend bend = new BendImpl();
                // Validate
                if (strRepresentation == null)
@@ -85,12 +83,9 @@
                for(int i=0; i<parts.length; i++) {
                        final String str = parts[i];
                        final Handle handle = 
HandleImpl.parseSerializableString(str);
-                       //System.out.println("Got handle: " + handle);
                        if(handle != null)
                                bend.insertHandleAt(i, handle);
                }
-
-               //System.out.println("Got Bend: " + bend.toString());
                return bend;
        }
 }

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
     2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
     2012-06-12 01:28:07 UTC (rev 29530)
@@ -15,28 +15,27 @@
  * 
  */
 public class HandleImpl implements Handle {
-       
-       private static final String DELIMITER =",";
-       
+
+       private static final String DELIMITER = ",";
+
        private double cosTheta = Double.NaN;
        private double sinTheta = Double.NaN;
        private double ratio = Double.NaN;
-       
+
        // Original handle location
-       private double x = 0;
-       private double y = 0;
-       
+       private double x = Double.NaN;
+       private double y = Double.NaN;
+
        public HandleImpl(double x, double y) {
                this.x = x;
                this.y = y;
        }
 
-
        @Override
        public Point2D calculateHandleLocation(final CyNetworkView graphView, 
final View<CyEdge> view) {
                final CyNode source = view.getModel().getSource();
                final CyNode target = view.getModel().getTarget();
-               
+
                final View<CyNode> sourceView = graphView.getNodeView(source);
                final View<CyNode> targetView = graphView.getNodeView(target);
 
@@ -50,7 +49,7 @@
                        newPoint = convert(sX, sY, tX, tY);
                } else {
                        newPoint = new Point2D.Double();
-                       if(x==0 && y==0) {
+                       if (x == 0 && y == 0) {
                                // If default, use center
                                newPoint.setLocation(tX - sX, tY - sY);
                        } else
@@ -59,12 +58,14 @@
                return newPoint;
        }
 
-       
        @Override
        public void defineHandle(final CyNetworkView graphView, final 
View<CyEdge> view, double x, double y) {
-               this.x = x;
-               this.y = y;
-               convertToRatio(graphView, view, new Point2D.Double(x, y));
+               if(!((Double)x).equals(Double.NaN))
+                       this.x = x;
+               
+               if(!((Double)y).equals(Double.NaN))
+                       this.y = y;
+               convertToRatio(graphView, view, new Point2D.Double(this.x, 
this.y));
        }
 
        private void convertToRatio(final CyNetworkView graphView, View<CyEdge> 
view, final Point2D absolutePoint) {
@@ -76,11 +77,11 @@
                // Location of source node
                final double sX = 
sourceView.getVisualProperty(DVisualLexicon.NODE_X_LOCATION);
                final double sY = 
sourceView.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION);
-
+               
                // Location of target node
                final double tX = 
targetView.getVisualProperty(DVisualLexicon.NODE_X_LOCATION);
-               final double tY = 
targetView.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION);
-
+               final double tY = 
targetView.getVisualProperty(DVisualLexicon.NODE_Y_LOCATION); 
+               
                // Location of handle
                final double hX = absolutePoint.getX();
                final double hY = absolutePoint.getY();
@@ -89,45 +90,45 @@
                // Distance from source to target (Edge length)
                final double v1x = tX - sX;
                final double v1y = tY - sY;
-//             final double dist1 = Math.sqrt(Math.pow(v1x, 2) + Math.pow(v1y, 
2));
+               // final double dist1 = Math.sqrt(Math.pow(v1x, 2) + 
Math.pow(v1y, 2));
                final double dist1 = Point2D.Double.distance(sX, sY, tX, tY);
-               
+
                // Vector v2
                // Distance from source to current handle
                final double v2x = hX - sX;
                final double v2y = hY - sY;
-//             final double dist2 = Math.sqrt(Math.pow(v2x, 2) + Math.pow(v2y, 
2));
+               // final double dist2 = Math.sqrt(Math.pow(v2x, 2) + 
Math.pow(v2y, 2));
                final double dist2 = Point2D.Double.distance(sX, sY, hX, hY);
-               
+
                // Ratio of vector lengths
-               ratio = dist2/dist1; 
-                               
+               ratio = dist2 / dist1;
+
                // Dot product of v1 and v2
                final double dotProduct = (v1x * v2x) + (v1y * v2y);
-               cosTheta = dotProduct/(dist1*dist2);
-               
+               cosTheta = dotProduct / (dist1 * dist2);
+
                // Avoid rounding problem
-               if(cosTheta>1.0d)
+               if (cosTheta > 1.0d)
                        cosTheta = 1.0d;
-               
+
                // Theta is the angle between v1 and v2
                double theta = Math.acos(cosTheta);
                sinTheta = Math.sin(theta);
-               
-//             System.out.println("\n\n## Dot prod = " + dotProduct);
-//             System.out.println("** cos = " + cosTheta);
-//             System.out.println("** sin = " + sinTheta);
-//             System.out.println("** theta = " + theta);
-//             System.out.println("** (Hx, Hy) = (" + hX + ", " + hY + ")");
+
+//              System.out.println("\n\n## Dot prod = " + dotProduct);
+//              System.out.println("** cos = " + cosTheta);
+//              System.out.println("** sin = " + sinTheta);
+//              System.out.println("** theta = " + theta);
+//              System.out.println("** (Hx, Hy) = (" + hX + ", " + hY + ")");
                final Point2D validate = convert(sX, sY, tX, tY);
-               if(Math.abs(validate.getX()-hX) > 2 || 
Math.abs(validate.getY()-hY) > 2)
+               if (Math.abs(validate.getX() - hX) > 2 || 
Math.abs(validate.getY() - hY) > 2)
                        sinTheta = -sinTheta;
-               
+
                // Validate
-               if(theta == Double.NaN ||sinTheta == Double.NaN)
-                       throw new IllegalStateException("Invalid angle: " + 
theta +". Cuased by cos(theta) = " + cosTheta);
+               if (theta == Double.NaN || sinTheta == Double.NaN)
+                       throw new IllegalStateException("Invalid angle: " + 
theta + ". Cuased by cos(theta) = " + cosTheta);
        }
-       
+
        /**
         * Rotate and scale the vector to the handle position
         * 
@@ -137,7 +138,7 @@
         * @param tY
         * @return
         */
-       private Point2D convert(double sX, double sY,double tX, double tY ) {
+       private Point2D convert(double sX, double sY, double tX, double tY) {
                final Point2D newPoint = new Point2D.Double();
                // Original edge vector v = (vx, vy). (from source to target)
                final double vx = tX - sX;
@@ -156,11 +157,10 @@
                final double handleX = newX + sX;
                final double handleY = newY + sY;
                newPoint.setLocation(handleX, handleY);
-               
+
                return newPoint;
        }
 
-
        /**
         * Serialized string is "cos,sin,ratio".
         */
@@ -168,37 +168,39 @@
        public String getSerializableString() {
                return cosTheta + DELIMITER + sinTheta + DELIMITER + ratio;
        }
-       
+
        private void setCos(final double cos) {
                this.cosTheta = cos;
        }
-       
+
        private void setSin(final double sin) {
                this.sinTheta = sin;
        }
-       
+
        private void setRatio(final double ratio) {
                this.ratio = ratio;
        }
-       
+
        /**
         * @param strRepresentation
         * @return returns null for invalid inputs.
         */
        public static Handle parseSerializableString(final String 
strRepresentation) {
                // Validate
-               if(strRepresentation == null)
+               if (strRepresentation == null)
                        return null;
-               
+
                final String[] parts = strRepresentation.split(DELIMITER);
-               if(parts.length != 3)
+               if (parts.length == 2) {
+                       return process2xHandles(parts);
+               } else if (parts.length != 3)
                        return null;
-               
+
                try {
                        final double cos = Double.valueOf(parts[0]);
                        final double sin = Double.valueOf(parts[1]);
                        final double ratio = Double.valueOf(parts[2]);
-                       
+
                        HandleImpl handle = new HandleImpl(0, 0);
                        handle.setSin(sin);
                        handle.setCos(cos);
@@ -206,6 +208,17 @@
                        return handle;
                } catch (Exception ex) {
                        return null;
-               }               
+               }
        }
+
+       private static final Handle process2xHandles(final String[] parts) {
+               try {
+                       final double x = Double.valueOf(parts[0]);
+                       final double y = Double.valueOf(parts[1]);
+                       return new HandleImpl(x, y);
+               } catch (Exception ex) {
+                       return null;
+               }
+               
+       }
 }

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
    2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/InnerCanvas.java
    2012-06-12 01:28:07 UTC (rev 29530)
@@ -465,7 +465,7 @@
                int chosenEdgeSelected = 0;
                
                // Set Edge Bend.
-               if (e.isControlDown() && ((m_lastRenderDetail & 
GraphRenderer.LOD_EDGE_ANCHORS) != 0)) {
+               if (e.isMetaDown() && ((m_lastRenderDetail & 
GraphRenderer.LOD_EDGE_ANCHORS) != 0)) {
                        
                        m_view.m_selectedAnchors.empty();
                        m_ptBuff[0] = m_lastXMousePos;

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/AbstractXGMMLReader.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/AbstractXGMMLReader.java
   2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/AbstractXGMMLReader.java
   2012-06-12 01:28:07 UTC (rev 29530)
@@ -30,6 +30,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Collection;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -51,6 +52,10 @@
 import org.cytoscape.view.model.VisualLexicon;
 import org.cytoscape.view.model.VisualProperty;
 import org.cytoscape.view.presentation.RenderingEngineManager;
+import org.cytoscape.view.presentation.property.BasicVisualLexicon;
+import org.cytoscape.view.presentation.property.EdgeBendVisualProperty;
+import org.cytoscape.view.presentation.property.values.Bend;
+import org.cytoscape.view.presentation.property.values.Handle;
 import org.cytoscape.work.TaskMonitor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -184,25 +189,34 @@
                        Set<String> attSet = atts.keySet();
 
                        for (String attName : attSet) {
+                               String attValue = atts.get(attName);
                                VisualProperty vp = visualLexicon.lookup(type, 
attName);
-                               String attValue = atts.get(attName);
-
+                               
                                if (vp != null) {
                                        if (isXGMMLTransparency(attName))
                                                attValue = 
convertXGMMLTransparencyValue(attValue);
+                                       
+                                       final Object parsedValue = 
vp.parseSerializableString(attValue);
 
-                                       Object value = 
vp.parseSerializableString(attValue);
-
-                                       if (value != null) {
+                                       if (parsedValue != null) {
                                                if 
(isLockedVisualProperty(model, attName))
-                                                       view.setLockedValue(vp, 
value);
+                                                       view.setLockedValue(vp, 
parsedValue);
                                                else
-                                                       
view.setVisualProperty(vp, value);
+                                                       
view.setVisualProperty(vp, parsedValue);
                                        }
                                } else {
                                        
unrecognizedVisualPropertyMgr.addUnrecognizedVisualProperty(netView, view, 
attName, attValue);
                                }
                        }
+                       
+                       // For 2.x compatibility
+                       final Bend bend = 
view.getVisualProperty(BasicVisualLexicon.EDGE_BEND);
+                       if (bend != null && bend != 
EdgeBendVisualProperty.DEFAULT_EDGE_BEND) {
+                               final List<Handle> handles = 
bend.getAllHandles();
+                               for (Handle handle : handles) {
+                                       handle.defineHandle(netView, 
(View<CyEdge>) view, Double.NaN, Double.NaN);
+                               }
+                       }
                }
        }
        

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeAttribute.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeAttribute.java
   2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeAttribute.java
   2012-06-12 01:28:07 UTC (rev 29530)
@@ -32,33 +32,38 @@
 import org.xml.sax.SAXException;
 
 public class HandleEdgeAttribute extends AbstractHandler {
+       
+       private static final String NAME = "name";
+       private static final String VALUE = "value";
 
        @Override
        public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {
                if (atts == null)
                        return current;
-               
+
                manager.attState = current;
 
-               // Since version 3.0, the CYS file's XGMML should not contain 
node or edge <att> tags,
-               // since node and edge attributes are now serialized as 
CyTables.
-               // Let's just add this condition for the unlikely scenario 
where another application generates
-               // the CYS file with redundant <att> tags for 3.0+.
+               // Since version 3.0, the CYS file's XGMML should not contain 
node or
+               // edge <att> tags, since node and edge attributes are now 
serialized as CyTables.
+               // Let's just add this condition for the unlikely scenario 
where another
+               // application generates the CYS file with redundant <att> tags 
for 3.0+.
                if (!manager.isSessionFormat() || manager.getDocumentVersion() 
< 3.0) {
                        // Is this a graphics override?
-                       String name = atts.getValue("name");
+                       String name = atts.getValue(NAME);
 
                        // Check for blank attribute
-                       if (name == null && atts.getValue("value") == null) 
return current;
-
+                       final String value = atts.getValue(VALUE);
+                       if (name == null && value == null)
+                               return current;
+                       
                        if (manager.getDocumentVersion() < 3.0) {
-                               // Writing locked visual properties as regular 
<att> tags is deprecated!
-                       if (name.startsWith("edge.")) {
-                               // It is a bypass attribute...
-                               name = name.replace(".", "").toLowerCase();
-                               String value = atts.getValue("value");
-                               
manager.addGraphicsAttribute(manager.getCurrentEdge(), name, value);
-                       }
+                               // Writing locked visual properties as regular 
<att> tags is
+                               // deprecated!
+                               if (name.startsWith("edge.")) {
+                                       // It is a bypass attribute...
+                                       name = name.replace(".", 
"").toLowerCase();
+                                       
manager.addGraphicsAttribute(manager.getCurrentEdge(), name, value);
+                               }
                        }
 
                        ParseState nextState = 
attributeValueUtil.handleAttribute(atts);

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeGraphics.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeGraphics.java
    2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeGraphics.java
    2012-06-12 01:28:07 UTC (rev 29530)
@@ -34,23 +34,24 @@
 import org.xml.sax.SAXException;
 
 public class HandleEdgeGraphics extends AbstractHandler {
+       private static final String EDGE_BEND = "edgeBend";
 
        @Override
-    public ParseState handle(String tag, Attributes atts, ParseState current) 
throws SAXException {
-        if (tag.equals("graphics")) {
-               manager.addGraphicsAttributes(manager.getCurrentEdge(), atts);
-        } else if (tag.equals("att")) {
-            // Handle special edge graphics attributes
-            String name = atts.getValue("name");
-            
-            if (name != null && name.equals("edgeBend")) {
-                manager.handleList = new ArrayList<String>();
-                return ParseState.EDGE_BEND;
-            } else if (name != null && 
!name.equals("cytoscapeEdgeGraphicsAttributes")) {
-               manager.addGraphicsAttribute(manager.getCurrentEdge(), name, 
atts.getValue("value"));
-            }
-        }
-        
-        return current;
-    }
+       public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {
+               if (tag.equals("graphics")) {
+                       manager.addGraphicsAttributes(manager.getCurrentEdge(), 
atts);
+               } else if (tag.equals("att")) {
+                       // Handle special edge graphics attributes
+                       final String name = atts.getValue("name");
+
+                       if (name != null && name.equals(EDGE_BEND)) {
+                               manager.handleList = new ArrayList<String>();
+                               return ParseState.EDGE_BEND;
+                       } else if (name != null && 
!name.equals("cytoscapeEdgeGraphicsAttributes")) {
+                               
manager.addGraphicsAttribute(manager.getCurrentEdge(), name, 
atts.getValue("value"));
+                       }
+               }
+
+               return current;
+       }
 }

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandle.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandle.java
      2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandle.java
      2012-06-12 01:28:07 UTC (rev 29530)
@@ -53,12 +53,17 @@
  */
 public class HandleEdgeHandle extends AbstractHandler {
        
+       private static final String HANDLE = "handle";
+
+       
        @Override
        public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {
 
+               final String name = attributeValueUtil.getAttribute(atts, 
"name");
+               
                if (manager.getDocumentVersion() == 1.0) {
                        // This is the outer "handle" attribute
-                       if (!attributeValueUtil.getAttribute(atts, 
"name").equals("handle")) {
+                       if (!name.equals(HANDLE)) {
                                // OK, this is one of our "data" attributes
                                if (attributeValueUtil.getAttributeValue(atts, 
"x") != null) {
                                        manager.edgeBendX = 
attributeValueUtil.getAttributeValue(atts, "x");

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleDone.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleDone.java
  2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleDone.java
  2012-06-12 01:28:07 UTC (rev 29530)
@@ -34,13 +34,14 @@
 public class HandleEdgeHandleDone extends AbstractHandler {
 
        @Override
-       public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {
+       public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {         
                if (manager.edgeBendX != null && manager.edgeBendY != null && 
manager.handleList != null) {
                        manager.handleList.add(manager.edgeBendX + "," + 
manager.edgeBendY);
+                       
                        manager.edgeBendX = null;
                        manager.edgeBendY = null;
                }
-               
+
                return current;
        }
 }
\ No newline at end of file

Modified: 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleList.java
===================================================================
--- 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleList.java
  2012-06-11 22:10:14 UTC (rev 29529)
+++ 
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/xgmml/handler/HandleEdgeHandleList.java
  2012-06-12 01:28:07 UTC (rev 29530)
@@ -33,22 +33,24 @@
 
 public class HandleEdgeHandleList extends AbstractHandler {
 
+       private static final String DELIMITER = "|";
+
        @Override
-    public ParseState handle(String tag, Attributes atts, ParseState current) 
throws SAXException {
-        if (manager.handleList != null) {
-            String list = "";
+       public ParseState handle(String tag, Attributes atts, ParseState 
current) throws SAXException {
+               if (manager.handleList != null) {
+                       String list = "";
 
-            for (int i = 0; i < manager.handleList.size(); i++) {
-                if (i != (manager.handleList.size() - 1)) {
-                    list += manager.handleList.get(i) + ";";
-                } else {
-                    list += manager.handleList.get(i);
-                }
-            }
+                       for (int i = 0; i < manager.handleList.size(); i++) {
+                               if (i != (manager.handleList.size() - 1)) {
+                                       list += manager.handleList.get(i) + 
DELIMITER;
+                               } else {
+                                       list += manager.handleList.get(i);
+                               }
+                       }
 
-            manager.addGraphicsAttribute(manager.getCurrentEdge(), 
"edgeHandleList", list);
-            manager.handleList = null;
-        }
-        return current;
-    }
+                       manager.addGraphicsAttribute(manager.getCurrentEdge(), 
"edgeHandleList", list);
+                       manager.handleList = null;
+               }
+               return current;
+       }
 }

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