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 / IFC_112 / netscape / application / Window.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  5.1 KB  |  174 lines  |  [TEXT/CWIE]

  1. // Window.java
  2. // By Ned Etcode
  3. // Copyright 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. import netscape.util.*;
  8.  
  9. /** Interface implemented by both the InternalWindow and ExternalWindow
  10.   * classes, defining functionality common to the two Window types.
  11.   * @see InternalWindow
  12.   * @see ExternalWindow
  13.   * @note 1.0 added moveToFront/Back
  14.   * @note 1.0 added support for Menus
  15.   * @note 1.0 added support for focus model
  16.   */
  17. public interface Window extends Target {
  18.     /** A Window type that has no title bar or border. */
  19.     public final static int BLANK_TYPE = 0;
  20.  
  21.     /** A Window type that has a title bar and border. */
  22.     public final static int TITLE_TYPE = 1;
  23.  
  24.     /** Command that makes the Window visible. */
  25.     public final static String SHOW = "show";
  26.  
  27.     /** Command that hides the Window. */
  28.     public final static String HIDE = "hide";
  29.  
  30.     /** Returns the Size defining the Window's content area. Use this
  31.       * Size to properly position and size any View that you plan to add to the
  32.       * Window.
  33.       */
  34.     public Size contentSize();
  35.  
  36.     /** Adds <B>aView</B> to the Window. */
  37.     public void addSubview(View aView);
  38.  
  39.     /** Displays the Window. */
  40.     public void show();
  41.  
  42.     /** Displays the Window until dismissed by the user.  This method will
  43.       * not return until the user closes the Window.  While the Window remains
  44.       * visible, no View outside the Window will receive Events.
  45.       */
  46.     public void showModally();
  47.  
  48.     /** Hides the Window. */
  49.     public void hide();
  50.  
  51.     /** Move the window to the front.
  52.       *
  53.       */
  54.     public void moveToFront();
  55.  
  56.     /** Move the window to the back.
  57.       *
  58.       */
  59.     public void moveToBack();
  60.  
  61.     /** Returns <b>true</b> if the Window is currently visible. */
  62.     public boolean isVisible();
  63.  
  64.     /** Sets the Window's title, the string displayed in its title bar.
  65.       */
  66.     public void setTitle(String aString);
  67.  
  68.     /** Returns the Window's title.
  69.       * @see #setTitle
  70.       */
  71.     public String title();
  72.  
  73.     /** Sets the Window's owner, the object interested in learning about
  74.       * special events, such as the user closing the Window.
  75.       */
  76.     public void setOwner(WindowOwner anObject);
  77.  
  78.     /** Returns the Window's owner.
  79.       * @see #setOwner
  80.       */
  81.     public WindowOwner owner();
  82.  
  83.     /** Sets the MenuView that will appear along the top edge of the Window.
  84.       */
  85.     public void setMenuView(MenuView aMenuView);
  86.  
  87.     /** Returns the MenuView that appears along the top edge of the Window.
  88.       */
  89.     public MenuView menuView();
  90.  
  91.     /** Returns the View containing the point (<B>x</B>, <B>y</B>). */
  92.     public View viewForMouse(int x, int y);
  93.  
  94.     /** Sets the Window's bounds to the rectangle (<b>x</b>, <b>y</b>,
  95.       * <b>width</b>, <b>height</b>).
  96.       */
  97.     public void setBounds(int x, int y, int width, int height);
  98.  
  99.     /** Sets the Window's bounds to <b>newBounds</b>. */
  100.     public void setBounds(Rect newBounds);
  101.  
  102.     /** Sets the Window's size to (<b>width</b>, <b>height</b>). */
  103.     public void sizeTo(int width, int height);
  104.  
  105.     /** Changes the Window's size by (<b>deltaWidth</b>, <b>deltaHeight</b>).
  106.       */
  107.     public void sizeBy(int deltaWidth, int deltaHeight);
  108.  
  109.     /** Changes the Window's location by (<b>deltaX</b>, <b>deltaY</b>).
  110.       */
  111.     public void moveBy(int deltaX, int deltaY);
  112.  
  113.     /** Sets the Window's location to (<b>x</b>, <b>y</b>). */
  114.     public void moveTo(int x, int y);
  115.  
  116.     /** Centers the Window. */
  117.     public void center();
  118.  
  119.     /** Returns the size the Window must be to support a content
  120.       * size of (<B>width</B>, <B>height</B>).
  121.       */
  122.     public Size windowSizeForContentSize(int width, int height);
  123.  
  124.    /** Returns a newly-allocated copy of the Window's bounding
  125.      * rectangle, which defines the Window's size and position.
  126.      */
  127.     public Rect bounds();
  128.  
  129.     /** Sets the Window's minimum size to (<b>width</b>, <b>height</b>). */
  130.     public void setMinSize(int width, int height);
  131.  
  132.     /** Returns the Window's minimum size.  Returns <b>null</b> if not set. */
  133.     public Size minSize();
  134.  
  135.     /** Sets whether the user can resize the Window. */
  136.     public void setResizable(boolean flag);
  137.  
  138.     /** Returns <b>true</b> if the user can resize the Window.
  139.       * @see #setResizable
  140.       */
  141.     public boolean isResizable();
  142.  
  143.    /** Sets whether the window contains a document. Windows containing document
  144.      * are treated in a different manner by the target chain.
  145.      *
  146.      */
  147.     public void setContainsDocument(boolean containsDocument);
  148.  
  149.     /** Return whether the window contains a document.
  150.       *
  151.       */
  152.     public boolean containsDocument();
  153.  
  154.     /** If the window contains a document, this method is called
  155.       * when the window just became the current document.
  156.       *
  157.      */
  158.     public void didBecomeCurrentDocument();
  159.  
  160.     /** If the window contains a document, this method is called
  161.       * when the window is no longer the current document.
  162.       *
  163.       */
  164.     public void didResignCurrentDocument();
  165.  
  166.     /** Return whether this window is the current document.
  167.       *
  168.       */
  169.     public boolean isCurrentDocument();
  170.  
  171. }
  172.  
  173.  
  174.