copasi API
0.1
|
00001 /* Begin CVS Header 00002 $Source: /fs/turing/cvs/copasi_dev/copasi/UI/parametertable.h,v $ 00003 $Revision: 1.14 $ 00004 $Name: Build-33 $ 00005 $Author: shoops $ 00006 $Date: 2008/12/18 19:58:12 $ 00007 End CVS Header */ 00008 00009 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual 00010 // Properties, Inc., EML Research, gGmbH, University of Heidelberg, 00011 // and The University of Manchester. 00012 // All rights reserved. 00013 00014 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual 00015 // Properties, Inc. and EML Research, gGmbH. 00016 // All rights reserved. 00017 00018 #ifndef PARAMETERTABLE_H 00019 #define PARAMETERTABLE_H 00020 00021 #include <q3table.h> 00022 #include <qcombobox.h> 00023 00024 #include "copasi.h" 00025 #include "model/CReaction.h" 00026 00027 class CReactionInterface; 00028 00029 class ColorTableItem : public Q3TableItem 00030 { 00031 public: 00032 ColorTableItem(Q3Table *t, EditType et, QColor c, const QString txt); 00033 ~ColorTableItem(); 00034 void setColor(QColor col) {color = col; table()->repaint();} 00035 00036 private: 00037 void paint(QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected); 00038 00039 QColor color; 00040 }; 00041 00042 class ColorCheckTableItem : public Q3CheckTableItem 00043 { 00044 public: 00045 ColorCheckTableItem(Q3Table *t, QColor c, const QString txt); 00046 ~ColorCheckTableItem(); 00047 void setColor(QColor col) {color = col; table()->repaint();} 00048 00049 private: 00050 void paint(QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected); 00051 00052 QColor color; 00053 }; 00054 00055 class ComboItem : public ColorTableItem 00056 { 00057 public: 00058 ComboItem(Q3Table *t, EditType et, QColor c, const QStringList & sl); 00059 QWidget *createEditor() const; 00060 void setContentFromEditor(QWidget *w); 00061 void setText(const QString &s); 00062 00063 private: 00064 QComboBox *cb; 00065 QStringList mSL; 00066 }; 00067 00068 //table used in the reactions widget 00069 00070 class ParameterTable : public Q3Table 00071 { 00072 Q_OBJECT 00073 00074 public: 00075 ParameterTable(QWidget * parent = 0, const char * name = 0); 00076 00077 void initTable(); 00078 00079 public slots: 00080 void updateTable(const CReactionInterface & ri, const CModel & model); 00081 00082 private slots: 00083 void handleCurrentCell(int row, int col); 00084 void slotCellChanged(int row, int col); 00085 00086 signals: 00087 void signalChanged(int, int, QString); 00088 void parameterStatusChanged(int, bool); 00089 00090 private: 00091 //void initTable(); 00092 00093 //convenience function. It gets a List of all metab names in the CMetabNameInterface format 00094 static const std::vector<std::string> getListOfAllMetabNames(const CModel & model, 00095 const CReactionInterface & ri); 00096 00097 //convenience function. 00098 static QStringList getListOfAllGlobalParameterNames(const CModel & model); 00099 //convenience function. 00100 static QStringList getListOfAllCompartmentNames(const CModel & model); 00101 00102 int mOldRow; 00103 00104 public: 00105 std::vector<C_INT32> mLine2Index; 00106 std::vector<C_INT32> mIndex2Line; 00107 }; 00108 00109 #endif 00110 //********************************************************************************