1. /*
  2. * @(#)MotifCheckBoxUI.java 1.19 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.java.swing.plaf.motif;
  8. import javax.swing.*;
  9. import javax.swing.plaf.*;
  10. import java.awt.*;
  11. /**
  12. * MotifCheckBox implementation
  13. * <p>
  14. * <strong>Warning:</strong>
  15. * Serialized objects of this class will not be compatible with
  16. * future Swing releases. The current serialization support is appropriate
  17. * for short term storage or RMI between applications running the same
  18. * version of Swing. A future release of Swing will provide support for
  19. * long term persistence.
  20. *
  21. * @version 1.19 11/29/01
  22. * @author Rich Schiavi
  23. */
  24. public class MotifCheckBoxUI extends MotifRadioButtonUI {
  25. private static final MotifCheckBoxUI motifCheckBoxUI = new MotifCheckBoxUI();
  26. private final static String propertyPrefix = "CheckBox" + ".";
  27. private boolean defaults_initialized = false;
  28. // ********************************
  29. // Create PLAF
  30. // ********************************
  31. public static ComponentUI createUI(JComponent c){
  32. return motifCheckBoxUI;
  33. }
  34. public String getPropertyPrefix() {
  35. return propertyPrefix;
  36. }
  37. // ********************************
  38. // Defaults
  39. // ********************************
  40. public void installDefaults(AbstractButton b) {
  41. super.installDefaults(b);
  42. if(!defaults_initialized) {
  43. icon = UIManager.getIcon(getPropertyPrefix() + "icon");
  44. defaults_initialized = true;
  45. }
  46. }
  47. protected void uninstallDefaults(AbstractButton b) {
  48. super.uninstallDefaults(b);
  49. defaults_initialized = false;
  50. }
  51. }