mirror of
https://github.com/nasa/trick.git
synced 2024-12-22 06:27:49 +00:00
Capped the maximum throttle value to 1000. (#434)
* Capped the maximum throttle value to 1000. Entering extremely large values into the maximum value field of the throttle GUI caused the GUI to freeze. Imposing a cap of 1000 to the maximum value prevents the GUI from freezing. * Updated brace style from Allman to K&R.
This commit is contained in:
parent
39aef15a8e
commit
af6b8cbea8
@ -191,8 +191,16 @@ public class SimControlActionController {
|
|||||||
maxField.addActionListener(
|
maxField.addActionListener(
|
||||||
new ActionListener() {
|
new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
// CTLaChance - 05-22-17
|
||||||
|
// Cap the maximum possible value to 1000.
|
||||||
|
if(Double.valueOf(maxField.getText()) > 1000) {
|
||||||
|
maxField.setText(Double.toString(1000));
|
||||||
|
slider.setDoubleMaximum(1000);
|
||||||
|
}
|
||||||
|
else {
|
||||||
slider.setDoubleMaximum(Double.valueOf(maxField.getText()));
|
slider.setDoubleMaximum(Double.valueOf(maxField.getText()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Box minMaxBox = Box.createHorizontalBox();
|
Box minMaxBox = Box.createHorizontalBox();
|
||||||
|
Loading…
Reference in New Issue
Block a user