RequestOutputPlotParamsLegendNodeClass.php 3.41 KB
<?php

define ("REQUESTOUTPUTPLOTPARAMSLEGEND_NAME", "paramsLegend");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_TYPE", "type");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWPARAMINFO", "showParamInfo");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWINTERVALINFO", "showIntervalInfo");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_INTERVALINFOTYPE", "intervalInfoType");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_POSITION", "position");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_DEFAULTTEXTCOLOR", "defaultTextColor");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERVISIBLE", "borderVisible");
define ("REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERCOLOR", "borderColor");

abstract class RequestOutputPlotParamsLegendTypeEnum
{
	const TEXTLINESYMBOL = "text-line-symbol";
	const TEXTONLY       = "text-only";
}

abstract class RequestOutputPlotParamsLegendPositionEnum
{
	const INSIDE  = "inside";
	const OUTSIDE = "outside";
}

abstract class RequestOutputPlotParamsLegendIntervalInfoTypeEnum
{
	const INDEX     = "index";
	const STARTSTOP = "start-stop";
}

/**
 * @class RequestOutputPlotParamsLegendNodeClass
 * @brief Definition of a "params legend" element for a plot
 * @details
 */
class RequestOutputPlotParamsLegendNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTPARAMSLEGEND_NAME);
	}
	
	public function setType($type)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_TYPE, $type);
	}
	
	public function getType()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_TYPE);
	}
	
	public function setShowParamInfo($show)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWPARAMINFO, $show);
	}
	
	public function getShowParamInfo()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWPARAMINFO);
	}
	
	public function setShowIntervalInfo($show)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWINTERVALINFO, $show);
	}
	
	public function getShowIntervalInfo()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_SHOWINTERVALINFO);
	}
	
	public function setIntervalInfoType($type)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_INTERVALINFOTYPE, $type);
	}
	
	public function getIntervalInfoType()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_INTERVALINFOTYPE);
	}
	
	public function setPosition($position)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_POSITION, $position);
	}
	
	public function getPosition()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_POSITION);
	}
	
	public function setDefaultTextColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_DEFAULTTEXTCOLOR, $color);
	}
	
	public function getDefaultTextColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_DEFAULTTEXTCOLOR);
	}
	
	public function setBorderVisible($visible)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERVISIBLE, $visible);
	}
	
	public function getBorderVisible()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERVISIBLE);
	}
	
	public function setBorderColor($color)
	{
		$this->setAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERCOLOR, $color);
	}
	
	public function getBorderColor()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTPARAMSLEGEND_BORDERCOLOR);
	}
	
	public function getFont()
	{
		$node = $this->getFirstChildByName(REQUESTOUTPUTPLOTPARAMSLEGEND_FONT);
	
		if (!isset($node))
		{
			$node = new RequestOutputPlotFontNodeClass();
			$this->addChild($node);
		}
	
		return $node;
	}
}

?>