Revision 3058
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/fmap/layers/FLyrPoints.java | ||
---|---|---|
279 | 279 |
*un punto |
280 | 280 |
*/ |
281 | 281 |
public void setMiniExtent(int nPoint, Point2D centerPoint, ViewPort vp, boolean isRight){ |
282 |
System.out.println("1---->>>"+vp.getExtent()); |
|
282 | 283 |
if(isRight){ |
283 | 284 |
((GeoPoint)pointList.get(nPoint)).rightCenterPoint = centerPoint; |
284 | 285 |
((GeoPoint)pointList.get(nPoint)).rightViewPort = vp; |
... | ... | |
294 | 295 |
* @return |
295 | 296 |
*/ |
296 | 297 |
public ViewPort getMiniExtent(int nPoint, boolean isRight){ |
297 |
if(isRight) |
|
298 |
if(isRight){ |
|
299 |
System.out.println("2---->>>"+((GeoPoint)pointList.get(nPoint)).rightViewPort.getExtent()); |
|
298 | 300 |
return ((GeoPoint)pointList.get(nPoint)).rightViewPort; |
299 |
else |
|
301 |
}else{ |
|
302 |
System.out.println("2---->>>"+((GeoPoint)pointList.get(nPoint)).leftViewPort.getExtent()); |
|
300 | 303 |
return ((GeoPoint)pointList.get(nPoint)).leftViewPort; |
304 |
} |
|
301 | 305 |
} |
302 | 306 |
|
303 | 307 |
/** |
... | ... | |
321 | 325 |
System.out.println("PUNTO "+i+": "); |
322 | 326 |
System.out.println("pix->"+((GeoPoint)pointList.get(i)).pixelPoint.getX()+" "+((GeoPoint)pointList.get(i)).pixelPoint.getY()); |
323 | 327 |
System.out.println("map->"+((GeoPoint)pointList.get(i)).mapPoint.getX()+" "+((GeoPoint)pointList.get(i)).mapPoint.getY()); |
328 |
System.out.println("extRight->"+((GeoPoint)pointList.get(i)).rightViewPort.getExtent()); |
|
329 |
System.out.println("extLeft->"+((GeoPoint)pointList.get(i)).leftViewPort.getExtent()); |
|
324 | 330 |
}else |
325 | 331 |
System.out.println("PUNTO "+i+": NULL"); |
326 | 332 |
} |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/SelectPointsPanel.java | ||
---|---|---|
211 | 211 |
* @return Cadena de salida con decimales recortados |
212 | 212 |
*/ |
213 | 213 |
public static String tailDecimal(String s){ |
214 |
int len = 2;
|
|
214 |
int len = 5;
|
|
215 | 215 |
int index = s.indexOf("."); |
216 | 216 |
if( index == -1) |
217 | 217 |
return s; |
... | ... | |
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
/** |
299 |
* Actualiza el punto de la capa que corresponde con el que |
|
300 |
* hay seleccionado en el combo. Los valores que se usan para la |
|
301 |
* actualizaci?n son los del info del panel. Si hubiese alg?n valor |
|
302 |
* en blanco la actualizaci?n no se produce. |
|
303 |
*/ |
|
304 |
private void updatePoint()throws NoSuchFieldException{ |
|
305 |
if(tableControlerPanel.getCPoint().getSelectedIndex() != -1){ |
|
306 |
Point2D pixel = null, map = null; |
|
307 |
checkInfoPointText(); |
|
308 |
pixel = new Point2D.Double(); |
|
309 |
pixel.setLocation( Double.valueOf(dataPointPanel.getTX().getText()).doubleValue(), |
|
310 |
Double.valueOf(dataPointPanel.getTY().getText()).doubleValue()); |
|
311 |
map = new Point2D.Double(); |
|
312 |
map.setLocation( Double.valueOf(dataPointPanel.getLongitud().getText()).doubleValue(), |
|
313 |
Double.valueOf(dataPointPanel.getLatitud().getText()).doubleValue()); |
|
314 |
lyrPoints.updatePoint(pixel, map, tableControlerPanel.getCPoint().getSelectedIndex()); |
|
315 |
} |
|
316 |
} |
|
317 |
|
|
318 |
/** |
|
319 | 299 |
* Esta funci?n resetea los controles del panel de info de un punto. |
320 | 300 |
*/ |
321 | 301 |
public void resetControls(boolean active){ |
... | ... | |
332 | 312 |
* Cuando pasamos de un punto a otro o se va a crear uno nuevo |
333 | 313 |
* <UL> |
334 | 314 |
* <LI>Cargamos la capa FLyrPoint si no est? ya cargada.</LI> |
335 |
* <LI>Actualizamos el punto seleccionado en ese momento y lanzamos una excepci?n si hay alg?n campo vacio.</LI>
|
|
315 |
* <LI>Comprobamos que los campos no esten vacios y lanzamos una excepci?n si hay alg?n campo vacio si lo est?n.</LI>
|
|
336 | 316 |
* <LI>Insertamos el nuevo punto seleccionado en los campos de informaci?n.</LI> |
337 | 317 |
* <LI>Checkeamos las flechas para ver si tenemos que activarlas o desactivarlas.</LI> |
338 | 318 |
* </UL> |
... | ... | |
342 | 322 |
private void changePoint(boolean changeSelection, int pos){ |
343 | 323 |
loadLyrPoint(); |
344 | 324 |
try{ |
345 |
updatePoint();
|
|
325 |
checkInfoPointText();
|
|
346 | 326 |
if(changeSelection){ |
347 | 327 |
isNew = true; |
348 | 328 |
lastIndexSelection = pos; |
... | ... | |
674 | 654 |
if(e.getSource() == tableControlerPanel.getBNew()){ |
675 | 655 |
loadLyrPoint(); |
676 | 656 |
try{ |
677 |
updatePoint(); |
|
657 |
if(this.getTableControlerPanel().getCPoint().getItemCount() > 0) |
|
658 |
checkInfoPointText(); |
|
678 | 659 |
lyrPoints.addPoint(null, null); |
679 | 660 |
isNew = true; |
680 | 661 |
tableControlerPanel.getCPoint().addItem("" + lyrPoints.getCountPoints()); |
trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/ZoomControlPanel.java | ||
---|---|---|
197 | 197 |
*/ |
198 | 198 |
public void setViewPort(ViewPort viewPort) { |
199 | 199 |
this.viewPort = viewPort; |
200 |
canvas.setViewPort(this.viewPort); |
|
200 | 201 |
} |
201 | 202 |
|
202 | 203 |
/** |
... | ... | |
204 | 205 |
*/ |
205 | 206 |
public void draw(){ |
206 | 207 |
if(canvas != null){ |
207 |
canvas.setViewPort(this.viewPort); |
|
208 | 208 |
canvas.repaint(); |
209 | 209 |
} |
210 | 210 |
} |
... | ... | |
357 | 357 |
*/ |
358 | 358 |
public void setNewViewPort(ViewPort vp){ |
359 | 359 |
this.newViewPort = vp; |
360 |
System.out.println("===>"+newViewPort.getExtent()); |
|
361 | 360 |
} |
362 | 361 |
|
363 | 362 |
/** |
... | ... | |
419 | 418 |
try{ |
420 | 419 |
if(newViewPort != null){ |
421 | 420 |
int pos = Integer.valueOf(zoomControl.getDialog().getSelectPointsPanel().getTableControlerPanel().getCPoint().getSelectedItem().toString()).intValue() - 1; |
421 |
|
|
422 | 422 |
if(!zoomControl.isRightControl()) |
423 | 423 |
zoomControl.getLyrPoints().setMiniExtent(pos, |
424 | 424 |
centerPoint, |
... | ... | |
429 | 429 |
centerPoint, |
430 | 430 |
newViewPort, |
431 | 431 |
false); |
432 |
|
|
432 | 433 |
//Si no tenemos las capas las cargamos |
433 | 434 |
if(flayers == null){ |
434 | 435 |
View theView = (View) PluginServices.getMDIManager().getActiveView(); |
... | ... | |
556 | 557 |
zoomControl.getDialog(), |
557 | 558 |
theView, |
558 | 559 |
lp); |
560 |
|
|
559 | 561 |
}else{ //Control de actualizaci?n de coordenadas del mundo |
560 | 562 |
Point2D mapPoint = new Point2D.Double(); |
561 | 563 |
mapPoint.setLocation(destX, destY); |
Also available in: Unified diff