1 /* JDesktopPane.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)
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., 59 Temple Place, Suite 330, Boston, MA
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
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. */
40 import java.io.IOException;
41 import java.io.ObjectOutputStream;
42 import javax.accessibility.Accessible;
43 import javax.accessibility.AccessibleContext;
44 import javax.accessibility.AccessibleRole;
45 import javax.swing.plaf.DesktopPaneUI;
49 * @author Andrew Selkirk
52 public class JDesktopPane extends JLayeredPane implements Accessible
55 //-------------------------------------------------------------
56 // Classes ----------------------------------------------------
57 //-------------------------------------------------------------
60 * AccessibleJDesktopPane
62 protected class AccessibleJDesktopPane extends AccessibleJComponent {
64 //-------------------------------------------------------------
65 // Initialization ---------------------------------------------
66 //-------------------------------------------------------------
69 * Constructor AccessibleJDesktopPane
70 * @param component TODO
72 protected AccessibleJDesktopPane(JDesktopPane component) {
75 } // AccessibleJDesktopPane()
78 //-------------------------------------------------------------
79 // Methods ----------------------------------------------------
80 //-------------------------------------------------------------
84 * @returns AccessibleRole
86 public AccessibleRole getAccessibleRole() {
87 return AccessibleRole.DESKTOP_PANE;
88 } // getAccessibleRole()
91 } // AccessibleJDesktopPane
94 //-------------------------------------------------------------
95 // Constants --------------------------------------------------
96 //-------------------------------------------------------------
101 public static int LIVE_DRAG_MODE = 0;
106 public static int OUTLINE_DRAG_MODE = 1;
111 private static final String uiClassID = "DesktopPaneUI";
114 //-------------------------------------------------------------
115 // Variables --------------------------------------------------
116 //-------------------------------------------------------------
121 private transient JInternalFrame selectedFrame;
126 private transient DesktopManager desktopManager;
132 private int dragMode;
135 //-------------------------------------------------------------
136 // Initialization ---------------------------------------------
137 //-------------------------------------------------------------
140 * Constructor JDesktopPane
142 public JDesktopPane() {
147 //-------------------------------------------------------------
148 // Methods ----------------------------------------------------
149 //-------------------------------------------------------------
154 * @exception IOException TODO
156 private void writeObject(ObjectOutputStream stream) throws IOException {
162 * @returns DesktopPaneUI
164 public DesktopPaneUI getUI() {
165 return (DesktopPaneUI) ui;
172 public void setUI(DesktopPaneUI ui) {
180 public void setDragMode(int mode) {
181 this.dragMode = mode;
189 public int getDragMode() {
195 * @returns DesktopManager
197 public DesktopManager getDesktopManager() {
198 return desktopManager;
199 } // getDesktopManager()
203 * @param manager TODO
205 public void setDesktopManager(DesktopManager manager) {
206 this.desktopManager = manager;
208 } // setDesktopManager()
213 public void updateUI() {
214 setUI((DesktopPaneUI) UIManager.get(this));
222 public String getUIClassID() {
228 * @returns JInternalFrame[]
230 public JInternalFrame[] getAllFrames() {
236 * @returns JInternalFrame
238 public JInternalFrame getSelectedFrame() {
240 } // getSelectedFrame()
246 public void setSelectedFrame(JInternalFrame frame) {
248 } // setSelectedFrame()
251 * getAllFramesInLayer
253 * @returns JInternalFrame[]
255 public JInternalFrame[] getAllFramesInLayer(int layer) {
257 } // getAllFramesInLayer()
263 public boolean isOpaque() {
271 protected String paramString() {
276 * getAccessibleContext
277 * @returns AccessibleContext
279 public AccessibleContext getAccessibleContext() {
280 if (accessibleContext == null) {
281 accessibleContext = new AccessibleJDesktopPane(this);
283 return accessibleContext;
284 } // getAccessibleContext()