Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_VISUAL_SPECTRUMWIDGET_H
00036 #define OPENMS_VISUAL_SPECTRUMWIDGET_H
00037
00038
00039 #include <OpenMS/CONCEPT/Types.h>
00040 #include <OpenMS/MATH/STATISTICS/Histogram.h>
00041 #include <OpenMS/VISUAL/SpectrumCanvas.h>
00042 #include <OpenMS/VISUAL/EnhancedTabBarWidgetInterface.h>
00043
00044 class QGridLayout;
00045 class QScrollBar;
00046 class QCloseEvent;
00047 class QMimeData;
00048
00049 namespace OpenMS
00050 {
00051
00052 class AxisWidget;
00053
00071 class OPENMS_GUI_DLLAPI SpectrumWidget :
00072 public QWidget,
00073 public EnhancedTabBarWidgetInterface
00074 {
00075 Q_OBJECT
00076
00077 public:
00080
00082 typedef LayerData::ExperimentType ExperimentType;
00084 typedef LayerData::FeatureMapType FeatureMapType;
00086 typedef ExperimentType::SpectrumType SpectrumType;
00088
00090 SpectrumWidget(const Param & preferences, QWidget * parent = 0);
00092 virtual ~SpectrumWidget();
00093
00100 SpectrumCanvas * canvas()
00101 {
00102 return canvas_;
00103 }
00104
00105 SpectrumCanvas * canvas() const
00106 {
00107 return canvas_;
00108 }
00109
00111 virtual inline AxisWidget * xAxis()
00112 {
00113 return x_axis_;
00114 }
00115
00117 virtual inline AxisWidget * yAxis()
00118 {
00119 return y_axis_;
00120 }
00121
00123 Int getActionMode() const;
00124
00126 virtual bool isLegendShown() const;
00127
00129 virtual void showLegend(bool show);
00130
00132 void setIntensityMode(SpectrumCanvas::IntensityModes mode);
00133
00135 virtual void hideAxes();
00136
00138 virtual void saveAsImage();
00139
00141 virtual Int getWindowId();
00142
00144 virtual void setWindowId(Int window_id);
00145 signals:
00147 void sendStatusMessage(std::string, OpenMS::UInt);
00149 void sendCursorStatus(double mz = -1.0, double rt = -1.0);
00151 void aboutToBeDestroyed(int window_id);
00153 void openPreferences();
00155 void dropReceived(const QMimeData * data, QWidget * source, int id);
00156
00157 public slots:
00159 void showStatistics();
00161 void showIntensityDistribution();
00163 void showMetaDistribution(const String & name);
00165 void updateAxes();
00174 void updateHScrollbar(float min, float disp_min, float disp_max, float max);
00183 void updateVScrollbar(float min, float disp_min, float disp_max, float max);
00185 virtual void showGoToDialog() = 0;
00187 void changeLegendVisibility();
00188
00189 protected:
00191
00192 void closeEvent(QCloseEvent * e);
00194
00201 void setCanvas_(SpectrumCanvas * canvas, UInt row = 0, UInt col = 2);
00203 virtual void intensityModeChange_();
00205 virtual Math::Histogram<> createIntensityDistribution_() const = 0;
00207 virtual Math::Histogram<> createMetaDistribution_(const String & name) const = 0;
00209 virtual void recalculateAxes_() = 0;
00210
00212
00213 void dragEnterEvent(QDragEnterEvent * event);
00214 void dragMoveEvent(QDragMoveEvent * event);
00215 void dropEvent(QDropEvent * event);
00217
00219 SpectrumCanvas * canvas_;
00221 QGridLayout * grid_;
00223 AxisWidget * y_axis_;
00225 AxisWidget * x_axis_;
00227 QScrollBar * x_scrollbar_;
00229 QScrollBar * y_scrollbar_;
00230
00231 Int window_id_;
00232 };
00233 }
00234
00235 #endif