Revision 3102 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrGeoRaster.java
FLyrGeoRaster.java | ||
---|---|---|
51 | 51 |
import com.iver.cit.gvsig.StackZoom; |
52 | 52 |
import com.iver.cit.gvsig.fmap.DriverException; |
53 | 53 |
import com.iver.cit.gvsig.fmap.ViewPort; |
54 |
import com.iver.cit.gvsig.fmap.layers.FLyrPoints.GeoPoint; |
|
54 | 55 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
55 | 56 |
import com.iver.cit.gvsig.gui.View; |
56 | 57 |
import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog; |
57 |
import com.iver.cit.gvsig.gui.Panels.ZoomControlPanel; |
|
58 | 58 |
import com.iver.cit.gvsig.gui.Panels.TablePointsPanel.PointTable; |
59 | 59 |
|
60 | 60 |
|
... | ... | |
365 | 365 |
* crear? una. |
366 | 366 |
* @return Capa de puntos |
367 | 367 |
*/ |
368 |
public FLyrPoints getFLyrPoints(){ |
|
368 |
public FLyrPoints getFLyrPoints()throws ClassCastException{ |
|
369 |
|
|
369 | 370 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
370 |
|
|
371 |
|
|
371 | 372 |
//Si no existe una capa de puntos la creamos |
372 | 373 |
if(lyrPoints == null){ |
373 | 374 |
lyrPoints = new FLyrPoints(); |
... | ... | |
423 | 424 |
* dialogo y la tabla. |
424 | 425 |
* |
425 | 426 |
*/ |
426 |
public void updateData(int nPunto, Point2D pixel, Point2D map, GeoreferencingDialog dialog, View vista, FLyrPoints plyr){
|
|
427 |
if(dialog == null || vista == null || plyr == null)
|
|
427 |
public void updateData(int nPunto, Point2D pixel, Point2D map, GeoreferencingDialog dialog, View view, FLyrPoints plyr){
|
|
428 |
if(dialog == null || plyr == null) |
|
428 | 429 |
return; |
429 | 430 |
if(pixel == null && map == null) |
430 | 431 |
return; |
... | ... | |
432 | 433 |
//Actualizamos los textBox |
433 | 434 |
if(pixel != null){ |
434 | 435 |
dialog.setPixelText(pixel.getX(), pixel.getY()); |
435 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastTx = String.valueOf(pixel.getX());
|
|
436 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastTy = String.valueOf(pixel.getY());
|
|
436 |
dialog.getSelectPointsPanel().lastTx = String.valueOf(pixel.getX()); |
|
437 |
dialog.getSelectPointsPanel().lastTy = String.valueOf(pixel.getY()); |
|
437 | 438 |
} |
438 | 439 |
if(map != null){ |
439 | 440 |
dialog.setMapCoordText(map.getX(), map.getY()); |
440 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastLong = String.valueOf(map.getX());
|
|
441 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastLat = String.valueOf(map.getX());
|
|
441 |
dialog.getSelectPointsPanel().lastLong = String.valueOf(map.getX()); |
|
442 |
dialog.getSelectPointsPanel().lastLat = String.valueOf(map.getX()); |
|
442 | 443 |
} |
443 | 444 |
|
445 |
//El Checkbox de activaci?n |
|
446 |
dialog.getOptionsPanel().getCbActivePoint().setSelected(((GeoPoint)getFLyrPoints().getPoint(nPunto - 1)).active); |
|
447 |
|
|
444 | 448 |
//Actualizamos la tabla |
445 | 449 |
PointTable pointsTable = dialog.getConectorPanel().getDataPointsTabPanel().getTablePointsPanel().getJTable(); |
446 |
if(pointsTable.getTable().getRowCount() < nPunto){
|
|
450 |
while(pointsTable.getTable().getRowCount() < nPunto)
|
|
447 | 451 |
pointsTable.getTableModel().addNew(); |
448 |
pointsTable.getTableModel().setValueAt(String.valueOf(nPunto - 1),nPunto - 1,0); |
|
449 |
} |
|
452 |
pointsTable.getTableModel().setValueAt(String.valueOf(nPunto - 1),nPunto - 1,0); |
|
453 |
|
|
454 |
//if(pointsTable.getTable().getRowCount() < nPunto){ |
|
455 |
//pointsTable.getTableModel().addNew(); |
|
456 |
//pointsTable.getTableModel().setValueAt(String.valueOf(nPunto - 1),nPunto - 1,0); |
|
457 |
//} |
|
450 | 458 |
if(pixel != null){ |
451 | 459 |
pointsTable.getTableModel().setValueAt(String.valueOf(pixel.getX()),nPunto - 1,1); |
452 | 460 |
pointsTable.getTableModel().setValueAt(String.valueOf(pixel.getY()),nPunto - 1,2); |
... | ... | |
457 | 465 |
} |
458 | 466 |
|
459 | 467 |
//Actualizamos la miniimagen |
460 |
ViewPort viewPort = vista.getMapControl().getMapContext().getViewPort(); |
|
461 |
if(pixel != null){ |
|
462 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setCenterPoint(this.img2World(pixel)); |
|
463 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
464 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().draw(); |
|
468 |
if(view != null){ |
|
469 |
ViewPort viewPort = view.getMapControl().getMapContext().getViewPort(); |
|
470 |
if(pixel != null){ |
|
471 |
dialog.getZoomControlLeft().setCenterPoint(this.img2World(pixel)); |
|
472 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
473 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().draw(); |
|
474 |
} |
|
475 |
|
|
476 |
if(map != null){ |
|
477 |
dialog.getZoomControlRight().setCenterPoint(map); |
|
478 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
479 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomRight().draw(); |
|
480 |
} |
|
481 |
|
|
482 |
//Actualizamos la vista |
|
483 |
view.getMapControl().getMapContext().invalidate(); |
|
465 | 484 |
} |
466 |
|
|
467 |
if(map != null){ |
|
468 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setCenterPoint(map); |
|
469 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
470 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomRight().draw(); |
|
471 |
} |
|
472 |
|
|
473 | 485 |
//Actualizamos la capa de puntos |
474 | 486 |
plyr.updatePoint(pixel, map, nPunto - 1); |
475 | 487 |
|
476 |
//Actualizamos la vista |
|
477 |
vista.getMapControl().getMapContext().invalidate(); |
|
478 | 488 |
} |
479 | 489 |
|
480 | 490 |
|
Also available in: Unified diff