home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / swing / DesktopManager.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  4.7 KB  |  111 lines

  1. /*
  2.  * @(#)DesktopManager.java    1.3 98/01/30
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package java.awt.swing;
  22.  
  23. /** DesktopManager objects are owned by a JDesktopPane object. They are responsible
  24.   * for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame 
  25.   * implementations should delegate specific behaviors to the DesktopManager. For
  26.   * instance, if a JInternalFrame was asked to iconify it should try:
  27.   * <PRE>
  28.   *    getDesktopPane().getDesktopManager().iconifyFrame(frame);
  29.   * </PRE>
  30.   * This will allow you to build custom behaviors for desktop specific actions.
  31.   * @see JDesktopPane
  32.   * @see JInternalFrame
  33.   * @see JDesktopIcon
  34.   *
  35.   * @version 1.3 01/30/98
  36.   * @author David Kloba
  37.   */
  38. public interface DesktopManager
  39. {
  40.     /** If possible, display this frame in an appropriate location.
  41.       * Normally, this is not called, as the creator of the JInternalFrame
  42.       * will add the frame to the appropriate parent.
  43.       */
  44.     void openFrame(JInternalFrame f); 
  45.  
  46.     /** Generally, this call should remove the frame from it's parent. */
  47.     void closeFrame(JInternalFrame f); 
  48.  
  49.     /** Generally, the frame should be resized to match it's parents bounds. */
  50.     void maximizeFrame(JInternalFrame f);
  51.     /** Generally, this indicates that the frame should be restored to it's 
  52.       * size and position prior to a maximizeFrame() call.
  53.       */
  54.     void minimizeFrame(JInternalFrame f);
  55.     /** Generally, remove this frame from it's parent and add an iconic representation. */
  56.     void iconifyFrame(JInternalFrame f);
  57.     /** Generally, remove any iconic representation that is present and restore the
  58.       * frame to it's original size and location.
  59.       */
  60.     void deiconifyFrame(JInternalFrame f);
  61.  
  62.     /** 
  63.      * Generally, indicate that this frame has focus. This is usually called after 
  64.      * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
  65.      */
  66.     void activateFrame(JInternalFrame f);
  67.  
  68.     /** 
  69.      * Generally, indicate that this frame has lost focus. This is usually called 
  70.      * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
  71.      */
  72.     void deactivateFrame(JInternalFrame f);
  73.  
  74.     /** This method is normally called when the user has indicated that 
  75.       * they will begin dragging a component around. This method should be called
  76.       * prior to any dragFrame() calls to allow the DesktopManager to prepare any
  77.       * necessary state. Normally <b>f</b> will be a JInternalFrame.
  78.       */
  79.     void beginDraggingFrame(JComponent f);
  80.  
  81.     /** The user has moved the frame. Calls to this method will be preceeded by calls
  82.       * to beginDraggingFrame(). 
  83.       *  Normally <b>f</b> will be a JInternalFrame.
  84.       */
  85.     void dragFrame(JComponent f, int newX, int newY);
  86.     /** This method signals the end of the dragging session. Any state maintained by
  87.       * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
  88.       */
  89.     void endDraggingFrame(JComponent f);
  90.  
  91.     /** This methods is normally called when the user has indicated that 
  92.       * they will begin resizing the frame. This method should be called
  93.       * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
  94.       * necessary state.  Normally <b>f</b> will be a JInternalFrame.
  95.       */
  96.     void beginResizingFrame(JComponent f, int direction);
  97.     /** The user has resized the component. Calls to this method will be preceeded by calls
  98.       * to beginResizingFrame(). 
  99.       *  Normally <b>f</b> will be a JInternalFrame.
  100.       */
  101.     void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  102.     /** This method signals the end of the resize session. Any state maintained by
  103.       * the DesktopManager can be removed here.  Normally <b>f</b> will be a JInternalFrame.
  104.       */
  105.     void endResizingFrame(JComponent f);
  106.  
  107.     /** This is a primative reshape method.*/
  108.     void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
  109. }
  110.  
  111.