|
@@ -89,8 +89,7 @@ public class TimePanel extends JPanel {
|
|
|
timer.setDelay(model.getTimerSpeed());
|
|
|
if (timeSlider.getValue() == model.getIterations() - 1) {
|
|
|
running = false;
|
|
|
- playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/play.png"))
|
|
|
- .getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
+ playBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/play.png", 30, 30, Image.SCALE_SMOOTH)));
|
|
|
timer.stop();
|
|
|
}
|
|
|
}
|
|
@@ -143,17 +142,14 @@ public class TimePanel extends JPanel {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
running = !running;
|
|
|
- playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30)));//relocated this here. as it was duplicate before.
|
|
|
+ controller.setIsSimRunning(running);
|
|
|
if (running) {
|
|
|
- if (!model.getIsSimRunning()) {
|
|
|
- controller.setIsSimRunning(true);
|
|
|
- }
|
|
|
timer.start();
|
|
|
timer.setDelay(model.getTimerSpeed());
|
|
|
- //playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30)));
|
|
|
+ playBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/pause.png", 30, 30, Image.SCALE_SMOOTH)));
|
|
|
} else {
|
|
|
timer.stop();
|
|
|
- //playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30)));
|
|
|
+ playBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/play.png", 30, 30, Image.SCALE_SMOOTH)));
|
|
|
}
|
|
|
}
|
|
|
});
|