gvsig-raster / org.gvsig.raster.georeferencing / trunk / org.gvsig.raster.georeferencing / org.gvsig.raster.georeferencing.swing / org.gvsig.raster.georeferencing.swing.impl / src / main / java / org / gvsig / raster / georeferencing / swing / impl / control / GeorefControlPanelImpl.java @ 1712
History | View | Annotate | Download (17.5 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2012 gvSIG Association.
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.raster.georeferencing.swing.impl.control; |
25 |
|
26 |
import java.awt.Dimension; |
27 |
import java.awt.GridBagConstraints; |
28 |
import java.awt.GridBagLayout; |
29 |
import java.awt.event.ComponentEvent; |
30 |
import java.io.File; |
31 |
|
32 |
import javax.swing.ImageIcon; |
33 |
import javax.swing.JButton; |
34 |
import javax.swing.JPanel; |
35 |
import javax.swing.JToggleButton; |
36 |
|
37 |
import org.gvsig.andami.IconThemeHelper; |
38 |
import org.gvsig.gui.beans.datainput.DataInputContainer; |
39 |
import org.gvsig.i18n.Messages; |
40 |
import org.gvsig.raster.georeferencing.swing.control.GeorefControlPanel; |
41 |
import org.gvsig.raster.georeferencing.swing.control.GeorefControlPanelListener; |
42 |
|
43 |
/**
|
44 |
* Panel que contiene la tabla de puntos de control
|
45 |
*
|
46 |
* 22/12/2007
|
47 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
48 |
*/
|
49 |
public class GeorefControlPanelImpl extends JPanel implements GeorefControlPanel { |
50 |
private static final long serialVersionUID = 1L; |
51 |
private JPanel buttonsPanel = null; |
52 |
private JButton bSaveToXml = null; |
53 |
private JButton bLoadFromXml = null; |
54 |
private JButton bSaveToAscii = null; |
55 |
private JButton bLoadFromAscii = null; |
56 |
private JButton bOptions = null; |
57 |
private JButton bTest = null; |
58 |
private JButton bEndTest = null; |
59 |
private JButton bEndGeoref = null; |
60 |
private JButton bCenterView = null; |
61 |
private JToggleButton bAddPoint = null; |
62 |
private DataInputContainer error = null; |
63 |
private GeorefControlPanelListener buttonsListener = null; |
64 |
|
65 |
private String pathToImagesForTest = "/src/main/resources/image/"; |
66 |
|
67 |
/**
|
68 |
* Constructor.
|
69 |
* Crea la composici?n de controles de zoom.
|
70 |
*/
|
71 |
public GeorefControlPanelImpl() {
|
72 |
init(); |
73 |
} |
74 |
|
75 |
public int getButtonIDPressed(Object source) { |
76 |
if(source == bSaveToXml)
|
77 |
return GeorefControlPanel.bSaveToXml;
|
78 |
if(source == bLoadFromXml)
|
79 |
return GeorefControlPanel.bLoadFromXml;
|
80 |
if(source == bSaveToAscii)
|
81 |
return GeorefControlPanel.bSaveToAscii;
|
82 |
if(source == bLoadFromAscii)
|
83 |
return GeorefControlPanel.bLoadFromAscii;
|
84 |
if(source == bTest)
|
85 |
return GeorefControlPanel.bTest;
|
86 |
if(source == bOptions)
|
87 |
return GeorefControlPanel.bOptions;
|
88 |
if(source == bEndTest)
|
89 |
return GeorefControlPanel.bEndTest;
|
90 |
if(source == bEndGeoref)
|
91 |
return GeorefControlPanel.bEndGeoref;
|
92 |
if(source == bCenterView)
|
93 |
return GeorefControlPanel.bCenterView;
|
94 |
if(source == bAddPoint)
|
95 |
return GeorefControlPanel.bAddPoint;
|
96 |
return -1; |
97 |
} |
98 |
|
99 |
public JPanel getComponent() { |
100 |
return this; |
101 |
} |
102 |
|
103 |
public void setListener(GeorefControlPanelListener listener) { |
104 |
this.buttonsListener = listener;
|
105 |
} |
106 |
|
107 |
private void init() { |
108 |
setLayout(new GridBagLayout()); |
109 |
//setPreferredSize(new java.awt.Dimension(0, h));
|
110 |
|
111 |
GridBagConstraints gb = new GridBagConstraints(); |
112 |
gb.insets = new java.awt.Insets(0, 0, 0, 0); |
113 |
|
114 |
gb.fill = GridBagConstraints.HORIZONTAL;
|
115 |
gb.weightx = 1;
|
116 |
gb.weighty = 0;
|
117 |
gb.gridx = 0;
|
118 |
add(new JPanel(), gb); |
119 |
gb.gridx = 2;
|
120 |
add(new JPanel(), gb); |
121 |
|
122 |
gb.fill = GridBagConstraints.NONE;
|
123 |
gb.weightx = 0;
|
124 |
gb.gridx = 1;
|
125 |
add(getButtonsPanel(), gb); |
126 |
} |
127 |
|
128 |
/**
|
129 |
* Obtiene el panel de botones
|
130 |
* @return JPanel
|
131 |
*/
|
132 |
public JPanel getButtonsPanel() { |
133 |
if(buttonsPanel == null) { |
134 |
buttonsPanel = new JPanel(); |
135 |
buttonsPanel.setLayout(new GridBagLayout()); |
136 |
//buttonsPanel.setBorder(BorderFactory.createLineBorder(Color.red));
|
137 |
|
138 |
GridBagConstraints gb = new GridBagConstraints(); |
139 |
gb.insets = new java.awt.Insets(0, 0, 1, 1); |
140 |
gb.fill = GridBagConstraints.NONE;
|
141 |
gb.weightx = 0;
|
142 |
gb.gridy = 0;
|
143 |
gb.gridx = 0;
|
144 |
buttonsPanel.add(getSaveToXMLButton(), gb); |
145 |
|
146 |
gb.gridy = 0;
|
147 |
gb.gridx = 1;
|
148 |
buttonsPanel.add(getLoadFromXMLButton(), gb); |
149 |
|
150 |
gb.gridy = 0;
|
151 |
gb.gridx = 2;
|
152 |
buttonsPanel.add(getExporToCSVButton(), gb); |
153 |
|
154 |
gb.gridy = 0;
|
155 |
gb.gridx = 3;
|
156 |
buttonsPanel.add(getLoadFromCSVButton(), gb); |
157 |
|
158 |
gb.gridy = 0;
|
159 |
gb.gridx = 4;
|
160 |
buttonsPanel.add(getOptionsButton(), gb); |
161 |
|
162 |
gb.gridy = 0;
|
163 |
gb.gridx = 5;
|
164 |
buttonsPanel.add(getCenterButton(), gb); |
165 |
|
166 |
gb.gridy = 0;
|
167 |
gb.gridx = 6;
|
168 |
buttonsPanel.add(getToolSelectPointButton(), gb); |
169 |
|
170 |
gb.gridy = 0;
|
171 |
gb.gridx = 7;
|
172 |
buttonsPanel.add(getEndGeorefButton(), gb); |
173 |
|
174 |
gb.gridy = 0;
|
175 |
gb.gridx = 8;
|
176 |
buttonsPanel.add(getTestButton(), gb); |
177 |
|
178 |
gb.gridy = 0;
|
179 |
gb.gridx = 9;
|
180 |
buttonsPanel.add(getEndTestButton(), gb); |
181 |
|
182 |
gb.gridy = 0;
|
183 |
gb.gridx = 10;
|
184 |
//gb.gridwidth = 4;
|
185 |
buttonsPanel.add(getError(), gb); |
186 |
} |
187 |
return buttonsPanel;
|
188 |
} |
189 |
|
190 |
/**
|
191 |
* Obtiene el objeto con el error total
|
192 |
* @return
|
193 |
*/
|
194 |
public DataInputContainer getError() {
|
195 |
if(error == null) { |
196 |
error = new DataInputContainer();
|
197 |
error.setLabelText("RMS");
|
198 |
error.setPreferredSize(new Dimension(85, 35)); |
199 |
} |
200 |
return error;
|
201 |
} |
202 |
|
203 |
/**
|
204 |
* Obtiene el bot?n de finalizar georreferenciaci?n. Si no existe se crea.
|
205 |
* @return JButton
|
206 |
*/
|
207 |
public JButton getEndGeorefButton() { |
208 |
if(bEndGeoref == null) { |
209 |
bEndGeoref = new JButton(); |
210 |
bEndGeoref.setPreferredSize(new Dimension(22, 22)); |
211 |
bEndGeoref.setIcon(loadIcon("exit-icon"));
|
212 |
bEndGeoref.setToolTipText(Messages.getText("end_georef"));
|
213 |
bEndGeoref.addActionListener(buttonsListener); |
214 |
} |
215 |
return bEndGeoref;
|
216 |
} |
217 |
|
218 |
/**
|
219 |
* Obtiene el bot?n de procesar georreferenciaci?n. Si no existe se crea.
|
220 |
* @return JButton
|
221 |
*/
|
222 |
public JButton getTestButton() { |
223 |
if(bTest == null) { |
224 |
bTest = new JButton(); |
225 |
bTest.setPreferredSize(new Dimension(22, 22)); |
226 |
bTest.setToolTipText(Messages.getText("test_georef"));
|
227 |
bTest.addActionListener(buttonsListener); |
228 |
bTest.setIcon(loadIcon("process-icon"));
|
229 |
} |
230 |
return bTest;
|
231 |
} |
232 |
|
233 |
/**
|
234 |
* Obtiene el bot?n de terminar el test de georreferenciaci?n. Si no existe se crea.
|
235 |
* @return JButton
|
236 |
*/
|
237 |
public JButton getEndTestButton() { |
238 |
if(bEndTest == null) { |
239 |
bEndTest = new JButton(); |
240 |
bEndTest.setPreferredSize(new Dimension(22, 22)); |
241 |
bEndTest.setToolTipText(Messages.getText("end_test_georef"));
|
242 |
bEndTest.addActionListener(buttonsListener); |
243 |
bEndTest.setIcon(loadIcon("endprocess-icon"));
|
244 |
} |
245 |
return bEndTest;
|
246 |
} |
247 |
|
248 |
/**
|
249 |
* Obtiene el bot?n de procesar georreferenciaci?n. Si no existe se crea.
|
250 |
* @return JButton
|
251 |
*/
|
252 |
public JButton getLoadFromCSVButton() { |
253 |
if(bLoadFromAscii == null) { |
254 |
bLoadFromAscii = new JButton(); |
255 |
bLoadFromAscii.setPreferredSize(new Dimension(22, 22)); |
256 |
bLoadFromAscii.setToolTipText(Messages.getText("load_from_ascii"));
|
257 |
bLoadFromAscii.addActionListener(buttonsListener); |
258 |
bLoadFromAscii.setIcon(loadIcon("importfromcsv-icon"));
|
259 |
} |
260 |
return bLoadFromAscii;
|
261 |
} |
262 |
|
263 |
/**
|
264 |
* Obtiene el bot?n de exportar a Ascii. Si no existe se crea.
|
265 |
* @return JButton
|
266 |
*/
|
267 |
public JButton getExporToCSVButton() { |
268 |
if(bSaveToAscii == null) { |
269 |
bSaveToAscii = new JButton(); |
270 |
bSaveToAscii.setPreferredSize(new Dimension(22, 22)); |
271 |
bSaveToAscii.setToolTipText(Messages.getText("save_to_ascii"));
|
272 |
bSaveToAscii.addActionListener(buttonsListener); |
273 |
bSaveToAscii.setIcon(loadIcon("exporttocsv-icon"));
|
274 |
} |
275 |
return bSaveToAscii;
|
276 |
} |
277 |
|
278 |
/**
|
279 |
* Obtiene el bot?n de cargar desde XML. Si no existe se crea.
|
280 |
* @return JButton
|
281 |
*/
|
282 |
public JButton getLoadFromXMLButton() { |
283 |
if(bLoadFromXml == null) { |
284 |
bLoadFromXml = new JButton(); |
285 |
bLoadFromXml.setPreferredSize(new Dimension(22, 22)); |
286 |
bLoadFromXml.setToolTipText(Messages.getText("load_from_xml"));
|
287 |
bLoadFromXml.addActionListener(buttonsListener); |
288 |
bLoadFromXml.setIcon(loadIcon("tfwload-icon"));
|
289 |
} |
290 |
return bLoadFromXml;
|
291 |
} |
292 |
|
293 |
private ImageIcon loadIcon(String iconName) { |
294 |
ImageIcon icon = null; |
295 |
try {
|
296 |
icon = IconThemeHelper.getImageIcon(iconName); |
297 |
} catch(NullPointerException e) {} |
298 |
String file = System.getProperty("user.dir") + pathToImagesForTest + iconName; |
299 |
if(icon == null) { |
300 |
if(new File(file + ".png").exists()) |
301 |
icon = new ImageIcon(file + ".png", ""); |
302 |
} |
303 |
if(icon == null) { |
304 |
if(new File(file + ".gif").exists()) |
305 |
icon = new ImageIcon(file + ".gif", ""); |
306 |
} |
307 |
return icon;
|
308 |
} |
309 |
|
310 |
/**
|
311 |
* Obtiene el bot?n de salvar a XML. Si no existe se crea.
|
312 |
* @return JButton
|
313 |
*/
|
314 |
public JButton getSaveToXMLButton() { |
315 |
if(bSaveToXml == null) { |
316 |
bSaveToXml = new JButton(); |
317 |
bSaveToXml.setPreferredSize(new Dimension(22, 22)); |
318 |
bSaveToXml.setToolTipText(Messages.getText("save_gcp_to_xml"));
|
319 |
bSaveToXml.addActionListener(buttonsListener); |
320 |
bSaveToXml.setIcon(loadIcon("save-icon"));
|
321 |
} |
322 |
return bSaveToXml;
|
323 |
} |
324 |
|
325 |
/**
|
326 |
* Obtiene el bot?n de procesar georreferenciaci?n. Si no existe se crea.
|
327 |
* @return JButton
|
328 |
*/
|
329 |
public JButton getOptionsButton() { |
330 |
if(bOptions == null) { |
331 |
bOptions = new JButton(); |
332 |
bOptions.setPreferredSize(new Dimension(22, 22)); |
333 |
bOptions.setToolTipText(Messages.getText("options"));
|
334 |
bOptions.addActionListener(buttonsListener); |
335 |
bOptions.setIcon(loadIcon("options-icon"));
|
336 |
} |
337 |
return bOptions;
|
338 |
} |
339 |
|
340 |
/**
|
341 |
* Obtiene el bot?n de asignar el punto de control seleccionado en la tabla sobre
|
342 |
* una posici?n de la vista. Si no existe se crea.
|
343 |
* @return JButton
|
344 |
*/
|
345 |
public JToggleButton getToolSelectPointButton() { |
346 |
if(bAddPoint == null) { |
347 |
bAddPoint = new JToggleButton(); |
348 |
bAddPoint.setPreferredSize(new Dimension(22, 22)); |
349 |
bAddPoint.setToolTipText(Messages.getText("move-point"));
|
350 |
bAddPoint.addActionListener(buttonsListener); |
351 |
bAddPoint.setIcon(loadIcon("add-icon"));
|
352 |
} |
353 |
return bAddPoint;
|
354 |
} |
355 |
|
356 |
/**
|
357 |
* Obtiene el bot?n de procesar georreferenciaci?n. Si no existe se crea.
|
358 |
* @return JButton
|
359 |
*/
|
360 |
public JButton getCenterButton() { |
361 |
if(bCenterView == null) { |
362 |
bCenterView = new JButton(); |
363 |
bCenterView.setPreferredSize(new Dimension(22, 22)); |
364 |
bCenterView.setToolTipText(Messages.getText("center_view"));
|
365 |
bCenterView.addActionListener(buttonsListener); |
366 |
bCenterView.setIcon(loadIcon("centerpoint-icon"));
|
367 |
} |
368 |
return bCenterView;
|
369 |
} |
370 |
|
371 |
public void componentHidden(ComponentEvent e) { |
372 |
} |
373 |
|
374 |
public void componentMoved(ComponentEvent e) { |
375 |
} |
376 |
|
377 |
public void componentShown(ComponentEvent e) { |
378 |
} |
379 |
|
380 |
|
381 |
//****************************************************
|
382 |
//Acceso a los datos de la tabla
|
383 |
|
384 |
/**
|
385 |
* Obtiene las coordenadas de una fila
|
386 |
* @param row Fila de la que se quieren obtener las coordenadas
|
387 |
* @return Array con 4 valores coordenadas real X, coordenada real Y, coordenadas raster X y coordenada raste Y
|
388 |
*/
|
389 |
/*public double[] getCoordinates(int row) {
|
390 |
double xMap = 0, yMap = 0, xRaster = 0, yRaster = 0;
|
391 |
boolean numberFormatException = false;
|
392 |
try {
|
393 |
Object value = getTable().getModel().getValueAt(row, 2);
|
394 |
try {
|
395 |
if(value instanceof Double)
|
396 |
xMap = ((Double)value).doubleValue();
|
397 |
else if(value instanceof String)
|
398 |
xMap = Double.valueOf(((String)value)).doubleValue();
|
399 |
} catch (NumberFormatException ex1) {
|
400 |
numberFormatException = true;
|
401 |
}
|
402 |
|
403 |
value = getTable().getModel().getValueAt(row, 3);
|
404 |
try {
|
405 |
if(value instanceof Double)
|
406 |
yMap = ((Double)value).doubleValue();
|
407 |
else if(value instanceof String)
|
408 |
yMap = Double.valueOf(((String)value)).doubleValue();
|
409 |
} catch (NumberFormatException ex1) {
|
410 |
numberFormatException = true;
|
411 |
}
|
412 |
|
413 |
try {
|
414 |
value = getTable().getModel().getValueAt(row, 4);
|
415 |
if(value instanceof Double)
|
416 |
xRaster = ((Double)value).doubleValue();
|
417 |
else if(value instanceof String)
|
418 |
xRaster = Double.valueOf(((String)value)).doubleValue();
|
419 |
} catch (NumberFormatException ex1) {
|
420 |
numberFormatException = true;
|
421 |
}
|
422 |
|
423 |
try {
|
424 |
value = getTable().getModel().getValueAt(row, 5);
|
425 |
if(value instanceof Double)
|
426 |
yRaster = ((Double)value).doubleValue();
|
427 |
else if(value instanceof String)
|
428 |
yRaster = Double.valueOf(((String)value)).doubleValue();
|
429 |
} catch (NumberFormatException ex1) {
|
430 |
numberFormatException = true;
|
431 |
}
|
432 |
|
433 |
//Esto es necesario porque aunque se produzca una excepci?n en la lectura
|
434 |
//de un valor deben leerse los dem?s campos antes de terminar.
|
435 |
if(numberFormatException) {
|
436 |
GeoreferencingSwingImplLibrary.messageBoxError("value_not_valid", table, null);
|
437 |
try {
|
438 |
getTable().getModel().setValueAt(new String(xMap + ""), row, 2);
|
439 |
getTable().getModel().setValueAt(new String(yMap + ""), row, 3);
|
440 |
getTable().getModel().setValueAt(new String(xRaster + ""), row, 4);
|
441 |
getTable().getModel().setValueAt(new String(yRaster + ""), row, 5);
|
442 |
} catch (NotInitializeException e) {
|
443 |
//Si est? inicializada sino habr?a entrado en la excepci?n de nivel mayor
|
444 |
}
|
445 |
}
|
446 |
|
447 |
//return new double[]{xMap, yMap, xRaster, yRaster};
|
448 |
} catch (NotInitializeException ex) {
|
449 |
GeoreferencingSwingImplLibrary.messageBoxError("table_not_initialize", table, null);
|
450 |
}
|
451 |
return new double[]{xMap, yMap, xRaster, yRaster};
|
452 |
}*/
|
453 |
|
454 |
/**
|
455 |
* Asigna un valor al punto en coordenadas raster de la tabla. Es recomendable gastar este y no
|
456 |
* setValueAt para evitar que se recalculen los errores en cada inserci?n de cada celda. De esta
|
457 |
* forma al actualiza ambas coordenadas a la vez solo se calcular? el error una vez.
|
458 |
* @param valueX Valor en X
|
459 |
* @param valueY Valor en Y
|
460 |
* @param row Fila a actualizar
|
461 |
* @param col Columna a actualizar
|
462 |
*/
|
463 |
/*public void updateRasterPoint(Object valueX, Object valueY, int row) {
|
464 |
try {
|
465 |
getTable().setValueAt(valueX, row, 4);
|
466 |
getTable().setValueAt(valueY, row, 5);
|
467 |
updateErrors();
|
468 |
} catch (NotInitializeException e) {
|
469 |
GeoreferencingSwingImplLibrary.messageBoxError("table_not_initialize", this, e);
|
470 |
}
|
471 |
}*/
|
472 |
|
473 |
/**
|
474 |
* Asigna un valor al punto en coordenadas del mundo de la tabla. Es recomendable gastar este y no
|
475 |
* setValueAt para evitar que se recalculen los errores en cada inserci?n de cada celda. De esta
|
476 |
* forma al actualiza ambas coordenadas a la vez solo se calcular? el error una vez.
|
477 |
* @param valueX Valor en X
|
478 |
* @param valueY Valor en Y
|
479 |
* @param row Fila a actualizar
|
480 |
* @param col Columna a actualizar
|
481 |
*/
|
482 |
/*public void updateMapPoint(Object valueX, Object valueY, int row) {
|
483 |
try {
|
484 |
getTable().setValueAt(valueX, row, 2);
|
485 |
getTable().setValueAt(valueY, row, 3);
|
486 |
updateErrors();
|
487 |
} catch (NotInitializeException e) {
|
488 |
GeoreferencingSwingImplLibrary.messageBoxError("table_not_initialize", this, e);
|
489 |
}
|
490 |
}*/
|
491 |
|
492 |
/**
|
493 |
* Asigna un valor al punto de la tabla. Es recomendable gastar este y no
|
494 |
* setValueAt para evitar que se recalculen los errores en cada inserci?n de cada celda. De esta
|
495 |
* forma al actualiza ambas coordenadas a la vez solo se calcular? el error una vez.
|
496 |
* @param mapX Valor en X en coordenadas del mundo
|
497 |
* @param mapY Valor en Y en coordenadas del mundo
|
498 |
* @param pixelX Valor en X en coordenadas del raster
|
499 |
* @param pixelY Valor en Y en coordenadas del raster
|
500 |
* @param row Fila a actualizar
|
501 |
* @param col Columna a actualizar
|
502 |
*/
|
503 |
/*public void updatePoint(Object mapX, Object mapY, Object pixelX, Object pixelY, int row) {
|
504 |
try {
|
505 |
getTable().setValueAt(mapX, row, 2);
|
506 |
getTable().setValueAt(mapY, row, 3);
|
507 |
getTable().setValueAt(pixelX, row, 4);
|
508 |
getTable().setValueAt(pixelY, row, 5);
|
509 |
updateErrors();
|
510 |
} catch (NotInitializeException e) {
|
511 |
GeoreferencingSwingImplLibrary.messageBoxError("table_not_initialize", this, e);
|
512 |
}
|
513 |
}*/
|
514 |
|
515 |
/**
|
516 |
* Actualiza los errores de toda la tabla. Esta funci?n debe ser llamada cuando ha
|
517 |
* habido alg?n cambio en los valores de los puntos.
|
518 |
* @throws NotInitializeException
|
519 |
*/
|
520 |
/*public void updateErrors() {
|
521 |
if(pointList == null)
|
522 |
return;
|
523 |
process.addParam("gpcs", pointList);
|
524 |
process.addParam("orden", new Integer(selectedDegree));
|
525 |
try {
|
526 |
process.execute();
|
527 |
} catch(RuntimeException e) {
|
528 |
//Matriz singular
|
529 |
return;
|
530 |
} catch (ProcessInterruptedException e) {
|
531 |
} catch (ProcessException e) {
|
532 |
}
|
533 |
HashMap<String, Object> map = (HashMap<String, Object>)process.getResult();
|
534 |
Geotransformation result = (Geotransformation)map.get("RESULT");
|
535 |
if(result == null)
|
536 |
return;
|
537 |
|
538 |
//Actualizamos los errores de toda la tabla
|
539 |
try {
|
540 |
ColorColumnRenderer cr = new ColorColumnRenderer();
|
541 |
for (int i = 0; i < pointList.size(); i++) {
|
542 |
GeoPoint point = pointList.get(i);
|
543 |
getTable().setValueAt(new Double(point.getErrorX()), point.getNumber(), 6);
|
544 |
getTable().setValueAt(new Double(point.getErrorY()), point.getNumber(), 7);
|
545 |
getTable().setValueAt(new Double(point.getRms()), point.getNumber(), 8);
|
546 |
if (point.getRms() > threshold)
|
547 |
cr.addRowToColor1(point.getNumber());
|
548 |
else
|
549 |
cr.addRowToColor2(point.getNumber());
|
550 |
}
|
551 |
getTable().getTable().getJTable().getColumnModel().getColumn(8).setCellRenderer(cr);
|
552 |
getError().setValue(result.getRmsTotal() + "");
|
553 |
} catch (NotInitializeException e) {
|
554 |
GeoreferencingSwingImplLibrary.messageBoxError("table_not_initialize", this, e);
|
555 |
}
|
556 |
}*/
|
557 |
|
558 |
} |
559 |
|
560 |
|