Author: pwang
Date: 2009-08-03 12:55:14 -0700 (Mon, 03 Aug 2009)
New Revision: 17663

Modified:
   
csplugins/trunk/ucsd/mes/groupResults/src/org/cytoscape/groups/results/LayoutRegion.java
Log:
Add deltaX,deltaY for each Box

Modified: 
csplugins/trunk/ucsd/mes/groupResults/src/org/cytoscape/groups/results/LayoutRegion.java
===================================================================
--- 
csplugins/trunk/ucsd/mes/groupResults/src/org/cytoscape/groups/results/LayoutRegion.java
    2009-08-03 18:27:59 UTC (rev 17662)
+++ 
csplugins/trunk/ucsd/mes/groupResults/src/org/cytoscape/groups/results/LayoutRegion.java
    2009-08-03 19:55:14 UTC (rev 17663)
@@ -232,22 +232,27 @@
                double xCenter = theView.getCenter().getX();
                double yCenter = theView.getCenter().getY();
                
+               double deltaX=0, deltaY=0;
+               
                while (it.hasNext()){
                        node = (CyNode) it.next();
                        nv = 
Cytoscape.getCurrentNetworkView().getNodeView(node);
+               
+                       deltaX = nv.getWidth()/2 + nv.getBorderWidth();
+                       deltaY = nv.getHeight()/2 + nv.getBorderWidth();
                        
-                       if (nv.getXPosition() < minX){
-                               minX = nv.getXPosition();
+                       if (nv.getXPosition()-deltaX < minX){
+                               minX = nv.getXPosition()- deltaX;
                        }
-                       if (nv.getXPosition() > maxX){
-                               maxX = nv.getXPosition();
+                       if (nv.getXPosition()+deltaX > maxX){
+                               maxX = nv.getXPosition()+deltaX;
                        }
                        
-                       if (nv.getYPosition() < minY){
-                               minY = nv.getYPosition();
+                       if (nv.getYPosition()-deltaY < minY){
+                               minY = nv.getYPosition()-deltaY;
                        }
-                       if (nv.getYPosition() > maxY){
-                               maxY = nv.getYPosition();
+                       if (nv.getYPosition()+deltaY > maxY){
+                               maxY = nv.getYPosition()+deltaY;
                        }                               
                }
                                
@@ -260,7 +265,6 @@
 
                return rectValues;
        }
-
        
        
        /**


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