Source for file Shadow.php
Documentation is available at Shadow.php
* Description: Properties to draw a shadow
* @copyright (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
* Shadow constructor, defines initial size and color
public function Shadow($c, $size=- 1, $color= null) {
* Assigns characteristics of Shadow '$value'.<br>
* Copies all properties from Source Shadow to Self.
public function assign($value) {
$this->height = $value->height;
$this->width = $value->width;
$this->bBrush->assign($value->bBrush);
* Defines the shadow Color. Gets or sets Color used to fill shadow.
return $this->bBrush->getColor();
* Defines the shadow Color. Gets or sets Color used to fill shadow.
$this->bBrush->setColor($value);
* The Transparency level from 0 to 100% of shadow.<br>
* Transparency is a $value between 0 and 100 which sets the transparency
* percentage with respect to foreground versus background for the shadow.
return $this->bBrush->getTransparency();
* Sets Transparency level from 0 to 100% of shadow.<br>
$this->bBrush->setTransparency($value);
* The vertical displacement of the shadow in pixels.
* Sets the vertical displacement of the shadow in pixels.
* <pre><font face="Courier" size="4">
* pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
* pieSeries.getMarks().setVisible(true);
* pieSeries.getShadow().setVisible(true);
* pieSeries.getShadow().setWidth(30);
* pieSeries.getShadow().setHeight(50);
* pieSeries.getShadow().setColor(Color.SILVER);
* pieSeries.fillSampleValues(9);
* Obsolete. Please use Width property.
* Obsolete. Please use Width property.
* Obsolete. Please use Height property.
* Obsolete. Please use Height property.
* The horizontal shadow size in pixels.
* Sets the horizontal shadow size in pixels.
* <pre><font face="Courier" size="4">
* pieSeries = new com.steema.teechart.styles.Pie(myChart.getChart());
* pieSeries.getMarks().setVisible(true);
* pieSeries.getShadow().setVisible(true);
* pieSeries.getShadow().setWidth(30);
* pieSeries.getShadow().setHeight(50);
* pieSeries.getShadow().setColor(Color.SILVER);
* pieSeries.fillSampleValues(9);
* Defines the Brush characteristics to fill the shadow.
* Size in pixels of shadow.<br>
* Returns the biggest of the HorizSize and VertSize properties.
* When setting Size, it will set both HorizSize and VertSize to the
return new Dimension($this->width, $this->height);
* Sets both horizontal and vertical shadow size to same $value.
* Size in pixels of shadow.<br>
* @param $value Dimension
/* public function setSize($value) {
$this->width = $value->width;
$this->height = $value->height;
* Determines whether the shadow will appear on screen.
* Determines whether the shadow will appear on screen.
* Draws a shadow around the Rect rectangle parameter, using the ACanvas
* Uses the Height, Width and Transparency properties to draw the shadow.
public function _draw($g, $rect) {
$this->draw($g, $rect, 0, 0);
* Draws a shadow around the Rect rectangle parameter.<br>
* Uses the Height, Width and Transparency properties to draw the shadow.
public function draw($g, $rect, $angle= 0, $aZ= 0) {
//TChart::$controlName .='Shadow';
if (($this->height != 0) || ($this->width != 0)) {
$g->getPen()->setVisible(false);
$bottom = new Rectangle($rect->getLeft() + $this->width, $rect->getBottom(), ($rect->getRight()- $rect->getLeft()) , $this->height);
$right = new Rectangle($rect->getRight(), $rect->getTop() + $this->height, $this->width, ($rect->getBottom()- $rect->getTop()) - $this->height);
$g->polygon($aZ,$g->rotateRectangle($bottom,$angle));
$g->polygon($aZ,$g->rotateRectangle($right,$angle));
/* Pep Changed to fix when legend have transparency
Rectangle tmp = new Rectangle(rect);
tmp.translate(width, height);
g.polygon(aZ, g.rotateRectangle(tmp, angle));
|