コード例 #1
0
  /**
   * Sets the unit options (radio buttons), enables the unit selection combobox.
   *
   * @param selectedRadio
   */
  private void setSelectionUnitOption(final Button selectedRadio) {

    BufferCommand cmd = (BufferCommand) getCommand();
    cmd.setRadioUnitOption(selectedRadio);
    // sets unit options
    this.defaultRadioUnitOption = selectedRadio;
    this.radioMapUnits.setSelection(selectedRadio.equals(this.radioMapUnits));
    this.radioLayerUnits.setSelection(selectedRadio.equals(this.radioLayerUnits));
    this.radioSpecifyUnits.setSelection(selectedRadio.equals(this.radioSpecifyUnits));
    // enables combo
    if (selectedRadio.equals(this.radioSpecifyUnits)) {
      this.comboWidthUnits.setEnabled(true);
    } else {
      this.comboWidthUnits.setEnabled(false);
    }
  }
コード例 #2
0
  /** Validate the current option's values */
  @Override
  protected final void setParametersOnCommand(ISOCommand command) {

    BufferCommand cmd = (BufferCommand) command;

    if (comboWidthUnits.getItemCount() == 0) {
      return;
    }

    // gets the options values and sends it to controller which does the
    // validation.

    Double distance = getBufferDistance();

    Unit<?> units = getBufferUnitOfMeasure();

    cmd.setBasicOptions(distance, units);
  }