/** Method updateComboBox. */ private void updateComboBox() { String selectedSRS = (String) srsComboBox.getSelectedItem(); comboBoxModel.removeAllElements(); for (Iterator i = mapLayerPanel.commonSRSList().iterator(); i.hasNext(); ) { String commonSRS = (String) i.next(); String srsName = SRSUtils.getName(commonSRS); comboBoxModel.addElement(srsName); } // selectedSRS might no longer be in the combobox, in which case nothing will be selected. [Jon // Aquino] srsComboBox.setSelectedItem(selectedSRS); if ((srsComboBox.getSelectedItem() == null) && (srsComboBox.getItemCount() > 0)) { srsComboBox.setSelectedIndex(0); } } // fin del método updateComboBox
public String getEPSG() { int index = srsComboBox.getSelectedIndex(); String srsCode = (String) mapLayerPanel.commonSRSList().get(index); return srsCode; }