ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Shadow.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class Shadow implements IComparable
9 {
10  // Shadow alignment
11  const SHADOW_BOTTOM = 'b';
12  const SHADOW_BOTTOM_LEFT = 'bl';
13  const SHADOW_BOTTOM_RIGHT = 'br';
14  const SHADOW_CENTER = 'ctr';
15  const SHADOW_LEFT = 'l';
16  const SHADOW_TOP = 't';
17  const SHADOW_TOP_LEFT = 'tl';
18  const SHADOW_TOP_RIGHT = 'tr';
19 
25  private $visible;
26 
34  private $blurRadius;
35 
43  private $distance;
44 
50  private $direction;
51 
57  private $alignment;
58 
64  private $color;
65 
71  private $alpha;
72 
76  public function __construct()
77  {
78  // Initialise values
79  $this->visible = false;
80  $this->blurRadius = 6;
81  $this->distance = 2;
82  $this->direction = 0;
83  $this->alignment = self::SHADOW_BOTTOM_RIGHT;
84  $this->color = new Color(Color::COLOR_BLACK);
85  $this->alpha = 50;
86  }
87 
93  public function getVisible()
94  {
95  return $this->visible;
96  }
97 
105  public function setVisible($pValue)
106  {
107  $this->visible = $pValue;
108 
109  return $this;
110  }
111 
117  public function getBlurRadius()
118  {
119  return $this->blurRadius;
120  }
121 
129  public function setBlurRadius($pValue)
130  {
131  $this->blurRadius = $pValue;
132 
133  return $this;
134  }
135 
141  public function getDistance()
142  {
143  return $this->distance;
144  }
145 
153  public function setDistance($pValue)
154  {
155  $this->distance = $pValue;
156 
157  return $this;
158  }
159 
165  public function getDirection()
166  {
167  return $this->direction;
168  }
169 
177  public function setDirection($pValue)
178  {
179  $this->direction = $pValue;
180 
181  return $this;
182  }
183 
189  public function getAlignment()
190  {
191  return $this->alignment;
192  }
193 
201  public function setAlignment($pValue)
202  {
203  $this->alignment = $pValue;
204 
205  return $this;
206  }
207 
213  public function getColor()
214  {
215  return $this->color;
216  }
217 
225  public function setColor(?Color $pValue = null)
226  {
227  $this->color = $pValue;
228 
229  return $this;
230  }
231 
237  public function getAlpha()
238  {
239  return $this->alpha;
240  }
241 
249  public function setAlpha($pValue)
250  {
251  $this->alpha = $pValue;
252 
253  return $this;
254  }
255 
261  public function getHashCode()
262  {
263  return md5(
264  ($this->visible ? 't' : 'f') .
265  $this->blurRadius .
266  $this->distance .
267  $this->direction .
268  $this->alignment .
269  $this->color->getHashCode() .
270  $this->alpha .
271  __CLASS__
272  );
273  }
274 
278  public function __clone()
279  {
280  $vars = get_object_vars($this);
281  foreach ($vars as $key => $value) {
282  if (is_object($value)) {
283  $this->$key = clone $value;
284  } else {
285  $this->$key = $value;
286  }
287  }
288  }
289 }
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: Shadow.php:278
getDirection()
Get Shadow direction (in degrees).
Definition: Shadow.php:165
setDistance($pValue)
Set Shadow distance.
Definition: Shadow.php:153
if(PHP_SAPI !='cli') color
Definition: langcheck.php:120
setDirection($pValue)
Set Shadow direction (in degrees).
Definition: Shadow.php:177
setAlignment($pValue)
Set Shadow alignment.
Definition: Shadow.php:201
setColor(?Color $pValue=null)
Set Color.
Definition: Shadow.php:225
$key
Definition: croninfo.php:18