RequestOutputPlotLegendsNodeClass.php 941 Bytes
<?php

require_once("RequestOutputPlotParamsLegendNodeClass.php");

/**
 * @class RequestOutputPlotLegendsNodeClass
 * @brief Definition of legends element for a plot
 * @details
 */
class RequestOutputPlotLegendsNodeClass extends NodeClass
{
	public function __construct($name)
	{
		parent::__construct($name);
	}
	
	public function getParamsLegend()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTPARAMSLEGEND_NAME);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotParamsLegendNodeClass();
			$this->addChild($node);
		}
	
		return $node;
	}
	
	public function addTextLegend()
	{
		$node = new RequestOutputPlotTextLegendNodeClass();
		$this->addChild($node);
		return $node;
	}
	
	public function loadFromNode($xmlNode)
	{
		foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMSLEGEND_NAME) as $paramsLegendXmlNode) {
			$this->addTextLegend()->loadFromNode($paramsLegendXmlNode);
		}
	}
}

?>