jdk/src/share/classes/javax/swing/JColorChooser.java

Print this page

        

@@ -20,25 +20,25 @@
  *
  * 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.awt.*;
 import java.awt.event.*;
+import java.beans.JavaBean;
+import java.beans.BeanProperty;
 import java.io.*;
 import java.util.*;
 
 import javax.swing.colorchooser.*;
 import javax.swing.plaf.ColorChooserUI;
 import javax.accessibility.*;
 
 import sun.swing.SwingUtilities2;
 
-
 /**
  * <code>JColorChooser</code> provides a pane of controls designed to allow
  * a user to manipulate and select a color.
  * For information about using color choosers, see
  * <a

@@ -71,21 +71,17 @@
  * the same version of Swing.  As of 1.4, support for long term storage
  * of all JavaBeans&trade;
  * has been added to the <code>java.beans</code> package.
  * Please see {@link java.beans.XMLEncoder}.
  *
- *
- * @beaninfo
- *      attribute: isContainer false
- *    description: A component that supports selecting a Color.
- *
- *
  * @author James Gosling
  * @author Amy Fowler
  * @author Steve Wilson
  * @since 1.2
  */
+@JavaBean(defaultProperty = "UI", description = "A component that supports selecting a Color.")
+@SwingContainer(false)
 @SuppressWarnings("serial") // Same-version serialization only
 public class JColorChooser extends JComponent implements Accessible {
 
     /**
      * @see #getUIClassID

@@ -230,16 +226,13 @@
     /**
      * Sets the L&amp;F object that renders this component.
      *
      * @param ui  the <code>ColorChooserUI</code> L&amp;F object
      * @see UIDefaults#getUI
-     *
-     * @beaninfo
-     *       bound: true
-     *      hidden: true
-     * description: The UI object that implements the color chooser's LookAndFeel.
      */
+    @BeanProperty(hidden = true, description
+            = "The UI object that implements the color chooser's LookAndFeel.")
     public void setUI(ColorChooserUI ui) {
         super.setUI(ui);
     }
 
     /**

@@ -258,10 +251,11 @@
      *
      * @return the string "ColorChooserUI"
      * @see JComponent#getUIClassID
      * @see UIDefaults#getUI
      */
+    @BeanProperty(bound = false)
     public String getUIClassID() {
         return uiClassID;
     }
 
     /**

@@ -277,16 +271,13 @@
     /**
      * Sets the current color of the color chooser to the specified color.
      * The <code>ColorSelectionModel</code> will fire a <code>ChangeEvent</code>
      * @param color the color to be set in the color chooser
      * @see JComponent#addPropertyChangeListener
-     *
-     * @beaninfo
-     *       bound: false
-     *      hidden: false
-     * description: The current color the chooser is to display.
      */
+    @BeanProperty(bound = false, description
+            = "The current color the chooser is to display.")
     public void setColor(Color color) {
         selectionModel.setSelectedColor(color);
 
     }
 

@@ -350,15 +341,13 @@
      *
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @see #getDragEnabled
      * @see #setTransferHandler
      * @see TransferHandler
-     *
-     * @beaninfo
-     *  description: Determines whether automatic drag handling is enabled.
-     *        bound: false
      */
+    @BeanProperty(bound = false, description
+            = "Determines whether automatic drag handling is enabled.")
     public void setDragEnabled(boolean b) {
         if (b && GraphicsEnvironment.isHeadless()) {
             throw new HeadlessException();
         }
         dragEnabled = b;

@@ -380,16 +369,13 @@
      * This will fire a <code>PropertyChangeEvent</code> for the property
      * named "previewPanel".
      *
      * @param preview the <code>JComponent</code> which displays the current color
      * @see JComponent#addPropertyChangeListener
-     *
-     * @beaninfo
-     *       bound: true
-     *      hidden: true
-     * description: The UI component which displays the current color.
      */
+    @BeanProperty(hidden = true, description
+            = "The UI component which displays the current color.")
     public void setPreviewPanel(JComponent preview) {
 
         if (previewPanel != preview) {
             JComponent oldPreview = previewPanel;
             previewPanel = preview;

@@ -465,16 +451,13 @@
     /**
      * Specifies the Color Panels used to choose a color value.
      *
      * @param panels  an array of <code>AbstractColorChooserPanel</code>
      *          objects
-     *
-     * @beaninfo
-     *       bound: true
-     *      hidden: true
-     * description: An array of different chooser types.
      */
+    @BeanProperty(hidden = true, description
+            = "An array of different chooser types.")
     public void setChooserPanels( AbstractColorChooserPanel[] panels) {
         AbstractColorChooserPanel[] oldValue = chooserPanels;
         chooserPanels = panels;
         firePropertyChange(CHOOSER_PANELS_PROPERTY, oldValue, panels);
     }

@@ -500,16 +483,13 @@
 
     /**
      * Sets the model containing the selected color.
      *
      * @param newModel   the new <code>ColorSelectionModel</code> object
-     *
-     * @beaninfo
-     *       bound: true
-     *      hidden: true
-     * description: The model which contains the currently selected color.
      */
+    @BeanProperty(hidden = true, description
+            = "The model which contains the currently selected color.")
     public void setSelectionModel(ColorSelectionModel newModel ) {
         ColorSelectionModel oldModel = selectionModel;
         selectionModel = newModel;
         firePropertyChange(JColorChooser.SELECTION_MODEL_PROPERTY, oldModel, newModel);
     }

@@ -569,10 +549,11 @@
      * A new AccessibleJColorChooser instance is created if necessary.
      *
      * @return an AccessibleJColorChooser that serves as the
      *         AccessibleContext of this JColorChooser
      */
+    @BeanProperty(bound = false)
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleJColorChooser();
         }
         return accessibleContext;