properties['lineThickness'] = 2; $this->properties['fillLines'] = false; $this->properties['symbolSize'] = 8; $this->properties['highlightFont'] = new ezcGraphFontOptions(); $this->properties['highlightFontCloned'] = false; $this->properties['highlightSize'] = 14; $this->properties['highlightLines'] = false; 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 */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'lineThickness': $this->properties['lineThickness'] = max( 1, (int) $propertyValue ); break; case 'fillLines': if ( $propertyValue === false ) { $this->properties['fillLines'] = false; } else { $this->properties['fillLines'] = min( 255, max( 0, (int) $propertyValue ) ); } break; case 'symbolSize': $this->properties['symbolSize'] = max( 1, (int) $propertyValue ); break; case 'highlightFont': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['highlightFont'] = $propertyValue; } elseif ( is_string( $propertyValue ) ) { if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->font; $this->properties['highlightFontCloned'] = true; } $this->properties['highlightFont']->font = $propertyValue; } else { throw new ezcBaseValueException( $propertyValue, 'ezcGraphFontOptions' ); } break; case 'highlightSize': $this->properties['highlightSize'] = max( 1, (int) $propertyValue ); break; case 'highlightLines': $this->properties['highlightLines'] = (bool) $propertyValue; break; default: return parent::__set( $propertyName, $propertyValue ); } } /** * __get * * @param mixed $propertyName * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @return mixed * @ignore */ public function __get( $propertyName ) { switch ( $propertyName ) { case 'highlightFont': // Clone font configuration when requested for this element if ( !$this->properties['highlightFontCloned'] ) { $this->properties['highlightFont'] = clone $this->properties['font']; $this->properties['highlightFontCloned'] = true; } return $this->properties['highlightFont']; default: return parent::__get( $propertyName ); } } } ?>