author | adinn |
Fri, 26 Jan 2018 16:38:21 +0000 | |
changeset 48682 | 34e45260c040 |
parent 47498 | aa0344e6f39b |
child 50345 | 276cb4b17f79 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
45648
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
2 |
* Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.applet; |
|
27 |
||
28 |
import java.awt.Image; |
|
29 |
import java.awt.Graphics; |
|
30 |
import java.awt.image.ColorModel; |
|
31 |
import java.net.URL; |
|
32 |
import java.util.Enumeration; |
|
33 |
import java.io.InputStream; |
|
34 |
import java.io.IOException; |
|
35 |
import java.util.Iterator; |
|
36 |
||
37 |
/** |
|
38 |
* This interface corresponds to an applet's environment: the |
|
39 |
* document containing the applet and the other applets in the same |
|
40 |
* document. |
|
41 |
* <p> |
|
42 |
* The methods in this interface can be used by an applet to obtain |
|
43 |
* information about its environment. |
|
44 |
* |
|
45 |
* @author Arthur van Hoff |
|
24865
09b1d992ca72
8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents:
24701
diff
changeset
|
46 |
* @since 1.0 |
38470
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
47 |
* |
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
48 |
* @deprecated The Applet API is deprecated. See the |
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
49 |
* <a href="package-summary.html"> java.applet package documentation</a> |
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
50 |
* for further information. |
2 | 51 |
*/ |
38470
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
52 |
|
6dd62dab450d
8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents:
32283
diff
changeset
|
53 |
@Deprecated(since = "9") |
2 | 54 |
public interface AppletContext { |
55 |
/** |
|
56 |
* Creates an audio clip. |
|
57 |
* |
|
58 |
* @param url an absolute URL giving the location of the audio clip. |
|
59 |
* @return the audio clip at the specified URL. |
|
60 |
*/ |
|
61 |
AudioClip getAudioClip(URL url); |
|
62 |
||
63 |
/** |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
64 |
* Returns an {@code Image} object that can then be painted on |
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
65 |
* the screen. The {@code url} argument that is |
2 | 66 |
* passed as an argument must specify an absolute URL. |
67 |
* <p> |
|
68 |
* This method always returns immediately, whether or not the image |
|
69 |
* exists. When the applet attempts to draw the image on the screen, |
|
70 |
* the data will be loaded. The graphics primitives that draw the |
|
71 |
* image will incrementally paint on the screen. |
|
72 |
* |
|
73 |
* @param url an absolute URL giving the location of the image. |
|
74 |
* @return the image at the specified URL. |
|
75 |
* @see java.awt.Image |
|
76 |
*/ |
|
77 |
Image getImage(URL url); |
|
78 |
||
79 |
/** |
|
80 |
* Finds and returns the applet in the document represented by this |
|
81 |
* applet context with the given name. The name can be set in the |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
82 |
* HTML tag by setting the {@code name} attribute. |
2 | 83 |
* |
84 |
* @param name an applet name. |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
85 |
* @return the applet with the given name, or {@code null} if |
2 | 86 |
* not found. |
87 |
*/ |
|
88 |
Applet getApplet(String name); |
|
89 |
||
90 |
/** |
|
91 |
* Finds all the applets in the document represented by this applet |
|
92 |
* context. |
|
93 |
* |
|
94 |
* @return an enumeration of all applets in the document represented by |
|
95 |
* this applet context. |
|
96 |
*/ |
|
97 |
Enumeration<Applet> getApplets(); |
|
98 |
||
99 |
/** |
|
100 |
* Requests that the browser or applet viewer show the Web page |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
101 |
* indicated by the {@code url} argument. The browser or |
2 | 102 |
* applet viewer determines which window or frame to display the |
103 |
* Web page. This method may be ignored by applet contexts that |
|
104 |
* are not browsers. |
|
105 |
* |
|
106 |
* @param url an absolute URL giving the location of the document. |
|
107 |
*/ |
|
108 |
void showDocument(URL url); |
|
109 |
||
110 |
/** |
|
111 |
* Requests that the browser or applet viewer show the Web page |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
112 |
* indicated by the {@code url} argument. The |
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
113 |
* {@code target} argument indicates in which HTML frame the |
2 | 114 |
* document is to be displayed. |
115 |
* The target argument is interpreted as follows: |
|
21957 | 116 |
* |
45648
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
117 |
* <table class="striped"> |
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
118 |
* <caption>Target arguments and their descriptions</caption> |
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
119 |
* <thead> |
47498
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
120 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
121 |
* <th scope="col">Target Argument |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
122 |
* <th scope="col">Description |
45648
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
123 |
* </thead> |
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
124 |
* <tbody> |
47498
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
125 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
126 |
* <th scope="row">{@code "_self"} |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
127 |
* <td>Show in the window and frame that contain the applet. |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
128 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
129 |
* <th scope="row">{@code "_parent"} |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
130 |
* <td>Show in the applet's parent frame. If the applet's frame has no |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
131 |
* parent frame, acts the same as "_self". |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
132 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
133 |
* <th scope="row">{@code "_top"} |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
134 |
* <td>Show in the top-level frame of the applet's window. If the |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
135 |
* applet's frame is the top-level frame, acts the same as "_self". |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
136 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
137 |
* <th scope="row">{@code "_blank"} |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
138 |
* <td>Show in a new, unnamed top-level window. |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
139 |
* <tr> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
140 |
* <th scope="row"><i>name</i> |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
141 |
* <td>Show in the frame or window named <i>name</i>. If a target named |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
142 |
* <i>name</i> does not already exist, a new top-level window with the |
aa0344e6f39b
8184219: Fix accessibility of tables in the java.desktop module
serb
parents:
47216
diff
changeset
|
143 |
* specified name is created, and the document is shown there. |
45648
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
144 |
* </tbody> |
87c997b74bb8
8180326: Update the tables in java.desktop to be HTML-5 friendly
serb
parents:
38470
diff
changeset
|
145 |
* </table> |
2 | 146 |
* <p> |
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
147 |
* An applet viewer or browser is free to ignore {@code showDocument}. |
2 | 148 |
* |
149 |
* @param url an absolute URL giving the location of the document. |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
150 |
* @param target a {@code String} indicating where to display |
2 | 151 |
* the page. |
152 |
*/ |
|
153 |
public void showDocument(URL url, String target); |
|
154 |
||
155 |
/** |
|
156 |
* Requests that the argument string be displayed in the |
|
157 |
* "status window". Many browsers and applet viewers |
|
158 |
* provide such a window, where the application can inform users of |
|
159 |
* its current state. |
|
160 |
* |
|
161 |
* @param status a string to display in the status window. |
|
162 |
*/ |
|
163 |
void showStatus(String status); |
|
164 |
||
165 |
/** |
|
166 |
* Associates the specified stream with the specified key in this |
|
167 |
* applet context. If the applet context previously contained a mapping |
|
168 |
* for this key, the old value is replaced. |
|
169 |
* <p> |
|
170 |
* For security reasons, mapping of streams and keys exists for each |
|
171 |
* codebase. In other words, applet from one codebase cannot access |
|
172 |
* the streams created by an applet from a different codebase |
|
24701 | 173 |
* |
2 | 174 |
* @param key key with which the specified value is to be associated. |
175 |
* @param stream stream to be associated with the specified key. If this |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
176 |
* parameter is {@code null}, the specified key is removed |
2 | 177 |
* in this applet context. |
19207 | 178 |
* @throws IOException if the stream size exceeds a certain |
2 | 179 |
* size limit. Size limit is decided by the implementor of this |
180 |
* interface. |
|
181 |
* @since 1.4 |
|
182 |
*/ |
|
183 |
public void setStream(String key, InputStream stream)throws IOException; |
|
184 |
||
185 |
/** |
|
186 |
* Returns the stream to which specified key is associated within this |
|
32283
1a96ab120a48
8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents:
25859
diff
changeset
|
187 |
* applet context. Returns {@code null} if the applet context contains |
2 | 188 |
* no stream for this key. |
189 |
* <p> |
|
190 |
* For security reasons, mapping of streams and keys exists for each |
|
191 |
* codebase. In other words, applet from one codebase cannot access |
|
192 |
* the streams created by an applet from a different codebase |
|
24701 | 193 |
* |
2 | 194 |
* @return the stream to which this applet context maps the key |
195 |
* @param key key whose associated stream is to be returned. |
|
196 |
* @since 1.4 |
|
197 |
*/ |
|
198 |
public InputStream getStream(String key); |
|
199 |
||
200 |
/** |
|
201 |
* Finds all the keys of the streams in this applet context. |
|
202 |
* <p> |
|
203 |
* For security reasons, mapping of streams and keys exists for each |
|
204 |
* codebase. In other words, applet from one codebase cannot access |
|
205 |
* the streams created by an applet from a different codebase |
|
24701 | 206 |
* |
2 | 207 |
* @return an Iterator of all the names of the streams in this applet |
208 |
* context. |
|
209 |
* @since 1.4 |
|
210 |
*/ |
|
211 |
public Iterator<String> getStreamKeys(); |
|
212 |
} |