RequestOutputPlotIntervalsNodeClass.php 960 Bytes
<?php

define("REQUESTOUTPUTPLOTINTERVALS_NAME", "intervals");
define("REQUESTOUTPUTPLOTINTERVALS_COLOR", "color");


/**
 * @class RequestOutputPlotTextLegendNodeClass
 * @brief Definition of a "text legend" element for a plot
 * @details
 */
class RequestOutputPlotIntervalsNodeClass extends NodeClass
{
	public $textLegendNode = null;
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTINTERVALS_NAME);
	}

	public function setColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR, $color);
	}

	public function getColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTINTERVALS_COLOR);
	}

	public function addTextLegend()
	{
		$this->textLegendNode = new RequestOutputPlotTextLegendNodeClass();
		$this->addChild($this->textLegendNode);
		return $this->textLegendNode;
	}

	public function loadFromNode($xmlNode)
	{
		$this->setColor($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTINTERVALS_COLOR));
	}
}