1 /*
2 * Copyright (c) 1998, 2010, 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
66 * <p>
67 * <strong>Warning:</strong>
68 * Serialized objects of this class will not be compatible with
69 * future Swing releases. The current serialization support is
70 * appropriate for short term storage or RMI between applications running
71 * the same version of Swing. As of 1.4, support for long term storage
72 * of all JavaBeans™
73 * has been added to the <code>java.beans</code> package.
74 * Please see {@link java.beans.XMLEncoder}.
75 *
76 *
77 * @beaninfo
78 * attribute: isContainer false
79 * description: A component that supports selecting a Color.
80 *
81 *
82 * @author James Gosling
83 * @author Amy Fowler
84 * @author Steve Wilson
85 */
86 public class JColorChooser extends JComponent implements Accessible {
87
88 /**
89 * @see #getUIClassID
90 * @see #readObject
91 */
92 private static final String uiClassID = "ColorChooserUI";
93
94 private ColorSelectionModel selectionModel;
95
96 private JComponent previewPanel = ColorChooserComponentFactory.getPreviewPanel();
97
98 private AbstractColorChooserPanel[] chooserPanels = new AbstractColorChooserPanel[0];
99
100 private boolean dragEnabled;
101
102 /**
103 * The selection model property name.
104 */
105 public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
|
1 /*
2 * Copyright (c) 1998, 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
66 * <p>
67 * <strong>Warning:</strong>
68 * Serialized objects of this class will not be compatible with
69 * future Swing releases. The current serialization support is
70 * appropriate for short term storage or RMI between applications running
71 * the same version of Swing. As of 1.4, support for long term storage
72 * of all JavaBeans™
73 * has been added to the <code>java.beans</code> package.
74 * Please see {@link java.beans.XMLEncoder}.
75 *
76 *
77 * @beaninfo
78 * attribute: isContainer false
79 * description: A component that supports selecting a Color.
80 *
81 *
82 * @author James Gosling
83 * @author Amy Fowler
84 * @author Steve Wilson
85 */
86 @SuppressWarnings("serial") // Same-version serialization only
87 public class JColorChooser extends JComponent implements Accessible {
88
89 /**
90 * @see #getUIClassID
91 * @see #readObject
92 */
93 private static final String uiClassID = "ColorChooserUI";
94
95 private ColorSelectionModel selectionModel;
96
97 private JComponent previewPanel = ColorChooserComponentFactory.getPreviewPanel();
98
99 private AbstractColorChooserPanel[] chooserPanels = new AbstractColorChooserPanel[0];
100
101 private boolean dragEnabled;
102
103 /**
104 * The selection model property name.
105 */
106 public static final String SELECTION_MODEL_PROPERTY = "selectionModel";
|