|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Grandstream-XMLApp |
|
4
|
|
|
* |
|
5
|
|
|
* Copyright (c) 2017 pudelek.org.pl |
|
6
|
|
|
* |
|
7
|
|
|
* @license MIT License (MIT) |
|
8
|
|
|
* |
|
9
|
|
|
* For the full copyright and license information, please view source file |
|
10
|
|
|
* that is bundled with this package in the file LICENSE |
|
11
|
|
|
* |
|
12
|
|
|
* @author Marcin Pudełek <[email protected]> |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace mrcnpdlk\Grandstream\XMLApp\Application\Model\Display; |
|
16
|
|
|
|
|
17
|
|
|
use mrcnpdlk\Grandstream\XMLApp\Application\Model\ModelInterface; |
|
18
|
|
|
use mrcnpdlk\Grandstream\XMLApp\Helper\Color; |
|
19
|
|
|
use mrcnpdlk\Grandstream\XMLApp\Helper\Point; |
|
20
|
|
|
use mrcnpdlk\Grandstream\XMLApp\Helper\Rectangle; |
|
21
|
|
|
use mrcnpdlk\Grandstream\XMLApp\MyXML; |
|
22
|
|
|
|
|
23
|
|
|
class DisplayRectangle extends DisplayAbstract implements ModelInterface |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* DisplayRectangle constructor. |
|
27
|
|
|
* |
|
28
|
|
|
* @param \mrcnpdlk\Grandstream\XMLApp\Helper\Rectangle $oRectangle |
|
29
|
|
|
* @param \mrcnpdlk\Grandstream\XMLApp\Helper\Point|null $oPoint |
|
30
|
|
|
*/ |
|
31
|
|
|
public function __construct( |
|
32
|
|
|
Rectangle $oRectangle, |
|
33
|
|
|
Point $oPoint = null |
|
34
|
|
|
) { |
|
35
|
|
|
parent::__construct($oPoint, $oRectangle); |
|
36
|
|
|
$this->setColorBorder(new Color(100)); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @return MyXML |
|
41
|
|
|
*/ |
|
42
|
|
|
public function getXml() : MyXML |
|
43
|
|
|
{ |
|
44
|
|
|
$oXml = new MyXML('DisplayRectangle'); |
|
45
|
|
|
|
|
46
|
|
|
$oXml->asObject()->addAttribute('x', $this->getPoint()->getX()); |
|
47
|
|
|
$oXml->asObject()->addAttribute('y', $this->getPoint()->getY()); |
|
48
|
|
|
$oXml->asObject()->addAttribute('width', $this->getRectangle()->getWidth()); |
|
49
|
|
|
$oXml->asObject()->addAttribute('height', $this->getRectangle()->getHeight()); |
|
50
|
|
|
$oXml->asObject()->addAttribute('bgcolor', $this->getColorBg()->get()); |
|
51
|
|
|
$oXml->asObject()->addAttribute('border-color', $this->getColorBorder()->get()); |
|
52
|
|
|
$oXml->asObject()->addAttribute('color', $this->getColorFont()->get()); |
|
53
|
|
|
|
|
54
|
|
|
return $oXml; |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|