mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +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,7 +191,15 @@ public class SimControlActionController {
|
||||
maxField.addActionListener(
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
slider.setDoubleMaximum(Double.valueOf(maxField.getText()));
|
||||
// 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()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user