src/java.desktop/share/classes/java/applet/Applet.java
author darcy
Tue, 24 Sep 2019 18:25:54 -0700
changeset 58309 c6f8b2c3dc66
parent 52740 52ea97fb80b0
permissions -rw-r--r--
8231334: Suppress warnings on non-serializable instance fields in client libs serializable classes Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
     2
 * Copyright (c) 1995, 2018, 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: 4261
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: 4261
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: 4261
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4261
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4261
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    25
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.applet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    28
import java.awt.AWTPermission;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    29
import java.awt.Dimension;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    30
import java.awt.GraphicsEnvironment;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    31
import java.awt.HeadlessException;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    32
import java.awt.Image;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    33
import java.awt.Panel;
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    34
import java.awt.event.ComponentEvent;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.io.ObjectInputStream;
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    37
import java.net.MalformedURLException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.Locale;
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    40
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    41
import javax.accessibility.AccessibleContext;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    42
import javax.accessibility.AccessibleRole;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    43
import javax.accessibility.AccessibleState;
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    44
import javax.accessibility.AccessibleStateSet;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
50652
11f36b771afd 8204454: Remove of sun.applet.AppletAudioClip
serb
parents: 50345
diff changeset
    46
import com.sun.media.sound.JavaSoundAudioClip;
11f36b771afd 8204454: Remove of sun.applet.AppletAudioClip
serb
parents: 50345
diff changeset
    47
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
/**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    49
 * An applet is a small program that is intended not to be run on its own, but
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    50
 * rather to be embedded inside another application.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    52
 * The {@code Applet} class must be the superclass of any applet that is to be
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    53
 * embedded in a Web page or viewed by the Java Applet Viewer. The
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    54
 * {@code Applet} class provides a standard interface between applets and their
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    55
 * environment.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    57
 * @author Arthur van Hoff
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    58
 * @author Chris Warth
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    59
 * @since 1.0
50345
276cb4b17f79 8203498: The specification for java.applet package should be updated
serb
parents: 47216
diff changeset
    60
 * @deprecated The Applet API is deprecated, no replacement.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 */
38470
6dd62dab450d 8157622: Add @Deprecated annotations to the Applet API classes
dtitov
parents: 35667
diff changeset
    62
