Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/swing/DesktopManager.java
38829 views
/*1* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.swing;2627/** DesktopManager objects are owned by a JDesktopPane object. They are responsible28* for implementing L&F specific behaviors for the JDesktopPane. JInternalFrame29* implementations should delegate specific behaviors to the DesktopManager. For30* instance, if a JInternalFrame was asked to iconify, it should try:31* <PRE>32* getDesktopPane().getDesktopManager().iconifyFrame(frame);33* </PRE>34* This delegation allows each L&F to provide custom behaviors for desktop-specific35* actions. (For example, how and where the internal frame's icon would appear.)36* <p>This class provides a policy for the various JInternalFrame methods, it is not37* meant to be called directly rather the various JInternalFrame methods will call38* into the DesktopManager.</p>39*40* @see JDesktopPane41* @see JInternalFrame42* @see JInternalFrame.JDesktopIcon43*44* @author David Kloba45*/46public interface DesktopManager47{48/** If possible, display this frame in an appropriate location.49* Normally, this is not called, as the creator of the JInternalFrame50* will add the frame to the appropriate parent.51*/52void openFrame(JInternalFrame f);5354/** Generally, this call should remove the frame from it's parent. */55void closeFrame(JInternalFrame f);5657/** Generally, the frame should be resized to match it's parents bounds. */58void maximizeFrame(JInternalFrame f);59/** Generally, this indicates that the frame should be restored to it's60* size and position prior to a maximizeFrame() call.61*/62void minimizeFrame(JInternalFrame f);63/** Generally, remove this frame from it's parent and add an iconic representation. */64void iconifyFrame(JInternalFrame f);65/** Generally, remove any iconic representation that is present and restore the66* frame to it's original size and location.67*/68void deiconifyFrame(JInternalFrame f);6970/**71* Generally, indicate that this frame has focus. This is usually called after72* the JInternalFrame's IS_SELECTED_PROPERTY has been set to true.73*/74void activateFrame(JInternalFrame f);7576/**77* Generally, indicate that this frame has lost focus. This is usually called78* after the JInternalFrame's IS_SELECTED_PROPERTY has been set to false.79*/80void deactivateFrame(JInternalFrame f);8182/** This method is normally called when the user has indicated that83* they will begin dragging a component around. This method should be called84* prior to any dragFrame() calls to allow the DesktopManager to prepare any85* necessary state. Normally <b>f</b> will be a JInternalFrame.86*/87void beginDraggingFrame(JComponent f);8889/** The user has moved the frame. Calls to this method will be preceded by calls90* to beginDraggingFrame().91* Normally <b>f</b> will be a JInternalFrame.92*/93void dragFrame(JComponent f, int newX, int newY);94/** This method signals the end of the dragging session. Any state maintained by95* the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.96*/97void endDraggingFrame(JComponent f);9899/** This methods is normally called when the user has indicated that100* they will begin resizing the frame. This method should be called101* prior to any resizeFrame() calls to allow the DesktopManager to prepare any102* necessary state. Normally <b>f</b> will be a JInternalFrame.103*/104void beginResizingFrame(JComponent f, int direction);105/** The user has resized the component. Calls to this method will be preceded by calls106* to beginResizingFrame().107* Normally <b>f</b> will be a JInternalFrame.108*/109void resizeFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);110/** This method signals the end of the resize session. Any state maintained by111* the DesktopManager can be removed here. Normally <b>f</b> will be a JInternalFrame.112*/113void endResizingFrame(JComponent f);114115/** This is a primitive reshape method.*/116void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight);117}118119120