Revision 3011
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrPoints.java | ||
---|---|---|
116 | 116 |
lyrGeoRaster = (FLyrGeoRaster)lyr; |
117 | 117 |
} |
118 | 118 |
|
119 |
for(int i=0; i<pointList.size();i++){ |
|
120 |
|
|
121 |
//Punto de la imagen |
|
122 |
pto = ((GeoPoint)pointList.get(i)).pixelPoint; |
|
123 |
|
|
124 |
if(pto != null){ |
|
125 |
g.setColor(Color.red); |
|
126 |
//g.setXORMode(Color.white); |
|
127 |
Point2D p = lyrGeoRaster.img2World(pto); |
|
128 |
p = vp.fromMapPoint(p); |
|
129 |
g.drawOval( (int)p.getX() - dpto, |
|
130 |
(int)p.getY() - dpto, |
|
131 |
DIAM_CIRCLE, |
|
132 |
DIAM_CIRCLE); |
|
133 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
|
134 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
|
119 |
if(lyrGeoRaster != null){ |
|
120 |
for(int i=0; i<pointList.size();i++){ |
|
121 |
|
|
122 |
//Punto de la imagen |
|
123 |
pto = ((GeoPoint)pointList.get(i)).pixelPoint; |
|
124 |
|
|
125 |
if(pto != null){ |
|
126 |
g.setColor(Color.red); |
|
127 |
//g.setXORMode(Color.white); |
|
128 |
Point2D p = lyrGeoRaster.img2World(pto); |
|
129 |
p = vp.fromMapPoint(p); |
|
130 |
g.drawOval( (int)p.getX() - dpto, |
|
131 |
(int)p.getY() - dpto, |
|
132 |
DIAM_CIRCLE, |
|
133 |
DIAM_CIRCLE); |
|
134 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
|
135 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
|
136 |
} |
|
137 |
|
|
138 |
//Punto de la vista |
|
139 |
pto = ((GeoPoint)pointList.get(i)).mapPoint; |
|
140 |
if(pto != null){ |
|
141 |
Point2D p = vp.fromMapPoint(pto); |
|
142 |
g.setColor(Color.green); |
|
143 |
//g.setXORMode(Color.white); |
|
144 |
g.drawOval( (int)p.getX() - dpto, |
|
145 |
(int)p.getY() - dpto, |
|
146 |
DIAM_CIRCLE, |
|
147 |
DIAM_CIRCLE); |
|
148 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
|
149 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
|
150 |
} |
|
135 | 151 |
} |
136 |
|
|
137 |
//Punto de la vista |
|
138 |
pto = ((GeoPoint)pointList.get(i)).mapPoint; |
|
139 |
if(pto != null){ |
|
140 |
Point2D p = vp.fromMapPoint(pto); |
|
141 |
g.setColor(Color.green); |
|
142 |
//g.setXORMode(Color.white); |
|
143 |
g.drawOval( (int)p.getX() - dpto, |
|
144 |
(int)p.getY() - dpto, |
|
145 |
DIAM_CIRCLE, |
|
146 |
DIAM_CIRCLE); |
|
147 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
|
148 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
|
149 |
} |
|
150 |
} |
|
152 |
} |
|
151 | 153 |
} |
152 | 154 |
|
153 | 155 |
/* (non-Javadoc) |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Dialogs/GeoreferencingDialog.java | ||
---|---|---|
318 | 318 |
|
319 | 319 |
if(lyrGeoRaster != null){ |
320 | 320 |
lyrGeoRaster.setFLyrPoints(lyrPoints); |
321 |
lyrGeoRaster.setGeoDialog(this); |
|
321 |
//lyrGeoRaster.setGeoDialog(this);
|
|
322 | 322 |
} |
323 | 323 |
|
324 | 324 |
theView.getMapControl().setTool("zoomIn"); |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/GeoRasterWizard.java | ||
---|---|---|
46 | 46 |
import java.awt.event.ActionEvent; |
47 | 47 |
import java.awt.geom.Rectangle2D; |
48 | 48 |
import java.io.File; |
49 |
import java.util.ArrayList; |
|
49 | 50 |
|
50 | 51 |
import javax.swing.JButton; |
51 | 52 |
import javax.swing.JCheckBox; |
... | ... | |
57 | 58 |
import javax.swing.JLayeredPane; |
58 | 59 |
import javax.swing.JPanel; |
59 | 60 |
import javax.swing.JTextField; |
60 |
import javax.swing.event.InternalFrameEvent; |
|
61 |
import javax.swing.event.InternalFrameListener; |
|
62 | 61 |
import javax.swing.filechooser.FileFilter; |
63 | 62 |
|
64 | 63 |
import org.cresques.cts.IProjection; |
... | ... | |
75 | 74 |
import com.iver.cit.gvsig.fmap.drivers.RasterDriver; |
76 | 75 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
77 | 76 |
import com.iver.cit.gvsig.fmap.layers.FLyrGeoRaster; |
78 |
import com.iver.cit.gvsig.fmap.layers.FLyrPoints; |
|
79 | 77 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
80 | 78 |
import com.iver.cit.gvsig.fmap.layers.RasterAdapter; |
81 | 79 |
import com.iver.cit.gvsig.fmap.layers.RasterFileAdapter; |
... | ... | |
401 | 399 |
|
402 | 400 |
|
403 | 401 |
if(lyrGeoRaster != null){ |
404 |
//theView.getMapControl().getMapContext().beginAtomicEvent(); |
|
405 |
//theView.getMapControl().getMapContext().getLayers().addLayer(lyrGeoRaster); |
|
406 |
//theView.getMapControl().getMapContext().endAtomicEvent(); |
|
407 | 402 |
lyrGeoRaster.getStackZoom().setInitExtent(ext); |
408 | 403 |
lyrGeoRaster.setActive(true); |
409 | 404 |
} |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/SelectPointsPanel.java | ||
---|---|---|
249 | 249 |
/** |
250 | 250 |
* Esta funci?n resetea los controles del panel de info de un punto. |
251 | 251 |
*/ |
252 |
private void resetControls(boolean active){
|
|
252 |
public void resetControls(boolean active){
|
|
253 | 253 |
getTX().setText(""); |
254 | 254 |
getTY().setText(""); |
255 | 255 |
getLatitud().setText(""); |
... | ... | |
290 | 290 |
/** |
291 | 291 |
* Limpia la lista de puntos y borra el dialogo. |
292 | 292 |
*/ |
293 |
private void clearList(){
|
|
293 |
public void clearList(){
|
|
294 | 294 |
loadLyrPoint(); |
295 | 295 |
lyrPoints.clear(); |
296 | 296 |
resetControls(false); |
... | ... | |
828 | 828 |
*/ |
829 | 829 |
public void loadFromLyrPoints(FLyrPoints lyr){ |
830 | 830 |
if(lyr != null){ |
831 |
System.out.println("......"+lyr.getName()); |
|
832 |
lyr.showPoints(); |
|
833 | 831 |
lyr.clean(); |
834 |
lyrPoints = lyr; |
|
832 |
lyrPoints = new FLyrPoints(); |
|
833 |
lyrPoints.setListPoint(lyr.getListPoint()); |
|
834 |
|
|
835 | 835 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
836 | 836 |
theView.getMapControl().getMapContext().beginAtomicEvent(); |
837 | 837 |
theView.getMapControl().getMapContext().getLayers().addLayer(lyr); |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/toc/GeoRasterTocMenuEntry.java | ||
---|---|---|
92 | 92 |
FLyrGeoRaster lyrGeoRaster = null; |
93 | 93 |
lyr = getNodeLayer(); |
94 | 94 |
GeoreferencingDialog geoDialog = null; |
95 |
|
|
95 |
|
|
96 |
|
|
97 |
PluginServices.getMainFrame().enableControls(); |
|
98 |
View vista = (View) PluginServices.getMDIManager().getActiveView(); |
|
99 |
MapControl mapCtrl = vista.getMapControl(); |
|
100 |
|
|
96 | 101 |
//Modificamos el nombre de la capa |
97 | 102 |
if ((lyr instanceof FLyrGeoRaster)){ |
98 | 103 |
lyrGeoRaster = (FLyrGeoRaster)lyr; |
99 | 104 |
lyrGeoRaster.setName("*"+lyrGeoRaster.getName()); |
105 |
lyrGeoRaster.setActive(true); |
|
100 | 106 |
geoDialog = lyrGeoRaster.getGeoDialog(); |
107 |
geoDialog.getSelectPointsPanel().resetControls(false); |
|
108 |
geoDialog.getSelectPointsPanel().getCPoint().removeAllItems(); |
|
109 |
|
|
101 | 110 |
//Cargamos la capa de puntos y los puntos desde la capa en el cuadro. |
102 | 111 |
geoDialog.getSelectPointsPanel().loadFromLyrPoints(lyrGeoRaster.getFLyrPoints()); |
103 | 112 |
} |
104 |
|
|
113 |
|
|
105 | 114 |
//Lanzamos el dialogo |
106 |
PluginServices.getMainFrame().enableControls(); |
|
107 |
View vista = (View) PluginServices.getMDIManager().getActiveView(); |
|
108 |
MapControl mapCtrl = vista.getMapControl(); |
|
109 |
|
|
110 | 115 |
JInternalFrame panel = new JInternalFrame(); |
111 | 116 |
panel.addInternalFrameListener(new com.iver.cit.gvsig.gui.toolListeners.GeoRasterFrameListener()); |
112 | 117 |
panel.setClosable(true); |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/toolListeners/GeoRasterFrameListener.java | ||
---|---|---|
82 | 82 |
lyr.isActive()){ |
83 | 83 |
lyr.setName(lyr.getName().substring(1, lyr.getName().length())); |
84 | 84 |
lyr.setActive(false); |
85 |
|
|
86 |
//Reponemos el extent inicial |
|
85 | 87 |
Extent initExtent = ((FLyrGeoRaster)lyr).getStackZoom().getInitExtent(); |
86 | 88 |
if(initExtent != null){ |
87 | 89 |
((FLyrGeoRaster)theView.getMapControl().getMapContext().getLayers().getLayer(lyr.getName())).setAssignExtent(initExtent); |
88 | 90 |
theView.getMapControl().getMapContext().invalidate(); |
89 | 91 |
} |
92 |
((FLyrGeoRaster)lyr).getGeoDialog().getSelectPointsPanel().clearList(); |
|
93 |
|
|
90 | 94 |
} |
91 |
if( lyr instanceof FLyrPoints) |
|
95 |
System.out.println("ELIMINAR!!"); |
|
96 |
if( lyr instanceof FLyrPoints){ |
|
97 |
System.out.println("ELIMINANDO "+lyr.getName()); |
|
92 | 98 |
theView.getMapControl().getMapContext().getLayers().removeLayer(i); |
93 |
|
|
94 |
|
|
99 |
} |
|
95 | 100 |
} |
96 | 101 |
|
97 | 102 |
PluginServices.getMainFrame().enableControls(); |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/StackZoom.java | ||
---|---|---|
60 | 60 |
|
61 | 61 |
private ArrayList extentList = new ArrayList(); |
62 | 62 |
private Extent initExtent = null; |
63 |
|
|
63 |
|
|
64 | 64 |
private int selectElem = -1; |
65 | 65 |
|
66 | 66 |
public StackZoom(){} |
... | ... | |
120 | 120 |
public void setInitExtent(Extent initExtent) { |
121 | 121 |
this.initExtent = initExtent; |
122 | 122 |
} |
123 |
|
|
123 | 124 |
} |
Also available in: Unified diff