1. /*
  2. * @(#)AppletStub.java 1.18 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.applet;
  8. import java.net.URL;
  9. /**
  10. * When an applet is first created, an applet stub is attached to it
  11. * using the applet's <code>setStub</code> method. This stub
  12. * serves as the interface between the applet and the browser
  13. * environment or applet viewer environment in which the application
  14. * is running.
  15. *
  16. * @author Arthur van Hoff
  17. * @version 1.18, 11/29/01
  18. * @see java.applet.Applet#setStub(java.applet.AppletStub)
  19. * @since JDK1.0
  20. */
  21. public interface AppletStub {
  22. /**
  23. * Determines if the applet is active. An applet is active just
  24. * before its <code>start</code> method is called. It becomes
  25. * inactive just before its <code>stop</code> method is called.
  26. *
  27. * @return <code>true</code> if the applet is active;
  28. * <code>false</code> otherwise.
  29. */
  30. boolean isActive();
  31. /**
  32. * Gets the document URL.
  33. *
  34. * @return the <code>URL</code> of the document containing the applet.
  35. */
  36. URL getDocumentBase();
  37. /**
  38. * Gets the base URL.
  39. *
  40. * @return the <code>URL</code> of the applet.
  41. */
  42. URL getCodeBase();
  43. /**
  44. * Returns the value of the named parameter in the HTML tag. For
  45. * example, if an applet is specified as
  46. * <blockquote><pre>
  47. * <applet code="Clock" width=50 height=50>
  48. * <param name=Color value="blue">
  49. * </applet>
  50. * </pre></blockquote>
  51. * <p>
  52. * then a call to <code>getParameter("Color")</code> returns the
  53. * value <code>"blue"</code>.
  54. *
  55. * @param name a parameter name.
  56. * @return the value of the named parameter.
  57. */
  58. String getParameter(String name);
  59. /**
  60. * Gets a handler to the applet's context.
  61. *
  62. * @return the applet's context.
  63. */
  64. AppletContext getAppletContext();
  65. /**
  66. * Called when the applet wants to be resized.
  67. *
  68. * @param width the new requested width for the applet.
  69. * @param height the new requested height for the applet.
  70. */
  71. void appletResize(int width, int height);
  72. }