Author: kono
Date: 2010-02-01 11:52:56 -0800 (Mon, 01 Feb 2010)
New Revision: 19094

Modified:
   cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java
   cytoscape/trunk/src/cytoscape/view/NetworkPanel.java
Log:
Tweaked component sizes and default window location.

Modified: cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java    2010-02-01 
18:55:25 UTC (rev 19093)
+++ cytoscape/trunk/src/cytoscape/view/CytoscapeDesktop.java    2010-02-01 
19:52:56 UTC (rev 19094)
@@ -93,7 +93,9 @@
        /*
         * Default Desktop Size (slitly wider than 2.4 and before for new UI)
         */
-       private static final Dimension DEF_DESKTOP_SIZE = new Dimension(950, 
700);
+       private static final Dimension DEF_DESKTOP_SIZE = new Dimension(980, 
720);
+       
+       private static final int DEF_DEVIDER_LOCATION = 310;
 
        /**
         *
@@ -321,12 +323,16 @@
                cyMenus.initializeMenus();
 
                // create the CytoscapeDesktop
-               BiModalJSplitPane masterPane = setupCytoPanels(networkPanel, 
networkViewManager);
+               final BiModalJSplitPane masterPane = 
setupCytoPanels(networkPanel, networkViewManager);
 
                // note - proper networkViewManager has been properly selected 
in
                // setupCytoPanels()
                main_panel.add(masterPane, BorderLayout.CENTER);
                main_panel.add(cyMenus.getToolBar(), BorderLayout.NORTH);
+               
+               // Set the width of Cytopanel West
+               masterPane.setDividerLocation(DEF_DEVIDER_LOCATION);
+               
                // Remove status bar.
                initStatusBar(main_panel);
                setJMenuBar(cyMenus.getMenuBar());
@@ -350,15 +356,15 @@
                pack();
                setSize(DEF_DESKTOP_SIZE);
                
-               // restore desktop location
-               restoreDesktop();
-
+               // Set desktop location
+               setDesktopLocation();
+               
                // show the Desktop
                setVisible(true);
                toFront();
        }
 
-       private void restoreDesktop(){
+       private void setDesktopLocation(){
                //restore desktop to previous location
                try {   
                        Properties props = new Properties();
@@ -370,6 +376,7 @@
                                        new 
Integer(props.get("h").toString()).intValue());
                }
                catch (Exception e){
+                       setLocationRelativeTo(null);
                }               
        }
        
@@ -688,9 +695,9 @@
        protected BiModalJSplitPane setupCytoPanels(NetworkPanel networkPanel,
                                                    NetworkViewManager 
networkViewManager) {
                // bimodals that our Cytopanels Live within
-               BiModalJSplitPane topRightPane = 
createTopRightPane(networkViewManager);
-               BiModalJSplitPane rightPane = createRightPane(topRightPane);
-               BiModalJSplitPane masterPane = createMasterPane(networkPanel, 
rightPane);
+               final BiModalJSplitPane topRightPane = 
createTopRightPane(networkViewManager);
+               final BiModalJSplitPane rightPane = 
createRightPane(topRightPane);
+               final BiModalJSplitPane masterPane = 
createMasterPane(networkPanel, rightPane);
 
                return masterPane;
        }

Modified: cytoscape/trunk/src/cytoscape/view/NetworkPanel.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/NetworkPanel.java        2010-02-01 
18:55:25 UTC (rev 19093)
+++ cytoscape/trunk/src/cytoscape/view/NetworkPanel.java        2010-02-01 
19:52:56 UTC (rev 19094)
@@ -98,6 +98,9 @@
        
        private static final long serialVersionUID = -7102083850894612840L;
        
+       private static final int DEF_DEVIDER_LOCATION = 280;
+       private static final int PANEL_PREFFERED_WIDTH = 250;
+       
        // Make this panel as a source of events.
        private final SwingPropertyChangeSupport pcs = new 
SwingPropertyChangeSupport(this);
                
@@ -154,7 +157,7 @@
 
        protected void initialize() {
                setLayout(new BorderLayout());
-               setPreferredSize(new Dimension(180, 700));
+               setPreferredSize(new Dimension(PANEL_PREFFERED_WIDTH, 700));
 
                treeTable.getTree().addTreeSelectionListener(this);
                treeTable.getTree().setRootVisible(false);
@@ -177,7 +180,7 @@
                split = new BiModalJSplitPane(cytoscapeDesktop, 
JSplitPane.VERTICAL_SPLIT,
                                              
BiModalJSplitPane.MODE_SHOW_SPLIT, scroll, navigatorPanel);
                split.setResizeWeight(1);
-
+               split.setDividerLocation(DEF_DEVIDER_LOCATION);
                add(split);
 
                // this mouse listener listens for the right-click event and 
will show

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