EZ-Components

This commit is contained in:
Andreas Österreicher
2009-02-17 15:27:43 +00:00
parent 359c3c55c9
commit 0a8e90a8b3
572 changed files with 64490 additions and 0 deletions
@@ -0,0 +1,33 @@
<?php
/**
* File containing the ezcGraphErrorParsingDateException class
*
* @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
*/
/**
* Exception thrown when a date assigned to the
* {@link ezcGraphChartElementDateAxis} could not be parsed.
*
* @package Graph
* @version 1.3
*/
class ezcGraphErrorParsingDateException extends ezcGraphException
{
/**
* Constructor
*
* @param mixed $value
* @return void
* @ignore
*/
public function __construct( $value )
{
$type = gettype( $value );
parent::__construct( "Could not parse date '{$value}' of type '{$type}'." );
}
}
?>
@@ -0,0 +1,20 @@
<?php
/**
* Base exception for the Graph package.
*
* @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
*/
/**
* General exception container for the Graph component.
*
* @package Graph
* @version 1.3
*/
abstract class ezcGraphException extends ezcBaseException
{
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphFlashBitmapTypeException class
*
* @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
*/
/**
* Flash can only read non interlaced bitmaps. This exception is thrown for
* all other image types.
*
* @package Graph
* @version 1.3
*/
class ezcGraphFlashBitmapTypeException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "Flash can only read JPEGs and PNGs." );
}
}
?>
@@ -0,0 +1,40 @@
<?php
/**
* File containing the ezcGraphFontRenderingException class
*
* @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
*/
/**
* Exception thrown when it is not possible to render a string beacause of
* minimum font size in the desinated bounding box.
*
* @package Graph
* @version 1.3
*/
class ezcGraphFontRenderingException extends ezcGraphException
{
/**
* Constructor
*
* @param string $string
* @param float $size
* @param int $width
* @param int $height
* @return void
* @ignore
*/
public function __construct( $string, $size, $width, $height )
{
parent::__construct( "Could not fit string '{$string}' with font size '{$size}' in box '{$width} * {$height}'.
Possible solutions to solve this problem:
- Decrease the amount of steps on the axis.
- Increase the size of the chart.
- Decrease the minimum font size.
- Use a font which consumes less space for each character." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphUnknownFontTypeException class
*
* @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
*/
/**
* Exception thrown if font type is unknown or not supported.
*
* @package Graph
* @version 1.3
*/
class ezcGraphUnknownFontTypeException extends ezcGraphException
{
/**
* Constructor
*
* @param string $file
* @param string $extension
* @return void
* @ignore
*/
public function __construct( $file, $extension )
{
parent::__construct( "Unknown font type '{$extension}' of file '{$file}'." );
}
}
?>
@@ -0,0 +1,34 @@
<?php
/**
* File containing the ezcGraphToolsIncompatibleDriverException class
*
* @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
*/
/**
* Exception thrown when trying to modify rendered images with incompatible
* graph tools.
*
* @package Graph
* @version 1.3
*/
class ezcGraphToolsIncompatibleDriverException extends ezcGraphException
{
/**
* Constructor
*
* @param mixed $driver
* @param string $accepted
* @return void
* @ignore
*/
public function __construct( $driver, $accepted )
{
$driverClass = get_class( $driver );
parent::__construct( "Incompatible driver used. Driver '{$driverClass}' is not an instance of '{$accepted}'." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphInvalidAssignementException class
*
* @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
*/
/**
* Exception thrown, when trying a property cannot be set for a data point, but
* only for data sets.
*
* @package Graph
* @version 1.3
*/
class ezcGraphInvalidAssignementException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "This cannot be set on data points, but only for data sets." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphInvalidDataException class
*
* @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
*/
/**
* Exception thrown when invalid data is provided, which cannot be rendered
* for some reason.
*
* @package Graph
* @version 1.3
*/
class ezcGraphInvalidDataException extends ezcGraphException
{
/**
* Constructor
*
* @param string $message
* @return void
* @ignore
*/
public function __construct( $message )
{
parent::__construct( "You provided unusable data: '$message'." );
}
}
?>
@@ -0,0 +1,33 @@
<?php
/**
* File containing the ezcGraphInvalidArrayDataSourceException class
*
* @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
*/
/**
* Exception thrown when an invalid data source is provided for an array
* data set.
*
* @package Graph
* @version 1.3
*/
class ezcGraphInvalidArrayDataSourceException extends ezcGraphException
{
/**
* Constructor
*
* @param mixed $value
* @return void
* @ignore
*/
public function __construct( $value )
{
$type = gettype( $value );
parent::__construct( "The array dataset can only use arrays and iterators, but you supplied '{$type}'." );
}
}
?>
@@ -0,0 +1,35 @@
<?php
/**
* File containing the ezcGraphMatrixInvalidDimensionsException class
*
* @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
*/
/**
* Exception thrown when an operation is not possible because of incompatible
* matrix dimensions.
*
* @package Graph
* @version 1.3
*/
class ezcGraphMatrixInvalidDimensionsException extends ezcGraphException
{
/**
* Constructor
*
* @param int $rows
* @param int $columns
* @param int $dRows
* @param int $dColumns
* @return void
* @ignore
*/
public function __construct( $rows, $columns, $dRows, $dColumns )
{
parent::__construct( "Matrix '{$dRows}, {$dColumns}' is incompatible with matrix '{$rows}, {$columns}' for requested operation." );
}
}
?>
@@ -0,0 +1,46 @@
<?php
/**
* File containing the ezcGraphInvalidDisplayTypeException class
*
* @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
*/
/**
* Exception thrown when an unsupported data type is set for the current chart.
*
* @package Graph
* @version 1.3
*/
class ezcGraphInvalidDisplayTypeException extends ezcGraphException
{
/**
* Constructor
*
* @param int $type
* @return void
* @ignore
*/
public function __construct( $type )
{
$chartTypeNames = array(
ezcGraph::PIE => 'Pie',
ezcGraph::LINE => 'Line',
ezcGraph::BAR => 'Bar',
);
if ( isset( $chartTypeNames[$type] ) )
{
$chartTypeName = $chartTypeNames[$type];
}
else
{
$chartTypeName = 'Unknown';
}
parent::__construct( "Invalid data set display type '$type' ('$chartTypeName') for current chart." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphSvgDriverInvalidIdException class
*
* @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
*/
/**
* Exception thrown when a id could not be found in a SVG document to insert
* elements in.
*
* @package Graph
* @version 1.3
*/
class ezcGraphSvgDriverInvalidIdException extends ezcGraphException
{
/**
* Constructor
*
* @param string $id
* @return void
* @ignore
*/
public function __construct( $id )
{
parent::__construct( "Could not find element with id '{$id}' in SVG document." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphInvalidImageFileException class
*
* @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
*/
/**
* Exception thrown when a file can not be used as a image file.
*
* @package Graph
* @version 1.3
*/
class ezcGraphInvalidImageFileException extends ezcGraphException
{
/**
* Constructor
*
* @param string $image
* @return void
* @ignore
*/
public function __construct( $image )
{
parent::__construct( "File '{$image}' is not a valid image." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphDatasetAverageInvalidKeysException class
*
* @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
*/
/**
* Exception thrown when a dataset with non numeric keys is used with average
* datasets.
*
* @package Graph
* @version 1.3
*/
class ezcGraphDatasetAverageInvalidKeysException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "You can not use non numeric keys with Average datasets." );
}
}
?>
@@ -0,0 +1,30 @@
<?php
/**
* File containing the ezcGraphNoDataException class
*
* @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
*/
/**
* Exception shown, when trying to render a chart without assigning any data.
*
* @package Graph
* @version 1.3
*/
class ezcGraphNoDataException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "No data sets assigned to chart." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphNoSuchDataException class
*
* @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
*/
/**
* Exception shown, when trying to access not existing data in datasets.
*
* @package Graph
* @version 1.3
*/
class ezcGraphNoSuchDataException extends ezcGraphException
{
/**
* Constructor
*
* @param string $name
* @return void
* @ignore
*/
public function __construct( $name )
{
parent::__construct( "No data with name '{$name}' found." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphNoSuchDataSetException class
*
* @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
*/
/**
* Exception thrown when trying to access a non exising dataset.
*
* @package Graph
* @version 1.3
*/
class ezcGraphNoSuchDataSetException extends ezcGraphException
{
/**
* Constructor
*
* @param string $name
* @return void
* @ignore
*/
public function __construct( $name )
{
parent::__construct( "No dataset with identifier '{$name}' could be found." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphNoSuchElementException class
*
* @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
*/
/**
* Exception thrown when trying to access a non existing chart element.
*
* @package Graph
* @version 1.3
*/
class ezcGraphNoSuchElementException extends ezcGraphException
{
/**
* Constructor
*
* @param string $name
* @return void
* @ignore
*/
public function __construct( $name )
{
parent::__construct( "No chart element with name '{$name}' found." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphToolsNotRenderedException class
*
* @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
*/
/**
* Exception thrown when a chart was not rendered yet, but the graph tool
* requires information only available in rendered charts.
*
* @package Graph
* @version 1.3
*/
class ezcGraphToolsNotRenderedException extends ezcGraphException
{
/**
* Constructor
*
* @param ezcGraphChart $chart
* @return void
* @ignore
*/
public function __construct( $chart )
{
parent::__construct( "Chart is not yet rendered." );
}
}
?>
@@ -0,0 +1,35 @@
<?php
/**
* File containing the ezcGraphMatrixOutOfBoundingsException class
*
* @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
*/
/**
* Exception thrown when a requested matrix value is out of the boundings of
* the matrix.
*
* @package Graph
* @version 1.3
*/
class ezcGraphMatrixOutOfBoundingsException extends ezcGraphException
{
/**
* Constructor
*
* @param int $rows
* @param int $columns
* @param int $rPos
* @param int $cPos
* @return void
* @ignore
*/
public function __construct( $rows, $columns, $rPos, $cPos )
{
parent::__construct( "Position '{$rPos}, {$cPos}' is out of the matrix boundings '{$rows}, {$columns}'." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphOutOfLogithmicalBoundingsException class
*
* @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
*/
/**
* Exception thrown when data exceeds the values which are displayable on an
* logarithmical scaled axis.
*
* @package Graph
* @version 1.3
*/
class ezcGraphOutOfLogithmicalBoundingsException extends ezcGraphException
{
/**
* Constructor
*
* @param int $minimum
* @return void
* @ignore
*/
public function __construct( $minimum )
{
parent::__construct( "Value '$minimum' exceeds displayable values on a logarithmical scaled axis." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphReducementFailedException class
*
* @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
*/
/**
* Exception thrown when a requested reducement of an ellipse or polygone
* failed because the shape was already too small.
*
* @package Graph
* @version 1.3
*/
class ezcGraphReducementFailedException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "Reducement of shape failed, because it was already too small." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphTooManyDataSetsExceptions class
*
* @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
*/
/**
* Exception thrown when trying to insert too many data sets in a data set
* container.
*
* @package Graph
* @version 1.3
*/
class ezcGraphTooManyDataSetsExceptions extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "You tried to insert to many datasets." );
}
}
?>
@@ -0,0 +1,32 @@
<?php
/**
* File containing the ezcGraphUnknownColorDefinitionException class
*
* @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
*/
/**
* Exception thrown, when a given value could not be interpreted as a color by
* {@link ezcGraphColor}.
*
* @package Graph
* @version 1.3
*/
class ezcGraphUnknownColorDefinitionException extends ezcGraphException
{
/**
* Constructor
*
* @param mixed $definition
* @return void
* @ignore
*/
public function __construct( $definition )
{
parent::__construct( "Unknown color definition '{$definition}'." );
}
}
?>
@@ -0,0 +1,31 @@
<?php
/**
* File containing the ezcGraphUnregularStepsException class
*
* @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
*/
/**
* Exception thrown when a bar chart shouls be rendered on an axis using
* unregular step sizes.
*
* @package Graph
* @version 1.3
*/
class ezcGraphUnregularStepsException extends ezcGraphException
{
/**
* Constructor
*
* @return void
* @ignore
*/
public function __construct()
{
parent::__construct( "Bar charts do not support axis with unregualr steps sizes." );
}
}
?>
@@ -0,0 +1,61 @@
<?php
/**
* File containing the ezcGraphGdDriverUnsupportedImageTypeException class
*
* @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
*/
/**
* Exception thrown if the image type is not supported and therefore could not
* be used in the gd driver.
*
* @package Graph
* @version 1.3
*/
class ezcGraphGdDriverUnsupportedImageTypeException extends ezcGraphException
{
/**
* Constructor
*
* @param int $type
* @return void
* @ignore
*/
public function __construct( $type )
{
$typeName = array(
1 => 'GIF',
2 => 'Jpeg',
3 => 'PNG',
4 => 'SWF',
5 => 'PSD',
6 => 'BMP',
7 => 'TIFF (intel)',
8 => 'TIFF (motorola)',
9 => 'JPC',
10 => 'JP2',
11 => 'JPX',
12 => 'JB2',
13 => 'SWC',
14 => 'IFF',
15 => 'WBMP',
16 => 'XBM',
);
if ( isset( $typeName[$type] ) )
{
$type = $typeName[$type];
}
else
{
$type = 'Unknown';
}
parent::__construct( "Unsupported image format '{$type}'." );
}
}
?>