AppletContext.java revision 0
2362N/A * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * This interface corresponds to an applet's environment: the 0N/A * document containing the applet and the other applets in the same 0N/A * The methods in this interface can be used by an applet to obtain 0N/A * information about its environment. 0N/A * @author Arthur van Hoff 0N/A * Creates an audio clip. 0N/A * @param url an absolute URL giving the location of the audio clip. 0N/A * @return the audio clip at the specified URL. 0N/A * Returns an <code>Image</code> object that can then be painted on 0N/A * the screen. The <code>url</code> argument<code> </code>that is 0N/A * passed as an argument must specify an absolute URL. 0N/A * This method always returns immediately, whether or not the image 0N/A * exists. When the applet attempts to draw the image on the screen, 0N/A * the data will be loaded. The graphics primitives that draw the 0N/A * image will incrementally paint on the screen. 0N/A * @param url an absolute URL giving the location of the image. 0N/A * @return the image at the specified URL. 0N/A * @see java.awt.Image 0N/A * Finds and returns the applet in the document represented by this 0N/A * applet context with the given name. The name can be set in the 0N/A * HTML tag by setting the <code>name</code> attribute. 0N/A * @param name an applet name. 0N/A * @return the applet with the given name, or <code>null</code> if 0N/A * Finds all the applets in the document represented by this applet 0N/A * @return an enumeration of all applets in the document represented by 0N/A * this applet context. * Requests that the browser or applet viewer show the Web page * indicated by the <code>url</code> argument. The browser or * applet viewer determines which window or frame to display the * Web page. This method may be ignored by applet contexts that * @param url an absolute URL giving the location of the document. * Requests that the browser or applet viewer show the Web page * indicated by the <code>url</code> argument. The * <code>target</code> argument indicates in which HTML frame the * document is to be displayed. * The target argument is interpreted as follows: * <center><table border="3" summary="Target arguments and their descriptions"> * <tr><th>Target Argument</th><th>Description</th></tr> * <tr><td><code>"_self"</code> <td>Show in the window and frame that * contain the applet.</tr> * <tr><td><code>"_parent"</code><td>Show in the applet's parent frame. If * the applet's frame has no parent frame, * acts the same as "_self".</tr> * <tr><td><code>"_top"</code> <td>Show in the top-level frame of the applet's * window. If the applet's frame is the * top-level frame, acts the same as "_self".</tr> * <tr><td><code>"_blank"</code> <td>Show in a new, unnamed * <tr><td><i>name</i><td>Show in the frame or window named <i>name</i>. If * a target named <i>name</i> does not already exist, a * new top-level window with the specified name is created, * and the document is shown there.</tr> * An applet viewer or browser is free to ignore <code>showDocument</code>. * @param url an absolute URL giving the location of the document. * @param target a <code>String</code> indicating where to display * Requests that the argument string be displayed in the * "status window". Many browsers and applet viewers * provide such a window, where the application can inform users of * @param status a string to display in the status window. * Associates the specified stream with the specified key in this * applet context. If the applet context previously contained a mapping * for this key, the old value is replaced. * For security reasons, mapping of streams and keys exists for each * codebase. In other words, applet from one codebase cannot access * the streams created by an applet from a different codebase * @param key key with which the specified value is to be associated. * @param stream stream to be associated with the specified key. If this * parameter is <code>null</code>, the specified key is removed * in this applet context. * @throws <code>IOException</code> if the stream size exceeds a certain * size limit. Size limit is decided by the implementor of this * Returns the stream to which specified key is associated within this * applet context. Returns <tt>null</tt> if the applet context contains * no stream for this key. * For security reasons, mapping of streams and keys exists for each * codebase. In other words, applet from one codebase cannot access * the streams created by an applet from a different codebase * @return the stream to which this applet context maps the key * @param key key whose associated stream is to be returned. * Finds all the keys of the streams in this applet context. * For security reasons, mapping of streams and keys exists for each * codebase. In other words, applet from one codebase cannot access * the streams created by an applet from a different codebase * @return an Iterator of all the names of the streams in this applet