FML Update
This commit is contained in:
@ -6,7 +6,7 @@ namespace FML\Stylesheet;
|
||||
// Missing attributes: LDir1..
|
||||
|
||||
/**
|
||||
* Class representing a Stylesheets Mood
|
||||
* Class representing a Stylesheet Mood
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -14,109 +14,90 @@ namespace FML\Stylesheet;
|
||||
*/
|
||||
class Mood {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'mood';
|
||||
protected $lAmbient_LinearRgb = '';
|
||||
protected $cloudsRgbMinLinear = '';
|
||||
protected $cloudsRgbMaxLinear = '';
|
||||
protected $lDir0_LinearRgb = '';
|
||||
protected $lAmbient_LinearRgb = null;
|
||||
protected $cloudsRgbMinLinear = null;
|
||||
protected $cloudsRgbMaxLinear = null;
|
||||
protected $lDir0_LinearRgb = null;
|
||||
protected $lDir0_Intens = 1.;
|
||||
protected $lDir0_DirPhi = 0.;
|
||||
protected $lDir0_DirTheta = 0.;
|
||||
protected $lBall_LinearRgb = '';
|
||||
protected $lBall_LinearRgb = null;
|
||||
protected $lBall_Intensity = 1.;
|
||||
protected $lBall_Radius = 0.;
|
||||
protected $fogColorSrgb = '';
|
||||
protected $selfIllumColor = '';
|
||||
protected $fogColorSrgb = null;
|
||||
protected $selfIllumColor = null;
|
||||
protected $skyGradientV_Scale = 1.;
|
||||
protected $skyGradientKeys = array();
|
||||
|
||||
/**
|
||||
* Create a new Mood Object
|
||||
* Create a new Mood object
|
||||
*
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public static function create() {
|
||||
$mood = new Mood();
|
||||
return $mood;
|
||||
return new static();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Mood Object
|
||||
*/
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Ambient Color in which the Elements reflect the Light
|
||||
* Set ambient color in which the Elements reflect the light
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLightAmbientColor($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lAmbient_LinearRgb = "{$red} {$green} {$blue}";
|
||||
$this->lAmbient_LinearRgb = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Minimum Value for the Background Color Range
|
||||
* Set minimum value for the background color range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setCloudsColorMin($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->cloudsRgbMinLinear = "{$red} {$green} {$blue}";
|
||||
$this->cloudsRgbMinLinear = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Maximum Value for the Background Color Range
|
||||
* Set maximum value for the background color range
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setCloudsColorMax($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->cloudsRgbMaxLinear = "{$red} {$green} {$blue}";
|
||||
$this->cloudsRgbMaxLinear = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set RGB Color of Light Source 0
|
||||
* Set RGB color of light source 0
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLight0Color($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lDir0_LinearRgb = "{$red} {$green} {$blue}";
|
||||
$this->lDir0_LinearRgb = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Intensity of Light Source 0
|
||||
* Set intensity of light source 0
|
||||
*
|
||||
* @param float $intensity Light Intensity
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $intensity Light intensity
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLight0Intensity($intensity) {
|
||||
$this->lDir0_Intens = (float)$intensity;
|
||||
@ -124,10 +105,10 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phi-Angle of Light Source 0
|
||||
* Set phi angle of light source 0
|
||||
*
|
||||
* @param float $phiAngle Phi-Angle
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $phiAngle Phi angle
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLight0PhiAngle($phiAngle) {
|
||||
$this->lDir0_DirPhi = (float)$phiAngle;
|
||||
@ -135,10 +116,10 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Theta-Angle of Light Source 0
|
||||
* Set theta angle of light source 0
|
||||
*
|
||||
* @param float $thetaAngle Theta-Angle
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $thetaAngle Theta angle
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLight0ThetaAngle($thetaAngle) {
|
||||
$this->lDir0_DirTheta = (float)$thetaAngle;
|
||||
@ -146,26 +127,23 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Color
|
||||
* Set light ball color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLightBallColor($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->lBall_LinearRgb = "{$red} {$green} {$blue}";
|
||||
$this->lBall_LinearRgb = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Intensity
|
||||
* Set light ball intensity
|
||||
*
|
||||
* @param float $intensity Light Ball Intensity
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $intensity Light ball intensity
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLightBallIntensity($intensity) {
|
||||
$this->lBall_Intensity = (float)$intensity;
|
||||
@ -173,10 +151,10 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Ball Radius
|
||||
* Set light ball radius
|
||||
*
|
||||
* @param float $radius Light Ball Radius
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $radius Light ball radius
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setLightBallRadius($radius) {
|
||||
$this->lBall_Radius = (float)$radius;
|
||||
@ -184,42 +162,36 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fog Color
|
||||
* Set fog color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setFogColor($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->fogColorSrgb = "{$red} {$green} {$blue}";
|
||||
$this->fogColorSrgb = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Self Illumination Color
|
||||
* Set self illumination color
|
||||
*
|
||||
* @param float $red Red Color Value
|
||||
* @param float $green Green Color Value
|
||||
* @param float $blue Blue Color Value
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $red Red color value
|
||||
* @param float $green Green color value
|
||||
* @param float $blue Blue color value
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setSelfIllumColor($red, $green, $blue) {
|
||||
$red = (float)$red;
|
||||
$green = (float)$green;
|
||||
$blue = (float)$blue;
|
||||
$this->selfIllumColor = "{$red} {$green} {$blue}";
|
||||
$this->selfIllumColor = floatval($red) . ' ' . floatval($green) . ' ' . floatval($blue);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Sky Gradient Scale
|
||||
* Set sky gradient scale
|
||||
*
|
||||
* @param float $scale Gradient Scale
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $scale Gradient scale
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function setSkyGradientScale($scale) {
|
||||
$this->skyGradientV_Scale = (float)$scale;
|
||||
@ -227,24 +199,24 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Key for the SkyGradient
|
||||
* Add a sky gradient key
|
||||
*
|
||||
* @param float $x Scale Value
|
||||
* @param string $color Gradient Color
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @param float $gradientX Scale value
|
||||
* @param string $color Gradient color
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function addSkyGradientKey($x, $color) {
|
||||
$x = (float)$x;
|
||||
public function addSkyGradientKey($gradientX, $color) {
|
||||
$gradientX = (float)$gradientX;
|
||||
$color = (string)$color;
|
||||
$gradientKey = array('x' => $x, 'color' => $color);
|
||||
$gradientKey = array('x' => $gradientX, 'color' => $color);
|
||||
array_push($this->skyGradientKeys, $gradientKey);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all SkyGradient Keys
|
||||
* Remove all sky gradient keys
|
||||
*
|
||||
* @return \FML\Stylesheet\Mood
|
||||
* @return \FML\Stylesheet\Mood|static
|
||||
*/
|
||||
public function removeSkyGradientKeys() {
|
||||
$this->skyGradientKeys = array();
|
||||
@ -252,9 +224,9 @@ class Mood {
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Mood XML Element
|
||||
* Render the Mood XML element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Mood XML Element should be rendered
|
||||
* @param \DOMDocument $domDocument DOMDocument for which the Mood XML element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
|
@ -2,8 +2,10 @@
|
||||
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
use FML\UniqueID;
|
||||
|
||||
/**
|
||||
* Class representing a specific Style3d
|
||||
* Class representing a Style3d
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -20,10 +22,10 @@ class Style3d {
|
||||
const MODEL_Window = 'Window';
|
||||
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'style3d';
|
||||
protected $id = null;
|
||||
protected $styleId = null;
|
||||
protected $model = self::MODEL_Box;
|
||||
protected $thickness = null;
|
||||
protected $color = null;
|
||||
@ -36,64 +38,63 @@ class Style3d {
|
||||
protected $focusZOffset = null;
|
||||
|
||||
/**
|
||||
* Create a new Style3d Object
|
||||
* Create a new Style3d object
|
||||
*
|
||||
* @param string $id (optional) Style Id
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $styleId (optional) Style id
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public static function create($id = null) {
|
||||
$style3d = new Style3d($id);
|
||||
return $style3d;
|
||||
public static function create($styleId = null) {
|
||||
return new static($styleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Style3d Object
|
||||
* Construct a new Style3d object
|
||||
*
|
||||
* @param string $id (optional) Style Id
|
||||
* @param string $styleId (optional) Style id
|
||||
*/
|
||||
public function __construct($id = null) {
|
||||
if ($id !== null) {
|
||||
$this->setId($id);
|
||||
public function __construct($styleId = null) {
|
||||
if (!is_null($styleId)) {
|
||||
$this->setId($styleId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Style Id
|
||||
* Set style id
|
||||
*
|
||||
* @param string $id Style Id
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $styleId Style id
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = (string)$id;
|
||||
public function setId($styleId) {
|
||||
$this->styleId = (string)$styleId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for Id and assign one if necessary
|
||||
* Check for id and assign one if necessary
|
||||
*
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function checkId() {
|
||||
if (!$this->id) {
|
||||
$this->id = uniqid();
|
||||
if (!$this->styleId) {
|
||||
$this->setId(new UniqueID());
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Style Id
|
||||
* Get style id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
return $this->styleId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Model
|
||||
* Set model
|
||||
*
|
||||
* @param string $model Style Model
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $model Style model
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setModel($model) {
|
||||
$this->model = (string)$model;
|
||||
@ -101,10 +102,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Thickness
|
||||
* Set thickness
|
||||
*
|
||||
* @param float $thickness Style Thickness
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param float $thickness Style thickness
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setThickness($thickness) {
|
||||
$this->thickness = (float)$thickness;
|
||||
@ -112,10 +113,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Color
|
||||
* Set color
|
||||
*
|
||||
* @param string $color Style Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $color Style color
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setColor($color) {
|
||||
$this->color = (string)$color;
|
||||
@ -123,10 +124,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Color
|
||||
* Set focus color
|
||||
*
|
||||
* @param string $focusColor Style Focus Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $focusColor Style focus color
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setFocusColor($focusColor) {
|
||||
$this->focusColor = (string)$focusColor;
|
||||
@ -134,10 +135,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Light Color
|
||||
* Set light color
|
||||
*
|
||||
* @param string $lightColor Light Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $lightColor Light color
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setLightColor($lightColor) {
|
||||
$this->lightColor = (string)$lightColor;
|
||||
@ -145,10 +146,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Light Color
|
||||
* Set focus light color
|
||||
*
|
||||
* @param string $focusLightColor Focus Light Color
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param string $focusLightColor Focus light color
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setFocusLightColor($focusLightColor) {
|
||||
$this->focusLightColor = (string)$focusLightColor;
|
||||
@ -156,10 +157,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y-Offset
|
||||
* Set Y-offset
|
||||
*
|
||||
* @param float $yOffset Y-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param float $yOffset Y-offset
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setYOffset($yOffset) {
|
||||
$this->yOffset = (float)$yOffset;
|
||||
@ -167,10 +168,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Y-Offset
|
||||
* Set focus Y-offset
|
||||
*
|
||||
* @param float $focusYOffset Focus Y-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param float $focusYOffset Focus Y-offset
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setFocusYOffset($focusYOffset) {
|
||||
$this->focusYOffset = (float)$focusYOffset;
|
||||
@ -178,10 +179,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Z-Offset
|
||||
* Set Z-offset
|
||||
*
|
||||
* @param float $zOffset Z-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param float $zOffset Z-offset
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setZOffset($zOffset) {
|
||||
$this->zOffset = (float)$zOffset;
|
||||
@ -189,10 +190,10 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Focus Z-Offset
|
||||
* Set focus Z-offset
|
||||
*
|
||||
* @param float $focusZOffset Focus Z-Offset
|
||||
* @return \FML\Stylesheet\Style3d
|
||||
* @param float $focusZOffset Focus Z-offset
|
||||
* @return \FML\Stylesheet\Style3d|static
|
||||
*/
|
||||
public function setFocusZOffset($focusZOffset) {
|
||||
$this->focusZOffset = (float)$focusZOffset;
|
||||
@ -200,16 +201,16 @@ class Style3d {
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Style3d XML Element
|
||||
* Render the Style3d XML element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Style3d XML Element should be rendered
|
||||
* @param \DOMDocument $domDocument DOMDocument for which the Style3d XML element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$style3dXml = $domDocument->createElement($this->tagName);
|
||||
$this->checkId();
|
||||
if ($this->id) {
|
||||
$style3dXml->setAttribute('id', $this->id);
|
||||
if ($this->styleId) {
|
||||
$style3dXml->setAttribute('id', $this->styleId);
|
||||
}
|
||||
if ($this->model) {
|
||||
$style3dXml->setAttribute('model', $this->model);
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\Stylesheet;
|
||||
|
||||
/**
|
||||
* Class representing the ManiaLinks Stylesheet
|
||||
* Class representing a ManiaLink Stylesheet
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,34 +11,28 @@ namespace FML\Stylesheet;
|
||||
*/
|
||||
class Stylesheet {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'stylesheet';
|
||||
/** @var Style3d[] $styles3d */
|
||||
protected $styles3d = array();
|
||||
/** @var Mood $mood */
|
||||
protected $mood = null;
|
||||
|
||||
/**
|
||||
* Create a new Stylesheet Object
|
||||
* Create a new Stylesheet object
|
||||
*
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
* @return \FML\Stylesheet\Stylesheet|static
|
||||
*/
|
||||
public static function create() {
|
||||
$stylesheet = new Stylesheet();
|
||||
return $stylesheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Stylesheet Object
|
||||
*/
|
||||
public function __construct() {
|
||||
return new static();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new Style3d
|
||||
*
|
||||
* @param Style3d $style3d The Style3d to add
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
* @param Style3d $style3d Style3d object
|
||||
* @return \FML\Stylesheet\Stylesheet|static
|
||||
*/
|
||||
public function addStyle3d(Style3d $style3d) {
|
||||
if (!in_array($style3d, $this->styles3d, true)) {
|
||||
@ -48,9 +42,9 @@ class Stylesheet {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all Styles
|
||||
* Remove all Style3ds
|
||||
*
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
* @return \FML\Stylesheet\Stylesheet|static
|
||||
*/
|
||||
public function removeStyles() {
|
||||
$this->styles3d = array();
|
||||
@ -58,10 +52,10 @@ class Stylesheet {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Mood Object of the Stylesheet
|
||||
* Set the Mood object of the Stylesheet
|
||||
*
|
||||
* @param Mood $mood Mood Object
|
||||
* @return \FML\Stylesheet\Stylesheet
|
||||
* @param Mood $mood Mood object
|
||||
* @return \FML\Stylesheet\Stylesheet|static
|
||||
*/
|
||||
public function setMood(Mood $mood) {
|
||||
$this->mood = $mood;
|
||||
@ -69,9 +63,9 @@ class Stylesheet {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Mood Object
|
||||
* Get the Mood object
|
||||
*
|
||||
* @param bool $createIfEmpty (optional) Whether the Mood Object should be created if it's not set yet
|
||||
* @param bool $createIfEmpty (optional) Whether the Mood object should be created if it's not set
|
||||
* @return \FML\Stylesheet\Mood
|
||||
*/
|
||||
public function getMood($createIfEmpty = true) {
|
||||
@ -82,9 +76,9 @@ class Stylesheet {
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Stylesheet XML Element
|
||||
* Render the Stylesheet XML element
|
||||
*
|
||||
* @param \DOMDocument $domDocument DomDocument for which the Stylesheet XML Element should be rendered
|
||||
* @param \DOMDocument $domDocument DOMDocument for which the Stylesheet XML element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
@ -93,7 +87,6 @@ class Stylesheet {
|
||||
$stylesXml = $domDocument->createElement('frame3dstyles');
|
||||
$stylesheetXml->appendChild($stylesXml);
|
||||
foreach ($this->styles3d as $style3d) {
|
||||
/** @var Style3d $style3d */
|
||||
$style3dXml = $style3d->render($domDocument);
|
||||
$stylesXml->appendChild($style3dXml);
|
||||
}
|
||||
|
Reference in New Issue
Block a user