001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-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; either
009: * version 2.1 of the License, or (at your option) any later version.
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.data.wms;
017:
018: import java.io.UnsupportedEncodingException;
019: import java.net.URL;
020: import java.net.URLEncoder;
021:
022: import org.geotools.data.ows.GetCapabilitiesRequest;
023:
024: /**
025: * @author rgould
026: *
027: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wms/src/main/java/org/geotools/data/wms/WMS1_3_0.java $
028: */
029: public class WMS1_3_0 extends WMS1_1_1 {
030:
031: public WMS1_3_0() {
032:
033: }
034:
035: /* (non-Javadoc)
036: * @see org.geotools.data.wms.Specification#getVersion()
037: */
038: public String getVersion() {
039: return "1.3.0";
040: }
041:
042: /* (non-Javadoc)
043: * @see org.geotools.data.wms.Specification#createGetCapabilitiesRequest(java.net.URL)
044: */
045: public GetCapabilitiesRequest createGetCapabilitiesRequest(
046: URL server) {
047: return new GetCapsRequest(server);
048: }
049:
050: public org.geotools.data.wms.request.GetMapRequest createGetMapRequest(
051: URL get) {
052: return new GetMapRequest(get);
053: }
054:
055: public static class GetCapsRequest extends WMS1_1_1.GetCapsRequest {
056:
057: public GetCapsRequest(URL urlGetCapabilities) {
058: super (urlGetCapabilities);
059: }
060:
061: /* (non-Javadoc)
062: * @see org.geotools.data.wms.request.AbstractGetCapabilitiesRequest#initVersion()
063: */
064: protected void initVersion() {
065: setProperty("VERSION", "1.3.0");
066: }
067: }
068:
069: public static class GetMapRequest extends WMS1_1_1.GetMapRequest {
070:
071: public GetMapRequest(URL onlineResource) {
072: super (onlineResource);
073: }
074:
075: protected void initVersion() {
076: setVersion("1.3.0");
077: }
078:
079: public void setFormat(String value) {
080: try {
081: value = URLEncoder.encode(value, "UTF-8");
082: } catch (UnsupportedEncodingException e) {
083: e.printStackTrace();
084: }
085: super .setFormat(value);
086: }
087: }
088:
089: public static class GetFeatureInfoRequest extends
090: WMS1_1_1.GetFeatureInfoRequest {
091:
092: public GetFeatureInfoRequest(URL onlineResource,
093: org.geotools.data.wms.request.GetMapRequest request) {
094: super (onlineResource, request);
095: }
096:
097: protected void initVersion() {
098: setProperty("VERSION", "1.3.0");
099: }
100:
101: protected String getQueryX() {
102: return "I";
103: }
104:
105: protected String getQueryY() {
106: return "J";
107: }
108: }
109:
110: public org.geotools.data.wms.request.GetFeatureInfoRequest createGetFeatureInfoRequest(
111: URL onlineResource,
112: org.geotools.data.wms.request.GetMapRequest getMapRequest) {
113: return new GetFeatureInfoRequest(onlineResource, getMapRequest);
114: }
115: }
|