use of net.sf.mzmine.parameters.parametertypes.ComboComponent in project mzmine2 by mzmine.
the class GraphicsExportDialog method choosePath.
/**
* choose a path by file chooser
*/
protected void choosePath() {
// open filechooser
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
//
StringComponent txtPath = (StringComponent) parametersAndComponents.get(GraphicsExportParameters.path.getName());
StringComponent txtName = (StringComponent) parametersAndComponents.get(GraphicsExportParameters.filename.getName());
ComboComponent<String> format = (ComboComponent<String>) parametersAndComponents.get(GraphicsExportParameters.exportFormat.getName());
// only a folder? or also a file name > then split
if (file.isDirectory()) {
// only a folder
txtPath.setText(file.getAbsolutePath());
} else {
// data file selected
// get folder
txtPath.setText(FileAndPathUtil.getFolderOfFile(file).getAbsolutePath());
// get filename
txtName.setText(FileAndPathUtil.getFileNameFromPath(file));
// get format without .
String f = FileAndPathUtil.getFormat(file).toUpperCase();
format.setSelectedItem(f);
}
}
}
use of net.sf.mzmine.parameters.parametertypes.ComboComponent in project mzmine2 by mzmine.
the class MSMSLibrarySubmissionWindow method addListener.
private void addListener() {
// listen for changes in masslist selection and preprocessing
MassListComponent mc = getMassListComponent();
mc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
DoubleComponent nc = getNoiseLevelComponent();
nc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
IntegerComponent minc = getMinSignalComponent();
minc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
ComboComponent<ScanSortMode> sortc = getComboSortMode();
sortc.addItemListener(e -> updateSortModeOnAllSelectors());
IntegerComponent mslevel = getMSLevelComponent();
mslevel.addDocumentListener(new DelayedDocumentListener(e -> {
updateParameterSetFromComponents();
Integer level = paramMeta.getParameter(LibraryMetaDataParameters.MS_LEVEL).getValue();
setFragmentScan(level != null && level > 1);
}));
}
use of net.sf.mzmine.parameters.parametertypes.ComboComponent in project mzmine2 by mzmine.
the class RawFileMergeParameters method showSetupDialog.
@Override
public ExitCode showSetupDialog(Window parent, boolean valueCheckRequired) {
if ((getParameters() == null) || (getParameters().length == 0))
return ExitCode.OK;
ParameterSetupDialog dialog = new ParameterSetupDialog(parent, valueCheckRequired, this);
//
((ComboComponent) dialog.getComponentForParameter(mode)).addItemListener(e -> {
boolean pattern = (e.getItem().equals(MODE.MERGE_PATTERN));
dialog.getComponentForParameter(position).setVisible(pattern);
dialog.getComponentForParameter(posMarker).setVisible(pattern);
});
dialog.setVisible(true);
return dialog.getExitCode();
}
Aggregations