RequestOutputPlotTextNodeClass.php 2.31 KB
<?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;
	}
}

?>