00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_COLORINGSETTINGSDIALOG_H
00008 #define BALL_VIEW_DIALOGS_COLORINGSETTINGSDIALOG_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifdef BALL_COMPILER_MSVC
00015 # include <BALL/VIEW/UIC/ui_coloringSettingsDialog.h>
00016 #else
00017 # include <BALL/VIEW/UIC/coloringSettingsDialogData.h>
00018 #endif
00019
00020
00021 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00022 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00023 #endif
00024
00025 #ifndef BALL_VIEW_KERNEL_COMMON_H
00026 # include <BALL/VIEW/KERNEL/common.h>
00027 #endif
00028
00029 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
00030 # include <BALL/VIEW/DATATYPE/colorRGBA.h>
00031 #endif
00032
00033 #include <QtGui/QTableWidget>
00034 #include <vector>
00035
00036 namespace BALL
00037 {
00038 class PTE;
00039
00040 namespace VIEW
00041 {
00042 class ColorProcessor;
00043
00047 class BALL_VIEW_EXPORT QColorTable
00048 : public QTableWidget,
00049 public PreferencesEntry::ExtendedPreferencesObject
00050 {
00051 Q_OBJECT
00052
00053 public:
00054 QColorTable(QWidget* parent = 0, const char* name = 0);
00055
00056 void setNamesTitle(const String& string);
00057
00058 String getNamesTitle() const;
00059
00060 void setContent(const vector<String>& names, const vector<ColorRGBA>& colors);
00061
00062 void setColors(const vector<ColorRGBA>& colors);
00063
00064 const vector<ColorRGBA>& getColors() const
00065 { return colors_;}
00066
00067 const vector<String>& getNames() const
00068 { return names_;}
00069
00071 virtual bool getValue(String&) const;
00072
00074 virtual bool setValue(const String& value);
00075
00076 private slots:
00077
00078 void beginEdit(int row, int col);
00079
00080 virtual void mousePressEvent(QMouseEvent* event);
00081
00082 private:
00083 vector<ColorRGBA> colors_;
00084 vector<String> names_;
00085 bool setting_content_;
00086 };
00087
00088
00093 class BALL_VIEW_EXPORT ColoringSettingsDialog
00094 : public QWidget,
00095 public Ui_ColoringSettingsDialogData,
00096 public PreferencesEntry
00097 {
00098 Q_OBJECT
00099
00100 public:
00101
00103 ColoringSettingsDialog( QWidget* parent = 0, const char* name = "ColoringSettings", Qt::WFlags fl = 0 );
00104
00106 virtual ~ColoringSettingsDialog() {}
00107
00109 virtual void applySettingsTo(ColorProcessor& cp) const;
00110
00112 virtual ColorProcessor* createColorProcessor(ColoringMethod method) const
00113 throw(Exception::InvalidOption);
00114
00116 virtual void getSettings(const ColorProcessor& cp);
00117
00119 virtual QWidget* getEntryFor(ColoringMethod method);
00120
00122 virtual vector<ColorRGBA> getColors(ColoringMethod method) const;
00123
00124 protected slots:
00125
00126 void middleResidueColorPressed() { chooseColor(middle_residue_label); }
00127 void lastResidueColorPressed() { chooseColor(last_residue_label); }
00128 void firstResidueColorPressed() { chooseColor(first_residue_label); }
00129
00130 void negativeChargeColorPressed() { chooseColor(negative_charge_label); }
00131 void neutralChargeColorPressed() { chooseColor(neutral_charge_label); }
00132 void positiveChargeColorPressed() { chooseColor(positive_charge_label);}
00133
00134 void nullDistanceColorPressed() { chooseColor(null_distance_label); }
00135 void maxDistanceColorPressed() { chooseColor(max_distance_label); }
00136
00137 void minimumTFColorPressed() { chooseColor(minimum_tf_label); }
00138 void maximumTFColorPressed() { chooseColor(maximum_tf_label); }
00139 void unassignedTFColorPressed() { chooseColor(unassigned_tf_label); }
00140
00141 void minimumOccupancyColorPressed() { chooseColor(minimum_o_label); }
00142 void maximumOccupancyColorPressed() { chooseColor(maximum_o_label); }
00143 void unassignedOccupancyColorPressed() { chooseColor(unassigned_o_label); }
00144
00145 void helixColorPressed() { chooseColor(helix_color_label); }
00146 void turnColorPressed() { chooseColor(turn_color_label); }
00147 void strandColorPressed() { chooseColor(strand_color_label);}
00148 void coilColorPressed() { chooseColor(coil_color_label); }
00149
00150 void forceMaxColorPressed() { chooseColor(force_max_color_label); }
00151 void forceMinColorPressed() { chooseColor(force_min_color_label); }
00152
00153
00154 void acidicColorPressed() { chooseColor(acidic_color_label); }
00155 void aromaticColorPressed() { chooseColor(aromatic_color_label); }
00156 void basicColorPressed() { chooseColor(basic_color_label); }
00157 void otherColorPressed() { chooseColor(other_color_label); }
00158 void polarColorPressed() { chooseColor(polar_color_label); }
00159 void hydrophobicColorPressed() { chooseColor(hydrophobic_color_label); }
00160
00161
00162 virtual void maxDistanceChanged();
00163 virtual void maxTFChanged();
00164 virtual void forceMaxValueChanged();
00165 virtual void forceMinValueChanged();
00166
00167 protected:
00168
00169 virtual void setDefaultValues_();
00170
00171 QColorTable* element_table_;
00172 QColorTable* residue_table_;
00173 QColorTable* chain_table_;
00174 QColorTable* molecule_table_;
00175 };
00176
00177 } }
00178
00179 #endif