Author: mes
Date: 2010-02-10 16:50:22 -0800 (Wed, 10 Feb 2010)
New Revision: 19286

Added:
   cytoscape/trunk/src/cytoscape/view/ToolCytoPanelListener.java
Modified:
   cytoscape/trunk/plugins/core/ManualLayout.jar
   cytoscape/trunk/src/cytoscape/view/CyMenus.java
   cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java
Log:
now the tools cytopanel has a View-Show/Hide menu like the others while 
retaining its previous behavior from the layout menu

Modified: cytoscape/trunk/plugins/core/ManualLayout.jar
===================================================================
(Binary files differ)

Modified: cytoscape/trunk/src/cytoscape/view/CyMenus.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/CyMenus.java     2010-02-11 00:46:54 UTC 
(rev 19285)
+++ cytoscape/trunk/src/cytoscape/view/CyMenus.java     2010-02-11 00:50:22 UTC 
(rev 19286)
@@ -444,6 +444,7 @@
                addAction(new CytoPanelAction(CytoPanelName.WEST,true));
                addAction(new CytoPanelAction(CytoPanelName.SOUTH,true));
                addAction(new CytoPanelAction(CytoPanelName.EAST,false));
+               addAction(new CytoPanelAction(CytoPanelName.SOUTH_WEST,false));
                
                viewMenu.add(new JSeparator());
                

Modified: cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java    2010-02-11 
00:46:54 UTC (rev 19285)
+++ cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java    2010-02-11 
00:50:22 UTC (rev 19286)
@@ -187,12 +187,8 @@
        protected CytoPanelImp cytoPanelWest;
        protected CytoPanelImp cytoPanelEast;
        protected CytoPanelImp cytoPanelSouth;
+       protected CytoPanelImp cytoPanelSouthWest;
 
-       // create cytopanel with tabs along the top for manual layout
-       protected CytoPanelImp cytoPanelSouthWest = new 
CytoPanelImp(SwingConstants.SOUTH_WEST,
-                                                                    
JTabbedPane.TOP,
-                                                                    
CytoPanelState.HIDE);
-
        // Status Bar
        protected JLabel statusBar;
 
@@ -661,10 +657,27 @@
                final BiModalJSplitPane topRightPane = 
createTopRightPane(networkViewManager);
                final BiModalJSplitPane rightPane = 
createRightPane(topRightPane);
                final BiModalJSplitPane masterPane = 
createMasterPane(networkPanel, rightPane);
+               createBottomLeft();
 
                return masterPane;
        }
 
+       protected void createBottomLeft() {
+               cytoPanelSouthWest = new 
CytoPanelImp(SwingConstants.SOUTH_WEST, JTabbedPane.TOP,
+                                                                    
CytoPanelState.HIDE);
+
+               BiModalJSplitPane split = new BiModalJSplitPane(this, 
JSplitPane.VERTICAL_SPLIT,
+                                             
BiModalJSplitPane.MODE_HIDE_SPLIT, new JPanel(),
+                                             cytoPanelSouthWest);
+               split.setResizeWeight(0);
+               cytoPanelSouthWest.setCytoPanelContainer(split);
+               cytoPanelSouthWest.setMinimumSize(new Dimension(180, 230));
+               cytoPanelSouthWest.setMaximumSize(new Dimension(180, 230));
+               cytoPanelSouthWest.setPreferredSize(new Dimension(180, 230));
+
+               new ToolCytoPanelListener( split, (CytoPanelImp)cytoPanelWest, 
cytoPanelSouthWest );
+       }
+
        /**
         * Creates the TopRight Pane.
         *

Added: cytoscape/trunk/src/cytoscape/view/ToolCytoPanelListener.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/ToolCytoPanelListener.java               
                (rev 0)
+++ cytoscape/trunk/src/cytoscape/view/ToolCytoPanelListener.java       
2010-02-11 00:50:22 UTC (rev 19286)
@@ -0,0 +1,83 @@
+
+/*
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications.  In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage.  See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package cytoscape.view;
+
+import cytoscape.view.cytopanels.BiModalJSplitPane;
+import cytoscape.view.cytopanels.CytoPanelListener;
+import cytoscape.view.cytopanels.CytoPanelState;
+import cytoscape.view.cytopanels.CytoPanel;
+import cytoscape.view.cytopanels.CytoPanelImp;
+
+import javax.swing.JLabel;
+
+
+/**
+ * This class handles the embedding of the Tools CytoPanel within the Control
+ * CytoPanel. For all other cytopanels this is handled by CytoPanelAction,
+ * but because tools panel is within another cytopanel, we have to handle 
things
+ * separately.
+ */
+class ToolCytoPanelListener implements CytoPanelListener {
+
+       BiModalJSplitPane split;
+       CytoPanel southWest;
+       CytoPanelImp west;
+       
+       ToolCytoPanelListener(BiModalJSplitPane split, CytoPanelImp west, 
CytoPanel southWest) {
+               this.split = split;
+               this.west = west;
+               this.southWest = southWest;
+
+               southWest.addCytoPanelListener(this);
+       }
+
+
+    public void onStateChange(CytoPanelState newState) {
+
+               if (newState == CytoPanelState.DOCK) 
+                       west.addComponentToSouth(split);
+               else 
+                       // removeComponentAtSouth() doesn't work properly, so 
we do this...
+                       west.addComponentToSouth(new JLabel());
+
+               west.validate();
+       }
+
+       public void onComponentSelected(int componentIndex) {}
+       public void onComponentAdded(int count) {}
+       public void onComponentRemoved(int count) {}
+}

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