|
@@ -89,8 +89,7 @@ public class TimePanel extends JPanel {
|
|
timer.setDelay(model.getTimerSpeed());
|
|
timer.setDelay(model.getTimerSpeed());
|
|
if (timeSlider.getValue() == model.getIterations() - 1) {
|
|
if (timeSlider.getValue() == model.getIterations() - 1) {
|
|
running = false;
|
|
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();
|
|
timer.stop();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -143,17 +142,14 @@ public class TimePanel extends JPanel {
|
|
@Override
|
|
@Override
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
running = !running;
|
|
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 (running) {
|
|
- if (!model.getIsSimRunning()) {
|
|
|
|
- controller.setIsSimRunning(true);
|
|
|
|
- }
|
|
|
|
timer.start();
|
|
timer.start();
|
|
timer.setDelay(model.getTimerSpeed());
|
|
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 {
|
|
} else {
|
|
timer.stop();
|
|
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)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|