2015-05-05 Yvan Roux <yvan.roux@linaro.org>
[official-gcc.git] / libjava / classpath / javax / swing / DesktopManager.java
blob620c7ffb857e62fd741e76d533675cbc19be293e
1 /* DesktopManager.java --
2 Copyright (C) 2002, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package javax.swing;
40 /**
41 * DesktopManagers are responsible for implementing the behaviours for the
42 * JInternalFrames that belong to JDesktopPanes. Actions such as maximizing,
43 * minimizing, iconifying, etc will be delegated to the DesktopManager.
45 public interface DesktopManager
47 /**
48 * This method will cause the JInternalFrame to be displayed in the set
49 * location. This usually is not needed since the user will add the
50 * JInternalFrame to a Container separately.
52 * @param frame The JInternalFrame to open.
54 void openFrame(JInternalFrame frame);
56 /**
57 * This method should remove the JInternalFrame from its parent.
59 * @param frame The JInternalFrame to close.
61 void closeFrame(JInternalFrame frame);
63 /**
64 * This method should maximize the JInternalFrame to match its parent's
65 * bounds.
67 * @param frame The JInternalFrame to maximize.
69 void maximizeFrame(JInternalFrame frame);
71 /**
72 * This method should restore the JInternalFrame to its normal bounds.
74 * @param frame The JInternalFrame to minimize.
76 void minimizeFrame(JInternalFrame frame);
78 /**
79 * This method should remove the JInternalFrame from its parent and replace
80 * it with a JDesktopIcon.
82 * @param frame The JInternalFrame to iconify.
84 void iconifyFrame(JInternalFrame frame);
86 /**
87 * This method should remove the JDesktopIcon from its parent and replace it
88 * with the JInternalFrame that the JDesktopIcon represents.
90 * @param frame The JInternalFrame to deiconify.
92 void deiconifyFrame(JInternalFrame frame);
94 /**
95 * This method should give focus to the JInternalFrame and its default focus
96 * owner.
98 * @param vframe The JInternalFrame to activate.
100 void activateFrame(JInternalFrame vframe);
103 * This method should be called when the JInternalFrame gets deselected and
104 * subsequently loses focus.
106 * @param frame The JInternalFrame to deactivate.
108 void deactivateFrame(JInternalFrame frame);
111 * This method should be called in preparation for dragging. This needs to
112 * be called prior to dragFrame calls so that the DesktopManager can
113 * prepare any state information.
115 * @param frame The JInternalFrame to prepare for dragging.
117 void beginDraggingFrame(JComponent frame);
120 * This method drags the given JInternalFrame to the given x and y
121 * coordinates.
123 * @param frame The JInternalFrame to drag.
124 * @param x The new x coordinate.
125 * @param y The new y coordinate.
127 void dragFrame(JComponent frame, int x, int y);
130 * This method should be called after dragFrame calls. Any information used
131 * by the DesktopManager for dragging the JInternalFrame can be cleared.
133 * @param frame The JInternalFrame that finished dragging.
135 void endDraggingFrame(JComponent frame);
138 * This method should be called prior to any resizeFrame calls. Any state
139 * information needed by the DesktopManager to resize the JInternalFrame
140 * will be prepared here.
142 * @param frame The JInternalFrame to resize.
143 * @param direction One of eight directions specified by SwingConstants.
145 void beginResizingFrame(JComponent frame, int direction);
148 * This method is called to resize the given JInternalFrame to the given
149 * bounds.
151 * @param frame The JInternalFrame to resize.
152 * @param x The new x coordinate.
153 * @param y The new y coordinate.
154 * @param width The new width.
155 * @param height The new height.
157 void resizeFrame(JComponent frame, int x, int y, int width, int height);
160 * This method is called to signify that the resize is finished. Any
161 * information used to resize the JInternalFrame can now be cleared.
163 * @param frame The JInternalFrame that just finished dragging.
165 void endResizingFrame(JComponent frame);
168 * This method does the actual work for reshaping the JInternalFrame.
170 * @param frame The JInternalFrame to resize.
171 * @param x The new x coordinate.
172 * @param y The new y coordinate.
173 * @param width The new width.
174 * @param height The new height.
176 void setBoundsForFrame(JComponent frame, int x, int y, int width, int height);
177 } // DesktopManager