Statistics
| Revision:

root / branches / pilotoDWG / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / VectorialFileDriver.java @ 2303

History | View | Annotate | Download (3.46 KB)

1 1100 fjp
/* 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 214 fernando
package com.iver.cit.gvsig.fmap.drivers;
42
43 408 fernando
import com.iver.cit.gvsig.fmap.core.IGeometry;
44
45 214 fernando
import java.awt.geom.Rectangle2D;
46 408 fernando
47 214 fernando
import java.io.File;
48
import java.io.IOException;
49
50 408 fernando
51
/**
52
 * Interfaz a implementar por los drivers. El constructor no ha de tener
53
 * par?metros y ha de ser r?pido, para las tareas de inicializaci?n de la capa
54
 * se deber? de utilizar initialize.
55
 */
56 214 fernando
public interface VectorialFileDriver extends VectorialDriver {
57 408 fernando
    /**
58
     * Abre el fichero para una serie de operaciones.
59
     *
60
     * @param f Fichero sobre el que se va a operar
61
     *
62
     * @throws IOException Si se produce alg?n error
63
     */
64 214 fernando
    void open(File f) throws IOException;
65
66 408 fernando
    /**
67
     * Cuando se terminan las operaciones sobre el fichero se invoca ?ste
68
     * m?todo para cerrar el descriptor que se abri? en f
69
     *
70
     * @throws IOException Si se produce alg?n error
71
     */
72 214 fernando
    void close() throws IOException;
73
74 408 fernando
    /**
75
     * Obtiene del fichero abierto en open la geometr?a index-?sima
76
     *
77
     * @param index ?ndice de la geometr?a que se quiere obtener
78
     *
79
     * @return IGeometry. Construida mediante llamadas a ShapeFactory
80
     *
81
     * @throws IOException Si se produce alg?n error
82
     */
83 305 fjp
    IGeometry getShape(int index) throws IOException;
84 214 fernando
85 408 fernando
    /**
86
     * Obtiene el n?mero de geometr?as que contiene
87
     * la capa
88
     *
89
     * @return int
90
     *
91
     * @throws IOException Si se produce alg?n error
92
     */
93 214 fernando
    int getShapeCount() throws IOException;
94 408 fernando
95
    /**
96
     * Obtiene el bounding box de la capa
97
     *
98
     * @return Rectangle2D
99
     *
100
     * @throws IOException Si se produce alg?n error
101
     */
102 214 fernando
    Rectangle2D getFullExtent() throws IOException;
103 408 fernando
104
    /**
105
     * M?todo invocado una s?la vez durante la ejecuci?n justo antes
106
     * de visualizar una capa. En ?l se deben de hacer las inicializaciones
107
     * necesarias
108
     *
109
     * @throws IOException Si se produce alg?n error
110 1786 vcaballero
     * @throws DriverIOException
111 408 fernando
     */
112 1786 vcaballero
    void initialize() throws DriverIOException;
113 408 fernando
114
    /**
115
     * Define los tipos de fichero que puede leer el driver. Si devuelve true,
116
     * el fichero est? aceptado (es de los que el driver puede leer), si
117
     * devuelve false es porque no lo puede leer.
118
     *
119 1005 vcaballero
     * @param f Fichero
120 408 fernando
     *
121 1005 vcaballero
     * @return boolean
122 408 fernando
     */
123
    boolean accept(File f);
124 1233 fjp
125
126 214 fernando
}