Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.ogc / org.gvsig.raster.wmts.ogc.impl / src / main / java / org / gvsig / raster / wmts / ogc / impl / base / WMTSStatusImpl.java @ 1809

History | View | Annotate | Download (5.19 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
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 2
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
*/
22
package org.gvsig.raster.wmts.ogc.impl.base;
23

    
24
import java.util.ArrayList;
25
import java.util.List;
26

    
27
import org.gvsig.raster.wmts.ogc.WMTSStatus;
28
import org.gvsig.raster.wmts.ogc.impl.Tags;
29
import org.gvsig.raster.wmts.ogc.impl.struct.WMTSTileMatrixImpl.InternalTileImpl;
30
import org.gvsig.raster.wmts.ogc.struct.WMTSTile;
31

    
32
/**
33
 * Describes the status of a WMTSclient, so it adds to the Remote client status
34
 * a list of layers, a list of layer styles, the extent of the map.
35
 * 
36
 * @author Nacho Brodin (nachobrodin@gmail.com)
37
 */
38
public class WMTSStatusImpl implements WMTSStatus {
39
        // width and heigh of the map
40
    private int        width;
41
    private int        height;
42
    //format of the image to be retrieved
43
    private String     format;
44
    // spatial reference system of the image to be retrieved
45
    private String     srs;
46
    // exception format, to be retrieved in case of error
47
    private String     exceptionFormat;
48
    //To set if the client has to use GET or POST
49
        private int        protocol = Tags.PROTOCOL_UNDEFINED;
50
        private String     layer          = null;
51
        private String     style          = null;
52
        private String     tileMatrixSet  = null;
53
        private String     tileMatrix     = null;
54
        private int        tileCol        = -1;
55
        private int        tileRow        = -1;
56
        private List<WMTSTile> tileList       = null;
57
        private String     infoFormat     = null;
58
        private int        level          = -1;
59
        
60
        public int getWidth() {        
61
        return width;
62
    }
63
    
64
    public void setWidth(int _width) {        
65
            width = _width;
66
    } 
67

    
68
    public int getHeight() {                
69
        return height;
70
    } 
71
    public void setHeight(int _height) {        
72
        height = _height;
73
    } 
74

    
75
    public String getFormat() {        
76
        return format;
77
    }
78
    
79
    public void setFormat(String _format) {        
80
        format = _format;
81
    } 
82
    
83
    public String getSrs() {        
84
        return srs;
85
    } 
86

    
87
    public void setSrs(String _srs) {        
88
        srs = _srs;
89
    } 
90

    
91
    public void setExceptionFormat(String _format) {        
92
        exceptionFormat = _format;
93
    } 
94
    
95
    public String getExceptionFormat() {        
96
        return exceptionFormat;
97
    }
98
    
99
    /**
100
         * @return the protocol
101
         */
102
        public int getProtocol() {
103
                return protocol;
104
        }
105

    
106
        /**
107
         * @param protocol the protocol to set
108
         */
109
        public void setProtocol(int protocol) {
110
                this.protocol = protocol;
111
        }
112

    
113
        public String getLayer() {
114
                return layer;
115
        }
116

    
117
        public String getStyle() {
118
                return style;
119
        }
120

    
121
        public String getTileMatrixSet() {
122
                return tileMatrixSet;
123
        }
124

    
125
        public String getTileMatrix() {
126
                return tileMatrix;
127
        }
128

    
129
        public int getTileRow() {
130
                return tileRow;
131
        }
132

    
133
        public int getTileCol() {
134
                return tileCol;
135
        }
136

    
137
        public void setLayer(String layer) {
138
                this.layer = layer;
139
        }
140

    
141
        public void setStyle(String style) {
142
                this.style = style;
143
        }
144

    
145
        public void setTileMatrixSet(String tileMatrixSet) {
146
                this.tileMatrixSet = tileMatrixSet;
147
        }
148

    
149
        public void setTileMatrix(String tileMatrix) {
150
                this.tileMatrix = tileMatrix;
151
        }
152

    
153
        public void setTileCol(int tileCol) {
154
                this.tileCol = tileCol;
155
        }
156

    
157
        public void setTileRow(int tileRow) {
158
                this.tileRow = tileRow;
159
        }
160

    
161
        public List<WMTSTile> getTileList() {
162
                return tileList;
163
        }
164

    
165
        public void setTileList(List<WMTSTile> tileList) {
166
                this.tileList = tileList;
167
        }
168
        
169
    public String getInfoFormat() {        
170
        return this.infoFormat;
171
    } 
172
    
173
    public void setInfoFormat(String format) {        
174
            this.infoFormat = format;
175
    }
176
    
177
    public int getLevel() {
178
                return level;
179
        }
180

    
181
        public void setLevel(int level) {
182
                this.level = level;
183
        }
184
    
185
    public WMTSStatusImpl cloneStatus() {
186
            WMTSStatusImpl status     = new WMTSStatusImpl();
187
            status.layer          = layer;
188
            status.style          = style;
189
            status.tileMatrixSet  = tileMatrixSet;
190
            status.tileMatrix     = tileMatrix;
191
            status.tileCol        = tileCol;
192
            status.tileRow        = tileRow;
193
            status.tileList       = new ArrayList<WMTSTile>();
194
            for (int i = 0; i < tileList.size(); i++) {
195
                        WMTSTile t = ((InternalTileImpl)tileList.get(i)).cloneTile();
196
                        status.tileList.add(t);
197
                }
198
            status.infoFormat     = infoFormat;
199
            status.setFormat(getFormat());
200
            status.setWidth(getWidth());
201
            status.setHeight(getHeight());
202
            status.setSrs(getSrs());
203
            status.setInfoFormat(getInfoFormat());
204
            return status;
205
    }
206
}