src/java.desktop/share/classes/java/applet/AppletStub.java
author adinn
Fri, 26 Jan 2018 16:38:21 +0000
changeset 48682 34e45260c040
parent 47216 71c04702a3d5
child 50345 276cb4b17f79
permissions -rw-r--r--
8196221: AArch64: Mistake in committed patch for JDK-8195859 Summary: The wrong patch was committed for JDK-8195859 Reviewed-by: aph
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
38470
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
     2
 * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package java.applet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * When an applet is first created, an applet stub is attached to it
32283
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    31
 * using the applet's {@code setStub} method. This stub
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * serves as the interface between the applet and the browser
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * environment or applet viewer environment in which the application
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * is running.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @author      Arthur van Hoff
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * @see         java.applet.Applet#setStub(java.applet.AppletStub)
24865
09b1d992ca72 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
henryjen
parents: 23010
diff changeset
    38
 * @since       1.0
38470
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
    39
 *
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
    40
 * @deprecated  The Applet API is deprecated. See the
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
    41
 * <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
    42
 * for further information.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
38470
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
    44
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 32283
diff changeset
    45
@Deprecated(since = "9")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public interface AppletStub {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * Determines if the applet is active. An applet is active just
32283
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    49
     * before its {@code start} method is called. It becomes
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    50
     * inactive just before its {@code stop} method is called.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     *
32283
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    52
     * @return  {@code true} if the applet is active;
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    53
     *          {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    boolean isActive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * Gets the URL of the document in which the applet is embedded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * For example, suppose an applet is contained
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * within the document:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    63
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * The document base is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    67
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * @return  the {@link java.net.URL} of the document that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *          applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @see     java.applet.AppletStub#getCodeBase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    URL getDocumentBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * Gets the base URL. This is the URL of the directory which contains the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @return  the base {@link java.net.URL} of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *          the directory which contains the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @see     java.applet.AppletStub#getDocumentBase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    URL getCodeBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Returns the value of the named parameter in the HTML tag. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * example, if an applet is specified as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * &lt;applet code="Clock" width=50 height=50&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * &lt;param name=Color value="blue"&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * &lt;/applet&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * <p>
32283
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    94
     * then a call to {@code getParameter("Color")} returns the
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    95
     * value {@code "blue"}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @param   name   a parameter name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @return  the value of the named parameter,
32283
1a96ab120a48 8133134: docs: replace <tt> tags (obsolete in html5) for java.desktop
avstepan
parents: 25859
diff changeset
    99
     * or {@code null} if not set.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    String getParameter(String name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Returns the applet's context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @return  the applet's context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    AppletContext getAppletContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Called when the applet wants to be resized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * @param   width    the new requested width for the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @param   height   the new requested height for the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    void appletResize(int width, int height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
}