root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / gt2 / DemoGT2driver.java @ 1691
History | View | Annotate | Download (3.52 KB)
1 |
/*
|
---|---|
2 |
* Created on 02-mar-2005
|
3 |
*
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Generalitat Valenciana
|
25 |
* Conselleria d'Infraestructures i Transport
|
26 |
* Av. Blasco Ib??ez, 50
|
27 |
* 46010 VALENCIA
|
28 |
* SPAIN
|
29 |
*
|
30 |
* +34 963862235
|
31 |
* gvsig@gva.es
|
32 |
* www.gvsig.gva.es
|
33 |
*
|
34 |
* or
|
35 |
*
|
36 |
* IVER T.I. S.A
|
37 |
* Salamanca 50
|
38 |
* 46005 Valencia
|
39 |
* Spain
|
40 |
*
|
41 |
* +34 963163400
|
42 |
* dac@iver.es
|
43 |
*/
|
44 |
package com.iver.cit.gvsig.fmap.drivers.gt2; |
45 |
|
46 |
import java.awt.geom.Rectangle2D; |
47 |
import java.io.IOException; |
48 |
|
49 |
import org.geotools.data.DataStore; |
50 |
import org.geotools.feature.GeometryAttributeType; |
51 |
import org.geotools.feature.type.BasicFeatureTypes; |
52 |
|
53 |
import com.iver.cit.gvsig.fmap.core.FShape; |
54 |
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes; |
55 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
56 |
import com.iver.cit.gvsig.fmap.drivers.shp.SHP; |
57 |
|
58 |
/**
|
59 |
* @author FJP
|
60 |
*
|
61 |
* TODO To change the template for this generated type comment go to
|
62 |
* Window - Preferences - Java - Code Generation - Code and Comments
|
63 |
*/
|
64 |
public class DemoGT2driver implements VectorialDriver { |
65 |
|
66 |
private DataStore dataStore;
|
67 |
/* (non-Javadoc)
|
68 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getShapeType()
|
69 |
*/
|
70 |
public int getShapeType() { |
71 |
int auxType = 0; |
72 |
GeometryAttributeType geomType; |
73 |
try {
|
74 |
geomType = dataStore.getSchema("").getDefaultGeometry();
|
75 |
if (geomType.getType() == BasicFeatureTypes.POLYGON.getClass())
|
76 |
auxType = auxType | FShape.POLYGON; |
77 |
if (geomType.getType() == BasicFeatureTypes.POINT.getClass())
|
78 |
auxType = auxType | FShape.POINT; |
79 |
if (geomType.getType() == BasicFeatureTypes.LINE.getClass())
|
80 |
auxType = auxType | FShape.LINE; |
81 |
} catch (IOException e) { |
82 |
// TODO Auto-generated catch block
|
83 |
e.printStackTrace(); |
84 |
} |
85 |
|
86 |
return auxType;
|
87 |
} |
88 |
|
89 |
/* (non-Javadoc)
|
90 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getDriverAttributes()
|
91 |
*/
|
92 |
public DriverAttributes getDriverAttributes() {
|
93 |
// TODO Auto-generated method stub
|
94 |
return null; |
95 |
} |
96 |
|
97 |
/* (non-Javadoc)
|
98 |
* @see com.hardcode.driverManager.Driver#getName()
|
99 |
*/
|
100 |
public String getName() { |
101 |
// TODO Auto-generated method stub
|
102 |
return null; |
103 |
} |
104 |
|
105 |
/* (non-Javadoc)
|
106 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getShapeCount()
|
107 |
*/
|
108 |
public int getShapeCount() throws IOException { |
109 |
// TODO Auto-generated method stub
|
110 |
return 0; |
111 |
} |
112 |
|
113 |
/* (non-Javadoc)
|
114 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getFullExtent()
|
115 |
*/
|
116 |
public Rectangle2D getFullExtent() throws IOException { |
117 |
// TODO Auto-generated method stub
|
118 |
return null; |
119 |
} |
120 |
|
121 |
} |