Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

TOPPASBase.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Johannes Junker $
00032 // $Authors: Johannes Junker, Chris Bielow $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
00036 #define OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
00037 
00038 //OpenMS
00039 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00040 #include <OpenMS/VISUAL/TOPPASTreeView.h>
00041 
00042 //QT
00043 #include <QtGui/QMainWindow>
00044 #include <QtGui/QWorkspace>
00045 #include <QtGui/QButtonGroup>
00046 #include <QtCore/QProcess>
00047 #include <QtGui/QSplashScreen>
00048 
00049 class QToolBar;
00050 class QListWidget;
00051 class QTextEdit;
00052 class QWorkspace;
00053 class QLabel;
00054 class QWidget;
00055 class QTreeWidget;
00056 class QTreeWidgetItem;
00057 class QWebView;
00058 class QNetworkAccessManager;
00059 class QNetworkReply;
00060 
00061 namespace OpenMS
00062 {
00063   class TOPPASWidget;
00064   class TOPPASScene;
00065   class TOPPASTabBar;
00066   class TOPPASLogWindow;
00067   class TOPPASResources;
00068 
00074   class OPENMS_GUI_DLLAPI TOPPASBase :
00075     public QMainWindow,
00076     public DefaultParamHandler
00077   {
00078     Q_OBJECT
00079 
00080 public:
00081 
00083     TOPPASBase(QWidget* parent = 0);
00085     virtual ~TOPPASBase();
00086 
00092     void loadPreferences(String filename = "");
00094     void savePreferences();
00096     void loadFiles(const StringList& list, QSplashScreen* splash_screen);
00097 
00098 public slots:
00100     void addTOPPASFile(const String& file_name, bool in_new_window = true);
00102     void openFileDialog();
00104     void openExampleDialog();
00106     void newPipeline(const int id = -1);
00108     void includePipeline();
00110     void saveCurrentPipelineAs();
00112     void savePipeline();
00114     void exportAsImage();
00116     void loadPipelineResourceFile();
00118     void savePipelineResourceFile();
00120     void openOnlinePipelineRepository();
00122     void preferencesDialog();
00124     void updateCurrentPath();
00126     void updateTabBar(QWidget* w);
00128     void showAboutDialog();
00130     void showURL();
00137     void showStatusMessage(std::string msg, OpenMS::UInt time);
00139     void showCursorStatus(double x, double y);
00141     void closeFile();
00143     void updateToolBar();
00145     void runPipeline();
00147     void abortPipeline();
00149     void toolStarted();
00151     void toolFinished();
00153     void toolCrashed();
00155     void toolFailed();
00157     void outputVertexFinished(const String& file);
00159     void updateTOPPOutputLog(const QString& out);
00161     void showPipelineFinishedLogMessage();
00163     void saveToClipboard(TOPPASScene* scene);
00165     void sendClipboardContent();
00167     void refreshParameters();
00169     void openFilesInTOPPView(QStringList all_files);
00171     void openToppasFile(QString filename);
00172 protected slots:
00173 
00177 
00178     void closeByTab(int id);
00180     void focusByTab(int id);
00182 
00184     void updateMenu();
00186     void showAsWindow_(TOPPASWidget* sw, const String& caption, const int special_id = -1);
00188     void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
00190     void insertNewVertexInCenter_(QTreeWidgetItem* item);
00191 
00193     void downloadTOPPASfromHomepage_(const QUrl& url);
00195     void toppasFileDownloaded_(QNetworkReply* r);
00196 
00198     void descriptionUpdated_();
00199 
00200 protected:
00201 
00203     TOPPASLogWindow* log_;
00205     QTextEdit* desc_;
00206 
00210     QToolBar* tool_bar_;
00212 
00214     QWorkspace* ws_;
00215 
00217     QWebView* webview_;
00219     QNetworkAccessManager* network_manager_;
00220 
00222     TOPPASTabBar* tab_bar_;
00223 
00225     QTreeWidget* tools_tree_view_;
00227     QListWidget* blocks_list_;
00228 
00232 
00233     QLabel* message_label_;
00235 
00237     TOPPASWidget* window_(int id) const;
00238 
00239 
00242     String current_path_;
00243 
00245     String tmp_path_;
00246 
00248     static int node_offset_;
00249 
00251     static qreal z_value_;
00252 
00254     TOPPASWidget* activeWindow_() const;
00255 
00257 
00258     void closeEvent(QCloseEvent* event);
00259     void keyPressEvent(QKeyEvent* e);
00261 
00263     enum LogState
00264     {
00265       LS_NOTICE, 
00266       LS_WARNING, 
00267       LS_ERROR 
00268     };
00270     void showLogMessage_(LogState state, const String& heading, const String& body);
00271 
00273     TOPPASScene* clipboard_scene_;
00274 
00275 
00276 public:
00278     static int const IDINITIALUNTITLED = 1000;
00279 
00281 
00282 
00283     static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = 0);
00284 
00287     static QString savePipelineAs(TOPPASWidget* w, QString current_path);
00288 
00290     static QString loadPipelineResourceFile(TOPPASWidget* w, QString current_path);
00291 
00293     static QString savePipelineResourceFile(TOPPASWidget* w, QString current_path);
00294 
00296     static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path);
00298   }; //class
00299 
00300 } //namespace
00301 
00302 #endif // OPENMS_APPLICATIONS_TOPPASBASE_H

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:45 using doxygen 1.7.1