mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 01:12:17 +00:00
EZ-Components
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcGraphContext struct
|
||||
*
|
||||
* @package Graph
|
||||
* @version 1.3
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
/**
|
||||
* Struct to represent the context of a renderer operation
|
||||
*
|
||||
* @version 1.3
|
||||
* @package Graph
|
||||
*/
|
||||
class ezcGraphContext extends ezcBaseStruct
|
||||
{
|
||||
/**
|
||||
* Name of dataset
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $dataset = false;
|
||||
|
||||
/**
|
||||
* Name of datapoint
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $datapoint = false;
|
||||
|
||||
/**
|
||||
* Associated URL for datapoint
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $url;
|
||||
|
||||
/**
|
||||
* Simple constructor
|
||||
*
|
||||
* @param string $dataset
|
||||
* @param string $datapoint
|
||||
* @param string $url
|
||||
* @return void
|
||||
* @ignore
|
||||
*/
|
||||
public function __construct( $dataset = null, $datapoint = null, $url = null )
|
||||
{
|
||||
$this->dataset = $dataset;
|
||||
$this->datapoint = $datapoint;
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* __set_state
|
||||
*
|
||||
* @param array $properties Struct properties
|
||||
* @return void
|
||||
* @ignore
|
||||
*/
|
||||
public function __set_state( array $properties )
|
||||
{
|
||||
$this->dataset = (string) $properties['dataset'];
|
||||
$this->datapoint = (string) $properties['datapoint'];
|
||||
|
||||
// Check to keep BC
|
||||
// @TODO: Remvove unnesecary check on next major version
|
||||
if ( array_key_exists( 'url', $properties ) )
|
||||
{
|
||||
$this->url = (string) $properties['url'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcGraphCoordinate struct
|
||||
*
|
||||
* @package Graph
|
||||
* @version 1.3
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
/**
|
||||
* Represents coordinates in two dimensional catesian coordinate system.
|
||||
*
|
||||
* @version 1.3
|
||||
* @package Graph
|
||||
*/
|
||||
class ezcGraphCoordinate extends ezcBaseStruct
|
||||
{
|
||||
/**
|
||||
* x coordinate
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $x = 0;
|
||||
|
||||
/**
|
||||
* y coordinate
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $y = 0;
|
||||
|
||||
/**
|
||||
* Simple constructor
|
||||
*
|
||||
* @param float $x x coordinate
|
||||
* @param float $y y coordinate
|
||||
* @ignore
|
||||
*/
|
||||
public function __construct( $x, $y )
|
||||
{
|
||||
$this->x = $x;
|
||||
$this->y = $y;
|
||||
}
|
||||
|
||||
/**
|
||||
* __set_state
|
||||
*
|
||||
* @param array $properties Struct properties
|
||||
* @return void
|
||||
* @ignore
|
||||
*/
|
||||
public function __set_state( array $properties )
|
||||
{
|
||||
$this->x = $properties['x'];
|
||||
$this->y = $properties['y'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns simple string representation of coordinate
|
||||
*
|
||||
* @return string
|
||||
* @ignore
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return sprintf( '( %.2f, %.2f )', $this->x, $this->y );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* File containing the ezcGraphAxisStep struct
|
||||
*
|
||||
* @package Graph
|
||||
* @version 1.3
|
||||
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
|
||||
* @license http://ez.no/licenses/new_bsd New BSD License
|
||||
*/
|
||||
/**
|
||||
* Represents a single step on the axis
|
||||
*
|
||||
* @version 1.3
|
||||
* @package Graph
|
||||
*/
|
||||
class ezcGraphAxisStep
|
||||
{
|
||||
/**
|
||||
* Position of step on one axis.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $position = 0;
|
||||
|
||||
/**
|
||||
* Size of step
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
public $width = 0;
|
||||
|
||||
/**
|
||||
* Steps label
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $label = false;
|
||||
|
||||
/**
|
||||
* Childrens of step
|
||||
*
|
||||
* @var array(ezcGraphAxisStep)
|
||||
*/
|
||||
public $childs = array();
|
||||
|
||||
/**
|
||||
* True if the step is at the same position as the other axis
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $isZero = false;
|
||||
|
||||
/**
|
||||
* True if this step is the last one
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $isLast = false;
|
||||
|
||||
/**
|
||||
* Simple constructor
|
||||
*
|
||||
* @param float $position
|
||||
* @param float $width
|
||||
* @param string $label
|
||||
* @param array $childs
|
||||
* @param bool $isZero
|
||||
* @param bool $isLast
|
||||
* @ignore
|
||||
*/
|
||||
public function __construct( $position = .0, $width = .0, $label = null, array $childs = array(), $isZero = false, $isLast = false )
|
||||
{
|
||||
$this->position = (float) $position;
|
||||
$this->width = (float) $width;
|
||||
$this->label = $label;
|
||||
$this->childs = $childs;
|
||||
$this->isZero = (bool) $isZero;
|
||||
$this->isLast = (bool) $isLast;
|
||||
}
|
||||
|
||||
/**
|
||||
* __set_state
|
||||
*
|
||||
* @param array $properties Struct properties
|
||||
* @return void
|
||||
* @ignore
|
||||
*/
|
||||
public function __set_state( array $properties )
|
||||
{
|
||||
$this->position = $properties['position'];
|
||||
$this->width = $properties['width'];
|
||||
$this->label = $properties['label'];
|
||||
$this->childs = $properties['childs'];
|
||||
$this->isZero = $properties['isZero'];
|
||||
$this->isLast = $properties['isLast'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user