Source Code Cross Referenced for LineSymbolizerImpl.java in  » GIS » GeoTools-2.4.1 » org » geotools » styling » 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 » GeoTools 2.4.1 » org.geotools.styling 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2002-2006, GeoTools Project Managment Committee (PMC)
005:         *    
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.styling;
017:
018:        // OpenGIS dependencies
019:        import org.geotools.event.AbstractGTComponent;
020:        import org.opengis.util.Cloneable;
021:
022:        /**
023:         * Provides a representation of a LineSymbolizer in an SLD Document.  A
024:         * LineSymbolizer defines how a line geometry should be rendered.
025:         *
026:         * @author James Macgill
027:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/styling/LineSymbolizerImpl.java $
028:         * @version $Id: LineSymbolizerImpl.java 20703 2006-07-24 16:57:44Z jgarnett $
029:         */
030:        public class LineSymbolizerImpl extends AbstractGTComponent implements 
031:                LineSymbolizer, Cloneable {
032:            private Stroke stroke = null;
033:            private String geometryName = null;
034:
035:            /**
036:             * Creates a new instance of DefaultLineSymbolizer
037:             */
038:            protected LineSymbolizerImpl() {
039:            }
040:
041:            /**
042:             * This property defines the geometry to be used for styling.<br>
043:             * The property is optional and if it is absent (null) then the "default"
044:             * geometry property of the feature should be used.  Geometry types other
045:             * than inherently linear types can be used.  If a point geometry is used,
046:             * it should be interpreted as a line of zero length and two end caps.  If
047:             * a polygon is used (or other "area" type) then its closed outline should
048:             * be used as the line string (with no end caps). The geometryPropertyName
049:             * is the name of a geometry property in the Feature being styled.
050:             * Typically, features only have one geometry so, in general, the need to
051:             * select one is not required. Note: this moves a little away from the SLD
052:             * spec which provides an XPath reference to a Geometry object, but does
053:             * follow it in spirit.
054:             *
055:             * @return The name of the attribute in the feature being styled  that
056:             *         should be used.  If null then the default geometry should be
057:             *         used.
058:             */
059:            public String getGeometryPropertyName() {
060:                return geometryName;
061:            }
062:
063:            /**
064:             * Sets the GeometryPropertyName.
065:             *
066:             * @param name The name of the geometryProperty.
067:             *
068:             * @see #LineSymbolizerImpl.geometryPropertyName()
069:             */
070:            public void setGeometryPropertyName(String name) {
071:                geometryName = name;
072:                fireChanged();
073:            }
074:
075:            /**
076:             * Provides the graphical-symbolization parameter to use for the linear
077:             * geometry.
078:             *
079:             * @return The Stroke style to use when rendering lines.
080:             */
081:            public Stroke getStroke() {
082:                return stroke;
083:            }
084:
085:            /**
086:             * Sets the graphical-symbolization parameter to use for the linear
087:             * geometry.
088:             *
089:             * @param stroke The Stroke style to use when rendering lines.
090:             */
091:            public void setStroke(Stroke stroke) {
092:                if (this .stroke == stroke) {
093:                    return;
094:                }
095:
096:                Stroke old = this .stroke;
097:                this .stroke = stroke;
098:                fireChildChanged("stroke", stroke, old);
099:            }
100:
101:            /**
102:             * Accepts a StyleVisitor to perform some operation on this LineSymbolizer.
103:             *
104:             * @param visitor The visitor to accept.
105:             */
106:            public void accept(StyleVisitor visitor) {
107:                visitor.visit(this );
108:            }
109:
110:            /**
111:             * Creates a deep copy clone.
112:             *
113:             * @return The deep copy clone.
114:             *
115:             * @throws RuntimeException DOCUMENT ME!
116:             */
117:            public Object clone() {
118:                LineSymbolizerImpl clone;
119:
120:                try {
121:                    clone = (LineSymbolizerImpl) super .clone();
122:
123:                    if (stroke != null) {
124:                        clone.stroke = (Stroke) stroke.clone();
125:                    }
126:                } catch (CloneNotSupportedException e) {
127:                    throw new RuntimeException(e); // this should never happen.
128:                }
129:
130:                return clone;
131:            }
132:
133:            /**
134:             * Generates a hashcode for the LineSymbolizerImpl.
135:             *
136:             * @return A hashcode.
137:             */
138:            public int hashCode() {
139:                final int PRIME = 1000003;
140:                int result = 0;
141:
142:                if (stroke != null) {
143:                    result = (PRIME * result) + stroke.hashCode();
144:                }
145:
146:                if (geometryName != null) {
147:                    result = (PRIME * result) + geometryName.hashCode();
148:                }
149:
150:                return result;
151:            }
152:
153:            /**
154:             * Compares this LineSymbolizerImpl with another for  equality.
155:             * 
156:             * <p>
157:             * Two LineSymbolizerImpls are equal if they have the same
158:             * geometryPropertyName and the same stroke.
159:             * </p>
160:             *
161:             * @param oth The other LineSymbolizerImpl
162:             *
163:             * @return True if this and oth are equal.
164:             */
165:            public boolean equals(Object oth) {
166:                if (this  == oth) {
167:                    return true;
168:                }
169:
170:                if (oth == null) {
171:                    return false;
172:                }
173:
174:                if (oth.getClass() != getClass()) {
175:                    return false;
176:                }
177:
178:                LineSymbolizerImpl other = (LineSymbolizerImpl) oth;
179:
180:                if (this .geometryName == null) {
181:                    if (other.geometryName != null) {
182:                        return false;
183:                    }
184:                } else {
185:                    if (!this .geometryName.equals(other.geometryName)) {
186:                        return false;
187:                    }
188:                }
189:
190:                if (this .stroke == null) {
191:                    if (other.stroke != null) {
192:                        return false;
193:                    }
194:                } else {
195:                    if (!this .stroke.equals(other.stroke)) {
196:                        return false;
197:                    }
198:                }
199:
200:                return true;
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.