Revision 3057 trunk/extensions/extGeoreferencing/src/com/iver/cit/gvsig/gui/Panels/ZoomControlPanel.java
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