Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAxisElementNodeClass.php 6.3 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");
22521f1c   Benjamin Renard   First commit
9
10
11
12
13
14

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

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

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

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

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

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

22521f1c   Benjamin Renard   First commit
43
44
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
/**
 * @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...
83
84
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
 * @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
126
127
128
129
 * @class RequestOutputPlotAxisElementLegendNodeClass
 * @brief Definition of legend for an axis
 * @details
 */
78a73e9a   Benjamin Renard   Integration for p...
130
class RequestOutputPlotAxisElementLegendNodeClass extends RequestOutputPlotLabelNodeClass
22521f1c   Benjamin Renard   First commit
131
132
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
{
	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...
165
166
167
168
		//tick
		$node = new RequestOutputPlotAxisElementTickClass();
		$this->addChild($node);
		
22521f1c   Benjamin Renard   First commit
169
170
171
172
173
174
175
176
177
178
		//legend
		$node = new RequestOutputPlotAxisElementLegendNodeClass();
		$this->addChild($node);
	}

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

78a73e9a   Benjamin Renard   Integration for p...
179
180
181
182
	public function getTick()
	{
		return $this->getFirstChildByName(REQUESTOUTPUTPLOTAXISELEMENTTICK_NAME);
	}
22521f1c   Benjamin Renard   First commit
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

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

	/* ToDo constantLine */

	/* 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...
203
204
205
206
	public function setThickness($thickness)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_THICKNESS, $thickness);
	}
22521f1c   Benjamin Renard   First commit
207

78a73e9a   Benjamin Renard   Integration for p...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
	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
227

78a73e9a   Benjamin Renard   Integration for p...
228
229
230
231
	public function getReverse()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_REVERSE);
	}
22521f1c   Benjamin Renard   First commit
232

4ede4320   Benjamin Renard   Integration for s...
233
234
235
236
237
238
239
240
241
	public function setVisible($visible)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_VISIBLE, $visible);
	}

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

78a73e9a   Benjamin Renard   Integration for p...
243
244
245
246
247
248
249
250
251
	public function setScale($scale)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SCALE, $scale);
	}

	public function getScale()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTAXISELEMENT_SCALE);
	}
22521f1c   Benjamin Renard   First commit
252
253
254
255
256
257
258

	/* ToDo showLegend */

	/* ToDo showTickMark */
}

?>