Author: Kore Nordmann
Date: 2006-09-24 12:11:12 +0200 (Sun, 24 Sep 2006)
New Revision: 3554
Log:
- Use ezcGraphColor::create for all color properties
Modified:
trunk/Graph/src/colors/linear_gradient.php
trunk/Graph/src/colors/radial_gradient.php
trunk/Graph/src/element/axis.php
trunk/Graph/src/options/font.php
trunk/Graph/src/options/renderer.php
trunk/Graph/src/options/renderer_2d.php
trunk/Graph/src/options/renderer_3d.php
Modified: trunk/Graph/src/colors/linear_gradient.php
===================================================================
--- trunk/Graph/src/colors/linear_gradient.php 2006-09-24 10:05:52 UTC (rev
3553)
+++ trunk/Graph/src/colors/linear_gradient.php 2006-09-24 10:11:12 UTC (rev
3554)
@@ -80,24 +80,10 @@
}
break;
case 'startColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['startColor'] = $propertyValue;
- }
+ $this->properties['startColor'] = ezcGraphColor::create(
$propertyValue );
break;
case 'endColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['endColor'] = $propertyValue;
- }
+ $this->properties['endColor'] = ezcGraphColor::create(
$propertyValue );
break;
}
}
Modified: trunk/Graph/src/colors/radial_gradient.php
===================================================================
--- trunk/Graph/src/colors/radial_gradient.php 2006-09-24 10:05:52 UTC (rev
3553)
+++ trunk/Graph/src/colors/radial_gradient.php 2006-09-24 10:11:12 UTC (rev
3554)
@@ -86,24 +86,10 @@
$this->properties['offset'] = min( 0, max( 1, (float)
$propertyValue ) );
break;
case 'startColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['startColor'] = $propertyValue;
- }
+ $this->properties['startColor'] = ezcGraphColor::create(
$propertyValue );
break;
case 'endColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['endColor'] = $propertyValue;
- }
+ $this->properties['endColor'] = ezcGraphColor::create(
$propertyValue );
break;
}
}
Modified: trunk/Graph/src/element/axis.php
===================================================================
--- trunk/Graph/src/element/axis.php 2006-09-24 10:05:52 UTC (rev 3553)
+++ trunk/Graph/src/element/axis.php 2006-09-24 10:11:12 UTC (rev 3554)
@@ -111,24 +111,10 @@
$this->properties['axisSpace'] = min( 1, max( 0, (float)
$propertyValue ) );
break;
case 'majorGrid':
- if ( $propertyValue instanceof ezcGraphColor )
- {
- $this->properties['majorGrid'] = $propertyValue;
- }
- else
- {
- $this->properties['majorGrid'] = ezcGraphColor::create(
$propertyValue );
- }
+ $this->properties['majorGrid'] = ezcGraphColor::create(
$propertyValue );
break;
case 'minorGrid':
- if ( $propertyValue instanceof ezcGraphColor )
- {
- $this->properties['minorGrid'] = $propertyValue;
- }
- else
- {
- $this->properties['minorGrid'] = ezcGraphColor::create(
$propertyValue );
- }
+ $this->properties['minorGrid'] = ezcGraphColor::create(
$propertyValue );
break;
case 'majorStep':
if ( $propertyValue <= 0 )
Modified: trunk/Graph/src/options/font.php
===================================================================
--- trunk/Graph/src/options/font.php 2006-09-24 10:05:52 UTC (rev 3553)
+++ trunk/Graph/src/options/font.php 2006-09-24 10:11:12 UTC (rev 3554)
@@ -101,35 +101,14 @@
}
break;
case 'color':
- if ( $propertyValue instanceof ezcGraphColor )
- {
- $this->properties['color'] = $propertyValue;
- }
- else
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
+ $this->properties['color'] = ezcGraphColor::create(
$propertyValue );
break;
case 'background':
- if ( $propertyValue instanceof ezcGraphColor )
- {
- $this->properties['background'] = $propertyValue;
- }
- else
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
+ $this->properties['background'] = ezcGraphColor::create(
$propertyValue );
break;
case 'border':
- if ( $propertyValue instanceof ezcGraphColor )
- {
- $this->properties['border'] = $propertyValue;
- }
- else
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
+ $this->properties['border'] = ezcGraphColor::create(
$propertyValue );
break;
case 'borderWidth':
$this->properties['borderWidth'] = (int) $propertyValue;
Modified: trunk/Graph/src/options/renderer.php
===================================================================
--- trunk/Graph/src/options/renderer.php 2006-09-24 10:05:52 UTC (rev
3553)
+++ trunk/Graph/src/options/renderer.php 2006-09-24 10:11:12 UTC (rev
3554)
@@ -125,11 +125,7 @@
$this->properties['legendSymbolGleamSize'] = min( 1, max( 0,
(float) $propertyValue ) );
break;
case 'legendSymbolGleamColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- $this->properties['legendSymbolGleamColor'] = $propertyValue;
+ $this->properties['legendSymbolGleamColor'] =
ezcGraphColor::create( $propertyValue );
break;
case 'pieVerticalSize':
$this->properties['pieVerticalSize'] = min( 1, max( 0, (float)
$propertyValue ) );
Modified: trunk/Graph/src/options/renderer_2d.php
===================================================================
--- trunk/Graph/src/options/renderer_2d.php 2006-09-24 10:05:52 UTC (rev
3553)
+++ trunk/Graph/src/options/renderer_2d.php 2006-09-24 10:11:12 UTC (rev
3554)
@@ -58,11 +58,7 @@
$this->properties['pieChartShadowTransparency'] = min( 1, max(
0, (float) $propertyValue ) );
break;
case 'pieChartShadowColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- $this->properties['pieChartShadowColor'] = $propertyValue;
+ $this->properties['pieChartShadowColor'] =
ezcGraphColor::create( $propertyValue );
break;
default:
return parent::__set( $propertyName, $propertyValue );
Modified: trunk/Graph/src/options/renderer_3d.php
===================================================================
--- trunk/Graph/src/options/renderer_3d.php 2006-09-24 10:05:52 UTC (rev
3553)
+++ trunk/Graph/src/options/renderer_3d.php 2006-09-24 10:11:12 UTC (rev
3554)
@@ -117,11 +117,7 @@
$this->properties['pieChartShadowTransparency'] = min( 1, max(
0, (float) $propertyValue ) );
break;
case 'pieChartShadowColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName,
$propertyValue, 'ezcGraphColor' );
- }
- $this->properties['pieChartShadowColor'] = $propertyValue;
+ $this->properties['pieChartShadowColor'] =
ezcGraphColor::create( $propertyValue );
break;
case 'barDarkenSide':
$this->properties['barDarkenSide'] = min( 1, max( 0, (float)
$propertyValue ) );
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components