Revision 42874 trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/ui/splash/MultiSplashWindow.java
MultiSplashWindow.java | ||
---|---|---|
34 | 34 |
import java.awt.Point; |
35 | 35 |
import java.awt.RenderingHints; |
36 | 36 |
import java.awt.Toolkit; |
37 |
import java.awt.event.ActionEvent; |
|
38 |
import java.awt.event.ActionListener; |
|
37 | 39 |
import java.awt.event.MouseEvent; |
38 | 40 |
import java.awt.event.MouseListener; |
39 | 41 |
|
... | ... | |
42 | 44 |
import javax.swing.JLabel; |
43 | 45 |
import javax.swing.JProgressBar; |
44 | 46 |
import javax.swing.JWindow; |
47 |
import javax.swing.Timer; |
|
45 | 48 |
|
46 | 49 |
import org.gvsig.andami.PluginServices; |
47 | 50 |
import org.gvsig.andami.messages.Messages; |
... | ... | |
51 | 54 |
|
52 | 55 |
|
53 | 56 |
|
54 |
public class MultiSplashWindow extends JWindow implements TimerCallBack,
|
|
57 |
public class MultiSplashWindow extends JWindow implements |
|
55 | 58 |
MouseListener { |
56 | 59 |
private static final Logger logger = LoggerFactory.getLogger(MultiSplashWindow.class); |
57 | 60 |
|
... | ... | |
67 | 70 |
private int current; |
68 | 71 |
private int lastIndex = -1; |
69 | 72 |
private Theme theme; |
70 |
private long[] timers;
|
|
73 |
private int[] timers;
|
|
71 | 74 |
|
72 | 75 |
private String version=""; |
73 | 76 |
private String[] versions=null; |
... | ... | |
110 | 113 |
numLogos = 1; |
111 | 114 |
img = new ImageIcon[1]; |
112 | 115 |
img[0] = PluginServices.getIconTheme().get("splash-default"); |
113 |
timers = new long[1];
|
|
114 |
timers[0] = 1000L;
|
|
116 |
timers = new int[1];
|
|
117 |
timers[0] = 1000; |
|
115 | 118 |
} |
116 | 119 |
versions=theme.getVersions(); |
117 | 120 |
points=theme.getPositions(); |
... | ... | |
183 | 186 |
|
184 | 187 |
public void tick() { |
185 | 188 |
current = index; |
186 |
timer.setInterval(timers[current]);
|
|
189 |
timer.setDelay(timers[current]);
|
|
187 | 190 |
repaint(); |
188 | 191 |
index++; |
189 | 192 |
|
... | ... | |
193 | 196 |
} |
194 | 197 |
|
195 | 198 |
public void start() { |
196 |
timer = new Timer(this, 1000); |
|
199 |
timer = new Timer(1000,new ActionListener() { |
|
200 |
|
|
201 |
@Override |
|
202 |
public void actionPerformed(ActionEvent e) { |
|
203 |
tick(); |
|
204 |
} |
|
205 |
}); |
|
197 | 206 |
timer.start(); |
198 | 207 |
} |
199 | 208 |
|
... | ... | |
211 | 220 |
|
212 | 221 |
public void stop() { |
213 | 222 |
timer.stop(); |
223 |
timer = null; |
|
214 | 224 |
} |
215 | 225 |
|
216 | 226 |
/** |
Also available in: Unified diff