30 import javax.swing.event.*;
31 import javax.swing.text.*;
32 import java.awt.*;
33 import java.awt.image.*;
34 import java.awt.event.*;
35 import java.beans.PropertyChangeEvent;
36 import java.beans.PropertyChangeListener;
37 import java.io.Serializable;
38 import sun.swing.SwingUtilities2;
39
40
41 /**
42 * The standard preview panel for the color chooser.
43 * <p>
44 * <strong>Warning:</strong>
45 * Serialized objects of this class will not be compatible with
46 * future Swing releases. The current serialization support is
47 * appropriate for short term storage or RMI between applications running
48 * the same version of Swing. As of 1.4, support for long term storage
49 * of all JavaBeans™
50 * has been added to the <code>java.beans</code> package.
51 * Please see {@link java.beans.XMLEncoder}.
52 *
53 * @author Steve Wilson
54 * @see JColorChooser
55 */
56 @SuppressWarnings("serial") // Same-version serialization only
57 class DefaultPreviewPanel extends JPanel {
58
59 private int squareSize = 25;
60 private int squareGap = 5;
61 private int innerGap = 5;
62
63
64 private int textGap = 5;
65 private Font font = new Font(Font.DIALOG, Font.PLAIN, 12);
66 private String sampleText;
67
68 private int swatchWidth = 50;
69
70 private Color oldColor = null;
|
30 import javax.swing.event.*;
31 import javax.swing.text.*;
32 import java.awt.*;
33 import java.awt.image.*;
34 import java.awt.event.*;
35 import java.beans.PropertyChangeEvent;
36 import java.beans.PropertyChangeListener;
37 import java.io.Serializable;
38 import sun.swing.SwingUtilities2;
39
40
41 /**
42 * The standard preview panel for the color chooser.
43 * <p>
44 * <strong>Warning:</strong>
45 * Serialized objects of this class will not be compatible with
46 * future Swing releases. The current serialization support is
47 * appropriate for short term storage or RMI between applications running
48 * the same version of Swing. As of 1.4, support for long term storage
49 * of all JavaBeans™
50 * has been added to the {@code java.beans} package.
51 * Please see {@link java.beans.XMLEncoder}.
52 *
53 * @author Steve Wilson
54 * @see JColorChooser
55 */
56 @SuppressWarnings("serial") // Same-version serialization only
57 class DefaultPreviewPanel extends JPanel {
58
59 private int squareSize = 25;
60 private int squareGap = 5;
61 private int innerGap = 5;
62
63
64 private int textGap = 5;
65 private Font font = new Font(Font.DIALOG, Font.PLAIN, 12);
66 private String sampleText;
67
68 private int swatchWidth = 50;
69
70 private Color oldColor = null;
|