Search in sources :

Example 46 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class AddFilePopupMenu method actionPerformed.

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
public void actionPerformed(ActionEvent event) {
    Object src = event.getSource();
    RawDataFile file = menuItemFiles.get(src);
    if (file != null)
        visualizer.addRawDataFile(file);
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile)

Example 47 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class AddFilePopupMenu method menuSelected.

/**
 * @see javax.swing.event.MenuListener#menuSelected(javax.swing.event.MenuEvent)
 */
public void menuSelected(MenuEvent event) {
    // remove all menu items
    removeAll();
    // get all project files
    RawDataFile[] openFiles = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
    List<RawDataFile> visualizedFiles = Arrays.asList(visualizer.getRawDataFiles());
    menuItemFiles = new Hashtable<JMenuItem, RawDataFile>();
    for (RawDataFile file : openFiles) {
        // if this file is already added, skip it
        if (visualizedFiles.contains(file))
            continue;
        // add a menu item for each file
        JMenuItem newItem = new JMenuItem(file.getName());
        newItem.addActionListener(this);
        menuItemFiles.put(newItem, file);
        add(newItem);
    }
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile) JMenuItem(javax.swing.JMenuItem)

Example 48 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class RemoveFilePopupMenu method actionPerformed.

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
public void actionPerformed(ActionEvent event) {
    Object src = event.getSource();
    RawDataFile file = menuItemFiles.get(src);
    if (file != null)
        visualizer.removeRawDataFile(file);
    // Disable menu?
    RawDataFile[] files = visualizer.getRawDataFiles();
    if (files.length == 1) {
        this.setEnabled(false);
    }
}
Also used : RawDataFile(net.sf.mzmine.datamodel.RawDataFile)

Example 49 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class ShoulderPeaksFilterModule method runModule.

@Override
@Nonnull
public ExitCode runModule(@Nonnull MZmineProject project, @Nonnull ParameterSet parameters, @Nonnull Collection<Task> tasks) {
    RawDataFile[] dataFiles = parameters.getParameter(ShoulderPeaksFilterParameters.dataFiles).getValue().getMatchingRawDataFiles();
    for (RawDataFile dataFile : dataFiles) {
        Task newTask = new ShoulderPeaksFilterTask(dataFile, parameters.cloneParameterSet());
        tasks.add(newTask);
    }
    return ExitCode.OK;
}
Also used : Task(net.sf.mzmine.taskcontrol.Task) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) Nonnull(javax.annotation.Nonnull)

Example 50 with RawDataFile

use of net.sf.mzmine.datamodel.RawDataFile in project mzmine2 by mzmine.

the class UserParameterOpenHandler_2_3 method endElement.

/**
 * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
 *      java.lang.String)
 */
@SuppressWarnings("unchecked")
public void endElement(String namespaceURI, String sName, String qName) throws SAXException {
    if (canceled)
        throw new SAXException("Parsing canceled");
    // <OPTION>
    if (qName.equals(UserParameterElementName_2_3.OPTION.getElementName())) {
        String optionValue = getTextOfElement();
        currentOptions.add(optionValue);
    }
    // <VALUE>
    if (qName.equals(UserParameterElementName_2_3.VALUE.getElementName())) {
        RawDataFile currentDataFile = dataFilesIDMap.get(currentDataFileID);
        String valueString = getTextOfElement();
        Object value;
        if (currentParameter instanceof DoubleParameter) {
            value = new Double(valueString);
        } else
            value = valueString;
        currentValues.put(currentDataFile, value);
    }
    // <PARAMETER>
    if (qName.equals(UserParameterElementName_2_3.PARAMETER.getElementName())) {
        if (currentParameter instanceof ComboParameter) {
            String[] newChoices = currentOptions.toArray(new String[0]);
            ((ComboParameter<String>) currentParameter).setChoices(newChoices);
        }
        newProject.addParameter(currentParameter);
        for (RawDataFile dataFile : currentValues.keySet()) {
            Object value = currentValues.get(dataFile);
            newProject.setParameterValue(currentParameter, dataFile, value);
        }
        parsedParams++;
    }
}
Also used : DoubleParameter(net.sf.mzmine.parameters.parametertypes.DoubleParameter) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) SAXException(org.xml.sax.SAXException) ComboParameter(net.sf.mzmine.parameters.parametertypes.ComboParameter)

Aggregations

RawDataFile (net.sf.mzmine.datamodel.RawDataFile)185 Feature (net.sf.mzmine.datamodel.Feature)59 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)52 DataPoint (net.sf.mzmine.datamodel.DataPoint)51 Scan (net.sf.mzmine.datamodel.Scan)40 ArrayList (java.util.ArrayList)33 PeakList (net.sf.mzmine.datamodel.PeakList)33 Nonnull (javax.annotation.Nonnull)24 SimpleDataPoint (net.sf.mzmine.datamodel.impl.SimpleDataPoint)24 SimplePeakList (net.sf.mzmine.datamodel.impl.SimplePeakList)24 SimplePeakListRow (net.sf.mzmine.datamodel.impl.SimplePeakListRow)22 Task (net.sf.mzmine.taskcontrol.Task)20 SimplePeakListAppliedMethod (net.sf.mzmine.datamodel.impl.SimplePeakListAppliedMethod)19 SimpleFeature (net.sf.mzmine.datamodel.impl.SimpleFeature)17 IOException (java.io.IOException)14 ParameterSet (net.sf.mzmine.parameters.ParameterSet)14 File (java.io.File)13 MassList (net.sf.mzmine.datamodel.MassList)13 PeakListAppliedMethod (net.sf.mzmine.datamodel.PeakList.PeakListAppliedMethod)13 TreeMap (java.util.TreeMap)10