< prev index next >

src/java.desktop/share/classes/java/applet/AppletStub.java

Print this page




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.applet;
  27 
  28 import java.net.URL;
  29 
  30 /**
  31  * When an applet is first created, an applet stub is attached to it
  32  * using the applet's {@code setStub} method. This stub
  33  * serves as the interface between the applet and the browser
  34  * environment or applet viewer environment in which the application
  35  * is running.
  36  *
  37  * @author      Arthur van Hoff
  38  * @see         java.applet.Applet#setStub(java.applet.AppletStub)
  39  * @since       1.0
  40  *
  41  * @deprecated The Applet API is deprecated, no replacement.
  42  */
  43 @Deprecated(since = "9")
  44 public interface AppletStub {

  45     /**
  46      * Determines if the applet is active. An applet is active just
  47      * before its {@code start} method is called. It becomes
  48      * inactive just before its {@code stop} method is called.
  49      *
  50      * @return  {@code true} if the applet is active;
  51      *          {@code false} otherwise.
  52      */
  53     boolean isActive();
  54 
  55 
  56     /**
  57      * Gets the URL of the document in which the applet is embedded.
  58      * For example, suppose an applet is contained
  59      * within the document:
  60      * <blockquote><pre>
  61      *    http://www.oracle.com/technetwork/java/index.html
  62      * </pre></blockquote>
  63      * The document base is:
  64      * <blockquote><pre>
  65      *    http://www.oracle.com/technetwork/java/index.html
  66      * </pre></blockquote>
  67      *
  68      * @return  the {@link java.net.URL} of the document that contains the
  69      *          applet.
  70      * @see     java.applet.AppletStub#getCodeBase()
  71      */
  72     URL getDocumentBase();
  73 
  74     /**
  75      * Gets the base URL. This is the URL of the directory which contains the applet.

  76      *
  77      * @return  the base {@link java.net.URL} of
  78      *          the directory which contains the applet.
  79      * @see     java.applet.AppletStub#getDocumentBase()
  80      */
  81     URL getCodeBase();
  82 
  83     /**
  84      * Returns the value of the named parameter in the HTML tag. For
  85      * example, if an applet is specified as
  86      * <blockquote><pre>
  87      * &lt;applet code="Clock" width=50 height=50&gt;
  88      * &lt;param name=Color value="blue"&gt;
  89      * &lt;/applet&gt;
  90      * </pre></blockquote>
  91      * <p>
  92      * then a call to {@code getParameter("Color")} returns the
  93      * value {@code "blue"}.
  94      *
  95      * @param   name   a parameter name.
  96      * @return  the value of the named parameter,
  97      * or {@code null} if not set.
  98      */
  99     String getParameter(String name);
 100 
 101     /**
 102      * Returns the applet's context.
 103      *
 104      * @return  the applet's context.
 105      */
 106     AppletContext getAppletContext();
 107 
 108     /**
 109      * Called when the applet wants to be resized.
 110      *
 111      * @param   width    the new requested width for the applet.
 112      * @param   height   the new requested height for the applet.
 113      */
 114     void appletResize(int width, int height);
 115 }


  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.applet;
  27 
  28 import java.net.URL;
  29 
  30 /**
  31  * When an applet is first created, an applet stub is attached to it using the
  32  * applet's {@code setStub} method. This stub serves as the interface between
  33  * the applet and the browser environment or applet viewer environment in which
  34  * the application is running.

  35  *
  36  * @author Arthur van Hoff
  37  * @see java.applet.Applet#setStub(java.applet.AppletStub)
  38  * @since 1.0

  39  * @deprecated The Applet API is deprecated, no replacement.
  40  */
  41 @Deprecated(since = "9")
  42 public interface AppletStub {
  43 
  44     /**
  45      * Determines if the applet is active. An applet is active just before its
  46      * {@code start} method is called. It becomes inactive just before its
  47      * {@code stop} method is called.
  48      *
  49      * @return {@code true} if the applet is active; {@code false} otherwise

  50      */
  51     boolean isActive();
  52 

  53     /**
  54      * Gets the {@code URL} of the document in which the applet is embedded. For
  55      * example, suppose an applet is contained within the document:

  56      * <blockquote><pre>
  57      *    http://www.oracle.com/technetwork/java/index.html
  58      * </pre></blockquote>
  59      * The document base is:
  60      * <blockquote><pre>
  61      *    http://www.oracle.com/technetwork/java/index.html
  62      * </pre></blockquote>
  63      *
  64      * @return the {@link java.net.URL} of the document that contains the applet

  65      * @see java.applet.AppletStub#getCodeBase()
  66      */
  67     URL getDocumentBase();
  68 
  69     /**
  70      * Gets the base {@code URL}. This is the {@code URL} of the directory which
  71      * contains the applet.
  72      *
  73      * @return the base {@link java.net.URL} of the directory which contains the
  74      *         applet
  75      * @see java.applet.AppletStub#getDocumentBase()
  76      */
  77     URL getCodeBase();
  78 
  79     /**
  80      * Returns the value of the named parameter in the HTML tag. For example, if
  81      * an applet is specified as
  82      * <blockquote><pre>
  83      * &lt;applet code="Clock" width=50 height=50&gt;
  84      * &lt;param name=Color value="blue"&gt;
  85      * &lt;/applet&gt;
  86      * </pre></blockquote>
  87      * <p>
  88      * then a call to {@code getParameter("Color")} returns the value
  89      * {@code "blue"}.
  90      *
  91      * @param  name a parameter name
  92      * @return the value of the named parameter, or {@code null} if not set

  93      */
  94     String getParameter(String name);
  95 
  96     /**
  97      * Returns the applet's context.
  98      *
  99      * @return the applet's context
 100      */
 101     AppletContext getAppletContext();
 102 
 103     /**
 104      * Called when the applet wants to be resized.
 105      *
 106      * @param  width the new requested width for the applet
 107      * @param  height the new requested height for the applet
 108      */
 109     void appletResize(int width, int height);
 110 }
< prev index next >