2
* @(#)CrayonsChooser.java 1.1 2006-04-23
4
* Copyright (c) 2005-2006 Werner Randelshofer
5
* Staldenmattweg 2, Immensee, CH-6405, Switzerland.
8
* This software is the confidential and proprietary information of
9
* Werner Randelshofer. ("Confidential Information"). You shall not
10
* disclose such Confidential Information and shall use it only in
11
* accordance with the terms of the license agreement you entered into
12
* with Werner Randelshofer.
15
package org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser;
19
//import java.awt.event.*;
22
import javax.swing.colorchooser.*;
23
import javax.swing.event.*;
24
import javax.swing.plaf.*;
26
import org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.util.*;
30
* A color chooser which provides a choice of Crayons.
32
* @author Werner Randelshofer
33
* @version 1.2 2006-04-23 Retrieve labels from UIManager.
34
* <br>1.0.2 2005-11-07 Get "labels" resource bundle from UIManager.
35
* <br>1.0.1 2005-09-11 Get icon from UIManager.
36
* <br>1.0 August 28, 2005 Created.
38
public class CrayonsChooser extends AbstractColorChooserPanel implements UIResource {
39
private Crayons crayons;
42
* Creates a new instance.
44
public CrayonsChooser() {
47
crayons = new Crayons();
49
crayons.addPropertyChangeListener(new PropertyChangeListener() {
51
public void propertyChange(PropertyChangeEvent evt) {
52
if (evt.getPropertyName().equals("Color")) {
53
setColorToModel(crayons.getColor());
59
/** This method is called from within the constructor to
60
* initialize the form.
61
* WARNING: Do NOT modify this code. The content of this method is
62
* always regenerated by the Form Editor.
64
private void initComponents() {//GEN-BEGIN:initComponents
66
}//GEN-END:initComponents
69
protected void buildChooser() {
73
public String getDisplayName() {
74
return UIManager.getString("ColorChooser.crayons");
78
public javax.swing.Icon getLargeDisplayIcon() {
79
return UIManager.getIcon("ColorChooser.crayonsIcon");
83
public Icon getSmallDisplayIcon() {
84
return getLargeDisplayIcon();
88
public void updateChooser() {
89
crayons.setColor(getColorFromModel());
91
public void setColorToModel(Color color) {
92
getColorSelectionModel().setSelectedColor(color);
95
// Variables declaration - do not modify//GEN-BEGIN:variables
96
// End of variables declaration//GEN-END:variables