diff options
author | Pacien TRAN-GIRARD | 2014-05-22 21:39:40 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-05-22 21:39:40 +0200 |
commit | 4c38e09ea101f10be902023baae3af3736f6b0ec (patch) | |
tree | b09281c755df97822f77db38bfd5427c41e99716 | |
parent | 26b452f04fe4226e69f5276883ed5c754a4d50ee (diff) | |
download | esieequest-4c38e09ea101f10be902023baae3af3736f6b0ec.tar.gz |
Fix timer interferences
-rw-r--r-- | src/esieequest/view/app/UserInterface.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/esieequest/view/app/UserInterface.java b/src/esieequest/view/app/UserInterface.java index e0121a2..0f426bd 100644 --- a/src/esieequest/view/app/UserInterface.java +++ b/src/esieequest/view/app/UserInterface.java | |||
@@ -103,7 +103,7 @@ abstract class UserInterface implements Viewable, ActionListener { | |||
103 | private JButton leftButton; | 103 | private JButton leftButton; |
104 | private JButton rightButton; | 104 | private JButton rightButton; |
105 | 105 | ||
106 | private final Timer timer; | 106 | private Timer timer; |
107 | private TimerTask timerTask; | 107 | private TimerTask timerTask; |
108 | private boolean scenePlaying; | 108 | private boolean scenePlaying; |
109 | 109 | ||
@@ -119,7 +119,6 @@ abstract class UserInterface implements Viewable, ActionListener { | |||
119 | this.bindKeys(); | 119 | this.bindKeys(); |
120 | this.bindFocus(); | 120 | this.bindFocus(); |
121 | this.setControlsState(false); | 121 | this.setControlsState(false); |
122 | this.timer = new Timer(); | ||
123 | this.muted = false; | 122 | this.muted = false; |
124 | } | 123 | } |
125 | 124 | ||
@@ -625,6 +624,11 @@ abstract class UserInterface implements Viewable, ActionListener { | |||
625 | UserInterface.this.scenePlaying = false; | 624 | UserInterface.this.scenePlaying = false; |
626 | } | 625 | } |
627 | }; | 626 | }; |
627 | |||
628 | if (this.timer != null) { | ||
629 | this.timer.cancel(); | ||
630 | } | ||
631 | this.timer = new Timer(); | ||
628 | this.timer.schedule(this.timerTask, scene.getDuration()); | 632 | this.timer.schedule(this.timerTask, scene.getDuration()); |
629 | } | 633 | } |
630 | 634 | ||