Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/applet/AppletStub.java
38829 views
/*1* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package java.applet;2526import java.net.URL;2728/**29* When an applet is first created, an applet stub is attached to it30* using the applet's <code>setStub</code> method. This stub31* serves as the interface between the applet and the browser32* environment or applet viewer environment in which the application33* is running.34*35* @author Arthur van Hoff36* @see java.applet.Applet#setStub(java.applet.AppletStub)37* @since JDK1.038*/39public interface AppletStub {40/**41* Determines if the applet is active. An applet is active just42* before its <code>start</code> method is called. It becomes43* inactive just before its <code>stop</code> method is called.44*45* @return <code>true</code> if the applet is active;46* <code>false</code> otherwise.47*/48boolean isActive();495051/**52* Gets the URL of the document in which the applet is embedded.53* For example, suppose an applet is contained54* within the document:55* <blockquote><pre>56* http://www.oracle.com/technetwork/java/index.html57* </pre></blockquote>58* The document base is:59* <blockquote><pre>60* http://www.oracle.com/technetwork/java/index.html61* </pre></blockquote>62*63* @return the {@link java.net.URL} of the document that contains the64* applet.65* @see java.applet.AppletStub#getCodeBase()66*/67URL getDocumentBase();6869/**70* Gets the base URL. This is the URL of the directory which contains the applet.71*72* @return the base {@link java.net.URL} of73* the directory which contains the applet.74* @see java.applet.AppletStub#getDocumentBase()75*/76URL getCodeBase();7778/**79* Returns the value of the named parameter in the HTML tag. For80* example, if an applet is specified as81* <blockquote><pre>82* <applet code="Clock" width=50 height=50>83* <param name=Color value="blue">84* </applet>85* </pre></blockquote>86* <p>87* then a call to <code>getParameter("Color")</code> returns the88* value <code>"blue"</code>.89*90* @param name a parameter name.91* @return the value of the named parameter,92* or <tt>null</tt> if not set.93*/94String getParameter(String name);9596/**97* Returns the applet's context.98*99* @return the applet's context.100*/101AppletContext getAppletContext();102103/**104* Called when the applet wants to be resized.105*106* @param width the new requested width for the applet.107* @param height the new requested height for the applet.108*/109void appletResize(int width, int height);110}111112113