@@ -265,7 +265,10 @@ public class SimulationManager extends Observable {
* duration in milliseconds of a step
*/
public void setStepDuration(long duration) {
- this.duration = duration;
+ if(duration>0)
+ this.duration = duration;
+ else
+ this.duration = 1;
notifyPanels();
}
@@ -383,6 +383,7 @@ public class SimulationConfigurator extends JFrame implements Observer{
if(mutex)return;
try{
long l = Long.parseLong(tfStepDuration.getText());
+ if(l<=0)throw new NumberFormatException("Duration shall not be negative");
if(!sim.isRunning()){
mutex = true;