Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php 6.96 KB
22521f1c   Benjamin Renard   First commit
1
2
3
<?php

define ("REQUESTOUTPUTPLOTAXISELEMENT_POSITION", "position");
78a73e9a   Benjamin Renard   Integration for p...
4
define ("REQUESTOUTPUTPLOTAXISELEMENT_REVERSE", "reverse");
4ede4320   Benjamin Renard   Integration for s...
5
define ("REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE", "visible");
78a73e9a   Benjamin Renard   Integration for p...
6
7
8
define ("REQUESTOUTPUTPLOTAXISELEMENT_SCALE", "scale");
define ("REQUESTOUTPUTPLOTAXISELEMENT_COLOR", "color");
define ("REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS", "thickness");
f012b419   Benjamin Renard   Add integration f...
9
10
define ("REQUESTOUTPUTPLOTAXISELEMENT_SHOWLEGEND", "showLegend");
define ("REQUESTOUTPUTPLOTAXISELEMENT_TICKMARKS", "showTickMark");
22521f1c   Benjamin Renard   First commit
11
12
13
14
15
16

define ("REQUESTOUTPUTPLOTAXISELEMENTRANGE_NAME", "range");
define ("REQUESTOUTPUTPLOTAXISELEMENTRANGE_MIN", "min");
define ("REQUESTOUTPUTPLOTAXISELEMENTRANGE_MAX", "max");
define ("REQUESTOUTPUTPLOTAXISELEMENTRANGE_EXTEND", "extend");

78a73e9a   Benjamin Renard   Integration for p...
17
18
19
20
21
define ("REQUESTOUTPUTPLOTAXISELEMENTTICK_NAME", "tick");
define ("REQUESTOUTPUTPLOTAXISELEMENTTICK_POSITION", "position");
define ("REQUESTOUTPUTPLOTAXISELEMENTTICK_MINORGRID", "minorGrid");
define ("REQUESTOUTPUTPLOTAXISELEMENTTICK_MAJORGRID", "majorGrid");

22521f1c   Benjamin Renard   First commit
22
23
24
define ("REQUESTOUTPUTPLOTAXISELEMENTLEGEND_NAME", "legend");
define ("REQUESTOUTPUTPLOTAXISELEMENTLEGEND_TEXT", "text");

78a73e9a   Benjamin Renard   Integration for p...
25
26
27
28
29
30
31
32
33
34
35
36
abstract class RequestOutputPlotAxisElementScale
{
	const LINEAR      = "linear";
	const LOGARITHMIC = "logarithmic";
}

abstract class RequestOutputPlotAxisElementTickPosition
{
	const INWARDS  = "inwards";
	const OUTWARDS = "outwards";
}

4ede4320   Benjamin Renard   Integration for s...
37
38
39
40
41
42
43
44
abstract class RequestOutputPlotAxisElementPosition
{
	const TOP    = "top";
	const BOTTOM = "bottom";
	const LEFT   = "bottom";
	const RIGHT  = "right";
}

22521f1c   Benjamin Renard   First commit
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
 * @class RequestOutputPlotAxisElementRangeNodeClass
 * @brief Definition of range for an axis
 * @details
*/
class RequestOutputPlotAxisElementRangeNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTAXISELEMENTRANGE_NAME);
	}

	public function setMinMax($min, $max)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_MIN, $min);
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_MAX, $max);
	}

	public function getMin()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_MIN);
	}

	public function getMax()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_MAX);
	}

	public function setExtend($extend)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_EXTEND, $extend);
	}

	public function getExtend()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTRANGE_EXTEND);
	}
}

/**
78a73e9a   Benjamin Renard   Integration for p...
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
 * @class RequestOutputPlotAxisElementTickClass
 * @brief Definition of ticks for an axis
 * @details
 */
class RequestOutputPlotAxisElementTickClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTAXISELEMENTTICK_NAME);
	}
	
	public function setPosition($position)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_POSITION, $position);
	}
	
	public function getPosition()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_POSITION);
	}
	
	public function setMinorGrid($minorGrid)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_MINORGRID, $minorGrid);
	}
	
	public function getMinorGrid()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_MINORGRID);
	}
	
	public function setMajorGrid($majorGrid)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_MAJORGRID, $majorGrid);
	}
	
	public function getMajorGrid()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTTICK_MAJORGRID);
	}
}

