Revision 2179 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/clip/ui/listener/ClippingPanelListener.java
ClippingPanelListener.java | ||
---|---|---|
62 | 62 |
import org.gvsig.gui.beans.datainput.DataInputContainerListener; |
63 | 63 |
import org.gvsig.gui.beans.table.models.CheckBoxModel; |
64 | 64 |
import org.gvsig.i18n.Messages; |
65 |
import org.gvsig.raster.algorithm.process.DataProcess; |
|
66 |
import org.gvsig.raster.algorithm.process.IProcessActions; |
|
65 | 67 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
66 | 68 |
import org.gvsig.raster.roi.ROI; |
69 |
import org.gvsig.raster.swing.RasterSwingLibrary; |
|
67 | 70 |
import org.gvsig.raster.swing.RasterSwingLocator; |
68 | 71 |
import org.gvsig.raster.tools.app.basic.RasterToolsUtil; |
69 | 72 |
import org.gvsig.raster.tools.app.basic.raster.process.ClippingProcess; |
70 |
import org.gvsig.raster.tools.app.basic.raster.process.IProcessActions; |
|
71 |
import org.gvsig.raster.tools.app.basic.raster.process.RasterProcess; |
|
72 | 73 |
import org.gvsig.raster.tools.app.basic.tool.clip.ClippingData; |
73 | 74 |
import org.gvsig.raster.tools.app.basic.tool.clip.ui.ClippingPanel; |
74 | 75 |
import org.gvsig.raster.tools.app.basic.tool.clip.ui.panel.ClippingCoordinatesPanel; |
... | ... | |
80 | 81 |
* <code>ClippingPanelListener</code> es una clase donde se recoger?n y |
81 | 82 |
* tratar?n todos los eventos del panel de recorte |
82 | 83 |
* |
83 |
* @version 19/04/2007 |
|
84 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
84 |
* @author BorSanZa - Borja S?nchez Zamorano |
|
85 | 85 |
*/ |
86 | 86 |
public class ClippingPanelListener implements ActionListener, RectangleListener, ButtonsPanelListener, CoordinatesListener, DataInputContainerListener, IProcessActions { |
87 | 87 |
private Dimension dim = new Dimension(); |
... | ... | |
156 | 156 |
getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_APPLY).setEnabled(true); |
157 | 157 |
getClippingPanel().getButtonsPanel().getButton(ButtonsPanel.BUTTON_ACCEPT).setEnabled(true); |
158 | 158 |
} else |
159 |
RasterToolsUtil.messageBoxError(RasterToolsUtil.getText(this, "no_data_saved"), null);
|
|
159 |
RasterSwingLibrary.messageBoxError(Messages.getText("no_data_saved"), null);
|
|
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
//Save parameters |
... | ... | |
180 | 180 |
} else |
181 | 181 |
assignFullExtent(); |
182 | 182 |
} catch (ROIException e1) { |
183 |
RasterToolsUtil.messageBoxError(Messages.getText("problems_loading_rois"), null);
|
|
183 |
RasterSwingLibrary.messageBoxError(Messages.getText("problems_loading_rois"), null);
|
|
184 | 184 |
} |
185 | 185 |
|
186 | 186 |
return; |
... | ... | |
550 | 550 |
uly = Double.parseDouble(coordinatesReales.getValue12()); |
551 | 551 |
Envelope ext = getFLayer().getFullEnvelope(); |
552 | 552 |
if (((int) ulx) > ((int) ext.getMaximum(0)) || ((int) lrx) < ((int) ext.getMinimum(0)) || ((int) uly) > ((int) ext.getMaximum(1)) || ((int) lry) < ((int) ext.getMinimum(1))) { |
553 |
RasterToolsUtil.messageBoxError(RasterToolsUtil.getText(this, "coordenadas_erroneas"), null);
|
|
553 |
RasterSwingLibrary.messageBoxError(Messages.getText("coordenadas_erroneas"), null);
|
|
554 | 554 |
return; |
555 | 555 |
} |
556 | 556 |
} catch (NumberFormatException e) { |
557 |
RasterToolsUtil.messageBoxError(RasterToolsUtil.getText(this, "coordenadas_erroneas"), null);
|
|
557 |
RasterSwingLibrary.messageBoxError(Messages.getText("coordenadas_erroneas"), null);
|
|
558 | 558 |
return; |
559 | 559 |
} |
560 | 560 |
|
... | ... | |
586 | 586 |
path = getOptionsPanel().getDirectoryTextField().getText(); |
587 | 587 |
File f = new File(path); |
588 | 588 |
if(!f.exists() || !f.canWrite()) { |
589 |
RasterToolsUtil.messageBoxError(RasterToolsUtil.getText(this, "path_not_valid"), null);
|
|
589 |
RasterSwingLibrary.messageBoxError(Messages.getText("path_not_valid"), null);
|
|
590 | 590 |
return; |
591 | 591 |
} |
592 | 592 |
} else |
... | ... | |
602 | 602 |
String filename = path + File.separator + file; |
603 | 603 |
|
604 | 604 |
if (new File(filename + ".tif").exists()) |
605 |
if (!RasterToolsUtil.messageBoxYesOrNot("raster_error_file_exists", getOptionsPanel()))
|
|
605 |
if (!RasterSwingLibrary.messageBoxYesOrNot("raster_error_file_exists", getOptionsPanel()))
|
|
606 | 606 |
return; |
607 | 607 |
|
608 | 608 |
/** |
... | ... | |
649 | 649 |
} |
650 | 650 |
} |
651 | 651 |
|
652 |
RasterProcess clippingProcess = new ClippingProcess();
|
|
652 |
DataProcess clippingProcess = new ClippingProcess();
|
|
653 | 653 |
clippingProcess.setActions(this); |
654 | 654 |
clippingProcess.addParam("viewname", getViewName()); |
655 | 655 |
if(pxRound) |
... | ... | |
658 | 658 |
clippingProcess.addParam("realcoordinates", wcValues); |
659 | 659 |
clippingProcess.addParam("suffix", ".tif"); |
660 | 660 |
clippingProcess.addParam("filename", filename); |
661 |
clippingProcess.addParam("layer", getFLayer()); |
|
661 |
clippingProcess.addParam("layer", getFLayer().getDataStore());
|
|
662 | 662 |
clippingProcess.addParam("drawablebands", drawableBands); |
663 | 663 |
clippingProcess.addParam("onelayerperband", new Boolean(getOptionsPanel().getCbOneLyrPerBand().isSelected())); |
664 | 664 |
clippingProcess.addParam("interpolationmethod", new Integer(interpMethod)); |
... | ... | |
666 | 666 |
clippingProcess.addParam("colorInterpretation", RasterLocator.getManager().getDataStructFactory().createColorInterpretation(ci)); |
667 | 667 |
clippingProcess.addParam("resolution", new int[]{(int) Math.round(data.getPxWidth()), |
668 | 668 |
(int) Math.round(data.getPxHeight())}); |
669 |
clippingProcess.addParam("viewProjection", mapControl.getProjection()); |
|
669 | 670 |
clippingProcess.start(); |
670 | 671 |
} |
671 | 672 |
|
... | ... | |
958 | 959 |
public Image getImageCursor() { |
959 | 960 |
return null; |
960 | 961 |
} |
962 |
|
|
963 |
public void updateProgress(int current, int total) { |
|
964 |
// TODO Auto-generated method stub |
|
965 |
|
|
966 |
} |
|
961 | 967 |
} |
Also available in: Unified diff