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 @ 2613

History | View | Annotate | Download (5.88 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.HashMap;
26
import java.util.List;
27

    
28
import org.gvsig.raster.wmts.ogc.WMTSStatus;
29
import org.gvsig.raster.wmts.ogc.impl.Tags;
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             = 0;
41
    private int            height            = 0;
42
    private String         format            = null;
43
    private String         srs               = null;
44
    private String         exceptionFormat   = null;
45
        private int            protocol          = Tags.PROTOCOL_UNDEFINED;
46
        private String         layer             = null;
47
        private String         style             = null;
48
        private String         tileMatrixSet     = null;
49
        private String         tileMatrix        = null;
50
        private int            tileCol           = -1;
51
        private int            tileRow           = -1;
52
        private List<WMTSTile> tileList          = null;
53
        private String         infoFormat        = null;
54
        private int            level             = -1;
55
        private HashMap<String , String>
56
                               resourceURL       = new HashMap<String, String>();
57
        private String         dimension         = null;
58
        private String         valueForDimension = null;
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
    public String getDimension() {
100
                return dimension;
101
        }
102

    
103
        public void setDimension(String dimension) {
104
                this.dimension = dimension;
105
        }
106

    
107
        public String getValueForDimension() {
108
                return valueForDimension;
109
        }
110

    
111
        public void setValueForDimension(String valueForDimension) {
112
                this.valueForDimension = valueForDimension;
113
        }
114
    
115
    /**
116
         * @return the protocol
117
         */
118
        public int getProtocol() {
119
                return protocol;
120
        }
121

    
122
        /**
123
         * @param protocol the protocol to set
124
         */
125
        public void setProtocol(int protocol) {
126
                this.protocol = protocol;
127
        }
128

    
129
        public String getLayer() {
130
                return layer;
131
        }
132

    
133
        public String getStyle() {
134
                return style;
135
        }
136

    
137
        public String getTileMatrixSet() {
138
                return tileMatrixSet;
139
        }
140

    
141
        public String getTileMatrix() {
142
                return tileMatrix;
143
        }
144

    
145
        public int getTileRow() {
146
                return tileRow;
147
        }
148

    
149
        public int getTileCol() {
150
                return tileCol;
151
        }
152

    
153
        public void setLayer(String layer) {
154
                this.layer = layer;
155
        }
156

    
157
        public void setStyle(String style) {
158
                this.style = style;
159
        }
160

    
161
        public void setTileMatrixSet(String tileMatrixSet) {
162
                this.tileMatrixSet = tileMatrixSet;
163
        }
164

    
165
        public void setTileMatrix(String tileMatrix) {
166
                this.tileMatrix = tileMatrix;
167
        }
168

    
169
        public void setTileCol(int tileCol) {
170
                this.tileCol = tileCol;
171
        }
172

    
173
        public void setTileRow(int tileRow) {
174
                this.tileRow = tileRow;
175
        }
176

    
177
        public List<WMTSTile> getTileList() {
178
                return tileList;
179
        }
180

    
181
        public void setTileList(List<WMTSTile> tileList) {
182
                this.tileList = tileList;
183
        }
184
        
185
    public String getInfoFormat() {        
186
        return this.infoFormat;
187
    } 
188
    
189
    public void setInfoFormat(String format) {        
190
            this.infoFormat = format;
191
    }
192
    
193
    public int getLevel() {
194
                return level;
195
        }
196

    
197
        public void setLevel(int level) {
198
                this.level = level;
199
        }
200
        
201
        public String getResourceURL(String key) {
202
                return resourceURL.get(key);
203
        }
204
        
205
        public void addResourceURL(String key, String url) {
206
                resourceURL.put(key, url);
207
        }
208
    
209
    public WMTSStatusImpl cloneStatus() {
210
            WMTSStatusImpl status     = new WMTSStatusImpl();
211
            status.layer          = layer;
212
            status.style          = style;
213
            status.tileMatrixSet  = tileMatrixSet;
214
            status.tileMatrix     = tileMatrix;
215
            status.tileCol        = tileCol;
216
            status.tileRow        = tileRow;
217
            status.tileList       = new ArrayList<WMTSTile>();
218
            for (int i = 0; i < tileList.size(); i++) {
219
                        WMTSTile t = tileList.get(i).cloneTile();
220
                        status.tileList.add(t);
221
                }
222
            if(resourceURL != null) {
223
                    status.resourceURL = (HashMap<String, String>)resourceURL.clone();
224
            }
225
            status.infoFormat     = infoFormat;
226
            status.setFormat(getFormat());
227
            status.setWidth(getWidth());
228
            status.setHeight(getHeight());
229
            status.setSrs(getSrs());
230
            status.setInfoFormat(getInfoFormat());
231
            return status;
232
    }
233
        
234
}