Showing the changes to java/pkg2/java/applet/AppletStub.java (1 of 18352 files). Show all
Unified · Split
| @@ -0,0 +1,111 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. | |
| 4 | + * | |
| 5 | + * | |
| 6 | + * | |
| 7 | + * | |
| 8 | + * | |
| 9 | + * | |
| 10 | + * | |
| 11 | + * | |
| 12 | + * | |
| 13 | + * | |
| 14 | + * | |
| 15 | + * | |
| 16 | + * | |
| 17 | + * | |
| 18 | + * | |
| 19 | + * | |
| 20 | + * | |
| 21 | + * | |
| 22 | + * | |
| 23 | + * | |
| 24 | + */ | |
| 25 | +package java.applet; | |
| 26 | + | |
| 27 | +import java.net.URL; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * When an applet is first created, an applet stub is attached to it | |
| 31 | + * using the applet's <code>setStub</code> method. This stub | |
| 32 | + * serves as the interface between the applet and the browser | |
| 33 | + * environment or applet viewer environment in which the application | |
| 34 | + * is running. | |
| 35 | + * | |
| 36 | + * @author Arthur van Hoff | |
| 37 | + * @see java.applet.Applet#setStub(java.applet.AppletStub) | |
| 38 | + * @since JDK1.0 | |
| 39 | + */ | |
| 40 | +public interface AppletStub { | |
| 41 | + /** | |
| 42 | + * Determines if the applet is active. An applet is active just | |
| 43 | + * before its <code>start</code> method is called. It becomes | |
| 44 | + * inactive just before its <code>stop</code> method is called. | |
| 45 | + * | |
| 46 | + * @return <code>true</code> if the applet is active; | |
| 47 | + * <code>false</code> otherwise. | |
| 48 | + */ | |
| 49 | + boolean isActive(); | |
| 50 | + | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * Gets the URL of the document in which the applet is embedded. | |
| 54 | + * For example, suppose an applet is contained | |
| 55 | + * within the document: | |
| 56 | + * <blockquote><pre> | |
| 57 | + * http://java.sun.com/products/jdk/1.2/index.html | |
| 58 | + * </pre></blockquote> | |
| 59 | + * The document base is: | |
| 60 | + * <blockquote><pre> | |
| 61 | + * http://java.sun.com/products/jdk/1.2/index.html | |
| 62 | + * </pre></blockquote> | |
| 63 | + * | |
| 64 | + * @return the {@link java.net.URL} of the document that contains the | |
| 65 | + * applet. | |
| 66 | + * @see java.applet.AppletStub#getCodeBase() | |
| 67 | + */ | |
| 68 | + URL getDocumentBase(); | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Gets the base URL. This is the URL of the directory which contains the applet. | |
| 72 | + * | |
| 73 | + * @return the base {@link java.net.URL} of | |
| 74 | + * the directory which contains the applet. | |
| 75 | + * @see java.applet.AppletStub#getDocumentBase() | |
| 76 | + */ | |
| 77 | + URL getCodeBase(); | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * Returns the value of the named parameter in the HTML tag. For | |
| 81 | + * example, if an applet is specified as | |
| 82 | + * <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")</code> returns the | |
| 89 | + * value <code>"blue"</code>. | |
| 90 | + * | |
| 91 | + * @param name a parameter name. | |
| 92 | + * @return the value of the named parameter, | |
| 93 | + * or <tt>null</tt> if not set. | |
| 94 | + */ | |
| 95 | + String getParameter(String name); | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * Returns the applet's context. | |
| 99 | + * | |
| 100 | + * @return the applet's context. | |
| 101 | + */ | |
| 102 | + AppletContext getAppletContext(); | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * Called when the applet wants to be resized. | |
| 106 | + * | |
| 107 | + * @param width the new requested width for the applet. | |
| 108 | + * @param height the new requested height for the applet. | |
| 109 | + */ | |
| 110 | + void appletResize(int width, int height); | |
| 111 | +} | |