|
@@ -138,24 +138,22 @@ public class TimePanel extends JPanel {
|
|
playBtn.setContentAreaFilled(false);
|
|
playBtn.setContentAreaFilled(false);
|
|
playBtn.setBorderPainted(false);
|
|
playBtn.setBorderPainted(false);
|
|
playBtn.setBorder(null);
|
|
playBtn.setBorder(null);
|
|
- 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)));
|
|
playBtn.addActionListener(new ActionListener() {
|
|
playBtn.addActionListener(new ActionListener() {
|
|
@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.
|
|
if (running) {
|
|
if (running) {
|
|
if (!model.getIsSimRunning()) {
|
|
if (!model.getIsSimRunning()) {
|
|
controller.setIsSimRunning(true);
|
|
controller.setIsSimRunning(true);
|
|
}
|
|
}
|
|
timer.start();
|
|
timer.start();
|
|
timer.setDelay(model.getTimerSpeed());
|
|
timer.setDelay(model.getTimerSpeed());
|
|
- playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/pause.png"))
|
|
|
|
- .getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
|
|
|
+ //playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30)));
|
|
} else {
|
|
} else {
|
|
timer.stop();
|
|
timer.stop();
|
|
- 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/pause.png",30,30)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -163,8 +161,7 @@ public class TimePanel extends JPanel {
|
|
|
|
|
|
timeResetBtn.setContentAreaFilled(false);
|
|
timeResetBtn.setContentAreaFilled(false);
|
|
timeResetBtn.setBorder(null);
|
|
timeResetBtn.setBorder(null);
|
|
- timeResetBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/reset.png"))
|
|
|
|
- .getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
|
|
|
+ timeResetBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/reset.png", 30, 30)));
|
|
timeResetBtn.addActionListener(new ActionListener() {
|
|
timeResetBtn.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
timeSlider.setValue(timeSlider.getMinimum());
|
|
timeSlider.setValue(timeSlider.getMinimum());
|
|
@@ -180,8 +177,7 @@ public class TimePanel extends JPanel {
|
|
|
|
|
|
timeForwardBtn.setContentAreaFilled(false);
|
|
timeForwardBtn.setContentAreaFilled(false);
|
|
timeForwardBtn.setBorder(null);
|
|
timeForwardBtn.setBorder(null);
|
|
- timeForwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/forward.png"))
|
|
|
|
- .getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
|
|
|
+ timeForwardBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/forward.png",30,30)));
|
|
timeForwardBtn.addActionListener(new ActionListener() {
|
|
timeForwardBtn.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
if (!model.getIsSimRunning()) {
|
|
if (!model.getIsSimRunning()) {
|
|
@@ -194,8 +190,7 @@ public class TimePanel extends JPanel {
|
|
timeBackwardBtn.setToolTipText(Languages.getLanguage()[92]);
|
|
timeBackwardBtn.setToolTipText(Languages.getLanguage()[92]);
|
|
|
|
|
|
timeBackwardBtn.setBorder(null);
|
|
timeBackwardBtn.setBorder(null);
|
|
- timeBackwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/backward.png"))
|
|
|
|
- .getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
|
|
|
|
|
|
+ timeBackwardBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/backward.png", 30,30)));
|
|
timeBackwardBtn.addActionListener(new ActionListener() {
|
|
timeBackwardBtn.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
timeSlider.setValue(timeSlider.getValue() - 1);
|
|
timeSlider.setValue(timeSlider.getValue() - 1);
|