|
@@ -209,6 +209,9 @@ public class TimePanel extends JPanel {
|
|
|
.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
timeForwardBtn.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent ae) {
|
|
|
+ if (!model.getIsSimRunning()) {
|
|
|
+ controller.setIsSimRunning(true);
|
|
|
+ }
|
|
|
timeSlider.setValue(timeSlider.getValue() + 1);
|
|
|
controller.setCurIteration(timeSlider.getValue());
|
|
|
}
|
|
@@ -267,6 +270,17 @@ public class TimePanel extends JPanel {
|
|
|
controller.resetSimulation();
|
|
|
}
|
|
|
});
|
|
|
+ timeSlider.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0, false), "Right_ARROW");
|
|
|
+ timeSlider.getActionMap().put("Right_ARROW", new AbstractAction() {
|
|
|
+ private static final long serialVersionUID = 1L;
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ if (!model.getIsSimRunning()) {
|
|
|
+ controller.setIsSimRunning(true);
|
|
|
+ }
|
|
|
+ timeSlider.setValue(timeSlider.getValue()+1);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|