Author: clopes
Date: 2012-03-20 13:56:04 -0700 (Tue, 20 Mar 2012)
New Revision: 28597

Modified:
   cytoscapeweb/trunk/cytoscapeweb/default.properties
   cytoscapeweb/trunk/cytoscapeweb/html-template/js/cytoscapeweb.js
   
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/data/VisualStyleVO.as
   cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/VisualProperties.as
   cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
   
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
   
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/layout/CompoundSpringEmbedder.as
Log:
Fixed bug #2691: Compound node bounds not updated after changing child labels.

Modified: cytoscapeweb/trunk/cytoscapeweb/default.properties
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/default.properties  2012-03-20 19:42:06 UTC 
(rev 28596)
+++ cytoscapeweb/trunk/cytoscapeweb/default.properties  2012-03-20 20:56:04 UTC 
(rev 28597)
@@ -1,3 +1,3 @@
-build.version=1.0
+build.version=1.0.1
 
 FLEX_HOME=/Applications/Adobe Flex Builder 3 Plug-in/sdks/3.2.0/
\ No newline at end of file

Modified: cytoscapeweb/trunk/cytoscapeweb/html-template/js/cytoscapeweb.js
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/html-template/js/cytoscapeweb.js    
2012-03-20 19:42:06 UTC (rev 28596)
+++ cytoscapeweb/trunk/cytoscapeweb/html-template/js/cytoscapeweb.js    
2012-03-20 20:56:04 UTC (rev 28597)
@@ -2824,7 +2824,9 @@
      *     <li><code>tooltipFontSize</code> {Number}: The point size of node 
tool tips. The default value is 11.</li>
      *     <li><code>tooltipFontColor</code> {String}: Font color of node tool 
tips. The default value is "#000000".</li>
      *     <li><code>tooltipBackgroundColor</code> {String}: Background color 
of node tool tips. The default value is "#f5f5cc".</li>
-     *     <li><code>tooltipBorderColor</code> {String}: Border color of node 
tool tips. The default value is "#000000".</li></ul>
+     *     <li><code>tooltipBorderColor</code> {String}: Border color of node 
tool tips. The default value is "#000000".</li>
+     *     <li><code>compoundChildLabelEnclosure</code> {Boolean}: Whether or 
not compound nodes should enclose child node/edge labels. 
+     *                                                             The default 
value is <code>true</code>, meaning compound nodes are sized to fit their child 
labels inside.</li></ul>
      * @property
      * @name nodes
      * @type Object

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/data/VisualStyleVO.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/data/VisualStyleVO.as
    2012-03-20 19:42:06 UTC (rev 28596)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/data/VisualStyleVO.as
    2012-03-20 20:56:04 UTC (rev 28597)
@@ -47,7 +47,6 @@
               global: {
                     backgroundColor: "#ffffff",
                     tooltipDelay: 800,
-                                       ignoreLabelsInCompounds: false,
                                        selectionLineColor: "#8888ff",
                     selectionLineOpacity: 0.8,
                     selectionLineWidth: 1,
@@ -129,7 +128,8 @@
                     compoundHoverGlowColor: "#aae6ff",
                     compoundHoverGlowOpacity: 0,
                     compoundHoverGlowBlur: 8,
-                    compoundHoverGlowStrength: 6
+                    compoundHoverGlowStrength: 6,
+                    compoundChildLabelEnclosure: true
                 },
                 edges: {
                     color: "#999999",

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/VisualProperties.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/VisualProperties.as   
    2012-03-20 19:42:06 UTC (rev 28596)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/VisualProperties.as   
    2012-03-20 20:56:04 UTC (rev 28597)
@@ -43,7 +43,6 @@
         //------------------------------
         public static const BACKGROUND_COLOR:String = "global.backgroundColor";
         public static const TOOLTIP_DELAY:String = "global.tooltipDelay";
-               public static const IGNORE_LABELS_FOR_COMPOUND_BOUNDS:String = 
"global.ignoreLabelsForCompoundBounds";
         
         // Selection Rectangle:
         public static const SELECTION_LINE_COLOR:String = 
"global.selectionLineColor";
@@ -185,6 +184,8 @@
         public static const C_NODE_HOVER_GLOW_BLUR:String = 
"nodes.compoundHoverGlowBlur";
         public static const C_NODE_HOVER_GLOW_STRENGTH:String = 
"nodes.compoundHoverGlowStrength";
         
+        public static const C_NODE_CHILD_LABEL_ENCLOSURE:String = 
"nodes.compoundChildLabelEnclosure";
+        
         // TODO rename and create colors, etc:
         public static const EDGE_TOOLTIP_TEXT_MERGE:String = 
"edges.mergeTooltipText";
         

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as  
2012-03-20 19:42:06 UTC (rev 28596)
+++ cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as  
2012-03-20 20:56:04 UTC (rev 28597)
@@ -252,6 +252,10 @@
             graphView.updateLabels(Groups.NODES);
             graphView.updateLabels(Groups.COMPOUND_NODES);
             graphView.updateLabels(Groups.EDGES);
+            
+            if 
(configProxy.visualStyle.getValue(VisualProperties.C_NODE_CHILD_LABEL_ENCLOSURE))
+                vis.updateAllCompoundBounds();
+            
             separateDisconnected();
         }
         

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
    2012-03-20 19:42:06 UTC (rev 28596)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
    2012-03-20 20:56:04 UTC (rev 28597)
