KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > DesktopManager


1 /*
2  * @(#)DesktopManager.java 1.15 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing;
9
10 /** DesktopManager objects are owned by a JDesktopPane object. They are responsible
11   * for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame
12   * implementations should delegate specific behaviors to the DesktopManager. For
13   * instance, if a JInternalFrame was asked to iconify, it should try:
14   * <PRE>
15   * getDesktopPane().getDesktopManager().iconifyFrame(frame);
16   * </PRE>
17   * This delegation allows each L&F to provide custom behaviors for desktop-specific
18   * actions. (For example, how and where the internal frame's icon would appear.)
19   * <p>This class provides a policy for the various JInternalFrame methods, it is not
20   * meant to be called directly rather the various JInternalFrame methods will call
21   * into the DesktopManager.</p>
22   *
23   * @see JDesktopPane
24   * @see JInternalFrame
25   * @see JInternalFrame.JDesktopIcon
26   *
27   * @version 1.15 12/19/03
28   * @author David Kloba
29   */

30 public interface DesktopManager
31 {
32     /** If possible, display this frame in an appropriate location.
33       * Normally, this is not called, as the creator of the JInternalFrame
34       * will add the frame to the appropriate parent.
35       */

36     void openFrame(JInternalFrame JavaDoc f);
37
38     /** Generally, this call should remove the frame from it's parent. */
39     void closeFrame(JInternalFrame JavaDoc f);
40
41     /** Generally, the frame should be resized to match it's parents bounds. */
42     void maximizeFrame(JInternalFrame JavaDoc f);
43     /** Generally, this indicates that the frame should be restored to it's
44       * size and position prior to a maximizeFrame() call.
45       */

46     void minimizeFrame(JInternalFrame JavaDoc f);
47     /** Generally, remove this frame from it's parent and add an iconic representation. */
48     void iconifyFrame(JInternalFrame JavaDoc f);
49     /** Generally, remove any iconic representation that is present and restore the
50       * frame to it's original size and location.
51       */

52     void deiconifyFrame(JInternalFrame JavaDoc f);
53
54     /**
55      * Generally, indicate that this frame has focus. This is usually called after
56      * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
57      */

58     void activateFrame(JInternalFrame JavaDoc f);
59
60     /**
61      * Generally, indicate that this frame has lost focus. This is usually called
62      * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
63      */

64     void deactivateFrame(JInternalFrame JavaDoc f);
65
66     /** This method is normally called when the user has indicated that
67       * they will begin dragging a component around. This method should be called
68       * prior to any dragFrame() calls to allow the DesktopManager to prepare any
69       * necessary state. Normally <b>f</b> will be a JInternalFrame.
70       */

71     void beginDraggingFrame(JComponent JavaDoc f);
72
73     /** The user has moved the frame. Calls to this method will be preceded by calls
74       * to beginDraggingFrame().
75       * Normally <b>f</b> will be a JInternalFrame.
76       */

77     void dragFrame(JComponent JavaDoc f, int newX, int newY);
78     /** This method signals the end of the dragging session. Any state maintained by
79       * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
80       */

81     void endDraggingFrame(JComponent JavaDoc f);
82
83     /** This methods is normally called when the user has indicated that
84       * they will begin resizing the frame. This method should be called
85       * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
86       * necessary state. Normally <b>f</b> will be a JInternalFrame.
87       */

88     void beginResizingFrame(JComponent JavaDoc f, int direction);
89     /** The user has resized the component. Calls to this method will be preceded by calls
90       * to beginResizingFrame().
91       * Normally <b>f</b> will be a JInternalFrame.
92       */

93     void resizeFrame(JComponent JavaDoc f, int newX, int newY, int newWidth, int newHeight);
94     /** This method signals the end of the resize session. Any state maintained by
95       * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
96       */

97     void endResizingFrame(JComponent JavaDoc f);
98
99     /** This is a primitive reshape method.*/
100     void setBoundsForFrame(JComponent JavaDoc f, int newX, int newY, int newWidth, int newHeight);
101 }
102
103
Popular Tags