OpenMS
|
#include <OpenMS/VISUAL/LayerDataBase.h>
Public Member Functions | |
LayerAnnotatorBase (const FileTypeList &supported_types, const String &file_dialog_text, QWidget *gui_lock) | |
C'tor with params. More... | |
virtual | ~LayerAnnotatorBase ()=default |
Make D'tor virtual for correct destruction from pointers to base. 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). File type is queried from filename More... | |
Protected Member Functions | |
virtual bool | annotateWorker_ (LayerDataBase &layer, const String &filename, LogWindow &log) const =0 |
Protected Attributes | |
const 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
LayerAnnotatorBase | ( | const 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 |
|
virtualdefault |
Make D'tor virtual for correct destruction from pointers to base.
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 file type 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 file type 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 file type. 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). File type is queried from filename
|
protected |
|
protected |
optional widget which will be locked when calling annotateWorker_() in child-classes
|
protected |