git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5346c89
)
JAL-591 tidy and comment code
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Fri, 20 Apr 2018 17:04:53 +0000
(18:04 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Fri, 20 Apr 2018 17:04:53 +0000
(18:04 +0100)
src/jalview/gui/WsJobParameters.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/WsJobParameters.java
b/src/jalview/gui/WsJobParameters.java
index
a1fcc6f
..
8377a16
100644
(file)
--- a/
src/jalview/gui/WsJobParameters.java
+++ b/
src/jalview/gui/WsJobParameters.java
@@
-816,6
+816,9
@@
public class WsJobParameters extends JPanel implements ItemListener,
settingDialog = stn;
}
settingDialog = stn;
}
+ /**
+ * Rebuilds the Options and Parameters panels
+ */
@Override
public void refreshParamLayout()
{
@Override
public void refreshParamLayout()
{
@@
-830,10
+833,19
@@
public class WsJobParameters extends JPanel implements ItemListener,
int hgap = 5;
int currentWidth = hgap;
int hgap = 5;
int currentWidth = hgap;
+ /*
+ * layout constraint 'nogrid' prevents vertical column alignment,
+ * allowing controls to flow without extra space inserted to align
+ */
optionsPanel.setLayout(new MigLayout("nogrid", "", ""));
optionsPanel.removeAll();
optionsPanel.setLayout(new MigLayout("nogrid", "", ""));
optionsPanel.removeAll();
-
JPanel lastAdded = null;
JPanel lastAdded = null;
+
+ /*
+ * add each control in turn; if adding would overflow the right margin,
+ * remove and re-add the previous parameter with "wrap" (after)
+ * in order to start a new row
+ */
for (OptionBox pbox : opanp.getOptSet().values())
{
pbox.validate();
for (OptionBox pbox : opanp.getOptSet().values())
{
pbox.validate();
@@
-872,8
+884,11
@@
public class WsJobParameters extends JPanel implements ItemListener,
for (ParamBox pbox : opanp.getParamSet().values())
{
pbox.validate();
for (ParamBox pbox : opanp.getParamSet().values())
{
pbox.validate();
- currentWidth += pbox.getSize().width + hgap;
- if (currentWidth /*+ 160*/ > availableWidth && lastAdded != null)
+ int boxWidth = pbox.getSize().width;
+ currentWidth += boxWidth + hgap;
+ boolean wrapAfterLast = currentWidth > availableWidth
+ && lastAdded != null;
+ if (wrapAfterLast)
{
paramsPanel.remove(lastAdded);
paramsPanel.add(lastAdded, "wrap");
{
paramsPanel.remove(lastAdded);
paramsPanel.add(lastAdded, "wrap");