Revision 7193
branches/v10/applications/appgvSIG/src/com/iver/cit/gvsig/AddLayer.java | ||
---|---|---|
53 | 53 |
|
54 | 54 |
import com.hardcode.driverManager.Driver; |
55 | 55 |
import com.hardcode.driverManager.DriverLoadException; |
56 |
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; |
|
57 | 56 |
import com.iver.andami.PluginServices; |
58 | 57 |
import com.iver.andami.messages.NotificationManager; |
59 | 58 |
import com.iver.andami.plugins.Extension; |
... | ... | |
62 | 61 |
import com.iver.cit.gvsig.fmap.ViewPort; |
63 | 62 |
import com.iver.cit.gvsig.fmap.drivers.RasterDriver; |
64 | 63 |
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver; |
65 |
import com.iver.cit.gvsig.fmap.drivers.WithDefaultLegend; |
|
66 | 64 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
67 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
|
68 | 65 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
69 | 66 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
70 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
|
71 |
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend; |
|
72 | 67 |
import com.iver.cit.gvsig.gui.FOpenDialog; |
73 | 68 |
import com.iver.cit.gvsig.gui.FileOpenDialog; |
74 | 69 |
import com.iver.cit.gvsig.gui.View; |
... | ... | |
264 | 259 |
|
265 | 260 |
|
266 | 261 |
|
267 |
try { |
|
262 |
// try {
|
|
268 | 263 |
|
269 | 264 |
// Le asignamos tambi?n una legenda por defecto acorde con |
270 | 265 |
// el tipo de shape que tenga. Tampoco s? si es aqu? el |
... | ... | |
272 | 267 |
checkProjection(lyr, mapControl.getViewPort()); |
273 | 268 |
mapControl.getMapContext().getLayers() |
274 | 269 |
.addLayer(lyr); |
275 |
|
|
276 |
if (lyr instanceof FLyrVect) |
|
277 |
{ |
|
278 |
FLyrVect lyrVect = (FLyrVect) lyr; |
|
279 |
if (drivers[iFile] instanceof WithDefaultLegend) { |
|
280 |
WithDefaultLegend aux = (WithDefaultLegend) drivers[iFile]; |
|
281 |
lyrVect.setLegend((VectorialLegend) aux.getDefaultLegend()); |
|
282 |
} else { |
|
283 |
lyrVect.setLegend(LegendFactory.createSingleSymbolLegend( |
|
284 |
lyrVect.getShapeType())); |
|
285 |
} |
|
286 |
} |
|
287 |
} catch (FieldNotFoundException e) { |
|
288 |
//Esta no puede saltar |
|
289 |
} |
|
270 |
//azabala. lo comento pq esto ya se hace en LayerFactory |
|
271 |
// if (lyr instanceof FLyrVect)
|
|
272 |
// {
|
|
273 |
// FLyrVect lyrVect = (FLyrVect) lyr;
|
|
274 |
// if (drivers[iFile] instanceof WithDefaultLegend) {
|
|
275 |
// WithDefaultLegend aux = (WithDefaultLegend) drivers[iFile];
|
|
276 |
// lyrVect.setLegend((VectorialLegend) aux.getDefaultLegend());
|
|
277 |
// } else {
|
|
278 |
// lyrVect.setLegend(LegendFactory.createSingleSymbolLegend(
|
|
279 |
// lyrVect.getShapeType()));
|
|
280 |
// }
|
|
281 |
// }
|
|
282 |
// } catch (FieldNotFoundException e) {
|
|
283 |
// //Esta no puede saltar
|
|
284 |
// }
|
|
290 | 285 |
rects[iFile]=lyr.getFullExtent(); |
291 | 286 |
|
292 | 287 |
// TODO: Poner una variable y dibujar solo cuando |
Also available in: Unified diff