jdk/src/share/classes/java/applet/AppletStub.java
author mcherkas
Fri, 04 Oct 2013 20:13:32 +0400
changeset 20455 f6f9a0c2796b
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index. Reviewed-by: anthony, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1995, 2006, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * using the applet's <code>setStub</code> method. This stub
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)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @since       JDK1.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public interface AppletStub {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * Determines if the applet is active. An applet is active just
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     * before its <code>start</code> method is called. It becomes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * inactive just before its <code>stop</code> method is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * @return  <code>true</code> if the applet is active;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     *          <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    boolean isActive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * Gets the URL of the document in which the applet is embedded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * For example, suppose an applet is contained
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * within the document:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    57
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * The document base is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    61
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @return  the {@link java.net.URL} of the document that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *          applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @see     java.applet.AppletStub#getCodeBase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    URL getDocumentBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * Gets the base URL. This is the URL of the directory which contains the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @return  the base {@link java.net.URL} of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     *          the directory which contains the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @see     java.applet.AppletStub#getDocumentBase()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    URL getCodeBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * Returns the value of the named parameter in the HTML tag. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * example, if an applet is specified as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * &lt;applet code="Clock" width=50 height=50&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * &lt;param name=Color value="blue"&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * &lt;/applet&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * then a call to <code>getParameter("Color")</code> returns the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * value <code>"blue"</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @param   name   a parameter name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @return  the value of the named parameter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * or <tt>null</tt> if not set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    String getParameter(String name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Returns the applet's context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @return  the applet's context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    AppletContext getAppletContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * Called when the applet wants to be resized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @param   width    the new requested width for the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @param   height   the new requested height for the applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    void appletResize(int width, int height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
}