Source Code Cross Referenced for FeatureTypeStyle.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/FeatureTypeStyle.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 java.util.ArrayList;
047:        import java.util.List;
048:
049:        import org.deegree.framework.xml.Marshallable;
050:
051:        /**
052:         * The FeatureTypeStyle defines the styling that is to be applied to a single feature type of a
053:         * layer). This element may also be externally re-used outside of the scope of WMSes and layers.
054:         * <p>
055:         * </p>
056:         * The FeatureTypeStyle element identifies that explicit separation in SLD between the handling of
057:         * layers and the handling of features of specific feature types. The layer concept is unique to WMS
058:         * and SLD, but features are used more generally, such as in WFS and GML, so this explicit
059:         * separation is important.
060:         * <p>
061:         * ----------------------------------------------------------------------
062:         * </p>
063:         * 
064:         * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
065:         * @version $Revision: 9340 $ $Date: 2007-12-27 04:32:12 -0800 (Thu, 27 Dec 2007) $
066:         */
067:        public class FeatureTypeStyle implements  Marshallable {
068:            private List<Rule> rules = null;
069:
070:            private List<String> semanticTypeIdentifier = null;
071:
072:            private String abstract_ = null;
073:
074:            private String featureTypeName = null;
075:
076:            private String name = null;
077:
078:            private String title = null;
079:
080:            /**
081:             * default constructor
082:             */
083:            FeatureTypeStyle() {
084:                semanticTypeIdentifier = new ArrayList<String>();
085:                rules = new ArrayList<Rule>();
086:            }
087:
088:            /**
089:             * constructor initializing the class with the <FeatureTypeStyle>
090:             */
091:            FeatureTypeStyle(String name, String title, String abstract_,
092:                    String featureTypeName, String[] semanticTypeIdentifier,
093:                    Rule[] rules) {
094:                this ();
095:                setName(name);
096:                setTitle(title);
097:                setAbstract(abstract_);
098:                setFeatureTypeName(featureTypeName);
099:                setSemanticTypeIdentifier(semanticTypeIdentifier);
100:                setRules(rules);
101:            }
102:
103:            /**
104:             * The Name element does not have an explicit use at present, though it conceivably might be
105:             * used to reference a feature style in some feature-style library.
106:             * 
107:             * @return name
108:             * 
109:             */
110:            public String getName() {
111:                return name;
112:            }
113:
114:            /**
115:             * The Name element does not have an explicit use at present, though it conceivably might be
116:             * used to reference a feature style in some feature-style library. Sets the <Name> o
117:             * 
118:             * @param name
119:             *            the name
120:             * 
121:             */
122:            public void setName(String name) {
123:                this .name = name;
124:            }
125:
126:            /**
127:             * human-readable information about the style
128:             * 
129:             * @return the title of the FeatureTypeStyle
130:             * 
131:             */
132:            public String getTitle() {
133:                return title;
134:            }
135:
136:            /**
137:             * sets the &lt;Title&gt;
138:             * 
139:             * @param title
140:             *            the title of the FeatureTypeStyle
141:             * 
142:             */
143:            public void setTitle(String title) {
144:                this .title = title;
145:            }
146:
147:            /**
148:             * human-readable information about the style
149:             * 
150:             * @return an abstract of the FeatureTypeStyle
151:             */
152:            public String getAbstract() {
153:                return abstract_;
154:            }
155:
156:            /**
157:             * sets &lt;Abstract&gt;
158:             * 
159:             * @param abstract_
160:             *            an abstract of the FeatureTypeStyle
161:             */
162:            public void setAbstract(String abstract_) {
163:                this .abstract_ = abstract_;
164:            }
165:
166:            /**
167:             * returns the name of the affected feature type
168:             * 
169:             * @return the name of the FeatureTypeStyle as String
170:             * 
171:             */
172:            public String getFeatureTypeName() {
173:                return featureTypeName;
174:            }
175:
176:            /**
177:             * sets the name of the affected feature type
178:             * 
179:             * @param featureTypeName
180:             *            the name of the FeatureTypeStyle
181:             * 
182:             */
183:            public void setFeatureTypeName(String featureTypeName) {
184:                this .featureTypeName = featureTypeName;
185:            }
186:
187:            /**
188:             * The SemanticTypeIdentifier is experimental and is intended to be used to identify what the
189:             * feature style is suitable to be used for using community- controlled name(s). For example, a
190:             * single style may be suitable to use with many different feature types. The syntax of the
191:             * SemanticTypeIdentifier string is undefined, but the strings generic:line, generic:polygon,
192:             * generic:point, generic:text, generic:raster, and generic:any are reserved to indicate that a
193:             * FeatureTypeStyle may be used with any feature type with the corresponding default geometry
194:             * type (i.e., no feature properties are referenced in the feature-type style).
195:             * 
196:             * @return the SemanticTypeIdentifiers from the FeatureTypeStyle as String-Array
197:             * 
198:             */
199:            public String[] getSemanticTypeIdentifier() {
200:                return semanticTypeIdentifier
201:                        .toArray(new String[semanticTypeIdentifier.size()]);
202:            }
203:
204:            /**
205:             * Sets the SemanticTypeIdentifiers.
206:             * 
207:             * @param semanticTypeIdentifiers
208:             *            SemanticTypeIdentifiers for the FeatureTypeStyle
209:             */
210:            public void setSemanticTypeIdentifier(
211:                    String[] semanticTypeIdentifiers) {
212:                semanticTypeIdentifier.clear();
213:
214:                if (semanticTypeIdentifiers != null) {
215:                    for (int i = 0; i < semanticTypeIdentifiers.length; i++) {
216:                        semanticTypeIdentifier.add(semanticTypeIdentifiers[i]);
217:                    }
218:                }
219:            }
220:
221:            /**
222:             * adds the &lt;SemanticTypeIdentifier&gt;
223:             * 
224:             * @param semanticTypeIdentifier
225:             *            SemanticTypeIdentifier to add
226:             */
227:            public void addSemanticTypeIdentifier(String semanticTypeIdentifier) {
228:                this .semanticTypeIdentifier.add(semanticTypeIdentifier);
229:            }
230:
231:            /**
232:             * Removes an &lt;SemanticTypeIdentifier&gt;.
233:             * 
234:             * @param semanticTypeIdentifier
235:             *            SemanticTypeIdentifier to remove
236:             */
237:            public void removeSemanticTypeIdentifier(
238:                    String semanticTypeIdentifier) {
239:                this .semanticTypeIdentifier.remove(this .semanticTypeIdentifier
240:                        .indexOf(semanticTypeIdentifier));
241:            }
242:
243:            /**
244:             * Rules are used to group rendering instructions by feature-property conditions and map scales.
245:             * Rule definitions are placed immediately inside of feature-style definitions.
246:             * 
247:             * @return the rules of the FeatureTypeStyle as Array
248:             * 
249:             */
250:            public Rule[] getRules() {
251:                return rules.toArray(new Rule[rules.size()]);
252:            }
253:
254:            /**
255:             * sets the &lt;Rules&gt;
256:             * 
257:             * @param rules
258:             *            the rules of the FeatureTypeStyle as Array
259:             */
260:            public void setRules(Rule[] rules) {
261:                this .rules.clear();
262:
263:                if (rules != null) {
264:                    for (int i = 0; i < rules.length; i++) {
265:                        this .rules.add(rules[i]);
266:                    }
267:                }
268:            }
269:
270:            /**
271:             * adds the &lt;Rules&gt;
272:             * 
273:             * @param rule
274:             *            a rule
275:             */
276:            public void addRule(Rule rule) {
277:                rules.add(rule);
278:            }
279:
280:            /**
281:             * removes a rule
282:             * 
283:             * @param rule
284:             *            a rule
285:             */
286:            public void removeRule(Rule rule) {
287:                rules.remove(rules.indexOf(rule));
288:            }
289:
290:            /**
291:             * exports the content of the FeatureTypeStyle as XML formated String
292:             * 
293:             * @return xml representation of the FeatureTypeStyle
294:             */
295:            public String exportAsXML() {
296:
297:                StringBuffer sb = new StringBuffer(1000);
298:                sb.append("<FeatureTypeStyle>");
299:                if (name != null && !name.equals("")) {
300:                    sb.append("<Name>").append(name).append("</Name>");
301:                }
302:                if (title != null && !title.equals("")) {
303:                    sb.append("<Title>").append(title).append("</Title>");
304:                }
305:                if (abstract_ != null && !abstract_.equals("")) {
306:                    sb.append("<Abstract>").append(abstract_).append(
307:                            "</Abstract>");
308:                }
309:                if (featureTypeName != null && !featureTypeName.equals("")) {
310:                    sb.append("<FeatureTypeName>").append(featureTypeName)
311:                            .append("</FeatureTypeName>");
312:                }
313:                for (int i = 0; i < semanticTypeIdentifier.size(); i++) {
314:                    sb.append("<SemanticTypeIdentifier>").append(
315:                            semanticTypeIdentifier.get(i)).append(
316:                            "</SemanticTypeIdentifier>");
317:                }
318:                for (int i = 0; i < rules.size(); i++) {
319:                    sb.append(((Marshallable) rules.get(i)).exportAsXML());
320:                }
321:                sb.append("</FeatureTypeStyle>");
322:
323:                return sb.toString();
324:            }
325:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.