00001
00002
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00030
00031
00032
00033
00034
00035
00036 #include "AIDA_TitleStyle.h"
00037 #include "AIDA_TextStyle.h"
00038 #include "GracePlotter/TitleStyle.h"
00039
00040 #include <iostream>
00041
00042
00043
00044 namespace Anaphe {
00045 namespace AIDA_Plotter_Grace {
00046
00047
00048
00050
00051
00052
00054
00055 AIDA_TitleStyle::AIDA_TitleStyle()
00056 : rep (0),
00057 ownRep(false)
00058 {
00059
00060 }
00061
00062
00063
00064
00065 AIDA_TitleStyle::AIDA_TitleStyle(TitleStyle* x, bool b)
00066 : rep (x),
00067 ownRep(b)
00068 {
00069
00070 }
00071
00072
00073
00074
00075 AIDA_TitleStyle::~AIDA_TitleStyle()
00076 {
00077 if (ownRep) delete rep;
00078 }
00079
00080
00081
00082
00084
00085
00086
00088
00089 void AIDA_TitleStyle::reset()
00090 {
00091 if (!rep) {
00092 crisis();
00093 return;
00094 }
00095 rep->reset();
00096 }
00097
00098
00099
00100
00101 bool AIDA_TitleStyle::setParameter(const std::string& paramName,
00102 const std::string& options)
00103 {
00104 if (!rep) {
00105 crisis();
00106 return false;
00107 }
00108 return rep->setParameter(paramName,options);
00109 }
00110
00111
00112
00113
00114 std::vector<std::string> AIDA_TitleStyle::availableParameters() const
00115 {
00116 if (!rep) {
00117 crisis();
00118 return std::vector<std::string>();
00119 }
00120 return rep->availableParameters();
00121 }
00122
00123
00124
00125
00126 std::vector<std::string> AIDA_TitleStyle::availableParameterOptions(const std::string& paramName) const
00127 {
00128 if (!rep) {
00129 crisis();
00130 return std::vector<std::string>();
00131 }
00132 return rep->availableOptions(paramName);
00133 }
00134
00135
00136
00137
00138 std::string AIDA_TitleStyle::parameterValue(const std::string& param) const
00139 {
00140 if (!rep) {
00141 crisis();
00142 return "";
00143 }
00144 return rep->parameterValue(param);
00145 }
00146
00147
00148
00149
00150 AIDA::ITextStyle& AIDA_TitleStyle::textStyle()
00151 {
00152 static AIDA_TextStyle pr;
00153 if (!rep) {
00154 crisis();
00155 return pr;
00156 }
00157 TextStyle& gts = rep->textStyle();
00158 pr.setRep(gts,false);
00159 return pr;
00160 }
00161
00162
00163
00164
00165 bool AIDA_TitleStyle::setTextStyle(const AIDA::ITextStyle& textStyle)
00166 {
00167 if (!rep) {
00168 crisis();
00169 return false;
00170 }
00171 const AIDA_TextStyle* pr = dynamic_cast<const AIDA_TextStyle*>(&textStyle);
00172 if (!pr) return false;
00173 AIDA_TextStyle* ncpr = const_cast<AIDA_TextStyle*>(pr);
00174 TextStyle* tsrep = ncpr->theRep();
00175 if (tsrep == 0) return false;
00176 else return rep->setTextStyle(*tsrep);
00177 }
00178
00179
00180
00181
00182 void AIDA_TitleStyle::setRep(TitleStyle& s, bool ownership)
00183 {
00184 if (ownRep) delete rep;
00185 rep = &s;
00186 ownRep = ownership;
00187 }
00188
00189
00190
00191 TitleStyle* AIDA_TitleStyle::theRep()
00192 {
00193 return rep;
00194 }
00195
00196
00197
00198 void AIDA_TitleStyle::crisis() const
00199 {
00200 std::cout << "*** AIDA_Plotter_Grace SEVERE ERROR: proxy failure in AIDA_TitleStyle" << std::endl;
00201 }
00202
00203
00204
00205
00206
00207 }
00208 }
00209