Revision 559 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dgn/DGNDriver.java
DGNDriver.java | ||
---|---|---|
7 | 7 |
import java.io.IOException; |
8 | 8 |
import java.util.ArrayList; |
9 | 9 |
|
10 |
import com.hardcode.gdbms.engine.data.DriverException; |
|
11 |
import com.hardcode.gdbms.engine.data.FileDriver; |
|
12 |
import com.hardcode.gdbms.engine.values.Value; |
|
10 | 13 |
import com.iver.cit.gvsig.fmap.core.FGeometry; |
11 | 14 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
12 | 15 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
... | ... | |
21 | 24 |
* |
22 | 25 |
* @author Vicente Caballero Navarro |
23 | 26 |
*/ |
24 |
public class DGNDriver implements VectorialFileDriver { |
|
27 |
public class DGNDriver implements VectorialFileDriver, FileDriver {
|
|
25 | 28 |
|
26 | 29 |
DGNReader m_DgnReader; |
27 | 30 |
|
... | ... | |
34 | 37 |
private final int ID_FIELD_TEXT=6; |
35 | 38 |
|
36 | 39 |
private String path; |
40 |
private File m_Fich; |
|
37 | 41 |
|
38 | 42 |
/** |
39 | 43 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#open(java.io.File) |
40 | 44 |
*/ |
41 | 45 |
public void open(File f) throws IOException { |
42 |
m_DgnReader = new DGNReader(f.getAbsolutePath());
|
|
46 |
m_Fich = f;
|
|
43 | 47 |
} |
44 | 48 |
|
45 | 49 |
/** |
... | ... | |
416 | 420 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#initialize() |
417 | 421 |
*/ |
418 | 422 |
public void initialize() throws IOException { |
419 |
|
|
423 |
m_DgnReader = new DGNReader(m_Fich.getAbsolutePath()); |
|
420 | 424 |
} |
421 | 425 |
|
422 | 426 |
/** |
423 | 427 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDriver#getShapeType() |
424 | 428 |
*/ |
425 | 429 |
public int getShapeType() { |
426 |
return 1;//TODO queda pendiente que tipo de shape.
|
|
430 |
return 15;
|
|
427 | 431 |
} |
428 | 432 |
|
429 | 433 |
/** |
... | ... | |
455 | 459 |
//TODO implementar bien |
456 | 460 |
return null; |
457 | 461 |
} |
462 |
|
|
463 |
/* (non-Javadoc) |
|
464 |
* @see com.hardcode.gdbms.engine.data.FileDriver#fileAccepted(java.io.File) |
|
465 |
*/ |
|
466 |
public boolean fileAccepted(File f) { |
|
467 |
return f.getName().toUpperCase().endsWith("DGN"); |
|
468 |
} |
|
469 |
|
|
470 |
/* (non-Javadoc) |
|
471 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldValue(long, int) |
|
472 |
*/ |
|
473 |
public Value getFieldValue(long rowIndex, int fieldId) throws DriverException { |
|
474 |
// TODO Auto-generated method stub |
|
475 |
return null; |
|
476 |
} |
|
477 |
|
|
478 |
/* (non-Javadoc) |
|
479 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldCount() |
|
480 |
*/ |
|
481 |
public int getFieldCount() throws DriverException { |
|
482 |
// TODO Auto-generated method stub |
|
483 |
return 0; |
|
484 |
} |
|
485 |
|
|
486 |
/* (non-Javadoc) |
|
487 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getFieldName(int) |
|
488 |
*/ |
|
489 |
public String getFieldName(int fieldId) throws DriverException { |
|
490 |
// TODO Auto-generated method stub |
|
491 |
return null; |
|
492 |
} |
|
493 |
|
|
494 |
/* (non-Javadoc) |
|
495 |
* @see com.hardcode.gdbms.engine.data.ReadDriver#getRowCount() |
|
496 |
*/ |
|
497 |
public long getRowCount() throws DriverException { |
|
498 |
try { |
|
499 |
return getShapeCount(); |
|
500 |
} catch (IOException e) { |
|
501 |
e.printStackTrace(); |
|
502 |
} |
|
503 |
return -1; |
|
504 |
} |
|
458 | 505 |
} |
Also available in: Unified diff