0N/A/*
2362N/A * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.swing;
0N/A
0N/A/** DesktopManager objects are owned by a JDesktopPane object. They are responsible
0N/A * for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame
0N/A * implementations should delegate specific behaviors to the DesktopManager. For
0N/A * instance, if a JInternalFrame was asked to iconify, it should try:
0N/A * <PRE>
0N/A * getDesktopPane().getDesktopManager().iconifyFrame(frame);
0N/A * </PRE>
0N/A * This delegation allows each L&F to provide custom behaviors for desktop-specific
0N/A * actions. (For example, how and where the internal frame's icon would appear.)
0N/A * <p>This class provides a policy for the various JInternalFrame methods, it is not
0N/A * meant to be called directly rather the various JInternalFrame methods will call
0N/A * into the DesktopManager.</p>
0N/A *
0N/A * @see JDesktopPane
0N/A * @see JInternalFrame
0N/A * @see JInternalFrame.JDesktopIcon
0N/A *
0N/A * @author David Kloba
0N/A */
0N/Apublic interface DesktopManager
0N/A{
0N/A /** If possible, display this frame in an appropriate location.
0N/A * Normally, this is not called, as the creator of the JInternalFrame
0N/A * will add the frame to the appropriate parent.
0N/A */
0N/A void openFrame(JInternalFrame f);
0N/A
0N/A /** Generally, this call should remove the frame from it's parent. */
0N/A void closeFrame(JInternalFrame f);
0N/A
0N/A /** Generally, the frame should be resized to match it's parents bounds. */
0N/A void maximizeFrame(JInternalFrame f);
0N/A /** Generally, this indicates that the frame should be restored to it's
0N/A * size and position prior to a maximizeFrame() call.
0N/A */
0N/A void minimizeFrame(JInternalFrame f);
0N/A /** Generally, remove this frame from it's parent and add an iconic representation. */
0N/A void iconifyFrame(JInternalFrame f);
0N/A /** Generally, remove any iconic representation that is present and restore the
0N/A * frame to it's original size and location.
0N/A */
0N/A void deiconifyFrame(JInternalFrame f);
0N/A
0N/A /**
0N/A * Generally, indicate that this frame has focus. This is usually called after
0N/A * the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.
0N/A */
0N/A void activateFrame(JInternalFrame f);
0N/A
0N/A /**
0N/A * Generally, indicate that this frame has lost focus. This is usually called
0N/A * after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.
0N/A */
0N/A void deactivateFrame(JInternalFrame f);
0N/A
0N/A /** This method is normally called when the user has indicated that
0N/A * they will begin dragging a component around. This method should be called
0N/A * prior to any dragFrame() calls to allow the DesktopManager to prepare any
0N/A * necessary state. Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void beginDraggingFrame(JComponent f);
0N/A
0N/A /** The user has moved the frame. Calls to this method will be preceded by calls
0N/A * to beginDraggingFrame().
0N/A * Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void dragFrame(JComponent f, int newX, int newY);
0N/A /** This method signals the end of the dragging session. Any state maintained by
0N/A * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void endDraggingFrame(JComponent f);
0N/A
0N/A /** This methods is normally called when the user has indicated that
0N/A * they will begin resizing the frame. This method should be called
0N/A * prior to any resizeFrame() calls to allow the DesktopManager to prepare any
0N/A * necessary state. Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void beginResizingFrame(JComponent f, int direction);
0N/A /** The user has resized the component. Calls to this method will be preceded by calls
0N/A * to beginResizingFrame().
0N/A * Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
0N/A /** This method signals the end of the resize session. Any state maintained by
0N/A * the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.
0N/A */
0N/A void endResizingFrame(JComponent f);
0N/A
0N/A /** This is a primitive reshape method.*/
0N/A void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);
0N/A}