gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.app / org.gvsig.raster.georeferencing.app.georeferencingclient / src / main / java / org / gvsig / raster / georeferencing / app / georeferencingclient / listener / ApplicationControlsListener.java @ 1752
History | View | Annotate | Download (19.4 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.georeferencing.app.georeferencingclient.listener; |
23 |
|
24 |
import java.awt.event.ActionEvent; |
25 |
import java.awt.geom.Point2D; |
26 |
|
27 |
import javax.swing.JPanel; |
28 |
|
29 |
import org.gvsig.andami.PluginServices; |
30 |
import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint; |
31 |
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException; |
32 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
33 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
34 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
35 |
import org.gvsig.i18n.Messages; |
36 |
import org.gvsig.raster.georeferencing.GeoreferencingLibrary; |
37 |
import org.gvsig.raster.georeferencing.app.georeferencingclient.GeoPointsPersistence; |
38 |
import org.gvsig.raster.georeferencing.app.georeferencingclient.Georeferencing; |
39 |
import org.gvsig.raster.georeferencing.app.georeferencingclient.TableWrapper; |
40 |
import org.gvsig.raster.georeferencing.framework.GeoreferencingFrameworkLocator; |
41 |
import org.gvsig.raster.georeferencing.framework.GeoreferencingFrameworkManager; |
42 |
import org.gvsig.raster.georeferencing.swing.GeoreferencingSwingLibrary; |
43 |
import org.gvsig.raster.georeferencing.swing.GeoreferencingSwingLocator; |
44 |
import org.gvsig.raster.georeferencing.swing.control.GeorefControlPanel; |
45 |
import org.gvsig.raster.georeferencing.swing.control.GeorefControlPanelListener; |
46 |
import org.gvsig.raster.georeferencing.swing.impl.option.GeorefOptionsDialog; |
47 |
import org.gvsig.raster.georeferencing.swing.model.GeoreferencingOptionsDataModel; |
48 |
import org.gvsig.raster.georeferencing.swing.view.SynchronizedViews; |
49 |
import org.gvsig.raster.swing.basepanel.ButtonsPanelEvent; |
50 |
import org.gvsig.raster.swing.impl.basepanel.ButtonsPanel; |
51 |
import org.gvsig.raster.swing.pagedtable.PagedTableEvent; |
52 |
import org.gvsig.raster.tools.app.basic.RasterToolsUtil; |
53 |
|
54 |
/**
|
55 |
* Listener para los botones de control de la aplicaci?n de georreferenciaci?n.
|
56 |
* F?sicamente est?n en el panel de la tabla de puntos de control.
|
57 |
*
|
58 |
* 25/01/2008
|
59 |
* @author Nacho Brodin nachobrodin@gmail.com
|
60 |
*/
|
61 |
public class ApplicationControlsListener implements GeorefControlPanelListener { |
62 |
private TableWrapper tableWrapper = null; |
63 |
private Georeferencing appMain = null; |
64 |
private GeorefControlPanel controlPanel = null; |
65 |
private GeorefOptionsDialog optionsDialog = null; |
66 |
private GeoreferencingFrameworkManager fManager = null; |
67 |
private GeoPointsPersistence persistence = null; |
68 |
private JPanel cellSizePanel = null; |
69 |
|
70 |
/**
|
71 |
* Flag que estar? a true despu?s de crear un nuevo punto de control. Volver? a false
|
72 |
* cuando se ejecute el evento de inserci?n de fila en una tabla. Esto es necesario para
|
73 |
* que no se centre el punto sobre la vista despu?s de insertar un nuevo punto. Ya que las
|
74 |
* vistas se van a la posici?n (0,0)
|
75 |
*/
|
76 |
private boolean newPointCreated = false; |
77 |
|
78 |
/**
|
79 |
* Constructor. Asigna el panel con los controles
|
80 |
* @param tablePanel
|
81 |
*/
|
82 |
public ApplicationControlsListener(TableWrapper tableWrapper, Georeferencing appMain) {
|
83 |
this.tableWrapper = tableWrapper;
|
84 |
this.appMain = appMain;
|
85 |
this.controlPanel = appMain.getGeorefControlPanel();
|
86 |
this.controlPanel.setListener(this); |
87 |
this.fManager = GeoreferencingFrameworkLocator.getManager();
|
88 |
this.persistence = new GeoPointsPersistence(); |
89 |
} |
90 |
|
91 |
private SynchronizedViews getSyncViews() {
|
92 |
return appMain.getSyncViews();
|
93 |
} |
94 |
|
95 |
private GeoreferencingOptionsDataModel getDataModel() {
|
96 |
return appMain.getDataModel();
|
97 |
} |
98 |
|
99 |
/**
|
100 |
* Eventos de los botones del cuadro de tabla y selecci?n de fila de tabla
|
101 |
*/
|
102 |
public void actionPerformed(ActionEvent e) { |
103 |
if(!Georeferencing.enableTableEvent)
|
104 |
return;
|
105 |
|
106 |
Georeferencing.enableTableEvent = false;
|
107 |
try {
|
108 |
//-------------------------------------
|
109 |
//Finalizaci?n de la georreferenciaci?n
|
110 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bEndGeoref)
|
111 |
endGeoref(); |
112 |
|
113 |
//-----------------------------------------
|
114 |
//Centrar la vista en el punto seleccionado
|
115 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bCenterView) {
|
116 |
getSyncViews().centerToPoint(tableWrapper.getTable().getSelectedRows()[0]);
|
117 |
} |
118 |
|
119 |
//---------------------------------
|
120 |
//Selecci?n de una fila de la tabla
|
121 |
if(e.getActionCommand().equals("SELECT_ROW")) { |
122 |
if(getDataModel().isCenterView() && !newPointCreated)
|
123 |
getSyncViews().centerToPoint(e.getID()); |
124 |
newPointCreated = false;
|
125 |
} |
126 |
|
127 |
//----------------------------------------------------------
|
128 |
//Seleccion de opciones. Se asignan las propiedades al abrir
|
129 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bOptions) {
|
130 |
if(optionsDialog == null) |
131 |
optionsDialog = new GeorefOptionsDialog(Georeferencing.DEFAULT_DEGREE, this); |
132 |
optionsDialog.setDegree(getDataModel().getDegree()); |
133 |
optionsDialog.setAlgorithm(getDataModel().getAlgorithm()); |
134 |
optionsDialog.setBackGroundColor(getDataModel().getBackgroundColor()); |
135 |
optionsDialog.setTextColor(getDataModel().getTextColor()); |
136 |
optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getAddErrorsCSVCheck().setSelected(getDataModel().isAddErrorsCSV());
|
137 |
optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getCenterViewCheck().setSelected(getDataModel().isCenterView());
|
138 |
optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getShowNumberCheck().setSelected(getDataModel().isShowNumber());
|
139 |
optionsDialog.setThresholdError(getDataModel().getThreshold()); |
140 |
optionsDialog.setInterpolationMethod(getDataModel().getInterpolationMethod()); |
141 |
optionsDialog.setOutFile(getDataModel().getOutFile()); |
142 |
//optionsDialog.setXCellSize(getDataModel().getXCellSize());
|
143 |
//optionsDialog.setYCellSize(getDataModel().getYCellSize());
|
144 |
fManager.showWindow(optionsDialog, 410, 400, Messages.getText("georeferencing")); |
145 |
} |
146 |
|
147 |
//------------------------------
|
148 |
//Mover el punto de control seleccionado
|
149 |
if(e.getSource() == appMain.getGeorefControlPanel().getMovePointButton()) {
|
150 |
if(getSyncViews() != null) { |
151 |
if(appMain.getGeorefControlPanel().getMovePointButton().isSelected()) {
|
152 |
getSyncViews().disableAllTools(); |
153 |
getSyncViews().enableTool(GeoreferencingSwingLibrary.SELECT_POINT_TOOL); |
154 |
} else {
|
155 |
getSyncViews().disableTool(GeoreferencingSwingLibrary.SELECT_POINT_TOOL); |
156 |
} |
157 |
} |
158 |
} |
159 |
|
160 |
//------------------------------
|
161 |
//Arrastrar y seleccionar un punto de control sobre la vista
|
162 |
if(e.getSource() == appMain.getGeorefControlPanel().getDragPointButton()) {
|
163 |
if(getSyncViews() != null) { |
164 |
if(appMain.getGeorefControlPanel().getDragPointButton().isSelected()) {
|
165 |
getSyncViews().disableAllTools(); |
166 |
getSyncViews().enableTool(GeoreferencingSwingLibrary.DRAG_POINT_TOOL); |
167 |
} else {
|
168 |
getSyncViews().disableTool(GeoreferencingSwingLibrary.DRAG_POINT_TOOL); |
169 |
} |
170 |
} |
171 |
} |
172 |
|
173 |
//-------
|
174 |
//Testear
|
175 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bTest) {
|
176 |
cellSizePanel = GeoreferencingSwingLocator.getSwingManager().createCellSizeWindow(this);
|
177 |
fManager.showWindow(cellSizePanel, 280, 180, Messages.getText("cellsize")); |
178 |
} |
179 |
|
180 |
//------------
|
181 |
//Fin del Test
|
182 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bEndTest) {
|
183 |
if(getDataModel().getType() == Georeferencing.WITH_MAP) {
|
184 |
if(appMain != null && appMain.getProcessActions().getLastTestLayer() != null) { |
185 |
appMain.getProcessActions().removeTestRasterLayer(); |
186 |
} |
187 |
} else {
|
188 |
RasterToolsUtil.messageBoxInfo("action_disable_without_view", null); |
189 |
} |
190 |
} |
191 |
|
192 |
//------------
|
193 |
//Salvar a CSV
|
194 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bSaveToAscii) {
|
195 |
persistence.exportToCSV(getDataModel().getGCPList(), getDataModel().isAddErrorsCSV()); |
196 |
} |
197 |
|
198 |
//----------------
|
199 |
//Cargar desde CSV
|
200 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bLoadFromAscii) {
|
201 |
persistence.importFromCSV(getSyncViews(), tableWrapper); |
202 |
} |
203 |
|
204 |
//------------
|
205 |
//Salvar a RMF
|
206 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bSaveToXml) {
|
207 |
persistence.saveToRMF(getDataModel().getGCPList(), getDataModel().getDataStore()); |
208 |
} |
209 |
|
210 |
//----------------
|
211 |
//Cargar desde RMF
|
212 |
if(controlPanel.getButtonIDPressed(e.getSource()) == GeorefControlPanel.bLoadFromXml) {
|
213 |
persistence.loadFromRMF(getDataModel().getDataStore(), getSyncViews(), tableWrapper); |
214 |
} |
215 |
|
216 |
} finally {
|
217 |
Georeferencing.enableTableEvent = true;
|
218 |
} |
219 |
} |
220 |
|
221 |
/**
|
222 |
* Acciones de finalizaci?n de georreferenciaci?n. La secuencia de acciones es:
|
223 |
* <UL>
|
224 |
* <LI>Preguntar si est? seguro de finalizar.</LI>
|
225 |
* <LI>Preguntar si se desea salvar la transformaci?n (Solo en caso de ser af?n).</LI>
|
226 |
* <LI>Preguntar si se desea cargar el resultado en la vista (Solo en caso de ser con mapa de referencia).</LI>
|
227 |
* </UL>
|
228 |
*/
|
229 |
private void endGeoref() { |
230 |
if(RasterToolsUtil.messageBoxYesOrNot("ask_end_georef", null)) { |
231 |
boolean saveTransform = false; |
232 |
if(getDataModel().getAlgorithm() == GeoreferencingLibrary.AFFINE) {
|
233 |
if(RasterToolsUtil.messageBoxYesOrNot("ask_save_transformation", null)) |
234 |
saveTransform = true;
|
235 |
else {
|
236 |
appMain.getProcessActions().removeTestRasterLayer(); |
237 |
fManager.closeAllWindows(); |
238 |
return;
|
239 |
} |
240 |
} |
241 |
|
242 |
if(getDataModel().getType() == Georeferencing.WITH_MAP) {
|
243 |
if(appMain.getProcessActions().getLastTestLayer() != null) |
244 |
appMain.getProcessActions().getLastTestLayer().setRemoveRasterFlag(false);
|
245 |
} |
246 |
|
247 |
if( appMain.getProcessActions().getLastTestLayer() != null && |
248 |
RasterToolsUtil.messageBoxYesOrNot( |
249 |
Messages.getText("ask_load_view")
|
250 |
+ " " +
|
251 |
appMain.getProcessActions().getLastTestLayer().getURI(), null)) {
|
252 |
FLayers lyrs = null;
|
253 |
if(appMain.getMapCtrl() != null) { |
254 |
lyrs = appMain.getMapCtrl().getMapContext().getLayers(); |
255 |
if(lyrs != null) { |
256 |
try {
|
257 |
if(appMain.getProcessActions().getLastTestLayer() != null){ |
258 |
lyrs.removeLayer(appMain.getProcessActions().getLastTestLayer()); |
259 |
PluginServices.getMainFrame().enableControls(); |
260 |
} |
261 |
} catch(NullPointerException ex){ |
262 |
//No hay raster para eliminar
|
263 |
} |
264 |
} |
265 |
} |
266 |
|
267 |
//Cargar en la vista
|
268 |
if(getDataModel().getAlgorithm() == GeoreferencingLibrary.AFFINE) {
|
269 |
try {
|
270 |
appMain.getProcessActions().addTestRasterLayer( |
271 |
getDataModel().getDataStore(), |
272 |
getDataModel().getAlgorithm(), |
273 |
getDataModel().getInterpolationMethod(), |
274 |
getDataModel().getDegree(), |
275 |
getDataModel().getOutFile(), |
276 |
getDataModel().getXCellSize(), |
277 |
getDataModel().getYCellSize(), |
278 |
tableWrapper.getGeoTransformDataResult()); |
279 |
} catch (LoadLayerException e) {
|
280 |
RasterToolsUtil.messageBoxError("error_loading_layer", null, e); |
281 |
} |
282 |
} |
283 |
if(getDataModel().getAlgorithm() == GeoreferencingLibrary.POLYNOMIAL) {
|
284 |
if(appMain.getProcessActions().getLastTestLayer() != null) { |
285 |
if(appMain.getMapCtrl() != null) |
286 |
appMain.getMapCtrl().getMapContext().getLayers().addLayer(appMain.getProcessActions().getLastTestLayer()); |
287 |
else
|
288 |
appMain.getFirstMapCtrl().getMapContext().getLayers().addLayer(appMain.getProcessActions().getLastTestLayer()); |
289 |
} else {
|
290 |
RasterToolsUtil.messageBoxInfo("raster_not_created", null); |
291 |
return;
|
292 |
} |
293 |
} |
294 |
} else {
|
295 |
appMain.getProcessActions().removeTestRasterLayer(); |
296 |
} |
297 |
|
298 |
|
299 |
if (saveTransform) {
|
300 |
// Salvar transformaci?n
|
301 |
if (appMain.getProcessActions().getLastTestLayer() == null) { |
302 |
RasterToolsUtil.messageBoxInfo("raster_not_created", null); |
303 |
return;
|
304 |
} |
305 |
|
306 |
RasterDataStore store = appMain.getProcessActions().getLastTestLayer().getDataStore(); |
307 |
try {
|
308 |
store.saveGeoreferencingToRmf(); |
309 |
} catch (RmfSerializerException e) {
|
310 |
RasterToolsUtil.messageBoxError("error_salvando_rmf", null, e); |
311 |
} |
312 |
} |
313 |
|
314 |
fManager.closeAllWindows(); |
315 |
} |
316 |
} |
317 |
|
318 |
/**
|
319 |
* This event is thrown when the user adds, removes or select point from the control
|
320 |
* table.
|
321 |
*/
|
322 |
public void tableChanged(PagedTableEvent e) { |
323 |
if(!Georeferencing.enableTableEvent)
|
324 |
return;
|
325 |
Georeferencing.enableTableEvent = false;
|
326 |
|
327 |
try {
|
328 |
//-----------------------------------
|
329 |
//Inserci?n de nueva fila en la tabla
|
330 |
if(e.getEvent() == PagedTableEvent.EVENT_ADD_ENTRY) {
|
331 |
long id = getSyncViews().addPoint(new Point2D.Double(0, 0), new Point2D.Double(0, 0)); |
332 |
tableWrapper.initializeRow(e.getRows()[0], id);
|
333 |
getSyncViews().calcPointsNumeration(); |
334 |
|
335 |
//Activamos la herramienta de mover punto en la vista
|
336 |
if(getSyncViews() != null) { |
337 |
getSyncViews().disableAllTools(); |
338 |
getSyncViews().enableTool(GeoreferencingSwingLibrary.SELECT_POINT_TOOL); |
339 |
} |
340 |
|
341 |
newPointCreated = true;
|
342 |
} |
343 |
|
344 |
//-----------------------------
|
345 |
//Eliminado de fila de la tabla
|
346 |
if(e.getEvent() == PagedTableEvent.EVENT_REMOVE_ENTRY) {
|
347 |
Object obj = ((Object[])e.getRowDeleted())[1]; |
348 |
int n = ((Integer)obj).intValue(); |
349 |
appMain.getSyncViews().removePoint(n); |
350 |
getSyncViews().calcPointsNumeration(); |
351 |
tableWrapper.updateErrors(); |
352 |
} |
353 |
|
354 |
//-----------------------------
|
355 |
//Eliminado todas las filas
|
356 |
if(e.getEvent() == PagedTableEvent.EVENT_REMOVE_ALL) {
|
357 |
getSyncViews().removeAllPoints(); |
358 |
} |
359 |
|
360 |
//-------------------------------------
|
361 |
//Actualizaci?n de una fila de la tabla
|
362 |
if(e.getEvent() == PagedTableEvent.EVENT_MODIFY_ENTRY) {
|
363 |
getSyncViews().calcPointsNumeration(); |
364 |
//Revisamos el flag de activo de cada punto poniendo el valor que pone en la entrada de la tabla
|
365 |
for (int i = 0; i < tableWrapper.getTable().getRowCount(); i++) { |
366 |
boolean active = ((Boolean) tableWrapper.getTable().getValueAt(i, 0)).booleanValue(); |
367 |
int position = appMain.getSyncViews().getPointPositionByNumber(i);
|
368 |
if (position < 0) |
369 |
return;
|
370 |
GeoPoint pt = getDataModel().getGCPList().getGeoPoint(position); |
371 |
pt.setActive(active); |
372 |
getSyncViews().setVisiblePoint(active, position); |
373 |
|
374 |
//Para la funcionalidad de cambio de coordenadas desde la tabla: reasignamos el valor
|
375 |
//de las coordenadas por si han cambiado estas
|
376 |
double[] values = tableWrapper.getCoordinates(i); |
377 |
|
378 |
getSyncViews().setCoordinates(position, values[0], values[1], values[2], values[3]); |
379 |
} |
380 |
tableWrapper.updateErrors(); |
381 |
} |
382 |
|
383 |
if(e.getEvent() == PagedTableEvent.EVENT_SELECTED_ROWS) {
|
384 |
if(getDataModel().isCenterView())
|
385 |
getSyncViews().centerToPoint(tableWrapper.getTable().getSelectedRows()[0]);
|
386 |
getDataModel().getGCPList().setSelectedPoint(tableWrapper.getTable().getSelectedRows()[0]);
|
387 |
getSyncViews().redrawPoints(); |
388 |
} |
389 |
|
390 |
if(e.getEvent() == PagedTableEvent.EVENT_SWAP_ENTRIES) {
|
391 |
getSyncViews().calcPointsNumeration(); |
392 |
} |
393 |
|
394 |
} finally {
|
395 |
Georeferencing.enableTableEvent = true;
|
396 |
} |
397 |
} |
398 |
|
399 |
/**
|
400 |
* Eventos de los botones del cuadro de opciones
|
401 |
*/
|
402 |
public void actionButtonPressed(ButtonsPanelEvent e) { |
403 |
Georeferencing.enableTableEvent = false;
|
404 |
|
405 |
try {
|
406 |
//Eventos del cuadro de tama?o de celda
|
407 |
if( cellSizePanel != null && |
408 |
e.getSource() == cellSizePanel) { |
409 |
if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
410 |
if(cellSizePanel != null) { |
411 |
try {
|
412 |
if(appMain.getProcessActions().getLastTestLayer() != null) |
413 |
appMain.getProcessActions().removeTestRasterLayer(); |
414 |
appMain.getProcessActions().addTestRasterLayer( |
415 |
getDataModel().getDataStore(), |
416 |
getDataModel().getAlgorithm(), |
417 |
getDataModel().getInterpolationMethod(), |
418 |
getDataModel().getDegree(), |
419 |
getDataModel().getOutFile(), |
420 |
getDataModel().getXCellSize(), |
421 |
getDataModel().getYCellSize(), |
422 |
tableWrapper.getGeoTransformDataResult()); |
423 |
} catch (LoadLayerException e1) {
|
424 |
RasterToolsUtil.messageBoxError("error_loading_layer", tableWrapper.getTable(), e1);
|
425 |
} |
426 |
} |
427 |
} |
428 |
|
429 |
//--------------------------------------------------
|
430 |
// Bot?n de Cerrar y Aceptar en el cuadro de opciones
|
431 |
if (e.getButton() == ButtonsPanel.BUTTON_CANCEL || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
432 |
if(cellSizePanel != null) { |
433 |
fManager.closeWindow(cellSizePanel); |
434 |
} |
435 |
} |
436 |
} |
437 |
|
438 |
//Eventos del cuadro de opciones
|
439 |
if( optionsDialog != null && |
440 |
optionsDialog.getOptionsPanel(null) != null && |
441 |
e.getSource() == optionsDialog.getOptionsPanel(null)) {
|
442 |
|
443 |
//---------------------------------------------------
|
444 |
//Bot?n de Aplicar y Aceptar en el cuadro de opciones
|
445 |
if (e.getButton() == ButtonsPanel.BUTTON_APPLY || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
446 |
if(optionsDialog != null) { |
447 |
|
448 |
//Asignamos las propiedades seleccionadas
|
449 |
getDataModel().setAlgorithm(optionsDialog.getAlgorithm()); |
450 |
getDataModel().setBackGroundColor(optionsDialog.getBackGroundColor()); |
451 |
getDataModel().setTextColor(optionsDialog.getTextColor()); |
452 |
getDataModel().setAddErrorsCSV(optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getAddErrorsCSVCheck().isSelected());
|
453 |
getDataModel().setCenterView(optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getCenterViewCheck().isSelected());
|
454 |
getDataModel().setShowNumber(optionsDialog.getOptionsPanel(this).getCheckOptionsPanel().getShowNumberCheck().isSelected());
|
455 |
getDataModel().setInterpolationMethod(optionsDialog.getInterpolationMethod()); |
456 |
getDataModel().setOutFile(optionsDialog.getOptionsPanel(this).getOutFileSelectionPanel().getOutFile());
|
457 |
|
458 |
//Recalculamos los errores si ha cambiado el grado
|
459 |
if(optionsDialog.getDegree() != getDataModel().getDegree()) {
|
460 |
getDataModel().setDegree(optionsDialog.getDegree()); |
461 |
tableWrapper.updateErrors(); |
462 |
} |
463 |
|
464 |
try {
|
465 |
getDataModel().setThreshold(optionsDialog.getThresholdError()); |
466 |
//getDataModel().setXCellSize(optionsDialog.getOptionsPanel(this).getCellSizePanel().getXCellSizeValue());
|
467 |
//getDataModel().setYCellSize(optionsDialog.getOptionsPanel(this).getCellSizePanel().getYCellSizeValue());
|
468 |
} catch(NumberFormatException exc) { |
469 |
RasterToolsUtil.messageBoxError("error_numeric_format", null, exc); |
470 |
} |
471 |
|
472 |
getSyncViews().setGraphicsColor(getDataModel().getTextColor()); |
473 |
getSyncViews().setBackgroundColor(getDataModel().getBackgroundColor()); |
474 |
getSyncViews().setActiveNumberPoint(getDataModel().isShowNumber()); |
475 |
|
476 |
} |
477 |
} |
478 |
|
479 |
//--------------------------------------------------
|
480 |
// Bot?n de Cerrar y Aceptar en el cuadro de opciones
|
481 |
if (e.getButton() == ButtonsPanel.BUTTON_CANCEL || e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
|
482 |
if(optionsDialog != null) { |
483 |
fManager.closeWindow(optionsDialog); |
484 |
} |
485 |
} |
486 |
} |
487 |
|
488 |
} finally {
|
489 |
Georeferencing.enableTableEvent = true;
|
490 |
} |
491 |
} |
492 |
} |