00001
00002
00003
00004
00005
00006
00007
00008 #include "xyar.h"
00009
00010 const char* xy_id_xyar_cpp="$Id: xyar.cpp,v 1.2 2002/06/04 20:01:32 clinio Exp $";
00011
00012 XYArea::XYArea(const XYAxis* axis1, const XYAxis* axis2,
00013 double begin1, double end1,
00014 double begin2, double end2,
00015 xybool visible) : XYObject(0, 0, visible),
00016 _forced_text(0),
00017 _axis1(axis1),
00018 _axis2(axis2),
00019 _begin1(begin1),
00020 _end1(end1),
00021 _begin2(begin2),
00022 _end2(end2)
00023 {
00024
00025 double min1 = MIN(begin1, end1);
00026 double min2 = MIN(begin2, end2);
00027 double min = MIN(min1, min2);
00028
00029 double xb, yb;
00030 _axis1 -> pointInValue(min, xb, yb);
00031
00032 _text = NULL;
00033 _textSize = 10;
00034 _textColor = XY_BLACK;
00035
00036 _style = XYObject::dashed;
00037 _color = XY_BLACK;
00038 _width = 2;
00039 _backgroundColor = 0xeeffee;
00040
00041 position(xb, yb);
00042 }
00043
00044 void XYArea::axis1 (const XYAxis* ax)
00045 {
00046 _axis1 = ax;
00047 }
00048
00049 const XYAxis* XYArea::axis1 (void) const
00050 {
00051 return _axis1;
00052 }
00053
00054 void XYArea::axis2 (const XYAxis* ax)
00055 {
00056 _axis2 = ax;
00057 }
00058
00059 void XYArea::width (int w)
00060 {
00061 _width = w;
00062 }
00063
00064 int XYArea::width (void) const
00065 {
00066 return _width;
00067 }
00068
00069 void XYArea::style (XYObject::LineStyle st)
00070 {
00071 _style = st;
00072 }
00073
00074 int XYArea::style (void) const
00075 {
00076 return _style;
00077 }
00078
00079 const XYAxis* XYArea::axis2 (void) const
00080 {
00081 return _axis2;
00082 }
00083
00084 void XYArea::begin1 (double bm)
00085 {
00086 _begin1 = bm;
00087 }
00088
00089 double XYArea::begin1 (void) const
00090 {
00091 return _begin1;
00092 }
00093
00094 void XYArea::end1 (double em)
00095 {
00096 _end1 = em;
00097 }
00098
00099 double XYArea::end1 (void) const
00100 {
00101 return _end1;
00102 }
00103
00104 void XYArea::begin2 (double bm)
00105 {
00106 _begin2 = bm;
00107 }
00108
00109 double XYArea::begin2 (void) const
00110 {
00111 return _begin2;
00112 }
00113
00114 void XYArea::end2 (double em)
00115 {
00116 _end2 = em;
00117 }
00118
00119 double XYArea::end2 (void) const
00120 {
00121 return _end2;
00122 }
00123
00124 void XYArea::color (long c)
00125 {
00126 _color = c;
00127 }
00128
00129 long XYArea::color (void) const
00130 {
00131 return _color;
00132 }
00133
00134 char* XYArea::text(void)
00135 {
00136 return _text;
00137 }
00138
00139 void XYArea::text( char* txt )
00140 {
00141 if (_text != NULL) free(_text);
00142 _text = strdup(txt);
00143 }
00144
00145 void XYArea::textSize (int ts)
00146 {
00147 _textSize = ts;
00148 }
00149
00150 int XYArea::textSize (void) const
00151 {
00152 return _textSize;
00153 }
00154
00155 void XYArea::textColor (long tc)
00156 {
00157 _textColor = tc;
00158 }
00159
00160 long XYArea::textColor (void) const
00161 {
00162 return _textColor;
00163 }
00164
00165 void XYArea::forcedText (xybool flg)
00166 {
00167 _forced_text = flg;
00168 }
00169
00170 xybool XYArea::forcedText (void) const
00171 {
00172 return _forced_text;
00173 }
00174
00175 void XYArea::backgroundColor (long bc)
00176 {
00177 _backgroundColor = bc;
00178 }
00179
00180 long XYArea::backgroundColor (void) const
00181 {
00182 return _backgroundColor;
00183 }
00184
00185
00186 void XYArea::insertAction (XYGraph * )
00187 {
00188 }
00189
00190
00191 void XYArea::removeAction (XYGraph * )
00192 {
00193 }