svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wms / request / WMSGetLegendGraphicRequest.java @ 40769
History | View | Annotate | Download (2.74 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 3
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | 40435 | jjdelcerro | package org.gvsig.remoteclient.wms.request; |
25 | |||
26 | import org.gvsig.remoteclient.utils.CapabilitiesTags; |
||
27 | import org.gvsig.remoteclient.wms.WMSProtocolHandler; |
||
28 | import org.gvsig.remoteclient.wms.WMSStatus; |
||
29 | |||
30 | /**
|
||
31 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
32 | */
|
||
33 | public abstract class WMSGetLegendGraphicRequest extends WMSRequest { |
||
34 | protected String layerName = null; |
||
35 | |||
36 | public WMSGetLegendGraphicRequest(WMSStatus status, WMSProtocolHandler protocolHandler, String layerName) { |
||
37 | super(status, protocolHandler);
|
||
38 | this.layerName = layerName;
|
||
39 | } |
||
40 | |||
41 | /*
|
||
42 | * (non-Javadoc)
|
||
43 | * @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getHttpPostRequest(java.lang.String)
|
||
44 | */
|
||
45 | protected String getHttpPostRequest(String onlineResource) { |
||
46 | // TODO Auto-generated method stub
|
||
47 | return null; |
||
48 | } |
||
49 | |||
50 | /*
|
||
51 | * (non-Javadoc)
|
||
52 | * @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getOperationCode()
|
||
53 | */
|
||
54 | protected String getOperationName() { |
||
55 | return CapabilitiesTags.GETLEGENDGRAPHIC;
|
||
56 | } |
||
57 | |||
58 | /*
|
||
59 | * (non-Javadoc)
|
||
60 | * @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getTempFilePrefix()
|
||
61 | */
|
||
62 | protected String getTempFilePrefix() { |
||
63 | String format = status.getFormat();
|
||
64 | if (format == null){ |
||
65 | return "wms_getLegendGraphic.xml"; |
||
66 | } |
||
67 | if (format.indexOf("png") >= 0){ |
||
68 | return "wms_getLegendGraphic.png"; |
||
69 | } |
||
70 | if (format.indexOf("xml") >= 0){ |
||
71 | return "wms_getLegendGraphic.xml"; |
||
72 | } |
||
73 | if (format.indexOf("gif") >= 0){ |
||
74 | return "wms_getLegendGraphic.gif"; |
||
75 | } |
||
76 | if (format.indexOf("tif") >= 0){ |
||
77 | return "wms_getLegendGraphic.tif"; |
||
78 | } |
||
79 | if (format.indexOf("bmp") >= 0){ |
||
80 | return "wms_getLegendGraphic.bmp"; |
||
81 | } |
||
82 | if (format.indexOf("jpg") >= 0 |
||
83 | || format.indexOf("jpeg") >= 0){ |
||
84 | return "wms_getLegendGraphic.jpg"; |
||
85 | } |
||
86 | return "wms_getLegendGraphic.xml"; |
||
87 | } |
||
88 | } |