properties['assumedNumericCharacterWidth'] = .62; $this->properties['assumedTextCharacterWidth'] = .53; $this->properties['strokeLineJoin'] = 'round'; $this->properties['strokeLineCap'] = 'round'; $this->properties['shapeRendering'] = 'geometricPrecision'; $this->properties['colorRendering'] = 'optimizeQuality'; $this->properties['textRendering'] = 'optimizeLegibility'; $this->properties['templateDocument'] = false; $this->properties['insertIntoGroup'] = false; $this->properties['graphOffset'] = new ezcGraphCoordinate( 0, 0 ); $this->properties['idPrefix'] = 'ezcGraph'; parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'assumedNumericCharacterWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['assumedNumericCharacterWidth'] = (float) $propertyValue; break; case 'assumedTextCharacterWidth': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'float > 0' ); } $this->properties['assumedTextCharacterWidth'] = (float) $propertyValue; break; case 'strokeLineJoin': $values = array( 'round', 'butt', 'square', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['strokeLineJoin'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'strokeLineCap': $values = array( 'round', 'butt', 'square', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['strokeLineCap'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'shapeRendering': $values = array( 'auto', 'optimizeSpeed', 'crispEdges', 'geometricPrecision', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['shapeRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'colorRendering': $values = array( 'auto', 'optimizeSpeed', 'optimizeQuality', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['colorRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'textRendering': $values = array( 'auto', 'optimizeSpeed', 'optimizeLegibility', 'geometricPrecision', 'inherit', ); if ( in_array( $propertyValue, $values, true ) ) { $this->properties['textRendering'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, implode( $values, ', ' ) ); } break; case 'templateDocument': if ( !is_file( $propertyValue ) || !is_readable( $propertyValue ) ) { throw new ezcBaseFileNotFoundException( $propertyValue ); } else { $this->properties['templateDocument'] = realpath( $propertyValue ); } break; case 'insertIntoGroup': if ( !is_string( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string' ); } else { $this->properties['insertIntoGroup'] = $propertyValue; } break; case 'graphOffset': if ( $propertyValue instanceof ezcGraphCoordinate ) { $this->properties['graphOffset'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphCoordinate' ); } break; case 'idPrefix': $this->properties['idPrefix'] = (string) $propertyValue; break; default: parent::__set( $propertyName, $propertyValue ); break; } } } ?>