1. /*
  2. * @(#)ColorUIResource.java 1.14 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. package javax.swing.plaf;
  8. import java.awt.Color;
  9. import javax.swing.plaf.UIResource;
  10. /*
  11. * A subclass of Color that implements UIResource. UI
  12. * classes that create colors should use this class.
  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
  17. * appropriate for short term storage or RMI between applications running
  18. * the same version of Swing. As of 1.4, support for long term storage
  19. * of all JavaBeans<sup><font size="-2">TM</font></sup>
  20. * has been added to the <code>java.beans</code> package.
  21. * Please see {@link java.beans.XMLEncoder}.
  22. *
  23. * @see javax.swing.plaf.UIResource
  24. * @version 1.14 12/19/03
  25. * @author Hans Muller
  26. *
  27. */
  28. public class ColorUIResource extends Color implements UIResource
  29. {
  30. public ColorUIResource(int r, int g, int b) {
  31. super(r, g, b);
  32. }
  33. public ColorUIResource(int rgb) {
  34. super(rgb);
  35. }
  36. public ColorUIResource(float r, float g, float b) {
  37. super(r, g, b);
  38. }
  39. public ColorUIResource(Color c) {
  40. super(c.getRGB(), (c.getRGB() & 0xFF000000) != 0xFF000000);
  41. }
  42. }