44 |
import java.io.InputStream; |
import java.io.InputStream; |
45 |
import java.net.URL; |
import java.net.URL; |
46 |
import java.util.Enumeration; |
import java.util.Enumeration; |
47 |
|
import java.util.Hashtable; |
48 |
import java.util.Iterator; |
import java.util.Iterator; |
49 |
|
|
50 |
public class AppletContextImpl implements AppletContext |
public class AppletContextImpl implements AppletContext |
51 |
{ |
{ |
52 |
public AppletContextImpl() |
private Hashtable applets; |
53 |
|
|
54 |
|
// FIXME: From JDK 1.4.2 documentaion: For security reasons, mapping of |
55 |
|
// streams and keys exists for each codebase. In other words, applet from |
56 |
|
// one codebase cannot access the streams created by an applet from a |
57 |
|
// different codebase |
58 |
|
private Hashtable streams; |
59 |
|
|
60 |
|
AppletContextImpl() |
61 |
{ |
{ |
62 |
throw new Error ("not implemented"); |
throw new Error ("not implemented"); |
63 |
} |
} |
64 |
|
|
65 |
public Applet getApplet (String name) |
public Applet getApplet (String name) |
66 |
{ |
{ |
67 |
throw new Error ("not implemented"); |
return (Applet) applets.get (name); |
68 |
} |
} |
69 |
|
|
70 |
public Enumeration getApplets() |
public Enumeration getApplets() |
71 |
{ |
{ |
72 |
throw new Error ("not implemented"); |
return applets.elements(); |
73 |
} |
} |
74 |
|
|
75 |
public AudioClip getAudioClip (URL url) |
public AudioClip getAudioClip (URL url) |
84 |
|
|
85 |
public InputStream getStream (String key) |
public InputStream getStream (String key) |
86 |
{ |
{ |
87 |
throw new Error ("not implemented"); |
return (InputStream) streams.get (key); |
88 |
} |
} |
89 |
|
|
90 |
public Iterator getStreamKeys() |
public Iterator getStreamKeys() |
91 |
{ |
{ |
92 |
throw new Error ("not implemented"); |
return streams.keySet().iterator(); |
93 |
} |
} |
94 |
|
|
95 |
public void setStream (String key, InputStream stream) |
public void setStream (String key, InputStream stream) |
96 |
{ |
{ |
97 |
throw new Error ("not implemented"); |
if (streams != null) |
98 |
|
streams.put (key, stream); |
99 |
|
else |
100 |
|
streams.remove (key); |
101 |
} |
} |
102 |
|
|
103 |
public void showDocument (URL url) |
public void showDocument (URL url) |
105 |
showDocument (url, "_self"); |
showDocument (url, "_self"); |
106 |
} |
} |
107 |
|
|
108 |
public void showDocument (URL url, String target) |
public native void showDocument (URL url, String target); |
|
{ |
|
|
throw new Error ("not implemented"); |
|
|
} |
|
109 |
|
|
110 |
public void showStatus (String status) |
public native void showStatus (String status); |
|
{ |
|
|
throw new Error ("not implemented"); |
|
|
} |
|
111 |
} |
} |