svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wmts / wmts_1_0_0 / struct / WMTSStyle_1_0_0.java @ 37808
History | View | Annotate | Download (2.83 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.remoteclient.wmts.wmts_1_0_0.struct; |
23 |
|
24 |
import java.io.IOException; |
25 |
|
26 |
import org.gvsig.remoteclient.utils.CapabilitiesTags; |
27 |
import org.gvsig.remoteclient.wmts.struct.WMTSLegendURL; |
28 |
import org.gvsig.remoteclient.wmts.struct.WMTSStyle; |
29 |
import org.kxml2.io.KXmlParser; |
30 |
import org.xmlpull.v1.XmlPullParserException; |
31 |
|
32 |
/**
|
33 |
* <p>Defines a OGC style. Theme that describes the appeareance of certain layer.</p>
|
34 |
*
|
35 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
36 |
*/
|
37 |
public class WMTSStyle_1_0_0 extends WMTSStyle { |
38 |
|
39 |
public WMTSLegendURL getLegendURL() {
|
40 |
if(legendURL == null) |
41 |
legendURL = new WMTSLegendURL_1_0_0();
|
42 |
return legendURL;
|
43 |
} |
44 |
|
45 |
/**
|
46 |
* Parses the layer's style
|
47 |
* @param parser
|
48 |
* @param style
|
49 |
* @throws IOException
|
50 |
* @throws XmlPullParserException
|
51 |
*/
|
52 |
public void parse(KXmlParser parser) throws IOException, XmlPullParserException { |
53 |
int currentTag;
|
54 |
boolean end = false; |
55 |
|
56 |
currentTag = parser.next(); |
57 |
|
58 |
while (!end) {
|
59 |
switch(currentTag) {
|
60 |
case KXmlParser.START_TAG:
|
61 |
if (compareName(parser, CapabilitiesTags.WMTS_IDENTIFIER)) {
|
62 |
setIdentifier(nextText(parser)); |
63 |
} else if (compareName(parser, CapabilitiesTags.WMTS_TITLE)) { |
64 |
setTitle(nextText(parser)); |
65 |
} else if (compareName(parser, CapabilitiesTags.WMTS_ABSTRACT)) { |
66 |
setAbstract(nextText(parser)); |
67 |
} else if (compareName(parser, CapabilitiesTags.WMTS_KEYWORDS)) { |
68 |
parser.skipSubTree(); |
69 |
} else if (compareName(parser, CapabilitiesTags.WMTS_LEGENDURL)) { |
70 |
getLegendURL().parse(parser); |
71 |
} else if (compareName(parser, CapabilitiesTags.WMTS_ISDEFAULT)) { |
72 |
Boolean b = new Boolean(nextText(parser)); |
73 |
setDefault(b.booleanValue()); |
74 |
} |
75 |
break;
|
76 |
case KXmlParser.END_TAG:
|
77 |
if (compareName(parser, CapabilitiesTags.WMTS_STYLE))
|
78 |
end = true;
|
79 |
break;
|
80 |
case KXmlParser.TEXT:
|
81 |
break;
|
82 |
} |
83 |
if (!end)
|
84 |
currentTag = parser.next(); |
85 |
} |
86 |
} |
87 |
} |