Revision 3049 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrGeoRaster.java
FLyrGeoRaster.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.fmap.layers; |
42 | 42 |
|
43 |
import java.awt.Component; |
|
44 | 43 |
import java.awt.Graphics2D; |
45 | 44 |
import java.awt.geom.Point2D; |
46 | 45 |
import java.awt.geom.Rectangle2D; |
47 | 46 |
import java.awt.image.BufferedImage; |
48 | 47 |
|
49 |
import javax.swing.JOptionPane; |
|
50 |
|
|
51 | 48 |
import org.cresques.px.Extent; |
52 | 49 |
|
53 |
import com.iver.andami.PluginServices; |
|
54 | 50 |
import com.iver.cit.gvsig.StackZoom; |
55 | 51 |
import com.iver.cit.gvsig.fmap.DriverException; |
56 | 52 |
import com.iver.cit.gvsig.fmap.ViewPort; |
57 | 53 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
54 |
import com.iver.cit.gvsig.gui.View; |
|
58 | 55 |
import com.iver.cit.gvsig.gui.Dialogs.GeoreferencingDialog; |
56 |
import com.iver.cit.gvsig.gui.Panels.ZoomControlPanel; |
|
57 |
import com.iver.cit.gvsig.gui.Panels.TablePointsPanel.PointTable; |
|
59 | 58 |
|
60 | 59 |
|
61 | 60 |
/** |
... | ... | |
405 | 404 |
public void setGeoDialog(GeoreferencingDialog geoDialog) { |
406 | 405 |
this.geoDialog = geoDialog; |
407 | 406 |
} |
407 |
|
|
408 |
/** |
|
409 |
* A partir de nuevas coordenadas actualiza la vista, minimagen, capa de puntos el |
|
410 |
* dialogo y la tabla. |
|
411 |
* |
|
412 |
*/ |
|
413 |
public void updateData(int nPunto, Point2D pixel, Point2D map, GeoreferencingDialog dialog, View vista, FLyrPoints plyr){ |
|
414 |
if(dialog == null || vista == null || plyr == null) |
|
415 |
return; |
|
416 |
if(pixel == null && map == null) |
|
417 |
return; |
|
418 |
|
|
419 |
//Actualizamos los textBox |
|
420 |
if(pixel != null){ |
|
421 |
dialog.setPixelText(pixel.getX(), pixel.getY()); |
|
422 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastTx = String.valueOf(pixel.getX()); |
|
423 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastTy = String.valueOf(pixel.getY()); |
|
424 |
} |
|
425 |
if(map != null){ |
|
426 |
dialog.setMapCoordText(map.getX(), map.getY()); |
|
427 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastLong = String.valueOf(map.getX()); |
|
428 |
dialog.getConectorPanel().getDataPointsTabPanel().getSelectPointsPanel().lastLat = String.valueOf(map.getX()); |
|
429 |
} |
|
430 |
|
|
431 |
//Actualizamos la tabla |
|
432 |
PointTable pointsTable = dialog.getConectorPanel().getDataPointsTabPanel().getTablePointsPanel().getJTable(); |
|
433 |
if(pointsTable.getTable().getRowCount() < nPunto){ |
|
434 |
pointsTable.getTableModel().addNew(); |
|
435 |
pointsTable.getTableModel().setValueAt(String.valueOf(nPunto - 1),nPunto - 1,0); |
|
436 |
} |
|
437 |
if(pixel != null){ |
|
438 |
pointsTable.getTableModel().setValueAt(String.valueOf(pixel.getX()),nPunto - 1,1); |
|
439 |
pointsTable.getTableModel().setValueAt(String.valueOf(pixel.getY()),nPunto - 1,2); |
|
440 |
} |
|
441 |
if(map != null){ |
|
442 |
pointsTable.getTableModel().setValueAt(String.valueOf(map.getX()),nPunto - 1,3); |
|
443 |
pointsTable.getTableModel().setValueAt(String.valueOf(map.getY()),nPunto - 1,4); |
|
444 |
} |
|
445 |
|
|
446 |
//Actualizamos la miniimagen |
|
447 |
ViewPort viewPort = vista.getMapControl().getMapContext().getViewPort(); |
|
448 |
if(pixel != null){ |
|
449 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().setCenterPoint(this.img2World(pixel)); |
|
450 |
dialog.getConectorPanel().getAdjustGeorefPanel().setNumberPoint(nPunto); |
|
451 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
452 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomLeft().draw(); |
|
453 |
} |
|
454 |
|
|
455 |
if(map != null){ |
|
456 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomRight().setCenterPoint(map); |
|
457 |
dialog.getConectorPanel().getAdjustGeorefPanel().setNumberPoint(nPunto); |
|
458 |
dialog.getConectorPanel().getAdjustGeorefPanel().setViewPort(viewPort); |
|
459 |
dialog.getConectorPanel().getAdjustGeorefPanel().getZoomRight().draw(); |
|
460 |
} |
|
461 |
|
|
462 |
//Actualizamos la capa de puntos |
|
463 |
plyr.updatePoint(pixel, map, nPunto - 1); |
|
464 |
|
|
465 |
//Actualizamos la vista |
|
466 |
vista.getMapControl().getMapContext().invalidate(); |
|
467 |
} |
|
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 |
|
|
408 | 477 |
} |
Also available in: Unified diff