Revision 3057

View differences:

trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrGeoRaster.java
466 466
		vista.getMapControl().getMapContext().invalidate();	
467 467
	}
468 468
	
469
	/**
470
	 * Carga los datos de un n?mero de punto determinado. Actualizar? las mini imagenes y los textField.
471
	 * @param nPunto N?mero de punto a cargar
472
	 */
473
	public void loadPointData(int nPunto, GeoreferencingDialog dialog, View vista, FLyrPoints plyr){
474
		
475
	}
476
	
477 469
}
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrPoints.java
67 67
	public class GeoPoint{
68 68
		public Point2D pixelPoint = null;
69 69
		public Point2D mapPoint = null;
70
		public ViewPort leftViewPort =  null, rightViewPort = null;
71
		public Point2D  leftCenterPoint = null, rightCenterPoint = null;
70 72
		public GeoPoint(Point2D p, Point2D m){
71 73
			this.pixelPoint = p;
72 74
			this.mapPoint = m;
73 75
		}
76

  
74 77
	}
75 78
	
76 79
	private ArrayList pointList = new ArrayList();
......
272 275
	}
273 276
	
274 277
	/**
278
	 *Asigna el extent para las mini imagenes. Estas deben ser recuperadas cuando se selecciona
279
	 *un punto
280
	 */
281
	public void setMiniExtent(int nPoint, Point2D centerPoint, ViewPort vp, boolean isRight){
282
		if(isRight){
283
			((GeoPoint)pointList.get(nPoint)).rightCenterPoint = centerPoint;
284
			((GeoPoint)pointList.get(nPoint)).rightViewPort = vp;
285
		}else{
286
			((GeoPoint)pointList.get(nPoint)).leftCenterPoint = centerPoint;
287
			((GeoPoint)pointList.get(nPoint)).leftViewPort = vp;
288
		}
289
	}
290
	
291
	/**
292
	 * Obtiene el extent de la mini imagen
293
	 * @param nPoint Punto de la lista
294
	 * @return
295
	 */
296
	public ViewPort getMiniExtent(int nPoint, boolean isRight){
297
		if(isRight)
298
			return ((GeoPoint)pointList.get(nPoint)).rightViewPort;
299
		else
300
			return ((GeoPoint)pointList.get(nPoint)).leftViewPort;
301
	}
302
	
303
	/**
304
	 * Obtiene el punto central de la mini imagen
305
	 * @param nPoint Punto de la lista
306
	 * @return
307
	 */
308
	public Point2D getCenterPoint(int nPoint, boolean isRight){
309
		if(isRight)
310
			return ((GeoPoint)pointList.get(nPoint)).rightCenterPoint;
311
		else
312
			return ((GeoPoint)pointList.get(nPoint)).leftCenterPoint;
313
	}
314
	
315
	/**
275 316
	 * Muestra en consola los puntos de la capa
276 317
	 */
277 318
	public void showPoints(){
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/SelectPointsPanel.java
237 237
    		dataPointPanel.getLatitud().setText(tailDecimal(""+pto.mapPoint.getY()));
238 238
    		dataPointPanel.getLongitud().setText(tailDecimal(""+pto.mapPoint.getX()));
239 239
    	}
240
    	
241
    	//Cargamos las mini imagenes
242
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setCenterPoint(lyrPoints.getCenterPoint(pos, false));
243
		this.grd.getConectorPanel().getAdjustGeorefPanel().setNumberPoint(pos);
244
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setNewViewPort(lyrPoints.getMiniExtent(pos, false));
245
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().draw();
246
    	
247
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setCenterPoint(lyrPoints.getCenterPoint(pos, true));
248
		this.grd.getConectorPanel().getAdjustGeorefPanel().setNumberPoint(pos);
249
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setNewViewPort(lyrPoints.getMiniExtent(pos, true));
250
    	this.grd.getConectorPanel().getAdjustGeorefPanel().getZoomRight().draw();
240 251
	}
241 252
	
242 253
	/**
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/ZoomControlPanel.java
253 253
	public void actionPerformed(ActionEvent e) {
254 254
		if(e.getSource() == bZoomMas){
255 255
			canvas.calcZoom(0.6);
256
			canvas.repaint();//.update();
256
			canvas.repaint();
257 257
		}
258 258
		
259 259
		if(e.getSource() == bZoomMenos){
260 260
			canvas.calcZoom(1.8);
261
			canvas.repaint();//.update();
261
			canvas.repaint();
262 262
		}
263 263
		
264 264
	}
......
278 278
		return lyrGeoRaster;
279 279
	}
280 280

  
281
	
281 282
	/**
283
	 * @return Returns the lyrPoints.
284
	 */
