RequestOutputPlotElementStatusNodeClass.php 1.74 KB
<?php

require_once("RequestOutputPlotElementNodeClass.php");

define ("REQUESTOUTPUTPLOTELEMENTSTATUS_NAME", "statusPlot");
define ("REQUESTOUTPUTPLOTELEMENTSTATUS_POSITION", "position");
define ("REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP", "colorMapIndex");

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

/**
 * @class RequestOutputPlotElementStatusNodeClass
 * @brief Definition of a status plot element for a panel of a plot request
 * @details
*/
class RequestOutputPlotElementStatusNodeClass extends RequestOutputPlotElementNodeClass
{
	public function __construct($noAxis)
	{
		parent::__construct(REQUESTOUTPUTPLOTELEMENTSTATUS_NAME,false,false,false,$noAxis,true,true);
		if (!$noAxis)
			//force time axis creation
			$this->getAxes()->getTimeAxis();
	}

	public function getTimeAxis()
	{
		if ($this->getAxes() == NULL)
			return NULL;
		return $this->getAxes()->getTimeAxis();
	}
	
	public function setPosition($position)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTELEMENTSTATUS_POSITION, $position);
	}
	
	public function getPosition()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTSTATUS_POSITION);
	}
	
	public function setColorMap($colorMapIndex)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP, $colorMapIndex);
	}
	
	public function getColorMap()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP);
	}
	
	public function loadFromNode($xmlNode)
	{
		$this->setPosition($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTSTATUS_POSITION));
		$this->setColorMap($this->getXmlNodeAttribute($xmlNode, REQUESTOUTPUTPLOTELEMENTSTATUS_COLORMAP));
		parent::loadFromNode($xmlNode);
	}
}

?>