svn-gvsig-desktop / trunk / libraries / libJCRS / src / org / gvsig / crs / gui / listeners / CRSMainTrPanelListener.java @ 8561
History | View | Annotate | Download (20.7 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2006 Instituto de Desarrollo Regional and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* Instituto de Desarrollo Regional (Universidad de Castilla La-Mancha
|
34 |
* Campus Universitario s/n
|
35 |
* 02071 Alabacete
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 967 599 200
|
39 |
*/
|
40 |
|
41 |
|
42 |
package org.gvsig.crs.gui.listeners; |
43 |
|
44 |
import java.awt.CardLayout; |
45 |
import java.awt.event.ActionEvent; |
46 |
import java.awt.event.ActionListener; |
47 |
import java.awt.event.ItemEvent; |
48 |
import java.awt.event.ItemListener; |
49 |
import java.awt.event.MouseEvent; |
50 |
import java.awt.event.MouseListener; |
51 |
|
52 |
import javax.swing.JComboBox; |
53 |
import javax.swing.JOptionPane; |
54 |
import javax.swing.ListSelectionModel; |
55 |
import javax.swing.event.DocumentEvent; |
56 |
import javax.swing.event.DocumentListener; |
57 |
import javax.swing.event.ListSelectionEvent; |
58 |
import javax.swing.event.ListSelectionListener; |
59 |
|
60 |
import org.gvsig.crs.ICrs; |
61 |
import org.gvsig.crs.gui.CRSMainTrPanel; |
62 |
import org.gvsig.crs.ogr.GetTransepsg; |
63 |
import org.gvsig.crs.persistence.CrsData; |
64 |
import org.gvsig.crs.persistence.RecentCRSsPersistence; |
65 |
|
66 |
import com.iver.andami.PluginServices; |
67 |
import com.iver.andami.ui.mdiManager.IWindow; |
68 |
import com.iver.cit.gvsig.gui.View; |
69 |
|
70 |
public class CRSMainTrPanelListener implements ActionListener, DocumentListener, |
71 |
ListSelectionListener, ItemListener, MouseListener{ |
72 |
|
73 |
private CRSMainTrPanel panel = null; |
74 |
|
75 |
public CRSMainTrPanelListener(CRSMainTrPanel p) {
|
76 |
panel=p; |
77 |
} |
78 |
|
79 |
public void actionPerformed(ActionEvent e) { |
80 |
if( e.getSource() == panel.getJButtonAccept()){
|
81 |
if (panel.isEpsg_tr()) {
|
82 |
GetTransepsg epsgParams = new GetTransepsg(panel.getEpsgTrPanel().getTransformation_code(),panel.getEpsgTrPanel().connect, panel.getEpsgTrPanel().inverseTranformation);
|
83 |
panel.getEpsgTrPanel().setValues(epsgParams.getParamValue()); |
84 |
panel.setProjection(panel.getEpsgTrPanel().getProjection()); |
85 |
panel.setEpsg_tr(false);
|
86 |
} |
87 |
else if (panel.isManual_tr()) { |
88 |
panel.setProjection(panel.getManualTrPanel().getProjection()); |
89 |
panel.setManual_tr(false);
|
90 |
} |
91 |
else if (panel.isNads_tr()) { |
92 |
panel.setProjection(panel.getNadsTrPanel().getProjection()); |
93 |
panel.setTargetNad(panel.getNadsTrPanel().getNad()); |
94 |
panel.setNads_tr(false);
|
95 |
} |
96 |
else{
|
97 |
panel.setSin_tr(true);
|
98 |
panel.setProjection(panel.getProjection()); |
99 |
} |
100 |
|
101 |
/*
|
102 |
* Actualizar recientes...
|
103 |
*/
|
104 |
String authority = ((ICrs)panel.getProjection()).getCrsWkt().getAuthority()[0]; |
105 |
String wkt = ((ICrs)panel.getProjection()).getWKT();
|
106 |
String name = ((ICrs)panel.getProjection()).getCrsWkt().getName();
|
107 |
int code = ((ICrs)panel.getProjection()).getCode();
|
108 |
CrsData crsData = new CrsData(authority,code,name,wkt);
|
109 |
RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
|
110 |
persistence.addCrsData(crsData); |
111 |
|
112 |
PluginServices.getMDIManager().closeWindow(panel); |
113 |
} |
114 |
|
115 |
if( e.getSource() == panel.getJButtonBefore()){
|
116 |
CardLayout cl = (CardLayout)(panel.getJPanelMain().getLayout()); |
117 |
cl.show(panel.getJPanelMain(), "primero");
|
118 |
panel.getJButtonNext().setVisible(true);
|
119 |
panel.getJButtonAccept().setVisible(false);
|
120 |
panel.getJButtonBefore().setEnabled(false);
|
121 |
} |
122 |
|
123 |
if( e.getSource() == panel.getJButtonCancel()){
|
124 |
panel.setCancelYes(true);
|
125 |
panel.setProjection(panel.getCrsfirst()); |
126 |
PluginServices.getMDIManager().closeWindow(panel); |
127 |
} |
128 |
|
129 |
if( e.getSource() == panel.getJButtonNext()){
|
130 |
panel.getJButtonNext().setVisible(false);
|
131 |
panel.getJButtonAccept().setVisible(true);
|
132 |
panel.getJButtonBefore().setEnabled(true);
|
133 |
if (panel.getNewSelection().equals(PluginServices.getText(this,"transformacion_manual"))) { |
134 |
CardLayout cl = (CardLayout)(panel.getJPanelMain().getLayout()); |
135 |
if (panel.getDataSource().equals(PluginServices.getText(this,"EPSG"))){ |
136 |
panel.getManualTrPanel().setWKT(panel.getCrsMainPanel().getEpsgPanel().getWKT()); |
137 |
panel.getManualTrPanel().setCode(panel.getCrsMainPanel().getEpsgPanel().epsg_code); |
138 |
} |
139 |
else if (panel.getDataSource().equals(PluginServices.getText(this,"recientes"))) { |
140 |
panel.getManualTrPanel().setWKT(panel.getCrsMainPanel().getRecentsPanel().getWKT()); |
141 |
panel.getManualTrPanel().setCode(panel.getCrsMainPanel().getRecentsPanel().getCodeCRS()); |
142 |
} |
143 |
panel.setManual_tr(true);
|
144 |
cl.show(panel.getJPanelMain(), "manual");
|
145 |
} |
146 |
else if(panel.getNewSelection().equals("+"+PluginServices.getText(this,"nadgrids"))){ |
147 |
CardLayout cl = (CardLayout)(panel.getJPanelMain().getLayout()); |
148 |
if (panel.getDataSource().equals(PluginServices.getText(this,"EPSG"))){ |
149 |
panel.getNadsTrPanel().setWKT(panel.getCrsMainPanel().getEpsgPanel().getWKT()); |
150 |
panel.getNadsTrPanel().setCode(panel.getCrsMainPanel().getEpsgPanel().epsg_code); |
151 |
} |
152 |
else if (panel.getDataSource().equals(PluginServices.getText(this,"recientes"))) { |
153 |
panel.getNadsTrPanel().setWKT(panel.getCrsMainPanel().getRecentsPanel().getWKT()); |
154 |
panel.getNadsTrPanel().setCode(panel.getCrsMainPanel().getRecentsPanel().getCodeCRS()); |
155 |
} |
156 |
panel.setNads_tr(true);
|
157 |
cl.show(panel.getJPanelMain(), "nad");
|
158 |
} |
159 |
else if(panel.getNewSelection().equals(PluginServices.getText(this,"transformacion_epsg"))){ |
160 |
CardLayout cl = (CardLayout)(panel.getJPanelMain().getLayout()); |
161 |
if (panel.getDataSource().equals(PluginServices.getText(this,"EPSG"))){ |
162 |
panel.getEpsgTrPanel().setWKT(panel.getCrsMainPanel().getEpsgPanel().getWKT()); |
163 |
panel.getEpsgTrPanel().setSource(panel.getCrsMainPanel().getEpsgPanel().epsg_code); |
164 |
} |
165 |
else if (panel.getDataSource().equals(PluginServices.getText(this,"recientes"))) { |
166 |
panel.getEpsgTrPanel().setWKT(panel.getCrsMainPanel().getRecentsPanel().getWKT()); |
167 |
panel.getEpsgTrPanel().setSource(panel.getCrsMainPanel().getRecentsPanel().getCodeCRS()); |
168 |
} |
169 |
panel.setEpsg_tr(true);
|
170 |
|
171 |
cl.show(panel.getJPanelMain(), "epsg");
|
172 |
} |
173 |
} |
174 |
if( e.getSource() == panel.getJComboOptions()){
|
175 |
JComboBox cb = (JComboBox)e.getSource(); |
176 |
panel.setNewSelection((String)cb.getSelectedItem());
|
177 |
if (panel.getNewSelection().equals(PluginServices.getText(this,"sin_transformacion"))){ |
178 |
panel.getJButtonAccept().setVisible(true);
|
179 |
panel.getJButtonNext().setVisible(false);
|
180 |
} |
181 |
else {
|
182 |
panel.getJButtonAccept().setVisible(false);
|
183 |
panel.getJButtonNext().setVisible(true);
|
184 |
} |
185 |
} |
186 |
} |
187 |
|
188 |
public void changedUpdate(DocumentEvent e) { |
189 |
// TODO Auto-generated method stub
|
190 |
} |
191 |
|
192 |
public void insertUpdate(DocumentEvent e) { |
193 |
update(e); |
194 |
} |
195 |
|
196 |
public void removeUpdate(DocumentEvent e) { |
197 |
update(e); |
198 |
} |
199 |
|
200 |
public void valueChanged(ListSelectionEvent e) { |
201 |
if (e.getSource() == panel.getCrsMainPanel().getRecentsPanel().getJTable().getSelectionModel()){
|
202 |
ListSelectionModel lsm = (ListSelectionModel)e.getSource(); |
203 |
if (lsm.isSelectionEmpty()) {
|
204 |
panel.getCrsMainPanel().getRecentsPanel().selectedRowTable = -1;
|
205 |
panel.getCrsMainPanel().getRecentsPanel().setCodeCRS(-1);
|
206 |
panel.getJButtonAccept().setEnabled(false);
|
207 |
panel.getJComboOptions().setEnabled(false);
|
208 |
panel.getJButtonNext().setVisible(false);
|
209 |
panel.getJComboOptions().setSelectedIndex(0);
|
210 |
} |
211 |
else {
|
212 |
panel.getCrsMainPanel().getRecentsPanel().selectedRowTable = lsm.getMinSelectionIndex(); |
213 |
panel.getCrsMainPanel().getRecentsPanel().setCodeCRS(Integer.parseInt((String)panel.getCrsMainPanel().getRecentsPanel().sorter.getValueAt(panel.getCrsMainPanel().getRecentsPanel().selectedRowTable,1))); |
214 |
panel.getCrsMainPanel().getRecentsPanel().setWKT((String)panel.getCrsMainPanel().getRecentsPanel().sorter.getValueAt(panel.getCrsMainPanel().getRecentsPanel().selectedRowTable,0)); |
215 |
//int base = panel.getCrsMainPanel().getRecentsPanel().getCodeCRS();
|
216 |
String sour = (String)panel.getCrsMainPanel().getRecentsPanel().sorter.getValueAt(panel.getCrsMainPanel().getRecentsPanel().selectedRowTable,0); |
217 |
IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow(); |
218 |
View activeView = (com.iver.cit.gvsig.gui.View) activeWindow;
|
219 |
String authority = ((ICrs) activeView.getMapControl().getProjection()).getCrsWkt().getAuthority()[0]; |
220 |
if (sour.equals("EPSG") && authority.equals("EPSG")){ |
221 |
panel.compareDatum(panel.getCrsMainPanel().getRecentsPanel().getWKT()); |
222 |
} |
223 |
else {
|
224 |
panel.getJComboOptions().setSelectedIndex(0);
|
225 |
panel.getJComboOptions().setEnabled(false);
|
226 |
panel.getJButtonAccept().setEnabled(true);
|
227 |
panel.getJButtonAccept().setVisible(true);
|
228 |
panel.getJButtonNext().setVisible(false);
|
229 |
} |
230 |
} |
231 |
} |
232 |
|
233 |
if (e.getSource() == panel.getCrsMainPanel().getEpsgPanel().getJTable().getSelectionModel()){
|
234 |
/*panel.setConnection(new EpsgConnection());
|
235 |
panel.getConnection().setConnectionEPSG();*/
|
236 |
String[] not_soported = {"engineering", "vertical", "compound", "geocentric"}; |
237 |
boolean soported = true; |
238 |
ListSelectionModel lsm = (ListSelectionModel)e.getSource(); |
239 |
if (lsm.isSelectionEmpty()) {
|
240 |
panel.getCrsMainPanel().getEpsgPanel().selectedRowTable = -1;
|
241 |
panel.getCrsMainPanel().getEpsgPanel().setCodeCRS(-1);
|
242 |
panel.getJButtonAccept().setEnabled(false);
|
243 |
panel.getCrsMainPanel().getEpsgPanel().getInfoCrs().setEnabled(false);
|
244 |
panel.getJComboOptions().setEnabled(false);
|
245 |
panel.getJButtonNext().setVisible(false);
|
246 |
panel.getJComboOptions().setSelectedIndex(0);
|
247 |
} |
248 |
else {
|
249 |
panel.getCrsMainPanel().getEpsgPanel().selectedRowTable = lsm.getMinSelectionIndex(); |
250 |
String crs_kind = (String)panel.getCrsMainPanel().getEpsgPanel().sorter.getValueAt(panel.getCrsMainPanel().getEpsgPanel().selectedRowTable,2); |
251 |
for (int i = 0; i < not_soported.length; i++) { |
252 |
if (crs_kind.equals(not_soported[i])) {
|
253 |
soported = false;
|
254 |
} |
255 |
} |
256 |
if (soported){
|
257 |
panel.getCrsMainPanel().getEpsgPanel().setCodeCRS(Integer.parseInt((String)panel.getCrsMainPanel().getEpsgPanel().sorter.getValueAt(panel.getCrsMainPanel().getEpsgPanel().selectedRowTable,0))); |
258 |
panel.getCrsMainPanel().getEpsgPanel().setWKT(); |
259 |
panel.getJButtonAccept().setEnabled(true);
|
260 |
int base = panel.getCrsMainPanel().getEpsgPanel().getCodeCRS();
|
261 |
panel.compareDatum(panel.getCrsMainPanel().getEpsgPanel().getWKT()); |
262 |
} |
263 |
else {
|
264 |
JOptionPane.showMessageDialog(panel, PluginServices.getText(this,"crs_not_soported"), "Warning...", |
265 |
JOptionPane.WARNING_MESSAGE);
|
266 |
panel.getCrsMainPanel().getEpsgPanel().setCodeCRS(-1);
|
267 |
panel.getCrsMainPanel().getEpsgPanel().setCodeCRS(0);
|
268 |
panel.getJButtonAccept().setEnabled(false);
|
269 |
panel.getCrsMainPanel().getEpsgPanel().getInfoCrs().setEnabled(false);
|
270 |
} |
271 |
panel.getCrsMainPanel().getEpsgPanel().getInfoCrs().setEnabled(true);
|
272 |
} |
273 |
} |
274 |
|
275 |
if (e.getSource() == panel.getCrsMainPanel().getIauPanel().getJTable().getSelectionModel()){
|
276 |
ListSelectionModel lsm = (ListSelectionModel)e.getSource(); |
277 |
|
278 |
if (lsm.isSelectionEmpty()) {
|
279 |
panel.getCrsMainPanel().getIauPanel().selectedRowTable = -1;
|
280 |
panel.getCrsMainPanel().getIauPanel().setCodeCRS(-1);
|
281 |
panel.getJButtonAccept().setEnabled(false);
|
282 |
panel.getJComboOptions().setEnabled(false);
|
283 |
panel.getJButtonNext().setVisible(false);
|
284 |
panel.getJComboOptions().setSelectedIndex(0);
|
285 |
} |
286 |
else {
|
287 |
panel.getCrsMainPanel().getIauPanel().selectedRowTable = lsm.getMinSelectionIndex(); |
288 |
panel.getCrsMainPanel().getIauPanel().setCodeCRS(Integer.parseInt((String)panel.getCrsMainPanel().getIauPanel().sorter.getValueAt(panel.getCrsMainPanel().getIauPanel().selectedRowTable,0))); |
289 |
panel.getCrsMainPanel().getIauPanel().setWKT(); |
290 |
panel.getJComboOptions().setEnabled(false);
|
291 |
panel.getJButtonAccept().setEnabled(true);
|
292 |
} |
293 |
} |
294 |
} |
295 |
|
296 |
public void itemStateChanged(ItemEvent e) { |
297 |
CardLayout cl = (CardLayout)(panel.getCrsMainPanel().getJPanelMain().getLayout()); |
298 |
String op = (String)e.getItem(); |
299 |
if (op.equals("EPSG")){ |
300 |
panel.getCrsMainPanel().getEpsgPanel().connection(); |
301 |
if(panel.getCrsMainPanel().getEpsgPanel().getJTable().getSelectedRowCount()>0) |
302 |
panel.getJButtonAccept().setEnabled(true);
|
303 |
else
|
304 |
panel.getJButtonAccept().setEnabled(false);
|
305 |
} else if (op.equals("IAU2000")) { |
306 |
panel.getCrsMainPanel().getIauPanel().connection(); |
307 |
if(panel.getCrsMainPanel().getIauPanel().getJTable().getSelectedRowCount()>0) |
308 |
panel.getJButtonAccept().setEnabled(true);
|
309 |
else
|
310 |
panel.getJButtonAccept().setEnabled(false);
|
311 |
} |
312 |
else if (op.equals("Recientes")) { |
313 |
if(panel.getCrsMainPanel().getRecentsPanel().getJTable().getSelectedRowCount()>0) |
314 |
panel.getJButtonAccept().setEnabled(true);
|
315 |
else
|
316 |
panel.getJButtonAccept().setEnabled(false);
|
317 |
} |
318 |
else if (op.equals("ESRI")) { |
319 |
if(panel.getCrsMainPanel().getEsriPanel().getJTextOpen().getText().length()>0) |
320 |
panel.getJButtonAccept().setEnabled(true);
|
321 |
else
|
322 |
panel.getJButtonAccept().setEnabled(false);
|
323 |
} |
324 |
cl.show(panel.getCrsMainPanel().getJPanelMain(), (String)e.getItem());
|
325 |
panel.getCrsMainPanel().setDataSource((String)e.getItem());
|
326 |
} |
327 |
|
328 |
private void update(DocumentEvent e) { |
329 |
if( e.getDocument() == panel.getCrsMainPanel().getEsriPanel().getJTextOpen().getDocument()){
|
330 |
if(panel.getCrsMainPanel().getEsriPanel().getJTextOpen().getText().length()>0) |
331 |
panel.getJButtonAccept().setEnabled(true);
|
332 |
else
|
333 |
panel.getJButtonAccept().setEnabled(false);
|
334 |
} |
335 |
} |
336 |
|
337 |
public void mouseClicked(MouseEvent e) { |
338 |
// TODO Auto-generated method stub
|
339 |
if (panel.getJButtonAccept().isVisible()) {
|
340 |
if (e.getSource() == panel.getCrsMainPanel().getRecentsPanel().getJTable()){
|
341 |
if (e.getClickCount() == 2){ |
342 |
if (panel.isEpsg_tr()) {
|
343 |
GetTransepsg epsgParams = new GetTransepsg(panel.getEpsgTrPanel().getTransformation_code(),panel.getEpsgTrPanel().connect, panel.getEpsgTrPanel().inverseTranformation);
|
344 |
panel.getEpsgTrPanel().setValues(epsgParams.getParamValue()); |
345 |
panel.setProjection(panel.getEpsgTrPanel().getProjection()); |
346 |
panel.setEpsg_tr(false);
|
347 |
} |
348 |
else if (panel.isManual_tr()) { |
349 |
panel.setProjection(panel.getManualTrPanel().getProjection()); |
350 |
panel.setManual_tr(false);
|
351 |
} |
352 |
else if (panel.isNads_tr()) { |
353 |
panel.setProjection(panel.getNadsTrPanel().getProjection()); |
354 |
panel.setTargetNad(panel.getNadsTrPanel().getNad()); |
355 |
panel.setNads_tr(false);
|
356 |
} |
357 |
else{
|
358 |
panel.setSin_tr(true);
|
359 |
panel.setProjection(panel.getProjection()); |
360 |
} |
361 |
|
362 |
|
363 |
// * Actualizar recientes...
|
364 |
|
365 |
String authority = ((ICrs)panel.getProjection()).getCrsWkt().getAuthority()[0]; |
366 |
String wkt = ((ICrs)panel.getProjection()).getWKT();
|
367 |
String name = ((ICrs)panel.getProjection()).getCrsWkt().getName();
|
368 |
int code = ((ICrs)panel.getProjection()).getCode();
|
369 |
CrsData crsData = new CrsData(authority,code,name,wkt);
|
370 |
RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
|
371 |
persistence.addCrsData(crsData); |
372 |
|
373 |
PluginServices.getMDIManager().closeWindow(panel); |
374 |
} |
375 |
} |
376 |
if (e.getSource() == panel.getCrsMainPanel().getEpsgPanel().getJTable()){
|
377 |
if (e.getClickCount() == 2){ |
378 |
if (panel.isEpsg_tr()) {
|
379 |
GetTransepsg epsgParams = new GetTransepsg(panel.getEpsgTrPanel().getTransformation_code(),panel.getEpsgTrPanel().connect, panel.getEpsgTrPanel().inverseTranformation);
|
380 |
panel.getEpsgTrPanel().setValues(epsgParams.getParamValue()); |
381 |
panel.setProjection(panel.getEpsgTrPanel().getProjection()); |
382 |
panel.setEpsg_tr(false);
|
383 |
} |
384 |
else if (panel.isManual_tr()) { |
385 |
panel.setProjection(panel.getManualTrPanel().getProjection()); |
386 |
panel.setManual_tr(false);
|
387 |
} |
388 |
else if (panel.isNads_tr()) { |
389 |
panel.setProjection(panel.getNadsTrPanel().getProjection()); |
390 |
panel.setTargetNad(panel.getNadsTrPanel().getNad()); |
391 |
panel.setNads_tr(false);
|
392 |
} |
393 |
else{
|
394 |
panel.setSin_tr(true);
|
395 |
panel.setProjection(panel.getProjection()); |
396 |
} |
397 |
|
398 |
|
399 |
//* Actualizar recientes...
|
400 |
|
401 |
String authority = ((ICrs)panel.getProjection()).getCrsWkt().getAuthority()[0]; |
402 |
String wkt = ((ICrs)panel.getProjection()).getWKT();
|
403 |
String name = ((ICrs)panel.getProjection()).getCrsWkt().getName();
|
404 |
int code = ((ICrs)panel.getProjection()).getCode();
|
405 |
CrsData crsData = new CrsData(authority,code,name,wkt);
|
406 |
RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
|
407 |
persistence.addCrsData(crsData); |
408 |
|
409 |
PluginServices.getMDIManager().closeWindow(panel); |
410 |
} |
411 |
} |
412 |
if (e.getSource() == panel.getCrsMainPanel().getIauPanel().getJTable()){
|
413 |
if (e.getClickCount() == 2){ |
414 |
if (panel.isEpsg_tr()) {
|
415 |
GetTransepsg epsgParams = new GetTransepsg(panel.getEpsgTrPanel().getTransformation_code(),panel.getEpsgTrPanel().connect, panel.getEpsgTrPanel().inverseTranformation);
|
416 |
panel.getEpsgTrPanel().setValues(epsgParams.getParamValue()); |
417 |
panel.setProjection(panel.getEpsgTrPanel().getProjection()); |
418 |
panel.setEpsg_tr(false);
|
419 |
} |
420 |
else if (panel.isManual_tr()) { |
421 |
panel.setProjection(panel.getManualTrPanel().getProjection()); |
422 |
panel.setManual_tr(false);
|
423 |
} |
424 |
else if (panel.isNads_tr()) { |
425 |
panel.setProjection(panel.getNadsTrPanel().getProjection()); |
426 |
panel.setTargetNad(panel.getNadsTrPanel().getNad()); |
427 |
panel.setNads_tr(false);
|
428 |
} |
429 |
else{
|
430 |
panel.setSin_tr(true);
|
431 |
panel.setProjection(panel.getProjection()); |
432 |
} |
433 |
|
434 |
|
435 |
//* Actualizar recientes...
|
436 |
|
437 |
String authority = ((ICrs)panel.getProjection()).getCrsWkt().getAuthority()[0]; |
438 |
String wkt = ((ICrs)panel.getProjection()).getWKT();
|
439 |
String name = ((ICrs)panel.getProjection()).getCrsWkt().getName();
|
440 |
int code = ((ICrs)panel.getProjection()).getCode();
|
441 |
CrsData crsData = new CrsData(authority,code,name,wkt);
|
442 |
RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
|
443 |
persistence.addCrsData(crsData); |
444 |
|
445 |
PluginServices.getMDIManager().closeWindow(panel); |
446 |
} |
447 |
} |
448 |
} |
449 |
if (e.getSource() == panel.getEpsgTrPanel().getJTable()){
|
450 |
if (e.getClickCount() == 2){ |
451 |
GetTransepsg epsgParams = new GetTransepsg(panel.getEpsgTrPanel().getTransformation_code(),panel.getEpsgTrPanel().connect, panel.getEpsgTrPanel().inverseTranformation);
|
452 |
panel.getEpsgTrPanel().setValues(epsgParams.getParamValue()); |
453 |
panel.setProjection(panel.getEpsgTrPanel().getProjection()); |
454 |
panel.setEpsg_tr(false);
|
455 |
|
456 |
/*
|
457 |
* Actualizar recientes...
|
458 |
*/
|
459 |
String authority = ((ICrs)panel.getProjection()).getCrsWkt().getAuthority()[0]; |
460 |
String wkt = ((ICrs)panel.getProjection()).getWKT();
|
461 |
String name = ((ICrs)panel.getProjection()).getCrsWkt().getName();
|
462 |
int code = ((ICrs)panel.getProjection()).getCode();
|
463 |
CrsData crsData = new CrsData(authority,code,name,wkt);
|
464 |
RecentCRSsPersistence persistence = new RecentCRSsPersistence(RecentCRSsPersistence.pluginClassInstance);
|
465 |
persistence.addCrsData(crsData); |
466 |
|
467 |
PluginServices.getMDIManager().closeWindow(panel); |
468 |
} |
469 |
} |
470 |
} |
471 |
|
472 |
public void mouseEntered(MouseEvent e) { |
473 |
// TODO Auto-generated method stub
|
474 |
|
475 |
} |
476 |
|
477 |
public void mouseExited(MouseEvent e) { |
478 |
// TODO Auto-generated method stub
|
479 |
|
480 |
} |
481 |
|
482 |
public void mousePressed(MouseEvent e) { |
483 |
// TODO Auto-generated method stub
|
484 |
|
485 |
} |
486 |
|
487 |
public void mouseReleased(MouseEvent e) { |
488 |
// TODO Auto-generated method stub
|
489 |
|
490 |
} |
491 |
|
492 |
} |