@@ -520,25 +520,15 @@
                 }
                 
                 // calculate&update bounds of the compound node
-                               if 
(_style.getValue(VisualProperties.IGNORE_LABELS_FOR_COMPOUND_BOUNDS))
-                               {
-                                       bounds = 
GraphUtils.getBounds(children.nodes,
-                                               null,
-                                               true,
-                                               true);
-                                       
-                                       if (_config.nodeLabelsVisible)
-                                       {
-                                               if (nodeLabeler.enabled)
-                                                       nodeLabeler.operate();
-                                               
-                                               //      if 
(compoundNodeLabeler.enabled)
-                                               //              
compoundNodeLabeler.operate();
-                                       }
-                               }
-                               else
-                               {
+                               if 
(_style.getValue(VisualProperties.C_NODE_CHILD_LABEL_ENCLOSURE)) {
                                        bounds = this.getRealBounds(children);
+                               } else {
+                                       bounds = 
GraphUtils.getBounds(children.nodes, null, true, true);
+                    
+                    if (_config.nodeLabelsVisible) {
+                        if (nodeLabeler.enabled)
+                            nodeLabeler.operate();
+                    }
                                }
                 
                 cns.updateBounds(bounds);

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/layout/CompoundSpringEmbedder.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/layout/CompoundSpringEmbedder.as
  2012-03-20 19:42:06 UTC (rev 28596)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/layout/CompoundSpringEmbedder.as
  2012-03-20 20:56:04 UTC (rev 28597)
@@ -308,29 +308,25 @@
                                        retrieveProxy(ConfigProxy.NAME) as 
ConfigProxy;
                                
                                var style:VisualStyleVO = 
configProxy.config.visualStyle;
+                               var encloseLabels:Boolean = 
style.getValue(VisualProperties.C_NODE_CHILD_LABEL_ENCLOSURE);
                                
-                               var ignore:Boolean =
-                                       
style.getValue(VisualProperties.IGNORE_LABELS_FOR_COMPOUND_BOUNDS);
-                               
-                               if(ignore)
+                               if(encloseLabels)
                                {
-                                       lNode.setWidth(node.width);
-                                       lNode.setHeight(node.height);
-                               }
-                               else
-                               {
                                        var data:Data = new Data();
                                        data.addNode(node);
                                        
-                                       var bounds:Rectangle = 
-                                               (visualization as 
GraphVis).getRealBounds(data);
-                                       
+                                       var bounds:Rectangle =  (visualization 
as GraphVis).getRealBounds(data);
                                        var width:Number = bounds.width;
                                        var height:Number = bounds.height;
                                        
                                        lNode.setWidth(width);
                                        lNode.setHeight(height);
                                }
+                               else
+                               {
+                                       lNode.setWidth(node.width);
+                    lNode.setHeight(node.height);
+                               }
                        }
                }
                

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