/[classpath]/classpath/javax/swing/plaf/ColorUIResource.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/ColorUIResource.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by egagnon, Sun Aug 11 20:08:43 2002 UTC revision 1.3 by brawer, Mon Jun 23 13:36:56 2003 UTC
# Line 1  Line 1 
1  /* ColorUIResource.java  /* ColorUIResource.java
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2003 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38    
39  package javax.swing.plaf;  package javax.swing.plaf;
40    
41  import java.awt.Color;  import java.awt.Color;
42    
43    
44  /**  /**
45   * STUBBED   * A Color that is marked as <code>UIResource</code>, which indicates that
46     * the color has been installed by a pluggable LookAndFeel. Such colors
47     * are replaced when the LookAndFeel changes.
48     *
49     * @see java.awt.Color
50     *
51     * @author Sascha Brawer (brawer@dandelis.ch)
52   */   */
53  public class ColorUIResource extends Color implements UIResource  public class ColorUIResource
54      extends Color
55      implements UIResource
56  {  {
57    public ColorUIResource(Color c)    /**
58       * Constructs a <code>ColorUIResource</code> using the specified
59       * red, green, and blue values, which must be given as integers in
60       * the range of 0-255. The alpha channel value will default to 255,
61       * meaning that the color is fully opaque.
62       *
63       * @param r the red intensity, which must be in the range [0 .. 255].
64       * @param g the green intensity, which must be in the range [0 .. 255].
65       * @param b the blue intensity, which must be in the range [0 .. 255].
66       */
67      public ColorUIResource(int r, int g, int b)
68    {    {
69      super(c.getRGB());      super(r, g, b);
70    }    }
71    public ColorUIResource(float r, float g, float b)  
72    
73      /**
74       * Consructs a <code>ColorUIResource</code> using the specified
75       * RGB value. The blue value is in bits 0-7, green in bits 8-15, and
76       * red in bits 16-23. The other bits are ignored. The alpha value is set
77       * to 255, meaning that the color is fully opaque.
78       *
79       * @param rgb the rgb value, as discussed above.
80       */
81      public ColorUIResource(int rgb)
82    {    {
83      super(r, g, b, 1.0f);      super(rgb);
84    }    }
85    public ColorUIResource(int rgb)  
86    
87      /**
88       * Constructs a <code>ColorUIResource</code> using the specified
89       * red, green, and blue intensities, which must be given as floats in
90       * the range of 0-1. The alpha channel value will default to 1.0f,
91       * meaning that the color is fully opaque.
92       *
93       * @param r the red intensity, which must be in the range [0.0 .. 1.0].
94       * @param g the green intensity, which must be in the range [0.0 .. 1.0].
95       * @param b the blue intensity, which must be in the range [0.0 .. 1.0].
96       */
97      public ColorUIResource(float r, float g, float b)
98    {    {
99      super(rgb, false);      super(r, g, b);
100    }    }
101    public ColorUIResource(int r, int g, int b)  
102    
103      /**
104       * Constructs a <code>ColorUIResource</code>, using the intensities
105       * of another color.
106       *
107       * @param c the color whose intensities will be considered when
108       *        constructing this <code>ColorUIResource</code>.
109       */
110      public ColorUIResource(Color c)
111    {    {
112      super(r, g, b, 255);      super(c.getRGB());
113    }    }
114  } // class ColorUIResource  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26