TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file Expand.php

Documentation is available at Expand.php

  1. <?php
  2.  
  3. /**
  4.  * Expand class
  5.  *
  6.  * Description: Expand animation
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage animations
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  
  17.   class Expand extends Animation
  18.   {
  19.  
  20.     private $sizeBy=10;
  21.     private $timer;
  22.     private $steps;
  23.     private $x;
  24.     private $y;
  25.     private $clone;
  26.  
  27.     private $once false;
  28.     private $oldIndex;
  29.     private $actualInterval;
  30.           
  31.     public function Expand($c=null)
  32.     {
  33.       parent::Animation($c);      
  34.       $this->sizeBy 10;
  35.       $this->timer 0// new System.Threading.Timer(new System.Threading.TimerCallback(timer_Tick), null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
  36.       //timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
  37.     }
  38.  
  39.     public function getSizeBy(
  40.     {
  41.         return $this->sizeBy;
  42.     }
  43.  
  44.     public function setSizeBy($value)     
  45.     {
  46.         $this->sizeBy $value;
  47.     }
  48.  
  49.     /// <summary>
  50.     /// Gets descriptive text.
  51.     /// </summary>
  52.     public function getDescription(
  53.     
  54.         return Texts::ExpandAnimation
  55.     }
  56.  
  57.     /// <summary>
  58.     /// Gets detailed descriptive text.
  59.     /// </summary>
  60.     public function getSummary(
  61.     
  62.         return Texts::ExpandSummary;
  63.     }
  64.  
  65.     protected function DoSeriesPointer()
  66.     {
  67.       if (!$this->once)
  68.       {
  69.         $interval MathUtils::round($this->speed $this->sizeBy);
  70.         $this->actualInterval $interval == $this->speed $interval;
  71.         $this->timer->Change(0$this->actualInterval);
  72.       }
  73.       $this->DrawSeriesPointer();
  74.     }
  75.  
  76.     /*
  77.     protected function DoMouseMove($e, $c)
  78.     {
  79.       base.DoMouseMove(e, ref c);
  80.       if (!drawing)
  81.       {
  82.         oldIndex = -1;
  83.       }
  84.     }
  85.  
  86.     protected function DoMouseDown(MouseEventArgs e, ref Cursor c)
  87.     {
  88.       base.DoMouseDown(e, ref c);
  89.       if (!drawing)
  90.       {
  91.         oldIndex = -1;
  92.       }
  93.     }
  94.     */
  95.  
  96.     private function DrawSeriesPointer()
  97.     {
  98.  
  99.       for ($i 0$i $this->chart->series->getCount()$i++)
  100.       {
  101.         if ($this->chart->series[$i=== CustomPoint && ($this->chart->series[$i]->pointer->visible))
  102.         {
  103.           $index $this->chart->series[$i]->clickedPointer($this->P);
  104.           if ($index != -1)
  105.           {
  106.             if ($this->oldIndex == $index)
  107.             {
  108.               $this->once true;
  109.             }
  110.             else
  111.             {            
  112.               $this->$this->$this->steps 0;
  113.               $this->clone null;
  114.               $this->once false;
  115.             }
  116.             if ($this->clone == null$this->clone $this->chart->series[$i]->Pointer->Clone();
  117.             if ($this->== 0$this->$this->chart->series[$i]->calcXPos($index);
  118.             if ($this->== 0$this->$this->chart->series[$i]->calcYPos($index);
  119.             $step (($this->steps $this->actualInterval2);
  120.             $horiz $this->clone->HorizSize $step;
  121.             $vert $this->clone->VertSize $step;
  122.             $this->clone->Draw($this->clone->Chart->Graphics3D$this->clone->Chart->Aspect->View3D
  123.                  $this->x$this->y$horiz$vert$this->clone->Color$this->clone->Style);
  124.             $this->oldIndex $index;
  125.           }
  126.         }
  127.       }
  128.     }
  129.  
  130.     //private delegate void InvalidateDelegate();
  131.  
  132.     private function timer_Tick($sender)
  133.     {
  134.         /*
  135.       if ((steps) < (Speed))
  136.       {
  137.         timer.Change(System.Threading.Timeout.Infinite, actualInterval);
  138.         steps += actualInterval;
  139.         if (Chart.Parent != null)
  140.         {
  141.           Control control = Chart.Parent.GetControl();
  142.           control.Invoke(new InvalidateDelegate(Invalidate)); 
  143.         }
  144.         timer.Change(0, actualInterval);
  145.       }
  146.       else
  147.       {
  148.         timer.Change(System.Threading.Timeout.Infinite, actualInterval);
  149.         if (Chart.Parent != null)
  150.         {
  151.           Control control = Chart.Parent.GetControl();
  152.                     control.Invoke(new InvalidateDelegate(Invalidate)); 
  153.         }
  154.       }  */
  155.     }
  156. }
  157. ?>

Documentation generated on Wed, 16 Jun 2010 12:05:13 +0200 by phpDocumentor 1.4.1