root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / write / EditionSourceAdapter.java @ 1100
History | View | Annotate | Download (4.98 KB)
1 |
/* Generated by Together */
|
---|---|
2 |
|
3 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
4 |
*
|
5 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
6 |
*
|
7 |
* This program is free software; you can redistribute it and/or
|
8 |
* modify it under the terms of the GNU General Public License
|
9 |
* as published by the Free Software Foundation; either version 2
|
10 |
* of the License, or (at your option) any later version.
|
11 |
*
|
12 |
* This program is distributed in the hope that it will be useful,
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
* GNU General Public License for more details.
|
16 |
*
|
17 |
* You should have received a copy of the GNU General Public License
|
18 |
* along with this program; if not, write to the Free Software
|
19 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
20 |
*
|
21 |
* For more information, contact:
|
22 |
*
|
23 |
* Generalitat Valenciana
|
24 |
* Conselleria d'Infraestructures i Transport
|
25 |
* Av. Blasco Ib??ez, 50
|
26 |
* 46010 VALENCIA
|
27 |
* SPAIN
|
28 |
*
|
29 |
* +34 963862235
|
30 |
* gvsig@gva.es
|
31 |
* www.gvsig.gva.es
|
32 |
*
|
33 |
* or
|
34 |
*
|
35 |
* IVER T.I. S.A
|
36 |
* Salamanca 50
|
37 |
* 46005 Valencia
|
38 |
* Spain
|
39 |
*
|
40 |
* +34 963163400
|
41 |
* dac@iver.es
|
42 |
*/
|
43 |
package com.iver.cit.gvsig.fmap.write; |
44 |
|
45 |
import java.awt.geom.Rectangle2D; |
46 |
import java.util.BitSet; |
47 |
|
48 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
49 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
50 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
51 |
import com.iver.cit.gvsig.fmap.write.geometron.EditableFeatureSource; |
52 |
public class EditionSourceAdapter implements EditableFeatureSource { |
53 |
/**
|
54 |
* Abre el ReadableVectorial que est? adaptando
|
55 |
*/
|
56 |
public void start() throws DriverIOException{ } |
57 |
|
58 |
/**
|
59 |
* Cierra el ReadableVectorial que est? adaptando
|
60 |
*/
|
61 |
public void stop() throws DriverIOException{ } |
62 |
|
63 |
/**
|
64 |
* Obtiene la shape i-?sima, independientemente de d?nde est?, si en la fuente de datos que se est? editando o en uno de los ExtensionFile. Si la geometria que se est? editando ha sido eliminada se devolver? una NullGeometry
|
65 |
*/
|
66 |
public IGeometry getShape(int index) throws DriverIOException{ |
67 |
// TODO implementar bien
|
68 |
return null; |
69 |
} |
70 |
|
71 |
/**
|
72 |
* Obtiene el n?mero de features de la capa en edici?n teniendo en cuenta las geometrias que se han a?adido y que las geometr?as eliminadas son marcadas pero siguen teni?ndose en cuenta.
|
73 |
*/
|
74 |
public int getShapeCount() throws DriverIOException{ |
75 |
// TODO implementar bien
|
76 |
return -1; |
77 |
} |
78 |
|
79 |
/**
|
80 |
* Genera un AddCommand, lo ejecuta y lo apila
|
81 |
*/
|
82 |
public void addGeometry(IGeometry g){ } |
83 |
|
84 |
/**
|
85 |
* Genera un ModifyCommand y lo apila
|
86 |
*/
|
87 |
public void modifyGeometry(int id, IGeometry g){ } |
88 |
|
89 |
/**
|
90 |
* Genera un DeleteCommand y lo apila.
|
91 |
*/
|
92 |
public void deleteGeometry(int id){ } |
93 |
|
94 |
/**
|
95 |
* Deshace el ?ltimo comando
|
96 |
*/
|
97 |
public void undo() { |
98 |
} |
99 |
|
100 |
/**
|
101 |
* Marca el registro i-?simo como no modificado, eliminando
|
102 |
*/
|
103 |
public void setNotModified(int i) { |
104 |
} |
105 |
|
106 |
/**
|
107 |
* Marca el registro i-?simo como eliminado
|
108 |
*/
|
109 |
public void setDeleted(int i) { |
110 |
} |
111 |
|
112 |
/**
|
113 |
* Marca el registro i-?simo como no eliminado
|
114 |
*/
|
115 |
public void setNotDeleted() { |
116 |
} |
117 |
|
118 |
/**
|
119 |
* Realiza la modificaci?n de una de las geometr?as del ReadableVectorial
|
120 |
*/
|
121 |
public void modify(IGeometry g) { |
122 |
} |
123 |
|
124 |
/**
|
125 |
* A lo largo de la edici?n puede darse que haya features que se modifican y luego que se deshace su modificaci?n
|
126 |
* . Estas features no se pueden eliminar del fichero porque las relaciones que hay en el IndexesMap cambiar?an err?neamente. El proceso de compactaci?n consistir? en ver las features que hay en el BitSet modified y generar un nuevo IndexesMap correcto. Adem?s compacta el editionFile y el extensionFile
|
127 |
*/
|
128 |
public void compactar() { |
129 |
} |
130 |
|
131 |
/**
|
132 |
* Vectorial que se est? editando
|
133 |
*/
|
134 |
private ReadableVectorial readableVectorial;
|
135 |
|
136 |
/**
|
137 |
* Fichero con las features modificadas
|
138 |
*/
|
139 |
private ExtensibleFile editionFile;
|
140 |
|
141 |
/**
|
142 |
* Fichero con las features a?adidas
|
143 |
*/
|
144 |
private ExtensibleFile extensionFile;
|
145 |
private CommandList commandStack;
|
146 |
|
147 |
/**
|
148 |
* Indica las features eliminadas de la ReadableVectorial que se est? editando
|
149 |
*/
|
150 |
private BitSet deleted; |
151 |
|
152 |
/**
|
153 |
* Indica los ?ndices de las features modificadas y que por tanto est?n en el editionFile
|
154 |
*/
|
155 |
private BitSet modified; |
156 |
|
157 |
/**
|
158 |
* Mapeo entre los ?ndices de la ReadableVecotorial y el editionFile
|
159 |
*/
|
160 |
private ModifiedMap indexesMap;
|
161 |
private ModifiedMap modifiedMap;
|
162 |
/**
|
163 |
* @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getFullExtent()
|
164 |
*/
|
165 |
public Rectangle2D getFullExtent() throws DriverIOException { |
166 |
return null; |
167 |
} |
168 |
|
169 |
/* (non-Javadoc)
|
170 |
* @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getShapeType()
|
171 |
*/
|
172 |
public int getShapeType() throws DriverIOException { |
173 |
// TODO Auto-generated method stub
|
174 |
return 0; |
175 |
} |
176 |
} |