KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > windows > WindowsCheckBoxUI


1 /*
2  * @(#)WindowsCheckBoxUI.java 1.20 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.java.swing.plaf.windows;
9
10 import javax.swing.plaf.basic.*;
11 import javax.swing.*;
12 import javax.swing.plaf.*;
13
14 import java.awt.*;
15
16 /**
17  * Windows check box.
18  * <p>
19  * <strong>Warning:</strong>
20  * Serialized objects of this class will not be compatible with
21  * future Swing releases. The current serialization support is appropriate
22  * for short term storage or RMI between applications running the same
23  * version of Swing. A future release of Swing will provide support for
24  * long term persistence.
25  *
26  * @version 1.20 12/19/03
27  * @author Jeff Dinkins
28  */

29 public class WindowsCheckBoxUI extends WindowsRadioButtonUI
30 {
31     // NOTE: MetalCheckBoxUI inherts from MetalRadioButtonUI instead
32
// of BasicCheckBoxUI because we want to pick up all the
33
// painting changes made in MetalRadioButtonUI.
34

35     private static final WindowsCheckBoxUI windowsCheckBoxUI = new WindowsCheckBoxUI();
36
37     private final static String JavaDoc propertyPrefix = "CheckBox" + ".";
38
39     private boolean defaults_initialized = false;
40     
41     // ********************************
42
// Create PLAF
43
// ********************************
44
public static ComponentUI createUI(JComponent c) {
45     return windowsCheckBoxUI;
46     }
47
48
49     public String JavaDoc getPropertyPrefix() {
50     return propertyPrefix;
51     }
52
53     // ********************************
54
// Defaults
55
// ********************************
56
public void installDefaults(AbstractButton b) {
57     super.installDefaults(b);
58     if(!defaults_initialized) {
59         icon = UIManager.getIcon(getPropertyPrefix() + "icon");
60         defaults_initialized = true;
61     }
62     }
63
64     public void uninstallDefaults(AbstractButton b) {
65     super.uninstallDefaults(b);
66     defaults_initialized = false;
67     }
68
69 }
70
71
Popular Tags