Author: clopes
Date: 2011-09-16 13:08:52 -0700 (Fri, 16 Sep 2011)
New Revision: 26841

Modified:
   cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
   
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/controls/TooltipControl.as
Log:
Fixed issue with removing selected nodes not deleting their labels and a rare 
null error on tooltips.

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as  
2011-09-16 18:54:21 UTC (rev 26840)
+++ cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as  
2011-09-16 20:08:52 UTC (rev 26841)
@@ -811,7 +811,8 @@
         
         private function disposeDataSprite(ds:DataSprite):void {
             // Force a roll-out, to keep things in a good state:
-            ds.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OUT));
+            if (graphProxy.rolledOverNode === ds || graphProxy.rolledOverEdge 
=== ds)
+                ds.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OUT));
             
             // Remove event listeners:
             if (ds is NodeSprite) {

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/controls/TooltipControl.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/controls/TooltipControl.as
        2011-09-16 18:54:21 UTC (rev 26840)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/controls/TooltipControl.as
        2011-09-16 20:08:52 UTC (rev 26841)
@@ -143,26 +143,29 @@
         protected function layout(tip:DisplayObject, obj:DisplayObject):void
         {
             var s:Stage = tip.stage;
-            tip.x = s.mouseX + xOffset;
-            tip.y = s.mouseY + yOffset;
             
-            var b:Rectangle = tipBounds ? tipBounds : getStageBounds(s);
-            var r:Rectangle = tip.getBounds(s);
-            
-            if (r.width > b.width) {
-                tip.x = b.left;
-            } else if (r.left < b.left + 5) {
+            if (s != null) {
                 tip.x = s.mouseX + xOffset;
-            } else if (r.right > b.right - 5) {
-                tip.x = s.mouseX - 2 - r.width;
+                tip.y = s.mouseY + yOffset;
+                
+                var b:Rectangle = tipBounds ? tipBounds : getStageBounds(s);
+                var r:Rectangle = tip.getBounds(s);
+                
+                if (r.width > b.width) {
+                    tip.x = b.left;
+                } else if (r.left < b.left + 5) {
+                    tip.x = s.mouseX + xOffset;
+                } else if (r.right > b.right - 5) {
+                    tip.x = s.mouseX - 2 - r.width;
+                }
+                if (r.height > b.height) {
+                    tip.y = b.top;
+                } if (r.top < b.top + 5) {
+                    tip.y = s.mouseY - yOffset;
+                } else if (r.bottom > b.bottom - 5) {
+                    tip.y = s.mouseY - 7 - r.height;
+                }
             }
-            if (r.height > b.height) {
-                tip.y = b.top;
-            } if (r.top < b.top + 5) {
-                tip.y = s.mouseY - yOffset;
-            } else if (r.bottom > b.bottom - 5) {
-                tip.y = s.mouseY - 7 - r.height;
-            }
         }
         
         /** @private */

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