Source Code Cross Referenced for PolygonSymbolizer.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/PolygonSymbolizer.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:
048:        /**
049:         * Used to render an interior "fill" and an outlining "stroke" for a polygon or other 2D-area
050:         * geometry. If a point or line are used, the fill is ignored and the stroke is used as described in
051:         * the LineSymbol. A missing Geometry element selects the default geometry. A missing Fill or Stroke
052:         * element means that there will be no fill or stroke plotted, respectively. The contained elements
053:         * are in the conceptual order of their being used and plotted using the "painters model", where the
054:         * Fill will be rendered first, and then the Stroke will be rendered on top of the Fill.
055:         * <p>
056:         * ----------------------------------------------------------------------
057:         * </p>
058:         * 
059:         * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
060:         * @version $Revision: 9340 $ $Date: 2007-12-27 04:32:12 -0800 (Thu, 27 Dec 2007) $
061:         */
062:
063:        public class PolygonSymbolizer extends AbstractSymbolizer implements 
064:                Marshallable {
065:
066:            private Fill fill = null;
067:
068:            private Stroke stroke = null;
069:
070:            /**
071:             * Creates a new PolygonSymbolizer object.
072:             */
073:            public PolygonSymbolizer() {
074:                super (null,
075:                        "org.deegree.graphics.displayelements.PolygonDisplayElement");
076:                setFill(new Fill());
077:
078:                Stroke stroke = new Stroke();
079:                setStroke(stroke);
080:            }
081:
082:            /**
083:             * constructor initializing the class with the <PolygonSymbolizer>
084:             */
085:            PolygonSymbolizer(Fill fill, Stroke stroke, Geometry geometry,
086:                    double min, double max) {
087:                super (geometry,
088:                        "org.deegree.graphics.displayelements.PolygonDisplayElement");
089:                setFill(fill);
090:                setStroke(stroke);
091:                setMinScaleDenominator(min);
092:                setMaxScaleDenominator(max);
093:            }
094:
095:            /**
096:             * constructor initializing the class with the <PolygonSymbolizer>
097:             */
098:            PolygonSymbolizer(Fill fill, Stroke stroke, Geometry geometry,
099:                    String responsibleClass, double min, double max) {
100:                super (geometry, responsibleClass);
101:                setFill(fill);
102:                setStroke(stroke);
103:                setMinScaleDenominator(min);
104:                setMaxScaleDenominator(max);
105:            }
106:
107:            /**
108:             * A Fill allows area geometries to be filled. There are two types of fills: solid-color and
109:             * repeated GraphicFill. In general, if a Fill element is omitted in its containing element, no
110:             * fill will be rendered. The default is a solid 50%-gray (color "#808080") opaque fill.
111:             * 
112:             * @return the fill of the polygon
113:             */
114:            public Fill getFill() {
115:                return fill;
116:            }
117:
118:            /**
119:             * sets the <Fill>
120:             * 
121:             * @param fill
122:             *            the fill of the polygon
123:             */
124:            public void setFill(Fill fill) {
125:                this .fill = fill;
126:            }
127:
128:            /**
129:             * A Stroke allows a string of line segments (or any linear geometry) to be rendered. There are
130:             * three basic types of strokes: solid Color, GraphicFill (stipple), and repeated GraphicStroke.
131:             * A repeated graphic is plotted linearly and has its graphic symbol bended around the curves of
132:             * the line string. The default is a solid black line (Color "#000000").
133:             * 
134:             * @return the stroke of the polygon
135:             */
136:            public Stroke getStroke() {
137:                return stroke;
138:            }
139:
140:            /**
141:             * sets the <Stroke>
142:             * 
143:             * @param stroke
144:             *            the stroke of the polygon
145:             */
146:            public void setStroke(Stroke stroke) {
147:                this .stroke = stroke;
148:            }
149:
150:            /**
151:             * Produces a textual representation of this object.
152:             * 
153:             * @return the textual representation
154:             */
155:            public String toString() {
156:                StringBuffer sb = new StringBuffer();
157:                sb.append("scale constraint:  >=" + minDenominator + " AND <"
158:                        + maxDenominator + "\n");
159:                sb.append("<PolygonSymbolizer>\n");
160:
161:                if (getGeometry() != null) {
162:                    sb.append(getGeometry()).append("\n");
163:                }
164:
165:                if (getFill() != null) {
166:                    sb.append(getFill()).append("\n");
167:                }
168:
169:                if (getStroke() != null) {
170:                    sb.append(getStroke()).append("\n");
171:                }
172:
173:                sb.append("</PolygonSymbolizer>\n");
174:
175:                return sb.toString();
176:            }
177:
178:            /**
179:             * exports the content of the PolygonSymbolizer as XML formated String
180:             * 
181:             * @return xml representation of the PolygonSymbolizer
182:             */
183:            public String exportAsXML() {
184:
185:                StringBuffer sb = new StringBuffer(1000);
186:                sb.append("<PolygonSymbolizer>");
187:                if (geometry != null) {
188:                    sb.append(((Marshallable) geometry).exportAsXML());
189:                }
190:                if (fill != null) {
191:                    sb.append(((Marshallable) fill).exportAsXML());
192:                }
193:                if (stroke != null) {
194:                    sb.append(((Marshallable) stroke).exportAsXML());
195:                }
196:                sb.append("</PolygonSymbolizer>");
197:
198:                return sb.toString();
199:            }
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.