resolve some layout problems : JAL-685
authorjprocter <Jim Procter>
Fri, 29 Oct 2010 13:59:21 +0000 (13:59 +0000)
committerjprocter <Jim Procter>
Fri, 29 Oct 2010 13:59:21 +0000 (13:59 +0000)
src/jalview/gui/WsJobParameters.java

index 9164cc0..440a714 100644 (file)
@@ -23,6 +23,8 @@ import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
 import java.awt.GridLayout;
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
@@ -349,8 +351,9 @@ public class WsJobParameters extends JPanel implements ItemListener,
     setName.addItemListener(this);
     setName.getEditor().addActionListener(this);
     JPanel setNameInfo = new JPanel(new FlowLayout(FlowLayout.LEFT));
-    SetNamePanel.setLayout(new GridLayout(2, 1));
-    SetNamePanel.setMinimumSize(new Dimension(300, 40));
+    GridBagLayout gbl = new GridBagLayout();
+    SetNamePanel.setLayout(gbl);
+    SetNamePanel.setMinimumSize(new Dimension(300, 60));
     JLabel setNameLabel = new JLabel("Current parameter set name :");
     setNameLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
     // setNameLabel.setHorizontalAlignment(FlowLayout.LEFT);
@@ -373,7 +376,15 @@ public class WsJobParameters extends JPanel implements ItemListener,
     JPanel buttonArea = new JPanel(new GridLayout(1, 1));
     buttonArea.add(setsavebuts);
     SetNamePanel.add(setNameInfo);
+    GridBagConstraints gbc = new GridBagConstraints();
+    gbc.gridheight = 2;
+    gbl.setConstraints(setNameInfo, gbc);
     SetNamePanel.add(buttonArea);
+    gbc = new GridBagConstraints();
+    gbc.gridx=0;
+    gbc.gridy=2;
+    gbc.gridheight = 1;
+    gbl.setConstraints(buttonArea, gbc);
     setDetails.add(setDescrView, BorderLayout.CENTER);
     // setDetails.setPreferredSize(new Dimension(360, 100));
     jobParameters.setBorder(new TitledBorder("Parameters"));
@@ -655,7 +666,9 @@ public class WsJobParameters extends JPanel implements ItemListener,
 
     jobOptions.setPreferredSize(new Dimension(PARAM_WIDTH, optSet.size()
             * OPTSET_HEIGHT));
-    jobOptions.setLayout(new GridLayout(optSet.size(), 1));
+    FlowLayout fl;
+    jobOptions.setLayout(fl=new FlowLayout(FlowLayout.LEFT));
+    
     refreshParamLayout();
     paramPane.validate();
     revalidate();