Beispiel #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;
   }
 }
Beispiel #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;
   }
 }