[ Index ]
 

Code source de Cr@wltr@ck 2.2.1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/graphs/artichow/php4/inc/ -> Tools.class.php (source)

   1  <?php
   2  /*
   3   * This work is hereby released into the Public Domain.
   4   * To view a copy of the public domain dedication,
   5   * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
   6   * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
   7   *
   8   */
   9   
  10  require_once dirname(__FILE__)."/../Graph.class.php";
  11  
  12  /**
  13   * Objects capable of being positioned
  14   *
  15   * @package Artichow
  16   */
  17  
  18  
  19  registerInterface('Positionable');
  20  
  21  /**
  22   * Manage left, right, top and bottom sides
  23   *
  24   * @package Artichow
  25   */
  26  class awSide {
  27  
  28      /**
  29       * Left side
  30       *
  31       * @var int
  32       */
  33      var $left = 0;
  34  
  35      /**
  36       * Right side
  37       *
  38       * @var int
  39       */
  40      var $right = 0;
  41  
  42      /**
  43       * Top side
  44       *
  45       * @var int
  46       */
  47      var $top = 0;
  48  
  49      /**
  50       * Bottom side
  51       *
  52       * @var int
  53       */
  54      var $bottom = 0;
  55      
  56      /**
  57       * Build the side
  58       *
  59       * @param mixed $left
  60       * @param mixed $right
  61       * @param mixed $top
  62       * @param mixed $bottom
  63       */
  64  	 function awSide($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
  65          $this->set($left, $right, $top, $bottom);
  66      }
  67      
  68      
  69      /**
  70       * Change side values
  71       *
  72       * @param mixed $left
  73       * @param mixed $right
  74       * @param mixed $top
  75       * @param mixed $bottom
  76       */
  77  	 function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
  78      
  79          if($left !== NULL) {
  80              $this->left = (float)$left;
  81          }
  82          if($right !== NULL) {
  83              $this->right = (float)$right;
  84          }
  85          if($top !== NULL) {
  86              $this->top = (float)$top;
  87          }
  88          if($bottom !== NULL) {
  89              $this->bottom = (float)$bottom;
  90          }
  91          
  92      }
  93      
  94      
  95      /**
  96       * Add values to each side
  97       *
  98       * @param mixed $left
  99       * @param mixed $right
 100       * @param mixed $top
 101       * @param mixed $bottom
 102       */
 103  	 function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
 104      
 105          if($left !== NULL) {
 106              $this->left += (float)$left;
 107          }
 108          if($right !== NULL) {
 109              $this->right += (float)$right;
 110          }
 111          if($top !== NULL) {
 112              $this->top += (float)$top;
 113          }
 114          if($bottom !== NULL) {
 115              $this->bottom += (float)$bottom;
 116          }
 117          
 118      }
 119  
 120  }
 121  
 122  registerClass('Side');
 123  ?>


Généré le : Thu Sep 6 14:14:11 2007 par Balluche grâce à PHPXref 0.7