Exemple #1
0
 /** Get an image ref. */
 static Ref getCachedImageRef(URL url) {
   synchronized (imageRefs) {
     AppletImageRef ref = (AppletImageRef) imageRefs.get(url);
     if (ref == null) {
       ref = new AppletImageRef(url);
       imageRefs.put(url, ref);
     }
     return ref;
   }
 }
Exemple #2
0
 /** Get an audio clip. */
 public AudioClip getAudioClip(URL url) {
   checkConnect(url);
   synchronized (audioClips) {
     AudioClip clip = (AudioClip) audioClips.get(url);
     if (clip == null) {
       audioClips.put(url, clip = new AppletAudioClip(url));
     }
     return clip;
   }
 }
Exemple #3
0
 /** Flush the image cache. */
 static void flushImageCache() {
   imageRefs.clear();
 }