37
38 /**
39 * CheckboxUI implementation for BasicCheckboxUI
40 * <p>
41 * <strong>Warning:</strong>
42 * Serialized objects of this class will not be compatible with
43 * future Swing releases. The current serialization support is
44 * appropriate for short term storage or RMI between applications running
45 * the same version of Swing. As of 1.4, support for long term storage
46 * of all JavaBeans™
47 * has been added to the <code>java.beans</code> package.
48 * Please see {@link java.beans.XMLEncoder}.
49 *
50 * @author Jeff Dinkins
51 */
52 @SuppressWarnings("serial") // Same-version serialization only
53 public class BasicCheckBoxUI extends BasicRadioButtonUI {
54
55 private static final Object BASIC_CHECK_BOX_UI_KEY = new Object();
56
57 private final static String propertyPrefix = "CheckBox" + ".";
58
59 // ********************************
60 // Create PLAF
61 // ********************************
62
63 /**
64 * Returns an instance of {@code BasicCheckBoxUI}.
65 *
66 * @param b a component
67 * @return an instance of {@code BasicCheckBoxUI}
68 */
69 public static ComponentUI createUI(JComponent b) {
70 AppContext appContext = AppContext.getAppContext();
71 BasicCheckBoxUI checkboxUI =
72 (BasicCheckBoxUI) appContext.get(BASIC_CHECK_BOX_UI_KEY);
73 if (checkboxUI == null) {
74 checkboxUI = new BasicCheckBoxUI();
75 appContext.put(BASIC_CHECK_BOX_UI_KEY, checkboxUI);
76 }
77 return checkboxUI;
|
37
38 /**
39 * CheckboxUI implementation for BasicCheckboxUI
40 * <p>
41 * <strong>Warning:</strong>
42 * Serialized objects of this class will not be compatible with
43 * future Swing releases. The current serialization support is
44 * appropriate for short term storage or RMI between applications running
45 * the same version of Swing. As of 1.4, support for long term storage
46 * of all JavaBeans™
47 * has been added to the <code>java.beans</code> package.
48 * Please see {@link java.beans.XMLEncoder}.
49 *
50 * @author Jeff Dinkins
51 */
52 @SuppressWarnings("serial") // Same-version serialization only
53 public class BasicCheckBoxUI extends BasicRadioButtonUI {
54
55 private static final Object BASIC_CHECK_BOX_UI_KEY = new Object();
56
57 private static final String propertyPrefix = "CheckBox" + ".";
58
59 // ********************************
60 // Create PLAF
61 // ********************************
62
63 /**
64 * Returns an instance of {@code BasicCheckBoxUI}.
65 *
66 * @param b a component
67 * @return an instance of {@code BasicCheckBoxUI}
68 */
69 public static ComponentUI createUI(JComponent b) {
70 AppContext appContext = AppContext.getAppContext();
71 BasicCheckBoxUI checkboxUI =
72 (BasicCheckBoxUI) appContext.get(BASIC_CHECK_BOX_UI_KEY);
73 if (checkboxUI == null) {
74 checkboxUI = new BasicCheckBoxUI();
75 appContext.put(BASIC_CHECK_BOX_UI_KEY, checkboxUI);
76 }
77 return checkboxUI;
|