src/java.desktop/share/classes/javax/swing/JDesktopPane.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -20,11 +20,10 @@
  *
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package javax.swing;
 
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collection;

@@ -32,20 +31,19 @@
 import javax.swing.plaf.*;
 import javax.accessibility.*;
 
 import java.awt.Component;
 import java.awt.Container;
-import java.awt.DefaultFocusTraversalPolicy;
-import java.awt.FocusTraversalPolicy;
-import java.awt.Window;
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
 import java.beans.PropertyVetoException;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.LinkedHashSet;
+
 /**
  * A container used to create a multiple-document interface or a virtual desktop.
  * You create <code>JInternalFrame</code> objects and add them to the
  * <code>JDesktopPane</code>. <code>JDesktopPane</code> extends
  * <code>JLayeredPane</code> to manage the potentially overlapping internal

@@ -86,10 +84,11 @@
  * @see DesktopManager
  *
  * @author David Kloba
  * @since 1.2
  */
+@JavaBean(defaultProperty = "UI")
 @SuppressWarnings("serial") // Same-version serialization only
 public class JDesktopPane extends JLayeredPane implements Accessible
 {
     /**
      * @see #getUIClassID

@@ -161,16 +160,13 @@
     /**
      * Sets the L&amp;F object that renders this component.
      *
      * @param ui  the DesktopPaneUI L&amp;F object
      * @see UIDefaults#getUI
-     * @beaninfo
-     *        bound: true
-     *       hidden: true
-     *    attribute: visualUpdate true
-     *  description: The UI object that implements the Component's LookAndFeel.
      */
+    @BeanProperty(hidden = true, visualUpdate = true, description
+            = "The UI object that implements the Component's LookAndFeel.")
     public void setUI(DesktopPaneUI ui) {
         super.setUI(ui);
     }
 
     /**

@@ -181,17 +177,16 @@
      * @param dragMode the style of drag to use for items in the Desktop
      *
      * @see #LIVE_DRAG_MODE
      * @see #OUTLINE_DRAG_MODE
      *
-     * @beaninfo
-     *        bound: true
-     *  description: Dragging style for internal frame children.
-     *         enum: LIVE_DRAG_MODE JDesktopPane.LIVE_DRAG_MODE
-     *               OUTLINE_DRAG_MODE JDesktopPane.OUTLINE_DRAG_MODE
      * @since 1.3
      */
+    @BeanProperty(enumerationValues = {
+            "JDesktopPane.LIVE_DRAG_MODE",
+            "JDesktopPane.OUTLINE_DRAG_MODE"}, description
+            = "Dragging style for internal frame children.")
     public void setDragMode(int dragMode) {
         int oldDragMode = this.dragMode;
         this.dragMode = dragMode;
         firePropertyChange("dragMode", oldDragMode, this.dragMode);
         dragModeSet = true;

@@ -223,16 +218,13 @@
      * Sets the <code>DesktopManger</code> that will handle
      * desktop-specific UI actions. This may be overridden by
      * {@code LookAndFeel}.
      *
      * @param d the <code>DesktopManager</code> to use
-     *
-     * @beaninfo
-     *        bound: true
-     *  description: Desktop manager to handle the internal frames in the
-     *               desktop pane.
      */
+    @BeanProperty(description
+            = "Desktop manager to handle the internal frames in the desktop pane.")
     public void setDesktopManager(DesktopManager d) {
         DesktopManager oldValue = desktopManager;
         desktopManager = d;
         firePropertyChange("desktopManager", oldValue, desktopManager);
     }

@@ -254,20 +246,22 @@
      *
      * @return the string "DesktopPaneUI"
      * @see JComponent#getUIClassID
      * @see UIDefaults#getUI
      */
+    @BeanProperty(bound = false)
     public String getUIClassID() {
         return uiClassID;
     }
 
     /**
      * Returns all <code>JInternalFrames</code> currently displayed in the
      * desktop. Returns iconified frames as well as expanded frames.
      *
      * @return an array of <code>JInternalFrame</code> objects
      */
+    @BeanProperty(bound = false)
     public JInternalFrame[] getAllFrames() {
         return getAllFrames(this).toArray(new JInternalFrame[0]);
     }
 
     private static Collection<JInternalFrame> getAllFrames(Container parent) {

@@ -598,10 +592,11 @@
      * A new <code>AccessibleJDesktopPane</code> instance is created if necessary.
      *
      * @return an <code>AccessibleJDesktopPane</code> that serves as the
      *         <code>AccessibleContext</code> of this <code>JDesktopPane</code>
      */
+    @BeanProperty(bound = false)
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJDesktopPane();
         }
         return accessibleContext;