git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git]
/
src
/
jalview
/
gui
/
OptsAndParamsPage.java
diff --git
a/src/jalview/gui/OptsAndParamsPage.java
b/src/jalview/gui/OptsAndParamsPage.java
index
0f4d0e7
..
f05110f
100644
(file)
--- a/
src/jalview/gui/OptsAndParamsPage.java
+++ b/
src/jalview/gui/OptsAndParamsPage.java
@@
-20,13
+20,6
@@
*/
package jalview.gui;
*/
package jalview.gui;
-import jalview.util.MessageManager;
-import jalview.ws.params.ArgumentI;
-import jalview.ws.params.OptionI;
-import jalview.ws.params.ParameterI;
-import jalview.ws.params.ValueConstrainI;
-import jalview.ws.params.ValueConstrainI.ValueType;
-
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
@@
-35,6
+28,8
@@
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
@@
-59,6
+54,12
@@
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import jalview.util.MessageManager;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.OptionI;
+import jalview.ws.params.ParameterI;
+import jalview.ws.params.ValueConstrainI;
+import jalview.ws.params.ValueConstrainI.ValueType;
import net.miginfocom.swing.MigLayout;
/**
import net.miginfocom.swing.MigLayout;
/**
@@
-92,7
+93,7
@@
public class OptsAndParamsPage
JLabel optlabel = new JLabel();
JLabel optlabel = new JLabel();
- JComboBox val = new JComboBox();
+ JComboBox<String> val = new JComboBox<>();
public OptionBox(OptionI opt)
{
public OptionBox(OptionI opt)
{
@@
-126,7
+127,7
@@
public class OptsAndParamsPage
}
}
add(enabled, BorderLayout.NORTH);
}
}
add(enabled, BorderLayout.NORTH);
- for (Object str : opt.getPossibleValues())
+ for (String str : opt.getPossibleValues())
{
val.addItem(str);
}
{
val.addItem(str);
}
@@
-573,9
+574,8
@@
public class OptsAndParamsPage
if (!adjusting)
{
float value = slider.getSliderValue();
if (!adjusting)
{
float value = slider.getSliderValue();
- valueField.setText(
- integ ? Integer.toString((int) value)
- : Float.toString(value));
+ valueField.setText(integ ? Integer.toString((int) value)
+ : Float.toString(value));
checkIfModified();
}
}
checkIfModified();
}
}
@@
-588,7
+588,7
@@
public class OptsAndParamsPage
{
if (choice)
{
{
if (choice)
{
- choicebox = new JComboBox();
+ choicebox = new JComboBox<>();
choicebox.addActionListener(this);
controlPanel.add(choicebox, BorderLayout.CENTER);
}
choicebox.addActionListener(this);
controlPanel.add(choicebox, BorderLayout.CENTER);
}
@@
-621,8
+621,20
@@
public class OptsAndParamsPage
{
}
});
{
}
});
+ valueField.addFocusListener(new FocusAdapter()
+ {
+
+ @Override
+ public void focusLost(FocusEvent e)
+ {
+ actionPerformed(null);
+ }
+
+ });
valueField.setPreferredSize(new Dimension(60, 25));
valueField.setPreferredSize(new Dimension(60, 25));
+ valueField.setText(parm.getValue());
slider = makeSlider(parm.getValidValue());
slider = makeSlider(parm.getValidValue());
+ updateSliderFromValueField();
slider.addChangeListener(this);
controlPanel.add(slider, BorderLayout.WEST);
slider.addChangeListener(this);
controlPanel.add(slider, BorderLayout.WEST);
@@
-689,8
+701,7
@@
public class OptsAndParamsPage
{
valueField.setText(valueField.getText().trim());
iVal = Integer.valueOf(valueField.getText());
{
valueField.setText(valueField.getText().trim());
iVal = Integer.valueOf(valueField.getText());
- if (minValue != null
- && minValue.intValue() > iVal)
+ if (minValue != null && minValue.intValue() > iVal)
{
iVal = minValue.intValue();
// TODO: provide visual indication that hard limit was reached for
{
iVal = minValue.intValue();
// TODO: provide visual indication that hard limit was reached for
@@
-702,7
+713,7
@@
public class OptsAndParamsPage
}
} catch (NumberFormatException e)
{
}
} catch (NumberFormatException e)
{
- System.err.println(e.toString());
+ jalview.bin.Console.errPrintln(e.toString());
}
if (minValue != null || maxValue != null)
{
}
if (minValue != null || maxValue != null)
{
@@
-721,8
+732,7
@@
public class OptsAndParamsPage
{
valueField.setText(valueField.getText().trim());
fVal = Float.valueOf(valueField.getText());
{
valueField.setText(valueField.getText().trim());
fVal = Float.valueOf(valueField.getText());
- if (minValue != null
- && minValue.floatValue() > fVal)
+ if (minValue != null && minValue.floatValue() > fVal)
{
fVal = minValue.floatValue();
// TODO: provide visual indication that hard limit was reached for
{
fVal = minValue.floatValue();
// TODO: provide visual indication that hard limit was reached for
@@
-730,8
+740,7
@@
public class OptsAndParamsPage
// update value field to reflect any bound checking we performed.
valueField.setText("" + fVal);
}
// update value field to reflect any bound checking we performed.
valueField.setText("" + fVal);
}
- if (maxValue != null
- && maxValue.floatValue() < fVal)
+ if (maxValue != null && maxValue.floatValue() < fVal)
{
fVal = maxValue.floatValue();
// TODO: provide visual indication that hard limit was reached for
{
fVal = maxValue.floatValue();
// TODO: provide visual indication that hard limit was reached for
@@
-741,7
+750,7
@@
public class OptsAndParamsPage
}
} catch (NumberFormatException e)
{
}
} catch (NumberFormatException e)
{
- System.err.println(e.toString());
+ jalview.bin.Console.errPrintln(e.toString());
}
if (minValue != null && maxValue != null)
{
}
if (minValue != null && maxValue != null)
{