Revision 1848
branches/Fmap_GisPlanet/libraries/libFMap/.classpath | ||
---|---|---|
18 | 18 |
<classpathentry kind="lib" path="lib/wmsclient.jar"/> |
19 | 19 |
<classpathentry kind="lib" path="lib/postgis-jdbc-driver.jar"/> |
20 | 20 |
<classpathentry kind="lib" path="lib/postgresql-74.213.jar"/> |
21 |
<classpathentry kind="lib" path="lib/mysql-connector-java-3.1.7-bin.jar"/> |
|
22 | 21 |
<classpathentry kind="output" path="bin"/> |
23 | 22 |
</classpath> |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/FMap.java | ||
---|---|---|
514 | 514 |
* Devuelve el XMLEntity. |
515 | 515 |
* |
516 | 516 |
* @return XMLEntity. |
517 |
* @throws XMLException |
|
517 | 518 |
*/ |
518 |
public XMLEntity getXMLEntity() { |
|
519 |
public XMLEntity getXMLEntity() throws XMLException {
|
|
519 | 520 |
XMLEntity xml = new XMLEntity(); |
520 | 521 |
xml.putProperty("className",this.getClass().getName()); |
521 | 522 |
xml.addChild(viewPort.getXMLEntity()); |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/LegendFactory.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.rendering; |
42 | 42 |
|
43 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
43 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
|
44 | 44 |
|
45 | 45 |
import com.iver.cit.gvsig.fmap.core.FShape; |
46 | 46 |
import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/VectorialUniqueValueLegend.java | ||
---|---|---|
300 | 300 |
} else { |
301 | 301 |
return getDefaultSymbol(); |
302 | 302 |
} |
303 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
303 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
304 | 304 |
throw new DriverException(e); |
305 | 305 |
} |
306 | 306 |
} |
... | ... | |
420 | 420 |
ds.start(); |
421 | 421 |
fieldId = ds.getFieldIndexByName(fieldName); |
422 | 422 |
ds.stop(); |
423 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
423 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
424 | 424 |
throw new DriverException(e); |
425 | 425 |
} |
426 | 426 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/VectorialIntervalLegend.java | ||
---|---|---|
162 | 162 |
} else { |
163 | 163 |
return getDefaultSymbol(); |
164 | 164 |
} |
165 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
165 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
166 | 166 |
throw new DriverException(e); |
167 | 167 |
} |
168 | 168 |
} |
... | ... | |
395 | 395 |
ds.start(); |
396 | 396 |
fieldId = ds.getFieldIndexByName(fieldName); |
397 | 397 |
ds.stop(); |
398 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
398 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
399 | 399 |
throw new DriverException(e); |
400 | 400 |
} |
401 | 401 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dgn/DgnMemoryDriver.java | ||
---|---|---|
50 | 50 |
*/ |
51 | 51 |
package com.iver.cit.gvsig.fmap.drivers.dgn; |
52 | 52 |
|
53 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
54 |
import com.hardcode.gdbms.engine.data.ReadDriver; |
|
53 |
import java.awt.Color; |
|
54 |
import java.awt.Font; |
|
55 |
import java.awt.geom.AffineTransform; |
|
56 |
import java.awt.geom.Arc2D; |
|
57 |
import java.io.File; |
|
58 |
import java.io.IOException; |
|
59 |
import java.util.ArrayList; |
|
60 |
|
|
61 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
62 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver; |
|
55 | 63 |
import com.hardcode.gdbms.engine.values.IntValue; |
56 | 64 |
import com.hardcode.gdbms.engine.values.Value; |
57 | 65 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
58 |
|
|
59 | 66 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
60 | 67 |
import com.iver.cit.gvsig.fmap.core.FPoint3D; |
61 | 68 |
import com.iver.cit.gvsig.fmap.core.FPolygon2D; |
... | ... | |
70 | 77 |
import com.iver.cit.gvsig.fmap.rendering.Legend; |
71 | 78 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
72 | 79 |
import com.iver.cit.gvsig.fmap.rendering.VectorialUniqueValueLegend; |
73 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
|
74 | 80 |
|
75 |
import java.awt.BasicStroke; |
|
76 |
import java.awt.Color; |
|
77 |
import java.awt.Font; |
|
78 |
import java.awt.Graphics2D; |
|
79 |
import java.awt.Paint; |
|
80 |
import java.awt.Rectangle; |
|
81 |
import java.awt.TexturePaint; |
|
82 |
import java.awt.geom.AffineTransform; |
|
83 |
import java.awt.geom.Arc2D; |
|
84 |
import java.awt.geom.Rectangle2D; |
|
85 |
import java.awt.image.BufferedImage; |
|
86 | 81 |
|
87 |
import java.io.File; |
|
88 |
import java.io.IOException; |
|
89 |
|
|
90 |
import java.util.ArrayList; |
|
91 |
|
|
92 |
|
|
93 | 82 |
/** |
94 | 83 |
* Driver DGN que trabaja directamente cargando el fichero en memoria. |
95 | 84 |
* |
... | ... | |
528 | 517 |
defaultLegend.setLabelHeightField("HeightText"); |
529 | 518 |
defaultLegend.setLabelRotationField("RotationText"); |
530 | 519 |
|
531 |
ReadDriver rs = this;
|
|
520 |
ObjectDriver rs = this;
|
|
532 | 521 |
IntValue clave; |
533 | 522 |
FSymbol theSymbol = null; |
534 | 523 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dgn/DGNDriver.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers.dgn; |
42 | 42 |
|
43 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
44 |
import com.hardcode.gdbms.engine.data.FileDriver; |
|
45 |
import com.hardcode.gdbms.engine.values.Value; |
|
46 |
|
|
47 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
|
48 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
49 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
|
50 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
|
51 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
52 |
|
|
53 | 43 |
import java.awt.geom.AffineTransform; |
54 | 44 |
import java.awt.geom.Arc2D; |
55 | 45 |
import java.awt.geom.Rectangle2D; |
56 |
|
|
57 | 46 |
import java.io.File; |
58 | 47 |
import java.io.IOException; |
59 |
|
|
60 | 48 |
import java.util.ArrayList; |
61 | 49 |
|
50 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
51 |
import com.hardcode.gdbms.engine.data.driver.FileDriver; |
|
52 |
import com.hardcode.gdbms.engine.values.Value; |
|
53 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
|
54 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
55 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
|
56 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
|
57 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
62 | 58 |
|
59 |
|
|
63 | 60 |
/** |
64 | 61 |
* Driver DGN. |
65 | 62 |
* |
... | ... | |
582 | 579 |
/* (non-Javadoc) |
583 | 580 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldType(int) |
584 | 581 |
*/ |
585 |
public Class getFieldType(int arg0) throws DriverException { |
|
586 |
// TODO Auto-generated method stub |
|
587 |
return null; |
|
582 |
public int getFieldType(int arg0) throws DriverException { |
|
583 |
throw new RuntimeException("por implementar"); |
|
588 | 584 |
} |
589 | 585 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dxf/DXFDriver.java | ||
---|---|---|
63 | 63 |
import org.cresques.px.gml.Point; |
64 | 64 |
import org.cresques.px.gml.Polygon; |
65 | 65 |
|
66 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
67 |
import com.hardcode.gdbms.engine.data.FileDriver; |
|
66 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
|
67 |
import com.hardcode.gdbms.engine.data.driver.FileDriver;
|
|
68 | 68 |
import com.hardcode.gdbms.engine.values.Value; |
69 | 69 |
import com.iver.cit.gvsig.fmap.core.FShape; |
70 | 70 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
... | ... | |
73 | 73 |
import com.iver.cit.gvsig.fmap.drivers.BoundedShapes; |
74 | 74 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
75 | 75 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
76 |
import com.iver.cit.gvsig.fmap.drivers.shp.SHP; |
|
77 | 76 |
|
78 | 77 |
/** |
79 | 78 |
* @author jmorell (jose.morell@gmail.com) |
... | ... | |
308 | 307 |
/* (non-Javadoc) |
309 | 308 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldType(int) |
310 | 309 |
*/ |
311 |
public Class getFieldType(int arg0) throws DriverException { |
|
312 |
// TODO Auto-generated method stub |
|
313 |
return null; |
|
310 |
public int getFieldType(int arg0) throws DriverException { |
|
311 |
throw new RuntimeException("por implementar"); |
|
314 | 312 |
} |
315 | 313 |
|
316 | 314 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dxf/DXFMemoryDriver.java | ||
---|---|---|
47 | 47 |
|
48 | 48 |
import java.awt.Color; |
49 | 49 |
import java.awt.Font; |
50 |
import java.awt.Graphics2D; |
|
51 |
import java.awt.Paint; |
|
52 |
import java.awt.Rectangle; |
|
53 |
import java.awt.TexturePaint; |
|
54 | 50 |
import java.awt.geom.Point2D; |
55 |
import java.awt.geom.Rectangle2D; |
|
56 |
import java.awt.image.BufferedImage; |
|
57 | 51 |
import java.io.File; |
58 | 52 |
import java.io.IOException; |
59 | 53 |
import java.util.ArrayList; |
... | ... | |
64 | 58 |
import org.cresques.px.IObjList; |
65 | 59 |
import org.cresques.px.dxf.AcadColor; |
66 | 60 |
import org.cresques.px.dxf.DxfFeatureMaker; |
67 |
import org.cresques.px.dxf.DxfHeaderManager; |
|
68 | 61 |
import org.cresques.px.gml.Feature; |
69 | 62 |
import org.cresques.px.gml.InsPoint; |
70 | 63 |
import org.cresques.px.gml.LineString; |
71 | 64 |
import org.cresques.px.gml.Point; |
72 | 65 |
import org.cresques.px.gml.Polygon; |
73 | 66 |
|
74 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
75 |
import com.hardcode.gdbms.engine.data.ReadDriver;
|
|
67 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
|
68 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
|
|
76 | 69 |
import com.hardcode.gdbms.engine.values.IntValue; |
77 | 70 |
import com.hardcode.gdbms.engine.values.Value; |
78 | 71 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
... | ... | |
331 | 324 |
defaultLegend.setLabelHeightField("HeightText"); |
332 | 325 |
defaultLegend.setLabelRotationField("RotationText"); |
333 | 326 |
|
334 |
ReadDriver rs = this;
|
|
327 |
ObjectDriver rs = this;
|
|
335 | 328 |
IntValue clave; |
336 | 329 |
FSymbol theSymbol = null; |
337 | 330 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/VectorialFileDriver.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers; |
42 | 42 |
|
43 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
44 |
|
|
45 |
import java.awt.geom.Rectangle2D; |
|
46 |
|
|
47 | 43 |
import java.io.File; |
48 | 44 |
import java.io.IOException; |
49 | 45 |
|
46 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
50 | 47 |
|
48 |
|
|
51 | 49 |
/** |
52 | 50 |
* Interfaz a implementar por los drivers. El constructor no ha de tener |
53 | 51 |
* par?metros y ha de ser r?pido, para las tareas de inicializaci?n de la capa |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/VectorialDriver.java | ||
---|---|---|
44 | 44 |
import java.io.IOException; |
45 | 45 |
|
46 | 46 |
import com.hardcode.driverManager.Driver; |
47 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
48 | 47 |
|
49 | 48 |
|
50 | 49 |
/** |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/DefaultDBDriver.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers; |
42 | 42 |
|
43 |
import java.awt.geom.Rectangle2D; |
|
44 | 43 |
import java.io.IOException; |
45 | 44 |
import java.sql.Connection; |
46 | 45 |
import java.sql.ResultSet; |
... | ... | |
48 | 47 |
import java.sql.SQLException; |
49 | 48 |
import java.sql.Statement; |
50 | 49 |
import java.sql.Types; |
51 |
import java.util.Date; |
|
52 | 50 |
|
53 |
import org.postgis.Geometry; |
|
54 |
import org.postgis.PGbox3d; |
|
55 |
import org.postgis.Point; |
|
56 |
|
|
57 |
import com.hardcode.gdbms.engine.data.DataSource; |
|
58 |
import com.hardcode.gdbms.engine.data.ReadDriver; |
|
51 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver; |
|
59 | 52 |
import com.hardcode.gdbms.engine.values.Value; |
60 | 53 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
61 | 54 |
import com.iver.cit.gvsig.fmap.DriverException; |
62 | 55 |
import com.iver.cit.gvsig.fmap.core.FShape; |
63 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
64 |
import com.iver.cit.gvsig.fmap.drivers.jdbc.postgis.WKTParser; |
|
65 |
import com.vividsolutions.jts.io.ParseException; |
|
66 | 56 |
|
67 | 57 |
|
68 | 58 |
|
69 | 59 |
/** |
70 | 60 |
* Clase abstracta qu |
71 | 61 |
*/ |
72 |
public abstract class DefaultDBDriver implements VectorialDatabaseDriver, ReadDriver {
|
|
62 |
public abstract class DefaultDBDriver implements VectorialDatabaseDriver, ObjectDriver {
|
|
73 | 63 |
/** |
74 | 64 |
* |
75 | 65 |
*/ |
... | ... | |
145 | 135 |
return FShape.MULTI; |
146 | 136 |
} |
147 | 137 |
|
148 |
public Class getFieldType(int idField) throws com.hardcode.gdbms.engine.data.DriverException
|
|
138 |
public int getFieldType(int idField) throws com.hardcode.gdbms.engine.data.driver.DriverException
|
|
149 | 139 |
{ |
150 | 140 |
String str = ""; |
151 | 141 |
try { |
... | ... | |
153 | 143 |
// adem?s nos saltamos el campo de geometry |
154 | 144 |
str = metaData.getColumnClassName(i); |
155 | 145 |
if (metaData.getColumnType(i) == Types.VARCHAR) |
156 |
return Value.VARCHAR;
|
|
146 |
return Types.VARCHAR;
|
|
157 | 147 |
if (metaData.getColumnType(i) == Types.FLOAT) |
158 |
return Value.FLOAT;
|
|
148 |
return Types.FLOAT;
|
|
159 | 149 |
if (metaData.getColumnType(i) == Types.DOUBLE) |
160 |
return Value.DOUBLE;
|
|
150 |
return Types.DOUBLE;
|
|
161 | 151 |
if (metaData.getColumnType(i) == Types.INTEGER) |
162 |
return Value.INTEGER;
|
|
152 |
return Types.INTEGER;
|
|
163 | 153 |
if (metaData.getColumnType(i) == Types.BIGINT) |
164 |
return Value.BIGINT;
|
|
154 |
return Types.BIGINT;
|
|
165 | 155 |
if (metaData.getColumnType(i) == Types.BIT) |
166 |
return Value.BIT;
|
|
156 |
return Types.BIT;
|
|
167 | 157 |
if (metaData.getColumnType(i) == Types.DATE) |
168 |
return Value.DATE;
|
|
158 |
return Types.DATE;
|
|
169 | 159 |
} catch (SQLException e) { |
170 |
throw new com.hardcode.gdbms.engine.data.DriverException("Tipo no soportado: " + str);
|
|
160 |
throw new com.hardcode.gdbms.engine.data.driver.DriverException(e);
|
|
171 | 161 |
} |
172 |
return null; |
|
173 |
|
|
162 |
throw new com.hardcode.gdbms.engine.data.driver.DriverException("Tipo no soportado: " + str); |
|
174 | 163 |
} |
175 | 164 |
/** |
176 | 165 |
* Obtiene el valor que se encuentra en la fila y columna indicada |
... | ... | |
186 | 175 |
* @throws DriverException Si se produce un error accediendo al DataSource |
187 | 176 |
*/ |
188 | 177 |
public Value getFieldValue(long rowIndex, int idField) |
189 |
throws com.hardcode.gdbms.engine.data.DriverException |
|
178 |
throws com.hardcode.gdbms.engine.data.driver.DriverException
|
|
190 | 179 |
{ |
191 | 180 |
int i = (int) (rowIndex + 1); |
192 | 181 |
int fieldId = idField+2; |
... | ... | |
207 | 196 |
if (metaData.getColumnType(fieldId) == Types.DATE) |
208 | 197 |
return ValueFactory.createValue(rs.getDate(fieldId)); |
209 | 198 |
} catch (SQLException e) { |
210 |
throw new com.hardcode.gdbms.engine.data.DriverException("Tipo no soportado: columna " + fieldId ); |
|
199 |
throw new com.hardcode.gdbms.engine.data.driver.DriverException("Tipo no soportado: columna " + fieldId );
|
|
211 | 200 |
} |
212 | 201 |
return null; |
213 | 202 |
|
... | ... | |
222 | 211 |
* @throws DriverException Si se produce alg?n error accediendo al |
223 | 212 |
* DataSource |
224 | 213 |
*/ |
225 |
public int getFieldCount() throws com.hardcode.gdbms.engine.data.DriverException |
|
214 |
public int getFieldCount() throws com.hardcode.gdbms.engine.data.driver.DriverException
|
|
226 | 215 |
{ |
227 | 216 |
try { |
228 | 217 |
// Suponemos que el primer campo es el de las geometries, y no lo |
229 | 218 |
// contamos |
230 | 219 |
return rs.getMetaData().getColumnCount()-1; |
231 | 220 |
} catch (SQLException e) { |
232 |
throw new com.hardcode.gdbms.engine.data.DriverException(e); |
|
221 |
throw new com.hardcode.gdbms.engine.data.driver.DriverException(e);
|
|
233 | 222 |
} |
234 | 223 |
|
235 | 224 |
} |
... | ... | |
240 | 229 |
* @param fieldId ?ndice del campo cuyo nombre se quiere obtener |
241 | 230 |
* |
242 | 231 |
* @return |
243 |
* @throws com.hardcode.gdbms.engine.data.DriverException |
|
232 |
* @throws com.hardcode.gdbms.engine.data.driver.DriverException
|
|
244 | 233 |
* |
245 | 234 |
* @throws DriverException Si se produce alg?n error accediendo al |
246 | 235 |
* DataSource |
247 | 236 |
*/ |
248 |
public String getFieldName(int fieldId) throws com.hardcode.gdbms.engine.data.DriverException |
|
237 |
public String getFieldName(int fieldId) throws com.hardcode.gdbms.engine.data.driver.DriverException
|
|
249 | 238 |
{ |
250 | 239 |
try { |
251 | 240 |
return rs.getMetaData().getColumnName(fieldId+2); |
252 | 241 |
} catch (SQLException e) { |
253 |
throw new com.hardcode.gdbms.engine.data.DriverException(e); |
|
242 |
throw new com.hardcode.gdbms.engine.data.driver.DriverException(e);
|
|
254 | 243 |
} |
255 | 244 |
} |
256 | 245 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/SHP.java | ||
---|---|---|
151 | 151 |
dbf.createdbf(visitor.getBitSet()); |
152 | 152 |
dbf.stop(); |
153 | 153 |
visitor.getSDS().stop(); |
154 |
} catch (com.hardcode.gdbms.engine.data.DriverException e2) { |
|
154 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e2) {
|
|
155 | 155 |
e2.printStackTrace(); |
156 | 156 |
} |
157 | 157 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/write/DBFFromSelected.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers.shp.write; |
42 | 42 |
|
43 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
44 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileHeaderNIO; |
|
45 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileWriterNIO; |
|
46 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
|
47 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
48 |
|
|
49 | 43 |
import java.io.File; |
50 | 44 |
import java.io.IOException; |
51 |
import java.io.OutputStream; |
|
52 | 45 |
import java.io.RandomAccessFile; |
53 |
|
|
54 |
import java.net.MalformedURLException; |
|
55 |
import java.net.URL; |
|
56 |
|
|
57 |
import java.nio.channels.Channels; |
|
58 | 46 |
import java.nio.channels.FileChannel; |
59 | 47 |
import java.nio.channels.WritableByteChannel; |
60 | 48 |
|
49 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
50 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
51 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileHeaderNIO; |
|
52 |
import com.iver.cit.gvsig.fmap.drivers.shp.DbaseFileWriterNIO; |
|
53 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
|
54 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
61 | 55 |
|
56 |
|
|
62 | 57 |
/** |
63 | 58 |
* Visitor de zoom a lo seleccionado. |
64 | 59 |
* |
... | ... | |
137 | 132 |
|
138 | 133 |
///} catch (DriverException e1) { |
139 | 134 |
// e1.printStackTrace(); |
140 |
} catch (com.hardcode.gdbms.engine.data.DriverException e2) {
|
|
141 |
e2.printStackTrace();
|
|
135 |
} catch (DriverException e) {
|
|
136 |
e.printStackTrace(); |
|
142 | 137 |
} |
143 | 138 |
|
144 | 139 |
//return true; |
... | ... | |
174 | 169 |
|
175 | 170 |
dbfWrite.write(record); |
176 | 171 |
} |
177 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
178 |
e.printStackTrace(); |
|
179 | 172 |
} catch (IOException e1) { |
180 | 173 |
e1.printStackTrace(); |
174 |
} catch (DriverException e) { |
|
175 |
e.printStackTrace(); |
|
181 | 176 |
} |
182 | 177 |
} |
183 | 178 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/DbaseFileHeaderNIO.java | ||
---|---|---|
62 | 62 |
*/ |
63 | 63 |
package com.iver.cit.gvsig.fmap.drivers.shp; |
64 | 64 |
|
65 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
66 |
import com.hardcode.gdbms.engine.instruction.SemanticException; |
|
67 |
import com.hardcode.gdbms.engine.values.Value; |
|
68 |
|
|
69 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
70 |
|
|
71 |
import com.vividsolutions.jts.geom.Geometry; |
|
72 |
|
|
73 | 65 |
import java.io.EOFException; |
74 | 66 |
import java.io.IOException; |
75 |
|
|
76 | 67 |
import java.nio.ByteBuffer; |
77 | 68 |
import java.nio.ByteOrder; |
78 | 69 |
import java.nio.channels.ReadableByteChannel; |
79 | 70 |
import java.nio.channels.WritableByteChannel; |
80 |
|
|
71 |
import java.sql.Types; |
|
81 | 72 |
import java.util.Calendar; |
82 | 73 |
import java.util.Date; |
83 | 74 |
import java.util.logging.Level; |
84 | 75 |
import java.util.logging.Logger; |
85 | 76 |
|
77 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
78 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
79 |
import com.vividsolutions.jts.geom.Geometry; |
|
86 | 80 |
|
81 |
|
|
87 | 82 |
/** |
88 | 83 |
* Class to represent the header of a Dbase III file. Creation date: (5/15/2001 |
89 | 84 |
* 5:15:30 PM) |
... | ... | |
771 | 766 |
try { |
772 | 767 |
for (int i = 0, ii = sds.getFieldCount(); i < ii; i++) { |
773 | 768 |
|
774 |
Class type = sds.getFieldType(i);
|
|
769 |
int type = sds.getFieldType(i);
|
|
775 | 770 |
String colName = sds.getFieldName(i); |
776 | 771 |
|
777 | 772 |
///int fieldLen = ((DBFDriver)sds.getDriver()).getFieldLength(i); |
... | ... | |
782 | 777 |
// fieldLen = 255; |
783 | 778 |
// } |
784 | 779 |
// @todo respect field length |
785 |
if ((type == Value.DOUBLE) ||
|
|
786 |
(type == Value.FLOAT) ||
|
|
787 |
(type == Value.INTEGER))
|
|
780 |
if ((type == Types.DOUBLE) ||
|
|
781 |
(type == Types.FLOAT) ||
|
|
782 |
(type == Types.INTEGER))
|
|
788 | 783 |
|
789 | 784 |
header.addColumn(colName, 'N', Math.min(fieldLen, 10), |
790 | 785 |
decimales); |
791 |
if (type == Value.DATE)
|
|
786 |
if (type == Types.DATE)
|
|
792 | 787 |
header.addColumn(colName, 'D', fieldLen, 0); |
793 |
if (type == Value.BIT)
|
|
788 |
if (type == Types.BIT)
|
|
794 | 789 |
header.addColumn(colName, 'L', 1, 0); |
795 |
if ((type == Value.VARCHAR) ||
|
|
796 |
(type == Value.CHAR) ||
|
|
797 |
(type == Value.LONGVARCHAR))
|
|
790 |
if ((type == Types.VARCHAR) ||
|
|
791 |
(type == Types.CHAR) ||
|
|
792 |
(type == Types.LONGVARCHAR))
|
|
798 | 793 |
header.addColumn(colName, 'C', Math.min(254, fieldLen), |
799 | 794 |
0); |
800 | 795 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/DBFFromGeometries.java | ||
---|---|---|
114 | 114 |
|
115 | 115 |
///} catch (DriverException e1) { |
116 | 116 |
// e1.printStackTrace(); |
117 |
} catch (com.hardcode.gdbms.engine.data.DriverException e2) { |
|
117 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e2) {
|
|
118 | 118 |
e2.printStackTrace(); |
119 | 119 |
} |
120 | 120 |
|
... | ... | |
151 | 151 |
dbfWrite.write(record); |
152 | 152 |
} |
153 | 153 |
} |
154 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
154 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
155 | 155 |
e.printStackTrace(); |
156 | 156 |
} catch (IOException e1) { |
157 | 157 |
e1.printStackTrace(); |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/gvs/GVSDriver.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* |
|
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
40 |
*/ |
|
41 |
package com.iver.cit.gvsig.fmap.drivers.gvs; |
|
42 |
|
|
43 |
import java.awt.geom.Rectangle2D; |
|
44 |
import java.io.ByteArrayInputStream; |
|
45 |
import java.io.File; |
|
46 |
import java.io.FileInputStream; |
|
47 |
import java.io.IOException; |
|
48 |
import java.io.ObjectInputStream; |
|
49 |
import java.nio.ByteBuffer; |
|
50 |
import java.nio.channels.FileChannel; |
|
51 |
|
|
52 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
53 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver; |
|
54 |
import com.hardcode.gdbms.engine.values.Value; |
|
55 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
56 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
57 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
|
58 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
59 |
|
|
60 |
public class GVSDriver implements VectorialFileDriver, ObjectDriver { |
|
61 |
|
|
62 |
private File file; |
|
63 |
private FileChannel channel; |
|
64 |
|
|
65 |
private File indexFile; |
|
66 |
private FileChannel indexChannel; |
|
67 |
private ByteBuffer byteCountBuffer = ByteBuffer.allocate(4); |
|
68 |
|
|
69 |
private int fieldCount; |
|
70 |
private int rowCount; |
|
71 |
|
|
72 |
private Rectangle2D extent; |
|
73 |
|
|
74 |
/** |
|
75 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#open(java.io.File) |
|
76 |
*/ |
|
77 |
public void open(File f) throws IOException { |
|
78 |
|
|
79 |
//Abrimos el fichero de ?ndice |
|
80 |
String name = f.getName().substring(0, f.getName().length() - 4) + ".gvi"; |
|
81 |
indexFile = new File(name); |
|
82 |
FileInputStream fis = new FileInputStream(indexFile); |
|
83 |
indexChannel = fis.getChannel(); |
|
84 |
|
|
85 |
//leemos el n?mero de geometr?as y de campos |
|
86 |
ByteBuffer indexBuffer = ByteBuffer.allocate(4); |
|
87 |
indexChannel.read(indexBuffer); |
|
88 |
fieldCount = indexBuffer.getInt(); |
|
89 |
indexChannel.read(indexBuffer); |
|
90 |
rowCount = indexBuffer.getInt(); |
|
91 |
|
|
92 |
//Leemos el extent |
|
93 |
ByteBuffer extentBuffer = ByteBuffer.allocate(8 * 4); |
|
94 |
indexChannel.read(extentBuffer); |
|
95 |
extent = new Rectangle2D.Double(extentBuffer.getDouble(), |
|
96 |
extentBuffer.getDouble(), |
|
97 |
extentBuffer.getDouble(), |
|
98 |
extentBuffer.getDouble()); |
|
99 |
|
|
100 |
//Abrimos el fichero de datos |
|
101 |
name = f.getName(); |
|
102 |
file = new File(name); |
|
103 |
fis = new FileInputStream(file); |
|
104 |
channel = fis.getChannel(); |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#close() |
|
109 |
*/ |
|
110 |
public void close() throws IOException { |
|
111 |
channel.close(); |
|
112 |
indexChannel.close(); |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#initialize() |
|
117 |
*/ |
|
118 |
public void initialize() throws IOException { |
|
119 |
} |
|
120 |
|
|
121 |
/** |
|
122 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#accept(java.io.File) |
|
123 |
*/ |
|
124 |
public boolean accept(File f) { |
|
125 |
return (f.getName().toLowerCase().endsWith("gvs")); |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#getShape(int) |
|
130 |
*/ |
|
131 |
public IGeometry getShape(int index) throws IOException { |
|
132 |
//Obtenemos el ?ndice del fichero de ?ndices |
|
133 |
int fileIndex = getFileIndex(index, -1); |
|
134 |
|
|
135 |
//Leemos la geometr?a |
|
136 |
channel.position((long)fileIndex); |
|
137 |
|
|
138 |
//Leemos el tama?o en bytes |
|
139 |
channel.read(byteCountBuffer); |
|
140 |
int geomBytes = byteCountBuffer.getInt(); |
|
141 |
|
|
142 |
//Leemos la geometr?a |
|
143 |
ByteBuffer byteBuffer = ByteBuffer.allocate(geomBytes); |
|
144 |
channel.read(byteBuffer); |
|
145 |
byte[] byteArray = new byte[geomBytes]; |
|
146 |
byteBuffer.get(byteArray); |
|
147 |
ByteArrayInputStream bais = new ByteArrayInputStream(byteArray); |
|
148 |
ObjectInputStream ois = new ObjectInputStream(bais); |
|
149 |
try { |
|
150 |
return (IGeometry) ois.readObject(); |
|
151 |
} catch (ClassNotFoundException e) { |
|
152 |
throw new IOException(e.getMessage()); |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
/** |
|
157 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getShapeType() |
|
158 |
*/ |
|
159 |
public int getShapeType() { |
|
160 |
return FShape.MULTI; |
|
161 |
} |
|
162 |
|
|
163 |
/** |
|
164 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getShapeCount() |
|
165 |
*/ |
|
166 |
public int getShapeCount() throws IOException { |
|
167 |
return rowCount; |
|
168 |
} |
|
169 |
|
|
170 |
/** |
|
171 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getDriverAttributes() |
|
172 |
*/ |
|
173 |
public DriverAttributes getDriverAttributes() { |
|
174 |
return null; |
|
175 |
} |
|
176 |
|
|
177 |
/** |
|
178 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getFullExtent() |
|
179 |
*/ |
|
180 |
public Rectangle2D getFullExtent() throws IOException { |
|
181 |
return extent; |
|
182 |
} |
|
183 |
|
|
184 |
/** |
|
185 |
* @see com.hardcode.driverManager.Driver#getName() |
|
186 |
*/ |
|
187 |
public String getName() { |
|
188 |
return "gvs driver"; |
|
189 |
} |
|
190 |
|
|
191 |
private int getFileIndex(int rowIndex, int columnIndex){ |
|
192 |
//Obtenemos la fila en el fichero de ?ndices |
|
193 |
int indexFileIndex = 2*4 + 8 * 4; |
|
194 |
indexFileIndex += (fieldCount + 1) * rowIndex; |
|
195 |
|
|
196 |
columnIndex++; |
|
197 |
indexFileIndex += columnIndex * 4; |
|
198 |
|
|
199 |
return indexFileIndex; |
|
200 |
} |
|
201 |
|
|
202 |
/** |
|
203 |
* @see com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldValue(long, int) |
|
204 |
*/ |
|
205 |
public Value getFieldValue(long rowIndex, int fieldIndex) throws DriverException { |
|
206 |
int fileIndex = getFileIndex((int) rowIndex, fieldIndex); |
|
207 |
|
|
208 |
try { |
|
209 |
//Leemos el tama?o en bytes |
|
210 |
channel.position((long)fileIndex); |
|
211 |
channel.read(byteCountBuffer); |
|
212 |
int geomBytes = byteCountBuffer.getInt(); |
|
213 |
|
|
214 |
//Leemos el value |
|
215 |
ByteBuffer byteBuffer = ByteBuffer.allocate(geomBytes); |
|
216 |
channel.read(byteBuffer); |
|
217 |
byte[] byteArray = new byte[geomBytes]; |
|
218 |
byteBuffer.get(byteArray); |
|
219 |
ByteArrayInputStream bais = new ByteArrayInputStream(byteArray); |
|
220 |
ObjectInputStream ois = new ObjectInputStream(bais); |
|
221 |
return (Value) ois.readObject(); |
|
222 |
} catch (IOException e1) { |
|
223 |
throw new DriverException(e1); |
|
224 |
} catch (ClassNotFoundException e) { |
|
225 |
throw new DriverException(e); |
|
226 |
} |
|
227 |
} |
|
228 |
|
|
229 |
/** |
|
230 |
* @see com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldCount() |
|
231 |
*/ |
|
232 |
public int getFieldCount() throws DriverException { |
|
233 |
return fieldCount; |
|
234 |
} |
|
235 |
|
|
236 |
/** |
|
237 |
* @see com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldName(int) |
|
238 |
*/ |
|
239 |
public String getFieldName(int arg0) throws DriverException { |
|
240 |
return "geom"; |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* @see com.hardcode.gdbms.engine.data.driver.ReadAccess#getRowCount() |
|
245 |
*/ |
|
246 |
public long getRowCount() throws DriverException { |
|
247 |
return rowCount; |
|
248 |
} |
|
249 |
|
|
250 |
/** |
|
251 |
* @see com.hardcode.gdbms.engine.data.driver.ReadAccess#getFieldType(int) |
|
252 |
*/ |
|
253 |
public int getFieldType(int arg0) throws DriverException { |
|
254 |
// TODO Auto-generated method stub |
|
255 |
return 0; |
|
256 |
} |
|
257 |
} |
|
0 | 258 |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/WMSDriver.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.fmap.drivers; |
42 | 42 |
|
43 | 43 |
import java.awt.Image; |
44 |
|
|
45 | 44 |
import java.io.IOException; |
46 |
|
|
47 | 45 |
import java.net.ProtocolException; |
48 | 46 |
import java.net.URL; |
49 | 47 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/MemoryDriver.java | ||
---|---|---|
49 | 49 |
import java.awt.geom.Rectangle2D; |
50 | 50 |
import java.io.File; |
51 | 51 |
import java.io.IOException; |
52 |
import java.sql.Types; |
|
52 | 53 |
import java.util.ArrayList; |
53 | 54 |
import java.util.Date; |
54 | 55 |
|
55 | 56 |
import javax.swing.table.DefaultTableModel; |
56 | 57 |
|
57 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
58 |
import com.hardcode.gdbms.engine.data.ReadDriver;
|
|
58 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
|
59 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
|
|
59 | 60 |
import com.hardcode.gdbms.engine.values.Value; |
60 | 61 |
import com.iver.cit.gvsig.fmap.core.FShape; |
61 | 62 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
... | ... | |
68 | 69 |
* |
69 | 70 |
* @author FJP |
70 | 71 |
*/ |
71 |
public abstract class MemoryDriver implements VectorialFileDriver, ReadDriver,
|
|
72 |
public abstract class MemoryDriver implements VectorialFileDriver, ObjectDriver,
|
|
72 | 73 |
BoundedShapes { |
73 | 74 |
private MemoryShapeInfo memShapeInfo = new MemoryShapeInfo(); |
74 | 75 |
private ArrayList arrayGeometries = new ArrayList(); |
... | ... | |
199 | 200 |
/** |
200 | 201 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldType(int) |
201 | 202 |
*/ |
202 |
public Class getFieldType(int i) throws DriverException {
|
|
203 |
public int getFieldType(int i) throws DriverException {
|
|
203 | 204 |
// TODO: Revisar esto. Por ejemplo, el long |
204 | 205 |
|
205 | 206 |
if (m_TableModel.getColumnClass(i) == String.class) |
206 |
return Value.VARCHAR;
|
|
207 |
return Types.VARCHAR;
|
|
207 | 208 |
if (m_TableModel.getColumnClass(i) == Float.class) |
208 |
return Value.FLOAT;
|
|
209 |
return Types.FLOAT;
|
|
209 | 210 |
if (m_TableModel.getColumnClass(i) == Double.class) |
210 |
return Value.DOUBLE;
|
|
211 |
return Types.DOUBLE;
|
|
211 | 212 |
if (m_TableModel.getColumnClass(i) == Integer.class) |
212 |
return Value.INTEGER;
|
|
213 |
return Types.INTEGER;
|
|
213 | 214 |
if (m_TableModel.getColumnClass(i) == Long.class) |
214 |
return Value.INTEGER;
|
|
215 |
return Types.INTEGER;
|
|
215 | 216 |
if (m_TableModel.getColumnClass(i) == Boolean.class) |
216 |
return Value.BIT;
|
|
217 |
return Types.BIT;
|
|
217 | 218 |
if (m_TableModel.getColumnClass(i) == Date.class) |
218 |
return Value.DATE;
|
|
219 |
return Types.DATE;
|
|
219 | 220 |
|
220 |
|
|
221 |
return Types.VARCHAR; |
|
221 | 222 |
// return m_TableModel.getColumnClass(i); |
222 |
throw new DriverException("Tipo no soportado: " + m_TableModel.getColumnClass(i).getName()); |
|
223 |
// throw new DriverException("Tipo no soportado: " + m_TableModel.getColumnClass(i).getName());
|
|
223 | 224 |
} |
224 | 225 |
/* (non-Javadoc) |
225 | 226 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldValue(long, int) |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/Class1.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
2 |
|
|
3 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
|
4 |
|
|
5 |
public class Class1 { |
|
6 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/DefaultStrategy.java | ||
---|---|---|
220 | 220 |
|
221 | 221 |
} catch (DriverIOException e) { |
222 | 222 |
throw new DriverException(e); |
223 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
223 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
224 | 224 |
throw new DriverException(e); |
225 | 225 |
} catch (DriverException e) { |
226 | 226 |
throw new DriverException(e); |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/FirstStrategy.java | ||
---|---|---|
137 | 137 |
System.out.println(t2 - t1); |
138 | 138 |
} catch (DriverIOException e) { |
139 | 139 |
throw new DriverException(e); |
140 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
140 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
141 | 141 |
throw new DriverException(e); |
142 | 142 |
} |
143 | 143 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/ShpStrategy.java | ||
---|---|---|
228 | 228 |
System.out.println(t2 - t1); |
229 | 229 |
} catch (DriverIOException e) { |
230 | 230 |
throw new DriverException(e); |
231 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
231 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
232 | 232 |
throw new DriverException(e); |
233 | 233 |
} catch (DriverException e) { |
234 | 234 |
throw new DriverException(e); |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/SelectedShapeVisitor.java | ||
---|---|---|
43 | 43 |
import java.util.ArrayList; |
44 | 44 |
import java.util.BitSet; |
45 | 45 |
|
46 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
46 | 47 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
47 | 48 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
48 | 49 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
... | ... | |
81 | 82 |
if (layer instanceof AlphanumericData && layer instanceof Selectable) { |
82 | 83 |
try { |
83 | 84 |
sds = ((AlphanumericData) layer).getRecordset(); |
84 |
bitset = ((Selectable) layer).getSelection(); |
|
85 |
} catch (com.iver.cit.gvsig.fmap.DriverException e) { |
|
85 |
} catch (DriverException e) { |
|
86 | 86 |
e.printStackTrace(); |
87 | 87 |
} |
88 |
bitset = ((Selectable) layer).getSelection(); |
|
88 | 89 |
|
89 | 90 |
return true; |
90 | 91 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/OptimiceStrategy.java | ||
---|---|---|
91 | 91 |
try { |
92 | 92 |
VectorialAdapter adapter = ((SingleLayer) getCapa()).getSource(); |
93 | 93 |
DataSource ds = ((AlphanumericData) getCapa()).getRecordset(); |
94 |
// ShapeInfo shapeinfo = adapter.getShapeInfo();
|
|
94 |
ShapeInfo shapeinfo = adapter.getShapeInfo(); |
|
95 | 95 |
logger.debug("adapter.start()"); |
96 | 96 |
adapter.start(); |
97 | 97 |
logger.debug("ds.start()"); |
... | ... | |
129 | 129 |
System.out.println(t2 - t1); |
130 | 130 |
} catch (DriverIOException e) { |
131 | 131 |
throw new DriverException(e); |
132 |
} catch (com.hardcode.gdbms.engine.data.DriverException e) { |
|
132 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
|
|
133 | 133 |
throw new DriverException(e); |
134 | 134 |
} |
135 | 135 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/demo/MapImage.java | ||
---|---|---|
50 | 50 |
|
51 | 51 |
import org.cresques.cts.ProjectionPool; |
52 | 52 |
|
53 |
|
|
53 |
import com.hardcode.driverManager.DriverLoadException; |
|
54 | 54 |
import com.iver.cit.gvsig.fmap.DriverException; |
55 | 55 |
import com.iver.cit.gvsig.fmap.MapControl; |
56 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
56 | 57 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
57 | 58 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
58 | 59 |
import com.iver.cit.gvsig.fmap.tools.ZoomInListenerImpl; |
... | ... | |
104 | 105 |
"C:\\eclipse3\\workspace\\Andami\\gvSIG\\extensiones\\com.iver.cit.gvsig\\drivers"); |
105 | 106 |
|
106 | 107 |
try { |
107 |
FLayer l = LayerFactory.createLayer("Vias", "gvSIG shp driver", |
|
108 |
FLayer l = LayerFactory.createLayer("Vias", |
|
109 |
(VectorialFileDriver) LayerFactory.getDM().getDriver("gvSIG shp driver"), |
|
108 | 110 |
new File("C:/Documents and Settings/fernando/Mis documentos/vias.shp"), |
109 | 111 |
ProjectionPool.get("EPSG:23030")); |
110 | 112 |
newMapControl.getMapContext().getLayers().addLayer(l); |
... | ... | |
112 | 114 |
newMapControl.setTool("zoom"); |
113 | 115 |
} catch (DriverException e) { |
114 | 116 |
e.printStackTrace(); |
117 |
} catch (DriverLoadException e) { |
|
118 |
e.printStackTrace(); |
|
115 | 119 |
} |
116 | 120 |
|
117 | 121 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/demo/ImageFrame.java | ||
---|---|---|
52 | 52 |
import org.cresques.cts.IProjection; |
53 | 53 |
import org.cresques.cts.ProjectionPool; |
54 | 54 |
|
55 |
import com.hardcode.driverManager.DriverLoadException; |
|
55 | 56 |
import com.iver.cit.gvsig.fmap.DriverException; |
56 | 57 |
import com.iver.cit.gvsig.fmap.FMap; |
57 | 58 |
import com.iver.cit.gvsig.fmap.MapControl; |
58 | 59 |
import com.iver.cit.gvsig.fmap.ViewPort; |
60 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
|
59 | 61 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
60 | 62 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
61 | 63 |
|
... | ... | |
90 | 92 |
LayerFactory.setDriversPath( |
91 | 93 |
"d:/java/eclipse30/eclipse/workspace/Andami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"); |
92 | 94 |
|
93 |
l = LayerFactory.createLayer("Provin", "gvSIG shp driver", |
|
95 |
l = LayerFactory.createLayer("Provin", |
|
96 |
(VectorialFileDriver) LayerFactory.getDM().getDriver("gvSIG shp driver"), |
|
94 | 97 |
new File("C:/Documents and Settings/fjp/Mis documentos/provin.shp"), |
95 | 98 |
ProjectionPool.get("EPSG:23030")); |
96 | 99 |
|
... | ... | |
107 | 110 |
getJContentPane().add(lbl, java.awt.BorderLayout.CENTER); |
108 | 111 |
} catch (DriverException e) { |
109 | 112 |
e.printStackTrace(); |
113 |
} catch (DriverLoadException e) { |
|
114 |
e.printStackTrace(); |
|
110 | 115 |
} |
111 | 116 |
|
112 | 117 |
|
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometry.java | ||
---|---|---|
60 | 60 |
import java.awt.Graphics2D; |
61 | 61 |
import java.awt.geom.AffineTransform; |
62 | 62 |
import java.awt.geom.Rectangle2D; |
63 |
import java.io.Serializable; |
|
63 | 64 |
|
64 | 65 |
|
65 | 66 |
/** |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/IGeometry.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.core; |
42 | 42 |
|
43 |
import java.awt.Graphics2D; |
|
44 |
import java.awt.geom.Rectangle2D; |
|
45 |
import java.io.Serializable; |
|
46 |
|
|
47 |
import org.cresques.cts.ICoordTrans; |
|
48 |
|
|
43 | 49 |
import com.iver.cit.gvsig.fmap.ViewPort; |
44 | 50 |
import com.iver.cit.gvsig.fmap.core.v02.FLabel; |
45 | 51 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
46 | 52 |
import com.iver.cit.gvsig.fmap.rendering.FStyledShapePainter; |
47 | 53 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
48 |
|
|
49 | 54 |
import com.vividsolutions.jts.geom.Geometry; |
50 | 55 |
|
51 |
import org.cresques.cts.ICoordTrans; |
|
52 | 56 |
|
53 |
import java.awt.Graphics2D; |
|
54 |
import java.awt.geom.Rectangle2D; |
|
55 |
|
|
56 |
|
|
57 | 57 |
/** |
58 | 58 |
* Interfaz de Geometr?a. |
59 | 59 |
* |
60 | 60 |
* @author $author$ |
61 | 61 |
*/ |
62 |
public interface IGeometry { |
|
62 |
public interface IGeometry extends Serializable {
|
|
63 | 63 |
public static int BEST = 0; |
64 | 64 |
public static int N = 1; |
65 | 65 |
public static int NE = 2; |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FShape.java | ||
---|---|---|
43 | 43 |
import org.cresques.cts.ICoordTrans; |
44 | 44 |
|
45 | 45 |
import java.awt.Shape; |
46 |
import java.io.Serializable; |
|
46 | 47 |
|
47 | 48 |
|
48 | 49 |
/** |
49 | 50 |
* A?ade el tipo de la shape a la interfaz java.awt.Shape |
50 | 51 |
*/ |
51 |
public interface FShape extends Shape { |
|
52 |
public interface FShape extends Shape, Serializable {
|
|
52 | 53 |
public final static int NULL = 0; |
53 | 54 |
public final static int POINT = 1; |
54 | 55 |
public final static int LINE = 2; |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/GeneralPathX.java | ||
---|---|---|
64 | 64 |
import java.awt.geom.PathIterator; |
65 | 65 |
import java.awt.geom.Point2D; |
66 | 66 |
import java.awt.geom.Rectangle2D; |
67 |
import java.io.Serializable; |
|
67 | 68 |
|
68 | 69 |
import org.cresques.cts.ICoordTrans; |
69 | 70 |
|
... | ... | |
94 | 95 |
* @version 1.58, 01/23/03 |
95 | 96 |
* @author Jim Graham |
96 | 97 |
*/ |
97 |
public class GeneralPathX implements Shape, Cloneable { |
|
98 |
public class GeneralPathX implements Shape, Cloneable, Serializable {
|
|
98 | 99 |
/** |
99 | 100 |
* An even-odd winding rule for determining the interior of |
100 | 101 |
* a path. |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FPoint2D.java | ||
---|---|---|
47 | 47 |
import java.awt.geom.PathIterator; |
48 | 48 |
import java.awt.geom.Point2D; |
49 | 49 |
import java.awt.geom.Rectangle2D; |
50 |
import java.io.Serializable; |
|
50 | 51 |
|
51 | 52 |
|
52 | 53 |
/** |
... | ... | |
55 | 56 |
* @author Vicente Caballero Navarro |
56 | 57 |
*/ |
57 | 58 |
public class FPoint2D implements FShape { |
58 |
protected Point2D p; |
|
59 |
protected double x; |
|
60 |
protected double y; |
|
59 | 61 |
|
60 | 62 |
/** |
61 | 63 |
* Crea un nuevo Point2D. |
... | ... | |
64 | 66 |
* @param y Coordenada y del punto. |
65 | 67 |
*/ |
66 | 68 |
public FPoint2D(double x, double y) { |
67 |
p = new Point2D.Double(x, y); |
|
69 |
this.x = x; |
|
70 |
this.y = y; |
|
68 | 71 |
} |
69 | 72 |
|
70 | 73 |
/** |
... | ... | |
74 | 77 |
* @param at Matriz de transformaci?n. |
75 | 78 |
*/ |
76 | 79 |
public void transform(AffineTransform at) { |
77 |
at.transform(p, p); |
|
80 |
double[] p = new double[]{x, y}; |
|
81 |
at.transform(p, 0, p, 0, 1); |
|
78 | 82 |
} |
79 | 83 |
|
80 | 84 |
/* (non-Javadoc) |
81 | 85 |
* @see java.awt.Shape#contains(double, double) |
82 | 86 |
*/ |
83 | 87 |
public boolean contains(double x, double y) { |
84 |
if ((x == p.getX()) || (y == p.getY())) {
|
|
88 |
if ((x == this.x) || (y == this.y)) {
|
|
85 | 89 |
return true; |
86 | 90 |
} else { |
87 | 91 |
return false; |
... | ... | |
101 | 105 |
public boolean intersects(double x, double y, double w, double h) { |
102 | 106 |
Rectangle2D.Double rAux = new Rectangle2D.Double(x, y, w, h); |
103 | 107 |
|
104 |
return rAux.contains(p.getX(), p.getY());
|
|
108 |
return rAux.contains(this.x, this.y);
|
|
105 | 109 |
} |
106 | 110 |
|
107 | 111 |
/* (non-Javadoc) |
108 | 112 |
* @see java.awt.Shape#getBounds() |
109 | 113 |
*/ |
110 | 114 |
public Rectangle getBounds() { |
111 |
return new Rectangle((int) p.getX(), (int) p.getY(), 0, 0);
|
|
115 |
return new Rectangle((int) this.x, (int) this.y, 0, 0);
|
|
112 | 116 |
} |
113 | 117 |
|
114 | 118 |
/** |
... | ... | |
117 | 121 |
* @return Coordenada x. |
118 | 122 |
*/ |
119 | 123 |
public double getX() { |
120 |
return p.getX();
|
|
124 |
return this.x;
|
|
121 | 125 |
} |
122 | 126 |
|
123 | 127 |
/** |
... | ... | |
126 | 130 |
* @return Coordenada y. |
127 | 131 |
*/ |
128 | 132 |
public double getY() { |
129 |
return p.getY();
|
|
133 |
return this.y;
|
|
130 | 134 |
} |
131 | 135 |
|
132 | 136 |
/* (non-Javadoc) |
... | ... | |
140 | 144 |
* @see java.awt.Shape#getBounds2D() |
141 | 145 |
*/ |
142 | 146 |
public Rectangle2D getBounds2D() { |
143 |
return new Rectangle2D.Double(p.getX(), p.getY(), 0, 0);
|
|
147 |
return new Rectangle2D.Double(x, y, 0, 0);
|
|
144 | 148 |
} |
145 | 149 |
|
146 | 150 |
/* (non-Javadoc) |
... | ... | |
154 | 158 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
155 | 159 |
*/ |
156 | 160 |
public boolean intersects(Rectangle2D r) { |
157 |
return r.contains(this.p);
|
|
161 |
return r.contains(new Point2D.Double(x, y));
|
|
158 | 162 |
} |
159 | 163 |
|
160 | 164 |
/* (non-Javadoc) |
161 | 165 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
162 | 166 |
*/ |
163 | 167 |
public PathIterator getPathIterator(AffineTransform at) { |
164 |
return new FPointIterator(p, at);
|
|
168 |
return new FPointIterator(new Point2D.Double(x, y), at);
|
|
165 | 169 |
} |
166 | 170 |
|
167 | 171 |
/* (non-Javadoc) |
168 | 172 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double) |
169 | 173 |
*/ |
170 | 174 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
171 |
return new FPointIterator(p, at);
|
|
175 |
return new FPointIterator(new Point2D.Double(x, y), at);
|
|
172 | 176 |
} |
173 | 177 |
|
174 | 178 |
/** |
... | ... | |
182 | 186 |
* @see com.iver.cit.gvsig.fmap.core.FShape#cloneFShape() |
183 | 187 |
*/ |
184 | 188 |
public FShape cloneFShape() { |
185 |
return new FPoint2D(p.getX(), p.getY());
|
|
189 |
return new FPoint2D(x, y);
|
|
186 | 190 |
} |
187 | 191 |
|
188 | 192 |
/* (non-Javadoc) |
189 | 193 |
* @see com.iver.cit.gvsig.fmap.core.FShape#reProject(org.cresques.cts.ICoordTrans) |
190 | 194 |
*/ |
191 | 195 |
public void reProject(ICoordTrans ct) { |
196 |
Point2D p = new Point2D.Double(x, y); |
|
192 | 197 |
p = ct.convert(p, p); |
198 |
x = p.getX(); |
|
199 |
y = p.getY(); |
|
193 | 200 |
} |
194 | 201 |
} |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FPolyline2D.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.core; |
42 | 42 |
|
43 |
import org.cresques.cts.ICoordTrans; |
|
44 |
|
|
45 |
import com.vividsolutions.jts.geom.Coordinate; |
|
46 |
import com.vividsolutions.jts.geom.CoordinateArrays; |
|
47 |
import com.vividsolutions.jts.geom.GeometryFactory; |
|
48 |
|
|
49 | 43 |
import java.awt.Rectangle; |
50 | 44 |
import java.awt.geom.AffineTransform; |
51 |
import java.awt.geom.PathIterator; |
|
52 | 45 |
import java.awt.geom.Line2D; |
46 |
import java.awt.geom.PathIterator; |
|
53 | 47 |
import java.awt.geom.Point2D; |
54 | 48 |
import java.awt.geom.Rectangle2D; |
49 |
import java.io.Serializable; |
|
55 | 50 |
import java.util.ArrayList; |
56 | 51 |
|
52 |
import org.cresques.cts.ICoordTrans; |
|
57 | 53 |
|
54 |
|
|
58 | 55 |
/** |
59 | 56 |
* DOCUMENT ME! |
60 | 57 |
* |
61 | 58 |
* @author Fernando Gonz?lez Cort?s |
62 | 59 |
*/ |
63 |
public class FPolyline2D implements FShape {
|
|
60 |
public class FPolyline2D implements FShape{ |
|
64 | 61 |
protected GeneralPathX gp; |
65 | 62 |
/** |
66 | 63 |
* Crea un nuevo FPolyline2D. |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayer.java | ||
---|---|---|
65 | 65 |
* Obtiene una representaci?n de la colecci?n de capas de forma recursiva |
66 | 66 |
* |
67 | 67 |
* @return XMLEntity. |
68 |
* @throws XMLException |
|
68 | 69 |
*/ |
69 |
XMLEntity getXMLEntity(); |
|
70 |
XMLEntity getXMLEntity() throws XMLException;
|
|
70 | 71 |
|
71 | 72 |
/** |
72 | 73 |
* Inserta las propiedades del XMLEntity al objeto actual. |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/VectorialAdapter.java | ||
---|---|---|
132 | 132 |
/** |
133 | 133 |
* Devuelve el DataSource a pasrtir del nombre. |
134 | 134 |
* |
135 |
* @param name Nombre. |
|
136 |
* |
|
137 | 135 |
* @return DataSource. |
138 | 136 |
* |
139 | 137 |
* @throws DriverLoadException |
140 | 138 |
*/ |
141 |
public abstract DataSource getRecordset(String name)
|
|
139 |
public abstract DataSource getRecordset() |
|
142 | 140 |
throws DriverLoadException; |
143 | 141 |
|
144 | 142 |
/** |
branches/Fmap_GisPlanet/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/VectorialFileAdapter.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.layers; |
42 | 42 |
|
43 |
import com.hardcode.driverManager.DriverLoadException; |
|
43 |
import java.awt.geom.Rectangle2D; |
|
44 |
import java.io.File; |
|
45 |
import java.io.IOException; |
|
44 | 46 |
|
47 |
import com.hardcode.driverManager.DriverLoadException; |
|
45 | 48 |
import com.hardcode.gdbms.engine.data.DataSource; |
46 | 49 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
47 |
import com.hardcode.gdbms.engine.data.FileDriver; |
|
48 | 50 |
import com.hardcode.gdbms.engine.data.NoSuchTableException; |
49 |
import com.hardcode.gdbms.engine.data.ReadDriver; |
|
50 |
|
|
51 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
51 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
52 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver; |
|
52 | 53 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
53 | 54 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
54 | 55 |
import com.iver.cit.gvsig.fmap.drivers.ExternalData; |
... | ... | |
57 | 58 |
import com.iver.cit.gvsig.fmap.rendering.indexes.IndexNotExistsException; |
58 | 59 |
import com.iver.cit.gvsig.fmap.write.FileWriterDriver; |
59 | 60 |
|
60 |
import java.awt.geom.Rectangle2D; |
|
61 | 61 |
|
62 |
import java.io.File; |
|
63 |
import java.io.IOException; |
|
64 |
|
|
65 |
|
|
66 | 62 |
/** |
67 | 63 |
* Adapta un driver de fichero vectorial a la interfaz vectorial, manteniendo |
68 | 64 |
* adem?s el estado necesario por una capa vectorial de fichero (el nombre del |
... | ... | |
199 | 195 |
/** |
200 | 196 |
* @see com.iver.cit.gvsig.fmap.layers.VectorialAdapter#getRecordset() |
201 | 197 |
*/ |
202 |
public DataSource getRecordset(String name) throws DriverLoadException {
|
|
198 |
public DataSource getRecordset() throws DriverLoadException { |
|
203 | 199 |
try { |
204 | 200 |
if (ds == null) { |
205 | 201 |
VectorialFileDriver driver = (VectorialFileDriver) getDriver(); |
... | ... | |
209 | 205 |
File dataFile = ed.getDataFile(file); |
210 | 206 |
String driverName = ed.getDataDriverName(); |
211 | 207 |
|
Also available in: Unified diff