Show
Ignore:
Timestamp:
08/30/06 14:48:27 (2 years ago)
Author:
mikey
Message:

moved ColorPrimitivesFactory? out of ColorPrimitives? class file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/ColorPrimitives.php

    r22 r24  
    11<?php 
    22/** 
    3  * @author sschmidt 
    4  * 
    5  * TODO To change the template for this generated type comment go to 
    6  * Window - Preferences - Java - Code Style - Code Templates 
     3 * example class 
     4 *  
     5 * @author  Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
    8 class ColorPrimitivesFactory 
    9 
    10     public static function create($name) 
    11     { 
    12         $colorPrimities = new ColorPrimitives($name); 
    13         return $colorPrimities; 
    14     } 
    15 
    16  
     8/** 
     9 * example class 
     10 *  
     11 * @package     XJConf 
     12 * @subpackage  examples 
     13 */ 
    1714class ColorPrimitives 
    1815{ 
     16    /** 
     17     * the red part of the color 
     18     * 
     19     * @var  int 
     20     */ 
    1921        private $red; 
     22        /** 
     23     * the green part of the color 
     24     * 
     25     * @var  int 
     26     */ 
    2027    private $green; 
     28    /** 
     29     * the blue part of the color 
     30     * 
     31     * @var  int 
     32     */ 
    2133    private $blue; 
    22     private $name = null; 
     34    /** 
     35     * the name of the color 
     36     * 
     37     * @var  int 
     38     */ 
     39    private $name       = null; 
     40    /** 
     41     * the title of the color 
     42     * 
     43     * @var  int 
     44     */ 
    2345    private $colorTitle = null; 
    24  
     46     
     47    /** 
     48     * constructor 
     49     * 
     50     * @var  string  $name  name of the color 
     51     */ 
    2552    public function __construct($name) 
    2653    { 
    2754        $this->name = $name; 
    2855    } 
    29  
     56     
     57    /** 
     58     * set the red part 
     59     * 
     60     * @param  int  $val 
     61     */ 
    3062    public function setRed($val) 
    3163    { 
     
    3365    } 
    3466     
     67    /** 
     68     * set the green part 
     69     * 
     70     * @param  int  $val 
     71     */ 
    3572    public function setGreen($val) { 
    3673        $this->green = $val; 
    3774    } 
    3875     
     76    /** 
     77     * set the blue part 
     78     * 
     79     * @param  int  $val 
     80     */ 
    3981    public function setBlue($val) { 
    4082        $this->blue = $val; 
    4183    } 
    42  
     84     
     85    /** 
     86     * set the title of the color 
     87     * 
     88     * @param  string  $title 
     89     */ 
    4390    public function setColorTitle($title) 
    4491    { 
     
    4693    } 
    4794     
     95    /** 
     96     * get the rgb value as hex 
     97     * 
     98     * @return  string 
     99     */ 
    48100    public function getRGB() 
    49101    { 
     
    51103    } 
    52104     
     105    /** 
     106     * return the name of the color 
     107     * 
     108     * @return  string 
     109     */ 
    53110    public function getName() 
    54111    { 
    55112        return $this->name; 
    56113    } 
    57  
     114     
     115    /** 
     116     * return the title of the color 
     117     * 
     118     * @return  string 
     119     */ 
    58120    public function getColorTitle() 
    59121    { 
     
    61123    } 
    62124     
     125    /** 
     126     * returns string representation 
     127     *  
     128     * @return  string 
     129     */ 
    63130    public function __toString() 
    64131    {