00001
00002
00003 char *area_cpp = "$Id: sxy_area.cpp,v 1.1 2002/11/25 19:52:05 clinio Exp $";
00004
00005
00006
00007 #include <assert.h>
00008
00009 #include <xy.h>
00010
00011 #include "sxy_chart.h"
00012 #include "sxy_area.h"
00013
00014
00015
00016 const int SXYArea::CONTINUOUS = XYObject::continuous;
00017 const int SXYArea::DASHED = XYObject::dashed;
00018 const int SXYArea::DOTTED = XYObject::dotted;
00019
00020
00021
00022 SXYArea::SXYArea( SXYAxis* x, SXYAxis* y ) {
00023 assert(x!=NULL);
00024 assert(y!=NULL);
00025
00026 x_axis = x;
00027 y_axis = y;
00028 assert( x_axis->getChart() == y_axis->getChart() );
00029
00030 xy_area = new XYCartesianArea(
00031 x_axis->getXyAxis(), y_axis->getXyAxis(), 1, 100, 1, 100 );
00032 assert( xy_area );
00033
00034 SXYChart* cht = x_axis->getChart();
00035 XYCartesian* xy_graph = cht->getXyGraph();
00036 xy_graph->insert( xy_area );
00037 }
00038
00039
00040
00041 SXYArea::~SXYArea() {
00042 SXYChart* cht = x_axis->getChart();
00043 XYCartesian* xy_graph = cht->getXyGraph();
00044 xy_graph->remove( xy_area );
00045
00046 if (xy_area != NULL) delete xy_area;
00047 xy_area = NULL;
00048 }
00049
00050
00051
00052 void SXYArea::setBackgroundColor(long int col) {
00053 xy_area->backgroundColor( col );
00054 }
00055
00056
00057
00058 long int SXYArea::getBackgroundColor(void) {
00059 return xy_area->backgroundColor();
00060 }
00061
00062
00063
00064
00065 void SXYArea::setTitleColor(long int col) {
00066 xy_area->textColor( col );
00067 }
00068
00069
00070
00071 long int SXYArea::getTitleColor(void) {
00072 return xy_area->textColor();
00073 }
00074
00075
00076
00077 void SXYArea::setLineColor(long int col) {
00078 xy_area->color( col );
00079 }
00080
00081
00082
00083 long int SXYArea::getLineColor(void) {
00084 return xy_area->color();
00085 }
00086
00087
00088
00089 int SXYArea::getForcedText(void) {
00090 return xy_area->forcedText();
00091 }
00092
00093
00094
00095 void SXYArea::setForcedText(int flg) {
00096 xy_area->forcedText(flg);
00097 }
00098
00099
00100
00101 int SXYArea::getLineWidth(void) {
00102 return xy_area->width();
00103 }
00104
00105
00106
00107 void SXYArea::setLineWidth(int wid) {
00108 xy_area->width(wid);
00109 }
00110
00111
00112
00113 int SXYArea::getLineStyle(void) {
00114 return (int)xy_area->style();
00115 }
00116
00117
00118
00119 void SXYArea::setLineStyle(int sty) {
00120 xy_area->style((XYObject::LineStyle)sty);
00121 }
00122
00123
00124
00125 void SXYArea::setTitleSize(int sz) {
00126 xy_area->textSize(sz);
00127 }
00128
00129
00130
00131 int SXYArea::getTitleSize(void) {
00132 return xy_area->textSize();
00133 }
00134
00135
00136
00137 void SXYArea::setTitle(char* txt) {
00138 xy_area->text(txt);
00139 }
00140
00141
00142
00143 char* SXYArea::getTitle(void) {
00144 return xy_area->text();
00145 }
00146
00147
00148
00149 void SXYArea::setHorizontalLimits( double min, double max ) {
00150 xy_area->begin1(min);
00151 xy_area->end1(max);
00152 }
00153
00154
00155
00156 void SXYArea::setVerticalLimits( double min, double max ) {
00157 xy_area->begin2(min);
00158 xy_area->end2(max);
00159 }
00160
00161
00162
00163 void SXYArea::getHorizontalLimits( double& min, double& max ) {
00164 min = xy_area->begin1();
00165 max = xy_area->end1();
00166 }
00167
00168
00169
00170 void SXYArea::getVerticalLimits( double& min, double& max ) {
00171 min = xy_area->begin2();
00172 max = xy_area->end2();
00173 }
00174
00175
00176
00177
00178
00179