OpenMS
2.8.0
|
#include <OpenMS/VISUAL/LayerDataBase.h>
Public Member Functions | |
LayerAnnotatorBase (const FileTypes::FileTypeList &supported_types, const String &file_dialog_text, QWidget *gui_lock) | |
C'tor with params. More... | |
bool | annotateWithFileDialog (LayerDataBase &layer, LogWindow &log, const String ¤t_path) const |
bool | annotateWithFilename (LayerDataBase &layer, LogWindow &log, const String &filename) const |
Static Public Member Functions | |
static std::unique_ptr< LayerAnnotatorBase > | getAnnotatorWhichSupports (const FileTypes::Type &type) |
static std::unique_ptr< LayerAnnotatorBase > | getAnnotatorWhichSupports (const String &filename) |
see getAnnotatorWhichSupports(const FileTypes::Type& type). Filetype is queried from filename More... | |
Protected Member Functions | |
virtual bool | annotateWorker_ (LayerDataBase &layer, const String &filename, LogWindow &log) const =0 |
Protected Attributes | |
const FileTypes::FileTypeList | supported_types_ |
const String | file_dialog_text_ |
QWidget * | gui_lock_ = nullptr |
optional widget which will be locked when calling annotateWorker_() in child-classes More... | |
A base class to annotate layers of specific types with (identification) data @hint Add new derived classes to getAnnotatorWhichSupports() to enable automatic annotation in TOPPView
LayerAnnotatorBase | ( | const FileTypes::FileTypeList & | supported_types, |
const String & | file_dialog_text, | ||
QWidget * | gui_lock | ||
) |
C'tor with params.
supported_types | Which identification data types are allowed to be opened by the user in annotate() |
file_dialog_text | The header text of the file dialog shown to the user |
gui_lock | Optional GUI element which will be locked (disabled) during call to 'annotateWorker_'; can be null_ptr |
bool annotateWithFileDialog | ( | LayerDataBase & | layer, |
LogWindow & | log, | ||
const String & | current_path | ||
) | const |
Annotates a layer
, writing messages to log
and showing QMessageBoxes on errors. The input file is selected via a file-dialog which is opened with current_path
as initial path. The filetype is checked to be one of the supported_types_ before the annotateWorker_ function is called as implemented by the derived classes
Referenced by TOPPViewBase::annotateWithAMS(), TOPPViewBase::annotateWithID(), and TOPPViewBase::annotateWithOSW().
bool annotateWithFilename | ( | LayerDataBase & | layer, |
LogWindow & | log, | ||
const String & | filename | ||
) | const |
Annotates a layer
, given a filename from which to load the data. The filetype is checked to be one of the supported_types_ before the annotateWorker_ function is called as implemented by the derived classes
|
protectedpure virtual |
abstract virtual worker function to annotate a layer using content from the filename
returns true on success
Implemented in LayerAnnotatorOSW, LayerAnnotatorAMS, and LayerAnnotatorPeptideID.
|
static |
get a derived annotator class, which supports annotation of the given filetype. If multiple class support this type (currently not the case) an Exception::IllegalSelfOperation will be thrown If NO class supports this type, the unique_ptr points to nothing (.get() == nullptr).
Referenced by TOPPViewBase::loadFiles().
|
static |
see getAnnotatorWhichSupports(const FileTypes::Type& type). Filetype is queried from filename
|
protected |
|
protected |
optional widget which will be locked when calling annotateWorker_() in child-classes
|
protected |