svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wms / wms_1_1_0 / WMSStyle1_1_0.java @ 40559
History | View | Annotate | Download (2.57 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 | |
25 | package org.gvsig.remoteclient.wms.wms_1_1_0; |
||
26 | |||
27 | import java.io.IOException; |
||
28 | |||
29 | import org.kxml2.io.KXmlParser; |
||
30 | import org.xmlpull.v1.XmlPullParserException; |
||
31 | |||
32 | import org.gvsig.remoteclient.utils.CapabilitiesTags; |
||
33 | |||
34 | /**
|
||
35 | * <p>Represents the layer style defined by the OGC Specifications for WMS 1.1.0</p>
|
||
36 | *
|
||
37 | */
|
||
38 | public class WMSStyle1_1_0 extends org.gvsig.remoteclient.wms.WMSStyle { |
||
39 | |||
40 | /**
|
||
41 | * <p>URL pointing to the legend for a layer with this style</p>
|
||
42 | */
|
||
43 | |||
44 | /**
|
||
45 | * <p>Parses the STYLE TAG according with the OGC Specifications for the WMS 1.1.1</p>
|
||
46 | */
|
||
47 | public void parse(KXmlParser parser) throws IOException, XmlPullParserException |
||
48 | { |
||
49 | int currentTag;
|
||
50 | boolean end = false; |
||
51 | |||
52 | parser.require(KXmlParser.START_TAG, null, CapabilitiesTags.STYLE);
|
||
53 | currentTag = parser.nextTag(); |
||
54 | |||
55 | while (!end)
|
||
56 | { |
||
57 | switch(currentTag)
|
||
58 | { |
||
59 | case KXmlParser.START_TAG:
|
||
60 | if (parser.getName().compareTo(CapabilitiesTags.NAME)==0) |
||
61 | { |
||
62 | setName(parser.nextText()); |
||
63 | } |
||
64 | else if (parser.getName().compareTo(CapabilitiesTags.TITLE)==0) |
||
65 | { |
||
66 | setTitle(parser.nextText()); |
||
67 | } |
||
68 | else if (parser.getName().compareTo(CapabilitiesTags.ABSTRACT)==0) |
||
69 | { |
||
70 | setAbstract(parser.nextText()); |
||
71 | } |
||
72 | else if (parser.getName().compareTo(CapabilitiesTags.LEGENDURL)==0) |
||
73 | break;
|
||
74 | case KXmlParser.END_TAG:
|
||
75 | if (parser.getName().compareTo(CapabilitiesTags.STYLE) == 0) |
||
76 | end = true;
|
||
77 | break;
|
||
78 | case KXmlParser.TEXT:
|
||
79 | break;
|
||
80 | } |
||
81 | if (!end)
|
||
82 | { |
||
83 | currentTag = parser.next(); |
||
84 | } |
||
85 | } |
||
86 | parser.require(KXmlParser.END_TAG, null, CapabilitiesTags.STYLE);
|
||
87 | } |
||
88 | } |