Source Code Cross Referenced for UserStyle.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/UserStyle.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:         * A user-defined allows map styling to be defined externally from a system and to be passed around
053:         * in an interoperable format.
054:         * <p>
055:         * </p>
056:         * A UserStyle is at the same semantic level as a NamedStyle used in the context of a WMS. In a
057:         * sense, a named style can be thought of as a reference to a hidden UserStyle that is stored inside
058:         * of a map server.
059:         * 
060:         * 
061:         * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
062:         * @author last edited by: $Author: apoth $
063:         * @version $Revision: 9340 $ $Date: 2007-12-27 04:32:12 -0800 (Thu, 27 Dec 2007) $
064:         */
065:        public class UserStyle extends AbstractStyle implements  Marshallable {
066:            private List<FeatureTypeStyle> featureTypeStyles = null;
067:
068:            private String abstract_ = null;
069:
070:            private String title = null;
071:
072:            private boolean default_ = false;
073:
074:            /**
075:             * constructor initializing the class with the <UserStyle>
076:             */
077:            UserStyle(String name, String title, String abstract_,
078:                    boolean default_, FeatureTypeStyle[] featureTypeStyles) {
079:                super (name);
080:
081:                this .featureTypeStyles = new ArrayList<FeatureTypeStyle>();
082:
083:                setTitle(title);
084:                setAbstract(abstract_);
085:                setDefault(default_);
086:                setFeatureTypeStyles(featureTypeStyles);
087:            }
088:
089:            /**
090:             * The Title is a human-readable short description for the style that might be displayed in a
091:             * GUI pick list.
092:             * 
093:             * @return the title of the User-AbstractStyle
094:             * 
095:             */
096:            public String getTitle() {
097:                return title;
098:            }
099:
100:            /**
101:             * sets the &lt;Title&gt;
102:             * 
103:             * @param title
104:             *            the title of the User-AbstractStyle
105:             * 
106:             */
107:            public void setTitle(String title) {
108:                this .title = title;
109:            }
110:
111:            /**
112:             * the Abstract is a more exact description that may be a few paragraphs long.
113:             * 
114:             * @return the abstract of the User-AbstractStyle
115:             */
116:            public String getAbstract() {
117:                return abstract_;
118:            }
119:
120:            /**
121:             * sets the &lt;Abstract&gt;
122:             * 
123:             * @param abstract_
124:             *            the abstract of the User-AbstractStyle
125:             */
126:            public void setAbstract(String abstract_) {
127:                this .abstract_ = abstract_;
128:            }
129:
130:            /**
131:             * The IsDefault element identifies whether a style is the default style of a layer, for use in
132:             * SLD library mode when rendering or for storing inside of a map server. The default value is
133:             * <tt>false</tt>.
134:             * 
135:             * @return true if the style ist the default style
136:             */
137:            public boolean isDefault() {
138:                return default_;
139:            }
140:
141:            /**
142:             * sets the &lt;Default&gt;
143:             * 
144:             * @param default_
145:             */
146:            public void setDefault(boolean default_) {
147:                this .default_ = default_;
148:            }
149:
150:            /**
151:             * A UserStyle can contain one or more FeatureTypeStyles which allow the rendering of features
152:             * of specific types.
153:             * <p>
154:             * </p>
155:             * The FeatureTypeStyle defines the styling that is to be applied to a single feature type of a
156:             * layer.
157:             * <p>
158:             * </p>
159:             * The FeatureTypeStyle element identifies that explicit separation in SLD between the handling
160:             * of layers and the handling of features of specific feature types. The layer concept is unique
161:             * to WMS and SLD, but features are used more generally, such as in WFS and GML, so this
162:             * explicit separation is important.
163:             * 
164:             * @return the FeatureTypeStyles of a User-AbstractStyle
165:             * 
166:             */
167:            public FeatureTypeStyle[] getFeatureTypeStyles() {
168:
169:                return featureTypeStyles
170:                        .toArray(new FeatureTypeStyle[featureTypeStyles.size()]);
171:            }
172:
173:            /**
174:             * sets the &lt;FeatureTypeStyle&gt;
175:             * 
176:             * @param featureTypeStyles
177:             *            the FeatureTypeStyles of a User-AbstractStyle
178:             */
179:            public void setFeatureTypeStyles(
180:                    FeatureTypeStyle[] featureTypeStyles) {
181:                this .featureTypeStyles.clear();
182:
183:                if (featureTypeStyles != null) {
184:                    for (int i = 0; i < featureTypeStyles.length; i++) {
185:                        addFeatureTypeStyle(featureTypeStyles[i]);
186:                    }
187:                }
188:            }
189:
190:            /**
191:             * Adds a &lt;FeatureTypeStyle&gt;
192:             * 
193:             * @param featureTypeStyle
194:             *            a FeatureTypeStyle to add
195:             */
196:            public void addFeatureTypeStyle(FeatureTypeStyle featureTypeStyle) {
197:                featureTypeStyles.add(featureTypeStyle);
198:            }
199:
200:            /**
201:             * Removes a &lt;FeatureTypeStyle&gt;
202:             */
203:            public void removeFeatureTypeStyle(FeatureTypeStyle featureTypeStyle) {
204:                if (featureTypeStyles.indexOf(featureTypeStyle) != -1) {
205:                    featureTypeStyles.remove(featureTypeStyles
206:                            .indexOf(featureTypeStyle));
207:                }
208:            }
209:
210:            /**
211:             * exports the content of the UserStyle as XML formated String
212:             * 
213:             * @return xml representation of the UserStyle
214:             */
215:            public String exportAsXML() {
216:
217:                StringBuffer sb = new StringBuffer(100);
218:                sb.append("<UserStyle>");
219:                if (name != null && !name.equals("")) {
220:                    sb.append("<Name>").append(name).append("</Name>");
221:                }
222:                if (title != null && !title.equals("")) {
223:                    sb.append("<Title>").append(title).append("</Title>");
224:                }
225:                if (abstract_ != null && !abstract_.equals("")) {
226:                    sb.append("<Abstract>").append(abstract_).append(
227:                            "</Abstract>");
228:                }
229:                if (default_) {
230:                    sb.append("<IsDefault>").append(1).append("</IsDefault>");
231:                }
232:                for (int i = 0; i < featureTypeStyles.size(); i++) {
233:                    sb.append(((Marshallable) featureTypeStyles.get(i))
234:                            .exportAsXML());
235:                }
236:                sb.append("</UserStyle>");
237:
238:                return sb.toString();
239:            }
240:
241:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.