285
	public FLyrPoints getLyrPoints() {
286
		return lyrPoints;
287
	}
288
	
289
	/**
282 290
	 * @return Returns the dialog.
283 291
	 */
284 292
	public GeoreferencingDialog getDialog() {
293
		if(dialog == null)
294
			this.loadLayer();
285 295
		return dialog;
286 296
	}	
287 297
	
298
    /**
299
     * Asigna el viewPort recalculado
300
     * @param vp ViewPort
301
     */
302
    public void setNewViewPort(ViewPort vp){
303
    	canvas.setNewViewPort(vp);
304
    }
305
    
288 306
	/**
289 307
	 * Control que representa la zona de dibujado de la ventana. Este se encarga de
290 308
	 * repintar el contenido sobre el Graphics2D a partir del viewPort que se le pase
......
334 352
	    }
335 353

  
336 354
	    /**
355
	     * Asigna el viewPort recalculado
356
	     * @param vp ViewPort
357
	     */
358
	    public void setNewViewPort(ViewPort vp){
359
	    	this.newViewPort = vp;
360
	    	System.out.println("===>"+newViewPort.getExtent());
361
	    }
362
	    
363
	    /**
337 364
	     * Calcula el zoom dependiendo del factor de escala pasado por
338 365
	     * par?metro.
339 366
	     */
......
356 383
	    public void initViewPort(){
357 384
	    	if(centerPoint != null){
358 385
	    		newViewPort = this.viewPort.cloneViewPort();
359
	    		
360 386
	        	//Hallamos la relaci?n entre el pixel y las WC a partir de la imagen de la capa
361 387
				double relacionPixelWcWidth =  ((viewPort.getExtent().getMaxX() - viewPort.getExtent().getMinX()) / zoom)/this.getWidth();
362 388
				double relacionPixelWcHeight = ((viewPort.getExtent().getMaxY() - viewPort.getExtent().getMinY()) / zoom)/this.getHeight();
......
392 418
		        
393 419
		        try{     		       
394 420
			        if(newViewPort != null){
421
			        	int pos = Integer.valueOf(zoomControl.getDialog().getSelectPointsPanel().getTableControlerPanel().getCPoint().getSelectedItem().toString()).intValue() - 1;
422
			        	if(!zoomControl.isRightControl())
423
			        		zoomControl.getLyrPoints().setMiniExtent(pos, 
424
			        												centerPoint,
425
																	newViewPort, 
426
																	true);
427
			        	else
428
			        		zoomControl.getLyrPoints().setMiniExtent(pos, 
429
																	centerPoint,
430
																	newViewPort, 
431
																	false);
395 432
			        	//Si no tenemos las capas las cargamos
396
			        	 if(flayers == null){
433
			        	if(flayers == null){
397 434
			        	 	View theView = (View) PluginServices.getMDIManager().getActiveView();
398 435
			        	 	flayers = theView.getMapControl().getMapContext().getLayers();
399
			        	 }
400
			        	 //dibujamos
401
			        	 flayers.draw(null, (Graphics2D) dbGraphics, newViewPort,new Cancellable() {
402
							public boolean isCanceled() {
436
			        	}
437
			        	//dibujamos
438
			        	flayers.draw(null, (Graphics2D) dbGraphics, newViewPort,new Cancellable() {
439
			        		public boolean isCanceled() {
403 440
								return false;
404 441
							}
405
			        	 },flayers.getFMap().getScaleView());
406
			        	 flayers.draw(null, gTmp, newViewPort,new Cancellable() {
407
							public boolean isCanceled() {
442
			        	},flayers.getFMap().getScaleView());
443
			        	flayers.draw(null, gTmp, newViewPort,new Cancellable() {
444
			        		public boolean isCanceled() {
408 445
								return false;
409 446
							}
410
			        	 },flayers.getFMap().getScaleView());
447
			        	},flayers.getFMap().getScaleView());
411 448
			        }
412 449
		        }catch (DriverException e) {
413 450
		        	 e.printStackTrace();
......
557 594

  
558 595

  
559 596
	
560
	
597

  
561 598
 }

Also available in: Unified diff