KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > motif > MotifCheckBoxUI


1 /*
2  * @(#)MotifCheckBoxUI.java 1.23 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.motif;
9
10 import javax.swing.*;
11
12 import javax.swing.plaf.*;
13
14 import java.awt.*;
15
16 /**
17  * MotifCheckBox implementation
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.23 12/19/03
27  * @author Rich Schiavi
28  */

29 public class MotifCheckBoxUI extends MotifRadioButtonUI {
30
31     private static final MotifCheckBoxUI motifCheckBoxUI = new MotifCheckBoxUI();
32
33     private final static String JavaDoc propertyPrefix = "CheckBox" + ".";
34
35     private boolean defaults_initialized = false;
36
37
38     // ********************************
39
// Create PLAF
40
// ********************************
41
public static ComponentUI createUI(JComponent c){
42     return motifCheckBoxUI;
43     }
44
45     public String JavaDoc getPropertyPrefix() {
46     return propertyPrefix;
47     }
48
49     // ********************************
50
// Defaults
51
// ********************************
52
public void installDefaults(AbstractButton b) {
53     super.installDefaults(b);
54     if(!defaults_initialized) {
55         icon = UIManager.getIcon(getPropertyPrefix() + "icon");
56         defaults_initialized = true;
57     }
58     }
59
60     protected void uninstallDefaults(AbstractButton b) {
61     super.uninstallDefaults(b);
62     defaults_initialized = false;
63     }
64 }
65
Popular Tags