Revision 3301 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayers.java
FLayers.java | ||
---|---|---|
63 | 63 |
import com.iver.cit.gvsig.fmap.ViewPort; |
64 | 64 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
65 | 65 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDatabaseDriver; |
66 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
|
66 | 67 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
67 | 68 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.LayerCollection; |
68 | 69 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData; |
... | ... | |
70 | 71 |
import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor; |
71 | 72 |
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException; |
72 | 73 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
74 |
import com.iver.utiles.IPersistance; |
|
73 | 75 |
import com.iver.utiles.XMLEntity; |
74 | 76 |
|
75 | 77 |
/** |
... | ... | |
672 | 674 |
e.printStackTrace(); |
673 | 675 |
throw new XMLException(e); |
674 | 676 |
} |
677 |
} |
|
678 |
// Clases con algun driver gen?rico creado por otro |
|
679 |
// programador |
|
680 |
if (xml.getChild(i).contains("other")) { |
|
681 |
|
|
682 |
String driverName = xml.getChild(i).getStringProperty("other"); |
|
683 |
VectorialDriver driver = null; |
|
684 |
try { |
|
685 |
driver = (VectorialDriver) LayerFactory.getDM().getDriver(driverName); |
|
686 |
} catch (DriverLoadException e) { |
|
687 |
// Si no existe ese driver, no pasa nada. |
|
688 |
// Puede que el desarrollador no quiera que |
|
689 |
// aparezca en el cuadro de di?logo y ha metido |
|
690 |
// el jar con sus clases en nuestro directorio lib. |
|
691 |
// Intentamos cargar esa clase "a pelo". |
|
692 |
if (xml.contains("className")) |
|
693 |
{ |
|
694 |
String className2 = xml.getChild(i).getStringProperty("className"); |
|
695 |
try { |
|
696 |
driver = (VectorialDriver) Class.forName(className2).newInstance(); |
|
697 |
} catch (Exception e1) { |
|
698 |
throw new XMLException(e1); |
|
699 |
} |
|
700 |
} |
|
701 |
} |
|
702 |
if (driver instanceof IPersistance) |
|
703 |
{ |
|
704 |
IPersistance persist = (IPersistance) driver; |
|
705 |
persist.setXMLEntity(xml.getChild(i).getChild(2)); |
|
706 |
} |
|
707 |
layer = LayerFactory.createLayer(s[i], driver, proj); |
|
675 | 708 |
} |
676 | 709 |
|
710 |
|
|
677 | 711 |
} else if ("raster".equals(type)) { |
678 | 712 |
/* if (xml.getChild(i).contains("file")) { |
679 | 713 |
Driver d = LayerFactory.getDM().getDriver(xml.getChild(i).getStringProperty("driverName")); |
Also available in: Unified diff