Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotTextNodeClass.php 3.09 KB
ab13f26c   Benjamin Renard   Add text object p...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
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
<?php

define ("REQUESTOUTPUTPLOTTEXT_NAME", "textPlot");
define ("REQUESTOUTPUTPLOTTEXT_TEXT", "text");
define ("REQUESTOUTPUTPLOTTEXT_YAXIS", "yAxis");
define ("REQUESTOUTPUTPLOTTEXT_X", "x");
define ("REQUESTOUTPUTPLOTTEXT_Y", "y");
define ("REQUESTOUTPUTPLOTTEXT_ANGLE", "angle");
define ("REQUESTOUTPUTPLOTTEXT_COLOR", "color");
define ("REQUESTOUTPUTPLOTTEXT_ALIGN", "align");
define ("REQUESTOUTPUTPLOTTEXT_FONT", "font");

abstract class RequestOutputPlotTextAlign
{
	const CENTER = "center";
	const LEFT   = "left";
	const RIGHT  = "right";
}

/**
 * @class RequestOutputPlotTextNodeClass
 * @brief Definition of a text element for a plot
 * @details
 */
class RequestOutputPlotTextNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTTEXT_NAME);
	}
	
	public function setText($text)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_TEXT, $text);
	}
	
	public function getText()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_TEXT);
	}
	
	public function setYAxis($yAxis)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_YAXIS, $yAxis);
	}
	
	public function getYAxis()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_YAXIS);
	}
	
	public function setX($x)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_X, $x);
	}
	
	public function getX()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_X);
	}
	
	public function setY($y)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_Y, $y);
	}
	
	public function getY()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_Y);
	}
	
	public function setAngle($angle)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_ANGLE, $angle);
	}
	
	public function getAngle()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_ANGLE);
	}
	
	public function setColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_COLOR, $color);
	}
	
	public function getColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_COLOR);
	}
	
	public function setAlign($align)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTEXT_ALIGN, $align);
	}
	
	public function getAlign()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTEXT_ALIGN);
	}
	
	public function getFont()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTTEXT_FONT);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotFontNodeClass();
			$this->addChild($node);
		}
	
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
	
	public function loadFromNode($xmlNode)
	{
		$this->setText($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_TEXT));
		$this->setYAxis($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_YAXIS));
		$this->setX($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_X));
		$this->setY($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_Y));
		$this->setAngle($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_ANGLE));
		$this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_COLOR));
		$this->setAlign($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTEXT_ALIGN));
		
		$fontXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTTEXT_FONT);
		if (isset($fontXmlNode))
			$this->getFont()->loadFromNode($fontXmlNode);
	}
ab13f26c   Benjamin Renard   Add text object p...
129
130
131
}

?>