casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ColorSummaryWidget.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 
26 #ifndef COLOR_SUMMARYWIDGET_QO_H
27 #define COLOR_SUMMARYWIDGET_QO_H
28 
29 #include <QWidget>
30 #include <QSettings>
31 #include <display/QtPlotter/ColorSummaryWidget.ui.h>
32 
33 namespace casa {
34 
35  class QtCanvas;
36 
37  class ColorSummaryWidget : public QDialog {
38  Q_OBJECT
39 
40  public:
41  ColorSummaryWidget(QWidget *parent = 0);
43  void setColorCanvas( QtCanvas* colorCanvas );
44 
45  private slots:
46 
47  //Methods to add colors in various categories
48  void addColorProfile();
49  void addColorFit();
50  void addColorFitSummary();
53  void zoomRectColorChanged();
55 
56  //Methods to remove colors in various categories
57  void removeColorProfile();
58  void removeColorFit();
59  void removeColorFitSummary();
60 
61  //User changed to a different color scheme (traditional,
62  //alternative, custom, etc)
63  void colorSchemeChanged();
64 
65  //Stores any changes to the colors used by the application
66  //before closing the dialog.
67  void reject();
68  void accept();
69 
70  private:
71  void addColor( QListWidget* list );
72  void removeColor( QListWidget* list );
73  void initializeColors();
74  void addColorListItem( QListWidget* list, const QColor& listColor );
75  void readCustomColor( QSettings& settings, const QString& countKey,
76  const QString& baseLookup, QList<QString>& list );
77  void populateColorList( const QList<QString>& colors, QListWidget* list );
78  void copyViewList(QListWidget* listWidget, QList<QString>& canvasList);
79  void copyViewLists();
81  void initializeUserColors();
82  void populateColorLists();
83  void clearColorLists();
84  void registerColorChange();
85  void clearColorChange();
87  void persistColorList( QSettings& settings, QListWidget* list,
88  const QString& baseStr, const QString& countStr );
89  void persist();
90  void setLabelColor( QLabel* label, QString colorName );
91 
92  Ui::ColorSummaryWidget ui;
94  QList<QString> mainCurveColorList;
95  QList<QString> fitCurveColorList;
96  QList<QString> fitSummaryCurveColorList;
97  QList<QString> traditionalCurveColorList;
98  QList<QString> customMainList;
99  QList<QString> customFitList;
100  QList<QString> customFitSummaryList;
107 
108  static const QString CUSTOM_PROFILE_COLOR;
109  static const QString CUSTOM_FIT_COLOR;
110  static const QString CUSTOM_SUMMARY_COLOR;
111  static const QString CUSTOM_PROFILE_COLOR_COUNT;
112  static const QString CUSTOM_FIT_COLOR_COUNT;
113  static const QString CUSTOM_SUMMARY_COLOR_COUNT;
114  static const QString COLOR_SCHEME_PREFERENCE;
115  static const QString CHANNEL_LINE_COLOR;
116  static const QString INITIAL_GAUSSIAN_ESTIMATE_COLOR;
117  static const QString MOLECULAR_LINE_COLOR;
118  static const QString ZOOM_RECT_COLOR;
119 
122  };
123 }
124 
125 #endif // COLORSUMMARYWIDGET_Q0_H
void reject()
Stores any changes to the colors used by the application before closing the dialog.
QList< QString > traditionalCurveColorList
static const QString CUSTOM_FIT_COLOR_COUNT
static const QString INITIAL_GAUSSIAN_ESTIMATE_COLOR
Ui::ColorSummaryWidget ui
void addColor(QListWidget *list)
void populateColorList(const QList< QString > &colors, QListWidget *list)
ColorSummaryWidget(QWidget *parent=0)
void readCustomColor(QSettings &settings, const QString &countKey, const QString &baseLookup, QList< QString > &list)
static const QString CUSTOM_PROFILE_COLOR
void initialGaussianEstimateColorChanged()
static const QString CUSTOM_PROFILE_COLOR_COUNT
void addColorProfile()
Methods to add colors in various categories.
void removeColorProfile()
Methods to remove colors in various categories.
void copyViewList(QListWidget *listWidget, QList< QString > &canvasList)
void setLabelColor(QLabel *label, QString colorName)
QList< QString > fitCurveColorList
static const QString CUSTOM_FIT_COLOR
static const QString CUSTOM_SUMMARY_COLOR_COUNT
static const QString ZOOM_RECT_COLOR
static const QString COLOR_SCHEME_PREFERENCE
void persistColorList(QSettings &settings, QListWidget *list, const QString &baseStr, const QString &countStr)
QList< QString > customFitSummaryList
static const QString CHANNEL_LINE_COLOR
QList< QString > fitSummaryCurveColorList
void addColorListItem(QListWidget *list, const QColor &listColor)
static const QString MOLECULAR_LINE_COLOR
void colorSchemeChanged()
User changed to a different color scheme (traditional, alternative, custom, etc)
void setColorCanvas(QtCanvas *colorCanvas)
static const QString CUSTOM_SUMMARY_COLOR
QList< QString > mainCurveColorList
void removeColor(QListWidget *list)