Author: ghuck
Date: 2010-06-29 07:54:20 -0700 (Tue, 29 Jun 2010)
New Revision: 20717

Modified:
   
coreplugins/branches/labelLayout/AutomaticLayout/src/csplugins/layout/LayoutLabelNodeImpl.java
Log:


Modified: 
coreplugins/branches/labelLayout/AutomaticLayout/src/csplugins/layout/LayoutLabelNodeImpl.java
===================================================================
--- 
coreplugins/branches/labelLayout/AutomaticLayout/src/csplugins/layout/LayoutLabelNodeImpl.java
      2010-06-29 14:54:16 UTC (rev 20716)
+++ 
coreplugins/branches/labelLayout/AutomaticLayout/src/csplugins/layout/LayoutLabelNodeImpl.java
      2010-06-29 14:54:20 UTC (rev 20717)
@@ -1,11 +1,15 @@
 package csplugins.layout;
 
 import cytoscape.*;
-import cytoscape.visual.LabelPosition;
+//import cytoscape.visual.LabelPosition;
 import cytoscape.logger.CyLogger;
 import cytoscape.data.CyAttributes;
 import cytoscape.view.*;
+import cytoscape.visual.parsers.*;
+import cytoscape.visual.VisualPropertyType;
 
+import ding.view.ObjectPositionImpl;
+
 import giny.view.*;
 
 import java.util.*;
@@ -22,7 +26,7 @@
 
     protected CyLogger logger = null;
     protected NodeView parentNodeView;
-    protected LabelPosition lp = null;
+    protected ObjectPosition lp;
     protected CyAttributes nodeAtts = null;
     //    protected ObjectPosition labelPosition;
 
@@ -42,21 +46,26 @@
        this.parentNodeView = parentNodeView;
        
        //labelPosition = parentNodeView.getLabelPosition();
-       
+
        // Set labelNode's location to parent node's current label position
-       nodeAtts = Cytoscape.getNodeAttributes();
-       String labelPosition = (String) 
nodeAtts.getAttribute(parentNodeView.getNode().
-                                                             getIdentifier(), 
"node.labelPosition");
-       
-       if (labelPosition == null) {
-           lp = new LabelPosition();
+       nodeAtts = Cytoscape.getNodeAttributes();
+       String labelPosition = (String) 
nodeAtts.getAttribute(parentNodeView.getNode().getIdentifier(), 
+                                                             
"node.labelPosition");    
+
+       if (labelPosition == null) {
+           lp = new ObjectPositionImpl();
        } else {
-           lp = LabelPosition.parse(labelPosition);
+           ValueParser<ObjectPosition> parser = 
+               (ValueParser<ObjectPosition>) 
VisualPropertyType.NODE_LABEL_POSITION.getValueParser();
+           
+           lp = parser.parseStringValue(labelPosition);
+           //      lp = LabelPosition.parse(labelPosition);
        }
        
 //     logger.info("Parent node: " + parentNodeView.getNode().getIdentifier());
 //     logger.info("Offset = " + lp.getOffsetX() + ", " + lp.getOffsetY() );
 
+
        this.setX(lp.getOffsetX() + parentNodeView.getXPosition());
        this.setY(lp.getOffsetY() + parentNodeView.getYPosition());         
        this.neighbors = new ArrayList<LayoutNode>();

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