root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / GPEContentHandlerTest.java @ 11203
History | View | Annotate | Download (5.32 KB)
1 |
package org.gvsig.gpe; |
---|---|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
3 |
*
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* Generalitat Valenciana
|
23 |
* Conselleria d'Infraestructures i Transport
|
24 |
* Av. Blasco Ib??ez, 50
|
25 |
* 46010 VALENCIA
|
26 |
* SPAIN
|
27 |
*
|
28 |
* +34 963862235
|
29 |
* gvsig@gva.es
|
30 |
* www.gvsig.gva.es
|
31 |
*
|
32 |
* or
|
33 |
*
|
34 |
* IVER T.I. S.A
|
35 |
* Salamanca 50
|
36 |
* 46005 Valencia
|
37 |
* Spain
|
38 |
*
|
39 |
* +34 963163400
|
40 |
* dac@iver.es
|
41 |
*/
|
42 |
/* CVS MESSAGES:
|
43 |
*
|
44 |
* $Id: GPEContentHandlerTest.java 11203 2007-04-13 13:14:55Z jorpiell $
|
45 |
* $Log$
|
46 |
* Revision 1.2 2007-04-13 13:14:55 jorpiell
|
47 |
* Created the base tests and add some methods to the content handler
|
48 |
*
|
49 |
* Revision 1.1 2007/04/12 17:06:42 jorpiell
|
50 |
* First GML writing tests
|
51 |
*
|
52 |
*
|
53 |
*/
|
54 |
/**
|
55 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
56 |
*/
|
57 |
public class GPEContentHandlerTest extends GPEContentHandler{ |
58 |
private String tab = ""; |
59 |
|
60 |
public Object startLayer(Object parent, Object bBox, String id, |
61 |
String name, String description,String srs) { |
62 |
System.out.print(tab + "Start Layer: " + name + "\n"); |
63 |
tab = tab + "\t";
|
64 |
return null; |
65 |
} |
66 |
|
67 |
public void endLayer(Object layer) { |
68 |
tab = tab.substring(0, tab.length()-1); |
69 |
System.out.print(tab + "End Layer\n"); |
70 |
|
71 |
} |
72 |
|
73 |
public void addNameToLayer(Object layer,String name){ |
74 |
System.out.print(tab + "Layer name changed: " + name + "\n"); |
75 |
} |
76 |
|
77 |
public void addDescriptionToLayer(Object layer,String description){ |
78 |
System.out.print(tab + "Layer description changed: " + description + "\n"); |
79 |
} |
80 |
|
81 |
public Object startElement(Object parent, String name, Object value, |
82 |
Object type) {
|
83 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
84 |
return null; |
85 |
} |
86 |
|
87 |
public void endElement(Object element) { |
88 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
89 |
|
90 |
} |
91 |
|
92 |
public Object startBbox(double[] x, double[] y, double[] z, String id, |
93 |
String srs) {
|
94 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
95 |
return null; |
96 |
} |
97 |
|
98 |
public void endBbox(Object bbox) { |
99 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
100 |
|
101 |
} |
102 |
|
103 |
public Object startPoint(double x, double y, double z, String id, String srs) { |
104 |
System.out.print(tab + "Start Point, SRS:" + srs + "\n"); |
105 |
tab = tab + "\t";
|
106 |
System.out.print(tab + x + "," + y + "," + z + "\n"); |
107 |
tab = tab.substring(0, tab.length()-1); |
108 |
return null; |
109 |
} |
110 |
|
111 |
public void endPoint(Object point) { |
112 |
System.out.print(tab + "End Point\n"); |
113 |
} |
114 |
|
115 |
public Object startLineString(double[] x, double[] y, double[] z, String id, |
116 |
String srs) {
|
117 |
System.out.print(tab + "Start LineString, SRS:" + srs + "\n"); |
118 |
tab = tab + "\t";
|
119 |
for (int i=0 ; i<x.length ; i++){ |
120 |
System.out.print(tab + x[i] + "," + y[i] + "," + z[i] + "\n"); |
121 |
} |
122 |
tab = tab.substring(0, tab.length()-1); |
123 |
return null; |
124 |
} |
125 |
|
126 |
public void endLineString(Object line) { |
127 |
System.out.print(tab + "End LineString:\n"); |
128 |
} |
129 |
|
130 |
public Object startLinearRing(double[] x, double[] y, double[] z, String id, |
131 |
String srs) {
|
132 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
133 |
return null; |
134 |
} |
135 |
|
136 |
public void endLinearRing(Object linearRing) { |
137 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
138 |
|
139 |
} |
140 |
|
141 |
public Object startPolygon(double[] x, double[] y, double[] z, String id, |
142 |
String srs) {
|
143 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
144 |
return null; |
145 |
} |
146 |
|
147 |
public void endPolygon(Object polygon) { |
148 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
149 |
|
150 |
} |
151 |
|
152 |
public void addInnerBoundary(Object polygon, Object linearRing) { |
153 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
154 |
|
155 |
} |
156 |
|
157 |
public void addOuterBoundary(Object polygon, Object linearRing) { |
158 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
159 |
|
160 |
} |
161 |
|
162 |
public boolean isViewInBox(Object bbox, Object view) { |
163 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
164 |
return false; |
165 |
} |
166 |
|
167 |
public boolean isGeometryInBox(Object bbox, Object geometry) { |
168 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
169 |
return false; |
170 |
} |
171 |
|
172 |
public void addFeature(Object layer, Object feature) { |
173 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
174 |
|
175 |
} |
176 |
|
177 |
public void addBbox(Object item, Object bbox) { |
178 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
179 |
|
180 |
} |
181 |
|
182 |
public void addElement(Object feature, Object element) { |
183 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
184 |
|
185 |
} |
186 |
|
187 |
public void addGeometry(Object feature, Object geometry) { |
188 |
// TODO Ap?ndice de m?todo generado autom?ticamente
|
189 |
|
190 |
} |
191 |
|
192 |
public Object startFeature(String name, String id) { |
193 |
System.out.print(tab + "Start Feature: " + name + "\n"); |
194 |
return null; |
195 |
} |
196 |
|
197 |
public void addNameToFeature(Object feature, String name){ |
198 |
System.out.print(tab + "Feature name changed: " + name + "\n"); |
199 |
} |
200 |
|
201 |
public void endFeature(Object feature) { |
202 |
System.out.print(tab + "End Feature\n"); |
203 |
} |
204 |
|
205 |
} |
206 |
|