Source Code Cross Referenced for CssParameter.java in  » GIS » deegree » org » deegree » graphics » sld » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » deegree » org.deegree.graphics.sld 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/graphics/sld/CssParameter.java $
002:        /*----------------    FILE HEADER  ------------------------------------------
003:
004:         This file is part of deegree.
005:         Copyright (C) 2001-2008 by:
006:         EXSE, Department of Geography, University of Bonn
007:         http://www.giub.uni-bonn.de/deegree/
008:         lat/lon GmbH
009:         http://www.lat-lon.de
010:
011:         This library is free software; you can redistribute it and/or
012:         modify it under the terms of the GNU Lesser General Public
013:         License as published by the Free Software Foundation; either
014:         version 2.1 of the License, or (at your option) any later version.
015:
016:         This library is distributed in the hope that it will be useful,
017:         but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019:         Lesser General Public License for more details.
020:
021:         You should have received a copy of the GNU Lesser General Public
022:         License along with this library; if not, write to the Free Software
023:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024:
025:         Contact:
026:
027:         Andreas Poth
028:         lat/lon GmbH
029:         Aennchenstr. 19
030:         53115 Bonn
031:         Germany
032:         E-Mail: poth@lat-lon.de
033:
034:         Prof. Dr. Klaus Greve
035:         Department of Geography
036:         University of Bonn
037:         Meckenheimer Allee 166
038:         53115 Bonn
039:         Germany
040:         E-Mail: greve@giub.uni-bonn.de
041:
042:        
043:         ---------------------------------------------------------------------------*/
044:        package org.deegree.graphics.sld;
045:
046:        import org.deegree.framework.xml.Marshallable;
047:        import org.deegree.model.feature.Feature;
048:        import org.deegree.model.filterencoding.FilterEvaluationException;
049:
050:        /**
051:         * The simple SVG/CSS2 styling parameters are given with the CssParameter element, which is defined
052:         * as follows:
053:         * 
054:         * <pre>
055:         *  
056:         *   &lt;xs:element name=&quot;CssParameter&quot; type=&quot;sld:ParameterValueType&quot;/&gt;
057:         *      &lt;xs:complexType name=&quot;ParameterValueType&quot; mixed=&quot;true&quot;&gt;
058:         *         &lt;xs:choice minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;
059:         *              &lt;xs:element ref=&quot;wfs:expression&quot;/&gt;
060:         *          &lt;/xs:choice&gt;
061:         *   &lt;/xs:complexType&gt;
062:         *  
063:         * </pre>
064:         * 
065:         * The parameter values are allowed to be complex expressions for maximum flexibility. The
066:         * mixed="true" definition means that regular text may be mixed in with various sub-expressions,
067:         * implying a text-substitution model for parameter values. Numeric and character-string data types
068:         * are not distinguished, which may cause some complications.
069:         * <p>
070:         * </p>
071:         * Here are some usage examples:
072:         * 
073:         * <pre>
074:         * 
075:         *  1. &lt;CssParameter name=&quot;stroke-width&quot;&gt;3&lt;/CssParameter&gt;
076:         *  2. &lt;CssParameter name=&quot;stroke-width&quot;&gt;
077:         *          &lt;wfs:Literal&gt;3&lt;/wfs:Literal&gt;
078:         *     &lt;/CssParameter&gt;
079:         *  3. &lt;CssParameter name=&quot;stroke-width&quot;&gt;
080:         *          &lt;wfs:Add&gt;
081:         *              &lt;wfs:PropertyName&gt;/A&lt;/wfs:PropertyName&gt;
082:         *              &lt;wfs:Literal&gt;2&lt;/wfs:Literal&gt;
083:         *          &lt;/wfs:Add&gt;
084:         *     &lt;/CssParameter&gt;
085:         *  4. &lt;Label&gt;This is city &quot;&lt;wfs:PropertyName&gt;/NAME&lt;/wfs:PropertyName&gt;&quot;
086:         *  of state &lt;wfs:PropertyName&gt;/STATE&lt;/wfs:PropertyName&gt;&lt;/Label&gt;
087:         *  
088:         * </pre>
089:         * 
090:         * The allowed SVG/CSS styling parameters for a stroke are: stroke (color), stroke-opacity,
091:         * stroke-width, stroke-linejoin, stroke-linecap, stroke-dasharray, and stroke-dashoffset. The
092:         * chosen parameter is given by the name attribute of the CssParameter element.
093:         * <p>
094:         * 
095:         * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
096:         * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
097:         * @version $Revision: 9340 $ $Date: 2007-12-27 04:32:12 -0800 (Thu, 27 Dec 2007) $
098:         */
099:
100:        public class CssParameter implements  Marshallable {
101:
102:            private ParameterValueType pvt = null;
103:
104:            private String name = null;
105:
106:            /**
107:             * constructor initializing the class with the <CssParameter>
108:             */
109:            CssParameter(String name, ParameterValueType pvt) {
110:                this .name = name;
111:                this .pvt = pvt;
112:            }
113:
114:            /**
115:             * Returns the name attribute's value of the CssParameter.
116:             * <p>
117:             * 
118:             * @return the value of the name attribute of the CssParameter
119:             */
120:            String getName() {
121:                return name;
122:            }
123:
124:            /**
125:             * Sets the name attribute's value of the CssParameter.
126:             * <p>
127:             * 
128:             * @param name
129:             *            the value of the name attribute of the CssParameter
130:             */
131:            void setName(String name) {
132:                this .name = name;
133:            }
134:
135:            /**
136:             * Returns the value of the CssParameter as an <tt>ParameterValueType</tt>.
137:             * <p>
138:             * 
139:             * @return the mixed content of the element
140:             */
141:            public ParameterValueType getValue() {
142:                return pvt;
143:            }
144:
145:            /**
146:             * Sets the value of the CssParameter as an <tt>ParameterValueType</tt>.
147:             * <p>
148:             * 
149:             * @param value
150:             *            the mixed content of the element
151:             */
152:            void setValue(ParameterValueType value) {
153:                this .pvt = value;
154:            }
155:
156:            /**
157:             * Returns the (evaluated) value of the CssParameter as a simple <tt>String</tt>.
158:             * <p>
159:             * 
160:             * @param feature
161:             *            specifies the <tt>Feature</tt> to be used for evaluation of the underlying
162:             *            'sld:ParameterValueType'
163:             * @return the (evaluated) <tt>String</tt> value of the parameter
164:             * @throws FilterEvaluationException
165:             *             if the evaluations fails
166:             */
167:            String getValue(Feature feature) throws FilterEvaluationException {
168:                return pvt.evaluate(feature);
169:            }
170:
171:            /**
172:             * Sets the value of the CssParameter as a simple <tt>String</tt>.
173:             * <p>
174:             * 
175:             * @param value
176:             *            CssParameter-Value to be set
177:             */
178:            void setValue(String value) {
179:                ParameterValueType pvt = null;
180:                pvt = StyleFactory.createParameterValueType("" + value);
181:                this .pvt = pvt;
182:            }
183:
184:            /**
185:             * exports the content of the CssParameter as XML formated String
186:             * 
187:             * @return xml representation of the CssParameter
188:             */
189:            public String exportAsXML() {
190:
191:                StringBuffer sb = new StringBuffer("<CssParameter name=");
192:                sb.append("'" + name + "'>");
193:                sb.append(((Marshallable) pvt).exportAsXML());
194:                sb.append("</CssParameter>");
195:
196:                return sb.toString();
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.