Path: blob/master/src/java.desktop/share/classes/java/applet/AppletStub.java
41152 views
/*1* Copyright (c) 1995, 2021, 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*/2425package java.applet;2627import java.net.URL;2829/**30* When an applet is first created, an applet stub is attached to it using the31* applet's {@code setStub} method. This stub serves as the interface between32* the applet and the browser environment or applet viewer environment in which33* the application is running.34*35* @author Arthur van Hoff36* @see java.applet.Applet#setStub(java.applet.AppletStub)37* @since 1.038* @deprecated The Applet API is deprecated, no replacement.39*/40@Deprecated(since = "9", forRemoval = true)41@SuppressWarnings("removal")42public interface AppletStub {4344/**45* Determines if the applet is active. An applet is active just before its46* {@code start} method is called. It becomes inactive just before its47* {@code stop} method is called.48*49* @return {@code true} if the applet is active; {@code false} otherwise50*/51boolean isActive();5253/**54* Gets the {@code URL} of the document in which the applet is embedded. For55* example, suppose an applet is contained within the document:56* <blockquote><pre>57* http://www.oracle.com/technetwork/java/index.html58* </pre></blockquote>59* The document base is:60* <blockquote><pre>61* http://www.oracle.com/technetwork/java/index.html62* </pre></blockquote>63*64* @return the {@link java.net.URL} of the document that contains the applet65* @see java.applet.AppletStub#getCodeBase()66*/67URL getDocumentBase();6869/**70* Gets the base {@code URL}. This is the {@code URL} of the directory which71* contains the applet.72*73* @return the base {@link java.net.URL} of the directory which contains the74* applet75* @see java.applet.AppletStub#getDocumentBase()76*/77URL getCodeBase();7879/**80* Returns the value of the named parameter in the HTML tag. For example, if81* an applet is specified as82* <blockquote><pre>83* <applet code="Clock" width=50 height=50>84* <param name=Color value="blue">85* </applet>86* </pre></blockquote>87* <p>88* then a call to {@code getParameter("Color")} returns the value89* {@code "blue"}.90*91* @param name a parameter name92* @return the value of the named parameter, or {@code null} if not set93*/94String getParameter(String name);9596/**97* Returns the applet's context.98*99* @return the applet's context100*/101AppletContext getAppletContext();102103/**104* Called when the applet wants to be resized.105*106* @param width the new requested width for the applet107* @param height the new requested height for the applet108*/109void appletResize(int width, int height);110}111112113