home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / applet / AppletStub.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.5 KB  |  87 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)AppletStub.java    1.17 98/06/29
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.applet;
  15.  
  16. import java.net.URL;
  17.  
  18. /**
  19.  * When an applet is first created, an applet stub is attached to it
  20.  * using the applet's <code>setStub</code> method. This stub
  21.  * serves as the interface between the applet and the browser
  22.  * environment or applet viewer environment in which the application
  23.  * is running.
  24.  *
  25.  * @author     Arthur van Hoff
  26.  * @version     1.17, 06/29/98
  27.  * @see         java.applet.Applet#setStub(java.applet.AppletStub)
  28.  * @since       JDK1.0
  29.  */
  30. public interface AppletStub {
  31.     /**
  32.      * Determines if the applet is active. An applet is active just
  33.      * before its <code>start</code> method is called. It becomes
  34.      * inactive just before its <code>stop</code> method is called.
  35.      *
  36.      * @return  <code>true</code> if the applet is active;
  37.      *          <code>false</code> otherwise.
  38.      */
  39.     boolean isActive();
  40.  
  41.     /**
  42.      * Gets the document URL.
  43.      *
  44.      * @return  the <code>URL</code> of the document containing the applet.
  45.      */
  46.     URL getDocumentBase();
  47.  
  48.     /**
  49.      * Gets the base URL.
  50.      *
  51.      * @return  the <code>URL</code> of the applet.
  52.      */
  53.     URL getCodeBase();
  54.  
  55.     /**
  56.      * Returns the value of the named parameter in the HTML tag. For
  57.      * example, if an applet is specified as
  58.      * <blockquote><pre>
  59.      * <applet code="Clock" width=50 height=50>
  60.      * <param name=Color value="blue">
  61.      * </applet>
  62.      * </pre></blockquote>
  63.      * <p>
  64.      * then a call to <code>getParameter("Color")</code> returns the
  65.      * value <code>"blue"</code>.
  66.      *
  67.      * @param   name   a parameter name.
  68.      * @return  the value of the named parameter.
  69.      */
  70.     String getParameter(String name);
  71.  
  72.     /**
  73.      * Gets a handler to the applet's context.
  74.      *
  75.      * @return  the applet's context.
  76.      */
  77.     AppletContext getAppletContext();
  78.  
  79.     /**
  80.      * Called when the applet wants to be resized.
  81.      *
  82.      * @param   width    the new requested width for the applet.
  83.      * @param   height   the new requested height for the applet.
  84.      */
  85.     void appletResize(int width, int height);
  86. }
  87.