1. /*
  2. * @(#)WindowsCheckBoxUI.java 1.17 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.windows;
  11. import javax.swing.plaf.basic.*;
  12. import javax.swing.*;
  13. import javax.swing.plaf.*;
  14. import java.awt.*;
  15. /**
  16. * Windows check box.
  17. * <p>
  18. * <strong>Warning:</strong>
  19. * Serialized objects of this class will not be compatible with
  20. * future Swing releases. The current serialization support is appropriate
  21. * for short term storage or RMI between applications running the same
  22. * version of Swing. A future release of Swing will provide support for
  23. * long term persistence.
  24. *
  25. * @version 1.17 02/02/00
  26. * @author Jeff Dinkins
  27. */
  28. public class WindowsCheckBoxUI extends WindowsRadioButtonUI
  29. {
  30. // NOTE: MetalCheckBoxUI inherts from MetalRadioButtonUI instead
  31. // of BasicCheckBoxUI because we want to pick up all the
  32. // painting changes made in MetalRadioButtonUI.
  33. private static final WindowsCheckBoxUI windowsCheckBoxUI = new WindowsCheckBoxUI();
  34. private final static String propertyPrefix = "CheckBox" + ".";
  35. private boolean defaults_initialized = false;
  36. // ********************************
  37. // Create PLAF
  38. // ********************************
  39. public static ComponentUI createUI(JComponent c) {
  40. return windowsCheckBoxUI;
  41. }
  42. public String getPropertyPrefix() {
  43. return propertyPrefix;
  44. }
  45. // ********************************
  46. // Defaults
  47. // ********************************
  48. public void installDefaults(AbstractButton b) {
  49. super.installDefaults(b);
  50. if(!defaults_initialized) {
  51. icon = UIManager.getIcon(getPropertyPrefix() + "icon");
  52. defaults_initialized = true;
  53. }
  54. }
  55. public void uninstallDefaults(AbstractButton b) {
  56. super.uninstallDefaults(b);
  57. defaults_initialized = false;
  58. }
  59. }