FML Update

This commit is contained in:
Steffen Schröder
2014-07-03 22:34:47 +02:00
parent edd62f0eb4
commit 8b3667b252
75 changed files with 392 additions and 370 deletions

View File

@ -59,7 +59,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Create a new Control object
*
* @param string $controlId (optional) Control id
* @return \FML\Controls\Control|static
* @return static
*/
public static function create($controlId = null) {
return new static($controlId);
@ -80,7 +80,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Check Id for dangerous characters and assign a new unique id if necessary
*
* @param bool $forceNewId (optional) Whether to force setting a newly generated id
* @return \FML\Controls\Control|static
* @return static
*/
public function checkId($forceNewId = false) {
if ($forceNewId || !$this->getId()) {
@ -123,7 +123,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Control id
*
* @param string $controlId Control id
* @return \FML\Controls\Control|static
* @return static
*/
public function setId($controlId) {
$this->controlId = (string)$controlId;
@ -136,7 +136,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param float $posX Horizontal position
* @param float $posY Vertical position
* @param float $posZ (optional) Depth
* @return \FML\Controls\Control|static
* @return static
*/
public function setPosition($posX, $posY, $posZ = null) {
$this->setX($posX);
@ -151,7 +151,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set X position
*
* @param float $posX Horizontal position
* @return \FML\Controls\Control|static
* @return static
*/
public function setX($posX) {
$this->posX = (float)$posX;
@ -162,7 +162,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Y position
*
* @param float $posY Vertical position
* @return \FML\Controls\Control|static
* @return static
*/
public function setY($posY) {
$this->posY = (float)$posY;
@ -173,7 +173,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Z position
*
* @param float $posZ Depth
* @return \FML\Controls\Control|static
* @return static
*/
public function setZ($posZ) {
$this->posZ = (float)$posZ;
@ -185,7 +185,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
*
* @param float $width Control width
* @param float $height Control height
* @return \FML\Controls\Control|static
* @return static
*/
public function setSize($width, $height) {
$this->setWidth($width);
@ -197,7 +197,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Control width
*
* @param float $width Control width
* @return \FML\Controls\Control|static
* @return static
*/
public function setWidth($width) {
$this->width = (float)$width;
@ -208,7 +208,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Control height
*
* @param float $height Control height
* @return \FML\Controls\Control|static
* @return static
*/
public function setHeight($height) {
$this->height = (float)$height;
@ -218,7 +218,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
/**
* Center alignment
*
* @return \FML\Controls\Control|static
* @return static
*/
public function centerAlign() {
$this->setAlign(self::CENTER, self::CENTER2);
@ -230,7 +230,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
*
* @param string $hAlign Horizontal alignment
* @param string $vAlign Vertical alignment
* @return \FML\Controls\Control|static
* @return static
*/
public function setAlign($hAlign, $vAlign) {
$this->setHAlign($hAlign);
@ -242,7 +242,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set horizontal alignment
*
* @param string $hAlign Horizontal alignment
* @return \FML\Controls\Control|static
* @return static
*/
public function setHAlign($hAlign) {
$this->hAlign = (string)$hAlign;
@ -253,7 +253,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set vertical alignment
*
* @param string $vAlign Vertical alignment
* @return \FML\Controls\Control|static
* @return static
*/
public function setVAlign($vAlign) {
$this->vAlign = (string)$vAlign;
@ -263,7 +263,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
/**
* Reset alignment
*
* @return \FML\Controls\Control|static
* @return static
*/
public function resetAlign() {
$this->setAlign(null, null);
@ -274,7 +274,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set Control scale
*
* @param float $scale Control scale
* @return \FML\Controls\Control|static
* @return static
*/
public function setScale($scale) {
$this->scale = (float)$scale;
@ -285,7 +285,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Set visibility
*
* @param bool $visible Whether the Control should be visible
* @return \FML\Controls\Control|static
* @return static
*/
public function setVisible($visible = true) {
$this->hidden = ($visible ? 0 : 1);
@ -295,8 +295,8 @@ abstract class Control implements Renderable, ScriptFeatureable {
/**
* Set Control rotation
*
* @param float $rotation
* @return \FML\Controls\Control|static
* @param float $rotation Control rotation
* @return static
*/
public function setRotation($rotation) {
$this->rotation = (float)$rotation;
@ -307,7 +307,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Add a new class name
*
* @param string $class Class name
* @return \FML\Controls\Control|static
* @return static
*/
public function addClass($class) {
$class = (string)$class;
@ -322,7 +322,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
*
* @param string $actionName Action to trigger
* @param string $eventLabel (optional) Event on which the action is triggered
* @return \FML\Controls\Control|static
* @return static
*/
public function addActionTriggerFeature($actionName, $eventLabel = ScriptLabel::MOUSECLICK) {
if (is_object($actionName) && ($actionName instanceof ActionTrigger)) {
@ -338,7 +338,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Add a new Script Feature
*
* @param ScriptFeature $scriptFeature Script Feature
* @return \FML\Controls\Control|static
* @return static
*/
public function addScriptFeature(ScriptFeature $scriptFeature) {
if (!in_array($scriptFeature, $this->scriptFeatures, true)) {
@ -351,7 +351,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* Add a dynamic Feature opening the current map info
*
* @param string $eventLabel (optional) Event on which the map info will be opened
* @return \FML\Controls\Control|static
* @return static
*/
public function addMapInfoFeature($eventLabel = ScriptLabel::MOUSECLICK) {
$mapInfo = new MapInfo($this, $eventLabel);
@ -364,7 +364,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
*
* @param string $login Login of the player
* @param string $eventLabel (optional) Event on which the player profile will be opened
* @return \FML\Controls\Control|static
* @return static
*/
public function addPlayerProfileFeature($login, $eventLabel = ScriptLabel::MOUSECLICK) {
$playerProfile = new PlayerProfile($login, $this, $eventLabel);
@ -378,7 +378,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param string $soundName UISound name
* @param int $variant (optional) Sound variant
* @param string $eventLabel (optional) Event on which the sound will be played
* @return \FML\Controls\Control|static
* @return static
*/
public function addUISoundFeature($soundName, $variant = 0, $eventLabel = ScriptLabel::MOUSECLICK) {
$uiSound = new UISound($soundName, $this, $variant, $eventLabel);
@ -393,7 +393,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param string $labelName (optional) Script label name
* @param bool $onlyShow (optional) Whether it should only show the Control but not toggle
* @param bool $onlyHide (optional) Whether it should only hide the Control but not toggle
* @return \FML\Controls\Control|static
* @return static
*/
public function addToggleFeature(Control $toggledControl, $labelName = Scriptlabel::MOUSECLICK, $onlyShow = false, $onlyHide = false) {
$toggle = new Toggle($this, $toggledControl, $labelName, $onlyShow, $onlyHide);
@ -407,7 +407,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param Control $tooltipControl Tooltip Control
* @param bool $stayOnClick (optional) Whether the Tooltip should stay on click
* @param bool $invert (optional) Whether the visibility toggling should be inverted
* @return \FML\Controls\Control|static
* @return static
*/
public function addTooltipFeature(Control $tooltipControl, $stayOnClick = false, $invert = false) {
$tooltip = new Tooltip($this, $tooltipControl, $stayOnClick, $invert);
@ -422,7 +422,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
* @param string $text Text to display on the Tooltip Label
* @param bool $stayOnClick (optional) Whether the Tooltip should stay on click
* @param bool $invert (optional) Whether the visibility toggling should be inverted
* @return \FML\Controls\Control|static
* @return static
*/
public function addTooltipLabelFeature(Label $tooltipControl, $text, $stayOnClick = false, $invert = false) {
$tooltip = new Tooltip($this, $tooltipControl, $stayOnClick, $invert, $text);
@ -435,7 +435,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
*
* @param string $scriptText Script text
* @param string $label (optional) Script label name
* @return \FML\Controls\Control|static
* @return static
*/
public function addScriptText($scriptText, $label = ScriptLabel::MOUSECLICK) {
$customText = new ControlScript($this, $scriptText, $label);
@ -446,7 +446,7 @@ abstract class Control implements Renderable, ScriptFeatureable {
/**
* Remove all Script Features
*
* @return \FML\Controls\Control|static
* @return static
*/
public function removeScriptFeatures() {
$this->scriptFeatures = array();

View File

@ -52,7 +52,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
* Set Entry name
*
* @param string $name Entry name
* @return \FML\Controls\Entry
* @return static
*/
public function setName($name) {
$this->name = (string)$name;
@ -72,7 +72,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
* Set default value
*
* @param string $default Default value
* @return \FML\Controls\Entry|static
* @return static
*/
public function setDefault($default) {
$this->default = $default;
@ -139,7 +139,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
* Set auto completion
*
* @param bool $autoComplete Whether the default value should be automatically completed based on the current request parameters
* @return \FML\Controls\Entry|static
* @return static
*/
public function setAutoComplete($autoComplete) {
$this->autoComplete = (bool)$autoComplete;
@ -150,7 +150,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
* Add a dynamic Feature submitting the Entry
*
* @param string $url Submit url
* @return \FML\Controls\Entry|static
* @return static
*/
public function addSubmitFeature($url) {
$entrySubmit = new EntrySubmit($this, $url);
@ -159,7 +159,7 @@ class Entry extends Control implements NewLineable, Scriptable, Styleable, TextF
}
/**
* @see \FML\Control::render()
* @see \FML\Types\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument);

View File

@ -28,7 +28,7 @@ class FileEntry extends Entry {
* Set the base folder
*
* @param string $folder Base folder
* @return \FML\Controls\FileEntry|static
* @return static
*/
public function setFolder($folder) {
$this->folder = (string)$folder;
@ -36,7 +36,7 @@ class FileEntry extends Entry {
}
/**
* @see \FML\Entry::render()
* @see \FML\Types\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument);

View File

@ -82,7 +82,7 @@ class Frame extends Control implements Container {
}
/**
* @see \FML\Renderable::render()
* @see \FML\Types\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument);

View File

@ -41,7 +41,7 @@ class Frame3d extends Frame implements Scriptable {
* Set Style3d id
*
* @param string $style3dId Style3d id
* @return \FML\Controls\Frame3d|static
* @return static
*/
public function setStyle3dId($style3dId) {
$this->style3dId = (string)$style3dId;
@ -53,7 +53,7 @@ class Frame3d extends Frame implements Scriptable {
* Set Style3d
*
* @param Style3d $style3d Style3d object
* @return \FML\Controls\Frame3d|static
* @return static
*/
public function setStyle3d(Style3d $style3d) {
$this->style3d = $style3d;
@ -70,7 +70,7 @@ class Frame3d extends Frame implements Scriptable {
}
/**
* @see \FML\Controls\Frame::render()
* @see \FML\Types\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = parent::render($domDocument);

View File

@ -26,7 +26,7 @@ class FrameInstance extends Control {
*
* @param string $modelId (optional) Frame Model id
* @param string $controlId (optional) Frame id
* @return \FML\Controls\FrameInstance|static
* @return static
*/
public static function create($modelId = null, $controlId = null) {
return new static($modelId, $controlId);
@ -49,7 +49,7 @@ class FrameInstance extends Control {
* Set Frame Model id
*
* @param string $modelId Frame Model id
* @return \FML\Controls\FrameInstance|static
* @return static
*/
public function setModelId($modelId) {
$this->modelId = (string)$modelId;
@ -61,7 +61,7 @@ class FrameInstance extends Control {
* Set Frame Model
*
* @param FrameModel $frameModel Frame Model
* @return \FML\Controls\FrameInstance|static
* @return static
*/
public function setModel(FrameModel $frameModel) {
$this->model = $frameModel;

View File

@ -46,7 +46,7 @@ class Gauge extends Control implements Styleable {
* Set ratio
*
* @param float $ratio Ratio value
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setRatio($ratio) {
$this->ratio = (float)$ratio;
@ -57,7 +57,7 @@ class Gauge extends Control implements Styleable {
* Set grading
*
* @param float $grading Grading value
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setGrading($grading) {
$this->grading = (float)$grading;
@ -68,7 +68,7 @@ class Gauge extends Control implements Styleable {
* Set color
*
* @param string $color Gauge color
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setColor($color) {
$this->color = (string)$color;
@ -79,7 +79,7 @@ class Gauge extends Control implements Styleable {
* Set rotation
*
* @param float $rotation Gauge rotation
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setRotation($rotation) {
$this->rotation = (float)$rotation;
@ -90,7 +90,7 @@ class Gauge extends Control implements Styleable {
* Set centered
*
* @param bool $centered Whether the Gauge is centered
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setCentered($centered) {
$this->centered = ($centered ? 1 : 0);
@ -101,7 +101,7 @@ class Gauge extends Control implements Styleable {
* Set clan
*
* @param int $clan Clan number
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setClan($clan) {
$this->clan = (int)$clan;
@ -112,7 +112,7 @@ class Gauge extends Control implements Styleable {
* Set draw background
*
* @param bool $drawBg Whether the Gauges background should be drawn
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setDrawBg($drawBg) {
$this->drawBg = ($drawBg ? 1 : 0);
@ -123,7 +123,7 @@ class Gauge extends Control implements Styleable {
* Set draw block background
*
* @param bool $drawBlockBg Whether the Gauges block background should be drawn
* @return \FML\Controls\Gauge|static
* @return static
*/
public function setDrawBlockBg($drawBlockBg) {
$this->drawBlockBg = ($drawBlockBg ? 1 : 0);

View File

@ -55,7 +55,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set text
*
* @param string $text Text value
* @return \FML\Controls\Label|static
* @return static
*/
public function setText($text) {
$this->text = (string)$text;
@ -66,7 +66,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set text id to use from Dico
*
* @param string $textId Text id
* @return \FML\Controls\Label|static
* @return static
*/
public function setTextId($textId) {
$this->textId = (string)$textId;
@ -77,7 +77,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set text prefix
*
* @param string $textPrefix Text prefix
* @return \FML\Controls\Label|static
* @return static
*/
public function setTextPrefix($textPrefix) {
$this->textPrefix = (string)$textPrefix;
@ -88,7 +88,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set text emboss
*
* @param bool $textEmboss Whether the text should be embossed
* @return \FML\Controls\Label|static
* @return static
*/
public function setTextEmboss($textEmboss) {
$this->textEmboss = ($textEmboss ? 1 : 0);
@ -99,7 +99,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set translate
*
* @param bool $translate Whether the text should be translated
* @return \FML\Controls\Label|static
* @return static
*/
public function setTranslate($translate) {
$this->translate = ($translate ? 1 : 0);
@ -110,7 +110,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
* Set max lines count
*
* @param int $maxLines Max lines count
* @return \FML\Controls\Label|static
* @return static
*/
public function setMaxLines($maxLines) {
$this->maxLines = (int)$maxLines;
@ -233,7 +233,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, Script
*
* @param bool $showSeconds (optional) Whether the seconds should be shown
* @param bool $showFullDate (optional) Whether the date should be shown
* @return \FML\Controls\Label|static
* @return static
*/
public function addClockFeature($showSeconds = true, $showFullDate = false) {
$clock = new Clock($this, $showSeconds, $showFullDate);

View File

@ -52,7 +52,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set image url
*
* @param string $image Image url
* @return \FML\Controls\Quad|static
* @return static
*/
public function setImage($image) {
$this->image = (string)$image;
@ -63,7 +63,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set image id to use from Dico
*
* @param string $imageId Image id
* @return \FML\Controls\Quad|static
* @return static
*/
public function setImageId($imageId) {
$this->imageId = (string)$imageId;
@ -74,7 +74,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set focus image url
*
* @param string $imageFocus Focus image url
* @return \FML\Controls\Quad|static
* @return static
*/
public function setImageFocus($imageFocus) {
$this->imageFocus = (string)$imageFocus;
@ -85,7 +85,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set focus image id to use from Dico
*
* @param string $imageFocusId Focus image id
* @return \FML\Controls\Quad|static
* @return static
*/
public function setImageFocusId($imageFocusId) {
$this->imageFocusId = (string)$imageFocusId;
@ -96,7 +96,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set colorization
*
* @param string $colorize Colorize value
* @return \FML\Controls\Quad|static
* @return static
*/
public function setColorize($colorize) {
$this->colorize = (string)$colorize;
@ -107,7 +107,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Set modulization
*
* @param string $modulizeColor Modulize value
* @return \FML\Controls\Quad|static
* @return static
*/
public function setModulizeColor($modulizeColor) {
$this->modulizeColor = (string)$modulizeColor;
@ -118,7 +118,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Disable the automatic image scaling
*
* @param bool $autoScale Whether the image should scale automatically
* @return \FML\Controls\Quad|static
* @return static
*/
public function setAutoScale($autoScale) {
$this->autoScale = ($autoScale ? 1 : 0);
@ -225,7 +225,7 @@ class Quad extends Control implements Actionable, BgColorable, Linkable, Scripta
* Apply the given CheckBox Design
*
* @param CheckBoxDesign $checkBoxDesign CheckBox Design
* @return \FML\Controls\Quad|static
* @return static
*/
public function applyCheckBoxDesign(CheckBoxDesign $checkBoxDesign) {
$checkBoxDesign->applyToQuad($this);