AttributeDatabase.h

00001 
00004 #ifndef _AttributeDatabase_h
00005 #define _AttributeDatabase_h
00006 
00007 // SYSTEM INCLUDES
00008 //
00009 
00010 // PROJECT INCLUDES
00011 //
00012 
00013 // LOCAL INCLUDES
00014 //
00015 
00016 // FORWARD REFERENCES
00017 //
00018 
00019 
00020 class AttributeDatabase
00021 {
00022 public:
00023 
00024     enum AttributeType {
00025         ALERT,                  
00026         DEFAULT,                
00027         NORMAL,                 
00028         INACTIVE,               
00029         HEADER,                 
00030         PLOT_FUNCTION,          
00031         PLOT_BACKGROUND,        
00032         PLOT_OUTSIDE_BG,        
00033         PLOT_OUTSIDE_BG2,       
00034         PLOT_OUTSIDE_BG3,       
00035         PLOT_NEW_SECTION_BG,    
00036 
00037         // Atrybuty ograniczeń muszą być też dodane w ui/XyConstraintsLayer.cc
00038         // oraz ui/UnivariateConstraintsLayer.cc (jeśli będzie).
00039         PLOT_CONSTRAINT1,       
00040         PLOT_CONSTRAINT2,       
00041         PLOT_CONSTRAINT3,       
00042         PLOT_CONSTRAINT4,       
00043         PLOT_CONSTRAINT5,       
00044 
00045         POINT_START,            
00046         POINT_RESULT,           
00047         POINT_BASE,             
00048         POINT_BEST,             
00049         POINT_MIDDLE,           
00050         POINT_OUT_OF_BOUNDS,    
00051         POINT_WORST,            
00052         POINT_X0,               
00053         SIMPLEX_B,              
00054         SIMPLEX_BASE,           
00055         SIMPLEX_C,              
00056         SIMPLEX_N,              
00057         SIMPLEX_POINT_EXTENDED, 
00058         SIMPLEX_POINT_MAIN,     
00059         SIMPLEX_VAR_ENTERING,   
00060         SIMPLEX_VAR_EXTENDING,  
00061         SIMPLEX_VAR_LEAVING,    
00062         SIMPLEX_VAR_SLACK,      
00063         STEP_IN_DIRECTION,      
00064         STEP_PRELIMINARY,       
00065         STEP_TRIAL_D1,          
00066         STEP_TRIAL_D2,          
00067         CH_STARTING_BEST,       
00068         CH_END_BEST,            
00069         CH_DECEASED,            
00070         CH_SURVIVOR,            
00071         CH_MUTANT,              
00072         CH_CHILD                
00073      };
00074 
00075 // LIFECYCLE
00076 
00079     ~AttributeDatabase(void);
00080 
00081 
00082 // OPERATORS
00083 
00084 // OPERATIONS
00085 // ACCESS
00086 
00087     static const AttributeDatabase& GetInstance();
00088 
00091     const wxColour&     Colour(AttributeType attribute) const;
00092 
00095     wxColour            TextColour(AttributeType attribute) const;
00096 
00099     wxPen               Pen(AttributeType attribute) const;
00100 
00103     wxBrush             Brush(AttributeType attribute) const;
00104 
00110     wxTextAttr          TextAttribute(AttributeType attribute) const;
00111 
00112 // INQUIRY
00113 
00114 protected:
00115 private:
00118     AttributeDatabase(void);
00119 
00120 
00125     AttributeDatabase(const AttributeDatabase& from);
00126 
00132     enum YesNoUndefinedType {
00133         YES = 1,
00134         NO  = 0,
00135         UNDEFINED = 2
00136     };
00137 
00138     struct AttributeDataType {
00139         // Czemu nie można w C++ inicjować łatwo struktur?
00140         AttributeDataType();
00141         AttributeDataType(const wxColour&       foreground,
00142                           const wxColour&       background,
00143                           YesNoUndefinedType    bold);
00144         AttributeDataType(const AttributeDataType& from);
00145         AttributeDataType& operator=(const AttributeDataType& from);
00146 
00147         wxColour            mForegroundColour;
00148         wxColour            mBackgroundColour;
00149         YesNoUndefinedType  mBold;
00150     };
00151 
00152     typedef std::map<AttributeType, AttributeDataType>   AttributeContainer;
00153 
00154     AttributeContainer  mAttributes;
00155     // To powinna być stała, ale nie można by wtedy ustawić tabów.
00156     wxTextAttr    mBaseTextAttribute;
00157 };
00158 
00159 // INLINE METHODS
00160 //
00161 
00162 // EXTERNAL REFERENCES
00163 //
00164 
00165 #endif  // _AttributeDatabase_h

Wygenerowano Fri Sep 29 21:04:48 2006 dla EduOptim2 programem  doxygen 1.4.6