gvsig-raster / org.gvsig.raster.wms / trunk / org.gvsig.raster.wms / org.gvsig.raster.wms.remoteclient / src / main / java / org / gvsig / remoteclient / wms / wms_1_3_0 / WMSStyle1_3_0.java @ 3083
History | View | Annotate | Download (2.54 KB)
1 |
/**
|
---|---|
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 |
|
25 |
package org.gvsig.remoteclient.wms.wms_1_3_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.3.0</p>
|
36 |
*
|
37 |
*/
|
38 |
public class WMSStyle1_3_0 extends org.gvsig.remoteclient.wms.WMSStyle { |
39 |
|
40 |
/**
|
41 |
* <p>Parses the STYLE TAG according with the OGC Specifications for the WMS 1.3.0</p>
|
42 |
*/
|
43 |
public void parse(KXmlParser parser) throws IOException, XmlPullParserException |
44 |
{ |
45 |
int currentTag;
|
46 |
boolean end = false; |
47 |
|
48 |
parser.require(KXmlParser.START_TAG, null, CapabilitiesTags.STYLE);
|
49 |
currentTag = parser.nextTag(); |
50 |
|
51 |
while (!end)
|
52 |
{ |
53 |
switch(currentTag)
|
54 |
{ |
55 |
case KXmlParser.START_TAG:
|
56 |
if (parser.getName().compareTo(CapabilitiesTags.NAME)==0) |
57 |
{ |
58 |
setName(parser.nextText()); |
59 |
} |
60 |
else if (parser.getName().compareTo(CapabilitiesTags.TITLE)==0) |
61 |
{ |
62 |
setTitle(parser.nextText()); |
63 |
} |
64 |
else if (parser.getName().compareTo(CapabilitiesTags.ABSTRACT)==0) |
65 |
{ |
66 |
setAbstract(parser.nextText()); |
67 |
} |
68 |
else if (parser.getName().compareTo(CapabilitiesTags.LEGENDURL)==0) |
69 |
{ |
70 |
parseLegendURL( parser ); |
71 |
} |
72 |
case KXmlParser.END_TAG:
|
73 |
if (parser.getName().compareTo(CapabilitiesTags.STYLE) == 0) |
74 |
end = true;
|
75 |
break;
|
76 |
case KXmlParser.TEXT:
|
77 |
break;
|
78 |
} |
79 |
if (!end)
|
80 |
{ |
81 |
currentTag = parser.nextTag(); |
82 |
} |
83 |
} |
84 |
parser.require(KXmlParser.END_TAG, null, CapabilitiesTags.STYLE);
|
85 |
} |
86 |
|
87 |
} |