Package net.sf.mzmine.taskcontrol

Examples of net.sf.mzmine.taskcontrol.Task


    PeakList peakLists[] = parameters.getParameter(
        FragmentSearchParameters.peakLists).getValue();

    for (PeakList peakList : peakLists) {
      Task newTask = new FragmentSearchTask(parameters, peakList);
      tasks.add(newTask);
    }
    return ExitCode.OK;
  }
View Full Code Here


    RawDataFile[] dataFiles = parameters.getParameter(
        ChromatogramBuilderParameters.dataFiles).getValue();

    for (int i = 0; i < dataFiles.length; i++) {
      Task newTask = new ChromatogramBuilderTask(dataFiles[i],
          parameters.cloneParameter());
      tasks.add(newTask);
    }

    return ExitCode.OK;
View Full Code Here

    PeakList peakLists[] = parameters.getParameter(
        CustomDBSearchParameters.peakLists).getValue();

    for (PeakList peakList : peakLists) {
      Task newTask = new CustomDBSearchTask(peakList, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
View Full Code Here

    RawDataFile[] dataFiles = parameters.getParameter(
        MsMsPeakPickerParameters.dataFiles).getValue();

    for (RawDataFile dataFile : dataFiles) {
      Task newTask = new MsMsPeakPickingTask(dataFile, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
View Full Code Here

  public void dispose() {

    // If the window is closed, we want to cancel all running tasks of the
    // data
    // sets
    Task tasks[] = this.ticDataSets.values().toArray(new Task[0]);

    for (Task task : tasks) {
      TaskStatus status = task.getStatus();
      if ((status == TaskStatus.WAITING)
          || (status == TaskStatus.PROCESSING)) {
View Full Code Here

          logger.log(Level.SEVERE,
              "Could not create a new temporary file ", e);
          return true;
        }

        Task newTask = null;
        if (extension.equals("mzdata")) {
          newTask = new MzDataReadTask(temp, newMZmineFile);
        }
        if (extension.equals("mzxml")) {
          newTask = new MzXMLReadTask(temp, newMZmineFile);
        }
        if (extension.equals("mzml")) {
          newTask = new MzMLReadTask(temp, newMZmineFile);
        }
        if (extension.equals("cdf")) {
          newTask = new NetCDFReadTask(temp, newMZmineFile);
        }
        if (extension.equals("raw")) {
          newTask = new XcaliburRawFileReadTask(temp, newMZmineFile);
        }
        if (extension.equals("csv")) {
          newTask = new AgilentCsvReadTask(temp, newMZmineFile);
        }
        if (extension.equals("xml"))
          try {
            // Check the first 512 bytes of the file, to determine
            // the
            // file type
            FileReader reader = new FileReader(temp);
            char buffer[] = new char[512];
            reader.read(buffer);
            reader.close();
            String fileHeader = new String(buffer);
            if (fileHeader.contains("mzXML")) {
              newTask = new MzXMLReadTask(temp, newMZmineFile);
            }
            if (fileHeader.contains("mzData")) {
              newTask = new MzDataReadTask(temp, newMZmineFile);
            }
            if (fileHeader.contains("mzML")) {
              newTask = new MzMLReadTask(temp, newMZmineFile);
            }
          } catch (Exception e) {
            logger.warning("Cannot read file " + temp + ": " + e);
            return true;
          }

        if (newTask == null) {
          logger.severe("Cannot determine file type of file " + temp);
          MZmineCore.getDesktop().displayErrorMessage(
              "Obtained malformed sample file for \"" + sampleID
                  + '"');
          return true;
        }

        newTask.addTaskListener(this);
        tasks.add(newTask);
      } catch (FileNotFoundException e) {
        logger.severe("Could not find expected sample \"" + sampleID
            + '"');
        MZmineCore.getDesktop().displayErrorMessage(
View Full Code Here

    RawDataFile[] dataFiles = parameters.getParameter(
        MassDetectionParameters.dataFiles).getValue();

    for (RawDataFile dataFile : dataFiles) {
      Task newTask = new MassDetectionTask(dataFile, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
View Full Code Here

    RawDataFile[] dataFiles = parameters.getParameter(
        ScanFiltersParameters.dataFiles).getValue();

    for (RawDataFile dataFile : dataFiles) {
      Task newTask = new ScanFilteringTask(dataFile, parameters);
      tasks.add(newTask);
    }
    return ExitCode.OK;
  }
View Full Code Here

      BatchQueue newQueue = BatchQueue.loadFromXml(parsedBatchXML
          .getDocumentElement());
      ParameterSet parameters = new BatchModeParameters();
      parameters.getParameter(BatchModeParameters.batchQueue).setValue(
          newQueue);
      Task batchTask = new BatchTask(parameters);
      batchTask.run();
      if (batchTask.getStatus() == TaskStatus.FINISHED)
        return ExitCode.OK;
      else
        return ExitCode.ERROR;
    } catch (Throwable e) {
      logger.log(Level.SEVERE, "Error while running batch", e);
View Full Code Here

  public synchronized Object getValueAt(int row, int column) {

    if (row < size) {

      WrappedTask wrappedTask = queue[row];
      Task actualTask = wrappedTask.getActualTask();

      switch (column) {
        case 0 :
          return actualTask.getTaskDescription();
        case 1 :
          return wrappedTask.getPriority();
        case 2 :
          return actualTask.getStatus();
        case 3 :
          double finishedPercentage = actualTask
              .getFinishedPercentage();
          LabeledProgressBar progressBar = progressBars.get(row);
          if (progressBar == null) {
            progressBar = new LabeledProgressBar(finishedPercentage);
            progressBars.put(row, progressBar);
View Full Code Here

TOP

Related Classes of net.sf.mzmine.taskcontrol.Task

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.