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