Package net.sf.mzmine.parameters

Examples of net.sf.mzmine.parameters.UserParameter


    }

    if (src == buttonRemoveParameter) {
      int selectedColumn = tableParameterValues.getSelectedColumn();
      UserParameter parameter = tablemodelParameterValues
          .getParameter(selectedColumn);
      if (parameter == null) {
        desktop.displayErrorMessage("Select a parameter column from the table first.");
        return;
      }
View Full Code Here


  protected UserParameter getParameter(String parameterName) {
    Iterator<UserParameter> parameterIterator = parameterValues.keySet()
        .iterator();

    while (parameterIterator.hasNext()) {
      UserParameter p = parameterIterator.next();
      if (p.getName().equals(parameterName))
        return p;
    }

    return null;
  }
View Full Code Here

  }

  private boolean validateParameterValues() {
    // Create new parameters and set values
    for (int columnIndex = 0; columnIndex < parameterValues.keySet().size(); columnIndex++) {
      UserParameter parameter = tablemodelParameterValues
          .getParameter(columnIndex + 1);

      if (parameter instanceof DoubleParameter) {

        for (int dataFileIndex = 0; dataFileIndex < dataFiles.length; dataFileIndex++) {
          Object objValue = tablemodelParameterValues.getValueAt(
              dataFileIndex, columnIndex + 1);
          if (objValue instanceof String) {
            try {
              Double.parseDouble((String) objValue);
            } catch (NumberFormatException ex) {
              desktop.displayErrorMessage("Incorrect value ("
                  + objValue + ") for parameter "
                  + parameter.getName() + " in data file "
                  + dataFiles[dataFileIndex].getName() + ".");
              return false;
            }
          }
        }
View Full Code Here

      currentProject.addParameter(parameter);
    }

    // Set values for new parameters
    for (int columnIndex = 0; columnIndex < parameterValues.keySet().size(); columnIndex++) {
      UserParameter parameter = tablemodelParameterValues
          .getParameter(columnIndex + 1);

      for (int dataFileIndex = 0; dataFileIndex < dataFiles.length; dataFileIndex++) {
        RawDataFile file = dataFiles[dataFileIndex];
View Full Code Here

        parameterValues);
    tableParameterValues.setModel(tablemodelParameterValues);

    for (int columnIndex = 0; columnIndex < (tablemodelParameterValues
        .getColumnCount() - 1); columnIndex++) {
      UserParameter parameter = tablemodelParameterValues
          .getParameter(columnIndex + 1);
      if (parameter instanceof ComboParameter) {
        Object choices[] = ((ComboParameter<Object>) parameter)
            .getChoices();
        tableParameterValues
View Full Code Here

  public String getColumnName(int col) {
    if (col == 0)
      return "Raw data";
    if (col > 0) {
      UserParameter p = parameters[col - 1];
      return p.getName();
    }
    return null;
  }
View Full Code Here

  public Object getValueAt(int row, int col) {
    if (col == 0)
      return files[row].getName();
    if (col > 0) {
      UserParameter p = parameters[col - 1];
      return parameterValues.get(p)[row];
    }
    return null;
  }
View Full Code Here

  @Override
  public void setValueAt(Object value, int row, int col) {
    if (col == 0)
      return;
    UserParameter p = parameters[col - 1];
    Object[] values = parameterValues.get(p);
    values[row] = value;

  }
View Full Code Here

        desktop.displayErrorMessage("Give a name for the parameter first.");
        return;
      }
      String paramName = fieldName.getText();

      UserParameter parameter = null;

      if (radiobuttonNumerical.isSelected()) {

        parameter = new DoubleParameter(paramName, null);
      }
View Full Code Here

    ParameterSet embeddedParameters = value.getParameterSet();
    if (embeddedParameters == null)
      return value;
    for (Parameter p : embeddedParameters.getParameters()) {
      if (p instanceof UserParameter) {
        UserParameter up = (UserParameter) p;
        Object upValue = up.getValue();
        if (upValue == null)
          return null;
      }
    }
    return value;
View Full Code Here

TOP

Related Classes of net.sf.mzmine.parameters.UserParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.