27 import java.awt.*;
28 import java.awt.event.*;
29 import java.awt.image.*;
30 import java.io.Serializable;
31 import java.util.EventListener;
32 import javax.swing.event.*;
33
34 /**
35 * The default implementation of a <code>Button</code> component's data model.
36 * <p>
37 * <strong>Warning:</strong>
38 * Serialized objects of this class will not be compatible with
39 * future Swing releases. The current serialization support is
40 * appropriate for short term storage or RMI between applications running
41 * the same version of Swing. As of 1.4, support for long term storage
42 * of all JavaBeans™
43 * has been added to the <code>java.beans</code> package.
44 * Please see {@link java.beans.XMLEncoder}.
45 *
46 * @author Jeff Dinkins
47 */
48 @SuppressWarnings("serial") // Same-version serialization only
49 public class DefaultButtonModel implements ButtonModel, Serializable {
50
51 /** The bitmask used to store the state of the button. */
52 protected int stateMask = 0;
53
54 /** The action command string fired by the button. */
55 protected String actionCommand = null;
56
57 /** The button group that the button belongs to. */
58 protected ButtonGroup group = null;
59
60 /** The button's mnemonic. */
61 protected int mnemonic = 0;
62
63 /**
64 * Only one <code>ChangeEvent</code> is needed per button model
65 * instance since the event's only state is the source property.
66 * The source of events generated is always "this".
|
27 import java.awt.*;
28 import java.awt.event.*;
29 import java.awt.image.*;
30 import java.io.Serializable;
31 import java.util.EventListener;
32 import javax.swing.event.*;
33
34 /**
35 * The default implementation of a <code>Button</code> component's data model.
36 * <p>
37 * <strong>Warning:</strong>
38 * Serialized objects of this class will not be compatible with
39 * future Swing releases. The current serialization support is
40 * appropriate for short term storage or RMI between applications running
41 * the same version of Swing. As of 1.4, support for long term storage
42 * of all JavaBeans™
43 * has been added to the <code>java.beans</code> package.
44 * Please see {@link java.beans.XMLEncoder}.
45 *
46 * @author Jeff Dinkins
47 * @since 1.2
48 */
49 @SuppressWarnings("serial") // Same-version serialization only
50 public class DefaultButtonModel implements ButtonModel, Serializable {
51
52 /** The bitmask used to store the state of the button. */
53 protected int stateMask = 0;
54
55 /** The action command string fired by the button. */
56 protected String actionCommand = null;
57
58 /** The button group that the button belongs to. */
59 protected ButtonGroup group = null;
60
61 /** The button's mnemonic. */
62 protected int mnemonic = 0;
63
64 /**
65 * Only one <code>ChangeEvent</code> is needed per button model
66 * instance since the event's only state is the source property.
67 * The source of events generated is always "this".
|