Author: jm
Date: 2012-03-14 11:04:26 -0700 (Wed, 14 Mar 2012)
New Revision: 28533

Modified:
   
core3/impl/trunk/layout-cytoscape-impl/src/main/java/csapps/layout/algorithms/hierarchicalLayout/HierarchicalLayoutAlgorithmTask.java
Log:
Fixes #774: Added check for number of nodes to be laid out rather than just 
number of selected nodes.

Modified: 
core3/impl/trunk/layout-cytoscape-impl/src/main/java/csapps/layout/algorithms/hierarchicalLayout/HierarchicalLayoutAlgorithmTask.java
===================================================================
--- 
core3/impl/trunk/layout-cytoscape-impl/src/main/java/csapps/layout/algorithms/hierarchicalLayout/HierarchicalLayoutAlgorithmTask.java
       2012-03-14 16:56:43 UTC (rev 28532)
+++ 
core3/impl/trunk/layout-cytoscape-impl/src/main/java/csapps/layout/algorithms/hierarchicalLayout/HierarchicalLayoutAlgorithmTask.java
       2012-03-14 18:04:26 UTC (rev 28533)
@@ -112,14 +112,14 @@
                if (!selectedOnly)
                        numSelectedNodes = 0;
 
-               if (numSelectedNodes == 1) {
+               final int numNodes = networkView.getNodeViews().size();
+               final int numLayoutNodes = (numSelectedNodes < 1) ? numNodes : 
numSelectedNodes;
+
+               if (numLayoutNodes == 1) {
                        // We were asked to do a hierchical layout of a single 
node -- done!
                        return;
                }
 
-               final int numNodes = networkView.getNodeViews().size();
-               final int numLayoutNodes = (numSelectedNodes < 1) ? numNodes : 
numSelectedNodes;
-
                // maps node's index (.getIndex()) to View<CyNode> of given node
                HashMap<Integer, View<CyNode>> index2NodeView = new 
HashMap<Integer, View<CyNode>>(numNodes);
                

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