Examples of UserParameter


Examples of net.sf.mzmine.parameters.UserParameter

  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

Examples of net.sf.mzmine.parameters.UserParameter

  @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

Examples of net.sf.mzmine.parameters.UserParameter

        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

Examples of net.sf.mzmine.parameters.UserParameter

    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

Examples of net.sf.mzmine.parameters.UserParameter

    this.selectedRows = parameters.getParameter(
        IntensityPlotParameters.selectedRows).getValue();

    if (xAxisValueSource instanceof ParameterWrapper) {
      MZmineProject project = MZmineCore.getCurrentProject();
      UserParameter xAxisParameter = ((ParameterWrapper) xAxisValueSource)
          .getParameter();
      LinkedHashSet<Comparable> parameterValues = new LinkedHashSet<Comparable>();
      for (RawDataFile file : selectedFiles) {
        Object value = project.getParameterValue(xAxisParameter, file);
        parameterValues.add((Comparable<?>) value);
View Full Code Here

Examples of net.sf.mzmine.parameters.UserParameter

      RawDataFile columnFile = selectedFiles[getColumnIndex(xValue)];
      return new RawDataFile[]{columnFile};
    }
    if (xAxisValueSource instanceof ParameterWrapper) {
      HashSet<RawDataFile> files = new HashSet<RawDataFile>();
      UserParameter xAxisParameter = ((ParameterWrapper) xAxisValueSource)
          .getParameter();
      MZmineProject project = MZmineCore.getCurrentProject();
      for (RawDataFile file : selectedFiles) {
        Object fileValue = project.getParameterValue(xAxisParameter,
            file);
View Full Code Here

Examples of net.sf.mzmine.parameters.UserParameter

  private boolean processParameterValues(File parameterFile,
      UserParameter[] parameters) {

    // Warn user if main dialog already contains a parameter with same name
    for (UserParameter parameter : parameters) {
      UserParameter p = mainDialog.getParameter(parameter.getName());
      if (p != null) {
        int res = JOptionPane.showConfirmDialog(mainDialog,
            "Overwrite previous parameter(s) with same name?",
            "Overwrite?", JOptionPane.OK_CANCEL_OPTION);
        if (res == JOptionPane.CANCEL_OPTION)
          return false;
        else
          break;
      }
    }

    // Remove parameters with same name
    for (UserParameter parameter : parameters) {
      UserParameter p = mainDialog.getParameter(parameter.getName());
      if (p != null) {
        mainDialog.removeParameter(p);
      }
    }

    // Add new parameters to the main dialog
    for (UserParameter parameter : parameters) {
      mainDialog.addParameter(parameter);
    }

    // Open reader
    BufferedReader parameterFileReader;
    try {
      parameterFileReader = new BufferedReader(new FileReader(
          parameterFile));
    } catch (FileNotFoundException ex) {
      logger.severe("Could not open file " + parameterFile);
      desktop.displayErrorMessage("Could not open file " + parameterFile);
      return false;
    }

    try {

      // Skip first row
      parameterFileReader.readLine();

      // Read rest of the rows which contain file name in the first column
      // and parameter values in the rest of the columns
      String nextRow = parameterFileReader.readLine();
      while (nextRow != null) {
        StringTokenizer st = new StringTokenizer(nextRow, ",");

        nextRow = parameterFileReader.readLine();

        // Get raw data file for this row
        String fileName = st.nextToken();

        // Set parameter values to project
        int parameterIndex = 0;
        while (st.hasMoreTokens()) {
          String parameterValue = st.nextToken();
          UserParameter parameter = parameters[parameterIndex];

          if (parameter instanceof DoubleParameter)
            mainDialog.setParameterValue(parameter, fileName,
                Double.parseDouble(parameterValue));
          else
View Full Code Here

Examples of net.sf.mzmine.parameters.UserParameter

        } else {
          SelectInput input = (SelectInput) lInput;
          String[] elements = ((SelectInput) lInput).getElements();

          if (input.getMultiple()) {
            UserParameter p = new MultiChoiceParameter<String>(
                lInput.getComment(), lInput.getName(), elements);
            para.add(p);

          } else {
            UserParameter p = new ComboParameter<String>(
                lInput.getComment(), lInput.getName(), elements);
            para.add(p);
          }
        }
      }
View Full Code Here

Examples of net.sf.mzmine.parameters.UserParameter

    if (coloringType.isByParameter()) {
      // Group files with same parameter value to same group
      MZmineProject project = MZmineCore.getCurrentProject();
      Vector<Object> availableParameterValues = new Vector<Object>();
      UserParameter selectedParameter = coloringType.getParameter();
      for (RawDataFile rawDataFile : selectedRawDataFiles) {
        Object paramValue = project.getParameterValue(
            selectedParameter, rawDataFile);
        if (!availableParameterValues.contains(paramValue))
          availableParameterValues.add(paramValue);
View Full Code Here

Examples of net.sf.mzmine.parameters.UserParameter

    if (coloringType.isByParameter()) {
      // Group files with same parameter value to same group
      MZmineProject project = MZmineCore.getCurrentProject();
      Vector<Object> availableParameterValues = new Vector<Object>();
      UserParameter selectedParameter = coloringType.getParameter();
      for (RawDataFile rawDataFile : selectedRawDataFiles) {
        Object paramValue = project.getParameterValue(
            selectedParameter, rawDataFile);
        if (!availableParameterValues.contains(paramValue))
          availableParameterValues.add(paramValue);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.