Revision 8127 trunk/libraries/libJCRS/src/org/gvsig/crs/gui/panels/TransformationEpsgPanel.java
TransformationEpsgPanel.java | ||
---|---|---|
32 | 32 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
33 | 33 |
import com.iver.cit.gvsig.gui.TableSorter; |
34 | 34 |
|
35 |
public class TransformationEpsgPanel extends JPanel { |
|
35 |
public class TransformationEpsgPanel extends JPanel implements ListSelectionListener {
|
|
36 | 36 |
|
37 | 37 |
|
38 | 38 |
/** |
... | ... | |
165 | 165 |
ListSelectionModel rowSM2 = transformationTable.getSelectionModel(); |
166 | 166 |
rowSM2.addListSelectionListener(new ListSelectionListener() { |
167 | 167 |
public void valueChanged(ListSelectionEvent e) { |
168 |
lsm2 = (ListSelectionModel)e.getSource(); |
|
169 |
if (lsm2.isSelectionEmpty()) { |
|
170 |
selectedRowTable = -1; |
|
171 |
tra = false; |
|
172 |
} |
|
173 |
else { |
|
174 |
selectedRowTable = lsm2.getMinSelectionIndex(); |
|
175 |
setTrasformation_code(Integer.parseInt((String)dtm.getValueAt(selectedRowTable,0))); |
|
176 |
String sentence = "SELECT source_crs_code " + |
|
177 |
"FROM epsg_coordoperation " + |
|
178 |
"WHERE coord_op_code = " + getTransformation_code() ; |
|
179 |
ResultSet result = Query.select(sentence,connect.getConnection()); |
|
180 |
try { |
|
181 |
result.next(); |
|
182 |
int source = result.getInt("source_crs_code"); |
|
183 |
if (source == getSource()) { |
|
184 |
inverseTranformation = false; |
|
185 |
} |
|
186 |
else inverseTranformation = true; |
|
187 |
} catch (SQLException e1) { |
|
188 |
e1.printStackTrace(); |
|
189 |
} |
|
190 |
} |
|
191 |
} |
|
168 |
} |
|
192 | 169 |
}); |
193 | 170 |
} |
194 | 171 |
return transformationTable; |
... | ... | |
454 | 431 |
return m_viewinfo; |
455 | 432 |
} |
456 | 433 |
|
434 |
public void valueChanged(ListSelectionEvent e) { |
|
435 |
// TODO Auto-generated method stub |
|
436 |
if (e.getSource() == this.getJTable()){ |
|
437 |
lsm2 = (ListSelectionModel)e.getSource(); |
|
438 |
if (lsm2.isSelectionEmpty()) { |
|
439 |
selectedRowTable = -1; |
|
440 |
tra = false; |
|
441 |
} |
|
442 |
else { |
|
443 |
selectedRowTable = lsm2.getMinSelectionIndex(); |
|
444 |
setTrasformation_code(Integer.parseInt((String)dtm.getValueAt(selectedRowTable,0))); |
|
445 |
String sentence = "SELECT source_crs_code " + |
|
446 |
"FROM epsg_coordoperation " + |
|
447 |
"WHERE coord_op_code = " + getTransformation_code() ; |
|
448 |
ResultSet result = Query.select(sentence,connect.getConnection()); |
|
449 |
try { |
|
450 |
result.next(); |
|
451 |
int source = result.getInt("source_crs_code"); |
|
452 |
if (source == getSource()) { |
|
453 |
inverseTranformation = false; |
|
454 |
} |
|
455 |
else inverseTranformation = true; |
|
456 |
} catch (SQLException e1) { |
|
457 |
e1.printStackTrace(); |
|
458 |
} |
|
459 |
} |
|
460 |
} |
|
461 |
} |
|
462 |
|
|
457 | 463 |
} |
Also available in: Unified diff