/**
22521f1c   Benjamin Renard   First commit
128
129
130
131
 * @class RequestOutputPlotAxisElementLegendNodeClass
 * @brief Definition of legend for an axis
 * @details
 */
78a73e9a   Benjamin Renard   Integration for p...
132
class RequestOutputPlotAxisElementLegendNodeClass extends RequestOutputPlotLabelNodeClass
22521f1c   Benjamin Renard   First commit
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTAXISELEMENTLEGEND_NAME);
	}

	public function setText($text)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENTLEGEND_TEXT, $text);
	}

	public function getText()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENTLEGEND_TEXT);
	}
}

/**
 * @class RequestOutputPlotAxisElementNodeClass
 * @brief Definition of a plot axis element for a plot element of a plot request
 * @details
 */
class RequestOutputPlotAxisElementNodeClass extends NodeClass
{
	public function __construct($axisElementName)
	{
		parent::__construct($axisElementName);

		//create axis element skeleton

		//range
		$node = new RequestOutputPlotAxisElementRangeNodeClass();
		$this->addChild($node);

78a73e9a   Benjamin Renard   Integration for p...
167
168
169
170
		//tick
		$node = new RequestOutputPlotAxisElementTickClass();
		$this->addChild($node);
		
22521f1c   Benjamin Renard   First commit
171
172
173
174
175
176
177
178
179
180
		//legend
		$node = new RequestOutputPlotAxisElementLegendNodeClass();
		$this->addChild($node);
	}

	public function getRange()
	{
		return $this->getFirstChildByName(REQUESTOUTPUTPLOTAXISELEMENTRANGE_NAME);
	}

78a73e9a   Benjamin Renard   Integration for p...
181
182
183
184
	public function getTick()
	{
		return $this->getFirstChildByName(REQUESTOUTPUTPLOTAXISELEMENTTICK_NAME);
	}
22521f1c   Benjamin Renard   First commit
185
186
187
188
189
190

	public function getLegend()
	{
		return $this->getFirstChildByName(REQUESTOUTPUTPLOTAXISELEMENTLEGEND_NAME);
	}

51cbca5c   Benjamin Renard   Add constants def...
191
192
193
194
195
196
	public function addConstant()
	{
		$node = new RequestOutputPlotConstantNodeClass();
		$this->addChild($node);
		return $node;
	}
22521f1c   Benjamin Renard   First commit
197
198
199
200
201
202
203
204
205
206
207
208
209

	/* ToDo origin */

	public function setPosition($position)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_POSITION, $position);
	}

	public function getPosition()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_POSITION);
	}

78a73e9a   Benjamin Renard   Integration for p...
210
211
212
213
	public function setThickness($thickness)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS, $thickness);
	}
22521f1c   Benjamin Renard   First commit
214

78a73e9a   Benjamin Renard   Integration for p...
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
	public function getThickness()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS);
	}
	
	public function setColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_COLOR, $color);
	}
	
	public function getColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_COLOR);
	}

	public function setReverse($reverse)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_REVERSE, $reverse);
	}
22521f1c   Benjamin Renard   First commit
234

78a73e9a   Benjamin Renard   Integration for p...
235
236
237
238
	public function getReverse()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_REVERSE);
	}
22521f1c   Benjamin Renard   First commit
239

4ede4320   Benjamin Renard   Integration for s...
240
241
242
243
244
245
246
247
248
	public function setVisible($visible)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE, $visible);
	}

	public function getVisible()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE);
	}
22521f1c   Benjamin Renard   First commit
249

78a73e9a   Benjamin Renard   Integration for p...
250
251
252
253
254
255
256
257
258
	public function setScale($scale)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SCALE, $scale);
	}

	public function getScale()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SCALE);
	}
22521f1c   Benjamin Renard   First commit
259

f012b419   Benjamin Renard   Add integration f...
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
	public function setShowLegend($show)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SHOWLEGEND, $show);
	}
	
	public function getShowLegend()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SHOWLEGEND);
	}
	
	public function setShowTickMarks($show)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_TICKMARKS, $show);
	}
	
	public function getShowTickMarks()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_TICKMARKS);
	}
22521f1c   Benjamin Renard   First commit
279
280
281
}

?>