Author: pwang
Date: 2010-10-11 15:49:27 -0700 (Mon, 11 Oct 2010)
New Revision: 22207

Modified:
   cytoscape/trunk/application/src/main/java/cytoscape/view/CyMenus.java
Log:
Get layout algorithm from properties

Modified: cytoscape/trunk/application/src/main/java/cytoscape/view/CyMenus.java
===================================================================
--- cytoscape/trunk/application/src/main/java/cytoscape/view/CyMenus.java       
2010-10-11 22:46:39 UTC (rev 22206)
+++ cytoscape/trunk/application/src/main/java/cytoscape/view/CyMenus.java       
2010-10-11 22:49:27 UTC (rev 22207)
@@ -54,6 +54,7 @@
 import org.jdesktop.swingx.JXTitledSeparator;
 
 import cytoscape.Cytoscape;
+import cytoscape.CytoscapeInit;
 import cytoscape.actions.*;
 import cytoscape.layout.ui.LayoutMenuManager;
 import cytoscape.layout.ui.SettingsAction;
@@ -109,7 +110,7 @@
        JButton annotationButton;
        JButton helpButton;
        JButton vizButton;
-       JButton forceDirectLayoutButton;
+       JButton applyLayoutButton;
        JButton createNewNetworkButton;
        /**
         * Creates a new CyMenus object. This will construct the basic bar 
objects,
@@ -639,19 +640,19 @@
                vizButton.setToolTipText("Open VizMapper\u2122");
                vizButton.setBorderPainted(false);
                
-               /////Add a button -- apply force-directed layout
-               forceDirectLayoutButton = new JButton();
-               forceDirectLayoutButton.setIcon(new ImageIcon(Cytoscape.class
+               /////Add a button -- apply layout, 'force-directed' by default
+               String layoutName = 
CytoscapeInit.getProperties().get("defaultLayoutAlgorithm").toString();
+                               
+               applyLayoutButton = new JButton();
+               applyLayoutButton.setIcon(new ImageIcon(Cytoscape.class
                                                        
.getResource("images/apply-force-directed-layout-32.png")));
-               forceDirectLayoutButton.setToolTipText("Apply force-directed 
layout");
-               forceDirectLayoutButton.setBorderPainted(false);
-               forceDirectLayoutButton.setRolloverEnabled(true);
-               
-               forceDirectLayoutButton.addMouseListener(new 
ApplyForcedDirectedLayoutMouseAdapter(forceDirectLayoutButton));
+               applyLayoutButton.setToolTipText("Apply "+layoutName + " 
layout");
+               applyLayoutButton.setBorderPainted(false);
+               applyLayoutButton.setRolloverEnabled(true);             
+               applyLayoutButton.addMouseListener(new 
ApplyLayoutMouseAdapter(applyLayoutButton));
 
-               toolBar.add(forceDirectLayoutButton);
+               toolBar.add(applyLayoutButton);
 
-
                /////Add a button -- Create new network from selected nodes, 
all edges
                createNewNetworkButton = new JButton();
                createNewNetworkButton.setIcon(new ImageIcon(Cytoscape.class

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