Revision 6313 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableDBAdapter.java
VectorialEditableDBAdapter.java | ||
---|---|---|
226 | 226 |
*/ |
227 | 227 |
public VectorialEditableDBAdapter() { |
228 | 228 |
super(); |
229 |
// TODO Auto-generated constructor stub |
|
230 | 229 |
} |
231 | 230 |
|
232 | 231 |
/* |
... | ... | |
305 | 304 |
|
306 | 305 |
} |
307 | 306 |
|
308 |
/* |
|
309 |
* (non-Javadoc) |
|
310 |
* |
|
311 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#stopEdition(com.iver.cit.gvsig.fmap.edition.IWriter) |
|
312 |
*/ |
|
313 |
public void stopEdition(IWriter writer, int sourceType) throws EditionException { |
|
314 |
// TODO Auto-generated method stub |
|
315 |
super.stopEdition(writer, sourceType); |
|
316 |
} |
|
317 |
|
|
318 | 307 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) |
319 | 308 |
throws DriverException { |
320 | 309 |
return new MyIterator(r, strEPSG); |
... | ... | |
325 | 314 |
return new MyIterator(r, strEPSG); |
326 | 315 |
} |
327 | 316 |
|
328 |
public String[] getFields() { |
|
329 |
VectorialDBAdapter orig = (VectorialDBAdapter) ova; |
|
330 |
return orig.getFields(); |
|
331 |
} |
|
332 |
|
|
333 |
public String getWhereClause() { |
|
334 |
VectorialDBAdapter orig = (VectorialDBAdapter) ova; |
|
335 |
return orig.getWhereClause(); |
|
336 |
} |
|
337 |
|
|
338 |
public String getTableName() { |
|
339 |
VectorialDBAdapter orig = (VectorialDBAdapter) ova; |
|
340 |
return orig.getTableName(); |
|
341 |
} |
|
342 |
|
|
343 | 317 |
public DBLayerDefinition getLyrDef() { |
344 | 318 |
VectorialDBAdapter orig = (VectorialDBAdapter) ova; |
345 | 319 |
return orig.getLyrDef(); |
346 | 320 |
} |
347 | 321 |
|
348 | 322 |
public int getRowIndexByFID(IFeature feat) { |
349 |
/* int resul; |
|
350 |
VectorialDBAdapter orig = (VectorialDBAdapter) ova; |
|
351 |
resul = orig.getRowIndexByFID(feat); |
|
352 |
int externalIndex = -1; |
|
353 |
if (resul == -1) |
|
354 |
{ |
|
355 |
// No est? en los originales. Si no est? borrado, |
|
356 |
// estar? en el fichero de expansi?n. |
|
357 |
Integer integer = (Integer) hashFIDtoExpansionFile.get(feat.getID()); |
|
358 |
resul = integer.intValue(); |
|
359 |
IRowEdited rowEd; |
|
360 |
try { |
|
361 |
rowEd = expansionFile.getRow(resul); |
|
362 |
externalIndex = rowEd.getIndex(); |
|
363 |
} catch (IOException e) { |
|
364 |
// TODO Auto-generated catch block |
|
365 |
e.printStackTrace(); |
|
366 |
} |
|
367 |
|
|
368 |
|
|
369 |
} |
|
370 |
else |
|
371 |
{ |
|
372 |
externalIndex = getInversedIndex(resul); |
|
373 |
} */ |
|
374 | 323 |
Integer calculatedIndex = (Integer) mapFID2index.get(feat.getID()); |
375 | 324 |
return getInversedIndex(calculatedIndex.intValue()); |
376 | 325 |
} |
... | ... | |
380 | 329 |
*/ |
381 | 330 |
public int doAddRow(IRow feat, int sourceType) throws DriverIOException, IOException { |
382 | 331 |
int calculatedIndex = super.doAddRow(feat, sourceType); |
383 |
Integer posInExpansionFile = (Integer) relations.get(new Integer(calculatedIndex)); |
|
332 |
// Integer posInExpansionFile = (Integer) relations.get(new Integer(calculatedIndex));
|
|
384 | 333 |
Integer virtual = new Integer(calculatedIndex); // calculatedIndex es igual al numero de shapes originales + el numero de entidades a?adidas. |
385 | 334 |
// es decir, virtual es el calculatedIndex (no tiene en cuenta los borrados) |
386 | 335 |
// calculatedIndex = indiceExterno + borrados hasta ese punto. |
... | ... | |
423 | 372 |
} |
424 | 373 |
|
425 | 374 |
/* (non-Javadoc) |
426 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#getFeature(int) |
|
427 |
*/ |
|
428 |
public IFeature getFeature(int numReg) throws DriverException { |
|
429 |
// TODO Auto-generated method stub |
|
430 |
return super.getFeature(numReg); |
|
431 |
} |
|
432 |
|
|
433 |
/* (non-Javadoc) |
|
434 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#getRow(int) |
|
435 |
*/ |
|
436 |
public IRowEdited getRow(int index) throws DriverIOException, IOException { |
|
437 |
// TODO Auto-generated method stub |
|
438 |
return super.getRow(index); |
|
439 |
} |
|
440 |
|
|
441 |
/* (non-Javadoc) |
|
442 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#getShape(int) |
|
443 |
*/ |
|
444 |
public IGeometry getShape(int rowIndex) throws DriverIOException { |
|
445 |
// TODO Auto-generated method stub |
|
446 |
return super.getShape(rowIndex); |
|
447 |
} |
|
448 |
|
|
449 |
/* (non-Javadoc) |
|
450 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#getShapeBounds(int) |
|
451 |
*/ |
|
452 |
public Rectangle2D getShapeBounds(int index) throws IOException { |
|
453 |
// TODO Auto-generated method stub |
|
454 |
return super.getShapeBounds(index); |
|
455 |
} |
|
456 |
|
|
457 |
/* (non-Javadoc) |
|
458 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#getShapeType(int) |
|
459 |
*/ |
|
460 |
public int getShapeType(int index) { |
|
461 |
// TODO Auto-generated method stub |
|
462 |
return super.getShapeType(index); |
|
463 |
} |
|
464 |
|
|
465 |
/* (non-Javadoc) |
|
466 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#setOriginalVectorialAdapter(com.iver.cit.gvsig.fmap.layers.ReadableVectorial) |
|
467 |
*/ |
|
468 |
public void setOriginalVectorialAdapter(ReadableVectorial rv) { |
|
469 |
// El ?ndice espacial se est? calcualndo en el startEdition, pero |
|
470 |
// OJO: No se hace con un while, sino con un getRow(). |
|
471 |
// Si va lento, habr? que reescribirlo. |
|
472 |
super.setOriginalVectorialAdapter(rv); |
|
473 |
} |
|
474 |
|
|
475 |
/* (non-Javadoc) |
|
476 | 375 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#undoAddRow(int) |
477 | 376 |
*/ |
478 | 377 |
public void undoAddRow(int calculatedIndex, int sourceType) throws DriverIOException, IOException { |
... | ... | |
485 | 384 |
|
486 | 385 |
} |
487 | 386 |
|
488 |
/* (non-Javadoc) |
|
489 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#undoModifyRow(int, int) |
|
490 |
*/ |
|
491 |
public void undoModifyRow(int geometryIndex, int previousExpansionFileIndex, int sourceType) throws IOException, DriverIOException { |
|
492 |
// TODO Auto-generated method stub |
|
493 |
super.undoModifyRow(geometryIndex, previousExpansionFileIndex, sourceType); |
|
494 |
} |
|
495 | 387 |
|
496 |
/* (non-Javadoc) |
|
497 |
* @see com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter#undoRemoveRow(int) |
|
498 |
*/ |
|
499 |
public void undoRemoveRow(int index, int sourceType) throws IOException, DriverIOException { |
|
500 |
// TODO Auto-generated method stub |
|
501 |
super.undoRemoveRow(index, sourceType); |
|
502 |
} |
|
503 |
|
|
504 | 388 |
} |
Also available in: Unified diff