Revision 4377 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toolListeners/SaveRasterListener.java
SaveRasterListener.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig.gui.toolListeners; |
42 | 42 |
|
43 |
import java.awt.geom.Point2D; |
|
44 |
|
|
43 | 45 |
import org.cresques.ui.raster.DataInputSaveRaster; |
44 | 46 |
import org.cresques.ui.raster.SaveRasterDialogPanel; |
45 | 47 |
import org.cresques.ui.raster.SaveSetupPanel; |
46 | 48 |
|
47 | 49 |
import com.iver.andami.PluginServices; |
48 |
|
|
49 | 50 |
import com.iver.cit.gvsig.fmap.MapControl; |
50 | 51 |
import com.iver.cit.gvsig.fmap.ViewPort; |
51 | 52 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
52 | 53 |
import com.iver.cit.gvsig.fmap.layers.FLyrRaster; |
53 |
import com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent; |
|
54 | 54 |
import com.iver.cit.gvsig.fmap.tools.SaveRasterListenerImpl; |
55 |
import com.iver.cit.gvsig.fmap.tools.ZoomInListenerImpl; |
|
56 |
|
|
55 |
import com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent; |
|
57 | 56 |
import com.iver.cit.gvsig.gui.View; |
58 | 57 |
import com.iver.cit.gvsig.gui.Panels.SaveRasterDialog; |
59 | 58 |
|
... | ... | |
89 | 88 |
FLayers layers = mapCtrl.getMapContext().getLayers(); |
90 | 89 |
|
91 | 90 |
SaveRasterDialog saveRaster = new SaveRasterDialog(layers, mapCtrl); |
92 |
if(Math.abs(rect.getMaxY()-rect.getMinY())>10 && Math.abs(rect.getMaxX()-rect.getMinX())>10){ |
|
91 |
ViewPort vp = mapCtrl.getViewPort(); |
|
92 |
Point2D ini = vp.fromMapPoint(rect.getMinX(), rect.getMinY()); |
|
93 |
Point2D fin = vp.fromMapPoint(rect.getMaxX(), rect.getMaxY()); |
|
94 |
if(Math.abs(fin.getY()-ini.getY())>10 && Math.abs(fin.getX()-ini.getX())>10){ |
|
93 | 95 |
saveRaster.setProjection(((View) PluginServices.getMDIManager().getActiveView()).getProjection()); |
94 | 96 |
//saveRaster.setLayerList(this.layerList); |
95 | 97 |
DataInputSaveRaster dialog = ((SaveSetupPanel)(((SaveRasterDialogPanel)saveRaster.getContentPane()).getContentPanel())).getSaveParameters(); |
... | ... | |
102 | 104 |
dialog.getTsup_izqX().setText(String.valueOf(rect.getMinX()).substring(0,indexPoint+2)); |
103 | 105 |
indexPoint = String.valueOf(rect.getMinY()).indexOf('.'); |
104 | 106 |
dialog.getTsup_izqY().setText(String.valueOf(rect.getMaxY()).substring(0,indexPoint+2)); |
105 |
|
|
106 |
/*dialog.getTinf_derX().setText(String.valueOf(rect.getMaxX())); |
|
107 |
dialog.getTinf_derY().setText(String.valueOf(rect.getMaxY())); |
|
108 |
dialog.getTsup_izqX().setText(String.valueOf(rect.getMinX())); |
|
109 |
dialog.getTsup_izqY().setText(String.valueOf(rect.getMinY()));*/ |
|
110 |
|
|
107 |
|
|
111 | 108 |
PluginServices.getMDIManager().addView(saveRaster); |
112 | 109 |
} |
113 | 110 |
} |
Also available in: Unified diff