Package net.sf.mzmine.parameters

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


      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

  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

        } 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

    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

    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

    parameters.getParameter(IntensityPlotParameters.selectedRows)
        .setChoices(rows);
    parameters.getParameter(IntensityPlotParameters.selectedRows).setValue(
        rows);

    UserParameter projectParams[] = MZmineCore.getCurrentProject()
        .getParameters();
    Object xAxisSources[] = new Object[projectParams.length + 1];
    xAxisSources[0] = IntensityPlotParameters.rawDataFilesOption;

    for (int i = 0; i < projectParams.length; i++) {
View Full Code Here

    // If the option is selected, first check that the module has all
    // parameters set
    if ((value != null) && (value)) {
      for (Parameter p : embeddedParameters.getParameters()) {
        if (p instanceof UserParameter) {
          UserParameter up = (UserParameter) p;
          Object upValue = up.getValue();
          if (upValue == null)
            return null;
        }
      }
    }
View Full Code Here

    serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");

    hd.setResult(streamResult);
    hd.startDocument();

    UserParameter projectParameters[] = project.getParameters();

    AttributesImpl atts = new AttributesImpl();

    atts.addAttribute("", "",
        UserParameterElementName.COUNT.getElementName(), "CDATA",
View Full Code Here

    dialog.setVisible(true);
    return dialog.getExitCode();
  }

  protected void generateChoices() {
    UserParameter newChoices[] = MZmineCore.getCurrentProject()
        .getParameters();

    String[] choices;
    if (newChoices == null || newChoices.length == 0) {
      choices = new String[1];
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.