KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > steadystate > css > RGBColorImpl


1 /*
2  * RGBColorImpl.java
3  *
4  * Steady State CSS2 Parser
5  *
6  * Copyright (C) 1999, 2002 Steady State Software Ltd. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  *
22  * To contact the authors of the library, write to Steady State Software Ltd.,
23  * 49 Littleworth, Wing, Buckinghamshire, LU7 0JX, England
24  *
25  * http://www.steadystate.com/css/
26  * mailto:css@steadystate.co.uk
27  */

28
29 package com.steadystate.css;
30
31 //import org.w3c.css.sac.*;
32
//import org.w3c.dom.css.CSSPrimitiveValue;
33
import com.steadystate.css.dom.CSSValueImpl;
34 import com.steadystate.css.parser.*;
35
36 /**
37  *
38  * @author David Schweinsberg
39  * @version $Release$
40  * @deprecated As of 0.9.0, replaced by {@link com.steadystate.css.dom.RGBColorImpl}
41  */

42 public class RGBColorImpl extends com.steadystate.css.dom.RGBColorImpl {
43
44     protected RGBColorImpl(HexColor h) {
45         setRed(new CSSValueImpl(
46             LexicalUnitImpl.createNumber(null, h.getRed()),
47             true));
48         setGreen(new CSSValueImpl(
49             LexicalUnitImpl.createNumber(null, h.getGreen()),
50             true));
51         setBlue(new CSSValueImpl(
52             LexicalUnitImpl.createNumber(null, h.getBlue()),
53             true));
54     }
55 /*
56     protected RGBColorImpl( CSSValue value )
57     {
58         if( value.getValueType() != CSSValue.CSS_VALUE_LIST )
59         return;
60
61         CSSValueList vl = (CSSValueList) value;
62
63         if( vl.getLength() != 3 )
64         return;
65
66         _red = (CSSPrimitiveValue) vl.item( 0 );
67         _green = (CSSPrimitiveValue) vl.item( 1 );
68         _blue = (CSSPrimitiveValue) vl.item( 2 );
69     }
70 */

71 }
72
Popular Tags