Author: ghuck
Date: 2011-06-26 18:34:49 -0700 (Sun, 26 Jun 2011)
New Revision: 25947

Modified:
   
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/AbstractIgraphLayout.java
   
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/StarLayout.java
Log:
Fixed issue with star layout

Modified: 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/AbstractIgraphLayout.java
===================================================================
--- 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/AbstractIgraphLayout.java
       2011-06-26 21:22:37 UTC (rev 25946)
+++ 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/AbstractIgraphLayout.java
       2011-06-27 01:34:49 UTC (rev 25947)
@@ -157,6 +157,11 @@
        if (canceled)
            return;
 
+       // Check whether there are nodes to layout or not
+       if ( (selectedOnly && (part.nodeCount() - part.lockedNodeCount()) <= 1) 
+            || part.nodeCount() <= 1 ) 
+           return;
+
        // Show message on the task monitor
        taskMonitor.setStatus("Initializing: Partition: " + 
part.getPartitionNumber());
        

Modified: 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/StarLayout.java
===================================================================
--- 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/StarLayout.java
 2011-06-26 21:22:37 UTC (rev 25946)
+++ 
csplugins/trunk/soc/ghuck/IgraphPlugin/src/cytoscape/plugins/igraph/layouts/StarLayout.java
 2011-06-27 01:34:49 UTC (rev 25947)
@@ -47,8 +47,11 @@
        // Simplify graph
        IgraphInterface.simplify();
        
+       // Get center node ID
+       int centerId = mapping.values().iterator().next();
+
        // Make native method call
-       IgraphInterface.starLayout(x, y, mapping.keySet().iterator().next());
+       IgraphInterface.starLayout(x, y, centerId);
 
        return 1;
     }

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