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

Source for file AnimationsCollection.php

Documentation is available at AnimationsCollection.php

  1. <?php
  2.  
  3. /**
  4.  * AnimationsCollection class
  5.  *
  6.  * Description: Animations Collection
  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. class AnimationsCollection extends ArrayObject
  17. {
  18.  
  19.     public $chart;
  20.  
  21.    // Interceptors
  22.     function __get$property {
  23.       $method ="get{$property}";
  24.       if method_exists$this$method ) ) {
  25.         return $this->$method();
  26.       }
  27.     }
  28.  
  29.     function __set $property,$value {
  30.       $method ="set{$property}";
  31.       if method_exists$this$method ) ) {
  32.         return $this->$method($value);
  33.       }
  34.     }
  35.  
  36.    public function AnimationsCollection($c)
  37.    {
  38.       parent::__construct();      
  39.       $this->chart = $c;
  40.    }
  41.          
  42.  
  43.    public function add($animation)
  44.    {
  45.       $animation->setChart($this->chart);
  46.       return $this->internalAdd($animation);
  47.    }
  48.  
  49.    public function internalAdd($animation)
  50.    {
  51.       if($this->indexOf($animation== - 1)
  52.       {
  53.          parent::append($animation);
  54.       }
  55.       return $animation;
  56.    }
  57.             
  58.    public function getAnimation($index)
  59.    {
  60.       return $this->offsetGet($index);
  61.    }
  62.  
  63.    public function setAnimation($index$value)
  64.    {
  65.       $this->set($index$value);
  66.    }
  67.    
  68.    public function indexOf($s)
  69.    {
  70.       for($t 0$t sizeof($this)$t++)
  71.       {
  72.          if($this->getAnimation($t=== $s)
  73.          {
  74.             return $t;
  75.          }
  76.       }
  77.  
  78.       return 1;
  79.    }
  80.  
  81.    public function remove($s)
  82.    {
  83.       $i $this->indexOf($s);
  84.       if($i != - 1)
  85.       {
  86.          $this->remove($i);
  87.          $this->chart->invalidate();
  88.       }
  89.    }
  90.  
  91.  
  92.    /**
  93.    * Sets Chart interface to tools collection
  94.    *
  95.    * @param chart IBaseChart
  96.    */
  97.    public function setChart($chart)
  98.    {
  99.       $this->chart = $chart;
  100.  
  101.       for($t 0$t sizeof($this)$t++)
  102.       {
  103.          $this->getAnimation($t)->setChart($chart);
  104.       }
  105.    }
  106.    
  107.     /*
  108.     /// <summary>
  109.     /// Internal. Exchange animation order.
  110.     /// </summary>
  111.     internal void MoveUp(Animation t1) //CDI - it's a sealed class .. we can forget about protected
  112.     {
  113.       int i = IndexOf(t1);
  114.       if (i > 0)
  115.       {
  116.         Animation tmpTool = ((Animation)chart.Animations[i]);
  117.         RemoveAt(i);
  118.         this.InnerList.Insert(i - 1, tmpTool);
  119.         chart.Invalidate();
  120.       }
  121.     }
  122.  
  123.     /// <summary>
  124.     /// Internal. Exchange animation order.
  125.     /// </summary>
  126.     internal void MoveDown(Animation t1)
  127.     {
  128.       int i = IndexOf(t1);
  129.       if ((i >= 0) && (i < chart.Animations.Count - 1))
  130.       {
  131.         Animation tmpTool = ((Animation)chart.Animations[i]);
  132.         RemoveAt(i);
  133.         if (i == chart.Animations.Count - 1)
  134.           InnerList.Add(tmpTool);
  135.         else
  136.           InnerList.Insert(i + 1, tmpTool);
  137.           chart.Invalidate();
  138.       }
  139.     }
  140.   }
  141.               */
  142.   /// <summary>
  143.   /// Internal use. Animation support EventArgs 
  144.   /// </summary>
  145. //  public class BeforeDrawAxesEventArgs : EventArgs { }
  146.   /// <summary>
  147.   /// Internal use. Animation support EventArgs 
  148.   /// </summary>
  149. //  public class BeforeDrawSeriesEventArgs : EventArgs { }
  150.   /// <summary>
  151.   /// Internal use. Animation support EventArgs 
  152.   /// </summary>
  153. //  public class AfterDrawSeriesEventsArgs : EventArgs { }
  154.   /// <summary>
  155.   /// Internal use. Animation support EventArgs 
  156.   /// </summary>
  157.   //public class BeforeDrawEventArgs : EventArgs { }
  158.   /// <summary>
  159.   /// Internal use. Animation support EventArgs 
  160.   /// </summary>
  161.   //public class AfterDrawEventArgs : EventArgs { }
  162.  
  163. }  
  164. ?>

Documentation generated on Wed, 16 Jun 2010 12:02:27 +0200 by phpDocumentor 1.4.1