@Deprecated(since = "9")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
public class Applet extends Panel {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * Constructs a new Applet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    68
     * Note: Many methods in {@code java.applet.Applet} may be invoked by the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    69
     * applet only after the applet is fully constructed; applet should avoid
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    70
     * calling methods in {@code java.applet.Applet} in the constructor.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    72
     * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    73
     *         returns {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public Applet() throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        if (GraphicsEnvironment.isHeadless()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Applets can be serialized but the following conventions MUST be followed:
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    85
     * <p>
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    86
     * Before Serialization: An applet must be in STOPPED state.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    87
     * <p>
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    88
     * After Deserialization: The applet will be restored in STOPPED state (and
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    89
     * most clients will likely move it into RUNNING state). The stub field will
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    90
     * be restored by the reader.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     */
32865
f9cb6e427f9e 8136783: Run blessed-modifier-order script on java.desktop
prr
parents: 25859
diff changeset
    92
    private transient AppletStub stub;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    94
    /**
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    95
     * Use serialVersionUID from JDK 1.0 for interoperability.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
    96
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    private static final long serialVersionUID = -5836846270535785031L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Read an applet from an object input stream.
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   101
     *
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   102
     * @param  s an object input stream
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   103
     * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   104
     *         returns {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    private void readObject(ObjectInputStream s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        throws ClassNotFoundException, IOException, HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        if (GraphicsEnvironment.isHeadless()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            throw new HeadlessException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        s.defaultReadObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * Sets this applet's stub. This is done automatically by the system.
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   119
     * <p>
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   120
     * If there is a security manager, its {@code checkPermission} method is
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   121
     * called with the {@code AWTPermission("setAppletStub")} permission if a
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   122
     * stub has already been set.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   123
     *
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   124
     * @param  stub the new stub
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   125
     * @throws SecurityException if the caller cannot set the stub
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public final void setStub(AppletStub stub) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        if (this.stub != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            SecurityManager s = System.getSecurityManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            if (s != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                s.checkPermission(new AWTPermission("setAppletStub"));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
11137
d5efdfdf72e0 7116993: fix warnings in java.applet
smarks
parents: 5506
diff changeset
   134
        this.stub = stub;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   138
     * Determines if this applet is active. An applet is marked active just
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   139
     * before its {@code start} method is called. It becomes inactive just
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   140
     * before its {@code stop} method is called.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   142
     * @return {@code true} if the applet is active; {@code false} otherwise
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   143
     * @see java.applet.Applet#start()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   144
     * @see java.applet.Applet#stop()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    public boolean isActive() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        if (stub != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            return stub.isActive();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        } else {        // If stub field not filled in, applet never active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   155
     * Gets the {@code URL} of the document in which this applet is embedded.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   156
     * For example, suppose an applet is contained within the document:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 14342
diff changeset
   158
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * The document base is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * <blockquote><pre>
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 14342
diff changeset
   162
     *    http://www.oracle.com/technetwork/java/index.html
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   165
     * @return the {@link java.net.URL} of the document that contains this
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   166
     *         applet
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   167
     * @see java.applet.Applet#getCodeBase()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    public URL getDocumentBase() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        return stub.getDocumentBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   174
     * Gets the base {@code URL}. This is the {@code URL} of the directory which
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   175
     * contains this applet.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   177
     * @return the base {@link java.net.URL} of the directory which contains
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   178
     *         this applet
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   179
     * @see java.applet.Applet#getDocumentBase()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    public URL getCodeBase() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        return stub.getCodeBase();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   186
     * Returns the value of the named parameter in the HTML tag. For example, if
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   187
     * this applet is specified as
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * &lt;applet code="Clock" width=50 height=50&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * &lt;param name=Color value="blue"&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * &lt;/applet&gt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   194
     * then a call to {@code getParameter("Color")} returns the value
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   195
     * {@code "blue"}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * <p>
35667
ed476aba94de 8138838: docs cleanup for java.desktop
avstepan
parents: 32865
diff changeset
   197
     * The {@code name} argument is case insensitive.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   199
     * @param  name a parameter name
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   200
     * @return the value of the named parameter, or {@code null} if not set
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     */
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   202
    public String getParameter(String name) {
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   203
        return stub.getParameter(name);
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   204
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   207
     * Determines this applet's context, which allows the applet to query and
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   208
     * affect the environment in which it runs.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   210
     * This environment of an applet represents the document that contains the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   211
     * applet.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   213
     * @return the applet's context
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public AppletContext getAppletContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        return stub.getAppletContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * Requests that this applet be resized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   222
     * @param  width the new requested width for the applet
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   223
     * @param  height the new requested height for the applet
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     */
11137
d5efdfdf72e0 7116993: fix warnings in java.applet
smarks
parents: 5506
diff changeset
   225
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public void resize(int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        Dimension d = size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        if ((d.width != width) || (d.height != height)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            super.resize(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            if (stub != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                stub.appletResize(width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Requests that this applet be resized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   239
     * @param  d an object giving the new width and height
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
11137
d5efdfdf72e0 7116993: fix warnings in java.applet
smarks
parents: 5506
diff changeset
   241
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public void resize(Dimension d) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        resize(d.width, d.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    /**
4261
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   247
     * Indicates if this container is a validate root.
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   248
     * <p>
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   249
     * {@code Applet} objects are the validate roots, and, therefore, they
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   250
     * override this method to return {@code true}.
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   251
     *
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   252
     * @return {@code true}
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   253
     * @see java.awt.Container#isValidateRoot
4261
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   254
     * @since 1.7
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   255
     */
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   256
    @Override
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   257
    public boolean isValidateRoot() {
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   258
        return true;
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   259
    }
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   260
126dc6fe0d7b 6852592: invalidate() must be smarter
anthony
parents: 2
diff changeset
   261
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   262
     * Requests that the argument string be displayed in the "status window".
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   263
     * Many browsers and applet viewers provide such a window, where the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   264
     * application can inform users of its current state.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   266
     * @param  msg a string to display in the status window
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public void showStatus(String msg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        getAppletContext().showStatus(msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   273
     * Returns an {@code Image} object that can then be painted on the screen.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   274
     * The {@code url} that is passed as an argument must specify an absolute
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   275
     * {@code URL}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   277
     * This method always returns immediately, whether or not the image exists.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   278
     * When this applet attempts to draw the image on the screen, the data will
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   279
     * be loaded. The graphics primitives that draw the image will incrementally
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   280
     * paint on the screen.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   282
     * @param  url an absolute {@code URL} giving the location of the image
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   283
     * @return the image at the specified {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   284
     * @see java.awt.Image
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    public Image getImage(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        return getAppletContext().getImage(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   291
     * Returns an {@code Image} object that can then be painted on the screen.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   292
     * The {@code url} argument must specify an absolute {@code URL}. The
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   293
     * {@code name} argument is a specifier that is relative to the {@code url}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   294
     * argument.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   296
     * This method always returns immediately, whether or not the image exists.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   297
     * When this applet attempts to draw the image on the screen, the data will
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   298
     * be loaded. The graphics primitives that draw the image will incrementally
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   299
     * paint on the screen.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   301
     * @param  url an absolute URL giving the base location of the image
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   302
     * @param  name the location of the image, relative to the {@code url}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   303
     *         argument
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   304
     * @return the image at the specified {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   305
     * @see java.awt.Image
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    public Image getImage(URL url, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
            return getImage(new URL(url, name));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        } catch (MalformedURLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   316
     * Get an audio clip from the given {@code URL}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   318
     * @param  url points to the audio clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   319
     * @return the audio clip at the specified {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   320
     * @since 1.2
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     */
32865
f9cb6e427f9e 8136783: Run blessed-modifier-order script on java.desktop
prr
parents: 25859
diff changeset
   322
    public static final AudioClip newAudioClip(URL url) {
50652
11f36b771afd 8204454: Remove of sun.applet.AppletAudioClip
serb
parents: 50345
diff changeset
   323
        return JavaSoundAudioClip.create(url);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   327
     * Returns the {@code AudioClip} object specified by the {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   328
     * argument.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   330
     * This method always returns immediately, whether or not the audio clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   331
     * exists. When this applet attempts to play the audio clip, the data will
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   332
     * be loaded.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   334
     * @param  url an absolute {@code URL} giving the location of the audio clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   335
     * @return the audio clip at the specified {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   336
     * @see java.applet.AudioClip
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    public AudioClip getAudioClip(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        return getAppletContext().getAudioClip(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   343
     * Returns the {@code AudioClip} object specified by the {@code URL} and
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   344
     * {@code name} arguments.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   346
     * This method always returns immediately, whether or not the audio clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   347
     * exists. When this applet attempts to play the audio clip, the data will
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   348
     * be loaded.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   350
     * @param  url an absolute {@code URL} giving the base location of the audio
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   351
     *         clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   352
     * @param  name the location of the audio clip, relative to the {@code url}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   353
     *         argument
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   354
     * @return the audio clip at the specified {@code URL}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   355
     * @see java.applet.AudioClip
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    public AudioClip getAudioClip(URL url, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            return getAudioClip(new URL(url, name));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        } catch (MalformedURLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   366
     * Returns information about this applet. An applet should override this
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   367
     * method to return a {@code String} containing information about the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   368
     * author, version, and copyright of the applet.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   370
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   371
     * returns {@code null}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   373
     * @return a string containing information about the author, version, and
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   374
     *         copyright of the applet
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    public String getAppletInfo() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   381
     * Gets the locale of the applet. It allows the applet to maintain its own
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   382
     * locale separated from the locale of the browser or appletviewer.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   384
     * @return the locale of the applet; if no locale has been set, the default
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   385
     *         locale is returned
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   386
     * @since 1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    public Locale getLocale() {
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   389
        Locale locale = super.getLocale();
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   390
        if (locale == null) {
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   391
            return Locale.getDefault();
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   392
        }
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   393
        return locale;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   397
     * Returns information about the parameters that are understood by this
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   398
     * applet. An applet should override this method to return an array of
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   399
     * strings describing these parameters.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   401
     * Each element of the array should be a set of three strings containing the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   402
     * name, the type, and a description. For example:
21957
97758de70fbd 8028019: AWT Doclint warning/error cleanup
rriggs
parents: 20455
diff changeset
   403
     * <blockquote><pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * String pinfo[][] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     *   {"fps",    "1-10",    "frames per second"},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     *   {"repeat", "boolean", "repeat image loop"},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     *   {"imgs",   "url",     "images directory"}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   411
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   412
     * returns {@code null}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   414
     * @return an array describing the parameters this applet looks for
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    public String[][] getParameterInfo() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   421
     * Plays the audio clip at the specified absolute {@code URL}. Nothing
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * happens if the audio clip cannot be found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   424
     * @param  url an absolute {@code URL} giving the location of the audio clip
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    public void play(URL url) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
        AudioClip clip = getAudioClip(url);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
        if (clip != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
            clip.play();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   434
     * Plays the audio clip given the {@code URL} and a specifier that is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * relative to it. Nothing happens if the audio clip cannot be found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   437
     * @param  url an absolute {@code URL} giving the base location of the audio
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   438
     *         clip
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   439
     * @param  name the location of the audio clip, relative to the {@code url}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   440
     *         argument
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    public void play(URL url, String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        AudioClip clip = getAudioClip(url, name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        if (clip != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
            clip.play();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   450
     * Called by the browser or applet viewer to inform this applet that it has
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   451
     * been loaded into the system. It is always called before the first time
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   452
     * that the {@code start} method is called.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   454
     * A subclass of {@code Applet} should override this method if it has
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   455
     * initialization to perform. For example, an applet with threads would use
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   456
     * the {@code init} method to create the threads and the {@code destroy}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   457
     * method to kill them.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   459
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   460
     * does nothing.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   462
     * @see java.applet.Applet#destroy()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   463
     * @see java.applet.Applet#start()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   464
     * @see java.applet.Applet#stop()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    public void init() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   470
     * Called by the browser or applet viewer to inform this applet that it
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   471
     * should start its execution. It is called after the {@code init} method
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   472
     * and each time the applet is revisited in a Web page.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   474
     * A subclass of {@code Applet} should override this method if it has any
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   475
     * operation that it wants to perform each time the Web page containing it
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   476
     * is visited. For example, an applet with animation might want to use the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   477
     * {@code start} method to resume animation, and the {@code stop} method to
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   478
     * suspend the animation.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   480
     * Note: some methods, such as {@code getLocationOnScreen}, can only provide
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   481
     * meaningful results if the applet is showing. Because {@code isShowing}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   482
     * returns {@code false} when the applet's {@code start} is first called,
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   483
     * methods requiring {@code isShowing} to return {@code true} should be
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   484
     * called from a {@code ComponentListener}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   486
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   487
     * does nothing.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   489
     * @see java.applet.Applet#destroy()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   490
     * @see java.applet.Applet#init()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   491
     * @see java.applet.Applet#stop()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   492
     * @see java.awt.Component#isShowing()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   493
     * @see java.awt.event.ComponentListener#componentShown(ComponentEvent)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    public void start() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   499
     * Called by the browser or applet viewer to inform this applet that it
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   500
     * should stop its execution. It is called when the Web page that contains
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   501
     * this applet has been replaced by another page, and also just before the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   502
     * applet is to be destroyed.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   504
     * A subclass of {@code Applet} should override this method if it has any
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   505
     * operation that it wants to perform each time the Web page containing it
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   506
     * is no longer visible. For example, an applet with animation might want to
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   507
     * use the {@code start} method to resume animation, and the {@code stop}
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   508
     * method to suspend the animation.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   510
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   511
     * does nothing.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   513
     * @see java.applet.Applet#destroy()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   514
     * @see java.applet.Applet#init()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    public void stop() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   520
     * Called by the browser or applet viewer to inform this applet that it is
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   521
     * being reclaimed and that it should destroy any resources that it has
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   522
     * allocated. The {@code stop} method will always be called before
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   523
     * {@code destroy}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   525
     * A subclass of {@code Applet} should override this method if it has any
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   526
     * operation that it wants to perform before it is destroyed. For example,
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   527
     * an applet with threads would use the {@code init} method to create the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   528
     * threads and the {@code destroy} method to kill them.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * <p>
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   530
     * The implementation of this method provided by the {@code Applet} class
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   531
     * does nothing.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   533
     * @see java.applet.Applet#init()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   534
     * @see java.applet.Applet#start()
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   535
     * @see java.applet.Applet#stop()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
    public void destroy() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
    // Accessibility support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   544
    /**
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   545
     * The accessible context associated with this {@code Applet}.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   546
     */
58309
c6f8b2c3dc66 8231334: Suppress warnings on non-serializable instance fields in client libs serializable classes
darcy
parents: 52740
diff changeset
   547
    @SuppressWarnings("serial") // Not statically typed as Serializable
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
    AccessibleContext accessibleContext = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   551
     * Gets the {@code AccessibleContext} associated with this {@code Applet}.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   552
     * For applets, the {@code AccessibleContext} takes the form of an
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   553
     * {@code AccessibleApplet}. A new {@code AccessibleApplet} instance is
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   554
     * created if necessary.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   556
     * @return an {@code AccessibleApplet} that serves as the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   557
     *         {@code AccessibleContext} of this {@code Applet}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
    public AccessibleContext getAccessibleContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
        if (accessibleContext == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
            accessibleContext = new AccessibleApplet();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
        return accessibleContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
    /**
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   568
     * This class implements accessibility support for the {@code Applet} class.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   569
     * It provides an implementation of the Java Accessibility API appropriate
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   570
     * to applet user-interface elements.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   571
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    protected class AccessibleApplet extends AccessibleAWTPanel {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   576
        /**
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   577
         * Use serialVersionUID from JDK 1.3 for interoperability.
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   578
         */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
        private static final long serialVersionUID = 8127374778187708896L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
         * Get the role of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
         *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   584
         * @return an instance of {@code AccessibleRole} describing the role of
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   585
         *         the object
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
        public AccessibleRole getAccessibleRole() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
            return AccessibleRole.FRAME;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
         * Get the state of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
         *
52740
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   594
         * @return an instance of {@code AccessibleStateSet} containing the
52ea97fb80b0 8211833: Javadoc cleanup of java.applet package
serb
parents: 50652
diff changeset
   595
         *         current state set of the object
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
         * @see AccessibleState
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
        public AccessibleStateSet getAccessibleStateSet() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
            AccessibleStateSet states = super.getAccessibleStateSet();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
            states.add(AccessibleState.ACTIVE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
            return states;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
}