Source Code Cross Referenced for WMSBoundingBoxImpl.java in  » GIS » geonetwork » org » wfp » vam » intermap » kernel » map » mapServices » wms » schema » impl » 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 » geonetwork » org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //=============================================================================
002:        //===	Copyright (C) 2001-2007 Food and Agriculture Organization of the
003:        //===	United Nations (FAO-UN), United Nations World Food Programme (WFP)
004:        //===	and United Nations Environment Programme (UNEP)
005:        //===
006:        //===	This program is free software; you can redistribute it and/or modify
007:        //===	it under the terms of the GNU General Public License as published by
008:        //===	the Free Software Foundation; either version 2 of the License, or (at
009:        //===	your option) any later version.
010:        //===
011:        //===	This program is distributed in the hope that it will be useful, but
012:        //===	WITHOUT ANY WARRANTY; without even the implied warranty of
013:        //===	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:        //===	General Public License for more details.
015:        //===
016:        //===	You should have received a copy of the GNU General Public License
017:        //===	along with this program; if not, write to the Free Software
018:        //===	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
019:        //===
020:        //===	Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
021:        //===	Rome - Italy. email: geonetwork@osgeo.org
022:        //==============================================================================
023:
024:        package org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.impl;
025:
026:        import org.jdom.Element;
027:        import org.wfp.vam.intermap.kernel.map.mapServices.wms.schema.type.WMSBoundingBox;
028:
029:        /**
030:         * @author ETj
031:         */
032:        public class WMSBoundingBoxImpl implements  WMSBoundingBox {
033:            private String _srs = null;
034:            private float _minx = Float.NaN;
035:            private float _miny = Float.NaN;
036:            private float _maxx = Float.NaN;
037:            private float _maxy = Float.NaN;
038:            private float _resx = Float.NaN; // opt
039:            private float _resy = Float.NaN; // opt
040:
041:            private WMSBoundingBoxImpl() {
042:            }
043:
044:            public static WMSBoundingBox newInstance() {
045:                return new WMSBoundingBoxImpl();
046:            }
047:
048:            public static WMSBoundingBox parse(Element ebb) {
049:                WMSBoundingBoxImpl bb = new WMSBoundingBoxImpl();
050:
051:                bb.setSRS(ebb.getAttributeValue("srs"));
052:                bb.setMinx(Float.parseFloat(ebb.getAttributeValue("minx")));
053:                bb.setMiny(Float.parseFloat(ebb.getAttributeValue("miny")));
054:                bb.setMaxx(Float.parseFloat(ebb.getAttributeValue("maxx")));
055:                bb.setMaxy(Float.parseFloat(ebb.getAttributeValue("maxy")));
056:
057:                String sresx = ebb.getAttributeValue("resx");
058:                if (sresx != null)
059:                    bb.setResx(Float.parseFloat(sresx));
060:
061:                String sresy = ebb.getAttributeValue("resy");
062:                if (sresy != null)
063:                    bb.setResy(Float.parseFloat(sresy));
064:
065:                return bb;
066:            }
067:
068:            /**
069:             * Sets Srs
070:             */
071:            public void setSRS(String srs) {
072:                _srs = srs;
073:            }
074:
075:            /**
076:             * Returns Srs
077:             */
078:            public String getSRS() {
079:                return _srs;
080:            }
081:
082:            /**
083:             * Sets Minx
084:             */
085:            public void setMinx(float minx) {
086:                _minx = minx;
087:            }
088:
089:            /**
090:             * Returns Minx
091:             */
092:            public float getMinx() {
093:                return _minx;
094:            }
095:
096:            /**
097:             * Sets Miny
098:             */
099:            public void setMiny(float miny) {
100:                _miny = miny;
101:            }
102:
103:            /**
104:             * Returns Miny
105:             */
106:            public float getMiny() {
107:                return _miny;
108:            }
109:
110:            /**
111:             * Sets Maxx
112:             */
113:            public void setMaxx(float maxx) {
114:                _maxx = maxx;
115:            }
116:
117:            /**
118:             * Returns Maxx
119:             */
120:            public float getMaxx() {
121:                return _maxx;
122:            }
123:
124:            /**
125:             * Sets Maxy
126:             */
127:            public void setMaxy(float maxy) {
128:                _maxy = maxy;
129:            }
130:
131:            /**
132:             * Returns Maxy
133:             */
134:            public float getMaxy() {
135:                return _maxy;
136:            }
137:
138:            /**
139:             * Sets Resx
140:             */
141:            public void setResx(float resx) {
142:                _resx = resx;
143:            }
144:
145:            /**
146:             * Returns Resx
147:             */
148:            public float getResx() {
149:                return _resx;
150:            }
151:
152:            /**
153:             * Sets Resy
154:             */
155:            public void setResy(float resy) {
156:                _resy = resy;
157:            }
158:
159:            /**
160:             * Returns Resy
161:             */
162:            public float getResy() {
163:                return _resy;
164:            }
165:
166:            /**
167:             * Method toElement
168:             */
169:            public Element toElement(String name) {
170:                if (_srs == null)
171:                    throw new IllegalStateException(name + "/SRS is missing");
172:                if (_minx == Float.NaN)
173:                    throw new IllegalStateException(name + "/minx is missing");
174:                if (_miny == Float.NaN)
175:                    throw new IllegalStateException(name + "/miny is missing");
176:                if (_maxx == Float.NaN)
177:                    throw new IllegalStateException(name + "/maxx is missing");
178:                if (_maxy == Float.NaN)
179:                    throw new IllegalStateException(name + "/maxy is missing");
180:
181:                Element ret = new Element(name).setAttribute("SRS", _srs)
182:                        .setAttribute("minx", "" + _minx).setAttribute("miny",
183:                                "" + _miny).setAttribute("maxx", "" + _maxx)
184:                        .setAttribute("maxy", "" + _maxy);
185:
186:                if (_resx != Float.NaN)
187:                    ret.setAttribute("resx", "" + _resx);
188:                if (_resy != Float.NaN)
189:                    ret.setAttribute("resy", "" + _resy);
190:
191:                return ret;
192:            }
193:
194:        }
ww_w___.ja_v__a___2_s___.___c__o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.