RequestOutputPlotTitleNodeClass.php 1.55 KB
<?php

require_once("RequestOutputPlotTitleNodeClass.php");

abstract class RequestOutputPlotTitlePosition
{
	const TOP    = "top";
	const BOTTOM = "bottom";
}

abstract class RequestOutputPlotTitleAlign
{
	const CENTER = "center";
	const LEFT   = "left";
	const RIGHT  = "right";
}

define ("REQUESTOUTPUTPLOTTITLE_NAME", "title");
define ("REQUESTOUTPUTPLOTTITLE_POSITION", "position");
define ("REQUESTOUTPUTPLOTTITLE_ALIGN", "align");
/**
 * @class RequestOutputPlotTitleNodeClass
 * @brief Definition of a title for a plot request
 * @details
*/
class RequestOutputPlotTitleNodeClass extends RequestOutputPlotLabelNodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTTITLE_NAME);
	}

	public function setText($text)
	{
		$this->setValue($text);
	}
	
	public function getText()
	{
		return $this->getValue();
	}
	
	public function setPosition($position)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTITLE_POSITION, $position);
	}
	
	public function getPosition()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTITLE_POSITION);
	}
	
	public function setAlign($align)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTTITLE_ALIGN, $align);
	}
	
	public function getAlign()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTTITLE_ALIGN);
	}
	
	public function loadFromNode($xmlNode)
	{
		$this->setText($this->getXmlNodeValue($xmlNode));
		$this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTITLE_POSITION));
		$this->setAlign($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTTITLE_ALIGN));
		parent::loadFromNode($xmlNode);
	}
}

?>