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