Source Code Cross Referenced for LegendURLDTO.java in  » GIS » GeoServer » org » vfny » geoserver » global » dto » 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 » GeoServer » org.vfny.geoserver.global.dto 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* This code is licensed under the GPL 2.0 license, availible at the root
002:         * application directory.
003:         */
004:        package org.vfny.geoserver.global.dto;
005:
006:        /**
007:         * Data Transfer Object for legend information.
008:         *
009:         * <p>
010:         * Defines the legend icon to be associated with a FeatureType.
011:         * </p>
012:         *
013:         * <p>
014:         * <pre>
015:         * Example:<code>
016:         * LegendDTO legend = new LegendDTO();
017:         * legend.setOnlineResource("http://www.myserver.org/legends/legend1.png");
018:         * legend.setWidth(72);
019:         * legend.setHeight(72);
020:         * legend.setFormat("image/png");
021:         * </code>
022:         *  </pre>
023:         * </p>
024:         *
025:         * @author Charles Kolbowicz, Institut de Recherche pour le D�veloppement
026:         *         (IRD), 2004
027:         * @version $Id: LegendURLDTO.java 6177 2007-02-19 10:11:27Z aaime $
028:         */
029:        public final class LegendURLDTO implements  DataTransferObject {
030:            /** The legend icon width. */
031:            private int width;
032:
033:            /** The legend icon height. */
034:            private int height;
035:
036:            /** The legend icon format; */
037:            private String format;
038:
039:            /** The legend icon location. */
040:            private String onlineResource;
041:
042:            /**
043:             * LegendConfig constructor.
044:             *
045:             * <p>
046:             * does nothing
047:             * </p>
048:             */
049:            public LegendURLDTO() {
050:            }
051:
052:            /**
053:             * LegendConfig constructor.
054:             *
055:             * <p>
056:             * Creates a copy of the LegendConfig provided. If the LegendConfig
057:             * provided is null then default values are used. All the data structures
058:             * are cloned.
059:             * </p>
060:             *
061:             * @param legend The legend to copy.
062:             *
063:             * @throws NullPointerException DOCUMENT ME!
064:             */
065:            public LegendURLDTO(LegendURLDTO legend) {
066:                if (legend == null) {
067:                    throw new NullPointerException();
068:                }
069:
070:                format = legend.getFormat();
071:                width = legend.getWidth();
072:                height = legend.getHeight();
073:                onlineResource = legend.getOnlineResource();
074:            }
075:
076:            /**
077:             * Implement clone.
078:             *
079:             * <p>
080:             * creates a clone of this object
081:             * </p>
082:             *
083:             * @return A copy of this LegendURLDTO
084:             *
085:             * @see java.lang.Object#clone()
086:             */
087:            public Object clone() {
088:                return new LegendURLDTO(this );
089:            }
090:
091:            /**
092:             * Implement equals.
093:             *
094:             * <p>
095:             * recursively tests to determine if the object passed in is a copy of this
096:             * object.
097:             * </p>
098:             *
099:             * @param obj The LegendURLDTO object to test.
100:             *
101:             * @return true when the object passed is the same as this object.
102:             *
103:             * @see java.lang.Object#equals(java.lang.Object)
104:             */
105:            public boolean equals(Object obj) {
106:                if ((obj == null) || !(obj instanceof  LegendURLDTO)) {
107:                    return false;
108:                }
109:
110:                LegendURLDTO legend = (LegendURLDTO) obj;
111:                boolean r = true;
112:                r = r && (width == legend.getWidth());
113:
114:                r = r && (height == legend.getHeight());
115:
116:                r = r && (format.equals(legend.getFormat()));
117:
118:                r = r && (onlineResource.equals(legend.getOnlineResource()));
119:
120:                return r;
121:            }
122:
123:            /**
124:             * Implement hashCode.
125:             *
126:             * @return Service hashcode or 0
127:             *
128:             * @see java.lang.Object#hashCode()
129:             */
130:            public int hashCode() {
131:                int r = 1;
132:
133:                r *= (width * height);
134:
135:                if (format != null) {
136:                    r *= format.hashCode();
137:                }
138:
139:                if (onlineResource != null) {
140:                    r *= onlineResource.hashCode();
141:                }
142:
143:                return r;
144:            }
145:
146:            public String toString() {
147:                return "LegendURL [" + width + ", " + height + "] - Type : "
148:                        + format + " -  Location : " + onlineResource + "\n";
149:            }
150:
151:            /**
152:             * Getter for legend icon width.
153:             *
154:             * @return Value of legend icon width;
155:             */
156:            public int getWidth() {
157:                return this .width;
158:            }
159:
160:            /**
161:             * Setter for legend icon width.
162:             *
163:             * @param width New value of legend icon width.
164:             */
165:            public void setWidth(int width) {
166:                this .width = width;
167:            }
168:
169:            /**
170:             * Getter for legend icon height.
171:             *
172:             * @return Value of legend icon height.
173:             */
174:            public int getHeight() {
175:                return this .height;
176:            }
177:
178:            /**
179:             * Setter for legend icon height.
180:             *
181:             * @param height New value of legend icon height.
182:             */
183:            public void setHeight(int height) {
184:                this .height = height;
185:            }
186:
187:            /**
188:             * Getter for legend icon format.
189:             *
190:             * @return Value of legend icon format.
191:             */
192:            public String getFormat() {
193:                return this .format;
194:            }
195:
196:            /**
197:             * Setter for legend icon format.
198:             *
199:             * @param format New value of legend icon format.
200:             */
201:            public void setFormat(String format) {
202:                this .format = format;
203:            }
204:
205:            /**
206:             * Getter for property onlineResource.
207:             *
208:             * @return Value of property onlineResource.
209:             */
210:            public String getOnlineResource() {
211:                return this .onlineResource;
212:            }
213:
214:            /**
215:             * Setter for legend icon onlineResource.
216:             *
217:             * @param onlineResource New value of legend icon onlineResource.
218:             */
219:            public void setOnlineResource(String onlineResource) {
220:                this.onlineResource = onlineResource;
221:            }
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.