Revision 1828 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java

View differences:

FLyrVect.java
40 40
 */
41 41
package com.iver.cit.gvsig.fmap.layers;
42 42

  
43
import java.awt.Graphics2D;
44
import java.awt.geom.Point2D;
45
import java.awt.geom.Rectangle2D;
46
import java.awt.image.BufferedImage;
47
import java.util.ArrayList;
48
import java.util.BitSet;
49

  
50
import org.apache.log4j.Logger;
51
import org.cresques.cts.ICoordTrans;
52

  
43 53
import com.hardcode.driverManager.DriverLoadException;
44

  
45 54
import com.hardcode.gdbms.engine.data.DataSource;
55
import com.hardcode.gdbms.engine.data.NoSuchTableException;
46 56
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException;
47 57
import com.hardcode.gdbms.engine.values.DoubleValue;
48 58
import com.hardcode.gdbms.engine.values.FloatValue;
49 59
import com.hardcode.gdbms.engine.values.NullValue;
50 60
import com.hardcode.gdbms.engine.values.Value;
51

  
52 61
import com.iver.cit.gvsig.fmap.DriverException;
53 62
import com.iver.cit.gvsig.fmap.ViewPort;
54 63
import com.iver.cit.gvsig.fmap.core.IGeometry;
......
72 81
import com.iver.cit.gvsig.fmap.rendering.LegendChangedEvent;
73 82
import com.iver.cit.gvsig.fmap.rendering.LegendFactory;
74 83
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
75

  
76 84
import com.iver.utiles.XMLEntity;
77 85

  
78
import org.apache.log4j.Logger;
79 86

  
80
import org.cresques.cts.ICoordTrans;
81

  
82
import java.awt.Graphics2D;
83
import java.awt.geom.Point2D;
84
import java.awt.geom.Rectangle2D;
85
import java.awt.image.BufferedImage;
86

  
87
import java.util.ArrayList;
88
import java.util.BitSet;
89

  
90

  
91 87
/**
92 88
 * Capa b?sica Vectorial.
93 89
 *
......
310 306
			e.printStackTrace();
311 307
		} catch (DriverException e) {
312 308
			e.printStackTrace();
313
		} catch (com.hardcode.gdbms.engine.data.DriverException e) {
309
		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
314 310
			// TODO Auto-generated catch block
315 311
			e.printStackTrace();
316 312
		}
......
403 399
	}
404 400

  
405 401
	/**
402
	 * @throws DriverException
406 403
	 * @see com.iver.cit.gvsig.fmap.layers.CommonOperations#getRecordset()
407 404
	 */
408 405
	public SelectableDataSource getRecordset() throws DriverException {
409
		if (sds == null) {
410
			//Nombre en el GDBMS de la tabla
411
			String name = this.toString();
412

  
406
		if (sds == null){
413 407
			try {
414
				DataSource ds = source.getRecordset(name);
408
				DataSource ds = source.getRecordset();
415 409

  
416 410
				if (ds == null) {
417 411
					return null;
......
419 413

  
420 414
				sds = new SelectableDataSource(ds);
421 415
				sds.setSelectionSupport(selectionSupport);
416
				
417
				return sds;
422 418
			} catch (DriverLoadException e) {
423 419
				throw new DriverException(e);
424 420
			}
425 421
		}
426

  
427 422
		return sds;
428 423
	}
429 424

  
......
452 447
		} catch (FieldNotFoundException e) {
453 448
			// TODO Auto-generated catch block
454 449
			e.printStackTrace();
455
		} catch (com.hardcode.gdbms.engine.data.DriverException e) {
450
		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
456 451
			throw new DriverException(e);
457 452
        }
458 453

  
......
493 488
	}
494 489

  
495 490
	/**
491
	 * @throws XMLException
496 492
	 * @see com.iver.cit.gvsig.fmap.layers.FLayer#getProperties()
497 493
	 */
498
	public XMLEntity getXMLEntity() {
494
	public XMLEntity getXMLEntity() throws XMLException {
499 495
		XMLEntity xml = super.getXMLEntity();
500 496
		xml.addChild(legend.getXMLEntity());
501 497
		xml.addChild(selectionSupport.getXMLEntity());
502 498

  
503 499
		if (source instanceof VectorialFileAdapter) {
500
			xml.putProperty("type", "vectorial");
504 501
			xml.putProperty("file", ((VectorialFileAdapter) source).getFile());
502
			try {
503
				xml.putProperty("recordset-name", getRecordset().getName());
504
			} catch (DriverException e) {
505
				throw new XMLException(e);
506
			}
505 507
		} else if (source instanceof VectorialDBAdapter) {
506 508
		} else if (source instanceof WFSAdapter) {
507 509
		}
......
528 530
		} catch (DriverException e) {
529 531
			throw new XMLException(e);
530 532
		}	
533
		
534
		selectionSupport.setXMLEntity(xml.getChild(1));
531 535

  
532
		selectionSupport.setXMLEntity(xml.getChild(1));
536
		String recordsetName = xml.getStringProperty("recordset-name");
537
		try {
538
			LayerFactory.getDataSourceFactory().changeDataSourceName(
539
					getRecordset().getName(),
540
					recordsetName);
541
		} catch (NoSuchTableException e1) {
542
			throw new XMLException(e1);
543
		} catch (DriverException e1) {
544
			throw new XMLException(e1);
545
		}
533 546
	}
534 547

  
535 548
	/**

Also available in: Unified diff