source: trunk/gcc/libjava/java/applet/AppletContext.java

Last change on this file was 1392, checked in by bird, 21 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 5.1 KB
Line 
1/* AppletContext.java -- access the applet's runtime environment
2 Copyright (C) 1999, 2002 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.applet;
40
41import java.awt.Image;
42import java.io.InputStream;
43import java.io.IOException;
44import java.net.URL;
45import java.util.Enumeration;
46import java.util.Iterator;
47
48/**
49 * This interface allows an applet access to the browser to retrieve
50 * additional data files and display documents. It also allows the
51 * applet to find out other applets in the same document.
52 *
53 * @author Aaron M. Renn (arenn@urbanophile.com)
54 * @since 1.0
55 * @status updated to 1.4
56 */
57public interface AppletContext
58{
59 /**
60 * Returns an audio clip from the specified URL.
61 *
62 * @param url the URL of the audio clip
63 * @return the retrieved audio clip
64 * @throws NullPointerException if url is null
65 */
66 AudioClip getAudioClip(URL url);
67
68 /**
69 * Returns an image from the specified URL. Note that the image is not
70 * actually retrieved until the applet attempts to display it, so this
71 * method returns immediately.
72 *
73 * @param url the absolute URL of the image
74 * @return the retrieved image
75 * @throws NullPointerException if url is null
76 */
77 Image getImage(URL url);
78
79 /**
80 * Returns the applet in the document for this object that has the
81 * specified name.
82 *
83 * @param name the applet name
84 * @return the requested applet, or <code>null</code> if not found
85 */
86 Applet getApplet(String name);
87
88 /**
89 * Returns a list of all the applets in the document for this object.
90 *
91 * @return a list of all the applets
92 */
93 Enumeration getApplets();
94
95 /**
96 * Displays the web page pointed to by the specified URL in the window
97 * for this object. This page replaces the document that is currently
98 * there.
99 *
100 * @param url the URL of the web page to load; unspecified on an error
101 */
102 void showDocument(URL url);
103
104 /**
105 * Displays the web page pointed to be the sepcified URL in the window
106 * with the specified name. The standard names "_top", "_blank",
107 * "_parent", and "_self" are allowed. An applet viewer may disregard
108 * this request.
109 *
110 * @param url the URL of the web page to load
111 * @param target the target window
112 */
113 void showDocument(URL url, String target);
114
115 /**
116 * Displays the specified message in the status window if that window
117 * exists.
118 *
119 * @param message the status message, may be null
120 */
121 void showStatus(String message);
122
123 /**
124 * Associate a stream to a key for this applet context, possibly replacing
125 * the old value. Stream associations are local to the applet context, for
126 * security purposes.
127 *
128 * @param key the key to associate with
129 * @param stream the stream value to tie to the key, or null to remove
130 * @throws IOException if the stream is too large
131 * @since 1.4
132 */
133 void setStream(String key, InputStream stream) throws IOException;
134
135 /**
136 * Return the stream associated with a given key in this applet context, or
137 * null if nothing is associated. Stream associations are local to the
138 * applet context, for security purposes.
139 *
140 * @param key the key to look up
141 * @return the associated stream, or null
142 * @since 1.4
143 */
144 InputStream getStream(String key);
145
146 /**
147 * Iterate over all keys that have associated streams. Stream associated
148 * are local to the applet context, for security purposes.
149 *
150 * @return an iterator over the association keys
151 * @since 1.4
152 */
153 Iterator getStreamKeys();
154} // interface AppletContext
Note: See TracBrowser for help on using the repository browser.