Source Code Cross Referenced for CSSPrimitiveValue.java in  » 6.0-JDK-Core » w3c » org » w3c » dom » css » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » w3c » org.w3c.dom.css 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
003         *
004         * This code is free software; you can redistribute it and/or modify it
005         * under the terms of the GNU General Public License version 2 only, as
006         * published by the Free Software Foundation.  Sun designates this
007         * particular file as subject to the "Classpath" exception as provided
008         * by Sun in the LICENSE file that accompanied this code.
009         *
010         * This code is distributed in the hope that it will be useful, but WITHOUT
011         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
013         * version 2 for more details (a copy is included in the LICENSE file that
014         * accompanied this code).
015         *
016         * You should have received a copy of the GNU General Public License version
017         * 2 along with this work; if not, write to the Free Software Foundation,
018         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
019         *
020         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
021         * CA 95054 USA or visit www.sun.com if you need additional information or
022         * have any questions.
023         */
024
025        /*
026         * This file is available under and governed by the GNU General Public
027         * License version 2 only, as published by the Free Software Foundation.
028         * However, the following notice accompanied the original version of this
029         * file and, per its terms, should not be removed:
030         *
031         * Copyright (c) 2000 World Wide Web Consortium,
032         * (Massachusetts Institute of Technology, Institut National de
033         * Recherche en Informatique et en Automatique, Keio University). All
034         * Rights Reserved. This program is distributed under the W3C's Software
035         * Intellectual Property License. This program is distributed in the
036         * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
037         * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
038         * PURPOSE.
039         * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
040         */
041
042        package org.w3c.dom.css;
043
044        import org.w3c.dom.DOMException;
045
046        /**
047         *  The <code>CSSPrimitiveValue</code> interface represents a single CSS value
048         * . This interface may be used to determine the value of a specific style 
049         * property currently set in a block or to set a specific style property 
050         * explicitly within the block. An instance of this interface might be 
051         * obtained from the <code>getPropertyCSSValue</code> method of the 
052         * <code>CSSStyleDeclaration</code> interface. A 
053         * <code>CSSPrimitiveValue</code> object only occurs in a context of a CSS 
054         * property. 
055         * <p> Conversions are allowed between absolute values (from millimeters to 
056         * centimeters, from degrees to radians, and so on) but not between relative 
057         * values. (For example, a pixel value cannot be converted to a centimeter 
058         * value.) Percentage values can't be converted since they are relative to 
059         * the parent value (or another property value). There is one exception for 
060         * color percentage values: since a color percentage value is relative to 
061         * the range 0-255, a color percentage value can be converted to a number; 
062         * (see also the <code>RGBColor</code> interface). 
063         * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
064         * @since DOM Level 2
065         */
066        public interface CSSPrimitiveValue extends CSSValue {
067            // UnitTypes
068            /**
069             * The value is not a recognized CSS2 value. The value can only be 
070             * obtained by using the <code>cssText</code> attribute.
071             */
072            public static final short CSS_UNKNOWN = 0;
073            /**
074             * The value is a simple number. The value can be obtained by using the 
075             * <code>getFloatValue</code> method.
076             */
077            public static final short CSS_NUMBER = 1;
078            /**
079             * The value is a percentage. The value can be obtained by using the 
080             * <code>getFloatValue</code> method.
081             */
082            public static final short CSS_PERCENTAGE = 2;
083            /**
084             * The value is a length (ems). The value can be obtained by using the 
085             * <code>getFloatValue</code> method.
086             */
087            public static final short CSS_EMS = 3;
088            /**
089             * The value is a length (exs). The value can be obtained by using the 
090             * <code>getFloatValue</code> method.
091             */
092            public static final short CSS_EXS = 4;
093            /**
094             * The value is a length (px). The value can be obtained by using the 
095             * <code>getFloatValue</code> method.
096             */
097            public static final short CSS_PX = 5;
098            /**
099             * The value is a length (cm). The value can be obtained by using the 
100             * <code>getFloatValue</code> method.
101             */
102            public static final short CSS_CM = 6;
103            /**
104             * The value is a length (mm). The value can be obtained by using the 
105             * <code>getFloatValue</code> method.
106             */
107            public static final short CSS_MM = 7;
108            /**
109             * The value is a length (in). The value can be obtained by using the 
110             * <code>getFloatValue</code> method.
111             */
112            public static final short CSS_IN = 8;
113            /**
114             * The value is a length (pt). The value can be obtained by using the 
115             * <code>getFloatValue</code> method.
116             */
117            public static final short CSS_PT = 9;
118            /**
119             * The value is a length (pc). The value can be obtained by using the 
120             * <code>getFloatValue</code> method.
121             */
122            public static final short CSS_PC = 10;
123            /**
124             * The value is an angle (deg). The value can be obtained by using the 
125             * <code>getFloatValue</code> method.
126             */
127            public static final short CSS_DEG = 11;
128            /**
129             * The value is an angle (rad). The value can be obtained by using the 
130             * <code>getFloatValue</code> method.
131             */
132            public static final short CSS_RAD = 12;
133            /**
134             * The value is an angle (grad). The value can be obtained by using the 
135             * <code>getFloatValue</code> method.
136             */
137            public static final short CSS_GRAD = 13;
138            /**
139             * The value is a time (ms). The value can be obtained by using the 
140             * <code>getFloatValue</code> method.
141             */
142            public static final short CSS_MS = 14;
143            /**
144             * The value is a time (s). The value can be obtained by using the 
145             * <code>getFloatValue</code> method.
146             */
147            public static final short CSS_S = 15;
148            /**
149             * The value is a frequency (Hz). The value can be obtained by using the 
150             * <code>getFloatValue</code> method.
151             */
152            public static final short CSS_HZ = 16;
153            /**
154             * The value is a frequency (kHz). The value can be obtained by using the 
155             * <code>getFloatValue</code> method.
156             */
157            public static final short CSS_KHZ = 17;
158            /**
159             * The value is a number with an unknown dimension. The value can be 
160             * obtained by using the <code>getFloatValue</code> method.
161             */
162            public static final short CSS_DIMENSION = 18;
163            /**
164             * The value is a STRING. The value can be obtained by using the 
165             * <code>getStringValue</code> method.
166             */
167            public static final short CSS_STRING = 19;
168            /**
169             * The value is a URI. The value can be obtained by using the 
170             * <code>getStringValue</code> method.
171             */
172            public static final short CSS_URI = 20;
173            /**
174             * The value is an identifier. The value can be obtained by using the 
175             * <code>getStringValue</code> method.
176             */
177            public static final short CSS_IDENT = 21;
178            /**
179             * The value is a attribute function. The value can be obtained by using 
180             * the <code>getStringValue</code> method.
181             */
182            public static final short CSS_ATTR = 22;
183            /**
184             * The value is a counter or counters function. The value can be obtained 
185             * by using the <code>getCounterValue</code> method.
186             */
187            public static final short CSS_COUNTER = 23;
188            /**
189             * The value is a rect function. The value can be obtained by using the 
190             * <code>getRectValue</code> method.
191             */
192            public static final short CSS_RECT = 24;
193            /**
194             * The value is a RGB color. The value can be obtained by using the 
195             * <code>getRGBColorValue</code> method.
196             */
197            public static final short CSS_RGBCOLOR = 25;
198
199            /**
200             * The type of the value as defined by the constants specified above.
201             */
202            public short getPrimitiveType();
203
204            /**
205             *  A method to set the float value with a specified unit. If the property 
206             * attached with this value can not accept the specified unit or the 
207             * float value, the value will be unchanged and a 
208             * <code>DOMException</code> will be raised. 
209             * @param unitType  A unit code as defined above. The unit code can only 
210             *   be a float unit type (i.e. <code>CSS_NUMBER</code>, 
211             *   <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>, 
212             *   <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>, 
213             *   <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>, 
214             *   <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>, 
215             *   <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>, 
216             *   <code>CSS_HZ</code>, <code>CSS_KHZ</code>, 
217             *   <code>CSS_DIMENSION</code>). 
218             * @param floatValue  The new float value. 
219             * @exception DOMException
220             *    INVALID_ACCESS_ERR: Raised if the attached property doesn't support 
221             *   the float value or the unit type.
222             *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
223             */
224            public void setFloatValue(short unitType, float floatValue)
225                    throws DOMException;
226
227            /**
228             *  This method is used to get a float value in a specified unit. If this 
229             * CSS value doesn't contain a float value or can't be converted into 
230             * the specified unit, a <code>DOMException</code> is raised. 
231             * @param unitType  A unit code to get the float value. The unit code can 
232             *   only be a float unit type (i.e. <code>CSS_NUMBER</code>, 
233             *   <code>CSS_PERCENTAGE</code>, <code>CSS_EMS</code>, 
234             *   <code>CSS_EXS</code>, <code>CSS_PX</code>, <code>CSS_CM</code>, 
235             *   <code>CSS_MM</code>, <code>CSS_IN</code>, <code>CSS_PT</code>, 
236             *   <code>CSS_PC</code>, <code>CSS_DEG</code>, <code>CSS_RAD</code>, 
237             *   <code>CSS_GRAD</code>, <code>CSS_MS</code>, <code>CSS_S</code>, 
238             *   <code>CSS_HZ</code>, <code>CSS_KHZ</code>, 
239             *   <code>CSS_DIMENSION</code>). 
240             * @return  The float value in the specified unit. 
241             * @exception DOMException
242             *    INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a float 
243             *   value or if the float value can't be converted into the specified 
244             *   unit. 
245             */
246            public float getFloatValue(short unitType) throws DOMException;
247
248            /**
249             *  A method to set the string value with the specified unit. If the 
250             * property attached to this value can't accept the specified unit or 
251             * the string value, the value will be unchanged and a 
252             * <code>DOMException</code> will be raised. 
253             * @param stringType  A string code as defined above. The string code can 
254             *   only be a string unit type (i.e. <code>CSS_STRING</code>, 
255             *   <code>CSS_URI</code>, <code>CSS_IDENT</code>, and 
256             *   <code>CSS_ATTR</code>). 
257             * @param stringValue  The new string value. 
258             * @exception DOMException
259             *    INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string 
260             *   value or if the string value can't be converted into the specified 
261             *   unit.
262             *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
263             */
264            public void setStringValue(short stringType, String stringValue)
265                    throws DOMException;
266
267            /**
268             *  This method is used to get the string value. If the CSS value doesn't 
269             * contain a string value, a <code>DOMException</code> is raised.  Some 
270             * properties (like 'font-family' or 'voice-family') convert a 
271             * whitespace separated list of idents to a string. 
272             * @return  The string value in the current unit. The current 
273             *   <code>primitiveType</code> can only be a string unit type (i.e. 
274             *   <code>CSS_STRING</code>, <code>CSS_URI</code>, 
275             *   <code>CSS_IDENT</code> and <code>CSS_ATTR</code>). 
276             * @exception DOMException
277             *    INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string 
278             *   value. 
279             */
280            public String getStringValue() throws DOMException;
281
282            /**
283             *  This method is used to get the Counter value. If this CSS value 
284             * doesn't contain a counter value, a <code>DOMException</code> is 
285             * raised. Modification to the corresponding style property can be 
286             * achieved using the <code>Counter</code> interface. 
287             * @return The Counter value.
288             * @exception DOMException
289             *    INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a 
290             *   Counter value (e.g. this is not <code>CSS_COUNTER</code>). 
291             */
292            public Counter getCounterValue() throws DOMException;
293
294            /**
295             *  This method is used to get the Rect value. If this CSS value doesn't 
296             * contain a rect value, a <code>DOMException</code> is raised. 
297             * Modification to the corresponding style property can be achieved 
298             * using the <code>Rect</code> interface. 
299             * @return The Rect value.
300             * @exception DOMException
301             *    INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect 
302             *   value. (e.g. this is not <code>CSS_RECT</code>). 
303             */
304            public Rect getRectValue() throws DOMException;
305
306            /**
307             *  This method is used to get the RGB color. If this CSS value doesn't 
308             * contain a RGB color value, a <code>DOMException</code> is raised. 
309             * Modification to the corresponding style property can be achieved 
310             * using the <code>RGBColor</code> interface. 
311             * @return the RGB color value.
312             * @exception DOMException
313             *    INVALID_ACCESS_ERR: Raised if the attached property can't return a 
314             *   RGB color value (e.g. this is not <code>CSS_RGBCOLOR</code>). 
315             */
316            public RGBColor getRGBColorValue() throws DOMException;
317
318        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.