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

Source for file ZoomScroll.php

Documentation is available at ZoomScroll.php

  1. <?php
  2.  
  3. /**
  4.   *
  5.   * <p>Title: ZoomScroll class</p>
  6.   * <p>Description: Internal use. Zoom and scroll support.</p>
  7.   * <p>Copyright (c) 2005-2010 by Steema Software SL. All Rights Reserved.</p>
  8.   * <p>Company: Steema Software SL</p>
  9.   */
  10.  
  11.  class ZoomScroll extends TeeBase {
  12.  
  13.     /**
  14.     * Determines if the user is currently zooming or scrolling contents
  15.     * by mouse dragging.
  16.     */
  17.     private $active;
  18.  
  19.     /**
  20.     * Creates a new ZoomScroll class that is asociated to chart parameter.
  21.     *
  22.     * @param value IBaseChart
  23.     */
  24.     public function ZoomScroll($c=null{
  25.         parent::__construct($c);                    
  26.     }
  27.  
  28.     /**
  29.     * Returns the active state of Chart Zoom and Scroll.<br>
  30.     * In other words, during the act of zooming or scrolling returns true.<br>
  31.     * Default value: false
  32.     *
  33.     * @return boolean 
  34.     */
  35.     public function getActive({
  36.         return $this->active;
  37.     }
  38.  
  39.     /**
  40.     * Sets the active state of Chart Zoom and Scroll.<br>
  41.     * Default value: false
  42.     *
  43.     * @param value boolean
  44.     */
  45.     public function setActive($boolean{
  46.         $this->active $this->value;
  47.     }
  48.  
  49.     /**
  50.     * Makes sure x0 and y0 coordinates are lower than x1 and y1 respectively.
  51.     */
  52.     public function check({
  53.  
  54.         if ($this->x0 > $this->x1{
  55.             $tmp $this->x0;
  56.             $this->x0 = $this->x1;
  57.             $this->x1 = $tmp;
  58.         }
  59.  
  60.         if ($this->y0 > $this->y1{
  61.             $tmp $this->y0;
  62.             $this->y0 = $this->y1;
  63.             $this->y1 = $tmp;
  64.         }
  65.     }
  66.  
  67.     /**
  68.     * Initializes a Zoom or Scroll operation starting at Point p coordinates.
  69.     *
  70.     * @param Point
  71.     */
  72.     public function activate($p{
  73.         $this->activateXY($p->x$p->y);
  74.     }
  75.  
  76.     /**
  77.     * Internal use. Starts a Zoom or Scroll from the co-ordinates x and y.
  78.     *
  79.     * @param int
  80.     * @param int
  81.     */
  82.     public function activateXY($x$y{
  83.         $this->x0 = $x;
  84.         $this->y0 = $y;
  85.         $this->x1 = $x;
  86.         $this->y1 = $y;
  87.         $this->active true;
  88.     }
  89.  
  90.     /**
  91.     * Starting horizontal coordinate.
  92.     */
  93.     public $x0;
  94.  
  95.     /**
  96.     * Starting vertical coordinate.
  97.     */
  98.     public $y0;
  99.  
  100.     /**
  101.     * Ending horizontal coordinate.
  102.     */
  103.     public $x1;
  104.  
  105.     /**
  106.     * Ending vertical coordinate.
  107.     */
  108.     public $y1;
  109. }
  110. ?>

Documentation generated on Wed, 16 Jun 2010 12:09:30 +0200 by phpDocumentor 1.4.1