1 /*
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
36 *
37 * DesktopManager implementation for Aqua
38 *
39 * Mac is more like Windows than it's like Motif/Basic
40 *
41 * From WindowsDesktopManager:
42 *
43 * This class implements a DesktopManager which more closely follows
44 * the MDI model than the DefaultDesktopManager. Unlike the
45 * DefaultDesktopManager policy, MDI requires that the selected
46 * and activated child frames are the same, and that that frame
47 * always be the top-most window.
48 * <p>
49 * The maximized state is managed by the DesktopManager with MDI,
50 * instead of just being a property of the individual child frame.
51 * This means that if the currently selected window is maximized
52 * and another window is selected, that new window will be maximized.
53 *
54 * @see com.sun.java.swing.plaf.windows.WindowsDesktopManager
55 */
56 public class AquaInternalFrameManager extends DefaultDesktopManager {
57 // Variables
58
59 /* The frame which is currently selected/activated.
60 * We store this value to enforce Mac's single-selection model.
61 */
62 JInternalFrame fCurrentFrame;
63 JInternalFrame fInitialFrame;
64 AquaInternalFramePaneUI fCurrentPaneUI;
65
66 /* The list of frames, sorted by order of creation.
67 * This list is necessary because by default the order of
68 * child frames in the JDesktopPane changes during frame
69 * activation (the activated frame is moved to index 0).
70 * We preserve the creation order so that "next" and "previous"
71 * frame actions make sense.
72 */
73 Vector<JInternalFrame> fChildFrames = new Vector<JInternalFrame>(1);
74
75 public void closeFrame(final JInternalFrame f) {
|
1 /*
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
36 *
37 * DesktopManager implementation for Aqua
38 *
39 * Mac is more like Windows than it's like Motif/Basic
40 *
41 * From WindowsDesktopManager:
42 *
43 * This class implements a DesktopManager which more closely follows
44 * the MDI model than the DefaultDesktopManager. Unlike the
45 * DefaultDesktopManager policy, MDI requires that the selected
46 * and activated child frames are the same, and that that frame
47 * always be the top-most window.
48 * <p>
49 * The maximized state is managed by the DesktopManager with MDI,
50 * instead of just being a property of the individual child frame.
51 * This means that if the currently selected window is maximized
52 * and another window is selected, that new window will be maximized.
53 *
54 * @see com.sun.java.swing.plaf.windows.WindowsDesktopManager
55 */
56 @SuppressWarnings("serial") // JDK implementation class
57 public class AquaInternalFrameManager extends DefaultDesktopManager {
58 // Variables
59
60 /* The frame which is currently selected/activated.
61 * We store this value to enforce Mac's single-selection model.
62 */
63 JInternalFrame fCurrentFrame;
64 JInternalFrame fInitialFrame;
65 AquaInternalFramePaneUI fCurrentPaneUI;
66
67 /* The list of frames, sorted by order of creation.
68 * This list is necessary because by default the order of
69 * child frames in the JDesktopPane changes during frame
70 * activation (the activated frame is moved to index 0).
71 * We preserve the creation order so that "next" and "previous"
72 * frame actions make sense.
73 */
74 Vector<JInternalFrame> fChildFrames = new Vector<JInternalFrame>(1);
75
76 public void closeFrame(final JInternalFrame f) {
|