3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
\r
6 * Image_Graph - PEAR PHP OO Graph Rendering Utility.
\r
8 * PHP versions 4 and 5
\r
10 * LICENSE: This library is free software; you can redistribute it and/or modify
\r
11 * it under the terms of the GNU Lesser General Public License as published by
\r
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
\r
13 * option) any later version. This library is distributed in the hope that it
\r
14 * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
\r
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
\r
16 * General Public License for more details. You should have received a copy of
\r
17 * the GNU Lesser General Public License along with this library; if not, write
\r
18 * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
\r
22 * @package Image_Graph
\r
23 * @subpackage Figure
\r
24 * @author Jesper Veggerby <pear.nosey@veggerby.dk>
\r
25 * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
\r
26 * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
\r
27 * @version CVS: $Id: Rectangle.php,v 1.9 2005/08/24 20:36:01 nosey Exp $
\r
28 * @link http://pear.php.net/package/Image_Graph
\r
32 * Include file Image/Graph/Element.php
\r
34 require_once 'Image/Graph/Element.php';
\r
37 * Rectangle to draw on the canvas
\r
40 * @package Image_Graph
\r
41 * @subpackage Figure
\r
42 * @author Jesper Veggerby <pear.nosey@veggerby.dk>
\r
43 * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
\r
44 * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
\r
45 * @version Release: 0.7.2
\r
46 * @link http://pear.php.net/package/Image_Graph
\r
48 class Image_Graph_Figure_Rectangle extends Image_Graph_Element
\r
52 * Rectangle [Construcor]
\r
54 * @param int $x The leftmost pixel of the box on the canvas
\r
55 * @param int $y The topmost pixel of the box on the canvas
\r
56 * @param int $width The width in pixels of the box on the canvas
\r
57 * @param int $height The height in pixels of the box on the canvas
\r
59 function Image_Graph_Figure_Rectangle($x, $y, $width, $height)
\r
61 parent::Image_Graph_Element();
\r
62 $this->_setCoords($x, $y, $x + $width, $y + $height);
\r
68 * @return bool Was the output 'good' (true) or 'bad' (false).
\r
73 if (parent::_done() === false) {
\r
77 $this->_canvas->startGroup(get_class($this));
\r
79 $this->_getFillStyle();
\r
80 $this->_getLineStyle();
\r
81 $this->_canvas->rectangle(
\r
83 'x0' => $this->_left,
\r
84 'y0' => $this->_top,
\r
85 'x1' => $this->_right,
\r
86 'y1' => $this->_bottom
\r
90 $this->_canvas->endGroup();
\r