001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /**
019: * @author Vadim L. Bogdanov
020: * @version $Revision$
021: */package javax.swing;
022:
023: /**
024: * <code>DesktopManager</code> objects are owned by a <code>JDesktopPane</code>
025: * object. They implement L&F specific behavior for <code>JDesktopPane</code>.
026: *
027: */
028: public interface DesktopManager {
029:
030: /**
031: * Displays the internal frame, if it's possible. This method normally
032: * is not called.
033: *
034: * @param f the internal frame to open
035: */
036: void openFrame(final JInternalFrame f);
037:
038: /**
039: * Restore size and location of the internal frame to its size
040: * and location before maximizing.
041: *
042: * @param f the internal frame to minimize
043: */
044: void minimizeFrame(final JInternalFrame f);
045:
046: /**
047: * Maximizes the internal frame (resize it to match its parent's bounds).
048: *
049: * @param f the internal frame to maximize
050: */
051: void maximizeFrame(final JInternalFrame f);
052:
053: /**
054: * Removes the internal frame from its parent and adds its desktop icon
055: * instead.
056: *
057: * @param f the internal frame to iconify
058: */
059: void iconifyFrame(final JInternalFrame f);
060:
061: /**
062: * Removes the internal frame's desktop icon from its parent and add
063: * the internal frame. Size and location of the internal frame are
064: * restored to those before iconification.
065: *
066: * @param f the internal frame to deiconify
067: */
068: void deiconifyFrame(final JInternalFrame f);
069:
070: /**
071: * Closes the internal frame, i.e. removes it from its parent.
072: *
073: * @param f the internal frame to close
074: */
075: void closeFrame(final JInternalFrame f);
076:
077: /**
078: * Sets focus to the internal frame. This method is usually called
079: * after setting JInternalFrame's <code>IS_SELECTED_PROPERTY</code>
080: * property to <code>true</code>.
081: *
082: * @param f the internal frame to activate
083: */
084: void activateFrame(final JInternalFrame f);
085:
086: /**
087: * Removes focus from the internal frame. This method is usually called
088: * after setting JInternalFrame's <code>IS_SELECTED_PROPERTY</code>
089: * property to <code>false</code>.
090: *
091: * @param f the internal frame to deactivate
092: */
093: void deactivateFrame(final JInternalFrame f);
094:
095: /**
096: * Primitive method to reshape.
097: *
098: * @param f the component to set bounds to
099: * @param x the new horizontal position of the component measured from
100: * the left corner of its container
101: * @param y the new vertical position of the component measured from
102: * the upper corner of its container
103: * @param width the new width of the component
104: * @param height the new height of the component
105: */
106: void setBoundsForFrame(final JComponent f, final int x,
107: final int y, final int width, final int height);
108:
109: /**
110: * This method is called when the user begins to resize the frame.
111: * <code>f</code> is normally <code>JInternalFrame</code>.
112: *
113: * @param f the component to resize
114: * @param direction direction of resizing
115: */
116: void beginResizingFrame(final JComponent f, final int direction);
117:
118: /**
119: * Resizes the component. Call of this method is preceded by call of
120: * <code>beginResizingFrame()</code>.
121: * <code>f</code> is normally <code>JInternalFrame</code>.
122: *
123: * @param f the component to resize
124: * @param x the new horizontal position of the component measured from
125: * the left corner of its container
126: * @param y the new vertical position of the component measured from
127: * the upper corner of its container
128: * @param width the new width of the component
129: * @param height the new height of the component
130: */
131: void resizeFrame(final JComponent f, final int x, final int y,
132: final int width, final int height);
133:
134: /**
135: * This method is called when the users has finished resizing the frame.
136: * <code>f</code> is normally <code>JInternalFrame</code>.
137: *
138: * @param f the component to resize
139: */
140: void endResizingFrame(final JComponent f);
141:
142: /**
143: * This method is called when the user begins to move the frame.
144: * <code>f</code> is normally <code>JInternalFrame</code>.
145: *
146: * @param f the moved component
147: */
148:
149: void beginDraggingFrame(final JComponent f);
150:
151: /**
152: * The frame has been moved. Call of this method is preceded by call of
153: * <code>beginDraggingFrame()</code>.
154: * <code>f</code> is normally <code>JInternalFrame</code>.
155: *
156: * @param f the moved component
157: * @param x the new x position
158: * @param y the new y position
159: */
160: void dragFrame(final JComponent f, final int x, final int y);
161:
162: /**
163: * This method is called when the users has finished moving the frame.
164: * <code>f</code> is normally <code>JInternalFrame</code>.
165: *
166: * @param f the moved component
167: */
168: void endDraggingFrame(final JComponent f);
169: }
|