src/share/classes/javax/swing/DefaultDesktopManager.java

Print this page




  30 import sun.awt.AWTAccessor;
  31 import sun.awt.SunToolkit;
  32 
  33 import java.awt.*;
  34 import java.beans.PropertyVetoException;
  35 
  36 /** This is an implementation of the <code>DesktopManager</code>.
  37   * It currently implements the basic behaviors for managing
  38   * <code>JInternalFrame</code>s in an arbitrary parent.
  39   * <code>JInternalFrame</code>s that are not children of a
  40   * <code>JDesktop</code> will use this component
  41   * to handle their desktop-like actions.
  42   * <p>This class provides a policy for the various JInternalFrame methods,
  43   * it is not meant to be called directly rather the various JInternalFrame
  44   * methods will call into the DesktopManager.</p>
  45   * @see JDesktopPane
  46   * @see JInternalFrame
  47   * @author David Kloba
  48   * @author Steve Wilson
  49   */

  50 public class DefaultDesktopManager implements DesktopManager, java.io.Serializable {
  51     final static String HAS_BEEN_ICONIFIED_PROPERTY = "wasIconOnce";
  52 
  53     final static int DEFAULT_DRAG_MODE = 0;
  54     final static int OUTLINE_DRAG_MODE = 1;
  55     final static int FASTER_DRAG_MODE = 2;
  56 
  57     int dragMode = DEFAULT_DRAG_MODE;
  58 
  59     private transient Rectangle currentBounds = null;
  60     private transient Graphics desktopGraphics = null;
  61     private transient Rectangle desktopBounds = null;
  62     private transient Rectangle[] floatingItems = {};
  63 
  64     /**
  65      * Set to true when the user actually drags a frame vs clicks on it
  66      * to start the drag operation.  This is only used when dragging with
  67      * FASTER_DRAG_MODE.
  68      */
  69     private transient boolean didDrag;




  30 import sun.awt.AWTAccessor;
  31 import sun.awt.SunToolkit;
  32 
  33 import java.awt.*;
  34 import java.beans.PropertyVetoException;
  35 
  36 /** This is an implementation of the <code>DesktopManager</code>.
  37   * It currently implements the basic behaviors for managing
  38   * <code>JInternalFrame</code>s in an arbitrary parent.
  39   * <code>JInternalFrame</code>s that are not children of a
  40   * <code>JDesktop</code> will use this component
  41   * to handle their desktop-like actions.
  42   * <p>This class provides a policy for the various JInternalFrame methods,
  43   * it is not meant to be called directly rather the various JInternalFrame
  44   * methods will call into the DesktopManager.</p>
  45   * @see JDesktopPane
  46   * @see JInternalFrame
  47   * @author David Kloba
  48   * @author Steve Wilson
  49   */
  50 @SuppressWarnings("serial") // No Interesting Non-Transient State
  51 public class DefaultDesktopManager implements DesktopManager, java.io.Serializable {
  52     final static String HAS_BEEN_ICONIFIED_PROPERTY = "wasIconOnce";
  53 
  54     final static int DEFAULT_DRAG_MODE = 0;
  55     final static int OUTLINE_DRAG_MODE = 1;
  56     final static int FASTER_DRAG_MODE = 2;
  57 
  58     int dragMode = DEFAULT_DRAG_MODE;
  59 
  60     private transient Rectangle currentBounds = null;
  61     private transient Graphics desktopGraphics = null;
  62     private transient Rectangle desktopBounds = null;
  63     private transient Rectangle[] floatingItems = {};
  64 
  65     /**
  66      * Set to true when the user actually drags a frame vs clicks on it
  67      * to start the drag operation.  This is only used when dragging with
  68      * FASTER_DRAG_MODE.
  69      */
  70     private transient boolean didDrag;