Revision 11034 branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/ShpStrategy.java

View differences:

ShpStrategy.java
69 69
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
70 70
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial;
71 71
import com.iver.cit.gvsig.fmap.layers.SpatialCache;
72
import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData;
73 72
import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial;
74 73
import com.iver.cit.gvsig.fmap.layers.layerOperations.Selectable;
75 74
import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer;
76
import com.iver.cit.gvsig.fmap.rendering.ClassifiedLegendInfo;
77 75
import com.iver.cit.gvsig.fmap.rendering.VectorialLegend;
78 76
import com.iver.utiles.swing.threads.Cancellable;
79 77
import com.iver.utiles.swing.threads.CancellableMonitorable;
......
132 130
			VectorialLegend l = (VectorialLegend) ((ClassifiableVectorial) getCapa())
133 131
					.getLegend();
134 132

  
135
			if (l instanceof ClassifiedLegendInfo) {
136
				ClassifiedLegendInfo clsfLegend = (ClassifiedLegendInfo) l;
137
				ISymbol[] symbs = clsfLegend.getSymbols();
138
				// double rSym = 0;
139
				// double maxRSym = -1;
133
//			if (l instanceof ClassifiedLegendInfo) {
134
//				ClassifiedLegendInfo clsfLegend = (ClassifiedLegendInfo) l;
135
//				ISymbol[] symbs = clsfLegend.getSymbols();
136
//				// double rSym = 0;
137
//				// double maxRSym = -1;
138
//
139
//				for (int i = 0; i < symbs.length; i++) {
140
//					// TODO: REVISAR LOS SIMBOLOS Y SUS TAMA?OS
141
//
142
//					/*
143
//					 * Style2D pointSymbol = symbs[i].getPointStyle2D(); if
144
//					 * (pointSymbol instanceof MarkStyle2D) { MarkStyle2D mrk2D =
145
//					 * (MarkStyle2D) pointSymbol; rSym =
146
//					 * viewPort.toMapDistance(mrk2D.getSize()); if (maxRSym <
147
//					 * rSym) maxRSym = rSym; }
148
//					 */
149
//				}
150
//			}
140 151

  
141
				for (int i = 0; i < symbs.length; i++) {
142
					// TODO: REVISAR LOS SIMBOLOS Y SUS TAMA?OS
143

  
144
					/*
145
					 * Style2D pointSymbol = symbs[i].getPointStyle2D(); if
146
					 * (pointSymbol instanceof MarkStyle2D) { MarkStyle2D mrk2D =
147
					 * (MarkStyle2D) pointSymbol; rSym =
148
					 * viewPort.toMapDistance(mrk2D.getSize()); if (maxRSym <
149
					 * rSym) maxRSym = rSym; }
150
					 */
151
				}
152
			}
153

  
154 152
			Rectangle2D extent = viewPort.getAdjustedExtent();
155 153
			// AffineTransform at = viewPort.getAffineTransform();
156 154

  
......
160 158

  
161 159
			long t1 = System.currentTimeMillis();
162 160
			// logger.debug("getCapa().getRecordset().start()");
163
			
161

  
164 162
			//CHEMA
165 163
			// En teorioa el al hacer el adapter.start()
166 164
			// deja abierta las fuentes de datos
167 165
			// geometrica y alfanumerica (cuando no son la misma
168
			// excepto cuando se ha hecho una operacion de 'join' de la tabla 
166
			// excepto cuando se ha hecho una operacion de 'join' de la tabla
169 167
			// (join de las tablas de gvsig(gdbms) no join de sql), entoces
170 168
			// el origen alfanumerico no es el mismo en el source
171 169
			// que en la capa.
......
236 234
				auxBI = new BufferedImage(image.getWidth(), image.getHeight(),
237 235
						image.getType());
238 236
			}
239

  
240 237
			for (int aux = 0; aux < sc; aux++) {
241 238
				// Salimos si alguien cancela
239

  
242 240
				if (cancel != null) {
243 241
					// azabala (por si acaso, al arreglar bug de process)
244 242
					if (cancel.isCanceled()) {
245
						break;
243
						return;
246 244
					}
247 245
				}
248 246
				if (bUseSpatialIndex) {
......
276 274
						// geom = ShapeFactory.createPolygon2D(new
277 275
						// GeneralPathX(bounds));
278 276

  
279
						
277

  
280 278
						//JMVIVO: OJO, No colnamos siempre porque
281 279
						// el FGeometry.drawInt (a diferencia del
282 280
						// FGeometry.draw) clona siempre la geometria
......
342 340
			// logger.debug("getCapa().getRecordset().stop()");
343 341
			//CHEMA
344 342
			// Cerramos la fuente alfanumerica cuando se ha hecho
345
			// una operacion de 'join'			
343
			// una operacion de 'join'
346 344
			//((FLyrVect) getCapa()).getSource().getRecordset().stop();
347 345
			if (lyr.isJoined()){
348 346
				lyr.getRecordset().stop();
......
420 418

  
421 419
			long t1 = System.currentTimeMillis();
422 420
			// logger.debug("getCapa().getRecordset().start()");
423
			
421

  
424 422
			//CHEMA
425 423
			// En teorioa el al hacer el adapter.start()
426 424
			// deja abierta las fuentes de datos
427 425
			// geometrica y alfanumerica (cuando no son la misma
428
			// excepto cuando se ha hecho una operacion de 'join' de la tabla 
426
			// excepto cuando se ha hecho una operacion de 'join' de la tabla
429 427
			// (join de las tablas de gvsig(gdbms) no join de sql), entoces
430 428
			// el origen alfanumerico no es el mismo en el source
431 429
			// que en la capa.
......
435 433
				lyr.getRecordset().start();
436 434
			}
437 435
			//CHEMA
438
			
439
			
436

  
437

  
440 438
			// TODO: A revisar si es o no conveniente este sistema
441 439
			// de comunicaci?n con los drivers.
442 440
			DriverAttributes attr = adapter.getDriverAttributes();
......
495 493
					// PRUEBA DE VELOCIDAD
496 494
					// geom = ShapeFactory.createPolygon2D(new
497 495
					// GeneralPathX(bounds));
498
					
496

  
499 497
					// JMVIVO: Clonamos siempre que sea necesario y no
500 498
					// solo si hay que reproyectar. Porque el FGeometry.draw
501 499
					// va a aplicar la transformacion sobre la geometria original
......
514 512
			// logger.debug("getCapa().getRecordset().stop()");
515 513
			//CHEMA
516 514
			// Cerramos la fuente alfanumerica cuando se ha hecho
517
			// una operacion de 'join'			
515
			// una operacion de 'join'
518 516
			//((FLyrVect) getCapa()).getSource().getRecordset().stop();
519 517
			if (lyr.isJoined()){
520 518
				lyr.getRecordset().stop();

Also available in: Unified diff