Ejemplo n.º 1
0
  /** 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
Ejemplo n.º 2
0
  /**
   * Constructor de la clase
   *
   * @param service
   * @param initialChosenMapLayers
   * @param initialSRS
   * @param alpha
   * @param selectedStyles
   */
  public EditWMSQueryPanel(
      WMService service,
      List initialChosenMapLayers,
      String initialSRS,
      int alpha,
      String initialFormat,
      Map selectedStyles) {
    this.service = service;
    this.format = initialFormat;
    this.selectedStyles = selectedStyles;

    try {
      jbInit();
      String url = service.getServerUrl();
      if (url.endsWith("?") || url.endsWith("&")) {
        url = url.substring(0, url.length() - 1);
      }
      urlTextField.setText(url);
      mapLayerPanel.init(service, initialChosenMapLayers);

      updateComboBox();
      String srsName = SRSUtils.getName(initialSRS);
      srsComboBox.setSelectedItem(srsName);
      SRS = srsName;

      mapLayerPanel.add(
          new InputChangedListener() {
            public void inputChanged() {
              updateComboBox();
              updateEnabledButtons();
            }
          });
      setAlpha(alpha);

      // inicializamos la tabla hash de estilos

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  } // fin del constructor