|
@@ -5,6 +5,8 @@ import java.awt.Color;
|
|
import java.awt.Image;
|
|
import java.awt.Image;
|
|
import java.awt.event.ActionEvent;
|
|
import java.awt.event.ActionEvent;
|
|
import java.awt.event.ActionListener;
|
|
import java.awt.event.ActionListener;
|
|
|
|
+import java.awt.event.MouseAdapter;
|
|
|
|
+import java.awt.event.MouseEvent;
|
|
|
|
|
|
import javax.swing.ImageIcon;
|
|
import javax.swing.ImageIcon;
|
|
import javax.swing.JButton;
|
|
import javax.swing.JButton;
|
|
@@ -94,6 +96,13 @@ public class TimePanel extends JPanel {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ timeSlider.addMouseListener(new MouseAdapter() {
|
|
|
|
+ @Override
|
|
|
|
+ public void mousePressed(MouseEvent e) {
|
|
|
|
+ controller.resetSimulation();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
// Panel
|
|
// Panel
|
|
timeBtnPanel.setBorder(null);
|
|
timeBtnPanel.setBorder(null);
|
|
timeBtnPanel.setBackground(Color.WHITE);
|
|
timeBtnPanel.setBackground(Color.WHITE);
|
|
@@ -134,7 +143,7 @@ public class TimePanel extends JPanel {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
timeSlider.setValue(timeSlider.getMinimum());
|
|
timeSlider.setValue(timeSlider.getMinimum());
|
|
controller.setCurIteration(timeSlider.getValue());
|
|
controller.setCurIteration(timeSlider.getValue());
|
|
- //controller.calculateStateForCurrentTimeStep();
|
|
|
|
|
|
+ // controller.calculateStateForCurrentTimeStep();
|
|
controller.resetSimulation();
|
|
controller.resetSimulation();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -170,7 +179,7 @@ public class TimePanel extends JPanel {
|
|
/*
|
|
/*
|
|
* the backwards button isnt used anymore
|
|
* the backwards button isnt used anymore
|
|
*/
|
|
*/
|
|
- //timeBtnPanel.add(timeBackwardBtn);
|
|
|
|
|
|
+ // timeBtnPanel.add(timeBackwardBtn);
|
|
timeBtnPanel.add(timeForwardBtn);
|
|
timeBtnPanel.add(timeForwardBtn);
|
|
|
|
|
|
this.add(timeBtnPanel, BorderLayout.WEST);
|
|
this.add(timeBtnPanel, BorderLayout.WEST);
|