home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / AppletContext.java < prev    next >
Text File  |  1996-05-03  |  3KB  |  87 lines

  1. /*
  2.  * @(#)AppletContext.java    1.13 95/12/14 Arthur van Hoff
  3.  *
  4.  * Copyright (c) 1994-1995 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package java.applet;
  21.  
  22. import java.awt.Image;
  23. import java.awt.Graphics;
  24. import java.awt.image.ColorModel;
  25. import java.net.URL;
  26. import java.util.Enumeration;
  27.  
  28. /**
  29.  * This interface corresponds to an applet's environment. It can be
  30.  * used by an applet to obtain information from the applet's
  31.  * environment, which is usually the browser or the applet viewer.
  32.  *
  33.  * @version     1.13, 14 Dec 1995
  34.  * @author     Arthur van Hoff
  35.  */
  36. public interface AppletContext {
  37.     /**
  38.      * Gets an audio clip.
  39.      */
  40.     AudioClip getAudioClip(URL url);
  41.  
  42.     /**
  43.      * Gets an image. This usually involves downloading it
  44.      * over the net. However, the environment may decide to
  45.      * cache images. This method takes an array of URLs,
  46.      * each of which will be tried until the image is found.
  47.      */
  48.     Image getImage(URL url);
  49.  
  50.     /**
  51.      * Gets an applet by name. 
  52.      * @return null if the applet does not exist.
  53.      */
  54.     Applet getApplet(String name);
  55.  
  56.     /**
  57.      * Enumerates the applets in this context. Only applets
  58.      * that are accessible will be returned. This list always
  59.      * includes the applet itself.
  60.      */
  61.     Enumeration getApplets();
  62.  
  63.     /**
  64.      * Shows a new document. This may be ignored by
  65.      * the applet context.
  66.      */
  67.     void showDocument(URL url);
  68.  
  69.     /**
  70.      * Show a new document in a target window or frame. This may be ignored by
  71.      * the applet context.
  72.      *
  73.      * This method accepts the target strings:
  74.      *   _self        show in current frame
  75.      *   _parent    show in parent frame
  76.      *   _top        show in top-most frame
  77.      *   _blank        show in new unnamed top-level window
  78.      *   <other>    show in new top-level window named <other>
  79.      */
  80.     public void showDocument(URL url, String target);
  81.  
  82.     /**
  83.      * Show a status string.
  84.      */
  85.     void showStatus(String status);
  86. }
  87.