Subversion Repositories Applications.gtt

Compare Revisions

No changes between revisions

Ignore whitespace Rev 60 → Rev 61

/trunk/bibliotheque/artichow/Image.class.php
New file
0,0 → 1,606
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
if(is_file(dirname(__FILE__)."/Artichow.cfg.php")) { // For PHP 4+5 version
require_once dirname(__FILE__)."/Artichow.cfg.php";
}
 
 
 
 
/*
* Register a class with the prefix in configuration file
*/
function registerClass($class, $abstract = FALSE) {
 
if(ARTICHOW_PREFIX === 'aw') {
return;
}
if($abstract) {
$abstract = 'abstract';
} else {
$abstract = '';
}
eval($abstract." class ".ARTICHOW_PREFIX.$class." extends aw".$class." { }");
 
}
 
/*
* Register an interface with the prefix in configuration file
*/
function registerInterface($interface) {
 
if(ARTICHOW_PREFIX === 'aw') {
return;
}
 
eval("interface ".ARTICHOW_PREFIX.$interface." extends aw".$interface." { }");
 
}
 
// Some useful files
require_once ARTICHOW."/Component.class.php";
 
require_once ARTICHOW."/inc/Grid.class.php";
require_once ARTICHOW."/inc/Tools.class.php";
require_once ARTICHOW."/inc/Driver.class.php";
require_once ARTICHOW."/inc/Math.class.php";
require_once ARTICHOW."/inc/Tick.class.php";
require_once ARTICHOW."/inc/Axis.class.php";
require_once ARTICHOW."/inc/Legend.class.php";
require_once ARTICHOW."/inc/Mark.class.php";
require_once ARTICHOW."/inc/Label.class.php";
require_once ARTICHOW."/inc/Text.class.php";
require_once ARTICHOW."/inc/Color.class.php";
require_once ARTICHOW."/inc/Font.class.php";
require_once ARTICHOW."/inc/Gradient.class.php";
require_once ARTICHOW."/inc/Shadow.class.php";
require_once ARTICHOW."/inc/Border.class.php";
 
require_once ARTICHOW."/common.php";
/**
* An image for a graph
*
* @package Artichow
*/
class awImage {
 
/**
* Graph width
*
* @var int
*/
public $width;
 
/**
* Graph height
*
* @var int
*/
public $height;
/**
* Use anti-aliasing ?
*
* @var bool
*/
protected $antiAliasing = FALSE;
/**
* Image format
*
* @var int
*/
protected $format = awImage::PNG;
/**
* Image background color
*
* @var Color
*/
protected $background;
/**
* GD resource
*
* @var resource
*/
protected $resource;
/**
* A Driver object
*
* @var Driver
*/
protected $driver;
/**
* Driver string
*
* @var string
*/
protected $driverString;
/**
* Shadow
*
* @var Shadow
*/
public $shadow;
/**
* Image border
*
* @var Border
*/
public $border;
/**
* Use JPEG for image
*
* @var int
*/
const JPEG = IMG_JPG;
/**
* Use PNG for image
*
* @var int
*/
const PNG = IMG_PNG;
/**
* Use GIF for image
*
* @var int
*/
const GIF = IMG_GIF;
/**
* Build the image
*/
public function __construct() {
$this->background = new awColor(255, 255, 255);
$this->shadow = new awShadow(awShadow::RIGHT_BOTTOM);
$this->border = new awBorder;
}
/**
* Get driver of the image
*
* @param int $w Driver width (from 0 to 1) (default to 1)
* @param int $h Driver height (from 0 to 1) (default to 1)
* @param float $x Position on X axis of the center of the driver (default to 0.5)
* @param float $y Position on Y axis of the center of the driver (default to 0.5)
* @return Driver
*/
public function getDriver($w = 1, $h = 1, $x = 0.5, $y = 0.5) {
$this->create();
$this->driver->setSize($w, $h);
$this->driver->setPosition($x, $y);
return $this->driver;
}
/**
* Sets the driver that will be used to draw the graph
*
* @param string $driverString
*/
public function setDriver($driverString) {
$this->driver = $this->selectDriver($driverString);
$this->driver->init($this);
}
/**
* Change the image size
*
* @var int $width Image width
* @var int $height Image height
*/
public function setSize($width, $height) {
if($width !== NULL) {
$this->width = (int)$width;
}
if($height !== NULL) {
$this->height = (int)$height;
}
}
/**
* Change image background
*
* @param mixed $background
*/
public function setBackground($background) {
if($background instanceof awColor) {
$this->setBackgroundColor($background);
} elseif($background instanceof awGradient) {
$this->setBackgroundGradient($background);
}
}
/**
* Change image background color
*
* @param awColor $color
*/
public function setBackgroundColor(awColor $color) {
$this->background = $color;
}
/**
* Change image background gradient
*
* @param awGradient $gradient
*/
public function setBackgroundGradient(awGradient $gradient) {
$this->background = $gradient;
}
/**
* Return image background, whether a Color or a Gradient
*
* @return mixed
*/
public function getBackground() {
return $this->background;
}
/**
* Turn antialiasing on or off
*
* @var bool $bool
*/
public function setAntiAliasing($bool) {
$this->antiAliasing = (bool)$bool;
}
/**
* Return the antialiasing setting
*
* @return bool
*/
public function getAntiAliasing() {
return $this->antiAliasing;
}
/**
* Change image format
*
* @var int $format New image format
*/
public function setFormat($format) {
if($format === awImage::JPEG or $format === awImage::PNG or $format === awImage::GIF) {
$this->format = $format;
}
}
/**
* Returns the image format as an integer
*
* @return unknown
*/
public function getFormat() {
return $this->format;
}
/**
* Returns the image format as a string
*
* @return string
*/
public function getFormatString() {
switch($this->format) {
case awImage::JPEG :
return 'jpeg';
case awImage::PNG :
return 'png';
case awImage::GIF :
return 'gif';
}
}
 
/**
* Create a new awimage
*/
public function create() {
 
if($this->driver === NULL) {
$driver = $this->selectDriver($this->driverString);
 
$driver->init($this);
$this->driver = $driver;
}
 
}
/**
* Select the correct driver
*
* @param string $driver The desired driver
* @return mixed
*/
protected function selectDriver($driver) {
$drivers = array('gd');
$driver = strtolower((string)$driver);
 
if(in_array($driver, $drivers, TRUE)) {
$string = $driver;
} else {
$string = ARTICHOW_DRIVER;
}
 
switch ($string) {
case 'gd':
require_once ARTICHOW.'/inc/drivers/gd.class.php';
$this->driverString = $string;
return new awGDDriver();
default:
// We should never get here, unless the wrong string is used AND the ARTICHOW_DRIVER
// global has been messed with.
awImage::drawError('Class Image: Unknown driver type (\''.$string.'\')');
break;
}
}
/**
* Draw a component on the image
*
* @var awComponent $component A component
*/
public function drawComponent(awComponent $component) {
$shadow = $this->shadow->getSpace(); // Image shadow
$border = $this->border->visible() ? 1 : 0; // Image border size
$driver = clone $this->driver;
$driver->setImageSize(
$this->width - $shadow->left - $shadow->right - $border * 2,
$this->height - $shadow->top - $shadow->bottom - $border * 2
);
// No absolute size specified
if($component->w === NULL and $component->h === NULL) {
list($width, $height) = $driver->setSize($component->width, $component->height);
// Set component size in pixels
$component->setAbsSize($width, $height);
} else {
$driver->setAbsSize($component->w, $component->h);
}
if($component->top !== NULL and $component->left !== NULL) {
$driver->setAbsPosition(
$border + $shadow->left + $component->left,
$border + $shadow->top + $component->top
);
} else {
$driver->setPosition($component->x, $component->y);
}
$driver->movePosition($border + $shadow->left, $border + $shadow->top);
list($x1, $y1, $x2, $y2) = $component->getPosition();
$component->init($driver);
$component->drawComponent($driver, $x1, $y1, $x2, $y2, $this->antiAliasing);
$component->drawEnvelope($driver, $x1, $y1, $x2, $y2);
$component->finalize($driver);
}
protected function drawShadow() {
$driver = $this->getDriver();
$this->shadow->draw(
$driver,
new awPoint(0, 0),
new awPoint($this->width, $this->height),
awShadow::IN
);
}
/**
* Send the image into a file or to the user browser
*
*/
public function send() {
$this->driver->send($this);
}
/**
* Return the image content as binary data
*
*/
public function get() {
return $this->driver->get($this);
}
/**
* Send the correct HTTP header according to the image type
*
*/
public function sendHeaders() {
 
if(headers_sent() === FALSE) {
switch ($this->driverString) {
case 'gd' :
header('Content-type: image/'.$this->getFormatString());
break;
}
 
}
}
private static $errorWriting = FALSE;
 
/*
* Display an error image and exit
*
* @param string $message Error message
*/
public static function drawError($message) {
if(self::$errorWriting) {
return;
}
self::$errorWriting = TRUE;
$message = wordwrap($message, 40, "\n", TRUE);
$width = 400;
$height = max(100, 40 + 22.5 * (substr_count($message, "\n") + 1));
$image = new awImage();
$image->setSize($width, $height);
$image->setDriver('gd');
$driver = $image->getDriver();
$driver->init($image);
// Display title
$driver->filledRectangle(
new awWhite,
new awLine(
new awPoint(0, 0),
new awPoint($width, $height)
)
);
$driver->filledRectangle(
new awRed,
new awLine(
new awPoint(0, 0),
new awPoint(110, 25)
)
);
$text = new awText(
"Artichow error",
new awFont3,
new awWhite,
0
);
$driver->string($text, new awPoint(5, 6));
// Display red box
$driver->rectangle(
new awRed,
new awLine(
new awPoint(0, 25),
new awPoint($width - 90, $height - 1)
)
);
// Display error image
$file = ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.'error.png';
$imageError = new awFileImage($file);
$driver->copyImage(
$imageError,
new awPoint($width - 81, $height - 81),
new awPoint($width - 1, $height - 1)
);
// Draw message
$text = new awText(
strip_tags($message),
new awFont2,
new awBlack,
0
);
$driver->string($text, new awPoint(10, 40));
$image->send();
exit;
}
/*
* Display an error image located in a file and exit
*
* @param string $error Error name
*/
public static function drawErrorFile($error) {
$file = ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.'errors'.DIRECTORY_SEPARATOR.$error.'.png';
header("Content-Type: image/png");
readfile($file);
exit;
}
 
}
 
registerClass('Image');
 
/**
* Load an image from a file
*
* @package Artichow
*/
class awFileImage extends awImage {
 
/**
* Build a new awimage
*
* @param string $file Image file name
*/
public function __construct($file) {
$driver = $this->selectDriver($this->driverString);
$driver->initFromFile($this, $file);
$this->driver = $driver;
}
 
}
 
registerClass('FileImage');
 
?>
/trunk/bibliotheque/artichow/examples/pie-014.php
New file
0,0 → 1,48
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
function createPie($values, $title, $x, $y) {
$plot = new Pie($values);
$plot->title->set($title);
$plot->title->setFont(new TuffyBold(8));
$plot->title->move(NULL, -12);
$plot->label->setFont(new Tuffy(7));
$plot->legend->hide(TRUE);
$plot->setLabelPosition(5);
$plot->setSize(0.40, 0.40);
$plot->setCenter($x, $y);
$plot->setBorderColor(new Black);
return $plot;
 
}
 
$graph = new Graph(400, 400);
$graph->setAntiAliasing(TRUE);
 
$plot = createPie(array(1, 4, 5, 2, 3), "Cowléoptère", 0.22, 0.25);
$graph->add($plot);
 
$plot = createPie(array(1, 9, 1, 2, 1), "Asticow", 0.66, 0.25);
$graph->add($plot);
 
$plot = createPie(array(5, 7, 8, 6, 3), "Cowlibri", 0.22, 0.75);
$graph->add($plot);
 
$plot = createPie(array(6, 4, 6, 5, 6), "Bourricow", 0.66, 0.75);
$plot->legend->hide(FALSE); // We print only one legend
$plot->legend->setPosition(1.25, 0);
$graph->add($plot);
 
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/champignon.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/examples/champignon.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/examples/pie-015.php
New file
0,0 → 1,50
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 300);
$graph->setBackgroundGradient(
new LinearGradient(
new VeryLightGray,
new White,
0
)
);
$graph->title->set("Pie (example 15) - Arbitrary labels");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.6, 0.6 * 4 / 3);
 
$plot->label->set(array(
'Arthur', 'Abel', 'Bernard', 'Thierry', 'Paul', 'Gaston', 'Joe'
));
$plot->label->setCallbackFunction(NULL); // We must disable the default callback function
 
$plot->setLegend(array(
'ABC',
'DEF',
'GHI',
'JKL',
'MNO',
'PQR',
'STU'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-016.php
New file
0,0 → 1,45
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 13) - Adjusting labels");
 
$values = array(16, 9, 13, 23, 10);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setAbsSize(220, 220);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->setLabelPosition(-40);
$plot->label->setPadding(2, 2, 2, 2);
$plot->label->setFont(new Tuffy(7));
$plot->label->setBackgroundColor(new White(60));
 
$plot->legend->setPosition(1.3);
$plot->legend->shadow->setSize(0);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-017.php
New file
0,0 → 1,48
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 17)");
$graph->title->setFont(new Tuffy(14));
 
$values = array(12, 16, 13, 18, 10, 20, 11);
 
$plot = new Pie($values, Pie::AQUA);
$plot->setCenter(0.4, 0.55);
$plot->setAbsSize(180, 180);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$explode = array();
for($i = 0; $i < count($values); $i++) {
$explode[] = 15;
}
 
$plot->explode($explode);
 
$plot->legend->setPosition(1.5);
$plot->legend->shadow->setSize(0);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-018.php
New file
0,0 → 1,32
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 18) - Display labels > 10 %");
$graph->title->setFont(new Tuffy(14));
 
$values = array(1, 5, 6, 16, 18, 19, 21, 3, 4, 7, 6);
 
$plot = new Pie($values);
$plot->setCenter(0.4, 0.55);
$plot->setAbsSize(180, 180);
$plot->setLabelMinimum(10);
 
$plot->legend->setPosition(1.5);
$plot->legend->shadow->setSize(0);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/line-010.php
New file
0,0 → 1,46
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
$graph = new Graph(375, 200);
 
// Set title
$graph->title->set('Star marks');
$graph->title->setFont(new Tuffy(12));
$graph->title->setColor(new DarkRed);
 
$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7));
 
// Change plot size and position
$plot->setSize(0.76, 1);
$plot->setCenter(0.38, 0.5);
 
$plot->setPadding(30, 15, 38, 25);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
 
// Change grid style
$plot->grid->setType(Line::DASHED);
 
// Add customized marks
$plot->mark->setType(Mark::STAR);
$plot->mark->setFill(new MidRed);
$plot->mark->setSize(6);
 
// Change legend
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(Legend::LEFT);
$plot->legend->shadow->smooth(TRUE);
 
$plot->legend->add($plot, 'My line', Legend::MARK);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/math-001.php
New file
0,0 → 1,23
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
$plot = new MathPlot(-3, 3, 3, -3);
$plot->setInterval(0.1);
 
$function = new MathFunction('cos');
$plot->add($function);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/math-002.php
New file
0,0 → 1,36
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
// Set graph title
$graph->title->set('f(x) = x * x');
$graph->title->setBackgroundColor(new White(0));
$graph->title->setPadding(NULL, NULL, 10, 10);
$graph->title->move(0, -10);
 
$plot = new MathPlot(-3, 3, 10, -2);
$plot->setInterval(0.2);
$plot->setPadding(NULL, NULL, NULL, 20);
 
// Defines x²
function x2($x) {
return $x * $x;
}
 
$function = new MathFunction('x2');
$function->setColor(new Orange);
$plot->add($function);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/test/error.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/examples/test/error.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/examples/test/error-box.php
New file
0,0 → 1,69
<?php
 
require_once "../../Graph.class.php";
 
 
$message = "Missing imageantialias() function.\nCheck your PHP installation.";
 
 
$message = wordwrap($message, 48, "\n", TRUE);
 
$width = 400;
$height = max(90, 50 + 13 * (substr_count($message, "\n") + 1));
 
$graph = new Graph($width, $height);
 
$driver = $graph->getDriver();
 
// Display title
$driver->filledRectangle(
new White,
new Line(
new Point(0, 0),
new Point($width, $height)
)
);
 
$driver->filledRectangle(
new Red,
new Line(
new Point(0, 0),
new Point(110, 25)
)
);
 
$text = new Text(
"Artichow error",
new Font3,
new White,
0
);
 
$driver->string($text, new Point(5, 6));
 
// Display red box
$driver->rectangle(
new Red,
new Line(
new Point(0, 25),
new Point($width - 90, $height - 1)
)
);
 
// Display error image
$image = new FileImage('error.png');
$driver->copyImage($image, new Point($width - 81, $height - 81), new Point($width - 1, $height - 1));
 
// Draw message
$text = new Text(
$message,
new Font2,
new Black,
0
);
 
$driver->string($text, new Point(10, 40));
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/test/multi-line-text.php
New file
0,0 → 1,37
<?php
 
require_once "../../Graph.class.php";
 
$graph = new Graph(400, 600);
 
$driver = $graph->getDriver();
 
$driver->filledRectangle(
new Red,
new Line(
new Point(200, 0),
new Point(200, 600)
)
);
 
$text = new Text(
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean gravida quam semper nibh. Sed orci. Aenean ullamcorper magna eget odio. Sed nonummy ante sit amet sapien.\nPhasellus nulla dui, aliquet vel, adipiscing vel, vulputate sed, velit.\nSed at neque vel ipsum commodo hendrerit.\nA. Nonyme",
new Tuffy(mt_rand(10, 15)),
new Color(mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100)),
0
);
 
$driver->string($text, new Point(0, 0), 200);
 
$text = new Text(
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean gravida quam semper nibh. Sed orci. Aenean ullamcorper magna eget odio. Sed nonummy ante sit amet sapien.\nPhasellus nulla dui, aliquet vel, adipiscing vel, vulputate sed, velit.\nSed at neque vel ipsum commodo hendrerit.\nA. Nonyme",
new Font(mt_rand(2, 4)),
new Color(mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100)),
0
);
 
$driver->string($text, new Point(0, 400), 200);
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/test/set-label-text-error.php
New file
0,0 → 1,58
<?php
require_once '../../BarPlot.class.php';
 
$graph = new Graph(600, 200);
$graph->setAntiAliasing(TRUE);
 
$values = array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0);
 
$plot = new BarPlot($values);
$plot->setBarColor(
new Color(234, 236, 255)
);
$plot->setSpace(5, 5, NULL, NULL);
 
$plot->barShadow->setSize(3);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
 
 
$mois = array ('Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Juil', 'Août', 'Sept', 'Oct', 'Nov', 'Déc');
$label = array ();
foreach ($mois as $m) { $label []= $m; }
$label []= ' ';
foreach ($mois as $m) { $label []= $m; }
 
 
$plot->xAxis->setLabelText($label);
 
/* ICI */
 
$max = array_max($values);
$yValues = array();
for($i=0; $i<= $max; $i++) {
$yValues[]=$i;
}
$plot->yAxis->setLabelText($yValues);
 
// Image::drawError(var_export($yValues, TRUE));
$plot->yAxis->setLabelText($yValues);
 
$plot->setPadding(30,5,20,15);
 
$labelAvant = new Label("2005");
$labelAvant->setFont (new TTFFont(ARTICHOW_FONT.'/TuffyBold.ttf', 12));
$labelAvant->move (180,10);
 
$labelMaintenant = new Label("2006");
$labelMaintenant->setFont (new TTFFont(ARTICHOW_FONT.'/TuffyBold.ttf', 12));
$labelMaintenant->move (450,10);
 
$graph->add($plot);
$graph->addLabel($labelAvant, 0, 0);
$graph->addLabel($labelMaintenant, 0, 0);
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/math-003.php
New file
0,0 → 1,33
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
$plot = new MathPlot(-3, 3, 20, -1);
$plot->setInterval(0.2);
$plot->setPadding(NULL, NULL, NULL, 20);
 
$plot->yAxis->setLabelInterval(4);
 
$function = new MathFunction('exp');
$function->setColor(new DarkRed);
$function->mark->setType(Mark::SQUARE);
$function->mark->setSize(3);
$function->mark->setFill(new DarkBlue);
$plot->add($function, "f(x) = exp(x)", Legend::MARK);
 
$plot->legend->setPosition(0.4, 0.2);
$plot->legend->setPadding(3, 3, 3, 3, 3);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/math-004.php
New file
0,0 → 1,39
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
$plot = new MathPlot(-3, 3, 10, -3);
$plot->setInterval(0.2);
$plot->setPadding(NULL, NULL, NULL, 20);
 
$function = new MathFunction('exp');
$function->setColor(new DarkRed);
$function->mark->setType(Mark::SQUARE);
$function->mark->setSize(3);
$function->mark->setFill(new DarkBlue);
$plot->add($function, "f(x) = exp(x)", Legend::MARK);
 
function x2($x) {
return - $x * $x;
}
 
$function = new MathFunction('x2');
$function->setColor(new DarkBlue);
$plot->add($function, "f(x) = - x * x");
 
$plot->legend->setPosition(0.4, 0.4);
$plot->legend->setPadding(3, 3, 3, 3, 3);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/math-005.php
New file
0,0 → 1,34
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
$plot = new MathPlot(-3, 3, 2, -3);
$plot->setInterval(0.05);
 
$function = new MathFunction('sqrt', 0);
$plot->add($function, "sqrt(x)");
 
function x2($x) {
return - $x * $x;
}
 
$function = new MathFunction('sin', -2, 2);
$function->setColor(new DarkBlue);
$plot->add($function, "sin(x) (-2 < x < 2)");
 
$plot->legend->setPosition(0.98, 0.8);
$plot->legend->setTextFont(new Tuffy(8));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/bar-001.php
New file
0,0 → 1,30
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../BarPlot.class.php";
 
$graph = new Graph(400, 400);
$graph->title->set('The title');
$graph->border->setStyle(Line::DASHED);
$graph->border->setColor(new DarkGray);
 
$values = array(19, 42, 15, -25, 3);
 
$plot = new BarPlot($values);
$plot->setSize(1, 0.96);
$plot->setCenter(0.5, 0.52);
 
$plot->setBarColor(
new VeryLightPurple(25)
);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/bar-002.php
New file
0,0 → 1,37
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../BarPlot.class.php";
 
$graph = new Graph(400, 400);
 
$values = array(2, 6, 3, 2, 4);
 
$plot = new BarPlot($values);
 
$plot->setBarGradient(
new LinearGradient(
new LightBlue(25),
new VeryLightOrange(25),
90
)
);
 
$plot->setSpace(5, 5, NULL, NULL);
 
$plot->barShadow->setSize(4);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
 
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/bar-003.php
New file
0,0 → 1,37
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../BarPlot.class.php";
 
$graph = new Graph(400, 400);
$graph->title->set('Two bars');
 
$values = array(12, 8, 13, 2, 4);
 
$group = new PlotGroup;
$group->setPadding(NULL, NULL, 35, NULL);
 
$plot = new BarPlot($values, 1, 2);
$plot->setBarColor(new LightBlue(25));
$plot->setBarSpace(5);
 
$group->add($plot);
 
$values = array(1, 7, 2, 10, 6);
 
$plot = new BarPlot($values, 2, 2);
$plot->setBarColor(new LightOrange(25));
$plot->setBarSpace(5);
 
$group->add($plot);
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/bar-004.php
New file
0,0 → 1,36
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../BarPlot.class.php";
 
$graph = new Graph(400, 400);
$graph->title->set('Two bars with depth');
 
$group = new PlotGroup;
$group->setPadding(NULL, NULL, 35, NULL);
$group->setSpace(5, 5, NULL, NULL);
 
$group->grid->hide(TRUE);
 
$values = array(1, 7, 2, 10, 6, 3, 4, 7);
 
$plot = new BarPlot($values, 1, 1, 5);
$plot->setBarColor(new LightBlue(25));
$group->add($plot);
 
$values = array(12, 8, 13, 2, 4, 8, 4, 3);
 
$plot = new BarPlot($values, 1, 1, 0);
$plot->setBarColor(new LightRed(25));
$group->add($plot);
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/bar-005.php
New file
0,0 → 1,59
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../BarPlot.class.php";
 
$graph = new Graph(400, 400);
 
// Set a title to the graph
$graph->title->set('The title');
 
// Change graph background color
$graph->setBackgroundColor(new Color(230, 230, 230));
 
$values = array(8, 2, 6, 1, 3, 5);
 
// Declare a new BarPlot
$plot = new BarPlot($values);
 
// Reduce padding around the plot
$plot->setPadding(NULL, NULL, NULL, 20);
 
// Reduce plot size and move it to the bottom of the graph
$plot->setSize(1, 0.96);
$plot->setCenter(0.5, 0.52);
 
// Set a background color to the plot
$plot->grid->setBackgroundColor(new White);
// Set a dashed grid
$plot->grid->setType(Line::DASHED);
 
 
$plot->label->set($values);
$plot->label->move(0, -10);
$plot->label->setColor(new DarkBlue);
 
// Set a shadow to the bars
$plot->barShadow->setSize(2);
 
// Bar size is at 60%
$plot->setBarSize(0.6);
 
// Change the color of the bars
$plot->setBarColor(
new Orange(15)
);
 
// Add the plot to the graph
$graph->add($plot);
 
// Draw the graph
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/all.php
New file
0,0 → 1,55
<?php
function table($files, $re = NULL) {
 
echo "<table cellpadding='4'>";
 
foreach($files as $key => $file) {
 
if($key%2 == 0) {
echo "<tr>";
}
 
if($re === NULL or eregi($re, $file)) {
image($file);
}
 
if($key%2 == 1) {
echo "</tr>";
}
 
 
}
 
if($key%2 == 0) {
echo "</tr>";
}
 
echo "</table>";
 
}
 
function image($file) {
echo "<td>
<h3>".$file."</h3>
<a href='".$file."'><img src='".$file."' style='border: 0px'/></a>
</td>";
}
?>
<h2>Artichow examples</h2>
<?php
$glob = glob("*.php");
 
table($glob, "[a-z]+\-[0-9]{3}\.php");
?>
<h2>Artichow.org examples</h2>
<?php
$glob = glob("site/*.php");
 
table($glob);
?>
<h2>Artichow tutorials</h2>
<?php
$glob = glob("tutorials/*.php");
 
table($glob);
?>
/trunk/bibliotheque/artichow/examples/pattern-001.php
New file
0,0 → 1,26
<?php
require_once "../Pattern.class.php";
require_once "../Graph.class.php";
 
$graph = new Graph(300, 200);
 
// Set title
$graph->title->set('Pattern 1');
$graph->title->move(100, 0);
$graph->title->setFont(new Tuffy(9));
$graph->title->setColor(new DarkRed);
 
$pattern = Pattern::get('BarDepth');
$pattern->setArgs(array(
'yForeground' => array(5, 3, 4, 7, 6, 5, 8, 4, 7, NULL, NULL),
'yBackground' => array(NULL, NULL, 4, 5, 6, 4, 2, 3, 7, 5, 4),
'legendForeground' => '2003',
'legendBackground' => '2004'
));
 
$group = $pattern->create();
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-001.php
New file
0,0 → 1,40
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
 
$graph->title->set("Pie (example 1)");
 
$values = array(12, 5, 13, 18, 10, 6, 11);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->shadow->setSize(0);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pattern-002.php
New file
0,0 → 1,24
<?php
require_once "../Pattern.class.php";
require_once "../Graph.class.php";
 
$graph = new Graph(300, 200);
 
$graph->title->set('Customized pattern 1');
$graph->title->setFont(new Tuffy(12));
 
$pattern = Pattern::get('BarDepth');
$pattern->setArgs(array(
'yForeground' => array(5, 3, 4, 7, 6, 5, 8, 4, 7, NULL, NULL),
'yBackground' => array(NULL, NULL, 4, 5, 6, 4, 2, 3, 7, 5, 4),
'colorForeground' => new Color(230, 230, 230),
'colorBackground' => new Color(250, 90, 90)
));
 
$group = $pattern->create();
$group->legend->setPosition(0.5, 0.78);
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-002.php
New file
0,0 → 1,41
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 2)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->explode(array(1 => 20, 4 => 26, 0 => 25));
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/AntiSpam.php
New file
0,0 → 1,14
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
?>
<form action="AntiSpam-valid.php" method="get">
<img src="AntiSpam-image.php" style="vertical-align: middle"/>
<input type="text" name="code"/>
<input type="submit" value="Submit"/>
</form>
/trunk/bibliotheque/artichow/examples/pie-003.php
New file
0,0 → 1,42
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 3)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::AQUA);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(15);
$plot->explode(array(4 => 20, 0 => 30));
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pattern-003.php
New file
0,0 → 1,23
<?php
require_once "../Pattern.class.php";
require_once "../Graph.class.php";
 
$graph = new Graph(400, 200);
 
// Set title
$graph->title->set('Pattern 2');
$graph->title->setFont(new Tuffy(12));
$graph->title->setColor(new DarkRed);
 
$pattern = Pattern::get('LightLine');
$pattern->setArgs(array(
'y' => array(5, 3, 4, 7, 6, 5, 8, 4, 7),
'legend' => 'John Doe'
));
 
$plot = $pattern->create();
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-004.php
New file
0,0 → 1,50
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setBackgroundGradient(
new LinearGradient(
new White,
new VeryLightGray,
0
)
);
$graph->title->set("Pie (example 4)");
$graph->shadow->setSize(7);
$graph->shadow->smooth(TRUE);
$graph->shadow->setPosition(Shadow::LEFT_BOTTOM);
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
 
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-005.php
New file
0,0 → 1,47
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setBackgroundGradient(
new LinearGradient(
new VeryLightGray,
new White,
0
)
);
$graph->title->set("Pie (example 5) - Initial angle: 140°");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->setStartAngle(140);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-006.php
New file
0,0 → 1,37
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setBackgroundGradient(
new LinearGradient(
new VeryLightGray,
new White,
0
)
);
$graph->title->set("Pie (example 6)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values);
$plot->setCenter(0.5, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(5);
$plot->setBorderColor(new Black);
 
 
$plot->legend->hide(TRUE);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-007.php
New file
0,0 → 1,56
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 7)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::DARK);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(5);
$plot->setBorderColor(new White);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
$plot->legend->shadow->setPosition(Shadow::RIGHT_TOP);
 
$plot->label->setPadding(2, 2, 2, 2);
$plot->label->border->setColor(new Red(60));
$plot->label->setFont(new Tuffy(7));
$plot->label->setBackgroundGradient(
new LinearGradient(
new Red(80),
new White(80),
0
)
);
$plot->setLabelPrecision(1);
 
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-008.php
New file
0,0 → 1,54
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 8)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setSize(0.85, 0.60);
$plot->set3D(15);
$plot->setBorderColor(new LightGray);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->shadow->setSize(3);
$plot->legend->setModel(Legend::MODEL_BOTTOM);
$plot->legend->setPosition(NULL, 1.1);
 
$plot->label->setPadding(2, 2, 2, 2);
$plot->label->border->setColor(new Red(60));
$plot->label->setFont(new Tuffy(7));
$plot->label->setBackgroundGradient(
new LinearGradient(
new Red(80),
new White(80),
0
)
);
$plot->setLabelPrecision(1);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-009.php
New file
0,0 → 1,49
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 9) - User defined colors");
$graph->title->border->show();
$graph->title->setBackgroundColor(new LightRed(60));
$graph->title->setPadding(3, 3, 3, 3);
 
$values = array(8, 4, 6, 3, 4);
$colors = array(
new LightOrange,
new LightPurple,
new LightBlue,
new LightRed,
new LightPink
);
 
$plot = new Pie($values, $colors);
$plot->setSize(0.70, 0.60);
$plot->setCenter(0.40, 0.55);
$plot->set3D(10);
$plot->setBorderColor(new LightGray);
 
$plot->setLegend(array(
'Alpha',
'Beta',
'Gamma',
'Delta',
'Epsilon'
));
 
$plot->legend->setPosition(1.30);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/line-001.php
New file
0,0 → 1,29
<?php
 
require_once "../LinePlot.class.php";
 
$graph = new Graph(400, 400);
 
$x = array(1, 10, 3,-4, 1);
 
$plot = new LinePlot($x);
$plot->setSpace(6, 6, 10, 10);
 
$plot->hideLine(TRUE);
$plot->setFillColor(new Color(180, 180, 180, 75));
 
$plot->mark->setType(Mark::IMAGE);
$plot->mark->setImage(new FileImage("champignon.png"));
 
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
 
$plot->label->set($x);
$plot->label->move(0, -23);
$plot->label->setBackgroundGradient(new LinearGradient(new Color(250, 250, 250, 10), new Color(255, 200, 200, 30), 0));
$plot->label->border->setColor(new Color(20, 20, 20, 20));
$plot->label->setPadding(3, 1, 1, 0);
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/line-002.php
New file
0,0 → 1,52
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 0.5, 3, 8
);
 
$plot = new LinePlot($x);
 
$plot->setSpace(6, 6, 10, 10);
$plot->setXAxisZero(FALSE);
 
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
 
// Change line color
$plot->setColor(new Color(0, 0, 150, 20));
 
// Set line background gradient
$plot->setFillGradient(
new LinearGradient(
new Color(150, 150, 210),
new Color(230, 230, 255),
90
)
);
 
// Change mark type
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->border->show();
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-003.php
New file
0,0 → 1,44
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4
);
 
$plot = new LinePlot($x);
 
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
 
// Set semi-transparent background gradient
$plot->setFillGradient(
new LinearGradient(
new Color(230, 150, 150, 20),
new Color(230, 230, 180, 50),
90
)
);
 
$plot->yAxis->setLabelPrecision(1);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-004.php
New file
0,0 → 1,59
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4
);
 
$plot = new LinePlot($x);
 
// Change component padding
$plot->setPadding(10, NULL, NULL, NULL);
 
// Change component space
$plot->setSpace(5, 5, 5, 5);
 
// Set a background color
$plot->setBackgroundColor(
new Color(230, 230, 230)
);
 
// Change grid background color
$plot->grid->setBackgroundColor(
new Color(235, 235, 180, 60)
);
 
// Hide grid
$plot->grid->hide(TRUE);
 
// Hide labels on Y axis
$plot->yAxis->label->hide(TRUE);
 
$plot->xAxis->label->setInterval(2);
 
$plot->label->set($x);
$plot->label->setFormat('%.1f');
$plot->label->setBackgroundColor(new Color(240, 240, 240, 15));
$plot->label->border->setColor(new Color(255, 0, 0, 15));
$plot->label->setPadding(5, 3, 1, 1);
 
$plot->xAxis->label->move(0, 5);
$plot->xAxis->label->setBackgroundColor(new Color(240, 240, 240, 15));
$plot->xAxis->label->border->setColor(new Color(0, 150, 0, 15));
$plot->xAxis->label->setPadding(5, 3, 1, 1);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-005.php
New file
0,0 → 1,36
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
$graph = new Graph(400, 300);
 
$x = array(
-4, -5, -2, -8, -3, 1, 4, 9, 5, 6, 2
);
 
$plot = new LinePlot($x);
 
// Filled an area with a color
$plot->setFilledArea(7, 9, new DarkGreen(25));
 
// Filled the area with a gradient
$gradient = new LinearGradient(
new Yellow(25),
new Orange(25),
90
);
$plot->setFilledArea(1, 4, $gradient);
 
// Hide first label
$plot->xAxis->label->hideFirst(TRUE);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-006.php
New file
0,0 → 1,49
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
// Use cache
$graph = new Graph(400, 400, "Example-006", time() + 5);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
 
 
$x = array();
for($i = 0; $i < 10; $i++) {
$x[] = mt_rand(0, 100);
}
 
$plot = new LinePlot($x);
$plot->setColor(
new Color(60, 60, 150)
);
$plot->setFillGradient(
new LinearGradient(
new Color(120, 175, 80, 47),
new Color(231, 172, 113, 30),
0
)
);
 
$plot->grid->setType(Line::DASHED);
 
$plot->setYMin(-5);
 
$plot->yAxis->setLabelNumber(8);
$plot->yAxis->setLabelPrecision(1);
 
$plot->xAxis->setNumberByTick('minor', 'major', 3);
 
$plot->setXAxisZero(TRUE);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-007.php
New file
0,0 → 1,67
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
// Return a random color
function color($a = NULL) {
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
 
function formatLabel($value) {
return sprintf("%.2f", $value);
}
 
$graph = new Graph(450, 400);
$graph->setAntiAliasing(TRUE);
$graph->title->set("Some lines");
 
$group = new PlotGroup;
$group->setXAxisZero(FALSE);
$group->setBackgroundColor(new Color(197, 180, 210, 80));
 
$group->setPadding(40, NULL, 50, NULL);
 
$group->axis->left->setLabelNumber(8);
$group->axis->left->setLabelPrecision(1);
$group->axis->left->setTickStyle(Tick::OUT);
 
$group->axis->bottom->setTickStyle(Tick::OUT);
 
// Display two lines
for($n = 0; $n < 2; $n++) {
 
$x = array();
for($i = 0; $i < 10; $i++) {
$x[] = (cos($i * M_PI / 5)) / ($n + 1);
}
$plot = new LinePlot($x);
$plot->setColor(color(10)); // Random line color
$plot->setFillColor(color(90)); // Random background color
 
$plot->label->set($x);
$plot->label->setBackgroundColor(new Color(220, 234, 230, 25));
$plot->label->setPadding(1, 0, 0, 0);
$plot->label->setCallbackFunction("formatLabel");
$plot->label->setInterval(2);
$group->add($plot);
$group->legend->add($plot, "Line #".($n + 1), Legend::LINE);
}
 
$group->legend->setSpace(12);
$group->legend->setBackgroundColor(new Color(255, 255, 255));
$group->setPadding(NULL, 100, NULL, NULL);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/line-008.php
New file
0,0 → 1,34
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
// Use cache
$graph = new Graph(400, 400);
$graph->setAntiAliasing(TRUE);
$graph->border->setStyle(Line::DOTTED);
$graph->border->setColor(new Red);
 
$x = array();
for($i = 0; $i < 10; $i++) {
$x[] = mt_rand(20, 100);
}
 
$plot = new LinePlot($x);
$plot->setFilledArea(0, 1, new Red(40));
$plot->setFilledArea(1, 2, new LinearGradient(new Red(40), new Orange(40), 90));
$plot->setFilledArea(2, 4, new LinearGradient(new Orange(40), new Green(40), 90));
$plot->setFilledArea(4, 7, new LinearGradient(new Green(40), new Blue(40), 90));
$plot->setFilledArea(7, 8, new LinearGradient(new Blue(40), new Purple(40), 90));
$plot->setFilledArea(8, 9, new Purple(40));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/AntiSpam-image.php
New file
0,0 → 1,16
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../AntiSpam.class.php";
 
$object = new AntiSpam();
$object->setRand(5);
$object->save('example');
$object->draw();
?>
/trunk/bibliotheque/artichow/examples/line-009.php
New file
0,0 → 1,66
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../LinePlot.class.php";
 
 
$graph = new Graph(400, 200);
$graph->setAntiAliasing(TRUE);
 
$group = new PlotGroup;
$group->setXAxisZero(FALSE);
$group->grid->setType(Line::DASHED);
 
$group->setBackgroundColor(new Color(197, 180, 210, 80));
 
$group->setPadding(40, NULL, 20, NULL);
 
$group->axis->left->setLabelNumber(8);
$group->axis->left->setLabelPrecision(1);
$group->axis->left->setTickStyle(Tick::IN);
$group->axis->left->label->move(-4, 0);
 
$group->axis->bottom->setTickStyle(Tick::OUT);
$group->axis->bottom->label->move(0, 4);
 
$x = array();
 
for($i = 0; $i < 15; $i++) {
$x[] = cos($i * M_PI / 5);
}
 
$plot = new LinePlot($x);
$plot->setColor(new Color(40, 40, 150, 10));
$plot->setFillColor(new Color(40, 40, 150, 90));
 
$group->add($plot);
$group->legend->add($plot, "Ligne #1", Legend::LINE);
 
$x = array();
 
for($i = 5; $i < 15; $i++) {
$x[] = (cos($i * M_PI / 5)) / 2;
}
 
$plot = new LinePlot($x);
$plot->setColor(new Color(120, 120, 30, 10));
$plot->setFillColor(new Color(120, 120, 30, 90));
 
$group->add($plot);
$group->legend->add($plot, "Ligne #2", Legend::LINE);
 
$group->legend->setTextFont(new Tuffy(8));
$group->legend->shadow->setSize(0);
$group->legend->setSpace(12);
$group->legend->setBackgroundColor(new Color(255, 255, 255));
$group->setPadding(NULL, 100, NULL, NULL);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/AntiSpam/valid.php
New file
0,0 → 1,11
<?php
require_once "../../../AntiSpam.class.php";
 
$object = new AntiSpam();
 
if($object->check('example', $_GET['code'])) {
echo "Good value :-)";
} else {
echo "Bad value :-(";
}
?>
/trunk/bibliotheque/artichow/examples/tutorials/AntiSpam/spam.php
New file
0,0 → 1,18
<?php
 
require_once '../../../AntiSpam.class.php';
 
// On créé l'image anti-spam
$object = new AntiSpam();
 
// La valeur affichée sur l'image fera 5 caractères
$object->setRand(5);
 
// On assigne un nom à cette image pour vérifier
// ultérieurement la valeur fournie par l'utilisateur
$object->save('example');
 
// On affiche l'image à l'écran
$object->draw();
 
?>
/trunk/bibliotheque/artichow/examples/tutorials/AntiSpam/form.php
New file
0,0 → 1,5
<form action="valid.php" method="get">
<img src="spam.php" style="vertical-align: middle"/>
<input type="text" name="code"/>
<input type="submit" value="Submit"/>
</form>
/trunk/bibliotheque/artichow/examples/tutorials/base-Color.php
New file
0,0 → 1,40
<?php
require_once "../../Graph.class.php";
 
$graph = new Graph(400, 30);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
for($i = 7; $i < 400; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point($i, 0),
new Point($i, 30)
)
);
}
 
for($i = 7; $i < 30; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point(0, $i),
new Point(400, $i)
)
);
}
 
$driver->filledRectangle(
new Color(0, 100, 200, 50),
new Line(
new Point(0, 0),
new Point(400, 30)
)
);
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/tutorials/line-Customize.php
New file
0,0 → 1,50
<?php
require_once "../../LinePlot.class.php";
 
$graph = new Graph(400, 300);
 
$graph->setAntiAliasing(TRUE);
 
$values = array(1, 7, 3, 2.5, 5, -4.5, -5);
$plot = new LinePlot($values);
$plot->setBackgroundColor(new Color(245, 245, 245));
 
$plot->hideLine(TRUE);
$plot->setFillColor(new Color(180, 180, 180, 75));
 
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
 
$plot->yAxis->setLabelPrecision(2);
$plot->yAxis->setLabelNumber(6);
 
$days = array(
'Lundi',
'Mardi',
'Mercredi',
'Jeudi',
'Vendredi',
'Samedi',
'Dimanche'
);
$plot->xAxis->setLabelText($days);
$plot->setSpace(6, 6, 10, 10);
 
$plot->mark->setType(Mark::IMAGE);
$plot->mark->setImage(new FileImage("smiley.png"));
 
$plot->label->set($values);
$plot->label->move(0, -23);
$plot->label->setBackgroundGradient(
new LinearGradient(
new Color(250, 250, 250, 10),
new Color(255, 200, 200, 30),
0
)
);
$plot->label->border->setColor(new Color(20, 20, 20, 20));
$plot->label->setPadding(3, 1, 1, 0);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/bar-Bars.php
New file
0,0 → 1,47
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(0, 0, 200);
$red = new Color(200, 0, 0);
 
$group = new PlotGroup;
$group->setPadding(40, 40);
$group->setBackgroundColor(
new Color(240, 240, 240)
);
 
$values = array(12, 8, 20, 32, 15, 5);
 
$plot = new BarPlot($values, 1, 2);
$plot->setBarColor($blue);
$plot->setYAxis(Plot::LEFT);
 
$group->add($plot);
$group->axis->left->setColor($blue);
$group->axis->left->title->set("Blue bars");
 
$values = array(6, 12, 14, 2, 11, 7);
 
$plot = new BarPlot($values, 2, 2);
$plot->setBarColor($red);
$plot->setYAxis(Plot::RIGHT);
 
$group->add($plot);
$group->axis->right->setColor($red);
$group->axis->right->title->set("Red bars");
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/bar-Simple.php
New file
0,0 → 1,31
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->setAntiAliasing(TRUE);
 
$values = array(19, 42, 15, -25, 3);
$plot = new BarPlot($values);
$plot->setBarColor(
new Color(250, 230, 180)
);
$plot->setSpace(5, 5, NULL, NULL);
 
$plot->barShadow->setSize(4);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/tutorials/base-Gradient-linear.php
New file
0,0 → 1,25
<?php
 
require_once "../../Graph.class.php";
 
$graph = new Graph(400, 30);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
$driver->filledRectangle(
new LinearGradient(
new Black,
new White,
0
),
new Line(
new Point(0, 0),
new Point(400, 30)
)
);
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/tutorials/line-Simple.php
New file
0,0 → 1,22
<?php
require_once "../../LinePlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->setAntiAliasing(FALSE);
 
$values = array(1, 4, 5, -2.5, 3);
$plot = new LinePlot($values);
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(250, 250, 250),
0
)
);
$plot->yAxis->setLabelPrecision(1);
$plot->setSpace(5, 5, NULL, NULL);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/plot-More.php
New file
0,0 → 1,47
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
require_once "../../LinePlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(150, 150, 230, 50);
$red = new Color(240, 50, 50, 25);
 
$group = new PlotGroup;
$group->setSpace(5, 5, 5, 0);
$group->setBackgroundColor(
new Color(240, 240, 240)
);
 
$values = array(18, 12, 14, 21, 11, 7, 9, 16, 7, 23);
 
$plot = new BarPlot($values);
$plot->setBarColor($red);
 
$group->add($plot);
 
$values = array(12, 8, 6, 12, 7, 5, 4, 9, 3, 12);
 
$plot = new LinePlot($values, LinePlot::MIDDLE);
$plot->setFillColor($blue);
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(7);
$plot->mark->setFill(new Color(255, 255, 255));
$plot->mark->border->show();
 
$group->add($plot);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/base-Gradient-radial.php
New file
0,0 → 1,24
<?php
require_once "../../Graph.class.php";
 
$graph = new Graph(250, 250);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
$start = new Color(125, 250, 0);
$end = new Color(0, 125, 125);
 
// On dessine le dégradé radial dans un cercle
$driver->filledEllipse(
new RadialGradient(
$start,
$end
),
new Point(125, 125),
250, 250
);
 
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/line-Lines.php
New file
0,0 → 1,49
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(0, 0, 200);
$red = new Color(200, 0, 0);
 
$group = new PlotGroup;
$group->setBackgroundColor(
new Color(240, 240, 240)
);
$group->setPadding(40, 40);
 
$values = array(12, 5, 20, 32, 15, 4, 16);
 
$plot = new LinePlot($values);
$plot->setColor($blue);
$plot->setYAxis(Plot::LEFT);
 
$group->add($plot);
 
$group->axis->left->setColor($blue);
$group->axis->left->title->set("Blue line");
 
$values = array(6, 12, 14, 2, 11, 5, 21);
 
$plot = new LinePlot($values);
$plot->setColor($red);
$plot->setYAxis(Plot::RIGHT);
 
$group->add($plot);
 
$group->axis->right->setColor($red);
$group->axis->right->title->set("Red line");
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/tutorials/smiley.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/examples/tutorials/smiley.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/examples/scatter-001.php
New file
0,0 → 1,21
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->title->set('Simple ScatterPlot');
 
$y = array(1, 10, 3,-4, 1, 4, 8, 7);
$x = array(0.5, 0.5, 3, 5, 2, 3, 4, 1.5);
 
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new VeryLightGray);
$plot->setPadding(NULL, NULL, 40, 20);
 
$plot->legend->add($plot, 'Some points', Legend::MARKONLY);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/scatter-002.php
New file
0,0 → 1,21
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->title->set('Linked ScatterPlot');
 
$y = array(1, 10, 3,-4, 1, 4, 8, 7);
$x = array(0.5, 0.5, 3, 5, 2, 3, 4, 1.5);
 
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new VeryLightGray);
$plot->setPadding(NULL, NULL, 40, 20);
 
$plot->link(TRUE, new DarkBlue);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/scatter-003.php
New file
0,0 → 1,30
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->shadow->setSize(5);
$graph->title->set('ScatterPlot with values');
 
$y = array(4, 3, 2, 5, 8, 1, 3, 6, 4, 5);
$x = array(1, 2, 5, 4, 3, 6, 2, 4, 5, 1);
 
$plot = new ScatterPlot($y, $x);
$plot->setSpace(6, 6, 6, 0);
$plot->setPadding(NULL, NULL, 40, 20);
 
// Set dashed lines on the grid
$plot->grid->setType(Line::DASHED);
 
$plot->mark->setSize(30);
$plot->mark->setFill(new DarkOrange(20));
 
 
$plot->label->set($y);
$plot->label->setColor(new White);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/scatter-004.php
New file
0,0 → 1,32
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->shadow->setSize(5);
 
$y = array();
for($i = 0; $i < 60; $i++) {
$y[] = cos($i / 30 * 2 * M_PI);
}
 
$plot = new ScatterPlot($y);
$plot->setSpace(6, 6);
 
// Set impulses
$plot->setImpulse(new DarkGreen);
 
$plot->grid->hideVertical();
 
// Hide axis labels and ticks
$plot->xAxis->label->hide();
$plot->xAxis->hideTicks();
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(4);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/scatter-005.php
New file
0,0 → 1,37
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->title->set('Impulses');
$graph->title->move(0, 30);
$graph->shadow->setSize(5);
 
$y = array();
for($i = 0; $i < 60; $i++) {
$y[] = cos($i / 30 * 2 * M_PI) / (1.5 + $i / 15);
}
 
$plot = new ScatterPlot($y);
$plot->setBackgroundColor(new VeryLightOrange);
$plot->setSpace(5);
 
// Set impulses
$plot->setImpulse(new DarkBlue);
 
$plot->grid->hideVertical();
 
// Hide ticks
$plot->xAxis->hideTicks();
 
// Change labels interval
$plot->xAxis->label->setInterval(5);
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(4);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/scatter-006.php
New file
0,0 → 1,39
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$center = 5;
 
$x = array();
$y = array();
 
for($i = 0; $i <= 30; $i++) {
$rad = ($i / 30) * 2 * M_PI;
$x[] = $center + cos($rad) * $center;
$y[] = $center + sin($rad) * $center;
}
 
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new VeryLightGray);
$plot->setPadding(30, 30, 30, 30);
$plot->setSpace(5, 5, 5, 5);
 
$plot->link(TRUE, new DarkGreen);
 
$plot->mark->setFill(new DarkOrange);
$plot->mark->setType(Mark::SQUARE, 4);
 
$plot->setXAxis(Plot::BOTH);
$plot->setXAxisZero(FALSE);
$plot->setYAxis(Plot::BOTH);
 
$plot->legend->add($plot, 'A circle', Legend::MARK);
$plot->legend->setPosition(0.5, 0.5);
$plot->legend->setAlign(Legend::CENTER, Legend::MIDDLE);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/AntiSpam-valid.php
New file
0,0 → 1,22
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../AntiSpam.class.php";
 
$object = new AntiSpam();
 
if($object->check('example', $_GET['code'])) {
echo "Good value :-)";
} else {
echo "Bad value :-(";
}
?>
<ul>
<li><a href='AntiSpam.php'>Try again</a></li>
</ul>
/trunk/bibliotheque/artichow/examples/scatter-007.php
New file
0,0 → 1,60
<?php
 
require_once "../ScatterPlot.class.php";
 
$graph = new Graph(400, 400);
 
$group = new PlotGroup;
 
$group->setBackgroundColor(new VeryLightGray);
$group->setPadding(30, 30, 30, 30);
$group->setSpace(5, 5, 5, 5);
 
$group->legend->setPosition(0.5, 0.62);
$group->legend->setAlign(Legend::CENTER, Legend::MIDDLE);
 
function getCircle($size) {
 
$center = 0;
$x = array();
$y = array();
for($i = 0; $i <= 30; $i++) {
$rad = ($i / 30) * 2 * M_PI;
$x[] = $center + cos($rad) * $size;
$y[] = $center + sin($rad) * $size;
}
return array($x, $y);
}
 
list($x, $y) = getCircle(3);
 
$plot = new ScatterPlot($y, $x);
 
$plot->link(TRUE, new DarkBlue);
 
$plot->mark->setFill(new DarkPink);
$plot->mark->setType(Mark::CIRCLE, 6);
 
$group->legend->add($plot, 'Circle #1', Legend::MARK);
$group->add($plot);
 
list($x, $y) = getCircle(5);
 
$plot = new ScatterPlot($y, $x);
 
$plot->link(TRUE, new DarkGreen);
 
$plot->mark->setFill(new DarkOrange);
$plot->mark->setType(Mark::SQUARE, 4);
 
$group->legend->add($plot, 'Circle #2', Legend::MARK);
$group->add($plot);
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-010.php
New file
0,0 → 1,29
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
 
$graph->title->set("Pie (example 10) - Just a pie");
$graph->title->setFont(new Tuffy(10));
 
$values = array(8, 4, 6, 1, 2, 3, 4);
 
$plot = new Pie($values);
$plot->set3D(10);
 
$plot->legend->hide(TRUE);
$plot->label->hide(TRUE);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-011.php
New file
0,0 → 1,48
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
function createPie($values, $title, $x, $y) {
$plot = new Pie($values, Pie::EARTH);
$plot->title->set($title);
$plot->title->setFont(new TuffyBold(8));
$plot->title->move(NULL, -12);
$plot->label->setFont(new Tuffy(7));
$plot->legend->hide(TRUE);
$plot->setLabelPosition(5);
$plot->setSize(0.45, 0.45);
$plot->setCenter($x, $y);
$plot->set3D(10);
$plot->setBorderColor(new Color(230, 230, 230));
return $plot;
 
}
 
$graph = new Graph(400, 300);
 
$plot = createPie(array(1, 4, 5, 2, 3), "Cowléoptère", 0.22, 0.25);
$graph->add($plot);
 
$plot = createPie(array(1, 9, 1, 2, 1), "Asticow", 0.68, 0.25);
$graph->add($plot);
 
$plot = createPie(array(5, 7, 8, 6, 3), "Cowlibri", 0.22, 0.75);
$graph->add($plot);
 
$plot = createPie(array(6, 4, 6, 5, 6), "Bourricow", 0.68, 0.75);
$plot->legend->hide(FALSE); // We print only one legend
$plot->legend->setPosition(1.18, 0);
$graph->add($plot);
 
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/pie-012.php
New file
0,0 → 1,38
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
$graph = new Graph(300, 300);
 
$graph->title->set("Pie (example 12)");
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->explode(array(1 => 20, 4 => 25));
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/pie-013.php
New file
0,0 → 1,40
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../Pie.class.php";
 
 
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Pie (example 13)");
 
$values = array(12, 5, 13, 18, 10, 6, 11);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setAbsSize(180, 180);
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.5);
$plot->legend->shadow->setSize(0);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/line-006.php
New file
0,0 → 1,58
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(300, 200);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
-4, -5, -2, -8, -3, 1, 4, 9, 5, 6, 2
);
 
$plot = new LinePlot($x);
$plot->setStyle(Line::DASHED);
 
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(25, 15, 10, 18);
 
$plot->setBackgroundGradient(
new LinearGradient(
new Color(230, 230, 230),
new Color(255, 255, 255),
90
)
);
 
$plot->setFilledArea(7, 9, new Red(25));
$plot->setFilledArea(1, 4, new Yellow(25));
 
$plot->setColor(new Color(0, 0, 150, 20));
 
$plot->grid->setColor(new VeryLightGray);
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(4);
$plot->mark->setFill(new VeryDarkGreen(30));
$plot->mark->border->show();
$plot->mark->border->setColor(new DarkBlue(60));
 
$plot->xAxis->label->hide(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 3);
 
$plot->yAxis->setLabelNumber(8);
 
$plot->legend->add($plot, "My line");
$plot->legend->setPosition(0.9, 0.77);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-001.php
New file
0,0 → 1,60
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(150, 100);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
0, 2, 5, 2, 3, 8
);
 
$plot = new LinePlot($x);
$plot->setXAxisZero(FALSE);
$plot->grid->setNobackground();
 
$plot->setSpace(6, 6, 10, 10);
$plot->setPadding(30, 6, 8, 18);
 
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
 
// Change line color
$plot->setColor(new Color(0, 0, 150, 20));
 
// Set line background gradient
$plot->setFillGradient(
new LinearGradient(
new Color(150, 150, 210),
new Color(230, 230, 255),
0
)
);
 
// Change mark type
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->border->show();
$plot->mark->setSize(6);
 
$plot->yAxis->setLabelPrecision(1);
$plot->yAxis->label->setFont(new Font1);
$plot->xAxis->label->setFont(new Font1);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-002.php
New file
0,0 → 1,50
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(150, 100);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4
);
 
$plot = new LinePlot($x);
$plot->grid->setNobackground();
$plot->setPadding(20, 8, 8, 20);
$plot->setXAxisZero(FALSE);
 
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
 
// Set semi-transparent background gradient
$plot->setFillGradient(
new LinearGradient(
new Color(230, 150, 150, 20),
new Color(230, 230, 180, 50),
90
)
);
 
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->label->hideLast(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/line-007.php
New file
0,0 → 1,70
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(300, 200);
 
$graph->setAntiAliasing(TRUE);
 
$group = new PlotGroup;
$group->grid->setType(Line::DASHED);
 
$group->setPadding(40, NULL, 20, NULL);
 
$group->axis->left->setLabelNumber(8);
$group->axis->left->setLabelPrecision(1);
$group->axis->left->setTickStyle(Tick::OUT);
 
$x = array(2, 4, 8, 16, 32, 48, 56, 60, 62);
 
$plot = new LinePlot($x);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
 
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->setFill(new MidRed);
$plot->mark->setSize(6);
 
$group->legend->add($plot, "John", Legend::MARK);
$group->add($plot);
 
$x = array(NULL, NULL, NULL, 10, 12, 14, 18, 26, 42);
 
$plot = new LinePlot($x);
$plot->setColor(new Color(120, 120, 30, 10));
$plot->setFillColor(new Color(120, 120, 60, 90));
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setFill(new DarkGreen);
$plot->mark->setSize(5);
 
$group->add($plot);
 
function setYear($value) {
return $value + 2000;
}
 
$group->axis->bottom->label->setCallbackFunction('setYear');
 
function setK($value) {
return round($value).'K';
}
 
$group->axis->left->label->setCallbackFunction('setK');
 
$group->legend->add($plot, "George", Legend::MARK);
$group->legend->setPosition(0.45, 0.25);
$group->legend->shadow->smooth(TRUE);
 
$graph->add($group);
 
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-003.php
New file
0,0 → 1,56
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(150, 100);
 
$x = array();
 
for($i = 0; $i < 8; $i++) {
$x[] = cos($i / 3 * M_PI) + mt_rand(-10, 10) / 40;
}
 
$plot = new LinePlot($x);
$plot->setPadding(22, 5, 25, 8);
 
// Hide grid
$plot->grid->setType(Line::DASHED);
 
// Change background color
$plot->setBackgroundColor(new Color(240, 240, 240, 50));
 
// Set Y on both left and rights sides
$plot->setYAxis(Plot::BOTH);
 
// Change line properties
$plot->setColor(new Color(0, 0, 0));
$plot->setFillColor(new Color(240, 190, 130, 50));
 
// Chenge ticks and labels interval
$plot->xAxis->setTickInterval(2);
$plot->xAxis->label->hide(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 1);
 
// Hide first and last values on X axis
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->label->hideLast(TRUE);
 
// Add a title
$plot->title->set("Random values");
$plot->title->move(0, 2);
$plot->title->setFont(new Tuffy(8));
$plot->title->setBackgroundColor(new Color(255, 255, 255, 25));
$plot->title->border->show();
$plot->title->setPadding(2, 2, 2, 2);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-004.php
New file
0,0 → 1,59
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(150, 100);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 4, 2, 3
);
 
$plot = new LinePlot($x);
 
// Change component padding
$plot->setPadding(10, 12, 12, 7);
 
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(230, 230, 230),
new Color(255, 255, 255),
0
)
);
 
// Change line background color
$plot->setFillGradient(
new LinearGradient(
new Color(200, 240, 215, 30),
new Color(150, 190, 165, 30),
0
)
);
 
// Hide grid
$plot->grid->hide(TRUE);
$plot->grid->setNobackground();
 
$plot->yAxis->label->hide(TRUE);
$plot->xAxis->label->hide(TRUE);
 
$plot->label->set($x);
$plot->label->setBackgroundColor(new Color(240, 240, 240, 10));
$plot->label->border->setColor(new Color(255, 0, 0, 15));
$plot->label->setPadding(3, 2, 0, 0);
$plot->label->setFont(new Font1);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-005.php
New file
0,0 → 1,46
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
$graph = new Graph(150, 100);
 
$graph->setAntiAliasing(TRUE);
 
$x = array();
for($i = 0; $i < 10; $i++) {
$x[] = mt_rand(1, 99) / 10;
}
 
$plot = new LinePlot($x);
$plot->setBackgroundColor(new Color(240, 240, 240));
$plot->setPadding(30, 8, 8, 20);
 
$plot->setColor(
new Color(60, 60, 150)
);
$plot->setFillGradient(
new LinearGradient(
new Color(120, 175, 80, 47),
new Color(231, 172, 113, 30),
0
)
);
 
$plot->grid->setType(Line::DASHED);
 
$plot->yAxis->setLabelNumber(2);
$plot->yAxis->setLabelPrecision(1);
 
$plot->xAxis->setLabelInterval(2);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/mini-006.php
New file
0,0 → 1,53
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
// Return a random color
function color($a = NULL) {
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
 
function formatLabel($value) {
return sprintf("%.2f", $value);
}
 
$graph = new Graph(150, 100);
 
$graph->setAntiAliasing(TRUE);
 
$group = new PlotGroup;
$group->setXAxisZero(FALSE);
$group->setBackgroundColor(new Color(197, 180, 210, 80));
 
$group->setPadding(25, 10, 10, 20);
 
$group->axis->left->setLabelNumber(2);
$group->axis->left->setLabelPrecision(1);
 
// Display two lines
for($n = 0; $n < 2; $n++) {
 
$x = array();
for($i = 0; $i < 10; $i++) {
$x[] = (cos($i * M_PI / 5)) / ($n + 1);
}
$plot = new LinePlot($x);
$plot->setColor(color(10)); // Random line color
$plot->setFillColor(color(90)); // Random background color
$group->add($plot);
}
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/logo.php
New file
0,0 → 1,51
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(500, 100);
 
$graph->setAntiAliasing(TRUE);
$graph->border->hide();
 
$x = array();
for($i = 0; $i < 20; $i++) {
$x[] = mt_rand(4, 12);
}
 
$plot = new LinePlot($x);
 
$plot->setSpace(0, 0, 50, 0);
$plot->setPadding(3, 3, 3, 3);
 
$plot->setBackgroundGradient(
new LinearGradient(
new Color(230, 230, 230),
new Color(255, 255, 255),
0
)
);
 
$plot->setColor(new Color(0, 0, 180, 20));
 
$plot->setFillGradient(
new LinearGradient(
new Color(220, 220, 230, 25),
new Color(240, 240, 255, 25),
90
)
);
 
$plot->xAxis->hide(TRUE);
$plot->yAxis->hide(TRUE);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/bar-001.php
New file
0,0 → 1,80
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
 
$graph = new Graph(280, 200);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
1, 2, 5, 0.5, 3, 8, 6
);
 
$plot = new BarPlot($x);
 
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(40, 15, 10, 40);
 
$plot->title->set("Zoé and friends");
$plot->title->setFont(new TuffyBold(11));
$plot->title->border->show();
$plot->title->setBackgroundColor(new Color(255, 255, 255, 25));
$plot->title->setPadding(4, 4, 4, 4);
$plot->title->move(-20, 25);
 
$plot->yAxis->title->set("Axe des Y");
$plot->yAxis->title->setFont(new TuffyBold(10));
$plot->yAxis->title->move(-4, 0);
$plot->yAxis->setTitleAlignment(Label::TOP);
 
$plot->xAxis->title->set("Axe des X");
$plot->xAxis->title->setFont(new TuffyBold(10));
$plot->xAxis->setTitleAlignment(Label::RIGHT);
 
$plot->setBackgroundGradient(
new LinearGradient(
new Color(230, 230, 230),
new Color(255, 255, 255),
0
)
);
 
$plot->barBorder->setColor(new Color(0, 0, 150, 20));
 
$plot->setBarGradient(
new LinearGradient(
new Color(150, 150, 210, 0),
new Color(230, 230, 255, 30),
0
)
);
 
$y = array(
'Zoé',
'Yvan',
'Fred',
'Lucie',
'Ilia',
'Nino',
'Marie'
);
 
$plot->xAxis->setLabelText($y);
$plot->xAxis->label->setFont(new TuffyBold(7));
 
$graph->shadow->setSize(4);
$graph->shadow->setPosition(Shadow::LEFT_TOP);
$graph->shadow->smooth(TRUE);
$graph->shadow->setColor(new Color(160, 160, 160));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/scatter-001.php
New file
0,0 → 1,69
<?php
 
require_once "../../ScatterPlot.class.php";
 
$graph = new Graph(280, 280);
 
$graph->title->move(-40, 0);
$graph->title->set('Two circles');
 
$group = new PlotGroup;
$group->setBackgroundGradient(
new LinearGradient(
new VeryLightGray,
new Color(245, 245, 245),
0
)
);
 
$group->setPadding(25, 20, 40, 15);
$group->setSpace(5, 5, 5, 5);
 
$group->legend->setPosition(0.82, 0.1);
$group->legend->setAlign(Legend::CENTER, Legend::MIDDLE);
 
function getCircle($size) {
 
$center = 0;
$x = array();
$y = array();
for($i = 0; $i <= 20; $i++) {
$rad = ($i / 20) * 2 * M_PI;
$x[] = $center + cos($rad) * $size;
$y[] = $center + sin($rad) * $size;
}
return array($x, $y);
}
 
list($x, $y) = getCircle(3);
 
$plot = new ScatterPlot($y, $x);
 
$plot->link(TRUE, new DarkBlue);
 
$plot->mark->setFill(new DarkPink);
$plot->mark->setType(Mark::CIRCLE, 6);
 
$group->legend->add($plot, 'Circle #1', Legend::MARK);
$group->add($plot);
 
list($x, $y) = getCircle(5);
 
$plot = new ScatterPlot($y, $x);
 
$plot->link(TRUE, new DarkGreen);
 
$plot->mark->setFill(new DarkOrange);
$plot->mark->setType(Mark::SQUARE, 4);
 
$group->legend->add($plot, 'Circle #2', Legend::MARK);
$group->add($plot);
 
$graph->add($group);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/bar-002.php
New file
0,0 → 1,80
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(280, 280);
 
$graph->setAntiAliasing(TRUE);
 
$group = new PlotGroup;
$group->setSpace(6, 6, 5, 5);
$group->setBackgroundGradient(
new LinearGradient(
new Color(235, 235, 235),
new White(),
0
)
);
$group->setPadding(40, 10, 10, 50);
 
$group->axis->left->setLabelPrecision(2);
$group->axis->bottom->label->hide(TRUE);
$group->axis->bottom->hideTicks(TRUE);
 
$group->grid->setType(Line::DASHED);
$group->grid->hideHorizontal(TRUE);
 
$gradients = array(
new LinearGradient(
new Color(30, 30, 160, 10), new Color(120, 120, 160, 10), 0
),
new LinearGradient(
new Color(30, 160, 30, 10), new Color(120, 160, 120, 10), 0
),
new LinearGradient(
new Color(160, 30, 30, 10), new Color(160, 120, 120, 10), 0
)
);
 
for($n = 0; $n < 3; $n++) {
 
$x = array();
for($i = 0; $i < 6; $i++) {
$x[] = (cos($i * M_PI / 100) / ($n + 1) * mt_rand(600, 900) / 1000 - 0.5) * (($n%2) ? -0.5 : 1) + (($n%2) ? -0.4 : 0);
}
$plot = new BarPlot($x, $n + 1, 3);
$plot->setXAxis(Plot::BOTTOM);
$plot->barShadow->setSize(1);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 10));
$plot->barBorder->setColor($gradients[$n]->from);
 
$plot->setBarGradient($gradients[$n]);
$plot->setBarSpace(2);
$group->legend->add($plot, 'Bar#'.($n + 1), Legend::BACKGROUND);
$group->add($plot);
}
 
$group->legend->setModel(Legend::MODEL_BOTTOM);
$group->legend->setPosition(NULL, 0.86);
$group->legend->shadow->hide();
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/bar-003.php
New file
0,0 → 1,73
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
function color($a = NULL) {
if($a === NULL) {
$a = 0;
}
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
 
$graph = new Graph(300, 200);
 
$graph->setAntiAliasing(TRUE);
$graph->border->hide();
 
$group = new PlotGroup;
$group->setSpace(5, 10, 20, 15);
$group->setPadding(40, 10, NULL, 20);
$group->setXAxisZero(FALSE);
 
$group->axis->left->setLabelPrecision(2);
 
$colors = array(
new Color(100, 180, 154, 12),
new Color(100, 154, 180, 12),
new Color(154, 100, 180, 12),
new Color(180, 100, 154, 12)
);
 
for($n = 0; $n < 4; $n++) {
 
$x = array();
for($i = 0; $i < 6; $i++) {
$x[] = (cos($i * M_PI / 100) / ($n + 1) * mt_rand(600, 1400) / 1000 - 0.5);
}
$plot = new BarPlot($x, 1, 1, (3 - $n) * 7);
$plot->barBorder->setColor(new Color(0, 0, 0));
$plot->setBarSize(0.54);
$plot->barShadow->setSize(3);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 10));
$plot->barShadow->smooth(TRUE);
 
$plot->setBarColor($colors[$n]);
$group->add($plot);
$group->legend->add($plot, "Barre #".$n, Legend::BACKGROUND);
}
 
$group->legend->shadow->setSize(0);
$group->legend->setAlign(Legend::CENTER);
$group->legend->setSpace(6);
$group->legend->setTextFont(new Tuffy(8));
$group->legend->setPosition(0.50, 0.12);
$group->legend->setBackgroundColor(new Color(255, 255, 255, 25));
$group->legend->setColumns(2);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/scatter-002.php
New file
0,0 → 1,30
<?php
 
require_once "../../ScatterPlot.class.php";
 
$graph = new Graph(300, 240);
 
$graph->title->set('Simple ScatterPlot');
$graph->shadow->setSize(4);
 
$y = array(1, 1.3, 1.8, 1.6, 10, 7, 8, 3, 4, 2, 4);
$x = array(0.5, 0.7, 0.65, 0.9, 0.5, 1.5, 4, 3, 5, 2, 2);
 
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new Color(255, 245, 220));
 
$plot->mark->setSize(15);
$plot->mark->setFill(
new RadialGradient(
new LightRed,
new Red
)
);
 
$plot->setSpace(6, 6, 6, 0);
$plot->setPadding(25, NULL, 40, 20);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/bar-004.php
New file
0,0 → 1,92
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
function labelFormat($value) {
return round($value, 2);
}
 
$graph = new Graph(280, 200);
 
$graph->setAntiAliasing(TRUE);
 
$group = new PlotGroup;
$group->setSpace(5, 5, 15, 0);
$group->setPadding(40, 40);
 
$group->axis->left->setLabelPrecision(2);
$group->axis->right->setLabelPrecision(2);
 
$colors = array(
new Color(80, 105, 190, 10),
new Color(105, 190, 80, 10)
);
 
$darkColor = array(
new Color(40, 55, 120, 10),
new Color(55, 120, 40, 10)
);
 
$axis = array(
Plot::LEFT,
Plot::RIGHT
);
 
$group->axis->left->setColor($darkColor[0]);
$group->axis->left->label->setColor($darkColor[0]);
$group->axis->right->setColor($darkColor[1]);
$group->axis->right->label->setColor($darkColor[1]);
 
$group->setBackgroundGradient(
new LinearGradient(
new Color(225, 225, 225),
new Color(255, 255, 255),
0
)
);
 
for($n = 0; $n < 2; $n++) {
 
$x = array();
for($i = 0; $i < 4; $i++) {
$x[] = (cos($i * M_PI / 100) / ($n + 1) * mt_rand(700, 1300) / 1000 - 0.5) * (($n%2) ? -0.5 : 1) + (($n%2) ? -0.4 : 0) + 1;
}
$plot = new BarPlot($x, $n+1, 2);
$plot->barBorder->setColor(new Color(0, 0, 0, 30));
$plot->setBarPadding(0.1, 0.1);
$plot->setBarSpace(5);
$plot->barShadow->setSize(3);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
 
$plot->label->set($x);
$plot->label->move(0, -6);
$plot->label->setFont(new Tuffy(7));
$plot->label->setAngle(90);
$plot->label->setAlign(NULL, Label::TOP);
$plot->label->setPadding(3, 1, 0, 6);
$plot->label->setCallbackFunction("labelFormat");
 
$plot->setBarColor($colors[$n]);
$plot->setYAxis($axis[$n]);
$group->add($plot);
}
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/scatter-003.php
New file
0,0 → 1,34
<?php
 
require_once "../../ScatterPlot.class.php";
 
$graph = new Graph(300, 280);
 
$graph->title->set('Linked ScatterPlot');
$graph->title->setFont(new TuffyItalic(14));
$graph->shadow->setSize(4);
 
$y = array(1, 10, 7, 8, 5, 4, 2, 4);
$x = array(0.5, 0.5, 1.5, 4, 3, 5, 2, 2);
 
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new Color(235, 235, 235));
 
$plot->mark->setSize(15);
$plot->mark->setFill(
new RadialGradient(
new LightGreen,
new DarkGreen
)
);
 
$plot->link(TRUE);
$plot->setColor(new DarkGreen);
 
$plot->setSpace(6, 6, 6, 0);
$plot->setPadding(25, NULL, 40, 20);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/bar-005.php
New file
0,0 → 1,82
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(300, 200);
 
$graph->setAntiAliasing(TRUE);
$graph->border->hide();
 
$group = new PlotGroup;
$group->grid->hide(TRUE);
$group->setSpace(2, 2, 20, 0);
$group->setPadding(30, 10, NULL, NULL);
 
$colors = array(
new Orange(25),
new LightBlue(10)
);
 
for($n = 0; $n < 2; $n++) {
 
$x = array();
for($i = 0; $i < 3 - $n * 3; $i++) {
$x[] = NULL;
}
for($i = 3 - ($n * 3); $i < 12 - ($n * 3); $i++) {
$x[] = cos($i * M_PI / 100) * mt_rand(800, 1200) / 1000 * (((1 - $n) * 5 + 10) / 10);
}
for($i = 0; $i < $n * 3; $i++) {
$x[] = NULL;
}
$plot = new BarPlot($x, 1, 1, (1 - $n) * 6);
// $plot->setBarPadding(2, 2);
$plot->barShadow->setSize(2);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(160, 160, 160, 10));
$plot->barShadow->smooth(TRUE);
 
$plot->setBarColor($colors[$n]);
$group->add($plot);
$group->legend->add($plot, $n + date('Y'), Legend::BACKGROUND);
}
 
function setPc($value) {
return round($value * 10).'%';
}
 
$group->axis->left->label->setCallbackFunction('setPc');
 
$months = array(
"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
);
 
$group->axis->bottom->setLabelText($months);
$group->axis->bottom->hideTicks(TRUE);
 
$group->legend->shadow->setSize(0);
$group->legend->setAlign(Legend::CENTER);
$group->legend->setSpace(6);
$group->legend->setTextFont(new Tuffy(8));
$group->legend->setPosition(0.50, 0.10);
$group->legend->setBackgroundColor(new Color(255, 255, 255, 25));
$group->legend->setColumns(2);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/canvas-001.php
New file
0,0 → 1,68
<?php
 
require_once "../../Graph.class.php";
 
$graph = new Graph(300, 200);
 
$driver = $graph->getDriver();
 
$driver->filledRectangle(
new Color(230, 230, 230, 0),
new Line(
new Point(10, 10),
new Point(200, 150)
)
);
 
for($i = 7; $i < 400; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point($i, 0 + 50),
new Point($i, 30 + 50)
)
);
}
 
for($i = 7; $i < 30; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point(0, $i + 50),
new Point(400, $i + 50)
)
);
}
 
$driver->filledRectangle(
new Color(0, 100, 200, 50),
new Line(
new Point(100, 100),
new Point(280, 180)
)
);
 
$debut = new Color(230, 250, 0);
$fin = new Color(255, 255, 255, 100);
 
$driver->filledEllipse(
new RadialGradient(
$debut,
$fin
),
new Point(105, 135),
90, 90
);
 
$text = new Text(
"Artichow !",
new Tuffy(15),
new Color(0, 0, 80),
45
);
 
$driver->string($text, new Point(210, 75));
 
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/pie-001.php
New file
0,0 → 1,42
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../Pie.class.php";
 
 
$graph = new Graph(300, 175);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Stats");
$graph->title->setFont(new TuffyItalic(16));
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values, Pie::EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->explode(array(1 => 14, 4 => 20, 0 => 10));
 
$plot->setLegend(array(
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
'Sun'
));
 
$plot->legend->setPosition(1.3);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/impulse-001.php
New file
0,0 → 1,36
<?php
 
require_once "../../ScatterPlot.class.php";
 
$graph = new Graph(300, 200);
 
$graph->title->set('Impulses');
$graph->shadow->setSize(4);
 
$y = array();
for($i = 0; $i < 40; $i++) {
$y[] = cos($i / 15 * 2 * M_PI) / (0.8 + $i / 15) * 4;
}
 
$plot = new ScatterPlot($y);
$plot->setPadding(25, 15, 35, 15);
$plot->setBackgroundColor(new Color(230, 230, 255));
$plot->setSpace(2, 2);
 
// Set impulses
$plot->setImpulse(new DarkBlue);
 
$plot->grid->hideVertical();
$plot->grid->setType(Line::DASHED);
 
// Hide ticks
$plot->xAxis->hideTicks();
$plot->xAxis->label->hide();
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(4);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/pie-002.php
New file
0,0 → 1,50
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../Pie.class.php";
 
 
$graph = new Graph(300, 175);
$graph->setBackgroundGradient(
new LinearGradient(
new White,
new VeryLightGray(40),
0
)
);
$graph->title->set("Horses");
$graph->shadow->setSize(5);
$graph->shadow->smooth(TRUE);
$graph->shadow->setPosition(Shadow::LEFT_BOTTOM);
$graph->shadow->setColor(new DarkGray);
 
$values = array(8, 4, 6, 2, 5);
 
$plot = new Pie($values);
$plot->setCenter(0.35, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->setLabelPosition(10);
 
$plot->setLegend(array(
'France',
'Spain',
'Italy',
'Germany',
'England'
));
 
$plot->legend->setPosition(1.40);
$plot->legend->shadow->setSize(0);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/pie-003.php
New file
0,0 → 1,52
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../Pie.class.php";
 
 
$graph = new Graph(300, 175);
$graph->setAntiAliasing(TRUE);
 
$graph->title->set("Customized colors");
$graph->title->setFont(new Tuffy(12));
$graph->title->move(80, 10);
 
$values = array(16, 9, 13, 23);
$colors = array(
new LightOrange,
new LightPurple,
new LightBlue,
new LightRed,
new LightPink
);
 
$plot = new Pie($values, $colors);
$plot->setCenter(0.3, 0.53);
$plot->setAbsSize(200, 200);
$plot->setBorderColor(new White);
$plot->setStartAngle(234);
 
$plot->setLegend(array(
'Arthur',
'Abel',
'Pascal',
'Thamer'
));
 
$plot->setLabelPosition(-40);
$plot->label->setPadding(2, 2, 2, 2);
$plot->label->setFont(new Tuffy(7));
$plot->label->setBackgroundColor(new White(60));
 
$plot->legend->setPosition(1.38);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/pie-004.php
New file
0,0 → 1,53
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../Pie.class.php";
 
 
$graph = new Graph(300, 175);
$graph->setBackgroundGradient(
new LinearGradient(
new VeryLightGray(40),
new White,
90
)
);
$graph->title->set("Arbitrary labels");
$graph->title->setAngle(90);
$graph->title->move(120, NULL);
 
$values = array(8, 4, 6, 2, 5, 3, 4);
 
$plot = new Pie($values);
$plot->setCenter(0.45, 0.5);
$plot->setSize(0.55, 0.55 * 300 / 175);
 
$plot->label->set(array(
'Arthur', 'Abel', 'Bernard', 'Thierry', 'Paul', 'Gaston', 'Joe'
));
 
$plot->label->setCallbackFunction(NULL); // We must disable the default callback function
$plot->setLabelPosition(10);
 
$plot->setLegend(array(
'ABC',
'DEF',
'GHI',
'JKL',
'MNO',
'PQR',
'STU'
));
 
$plot->legend->hide(TRUE);
 
$graph->add($plot);
$graph->draw();
 
?>
/trunk/bibliotheque/artichow/examples/site/pie-005.php
New file
0,0 → 1,51
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../Pie.class.php";
 
function createPie($values, $title, $x, $y) {
$plot = new Pie($values, Pie::EARTH);
$plot->title->set($title);
$plot->title->setFont(new TuffyBold(9));
$plot->title->move(NULL, -12);
$plot->label->setFont(new Tuffy(7));
$plot->legend->hide(TRUE);
$plot->setLabelPosition(5);
$plot->setSize(0.48, 0.35);
$plot->setCenter($x, $y);
$plot->set3D(8);
$plot->setBorderColor(new White);
return $plot;
 
}
 
$graph = new Graph(280, 350);
$graph->setAntiAliasing(TRUE);
 
$plot = createPie(array(1, 4, 5, 2, 3), "Cowléoptère", 0.25, 0.24);
$graph->add($plot);
 
$plot = createPie(array(1, 9, 1, 2, 1), "Asticow", 0.75, 0.24);
$graph->add($plot);
 
$plot = createPie(array(5, 7, 8, 6, 3), "Cowlibri", 0.25, 0.65);
$graph->add($plot);
 
$plot = createPie(array(6, 4, 6, 5, 6), "Bourricow", 0.75, 0.65);
$plot->legend->setModel(Legend::MODEL_BOTTOM);
$plot->setLegend(array('plip', 'plop', 'plap', 'plup', 'plep'));
$plot->legend->hide(FALSE); // We print only one legend
$plot->legend->setPosition(0, 1.10);
$graph->add($plot);
 
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/line-001.php
New file
0,0 → 1,71
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(300, 175);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
3, 1, 5, 6, 3, 8, 6
);
 
$plot = new LinePlot($x);
 
$plot->grid->setNoBackground();
 
$plot->title->set("Filled line and marks");
$plot->title->setFont(new Tuffy(10));
$plot->title->setBackgroundColor(new Color(255, 255, 255, 25));
$plot->title->border->show();
$plot->title->setPadding(3, 3, 3, 3);
$plot->title->move(-20, 25);
 
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(25, 15, 10, 18);
 
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
 
$plot->setColor(new Color(0, 0, 150, 20));
 
$plot->setFillGradient(
new LinearGradient(
new Color(150, 150, 210),
new Color(245, 245, 245),
0
)
);
 
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->border->show();
 
$y = array(
'Lundi',
'Mardi',
'Mercredi',
'Jeudi',
'Vendredi',
'Samedi',
'Dimanche'
);
 
$plot->xAxis->setLabelText($y);
$plot->xAxis->label->setFont(new Tuffy(7));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/line-002.php
New file
0,0 → 1,62
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
 
$graph = new Graph(300, 175);
 
$graph->setAntiAliasing(TRUE);
 
$x = array(
4, 3, 1, 0, -2, 1, 3, 2, 3, 5, 4, 1
);
 
$plot = new LinePlot($x);
$plot->setXAxisZero(FALSE);
 
$plot->grid->hide(TRUE);
 
$plot->title->set("Using dashed line and legend");
$plot->title->setFont(new TuffyItalic(9));
$plot->title->setBackgroundColor(new Color(255, 255, 255, 50));
$plot->title->setPadding(3, 3, 3, 3);
$plot->title->move(0, 20);
 
$plot->setSpace(6, 6, 10, 10);
$plot->setPadding(30, 10, 15, 25);
 
$plot->setBackgroundColor(
new Color(245, 245, 245)
);
 
$plot->setStyle(Line::DASHED);
$plot->setColor(new Color(0, 150, 0, 20));
 
$plot->setFillGradient(
new LinearGradient(
new Color(220, 220, 150, 40),
new Color(255, 255, 210, 30),
0
)
);
 
$graph->shadow->setSize(4);
$graph->shadow->setPosition(Shadow::LEFT_BOTTOM);
$graph->shadow->smooth(TRUE);
 
$plot->legend->add($plot, "Apples");
$plot->legend->shadow->setSize(0);
$plot->legend->setAlign(Legend::CENTER, Legend::TOP);
$plot->legend->setPosition(0.75, 0.60);
$plot->legend->setTextFont(new Tuffy(8));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/line-003.php
New file
0,0 → 1,70
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
$graph = new Graph(280, 200);
 
$x = array();
for($i = 115; $i < 115 + 180; $i++) {
$x[] = cos($i / 25);
}
 
function format($value) {
return sprintf("%.1f", $value).' %';
}
 
$plot = new LinePlot($x);
 
$plot->setBackgroundColor(
new Color(240, 240, 240)
);
 
$plot->setPadding(40, 15, 15, 15);
 
$plot->setColor(
new Color(60, 60, 150)
);
 
$plot->setFillColor(
new Color(120, 175, 80, 47)
);
 
$plot->grid->setType(Line::DASHED);
 
$plot->yAxis->setLabelNumber(6);
$plot->yAxis->setLabelPrecision(1);
$plot->yAxis->setNumberByTick('minor', 'major', 1);
$plot->yAxis->label->setCallbackFunction('format');
$plot->yAxis->label->setFont(new Tuffy(7));
 
$plot->xAxis->setNumberByTick('minor', 'major', 3);
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->setLabelInterval(50);
$plot->xAxis->label->setFont(new Tuffy(7));
 
$plot->grid->setInterval(1, 50);
 
$graph->shadow->setSize(4);
$graph->shadow->setPosition(Shadow::RIGHT_BOTTOM);
$graph->shadow->smooth(TRUE);
 
$plot->label->set($x);
$plot->label->setInterval(25);
$plot->label->hideFirst(TRUE);
$plot->label->setPadding(1, 1, 1, 1);
$plot->label->setCallbackFunction('format');
$plot->label->setBackgroundColor(
new Color(227, 223, 241, 15)
);
$plot->label->setFont(new Tuffy(7));
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/math-001.php
New file
0,0 → 1,45
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../MathPlot.class.php";
 
 
$graph = new Graph(300, 300);
 
$plot = new MathPlot(-3, 3, 3, -3);
$plot->setInterval(0.2);
$plot->setPadding(NULL, NULL, NULL, 20);
 
$function = new MathFunction('cos');
$function->setColor(new DarkGreen);
$function->mark->setType(Mark::SQUARE);
$function->mark->setSize(3);
$plot->add($function, "f(x) = cos(x)", Legend::MARK);
 
$function = new MathFunction('exp');
$function->setColor(new DarkRed);
$function->mark->setType(Mark::SQUARE);
$function->mark->setSize(3);
$function->mark->setFill(new DarkBlue);
$plot->add($function, "f(x) = exp(x)", Legend::MARK);
 
function x2($x) {
return - $x * $x + 0.5;
}
 
$function = new MathFunction('x2');
$function->setColor(new DarkBlue);
$plot->add($function, "f(x) = - x * x + 0.5");
 
$plot->legend->setPosition(0.9, 0.8);
$plot->legend->setPadding(3, 3, 3, 3, 3);
 
$graph->add($plot);
$graph->draw();
?>
/trunk/bibliotheque/artichow/examples/site/line-004.php
New file
0,0 → 1,104
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
require_once "../../BarPlot.class.php";
 
 
$graph = new Graph(600, 250);
 
$graph->setBackgroundColor(new Color(0xF4, 0xF4, 0xF4));
$graph->shadow->setSize(3);
 
$graph->title->set("Evolution");
$graph->title->setFont(new Tuffy(15));
$graph->title->setColor(new Color(0x00, 0x00, 0x8B));
 
 
$group = new PlotGroup;
$group->setSize(0.82, 1);
$group->setCenter(0.41, 0.5);
$group->setPadding(35, 26, 40, 27);
$group->setSpace(2, 2);
 
$group->grid->setColor(new Color(0xC4, 0xC4, 0xC4));
$group->grid->setType(Line::DASHED);
$group->grid->hideVertical(TRUE);
$group->grid->setBackgroundColor(new White);
 
$group->axis->left->setColor(new DarkGreen);
$group->axis->left->label->setFont(new Font2);
 
$group->axis->right->setColor(new DarkBlue);
$group->axis->right->label->setFont(new Font2);
 
$group->axis->bottom->label->setFont(new Font2);
 
$group->legend->setPosition(1.18);
$group->legend->setTextFont(new Tuffy(8));
$group->legend->setSpace(10);
 
// Add a bar plot
$x = array(16, 16, 12, 13, 11, 18, 10, 12, 11, 12, 11, 16);
 
$plot = new BarPlot($x, 1, 2);
$plot->setBarColor(new MidYellow);
$plot->setBarPadding(0.15, 0.15);
$plot->barShadow->setSize(3);
$plot->barShadow->smooth(TRUE);
$plot->barShadow->setColor(new Color(200, 200, 200, 10));
$plot->move(1, 0);
 
$group->legend->add($plot, "Yellow bar", Legend::BACKGROUND);
$group->add($plot);
 
// Add a bar plot
$x = array(20, 25, 20, 18, 16, 25, 29, 12, 15, 18, 21, 26);
 
$plot = new BarPlot($x, 2, 2);
$plot->setBarColor(new Color(120, 175, 80, 10));
$plot->setBarPadding(0.15, 0.15);
$plot->barShadow->setSize(3);
$plot->barShadow->smooth(TRUE);
$plot->barShadow->setColor(new Color(200, 200, 200, 10));
 
$group->legend->add($plot, "Green bar", Legend::BACKGROUND);
$group->add($plot);
 
// Add a second bar plot
$x = array(12, 14, 10, 9, 10, 16, 12, 8, 8, 10, 12, 13);
 
$plot = new BarPlot($x, 2, 2);
$plot->setBarColor(new Orange);
$plot->setBarPadding(0.15, 0.15);
 
$group->legend->add($plot, "Orange bar", Legend::BACKGROUND);
$group->add($plot);
 
// Add a line plot
$x = array(6, 5, 6, 5.5, 4.5, 4, 4.5, 4, 5, 4, 5, 5.5);
 
$plot = new LinePlot($x, LinePlot::MIDDLE);
$plot->setColor(new DarkBlue);
$plot->setThickness(5);
$plot->setYAxis(Plot::RIGHT);
$plot->setYMax(12);
 
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->setSize(6);
$plot->mark->setFill(new LightBlue);
$plot->mark->border->show();
 
$group->legend->add($plot, "Blue line", Legend::MARK);
$group->add($plot);
 
$graph->add($group);
$graph->draw();
?>
/trunk/bibliotheque/artichow/common.php
New file
0,0 → 1,96
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
/*
* Get the minimum of an array and ignore non numeric values
*/
function array_min($array) {
 
if(is_array($array) and count($array) > 0) {
do {
$min = array_pop($array);
if(is_numeric($min) === FALSE) {
$min = NULL;
}
} while(count($array) > 0 and $min === NULL);
if($min !== NULL) {
$min = (float)$min;
}
foreach($array as $value) {
if(is_numeric($value) and (float)$value < $min) {
$min = (float)$value;
}
}
return $min;
}
return NULL;
 
}
 
/*
* Get the maximum of an array and ignore non numeric values
*/
function array_max($array) {
 
if(is_array($array) and count($array) > 0) {
do {
$max = array_pop($array);
if(is_numeric($max) === FALSE) {
$max = NULL;
}
} while(count($array) > 0 and $max === NULL);
 
if($max !== NULL) {
$max = (float)$max;
}
foreach($array as $value) {
if(is_numeric($value) and (float)$value > $max) {
$max = (float)$value;
}
}
return $max;
}
return NULL;
 
}
/*
* Define file_put_contents() if needed
*/
if(function_exists('file_put_contents') === FALSE) {
 
function file_put_contents($file, $content) {
$fp = fopen($file, 'w');
if($fp) {
fwrite($fp, $content);
fclose($fp);
}
}
}
 
/*
* Change error handler
*/
set_error_handler('errorHandlerArtichow');
 
function errorHandlerArtichow($level, $message, $file, $line) {
awImage::drawError($message.' in '.$file.' on line '.$line.'.');
}
?>
/trunk/bibliotheque/artichow/LinePlot.class.php
New file
0,0 → 1,585
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Plot.class.php";
 
/**
* LinePlot
*
* @package Artichow
*/
class awLinePlot extends awPlot implements awLegendable {
/**
* Add marks to your line plot
*
* @var Mark
*/
public $mark;
/**
* Labels on your line plot
*
* @var Label
*/
public $label;
/**
* Filled areas
*
* @var bool
*/
protected $areas = array();
/**
* Is the line hidden
*
* @var bool
*/
protected $lineHide = FALSE;
/**
* Line color
*
* @var Color
*/
protected $lineColor;
/**
* Line mode
*
* @var int
*/
protected $lineMode = awLinePlot::LINE;
/**
* Line type
*
* @var int
*/
protected $lineStyle = awLine::SOLID;
/**
* Line thickness
*
* @var int
*/
protected $lineThickness = 1;
/**
* Line background
*
* @var Color, Gradient
*/
protected $lineBackground;
/**
* Line mode
*
* @var int
*/
const LINE = 0;
/**
* Line in the middle
*
* @var int
*/
const MIDDLE = 1;
/**
* Construct a new awLinePlot
*
* @param array $values Some numeric values for Y axis
* @param int $mode
*/
public function __construct($values, $mode = awLinePlot::LINE) {
parent::__construct();
$this->mark = new awMark;
$this->label = new awLabel;
$this->lineMode = (int)$mode;
$this->setValues($values);
}
/**
* Hide line
*
* @param bool $hide
*/
public function hideLine($hide) {
$this->lineHide = (bool)$hide;
}
/**
* Add a filled area
*
* @param int $start Begining of the area
* @param int $end End of the area
* @param mixed $background Background color or gradient of the area
*/
public function setFilledArea($start, $stop, $background) {
if($stop <= $start) {
awImage::drawError("Class LinePlot: End position can not be greater than begin position in setFilledArea().");
}
$this->areas[] = array((int)$start, (int)$stop, $background);
}
/**
* Change line color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->lineColor = $color;
}
/**
* Change line style
*
* @param int $style
*/
public function setStyle($style) {
$this->lineStyle = (int)$style;
}
/**
* Change line tickness
*
* @param int $tickness
*/
public function setThickness($tickness) {
$this->lineThickness = (int)$tickness;
}
/**
* Change line background color
*
* @param awColor $color
*/
public function setFillColor(awColor $color) {
$this->lineBackground = $color;
}
/**
* Change line background gradient
*
* @param awGradient $gradient
*/
public function setFillGradient(awGradient $gradient) {
$this->lineBackground = $gradient;
}
 
/**
* Get the line thickness
*
* @return int
*/
public function getLegendLineThickness() {
return $this->lineThickness;
}
 
/**
* Get the line type
*
* @return int
*/
public function getLegendLineStyle() {
return $this->lineStyle;
}
 
/**
* Get the color of line
*
* @return Color
*/
public function getLegendLineColor() {
return $this->lineColor;
}
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground() {
return $this->lineBackground;
}
 
/**
* Get a mark object
*
* @return Mark
*/
public function getLegendMark() {
return $this->mark;
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
$max = $this->getRealYMax();
$min = $this->getRealYMin();
// Get start and stop values
list($start, $stop) = $this->getLimit();
if($this->lineMode === awLinePlot::MIDDLE) {
$inc = $this->xAxis->getDistance(0, 1) / 2;
} else {
$inc = 0;
}
// Build the polygon
$polygon = new awPolygon;
for($key = $start; $key <= $stop; $key++) {
$value = $this->datay[$key];
if($value !== NULL) {
$p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($key, $value));
$p = $p->move($inc, 0);
$polygon->set($key, $p);
}
}
// Draw backgrounds
if($this->lineBackground instanceof awColor or $this->lineBackground instanceof awGradient) {
$backgroundPolygon = new awPolygon;
$p = $this->xAxisPoint($start);
$p = $p->move($inc, 0);
$backgroundPolygon->append($p);
// Add others points
foreach($polygon->all() as $point) {
$backgroundPolygon->append(clone $point);
}
$p = $this->xAxisPoint($stop);
$p = $p->move($inc, 0);
$backgroundPolygon->append($p);
// Draw polygon background
$driver->filledPolygon($this->lineBackground, $backgroundPolygon);
}
$this->drawArea($driver, $polygon);
// Draw line
$prev = NULL;
// Line color
if($this->lineHide === FALSE) {
if($this->lineColor === NULL) {
$this->lineColor = new awColor(0, 0, 0);
}
foreach($polygon->all() as $point) {
if($prev !== NULL) {
$driver->line(
$this->lineColor,
new awLine(
$prev,
$point,
$this->lineStyle,
$this->lineThickness
)
);
}
$prev = $point;
}
 
}
// Draw marks and labels
foreach($polygon->all() as $key => $point) {
 
$this->mark->draw($driver, $point);
$this->label->draw($driver, $point, $key);
}
}
protected function drawArea(awDriver $driver, awPolygon $polygon) {
$starts = array();
foreach($this->areas as $area) {
list($start) = $area;
$starts[$start] = TRUE;
}
// Draw filled areas
foreach($this->areas as $area) {
list($start, $stop, $background) = $area;
$polygonArea = new awPolygon;
$p = $this->xAxisPoint($start);
$polygonArea->append($p);
for($i = $start; $i <= $stop; $i++) {
$p = clone $polygon->get($i);
if($i === $stop and array_key_exists($stop, $starts)) {
$p = $p->move(-1, 0);
}
$polygonArea->append($p);
}
$p = $this->xAxisPoint($stop);
if(array_key_exists($stop, $starts)) {
$p = $p->move(-1, 0);
}
$polygonArea->append($p);
// Draw area
$driver->filledPolygon($background, $polygonArea);
}
}
public function getXAxisNumber() {
if($this->lineMode === awLinePlot::MIDDLE) {
return count($this->datay) + 1;
} else {
return count($this->datay);
}
}
protected function xAxisPoint($position) {
$y = $this->xAxisZero ? 0 : $this->getRealYMin();
return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y));
}
public function getXCenter() {
return ($this->lineMode === awLinePlot::MIDDLE);
}
 
}
 
registerClass('LinePlot');
 
 
/**
* Simple LinePlot
* Useful to draw simple horizontal lines
*
* @package Artichow
*/
class awSimpleLinePlot extends awPlot implements awLegendable {
/**
* Line color
*
* @var Color
*/
protected $lineColor;
/**
* Line start
*
* @var int
*/
protected $lineStart;
/**
* Line stop
*
* @var int
*/
protected $lineStop;
/**
* Line value
*
* @var flaot
*/
protected $lineValue;
/**
* Line mode
*
* @var int
*/
protected $lineMode = awLinePlot::LINE;
/**
* Line type
*
* @var int
*/
protected $lineStyle = awLine::SOLID;
/**
* Line thickness
*
* @var int
*/
protected $lineThickness = 1;
/**
* Line mode
*
* @var int
*/
const LINE = 0;
/**
* Line in the middle
*
* @var int
*/
const MIDDLE = 1;
/**
* Construct a new awLinePlot
*
* @param float $value A Y value
* @param int $start Line start index
* @param int $stop Line stop index
* @param int $mode Line mode
*/
public function __construct($value, $start, $stop, $mode = awLinePlot::LINE) {
parent::__construct();
$this->lineMode = (int)$mode;
$this->lineStart = (int)$start;
$this->lineStop = (int)$stop;
$this->lineValue = (float)$value;
$this->lineColor = new awColor(0, 0, 0);
}
/**
* Change line color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->lineColor = $color;
}
/**
* Change line style
*
* @param int $style
*/
public function setStyle($style) {
$this->lineStyle = (int)$style;
}
/**
* Change line tickness
*
* @param int $tickness
*/
public function setThickness($tickness) {
$this->lineThickness = (int)$tickness;
}
 
/**
* Get the line thickness
*
* @return int
*/
public function getLegendLineThickness() {
return $this->lineThickness;
}
 
/**
* Get the line type
*
* @return int
*/
public function getLegendLineStyle() {
return $this->lineStyle;
}
 
/**
* Get the color of line
*
* @return Color
*/
public function getLegendLineColor() {
return $this->lineColor;
}
 
public function getLegendBackground() {
return NULL;
}
 
public function getLegendMark() {
return NULL;
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
if($this->lineMode === awLinePlot::MIDDLE) {
$inc = $this->xAxis->getDistance(0, 1) / 2;
} else {
$inc = 0;
}
$p1 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStart, $this->lineValue));
$p2 = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($this->lineStop, $this->lineValue));
$driver->line(
$this->lineColor,
new awLine(
$p1->move($inc, 0),
$p2->move($inc, 0),
$this->lineStyle,
$this->lineThickness
)
);
}
public function getXAxisNumber() {
if($this->lineMode === awLinePlot::MIDDLE) {
return count($this->datay) + 1;
} else {
return count($this->datay);
}
}
protected function xAxisPoint($position) {
$y = $this->xAxisZero ? 0 : $this->getRealYMin();
return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y));
}
public function getXCenter() {
return ($this->lineMode === awLinePlot::MIDDLE);
}
 
}
 
registerClass('SimpleLinePlot');
?>
/trunk/bibliotheque/artichow/MathPlot.class.php
New file
0,0 → 1,439
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Component.class.php";
 
/**
* A mathematic function
*
* @package Artichow
*/
class awMathFunction implements awLegendable {
 
/**
* Function line
*
* @var Line
*/
public $line;
/**
* Marks for your plot
*
* @var Mark
*/
public $mark;
/**
* Callback function
*
* @var string
*/
public $f;
/**
* Start the drawing from this value
*
* @var float
*/
public $fromX;
/**
* Stop the drawing at this value
*
* @var float
*/
public $toX;
 
/**
* Line color
*
* @var Color
*/
protected $color;
/**
* Construct the function
*
* @param string $f Callback function
* @param float $fromX
* @param float $toX
*/
public function __construct($f, $fromX = NULL, $toX = NULL) {
$this->f = (string)$f;
$this->fromX = is_null($fromX) ? NULL : (float)$fromX;
$this->toX = is_null($toX) ? NULL : (float)$toX;
$this->line = new awLine;
$this->mark = new awMark;
$this->color = new awBlack;
}
/**
* Change line color
*
* @param awColor $color A new awcolor
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Get line color
*
* @return Color
*/
public function getColor() {
return $this->color;
}
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground() {
}
 
/**
* Get the line thickness
*
* @return NULL
*/
public function getLegendLineThickness() {
return $this->line->getThickness();
}
 
/**
* Get the line type
*
* @return NULL
*/
public function getLegendLineStyle() {
return $this->line->getStyle();
}
 
/**
* Get the color of line
*
* @return NULL
*/
public function getLegendLineColor() {
return $this->color;
}
 
/**
* Get a mark object
*
* @return NULL
*/
public function getLegendMark() {
return $this->mark;
}
 
}
 
registerClass('MathFunction');
/**
* For mathematics functions
*
* @package Artichow
*/
class awMathPlot extends awComponent {
/**
* Functions
*
* @var array
*/
protected $functions = array();
/**
* Grid properties
*
* @var Grid
*/
public $grid;
/**
* X axis
*
* @var Axis
*/
public $xAxis;
/**
* Y axis
*
* @var Axis
*/
public $yAxis;
/**
* Extremum
*
* @var Side
*/
private $extremum = NULL;
/**
* Interval
*
* @var float
*/
private $interval = 1;
/**
* Build the plot
*
* @param int $xMin Minimum X value
* @param int $xMax Maximum X value
* @param int $yMax Maximum Y value
* @param int $yMin Minimum Y value
*/
public function __construct($xMin, $xMax, $yMax, $yMin) {
parent::__construct();
$this->setPadding(8, 8, 8, 8);
$this->grid = new awGrid;
// Hide grid by default
$this->grid->hide(TRUE);
// Set extremum
$this->extremum = new awSide($xMin, $xMax, $yMax, $yMin);
// Create axis
$this->xAxis = new awAxis;
$this->xAxis->setTickStyle(awTick::IN);
$this->xAxis->label->hideValue(0);
$this->initAxis($this->xAxis);
$this->yAxis = new awAxis;
$this->yAxis->setTickStyle(awTick::IN);
$this->yAxis->label->hideValue(0);
$this->initAxis($this->yAxis);
}
protected function initAxis(awAxis $axis) {
$axis->setLabelPrecision(1);
$axis->addTick('major', new awTick(0, 5));
$axis->addTick('minor', new awTick(0, 3));
$axis->addTick('micro', new awTick(0, 1));
$axis->setNumberByTick('minor', 'major', 1);
$axis->setNumberByTick('micro', 'minor', 4);
$axis->label->setFont(new awTuffy(7));
}
/**
* Interval to calculate values
*
* @param float $interval
*/
public function setInterval($interval) {
$this->interval = (float)$interval;
}
/**
* Add a formula f(x)
*
* @param awMathFunction $function
* @param string $name Name for the legend (can be NULL if you don't want to set a legend)
* @param int $type Type for the legend
*/
public function add(awMathFunction $function, $name = NULL, $type = awLegend::LINE) {
$this->functions[] = $function;
if($name !== NULL) {
$this->legend->add($function, $name, $type);
}
}
public function init(awDriver $driver) {
list($x1, $y1, $x2, $y2) = $this->getPosition();
$this->xAxis->line->setX($x1, $x2);
$this->xAxis->label->setAlign(NULL, awLabel::BOTTOM);
$this->xAxis->label->move(0, 3);
$this->xAxis->setRange($this->extremum->left, $this->extremum->right);
$this->yAxis->line->setY($y2, $y1);
$this->yAxis->label->setAlign(awLabel::RIGHT);
$this->yAxis->label->move(-6, 0);
$this->yAxis->reverseTickStyle();
$this->yAxis->setRange($this->extremum->bottom, $this->extremum->top);
$this->xAxis->setYCenter($this->yAxis, 0);
$this->yAxis->setXCenter($this->xAxis, 0);
if($this->yAxis->getLabelNumber() === NULL) {
$number = $this->extremum->top - $this->extremum->bottom + 1;
$this->yAxis->setLabelNumber($number);
}
if($this->xAxis->getLabelNumber() === NULL) {
$number = $this->extremum->right - $this->extremum->left + 1;
$this->xAxis->setLabelNumber($number);
}
// Set ticks
$this->xAxis->tick('major')->setNumber($this->xAxis->getLabelNumber());
$this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber());
// Set axis labels
$labels = array();
for($i = 0, $count = $this->xAxis->getLabelNumber(); $i < $count; $i++) {
$labels[] = $i;
}
$this->xAxis->label->set($labels);
$labels = array();
for($i = 0, $count = $this->yAxis->getLabelNumber(); $i < $count; $i++) {
$labels[] = $i;
}
$this->yAxis->label->set($labels);
parent::init($driver);
// Create the grid
$this->createGrid();
// Draw the grid
$this->grid->draw($driver, $x1, $y1, $x2, $y2);
}
public function drawEnvelope(awDriver $driver) {
// Draw axis
$this->xAxis->draw($driver);
$this->yAxis->draw($driver);
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
foreach($this->functions as $function) {
$f = $function->f;
$fromX = is_null($function->fromX) ? $this->extremum->left : $function->fromX;
$toX = is_null($function->toX) ? $this->extremum->right : $function->toX;
$old = NULL;
for($i = $fromX; $i <= $toX; $i += $this->interval) {
$p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($i, $f($i)));
if($p->y >= $y1 and $p->y <= $y2) {
$function->mark->draw($driver, $p);
}
if($old !== NULL) {
$line = $function->line;
$line->setLocation($old, $p);
if(
($line->p1->y >= $y1 and $line->p1->y <= $y2) or
($line->p2->y >= $y1 and $line->p2->y <= $y2)
) {
$driver->line(
$function->getColor(),
$line
);
}
}
$old = $p;
}
// Draw last point if needed
if($old !== NULL and $i - $this->interval != $toX) {
$p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($toX, $f($toX)));
if($p->y >= $y1 and $p->y <= $y2) {
$function->mark->draw($driver, $p);
}
$line = $function->line;
$line->setLocation($old, $p);
if(
($line->p1->y >= $y1 and $line->p1->y <= $y2) or
($line->p2->y >= $y1 and $line->p2->y <= $y2)
) {
$driver->line(
$function->getColor(),
$line
);
}
}
}
}
protected function createGrid() {
// Horizontal lines of the grid
 
$major = $this->yAxis->tick('major');
$interval = $major->getInterval();
$number = $this->yAxis->getLabelNumber() - 1;
$h = array();
if($number > 0) {
for($i = 0; $i <= $number; $i++) {
$h[] = $i / $number;
}
}
// Vertical lines
$major = $this->xAxis->tick('major');
$interval = $major->getInterval();
$number = $this->xAxis->getLabelNumber() - 1;
$w = array();
if($number > 0) {
for($i = 0; $i <= $number; $i++) {
if($i%$interval === 0) {
$w[] = $i / $number;
}
}
}
$this->grid->setGrid($w, $h);
}
 
}
 
registerClass('MathPlot');
?>
/trunk/bibliotheque/artichow/ChangeLog
New file
0,0 → 1,170
Artichow 1.1
 
- All new driver-based architecture: Artichow now draws the graphs using drivers, located in 'inc/drivers/'. The move will ease development of new drawing formats (SVG, Flash, etc.) while keeping backward compatibility very high: you shouldn't have to change anything to your existing code and only two methods from the Font class have disappeared (see below) (Laurent)
- Added Image::setDriver() to allow driver selection (Laurent)
- Changed the Drawer class name to Driver. The class is now abstract, the implementation has to be made in the driver file itself. (Laurent)
- Added the GDDriver class to draw with GD: the file is 'inc/drivers/gd.class.php' (Laurent)
- Modified GDDriver::rectangle() so that it doesn't tamper with the Line object passed as an argument any more (Laurent)
- Fixed a bug where calling GDDriver::polygon() wouldn't close the polygon being drawn when using a non-solid border (Laurent)
- Added the constant ARTICHOW_DRIVER to define the default driver to use when none is selected (defaults to 'gd') (Laurent)
- Changed and reorganised the Font related classes: added FileFont and PHPFont, reworked inheritance (Laurent)
- Deleted Font::getTextWidth() and Font::getTextHeight(), replaced by Driver::getTextWidth() and Driver::getTextHeight() (Laurent)
- Added two new helping classes for Font manipulation, PHPFontDriver and FileFontDriver (Laurent)
- Fixed a bug that prevented values passed to Grid::setGrid() to have any effect (Laurent)
- Added four new types of Mark (Mark::INVERTED_TRIANGLE, Mark::RHOMBUS, Mark::CROSS, Mark::PLUS) (Geoffrey)
- Updated Image::drawError() so that it doesn't display HTML tags any more (Laurent)
- Modified Lable::setCallbackFunction() so that it now accepts static method callbacks (i.e. setCallbackFunction(array($this, 'methodName'))) (Vincent)
- Code cleanup and tweaking
 
Artichow 1.0.9
 
- Fixed a bug in Font class (second argument of wordwrap() can not be empty) (Vincent)
- Fixed a bug in Drawer class (text size was not handled correctly) (Vincent)
- Added support for using font paths containing space character when using GD <= 2.0.18 (bug#12) (Vincent)
- Fixed a bug where the HTTP headers were sent even though the draw() method was called with Graph::DRAW_RETURN or a filename (Laurent)
- Added support for antialiased pies on non-white background (only work with plain colors) (thanks to Eldwin) (Laurent)
- Anti-aliasing is now handled by the Drawer class (Laurent)
- Added method Drawer::setAntiAliasing() to turn anti-aliasing on or off (Laurent)
- Fixed a bug where a LinePlot with multiple lines of different thickness wouldn't have its anti-aliasing setting correctly handled (Laurent)
- Fixed a bug where the X axis wouldn't be labelled properly (bug#16) (Laurent)
- Added a new type of Mark (Mark::TRIANGLE) (Laurent)
- Fixed a bug where calling Axis::setYMax() wouldn't have any effect when drawing the axis (Vincent)
- Fixed a bug where a dashed line wouldn't been drawn properly in certain circumstances (Laurent)
- Fixed a bug where using Label::setFormat() or Label::setCallbackFunction() would be overriden by Axis::setLabelPrecision() (Laurent)
- Fixed a "division by zero" error when using a gradient fill on a LinePlot with zeroed values (bug#19) (Laurent)
- General code cleanup
 
Artichow 1.0.8
 
- Enhanced error support
- Added multi-line text support
- Updated and improved documentation
- Changed Graph::draw() method to accept more options
- Deleted first parameter of Image::send() method
- Added a third parameter to Image::send() method to disable auto-sending of Content-Type header
- Added a second parameter to Image::send() method to return an image instead of outputing it
- Fixed a fatal error on direct access to files Image.class.php and inc/*
- Fixed a bug in configuration file (bad constant definition check for ARTICHOW_CACHE_DIRECTORY)
 
Artichow 1.0.7
 
- Added constant ARTICHOW_CACHE_DIRECTORY to choose cache directory
- Fixed a division by zero bug in Axis class
- Improved cache handling
- Fixed a bug with ob_* handlers
- Fixed a bug for lines thickness
- Shadow color now works fine
 
Artichow 1.0.6
 
- Added method Plot::setYAxisZero()
- Added auto-scaling for plots
- Added constant ARTICHOW_CACHE to enable/disable the cache
- Improved prefix for classes
 
Artichow 1.0.5
 
- Added constant ARTICHOW_PREFIX to prefix Artichow's classes (bug #000002)
- Added methods Shadow::hide() and Shadow::show()
- Added method Plot::reduce()
- It is now possible to save its charts in a file
- Fixed a bug in PlotGroup (setYMin() / setYMax() did not work)
- Fixed an incoherent behaviour if some values in $datay are not numeric (LinePlot, BarPlot, ScatterPlot)
- Fixed an inclusion bug in Pattern
- Fixed a bug for PHP 5.1.0
 
Artichow 1.0.4
 
- Added support for GIF images
- Added patterns (Pattern.class.php)
- Added titles on axis
- Renamed Artichow.class.php to Graph.class.php (break backward compatibility)
- Added a README file
- Added support for ScatterPlot
- Merged setBackgroundColor() and setBackgroundGradient() into setFill() in class Mark (break backward compatibility)
- Added an optional argument $size to Mark::setType()
- Grid background in now default to white in class Plot
- Changed class Polygon to accept NULL values
- Added a new legend type (Legend::MARKONLY)
- Added method Legend::show()
- Added methods Mark::move(), Mark::hide() and Mark::show()
- Added new marks (star, book, ...)
- Added methods Label::setBackground() and Legend::setBackground()
- Added methods Plot::setXMax(), Plot::setXMin(), PlotGroup::setXMax() and PlotGroup::setXMin()
- Added new colors to default theme in Pie
- Removed methods Drawer::setBackground*()
- Tests have been removed from the archive
- Moved methods Component::addLabel() and Component::addAbsLabel() to class Graph
- Modes LinePlot::MIDDLE and LinePlot::BAR have been merged into LinePlot::MIDDLE (break backward compatibility)
- Fixed a bug in Artichow.cfg.php (unable to use some ttf fonts)
- Fixed a bug in Legend (position of marks was sometimes broken)
- Fixed a bug in Pie (pies can now take only a single value)
- Fixed some bugs in Plot / LinePlot
- Fixed a bug in Font::draw() (call to undefined function trigger__error)
 
Artichow 1.0.3 (beta)
 
- Added EXPERIMENTAL support for PHP 4
- Changed class BarPlot so it now uses class Border instead of setBorderThickness() and setBorderColor()
- Changed class Legend so it now uses class Border instead of setBorderSize() and setBorderColor()
- Changed class Mark so it now uses class Border instead of setBorderSize() and setBorderColor()
- Changed class Text so it now uses class Border instead of setBorderColor()
- Changed class Label so it now uses class Border instead of setBorderColor()
- Drawer::drawRectangle() and Drawer::drawFilledRectangle() now take a line as second argument
- Added styles to rectangles and polygons
- BarPlot::setBarPadding() takes now values in per-cent instead of pixels
- Merged drawFilledRectangleColor() and drawFilledRectangleGradient() into drawFilledRectangle() in class Drawer
- Merged drawFilledPolygonColor() and drawFilledPolygonGradient() into drawFilledPolygon() in class Drawer
- Merged drawFilledEllipseColor() and drawFilledEllipseGradient() into drawFilledEllipse() in class Drawer
- Added method BarPlot::setBarWidth()
- Added an optional border to the class Image
- Added a new class Border
- Added support for MathPlot
- LinePlot::STEP has been removed
- Merged classes Paragraph and Label (no changes in the API)
- Method Plot::setLabelCenter() is obsolete and has been removed
- Rewrited Axis (add a new class Tick) (break backward compatibility)
- Removed draw*Triangle* from class Drawer (use polygons instead)
- Removed prefix draw in each method of class Drawer
- Renamed LinePlot::setLineType() into LinePlot::setStyle()
- Renamed LinePlot::setLineThickness() into LinePlot::setThickness()
- Renamed LinePlot::setLineColor() into LinePlot::setColor()
- Renamed LinePlot::setLineBackgroundColor() to LinePlot::setFillColor()
- Renamed LinePlot::setLineBackgroundGradient() to LinePlot::setFillGradient()
- Renamed Line::setType() to Line::setStyle()
- Added methods Label::get(), Label::setFormat() and change method Label::setFont()
- Added a parameter $smooth in Shadow::setSize();
- Added filled areas in LinePlot
- Added lots of new features in Math.class.php
- Fixed a bug in Math::isVertical() and Math::isHorizontal()
- Fixed a bug in Legend (shadow is now well-positioned is there is no border on the legend)
- Lots of minor changes
 
Artichow 1.0.2 (beta)
 
- Added support for pies (2D & 3D)
- Moved shadow from class Component to class Image
- X Axis are now centered on 0 by default on bar and line plots
- Added title to Graphs
- Added 4 named fonts
- Added 50 named colors
- Added shadow to legends
- Added method Image::setBackgroundGradient()
- Added methods Label::setCallbackFunction() and Label::hide()
- Added method Legend::hide()
- Added methods Drawer::copyResizeImage(), Drawer::drawArc() and Drawer::drawFilledArcColor()
- Renamed Positionable::setHorizontalAlign() and Positionable::setVerticalAlign() to Positionable::setAlign()
- API for ellipses has changed
- Title is now a property instead of a method in Component
- Removed old code, that fixes a bug in the grid
- Fixed a bug that affects position of bars in some cases
- Fixed wrong size of shadow
- Fixed a bug in Plot::setYMin() and Plot::setYMax()
 
Artichow 1.0.1 (alpha)
 
- Added anti-spam images
 
Artichow 1.0.0 (alpha)
 
- Initial release
/trunk/bibliotheque/artichow/Graph.class.php
New file
0,0 → 1,412
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Image.class.php";
 
/**
* A graph
*
* @package Artichow
*/
class awGraph extends awImage {
 
/**
* Graph name
*
* @var string
*/
protected $name;
 
/**
* Cache timeout
*
* @var int
*/
protected $timeout = 0;
/**
* Graph timing ?
*
* @var bool
*/
protected $timing;
/**
* Components
*
* @var array
*/
private $components = array();
/**
* Some labels to add to the component
*
* @var array
*/
protected $labels = array();
/**
* Graph title
*
* @var Label
*/
public $title;
/**
* File cache location
*
* @var string
*/
private $fileCache;
/**
* Time file cache location
*
* @var string
*/
private $fileCacheTime;
/**
* Drawing mode to return the graph
*
* @var int
*/
const DRAW_RETURN = 1;
/**
* Drawing mode to display the graph
*
* @var int
*/
const DRAW_DISPLAY = 2;
/**
* Construct a new graph
*
* @param int $width Graph width
* @param int $height Graph height
* @param string $name Graph name for the cache (must be unique). Let it null to not use the cache.
* @param int $timeout Cache timeout (unix timestamp)
*/
public function __construct($width = NULL, $height = NULL, $name = NULL, $timeout = 0) {
parent::__construct();
$this->setSize($width, $height);
 
if(ARTICHOW_CACHE) {
$this->name = $name;
$this->timeout = $timeout;
// Clean sometimes all the cache
if(mt_rand(0, 5000) === 0) {
awGraph::cleanCache();
}
// Take the graph from the cache if possible
if($this->name !== NULL) {
$this->fileCache = ARTICHOW_CACHE_DIRECTORY."/".$this->name;
$this->fileCacheTime = $this->fileCache."-time";
if(is_file($this->fileCache)) {
$type = awGraph::cleanGraphCache($this->fileCacheTime);
if($type === NULL) {
awGraph::deleteFromCache($this->name);
} else {
header("Content-Type: image/".$type);
echo file_get_contents($this->fileCache);
exit;
}
}
}
}
$this->title = new awLabel(
NULL,
new awTuffy(16),
NULL,
0
);
$this->title->setAlign(awLabel::CENTER, awLabel::BOTTOM);
}
/**
* Delete a graph from the cache
*
* @param string $name Graph name
* @return bool TRUE on success, FALSE on failure
*/
public static function deleteFromCache($name) {
 
if(ARTICHOW_CACHE) {
if(is_file(ARTICHOW_CACHE_DIRECTORY."/".$name."-time")) {
unlink(ARTICHOW_CACHE_DIRECTORY."/".$name."");
unlink(ARTICHOW_CACHE_DIRECTORY."/".$name."-time");
}
}
}
/**
* Delete all graphs from the cache
*/
public static function deleteAllCache() {
 
if(ARTICHOW_CACHE) {
$dp = opendir(ARTICHOW_CACHE_DIRECTORY);
while($file = readdir($dp)) {
if($file !== '.' and $file != '..') {
unlink(ARTICHOW_CACHE_DIRECTORY."/".$file);
}
}
}
}
/**
* Clean cache
*/
public static function cleanCache() {
 
if(ARTICHOW_CACHE) {
$glob = glob(ARTICHOW_CACHE_DIRECTORY."/*-time");
foreach($glob as $file) {
$type = awGraph::cleanGraphCache($file);
if($type === NULL) {
$name = ereg_replace(".*/(.*)\-time", "\\1", $file);
awGraph::deleteFromCache($name);
}
}
}
}
/**
* Enable/Disable Graph timing
*
* @param bool $timing
*/
public function setTiming($timing) {
$this->timing = (bool)$timing;
}
/**
* Add a component to the graph
*
* @param awComponent $component
*/
public function add(awComponent $component) {
$this->components[] = $component;
}
/**
* Add a label to the component
*
* @param awLabel $label
* @param int $x Position on X axis of the center of the text
* @param int $y Position on Y axis of the center of the text
*/
public function addLabel(awLabel $label, $x, $y) {
$this->labels[] = array(
$label, $x, $y
);
}
/**
* Add a label to the component with absolute position
*
* @param awLabel $label
* @param awPoint $point Text position
*/
public function addAbsLabel(awLabel $label, awPoint $point) {
$this->labels[] = array(
$label, $point
);
}
/**
* Build the graph and draw component on it
*
* @param string $mode Display mode (can be a file name)
*/
public function draw($mode = Graph::DRAW_DISPLAY) {
if($this->timing) {
$time = microtimeFloat();
}
$this->create();
foreach($this->components as $component) {
$this->drawComponent($component);
}
$this->drawTitle();
$this->drawShadow();
$this->drawLabels();
if($this->timing) {
$this->drawTiming(microtimeFloat() - $time);
}
// Create graph
$data = $this->get();
// Put the graph in the cache if needed
$this->cache($data);
switch($mode) {
case Graph::DRAW_DISPLAY :
$this->sendHeaders();
echo $data;
break;
case Graph::DRAW_RETURN :
return $data;
default :
if(is_string($mode)) {
file_put_contents($mode, $data);
} else {
awImage::drawError("Class Graph: Unable to draw the graph.");
}
}
 
}
private function drawLabels() {
$driver = $this->getDriver();
foreach($this->labels as $array) {
if(count($array) === 3) {
// Text in relative position
list($label, $x, $y) = $array;
$point = new awPoint(
$x * $this->width,
$y * $this->height
);
} else {
// Text in absolute position
list($label, $point) = $array;
}
$label->draw($driver, $point);
}
}
private function drawTitle() {
$driver = $this->getDriver();
$point = new awPoint(
$this->width / 2,
10
);
$this->title->draw($driver, $point);
}
private function drawTiming($time) {
$driver = $this->getDriver();
$label = new awLabel;
$label->set("(".sprintf("%.3f", $time)." s)");
$label->setAlign(awLabel::LEFT, awLabel::TOP);
$label->border->show();
$label->setPadding(1, 0, 0, 0);
$label->setBackgroundColor(new awColor(230, 230, 230, 25));
$label->draw($driver, new awPoint(5, $driver->imageHeight - 5));
}
private function cache($data) {
if(ARTICHOW_CACHE and $this->name !== NULL) {
if(is_writable(ARTICHOW_CACHE_DIRECTORY) === FALSE) {
awImage::drawError("Class Graph: Cache directory is not writable.");
}
file_put_contents($this->fileCache, $data);
file_put_contents($this->fileCacheTime, $this->timeout."\n".$this->getFormatString());
}
}
private static function cleanGraphCache($file) {
list(
$time,
$type
) = explode("\n", file_get_contents($file));
$time = (int)$time;
if($time !== 0 and $time < time()) {
return NULL;
} else {
return $type;
}
}
 
}
 
registerClass('Graph');
 
/*
* To preserve PHP 4 compatibility
*/
function microtimeFloat() {
list($usec, $sec) = explode(" ", microtime());
return (float)$usec + (float)$sec;
}
?>
/trunk/bibliotheque/artichow/Component.class.php
New file
0,0 → 1,415
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/Graph.class.php";
 
 
/**
* A graph can contain some groups of components
*
* @package Artichow
*/
abstract class awComponentGroup extends awComponent {
 
/**
* Components of this group
*
* @var array
*/
protected $components;
/**
* Build the component group
*/
public function __construct() {
parent::__construct();
$this->components = array();
}
 
/**
* Add a component to the group
*
* @param awComponent $component A component
*/
public function add(awComponent $component) {
$this->components[] = $component;
}
 
}
 
registerClass('ComponentGroup', TRUE);
 
abstract class awComponent {
 
/**
* Component driver
*
* @var Driver
*/
protected $driver;
 
/**
* Component width
*
* @var float
*/
public $width = 1.0;
 
/**
* Component height
*
* @var float
*/
public $height = 1.0;
 
/**
* Position X of the center the graph (from 0 to 1)
*
* @var float
*/
public $x = 0.5;
 
/**
* Position Y of the center the graph (from 0 to 1)
*
* @var float
*/
public $y = 0.5;
/**
* Component absolute width (in pixels)
*
*
* @var int
*/
public $w;
/**
* Component absolute height (in pixels)
*
*
* @var int
*/
public $h;
 
/**
* Left-top corner Y position
*
* @var float
*/
public $top;
 
/**
* Left-top corner X position
*
* @var float
*/
public $left;
/**
* Component background color
*
* @var Color
*/
protected $background;
/**
* Component padding
*
* @var Side
*/
protected $padding;
/**
* Component space
*
* @var Side
*/
protected $space;
/**
* Component title
*
* @var Label
*/
public $title;
/**
* Adjust automatically the component ?
*
* @var bool
*/
protected $auto = TRUE;
/**
* Legend
*
* @var Legend
*/
public $legend;
/**
* Build the component
*/
public function __construct() {
// Component legend
$this->legend = new awLegend();
$this->padding = new awSide(25, 25, 25, 25);
$this->space = new awSide(0, 0, 0, 0);
// Component title
$this->title = new awLabel(
NULL,
new awTuffy(10),
NULL,
0
);
$this->title->setAlign(awLabel::CENTER, awLabel::TOP);
}
/**
* Adjust automatically the component ?
*
* @param bool $auto
*/
public function auto($auto) {
$this->auto = (bool)$auto;
}
/**
* Change the size of the component
*
* @param int $width Component width (from 0 to 1)
* @param int $height Component height (from 0 to 1)
*/
public function setSize($width, $height) {
$this->width = (float)$width;
$this->height = (float)$height;
}
/**
* Change the absolute size of the component
*
* @param int $w Component width (in pixels)
* @param int $h Component height (in pixels)
*/
public function setAbsSize($w, $h) {
$this->w = (int)$w;
$this->h = (int)$h;
}
/**
* Change component background color
*
* @param awColor $color (can be null)
*/
public function setBackgroundColor($color) {
if($color === NULL or $color instanceof awColor) {
$this->background = $color;
}
}
/**
* Change component background gradient
*
* @param awGradient $gradient (can be null)
*/
public function setBackgroundGradient($gradient) {
if($gradient === NULL or $gradient instanceof awGradient) {
$this->background = $gradient;
}
}
/**
* Change component background image
*
* @param awImage $image (can be null)
*/
public function setBackgroundImage($image) {
if($image === NULL or $image instanceof awImage) {
$this->background = $image;
}
}
/**
* Return the component background
*
* @return Color, Gradient
*/
public function getBackground() {
return $this->background;
}
/**
* Change component padding
*
* @param int $left Padding in pixels (NULL to keep old value)
* @param int $right Padding in pixels (NULL to keep old value)
* @param int $top Padding in pixels (NULL to keep old value)
* @param int $bottom Padding in pixels (NULL to keep old value)
*/
public function setPadding($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
$this->padding->set($left, $right, $top, $bottom);
}
/**
* Change component space
*
* @param float $left Space in % (NULL to keep old value)
* @param float $right Space in % (NULL to keep old value)
* @param float $bottom Space in % (NULL to keep old value)
* @param float $top Space in % (NULL to keep old value)
*/
public function setSpace($left = NULL, $right = NULL, $bottom = NULL, $top = NULL) {
$this->space->set($left, $right, $bottom, $top);
}
/**
* Change the absolute position of the component on the graph
*
* @var int $x Left-top corner X position
* @var int $y Left-top corner Y position
*/
public function setAbsPosition($left, $top) {
$this->left = (int)$left;
$this->top = (int)$top;
}
/**
* Set the center of the component
*
* @param int $x Position X of the center of the component
* @param int $y Position Y of the center of the component
*/
public function setCenter($x, $y) {
$this->x = (float)$x;
$this->y = (float)$y;
}
/**
* Get component coords with its padding
*
* @return array Coords of the component
*/
public function getPosition() {
// Get component coords
$x1 = $this->padding->left;
$y1 = $this->padding->top;
$x2 = $this->w - $this->padding->right;
$y2 = $this->h - $this->padding->bottom;
return array($x1, $y1, $x2, $y2);
}
/**
* Init the drawing of the component
*/
public function init(awDriver $driver) {
 
// Set component background
$background = $this->getBackground();
if($background !== NULL) {
$p1 = new awPoint(0, 0);
$p2 = new awPoint($this->w - 1, $this->h - 1);
if($background instanceof awImage) {
$driver->copyImage(
$background,
$p1,
$p2
);
} else {
$driver->filledRectangle(
$background,
new awLine($p1, $p2)
);
}
}
}
/**
* Finalize the drawing of the component
*/
public function finalize(awDriver $driver) {
// Draw component title
$point = new awPoint(
$this->w / 2,
$this->padding->top - 8
);
$this->title->draw($driver, $point);
// Draw legend
$this->legend->draw($driver);
}
/**
* Draw the grid around your component
*
* @param Driver A driver
* @return array Coords for the component
*/
abstract public function drawEnvelope(awDriver $driver);
/**
* Draw the component on the graph
* Component should be drawed into specified coords
*
* @param Driver A driver
* @param int $x1
* @param int $y1
* @param int $x2
* @param int $y2
* @param bool $aliasing Use anti-aliasing to draw the component ?
*/
abstract public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing);
/**
* Get space width in pixels
*
* @param int $width Component width
* @param int $height Component height
* @return array
*/
protected function getSpace($width, $height) {
$left = (int)($width * $this->space->left / 100);
$right = (int)($width * $this->space->right / 100);
$top = (int)($height * $this->space->top / 100);
$bottom = (int)($height * $this->space->bottom / 100);
return array($left, $right, $top, $bottom);
}
}
 
registerClass('Component', TRUE);
?>
/trunk/bibliotheque/artichow/BarPlot.class.php
New file
0,0 → 1,364
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Plot.class.php";
 
/**
* BarPlot
*
* @package Artichow
*/
class awBarPlot extends awPlot implements awLegendable {
/**
* Labels on your bar plot
*
* @var Label
*/
public $label;
/**
* Bar plot identifier
*
* @var int
*/
protected $identifier;
/**
* Bar plot number
*
* @var int
*/
protected $number;
/**
* Bar plot depth
*
* @var int
*/
protected $depth;
/**
* For moving bars
*
* @var int
*/
protected $move;
/**
* Bars shadow
*
* @var Shadow
*/
public $barShadow;
/**
* Bars border
*
* @var Border
*/
public $barBorder;
/**
* Bars padding
*
* @var Side
*/
protected $barPadding;
/**
* Bars space
*
* @var int
*/
protected $barSpace = 0;
/**
* Bars background
*
* @var Color, Gradient
*/
protected $barBackground;
/**
* Construct a new awBarPlot
*
* @param array $values Some numeric values for Y axis
* @param int $identifier Plot identifier
* @param int $number Bar plot number
* @param int $depth Bar plot depth in pixels
*/
public function __construct($values, $identifier = 1, $number = 1, $depth = 0) {
parent::__construct();
$this->label = new awLabel;
$this->barPadding = new awSide(0.08, 0.08, 0, 0);
$this->barShadow = new awShadow(awShadow::RIGHT_TOP);
$this->barBorder = new awBorder;
$this->setValues($values);
$this->identifier = (int)$identifier;
$this->number = (int)$number;
$this->depth = (int)$depth;
$this->move = new awSide;
// Hide vertical grid
$this->grid->hideVertical(TRUE);
}
/**
* Change bars padding
* This method is not compatible with awBarPlot::setBarPadding()
*
* @param float $left Left padding (between 0 and 1)
* @param float $right Right padding (between 0 and 1)
*/
public function setBarPadding($left = NULL, $right = NULL) {
$this->barPadding->set($left, $right);
}
/**
* Change bars size
* This method is not compatible with awBarPlot::setBarPadding()
*
* @param int $width Bars size (between 0 and 1)
*/
public function setBarSize($size) {
$padding = (1 - $size) / 2;
$this->barPadding->set($padding, $padding);
}
/**
* Move bars
*
* @param int $x
* @param int $y
*/
public function move($x, $y) {
$this->move->set($x, NULL, $y, NULL);
}
/**
* Change bars space
*
* @param int $space Space in pixels
*/
public function setBarSpace($space) {
$this->barSpace = (int)$space;
}
/**
* Change line background color
*
* @param awColor $color
*/
public function setBarColor(awColor $color) {
$this->barBackground = $color;
}
/**
* Change line background gradient
*
* @param awGradient $gradient
*/
public function setBarGradient(awGradient $gradient) {
$this->barBackground = $gradient;
}
 
/**
* Get the line thickness
*
* @return int
*/
public function getLegendLineThickness() {
}
 
/**
* Get the line type
*
* @return int
*/
public function getLegendLineStyle() {
}
 
/**
* Get the color of line
*
* @return Color
*/
public function getLegendLineColor() {
}
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground() {
return $this->barBackground;
}
 
/**
* Get a mark object
*
* @return Mark
*/
public function getLegendMark() {
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
$count = count($this->datay);
$max = $this->getRealYMax(NULL);
$min = $this->getRealYMin(NULL);
// Find zero for bars
if($this->xAxisZero and $min <= 0 and $max >= 0) {
$zero = 0;
} else if($max < 0) {
$zero = $max;
} else {
$zero = $min;
}
// Get base position
$zero = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint(0, $zero));
// Distance between two values on the graph
$distance = $this->xAxis->getDistance(0, 1);
// Compute paddings
$leftPadding = $this->barPadding->left * $distance;
$rightPadding = $this->barPadding->right * $distance;
$padding = $leftPadding + $rightPadding;
$space = $this->barSpace * ($this->number - 1);
$barSize = ($distance - $padding - $space) / $this->number;
$barPosition = $leftPadding + $barSize * ($this->identifier - 1);
for($key = 0; $key < $count; $key++) {
$value = $this->datay[$key];
if($value !== NULL) {
$position = awAxis::toPosition(
$this->xAxis,
$this->yAxis,
new awPoint($key, $value)
);
$barStart = $barPosition + ($this->identifier - 1) * $this->barSpace + $position->x;
$barStop = $barStart + $barSize;
$t1 = min($zero->y, $position->y);
$t2 = max($zero->y, $position->y);
if(round($t2 - $t1) == 0) {
continue;
}
$p1 = new awPoint(
round($barStart) + $this->depth + $this->move->left,
round($t1) - $this->depth + $this->move->top
);
$p2 = new awPoint(
round($barStop) + $this->depth + $this->move->left,
round($t2) - $this->depth + $this->move->top
);
$this->drawBar($driver, $p1, $p2);
}
}
// Draw labels
foreach($this->datay as $key => $value) {
if($value !== NULL) {
$position = awAxis::toPosition(
$this->xAxis,
$this->yAxis,
new awPoint($key, $value)
);
$point = new awPoint(
$barPosition + ($this->identifier - 1) * $this->barSpace + $position->x + $barSize / 2 + 1 + $this->depth,
$position->y - $this->depth
);
$this->label->draw($driver, $point, $key);
}
}
}
public function getXAxisNumber() {
return count($this->datay) + 1;
}
// ça bidouille à fond ici !
public function getXMax() {
return array_max($this->datax) + 1;
}
public function getXCenter() {
return TRUE;
}
protected function drawBar(awDriver $driver, awPoint $p1, awPoint $p2) {
// Draw shadow
$this->barShadow->draw(
$driver,
$p1,
$p2,
awShadow::OUT
);
if(abs($p2->y - $p1->y) > 1) {
$this->barBorder->rectangle(
$driver,
$p1,
$p2
);
if($this->barBackground !== NULL) {
$size = $this->barBorder->visible() ? 1 : 0;
$b1 = $p1->move($size, $size);
$b2 = $p2->move(-1 * $size, -1 * $size);
// Draw background
$driver->filledRectangle(
$this->barBackground,
new awLine($b1, $b2)
);
}
}
}
 
}
 
registerClass('BarPlot');
?>
/trunk/bibliotheque/artichow/README
New file
0,0 → 1,120
I. Installation
II. Configuration
III. Utilisation
IV. Divers
 
 
I. Installation
------------
 
*** Première installation ***
 
L'installation de Artichow se résume à décompresser l'archive dans le dossier
de votre choix sur votre serveur. Veillez simplement à télécharger l'archive
dont vous avez vraiment besoin (PHP 5 ou PHP 4 & 5).
Notez que Artichow requiert GD 2 et PHP 4.3.0 au minimum pour fonctionner.
 
*** Mise à jour ***
 
Lorsque vous souhaitez mettre à jour Artichow avec la dernière version,
essayez de suivre pas à pas ces étapes :
1) Décompressez la dernière version de Artichow dans un dossier
2) Ecrasez le fichier Artichow.cfg.php avec votre ancien fichier
3) Copiez vos patterns dans le dossier patterns/ de la nouvelle version
4) Supprimez l'ancienne version de Artichow de votre disque
5) Copiez la nouvelle version là où était l'ancienne
Une fois ces cinq étapes effectuées, vous n'aurez plus qu'à mettre
éventuellement à jour vos graphiques, en fonction des dernières évolutions de
l'API de Artichow. Pour cela, voyez le titre "Migrer d'une version à l'autre"
sur la page :
http://www.artichow.org/documentation
 
II. Configuration
-------------
 
Même si une utilisation normale de Artichow ne nécessite pas de configuration
particulière, il existe un fichier Artichow.cfg.php qui permet de modifier
quelques paramètres de la librairie.
Vous pouvez notamment configurer le répertoire vers les polices de caractère
en modifiant la constante ARTICHOW_FONT (par exemple en choisissant
'c:\Windows\font' si vous êtes sous Windows).
Vous pouvez également redéfinir la variable $fonts. Cette variable contient une
liste de polices TTF (sans l'extension) présentes dans votre répertoire
ARTICHOW_FONT. Pour toutes les polices de cette liste, une classe du même nom
est créée. Les polices ainsi définies peuvent ensuite être utilisées de cette
manière :
<?php
$font = new Verdana(12); // 12 représente la taille en points
?>
Il existe également une constante ARTICHOW_DEPRECATED. Si cette constante vaut
TRUE, alors un message d'erreur sera affiché lorsque vous utiliserez une
fonctionnalité dépréciée de Artichow. A l'inverse, avec la valeur FALSE,
vous pourrez continuer à utiliser les fonctions dépréciées sans soucis.
Cependant, dans un souci de compatibilité, il est préférable de mettre à
jour vos graphiques dès lors qu'un message de ce type apparaît (et donc de
laisser la constante à TRUE). Les fonctionnalités dépréciées sont toujours
potentiellement susceptibles de disparaître d'une version à l'autre de la
librairie.
La constante ARTICHOW_PREFIX est vide par défaut et correspond à un préfixe qui
est ajouté au nom de chaque classe utilisée sur Artichow. Certains noms de
classe (Graph, Image, Text, Font, etc.) sont utilisés par d'autres librairies
et cela peut aboutir à des conflits. Pour résoudre ce problème, choisissez par
exemple 'xyz' comme préfixe et toutes les classes de Artichow s'appèleront
désormais xyz[Nom normal]. Exemple d'utilisation de Artichow avec
ARTICHOW_PREFIX à 'xyz' :
<?php
require_once "Artichow/LinePlot.class.php";
 
$plot = new xyzLinePlot(array(1, 2, 3));
$plot->title->set('Mon graphique');
$plot->title->setFont(new xyzFont4);
 
$graph = new xyzGraph(400, 300);
$graph->add($plot);
$graph->draw();
?>
 
 
III. Utilisation
-----------
 
Si vous utilisez la version conçue exclusivement pour PHP 5, vous pouvez vous
référer aux exemples et aux tutoriels afin de bien prendre en main la
librairie.
Si vous utilisez la version pour PHP 4 & 5, référez vous également aux exemples
et tutoriels mais faîtes attention lors de l'inclusion des fichiers de
Artichow. N'incluez pas les fichiers de cette manière :
<?php
// Ceci ne fonctionnera pas
require_once "Artichow/php5/LinePlot.class.php";
// Cela non plus
require_once "Artichow/php4/LinePlot.class.php";
?>
Préférez plutôt :
<?php
// Fonctionnera correctement
require_once "Artichow/LinePlot.class.php";
?>
C'est la librairie qui se charge de sélectionner les bons fichiers en fonction
de la version de PHP dont vous disposez.
 
IV. Divers
------
 
La documentation de Artichow est disponible sur :
http://www.artichow.org/documentation
 
Des tutoriels sont accessibles sur :
http://www.artichow.org/tutorial
 
Un forum de support peut être trouvé sur :
http://www.artichow.org/forum/
 
N'oubliez pas que Artichow est dans le domaine public. Vous pouvez donc faire
CE QUE VOUS SOUHAITEZ avec cette librairie, y compris ajouter votre nom dans
chaque fichier, et la redistribuer ainsi.
 
Si vous souhaitez aider et participer au développement de Artichow, n'hésitez
pas à consulter cette page :
http://www.artichow.org/help
 
/trunk/bibliotheque/artichow/ScatterPlot.class.php
New file
0,0 → 1,300
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Plot.class.php";
 
/**
* ScatterPlot
*
* @package Artichow
*/
class awScatterPlot extends awPlot implements awLegendable {
/**
* Add marks to the scatter plot
*
* @var Mark
*/
public $mark;
/**
* Labels on the plot
*
* @var Label
*/
public $label;
/**
* Link points ?
*
* @var bool
*/
protected $link = FALSE;
/**
* Display impulses
*
* @var bool
*/
protected $impulse = NULL;
/**
* Link NULL points ?
*
* @var bool
*/
protected $linkNull = FALSE;
/**
* Line color
*
* @var Color
*/
protected $lineColor;
/**
* Line type
*
* @var int
*/
protected $lineStyle = awLine::SOLID;
/**
* Line thickness
*
* @var int
*/
protected $lineThickness = 1;
/**
* Construct a new awScatterPlot
*
* @param array $datay Numeric values for Y axis
* @param array $datax Numeric values for X axis
* @param int $mode
*/
public function __construct($datay, $datax = NULL) {
parent::__construct();
// Defaults marks
$this->mark = new awMark;
$this->mark->setType(awMark::CIRCLE);
$this->mark->setSize(7);
$this->mark->border->show();
$this->label = new awLabel;
$this->setValues($datay, $datax);
$this->setColor(new awBlack);
}
/**
* Display plot as impulses
*
* @param awColor $impulse Impulses color (or NULL to disable impulses)
*/
public function setImpulse($color) {
$this->impulse = $color;
}
/**
* Link scatter plot points
*
* @param bool $link
* @param awColor $color Line color (default to black)
*/
public function link($link, $color = NULL) {
$this->link = (bool)$link;
if($color instanceof awColor) {
$this->setColor($color);
}
}
/**
* Ignore null values for Y data and continue linking
*
* @param bool $link
*/
public function linkNull($link) {
$this->linkNull = (bool)$link;
}
/**
* Change line color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->lineColor = $color;
}
/**
* Change line style
*
* @param int $style
*/
public function setStyle($style) {
$this->lineStyle = (int)$style;
}
/**
* Change line tickness
*
* @param int $tickness
*/
public function setThickness($tickness) {
$this->lineThickness = (int)$tickness;
}
 
/**
* Get the line thickness
*
* @return int
*/
public function getLegendLineThickness() {
return $this->lineThickness;
}
 
/**
* Get the line type
*
* @return int
*/
public function getLegendLineStyle() {
return $this->lineStyle;
}
 
/**
* Get the color of line
*
* @return Color
*/
public function getLegendLineColor() {
return $this->lineColor;
}
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground() {
return NULL;
}
 
/**
* Get a mark object
*
* @return Mark
*/
public function getLegendMark() {
return $this->mark;
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
$count = count($this->datay);
// Get start and stop values
list($start, $stop) = $this->getLimit();
// Build the polygon
$polygon = new awPolygon;
for($key = 0; $key < $count; $key++) {
$x = $this->datax[$key];
$y = $this->datay[$key];
if($y !== NULL) {
$p = awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($x, $y));
$polygon->set($key, $p);
} else if($this->linkNull === FALSE) {
$polygon->set($key, NULL);
}
}
// Link points if needed
if($this->link) {
$prev = NULL;
foreach($polygon->all() as $point) {
if($prev !== NULL and $point !== NULL) {
$driver->line(
$this->lineColor,
new awLine(
$prev,
$point,
$this->lineStyle,
$this->lineThickness
)
);
}
$prev = $point;
}
}
// Draw impulses
if($this->impulse instanceof awColor) {
foreach($polygon->all() as $key => $point) {
if($point !== NULL) {
$zero = awAxis::toPosition(
$this->xAxis,
$this->yAxis,
new awPoint($key, 0)
);
$driver->line(
$this->impulse,
new awLine(
$zero,
$point,
awLine::SOLID,
1
)
);
}
}
}
// Draw marks and labels
foreach($polygon->all() as $key => $point) {
 
$this->mark->draw($driver, $point);
$this->label->draw($driver, $point, $key);
}
}
protected function xAxisPoint($position) {
$y = $this->xAxisZero ? 0 : $this->getRealYMin();
return awAxis::toPosition($this->xAxis, $this->yAxis, new awPoint($position, $y));
}
public function getXCenter() {
return FALSE;
}
 
}
 
registerClass('ScatterPlot');
?>
/trunk/bibliotheque/artichow/patterns/BarDepth.php
New file
0,0 → 1,85
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once ARTICHOW."/BarPlot.class.php";
 
class BarDepthPattern extends Pattern {
 
protected function getPlot($y, $depth) {
$plot = new BarPlot($y, 1, 1, $depth);
$plot->barShadow->setSize(2);
$plot->barShadow->smooth(TRUE);
$plot->barShadow->setColor(new Color(160, 160, 160, 10));
return $plot;
}
 
public function create() {
 
$group = new PlotGroup;
$group->setSpace(2, 2, 2, 0);
$group->setPadding(30, 10, NULL, NULL);
$group->grid->hideVertical(TRUE);
$group->grid->setType(Line::DASHED);
$yForeground = $this->getArg('yForeground');
$yBackground = $this->getArg('yBackground');
$legendForeground = $this->getArg('legendForeground');
$legendBackground = $this->getArg('legendBackground');
$colorForeground = $this->getArg('colorForeground', new LightBlue(10));
$colorBackground = $this->getArg('colorBackground', new Orange(25));
if($yForeground === NULL) {
awImage::drawError("Class BarDepthPattern: Argument 'yForeground' must not be NULL.");
}
// Background
if($yBackground !== NULL) {
$plot = $this->getPlot($yBackground, 6);
$plot->setBarColor($colorBackground);
$group->add($plot);
if($legendBackground !== NULL) {
$group->legend->add($plot, $legendBackground, Legend::BACKGROUND);
}
}
// Foreground
$plot = $this->getPlot($yForeground, 0);
$plot->setBarColor($colorForeground);
$group->add($plot);
if($legendForeground !== NULL) {
$group->legend->add($plot, $legendForeground, Legend::BACKGROUND);
}
$group->axis->bottom->hideTicks(TRUE);
$group->legend->shadow->setSize(0);
$group->legend->setAlign(Legend::CENTER);
$group->legend->setSpace(6);
$group->legend->setTextFont(new Tuffy(8));
$group->legend->setPosition(0.50, 0.10);
$group->legend->setBackgroundColor(new Color(255, 255, 255, 10));
$group->legend->setColumns(2);
return $group;
 
}
 
}
?>
/trunk/bibliotheque/artichow/patterns/LightLine.php
New file
0,0 → 1,50
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once ARTICHOW."/LinePlot.class.php";
 
class LightLinePattern extends Pattern {
 
public function create() {
$legend = $this->getArg('legend');
$y = $this->getArg('y');
if($y === NULL) {
awImage::drawError("Class LightLinePattern: Argument 'y' must not be NULL.");
}
$plot = new LinePlot($y);
$plot->setSize(0.7, 1);
$plot->setCenter(0.35, 0.5);
$plot->setPadding(35, 15, 35, 30);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
$plot->grid->setType(Line::DASHED);
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->setFill(new MidRed);
$plot->mark->setSize(6);
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(Legend::LEFT);
$plot->legend->shadow->smooth(TRUE);
if($legend !== NULL) {
$plot->legend->add($plot, $legend, Legend::MARK);
}
return $plot;
 
}
 
}
?>
/trunk/bibliotheque/artichow/DEPRECATED
New file
0,0 → 1,3
Artichow 1.0.9
 
- Pie::setBorder(): replaced by Pie::setBorderColor()
/trunk/bibliotheque/artichow/cache/Example-006-time
New file
0,0 → 1,2
1166203465
png
/trunk/bibliotheque/artichow/cache/Example-006
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/cache/Example-006
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/cache/Abel-time
New file
0,0 → 1,2
1166203484
png
/trunk/bibliotheque/artichow/cache/Abel
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/cache/Abel
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/cache/Albert-time
New file
0,0 → 1,2
1166203480
png
/trunk/bibliotheque/artichow/cache/Albert
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/cache/Albert
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/Artichow.cfg.php
New file
0,0 → 1,85
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
/*
* Path to Artichow
*/
 
define('ARTICHOW', dirname(__FILE__));
 
 
/*
* Path to TrueType fonts
* DO NOT USE FONT PATH WITH SPACE CHARACTER (" ") WITH GD <= 2.0.18
*/
if(!defined('ARTICHOW_FONT')) {
define('ARTICHOW_FONT', ARTICHOW.DIRECTORY_SEPARATOR.'font');
}
 
/*
* Patterns directory
*/
if(!defined('ARTICHOW_PATTERN')) {
define('ARTICHOW_PATTERN', ARTICHOW.DIRECTORY_SEPARATOR.'patterns');
}
 
/*
* Images directory
*/
if(!defined('ARTICHOW_IMAGE')) {
define('ARTICHOW_IMAGE', ARTICHOW.DIRECTORY_SEPARATOR.'images');
}
 
/*
* Enable/disable cache support
*/
define('ARTICHOW_CACHE', TRUE);
 
/*
* Cache directory
*/
if(!defined('ARTICHOW_CACHE_DIRECTORY')) {
define('ARTICHOW_CACHE_DIRECTORY', ARTICHOW.DIRECTORY_SEPARATOR.'cache');
}
 
/*
* Prefix for class names
* No prefix by default
*/
define('ARTICHOW_PREFIX', '');
 
/*
* Trigger errors when use of a deprecated feature
*/
define('ARTICHOW_DEPRECATED', TRUE);
 
/*
* Defines the default driver
*/
define('ARTICHOW_DRIVER', 'gd');
 
/*
* Fonts to use
*/
$fonts = array(
'Tuffy',
'TuffyBold',
'TuffyBoldItalic',
'TuffyItalic'
);
 
?>
/trunk/bibliotheque/artichow/TODO
New file
0,0 → 1,13
- message d'erreur si MING n'est pas installé
 
- setLabelPrecision a un booleen pour déterminer s'il faut remplir avec des zéros ou non
 
- Label => TextBox
- Excel/Spider/Splines/Bezier
 
- doc de Pattern
- bug de la grille
- pouvoir tracer des lignes verticales et horizontales à n'importe quel endroit sur les Plots
- avant de parler de SimpleLinePlot, ajouter une classe CommonLinePlot, dont dérivent tous les LinePlot
 
- faire un mode auto pour les Pie (au delà d'un certain nombre de parts, grouper le reste sous l'étiquette 'Divers' (choisie par le user))
/trunk/bibliotheque/artichow/doc/Axis.html
New file
0,0 → 1,385
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Axis</h2><div class="description">
<p>
La classe <a href="Axis.html">Axis</a> permet de manipuler des axes.
Un axe permet à un utilisateur de répérer les points et leurs valeurs sur un graphique.
</p>
<p>
De nombreuses méthodes de la classe <a href="Axis.html">Axis</a> ne sont pas documentées,
car elles ne sont utilisées qu'en interne par Artichow.
Néanmoins, si vous développez Artichow, vous aurez besoin de ces méthodes.
N'hésitez donc pas à parcourir le code source de cette classe.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Axis.html#property.title"><span class="argument">$title</span></a>
</li>
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Axis.html#property.label"><span class="argument">$label</span></a>
</li>
<li>
<span class="access">public</span> <a href="Line.html"><span class="type">Line</span></a> <a href="Axis.html#property.line"><span class="argument">$line</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Axis.html#property.auto"><span class="argument">$auto</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Axis.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$min</span>, <span class="type">float</span> <span class="argument">$max</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
</li>
<li>
<span class="access">public</span> <a href="true.html"><span class="type">true</span></a> <a href="Axis.html#method.isAuto">isAuto</a>()
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.addTick">addTick</a>(<span class="type">string</span> <span class="argument">$name</span>, <a href="Tick.html"><span class="type">Tick</span></a> <span class="argument">$tick</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html"><span class="type">Tick</span></a> <a href="Axis.html#method.tick">tick</a>(<span class="type">string</span> <span class="argument">$name</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.deleteTick">deleteTick</a>(<span class="type">string</span> <span class="argument">$name</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.hideTicks">hideTicks</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setTickStyle">setTickStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.reverseTickStyle">reverseTickStyle</a>()
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setTickInterval">setTickInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setNumberByTick">setNumberByTick</a>(<span class="type">string</span> <span class="argument">$to</span>, <span class="type">string</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$number</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setLabelInterval">setLabelInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setLabelNumber">setLabelNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Axis.html#method.getLabelNumber">getLabelNumber</a>()
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setLabelPrecision">setLabelPrecision</a>(<span class="type">int</span> <span class="argument">$precision</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setLabelText">setLabelText</a>(<span class="type">array</span> <span class="argument">$texts</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setTitleAlignment">setTitleAlignment</a>(<span class="type">int</span> <span class="argument">$alignment</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setTitlePosition">setTitlePosition</a>(<span class="type">float</span> <span class="argument">$postion</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Axis.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>)
</li>
<li>
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Axis.html#method.getPadding">getPadding</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.title"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Axis.html#property.title"><span class="argument">$title</span></a><div class="description">
Représente le titre de l'axe.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Axis.html#property.label"><span class="argument">$label</span></a><div class="description">
Représente les étiquettes qui portent les valeurs affichées sur l'axe.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.line"></a><span class="access">public</span> <a href="Line.html"><span class="type">Line</span></a> <a href="Axis.html#property.line"><span class="argument">$line</span></a><div class="description">
Représente la ligne de l'axe.
Vous pouvez modifier le style et l'épaisseur de cette ligne, pas ses coordonnées.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.auto"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Axis.html#property.auto"><span class="argument">$auto</span></a><div class="description">
Précise si la gestion de l'axe doit être automatique ou non.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Axis.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$min</span>, <span class="type">float</span> <span class="argument">$max</span>)
<div class="description">
Déclare un nouvel axe.
Les variables $min et $max représentent respectivement la valeurs minimales et maximales associées à l'axe.
Par exemple, choisir $min = -12 et $max = 42 signifie tout simplement que l'axe ira de -12 à 42.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.auto"></a><span class="access">public</span> <a href="Axis.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
<div class="description">
Active/désactive la gestion automatique de l'axe.
La gestion automatique est automatiquement désactivée en cas d'appel aux méthodes suivantes : <a href="Axis.html#method.setLabelNumber">Axis::setLabelNumber()</a>, <a href="Axis.html#method.setLabelInterval">Axis::setLabelInterval()</a>, <a href="Axis.html#method.setLabelPrecision">Axis::setLabelPrecision()</a> et <a href="Axis.html#method.setLabelText">Axis::setLabelText()</a>.
Lorsqu'un axe est sous gestion automatique, l'échelle est le nombre de valeurs à afficher sur l'axe sont automatiquement calculés.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isAuto"></a><span class="access">public</span> <a href="true.html"><span class="type">true</span></a> <a href="Axis.html#method.isAuto">isAuto</a>()
<div class="description">
Retourne TRUE si l'axe est gérée automatiquement, FALSE sinon.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Axis.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Cache ou non l'axe. Le paramètre $hide est par défaut à TRUE (ce qui signifie que l'axe ne sera pas dessiné).
S'il est mis à FALSE, l'axe sera dessiné.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.addTick"></a><span class="access">public</span> <a href="Axis.html#method.addTick">addTick</a>(<span class="type">string</span> <span class="argument">$name</span>, <a href="Tick.html"><span class="type">Tick</span></a> <span class="argument">$tick</span>)
<div class="description">
Associe un objet <a href="Tick.html">Tick</a> $tick à l'axe.
Cet objet sera reconnu par le nom $name au sein de la classe <a href="Axis.html">Axis</a>.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.tick"></a><span class="access">public</span> <a href="Tick.html"><span class="type">Tick</span></a> <a href="Axis.html#method.tick">tick</a>(<span class="type">string</span> <span class="argument">$name</span>)
<div class="description">
Récupère un objet <a href="Tick.html">Tick</a> en fonction de son nom.
Cet objet doit avoir été précédemment ajouté avec la méthode <a href="Axis.html#method.addTick">Axis::addTick()</a>.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.deleteTick"></a><span class="access">public</span> <a href="Axis.html#method.deleteTick">deleteTick</a>(<span class="type">string</span> <span class="argument">$name</span>)
<div class="description">
Supprime l'objet <a href="Tick.html">Tick</a> de nom $name associé à l'axe.
Pour pouvoir être supprimé, cet objet doit avoir été précédemment ajouté avec la méthode <a href="Axis.html#method.addTick">Axis::addTick()</a>.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideTicks"></a><span class="access">public</span> <a href="Axis.html#method.hideTicks">hideTicks</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Cache ou non tous les ticks qui ont été associés à cet axe.
<div class="see">
Voir aussi :
<ul><li><a href="Axis.html#method.addTick">Axis::addTick()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTickStyle"></a><span class="access">public</span> <a href="Axis.html#method.setTickStyle">setTickStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style de tous les ticks associés à l'axe pour $style.
<div class="see">
Voir aussi :
<ul><li><a href="Tick.html#method.setStyle">Tick::setStyle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.reverseTickStyle"></a><span class="access">public</span> <a href="Axis.html#method.reverseTickStyle">reverseTickStyle</a>()
<div class="description">
Inverse le style de tous les ticks associés à l'axe pour $style.
Si les ticks étaient tournés vers l'extérieur, ils seront désormais tournés vers l'intérieur.
Et vice-versa.
<div class="see">
Voir aussi :
<ul><li><a href="Tick.html#method.setStyle">Tick::setStyle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTickInterval"></a><span class="access">public</span> <a href="Axis.html#method.setTickInterval">setTickInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
<div class="description">
Change l'intervalle d'affichage de tous les ticks associés à l'axe pour $interval.
Cette méthode permet d'espacer l'affichage des ticks par rapport aux valeurs de l'axe.
<div class="see">
Voir aussi :
<ul><li><a href="Tick.html#method.setStyle">Tick::setStyle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setNumberByTick"></a><span class="access">public</span> <a href="Axis.html#method.setNumberByTick">setNumberByTick</a>(<span class="type">string</span> <span class="argument">$to</span>, <span class="type">string</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$number</span>)
<div class="description">
Cette méthode permet de modifier la fréquence d'affichage d'un objet <a href="Tick.html">Tick</a> par rapport à un autre.
$to représente l'objet dont la fréquence d'affichage doit être modifiée et $from l'objet auquel on se réfère.
A chaque fois qu'un tick $from sera affiché, on affichera $number ticks $to.
Si $number vaut 2, cela signifie que deux ticks $to seront affichés pour un tick $from.
Cette méthode prend tout son sens donc le cadre des <a href="Plot.html">Plot</a> par exemple :
<pre>
 
&lt;?php
 
require_once 'LinePlot.class.php';
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
 
// Pour chaque tick major affiché,
// on affichera 10 ticks minor
$plot-&gt;xAxis-&gt;setNumberByTick('minor', 'major', 10);
 
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
Cela donne 10 ticks mineurs par tick majeur :
<div class="image">
<img src="doc/image/ticks.png" alt="10 ticks mineurs par tick majeur">
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelInterval"></a><span class="access">public</span> <a href="Axis.html#method.setLabelInterval">setLabelInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
<div class="description">
Change l'intervalle d'affichage des étiquettes sur l'axe pour $interval.
Par défaut, cet intervalle est égal à 1.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelNumber"></a><span class="access">public</span> <a href="Axis.html#method.setLabelNumber">setLabelNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
<div class="description">
Change le nombre d'étiquettes à afficher sur l'axe pour $number.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLabelNumber"></a><span class="access">public</span> <span class="type">int</span> <a href="Axis.html#method.getLabelNumber">getLabelNumber</a>()
<div class="description">
Retourne le nombre d'étiquettes qui seront affichées sur l'axe.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelPrecision"></a><span class="access">public</span> <a href="Axis.html#method.setLabelPrecision">setLabelPrecision</a>(<span class="type">int</span> <span class="argument">$precision</span>)
<div class="description">
Change la précision des valeurs affichées sur chaque étiquette de l'axe.
$number représente le nombre de chiffres après la virgule qui doivent être affiché.
Par défaut, $precision vaut 0.
<div class="see">
Voir aussi :
<ul>
<li><a href="Axis.html#method.setLabelText">Axis::setLabelText()</a></li>
<li><a href="Label.html#method.setCallbackFunction">Label::setCallbackFunction()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelText"></a><span class="access">public</span> <a href="Axis.html#method.setLabelText">setLabelText</a>(<span class="type">array</span> <span class="argument">$texts</span>)
<div class="description">
Cette méthode permet d'afficher des valeurs arbitraires plutôt que des valeurs numériques sur les étiquettes de l'axe.
$texts est un tableau comportant autant d'entrées que d'étiquettes et qui contient les nouvelles valeurs à afficher.
<div class="see">
Voir aussi :
<ul>
<li><a href="Axis.html#method.setLabelPrecision">Axis::setLabelPrecision()</a></li>
<li><a href="Label.html#method.setCallbackFunction">Label::setCallbackFunction()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTitleAlignment"></a><span class="access">public</span> <a href="Axis.html#method.setTitleAlignment">setTitleAlignment</a>(<span class="type">int</span> <span class="argument">$alignment</span>)
<div class="description">
Change l'alignement du titre de l'axe sur l'axe.
Les valeurs possibles sont <a href="Label.html#constant.LEFT">Label::LEFT</a>, <a href="Label.html#constant.RIGHT">Label::RIGHT</a>, <a href="Label.html#constant.TOP">Label::TOP</a> et <a href="Label.html#constant.BOTTOM">Label::BOTTOM</a>.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTitlePosition"></a><span class="access">public</span> <a href="Axis.html#method.setTitlePosition">setTitlePosition</a>(<span class="type">float</span> <span class="argument">$postion</span>)
<div class="description">
Change la position du titre sur l'axe.
$position est une fraction de la taille de l'axe.
Par exemple, si $position est placé à 0.5, le titre sera affiché au milieu de l'axe.
Si $position vaut 0.25, alors le titre sera affiché sur le premier quart de l'axe.
Pour aligner le titre par rapport à cette position, utilisez la méthode <a href="Axis.html#method.setTitleAlignment">Axis::setTitleAlignment()</a>.
<div class="see">
Voir aussi :
<ul><li><a href="Axis.html#method.setTitleAlignment">Axis::setTitleAlignment()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Axis.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de l'axe et de son titre pour $color.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPadding"></a><span class="access">public</span> <a href="Axis.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>)
<div class="description">
Change l'espace interne à gauche et à droite de l'axe.
Gauche et droite n'ont de sens que pour les axes verticaux.
Pour les axes plus horizontaux, préférez haut à gauche et bas à droite.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getPadding"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Axis.html#method.getPadding">getPadding</a>()
<div class="description">
Retourne l'espace interne associé à l'axe.
</div>
<div class="description-bottom"><a href="Axis.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/FileFont.html
New file
0,0 → 1,214
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class FileFont</h2><div class="extends"><ul>
<li><a href="Font.html">Font</a></li>
<ul><li>FileFont</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="FileFont.html">FileFont</a> permet de gérer les polices représentée par un fichier, donc externe à PHP.
Quelques polices sont disponibles dans le répertoire <span style="font-weight: bold">font/</span> de Artichow.
Si vous connaissez d'autres polices intéressantes et dans le domaine public, n'hésitez pas à le signaler à <span style="text-decoration: underline">vincent</span> sur <span style="text-decoration: underline">artichow point org</span>.
</p>
<p>
Afin de simplifier l'utilisation de cette classe, plusieurs polices sont déjà prédéfinies sur Artichow.
Chacune de ces polices est une classe qui dérive de <a href="FileFont.html">FileFont</a> et dont le constructeur ne prend qu'un paramètre, la taille de la police. Voici les polices prédéfinies :
</p>
<ul>
<li>
<em>Famille Tuffy :</em> Tuffy, TuffyBold, TuffyItalic, TuffyBoldItalic</li>
</ul>
<p>
Voici un exemple d'utilisation pour les polices prédéfinies :
<pre>
 
&lt;?php
 
// On utilise Tuffy de taille 12
// Equivalent à new <a href="FileFont.html">FileFont</a>(ARTICHOW_FONT.'/Tuffy.ttf', 12);
$blue = new Tuffy(12);
 
// On utilise Tuffy en italique taille 42
// Equivalent à new <a href="FileFont.html">FileFont</a>(ARTICHOW_FONT.'/TuffyItalic.ttf', 42);
$orange = new TuffyItalic(42);
 
?&gt;
 
</pre>
</p>
</div><div class="inherit">
Les classes suivantes dérivent de FileFont :
<ul><li><a href="TTFFont.html">TTFFont</a></li></ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#property.name"><span class="argument">$name</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="FileFont.html#property.size"><span class="argument">$size</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#property.extension"><span class="argument">$extension</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="FileFont.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$name</span>, <span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="FileFont.html#method.setName">setName</a>(<span class="type">string</span> <span class="argument">$name</span>)
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#method.getName">getName</a>()
</li>
<li>
<span class="access">public</span> <a href="FileFont.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="FileFont.html#method.getSize">getSize</a>()
</li>
<li>
<span class="access">public</span> <a href="FileFont.html#method.setExtension">setExtension</a>(<span class="type">string</span> <span class="argument">$extension</span>)
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#method.getExtension">getExtension</a>()
</li>
<li>
<span class="access">public</span> <a href="FileFont.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
<li>
<span class="access">public</span> <a href="FileFont.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.name"></a><span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#property.name"><span class="argument">$name</span></a><div class="description">
Le nom du fichier contenant la police, sans l'extension.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.size"></a><span class="access">public</span> <span class="type">int</span> <a href="FileFont.html#property.size"><span class="argument">$size</span></a><div class="description">
La taille de la police, en pixels.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.extension"></a><span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#property.extension"><span class="argument">$extension</span></a><div class="description">
L'extension du fichier. Cette propriété est utile si deux polices pouvant être utilisé par plusieurs pilotes doivent avoir une extension différente selon le cas. Voir à ce sujet le classe <a href="TTFFont.html">TTFFont</a>.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="FileFont.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$name</span>, <span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Construit la police de nom $name et de taille $size.
Le nom doit être soit un chemin d'accès absolu, soit un simple nom de fichier. Dans ce dernier cas, la police correspondante sera recherchée dans le dossier <span style="font-weight: bold;">font/</span> d'Artichow.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setName"></a><span class="access">public</span> <a href="FileFont.html#method.setName">setName</a>(<span class="type">string</span> <span class="argument">$name</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Définit le nom du fichier contenant les informations de la police.
Ce nom doit être soit un chemin d'accès absolu, soit un simple nom de fichier. Dans ce dernier cas, la police correspondante sera recherchée dans le dossier <span style="font-weight: bold;">font/</span> d'Artichow.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getName"></a><span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#method.getName">getName</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie l'extension du fichier contenant les informations de la police.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="FileFont.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Définit la taille de la police, en pixels.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSize"></a><span class="access">public</span> <span class="type">int</span> <a href="FileFont.html#method.getSize">getSize</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie la taille de la police, en pixels.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setExtension"></a><span class="access">public</span> <a href="FileFont.html#method.setExtension">setExtension</a>(<span class="type">string</span> <span class="argument">$extension</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Définit l'extension du fichier contenant les informations de la police.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getExtension"></a><span class="access">public</span> <span class="type">string</span> <a href="FileFont.html#method.getExtension">getExtension</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie l'extension du fichier contenant les informations de la police.
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextWidth"></a><span class="access">public</span> <a href="FileFont.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Renvoie la largeur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextHeight"></a><span class="access">public</span> <a href="FileFont.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Renvoie la hauteur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="FileFont.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Font.html
New file
0,0 → 1,96
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Font</h2><div class="description">
<p>
La classe abstraite <a href="Font.html">Font</a> permet de gérer les polices de manière uniforme sur Artichow.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Font :
<ul>
<li><a href="PHPFont.html">PHPFont</a></li>
<li><a href="FileFont.html">FileFont</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods">
<li>
<span class="access">public</span> <a href="Font.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Font.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Font.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Font.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Font.html#method.__construct">__construct</a>()
<div class="description">
Construit la police.
</div>
<div class="description-bottom"><a href="Font.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Font.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
<div class="description">
Dessine avec la police courante le texte $text.
Le pilote $driver sera utilisé pour le dessin tandis que le texte sera positionné au point $point.
Le paramètre $width permet de spécifier la largeur maximale en pixels de la boîte de texte.
</div>
<div class="description-bottom"><a href="Font.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextWidth"></a><span class="access">public</span> <span class="type">float</span> <a href="Font.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Retourne la largeur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Font.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextHeight"></a><span class="access">public</span> <span class="type">float</span> <a href="Font.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Retourne la hauteur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Font.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/GDDriver.html
New file
0,0 → 1,72
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class GDDriver</h2><div class="extends"><ul>
<li><a href="Driver.html">Driver</a></li>
<ul><li>GDDriver</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="GDDriver.html">GDDriver</a> est une implémentation de <a href="Driver.html">Driver</a> qui repose sur la bibliothèque GD. C'est le pilote par défaut utilisé par Artichow, PHP doit donc être compilé avec le support de GD pour que tout fonctionne.
</p>
<p>
Seules seront mentionnées ici les méthodes dont l'implémentation pourrait avoir un comportement spécifique. Pour le reste, veuillez vous référer à la doc de la classe parente <a href="Driver.html">Driver</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <span class="type">resource</span> <a href="GDDriver.html#property.resource"><span class="argument">$resource</span></a>
</li></ul><ul class="methods">
<li>
<span class="access">public</span> <a href="GDDriver.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="GDDriver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.resource"></a><span class="access">public</span> <span class="type">resource</span> <a href="GDDriver.html#property.resource"><span class="argument">$resource</span></a><div class="description">
La ressource GD contenant le dessin.
</div>
<div class="description-bottom"><a href="GDDriver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="GDDriver.html#method.__construct">__construct</a>()
<div class="description">
Construit le pilote.
Instancie les <a href="FontDriver.html">FontDriver</a> et initialise la propriété <a href="Driver.html#property.driverString">driverString</a> à 'gd'.
</div>
<div class="description-bottom"><a href="GDDriver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <span class="type">int</span> <a href="GDDriver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Convertit un objet <a href="Color.html">Color</a> pour qu'il soit exploitable directement par les fonctions de dessins de GD.
Renvoie un entier identifiant la couleur aux yeux de GD.
</div>
<div class="description-bottom"><a href="GDDriver.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Border.html
New file
0,0 → 1,154
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Border</h2><div class="description">
<p>La classe <a href="Border.html">Border</a> permet de centraliser la gestion des bordures sur Artichow.</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Border.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Black</span>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Border.html#property.style"><span class="argument">$style</span></a> := <span class="default">Line::SOLID</span>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Border.html#property.hide"><span class="argument">$hide</span></a> := <span class="default">FALSE</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Border.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span> := <span class="default">new Black</span>, <span class="type">int</span> <span class="argument">$style</span> := <span class="default">Line::SOLID</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Border.html#method.visible">visible</a>()
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.rectangle">rectangle</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.ellipse">ellipse</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Border.html#method.polygon">polygon</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.color"></a><span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Border.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Black</span><div class="description">
La couleur de la bordure
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.style"></a><span class="access">protected</span> <span class="type">int</span> <a href="Border.html#property.style"><span class="argument">$style</span></a> := <span class="default">Line::SOLID</span><div class="description">
Style de la ligne qui compose la bordure.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hide"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Border.html#property.hide"><span class="argument">$hide</span></a> := <span class="default">FALSE</span><div class="description">
Est-ce que la bordure doit être cachée ?
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Border.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span> := <span class="default">new Black</span>, <span class="type">int</span> <span class="argument">$style</span> := <span class="default">Line::SOLID</span>)
<div class="description">
Déclare une nouvelle bordure de couleur $color et avec pour style $style.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Border.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la bordure pour $color.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStyle"></a><span class="access">public</span> <a href="Border.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style de la bordure pour $style.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Border.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Détermine si la bordure doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Border.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
<div class="description">
Détermine si la bordure doit être affichée ou non.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.visible"></a><span class="access">public</span> <span class="type">bool</span> <a href="Border.html#method.visible">visible</a>()
<div class="description">
Retourne TRUE si la bordure doit être affichée, FALSE sinon.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.rectangle"></a><span class="access">public</span> <a href="Border.html#method.rectangle">rectangle</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Dessine la bordure sous la forme d'un rectangle dont la diagonale s'étend des points $p1 à $p2.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.ellipse"></a><span class="access">public</span> <a href="Border.html#method.ellipse">ellipse</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Dessine la bordure sous la forme d'une ellipse de centre $center et de largeur et hauteur respectives $width et $height.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.polygon"></a><span class="access">public</span> <a href="Border.html#method.polygon">polygon</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Dessine la bordure comme un polygone entourant celui passé en argument.
</div>
<div class="description-bottom"><a href="Border.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Color.html
New file
0,0 → 1,168
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Color</h2><div class="description">
<p>
La classe <a href="Color.html">Color</a> permet de gérer les couleurs de manière uniforme sur Artichow.
</p>
<p>
Afin de simplifier l'utilisation de cette classe, plusieurs couleurs sont déjà prédéfinies sur Artichow.
Chacune de ces couleurs est une classe qui dérive de <a href="Color.html">Color</a> et dont le constructeur ne prend qu'un paramètre, le degré de transparence. Voici les couleurs prédéfinies triées par ton :
</p>
<ul>
<li>
<em>Gris :</em> Black, AlmostBlack, VeryDarkGray, DarkGray, MidGray, LightGray, VeryLightGray, White</li>
<li>
<em>Rouge :</em> VeryDarkRed, DarkRed, MidRed, Red, LightRed</li>
<li>
<em>Vert :</em> VeryDarkGreen, DarkGreen, MidGreen, Green, LightGreen</li>
<li>
<em>Bleu :</em> VeryDarkBlue, DarkBlue, MidBlue, Blue, LightBlue</li>
<li>
<em>Jaune :</em> VeryDarkYellow, DarkYellow, MidYellow, Yellow, LightYellow</li>
<li>
<em>Cyan :</em> VeryDarkCyan, DarkCyan, MidCyan, Cyan, LightCyan</li>
<li>
<em>Magenta :</em> VeryDarkMagenta, DarkMagenta, MidMagenta, Magenta, LightMagenta</li>
<li>
<em>Orange :</em> DarkOrange, Orange, LightOrange, VeryLightOrange</li>
<li>
<em>Rose :</em> DarkPink, Pink, LightPink, VeryLightPink</li>
<li>
<em>Violet :</em> DarkPurple, Purple, LightPurple, VeryLightPurple</li>
</ul>
<p>
Voici un exemple d'utilisation pour les couleurs prédéfinies :
<pre>
 
&lt;?php
 
// On créé un bleu foncé
$blue = new DarkBlue; // Equivalent à new <a href="Color.html">Color</a>(0, 0, 128);
 
// On créé de l'orange transparent à 50 %
$orange = new Orange(50); // Equivalent à new <a href="Color.html">Color</a>(255, 128, 0, 50);
 
?&gt;
 
</pre>
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.red"><span class="argument">$red</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.green"><span class="argument">$green</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.blue"><span class="argument">$blue</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.alpha"><span class="argument">$alpha</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Color.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$red</span>, <span class="type">int</span> <span class="argument">$green</span>, <span class="type">int</span> <span class="argument">$blue</span>, <span class="type">int</span> <span class="argument">$alpha</span> := <span class="default">0</span>)
</li>
<li>
<span class="access">public</span> <a href="Color.html#method.brightness">brightness</a>(<span class="type">int</span> <span class="argument">$brightness</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Color.html#method.getColor">getColor</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Color.html#method.rgba">rgba</a>()
</li>
<li>
<span class="access">public</span> <a href="Color.html#method.free">free</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.red"></a><span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.red"><span class="argument">$red</span></a><div class="description">
Intensité en rouge de la couleur (entre 0 et 255)
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.green"></a><span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.green"><span class="argument">$green</span></a><div class="description">
Intensité en vert de la couleur (entre 0 et 255)
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.blue"></a><span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.blue"><span class="argument">$blue</span></a><div class="description">
Intensité en blue de la couleur (entre 0 et 255)
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.alpha"></a><span class="access">public</span> <span class="type">int</span> <a href="Color.html#property.alpha"><span class="argument">$alpha</span></a><div class="description">
Degré de transparence de la couleur (entre 0 et 100)
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Color.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$red</span>, <span class="type">int</span> <span class="argument">$green</span>, <span class="type">int</span> <span class="argument">$blue</span>, <span class="type">int</span> <span class="argument">$alpha</span> := <span class="default">0</span>)
<div class="description">
Construit une nouvelle couleur. Les trois premiers paramètres représentent l'intensité en rouge, vert et bleu pour cette couleur. L'intensité de chaque couleur est un nombre compris entre 0 et 255 (du foncé vers le clair). Le paramètre $alpha représente le dégré de transparence de la couleur, et doit être compris entre 0 et 100.
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.brightness"></a><span class="access">public</span> <a href="Color.html#method.brightness">brightness</a>(<span class="type">int</span> <span class="argument">$brightness</span>)
<div class="description">
Change la luminosité de la couleur, en ajoutant la valeur $brightness à chaque composante (rouge, vert, bleu) de cette couleur.
$brightness peut prendre des valeurs comprises entre -255 et +255.
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <span class="type">array</span> <a href="Color.html#method.getColor">getColor</a>()
<div class="description">
Retourne un tableau de quatre valeurs qui représentent l'intensité en rouge, vert et bleu ainsi que le degré de transparence de la couleur.
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.rgba"></a><span class="access">public</span> <span class="type">array</span> <a href="Color.html#method.rgba">rgba</a>()
<div class="description">
Retourne un tableau de quatre valeurs qui représentent l'intensité en rouge, vert et bleu ainsi que le degré de transparence de la couleur.
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.free"></a><span class="access">public</span> <a href="Color.html#method.free">free</a>()
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1.0</li></ul>
<div class="description">
Libère les ressources allouées lors de l'appel à <a href="Color.html#method.getColor">getColor()</a>.
</div>
<div class="description-bottom"><a href="Color.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/PHPFont.html
New file
0,0 → 1,73
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class PHPFont</h2><div class="extends"><ul>
<li><a href="Font.html">Font</a></li>
<ul><li>PHPFont</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="PHPFont.html">PHPFont</a> permet de gérer les polices fournie avec PHP. Ce sont des polices pouvant subir peu de transformation (rotation de 90° uniquement par exemple).
</p>
<p>
Il existe 5 polices prédéfinies, ainsi que les 5 classes "raccourcies" correspondantes:
<pre>
 
&lt;?php
 
// Equivalent à new <a href="PHPFont.html">PHPFont</a>(1);
$font = new Font1;
 
// Equivalent à new <a href="PHPFont.html">PHPFont</a>(2);
$font = new Font2;
 
// etc.
 
?&gt;
 
</pre>
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <span class="type">int</span> <a href="PHPFont.html#property.font"><span class="argument">$font</span></a>
</li></ul><ul class="methods"><li>
<span class="access">public</span> <a href="PHPFont.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$font</span>)
</li></ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.font"></a><span class="access">public</span> <span class="type">int</span> <a href="PHPFont.html#property.font"><span class="argument">$font</span></a><div class="description">
L'identifiant de la police, de 1 à 5.
</div>
<div class="description-bottom"><a href="PHPFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="PHPFont.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$font</span>)
<div class="description">
Construit la police d'identifiant $font.
</div>
<div class="description-bottom"><a href="PHPFont.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Label.html
New file
0,0 → 1,423
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Label</h2><div class="description">
<p>
La classe <a href="Label.html">Label</a> permet de créer et d'afficher des étiquettes de texte sur des images.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Label.html#property.border"><span class="argument">$border</span></a> := <span class="default">new Border</span>
</li>
<li>
<span class="access">protected</span> <a href="Font.html"><span class="type">Font</span></a> <a href="Label.html#property.font"><span class="argument">$font</span></a> := <span class="default">new Font(Font::FONT_2)</span>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.angle"><span class="argument">$angle</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Label.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Color(0, 0, 0)</span>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hide"><span class="argument">$hide</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hideFirst"><span class="argument">$hideFirst</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hideLast"><span class="argument">$hideLast</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.interval"><span class="argument">$interval</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.hAlign"><span class="argument">$hAlign</span></a> := <span class="default">Label::CENTER</span>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.vAlign"><span class="argument">$vAlign</span></a> := <span class="default">Label::MIDDLE</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Label.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$label</span> := <span class="default">NULL</span>, <a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span> := <span class="default">new Font(Text::FONT_2)</span>, <a href="color.html"><span class="type">color</span></a> <span class="argument">$color</span> := <span class="default">new Color(0, 0, 0)</span>, <span class="type">int</span> <span class="argument">$angle</span> := <span class="default">0</span>)
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Label.html#method.get">get</a>(<span class="type">int</span> <span class="argument">$key</span>)
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Label.html#method.all">all</a>()
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.set">set</a>(<span class="type">mixed</span> <span class="argument">$labels</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.count">count</a>()
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setCallbackFunction">setCallbackFunction</a>(<span class="type">mixed</span> <span class="argument">$function</span>)
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="Label.html#method.getCallbackFunction">getCallbackFunction</a>()
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setFormat">setFormat</a>(<span class="type">string</span> <span class="argument">$format</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setFont">setFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setAngle">setAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setBackground">setBackground</a>(<span class="type">mixed</span> <span class="argument">$background</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.hideKey">hideKey</a>(<span class="type">int</span> <span class="argument">$key</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.hideFirst">hideFirst</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.hideLast">hideLast</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Text.html"><span class="type">Text</span></a> <a href="Label.html#method.getText">getText</a>(<span class="type">int</span> <span class="argument">$key</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.getMaxWidth">getMaxWidth</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.getMaxHeight">getMaxHeight</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">public</span> <a href="Label.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$key</span> := <span class="default">0</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.border"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Label.html#property.border"><span class="argument">$border</span></a> := <span class="default">new Border</span><div class="description">
La bordure associée à l'étiquette.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.font"></a><span class="access">protected</span> <a href="Font.html"><span class="type">Font</span></a> <a href="Label.html#property.font"><span class="argument">$font</span></a> := <span class="default">new Font(Font::FONT_2)</span><div class="description">
La police utilisée pour ce paragraphe.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.angle"></a><span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.angle"><span class="argument">$angle</span></a> := <span class="default">0</span><div class="description">
L'angle du texte du paragraphe.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.color"></a><span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Label.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Color(0, 0, 0)</span><div class="description">
La couleur du texte du paragraphe.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hide"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hide"><span class="argument">$hide</span></a><div class="description">
Détermine si les étiquettes doivent être cachées.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hideFirst"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hideFirst"><span class="argument">$hideFirst</span></a><div class="description">
Détermine si la première étiquette doit être cachée.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hideLast"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Label.html#property.hideLast"><span class="argument">$hideLast</span></a><div class="description">
Détermine si la dernière étiquette doit être cachée.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.interval"></a><span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.interval"><span class="argument">$interval</span></a><div class="description">
L'interval d'affichage des étiquettes.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hAlign"></a><span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.hAlign"><span class="argument">$hAlign</span></a> := <span class="default">Label::CENTER</span><div class="description">
L'alignement horizontal des étiquettes.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.vAlign"></a><span class="access">protected</span> <span class="type">int</span> <a href="Label.html#property.vAlign"><span class="argument">$vAlign</span></a> := <span class="default">Label::MIDDLE</span><div class="description">
L'alignement vertical des étiquettes.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Label.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$label</span> := <span class="default">NULL</span>, <a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span> := <span class="default">new Font(Text::FONT_2)</span>, <a href="color.html"><span class="type">color</span></a> <span class="argument">$color</span> := <span class="default">new Color(0, 0, 0)</span>, <span class="type">int</span> <span class="argument">$angle</span> := <span class="default">0</span>)
<div class="description">
Construit un nouvel objet qui permettra l'affichage d'étiquettes sur une image.
$label est un chaîne de caractères qui représente la première étiquette (peut être laissée à NULL).
$font est la police à utiliser pour l'étiquette tandis que $color sera utilisé pour la couleur du texte.
Enfin, l'angle du texte prendra la valeur de $angle.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.get"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Label.html#method.get">get</a>(<span class="type">int</span> <span class="argument">$key</span>)
<div class="description">
Retourne la valeur de l'élément de l'étiquette dont la clé vaut $key.
Si la clé n'est associée à aucune valeur, alors cette méthode retourne NULL.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.all"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Label.html#method.all">all</a>()
<div class="description">
Retourne toutes la valeur de toutes les étiquettes sous la forme d'un tableau.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.set"></a><span class="access">public</span> <a href="Label.html#method.set">set</a>(<span class="type">mixed</span> <span class="argument">$labels</span>)
<div class="description">
Change le texte des étiquettes à afficher sur l'image.
$labels peut être une chaîne de caractères si vous n'avez besoin que d'une étiquette, ou un tableau de chaînes de caractères si vous avez besoin de plusieurs étiquettes.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.count"></a><span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.count">count</a>()
<div class="description">
Retourne le nombre de textes dans le paragraphe.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setCallbackFunction"></a><span class="access">public</span> <a href="Label.html#method.setCallbackFunction">setCallbackFunction</a>(<span class="type">mixed</span> <span class="argument">$function</span>)
<div class="description">
Change le nom de la fonction de callback qui sera appelé lors du dessin des textes du paragraphe. $function peut être une simple chaîne de caractères, ou un tableau du type <span style="font-style: italic;">array($this, 'methodName')</span> pour permettre d'appeler des méthodes statiques.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getCallbackFunction"></a><span class="access">public</span> <span class="type">string</span> <a href="Label.html#method.getCallbackFunction">getCallbackFunction</a>()
<div class="description">
Retourne le nom de la fonction de callback actuellement utilisée.
Si aucune fonction de callback n'a été spécifiée, alors NULL sera retourné.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFormat"></a><span class="access">public</span> <a href="Label.html#method.setFormat">setFormat</a>(<span class="type">string</span> <span class="argument">$format</span>)
<div class="description">
Formate le texte de chaque étiquette selon $format.
$format est du même format que les fonctions printf ou sprintf.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFont"></a><span class="access">public</span> <a href="Label.html#method.setFont">setFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
<div class="description">
Change la police utilisée pour le texte de l'étiquette.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAngle"></a><span class="access">public</span> <a href="Label.html#method.setAngle">setAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
<div class="description">
Change l'angle du texte de l'étiquette. Les valeurs possibles sont 0 ou 90°.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Label.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur du texte de l'étiquette.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackground"></a><span class="access">public</span> <a href="Label.html#method.setBackground">setBackground</a>(<span class="type">mixed</span> <span class="argument">$background</span>)
<div class="description">
Change le fond du texte de l'étiquette.
$background peut être soit une couleur, soit un dégradé;
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Label.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond du texte de l'étiquette.
<div class="see">
Voir aussi :
<ul><li><a href="Label.html#method.setBackground">Label::setBackground()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Label.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond du texte de l'étiquette.
<div class="see">
Voir aussi :
<ul><li><a href="Label.html#method.setBackground">Label::setBackground()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPadding"></a><span class="access">public</span> <a href="Label.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
<div class="description">
Change la valeur de l'espace qui entoure le texte par rapport à sa bordure.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Label.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Détermine si toutes les étiquettes doivent être cachées ou non.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Label.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
<div class="description">
Détermine si toutes les étiquettes doivent être affichées ou non.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideKey"></a><span class="access">public</span> <a href="Label.html#method.hideKey">hideKey</a>(<span class="type">int</span> <span class="argument">$key</span>)
<div class="description">
Détermine si l'étiquette de clé $key doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideFirst"></a><span class="access">public</span> <a href="Label.html#method.hideFirst">hideFirst</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Détermine si la première étiquette doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideLast"></a><span class="access">public</span> <a href="Label.html#method.hideLast">hideLast</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Détermine si la dernière étiquette doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setInterval"></a><span class="access">public</span> <a href="Label.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
<div class="description">
Change l'interval d'affichage des étiquettes.
L'interval est à 1 par défaut, ce qui signifie que toutes les étiquettes sont affichées.
Si cet interval est placé à 2 par exemple, alors la méthode <a href="Label.html#method.draw">draw()</a> n'affichera qu'une étiquette sur 2.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.move"></a><span class="access">public</span> <a href="Label.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Déplace l'affichage de l'étiquette de $x pixels sur l'axe des abscisses et de $y pixels sur l'axe des ordonnées.
Les appels à <a href="Label.html#method.move">move()</a> sont cumulés, c'est-à-dire qu'un appel avec de nouvelles valeurs additionnera ces valeurs avec les anciennes.
Par défaut, $x et $y sont à 0.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAlign"></a><span class="access">public</span> <a href="Label.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
<div class="description">
Change l'alignement de l'étiquette par rapport au point où elle sera affichée.
$h correspond à l'alignement horizontal (<a href="Label.html#constant.LEFT">Positionable::LEFT</a>, <a href="Label.html#constant.RIGHT">Positionable::RIGHT</a> ou <a href="Label.html#constant.CENTER">Positionable::CENTER</a>) et $v à l'alignement vertical (<a href="Label.html#constant.TOP">Positionable::TOP</a>, <a href="Label.html#constant.BOTTOM">Positionable::BOTTOM</a> ou <a href="Label.html#constant.MIDDLE">Positionable::MIDDLE</a>).
Si vous ne souhaitez pas modifier une des deux valeurs, vous pouvez passer NULL.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getText"></a><span class="access">public</span> <a href="Text.html"><span class="type">Text</span></a> <a href="Label.html#method.getText">getText</a>(<span class="type">int</span> <span class="argument">$key</span>)
<div class="description">
Retourne un objet de type <a href="Text.html">Text</a> qui correspond à la valeur du tableau de textes passé au constructeur ou à <a href="Label.html#method.set">Label::set()</a> pour la clé $key.
Cette object <a href="Text.html">Text</a> se verra attribué toutes les propriétés (couleur, police, angle, etc.) définies pour le paragraphe.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getMaxWidth"></a><span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.getMaxWidth">getMaxWidth</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Essaie de déterminer la longueur maximale des étiquettes. Cette méthode a besoin d'un <a href="Driver.html">Driver</a> pour établir la taille de chaque texte.
La longueur maximale trouvée est déterminée et rétournée en pixels.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getMaxHeight"></a><span class="access">public</span> <span class="type">int</span> <a href="Label.html#method.getMaxHeight">getMaxHeight</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Essaie de déterminer la hauteur maximale des étiquettes. Cette méthode a besoin d'un <a href="Driver.html">Driver</a> pour établir la taille de chaque texte.
La hauteur maximale trouvée est déterminée et rétournée en pixels.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Label.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$key</span> := <span class="default">0</span>)
<div class="description">
Dessine l'étiquette identifiée par $key avec le pilote $driver. L'étiquette sera placée au point $point décalé des valeurs successivement passées à <a href="Label.html#method.move">move()</a>, et alignée par rapport à ce point selon les valeurs passées à <a href="Label.html#method.setAlign">setAlign()</a>.
L'étiquette ne sera pas affichée si sa clé $key n'est pas dans l'interval d'affichage donné avec <a href="Label.html#method.setInterval">setInterval()</a>.
</div>
<div class="description-bottom"><a href="Label.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/image/fond-flou.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/fond-flou.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-bd.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/doc/image/coin-bd.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-bd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-bd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-bg-long.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-bg-long.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-bg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-bg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-hd-transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-hd-transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-hd.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-hd.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-hg-transparent.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-hg-transparent.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/coin-hg.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/doc/image/coin-hg.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/fond.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/doc/image/fond.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/image/back-rayures.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/doc/image/back-rayures.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/doc/Legendable.html
New file
0,0 → 1,86
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Legendable</h2><div class="description">
<p>
<a href="Legendable.html">Legendable</a> est une <span style="text-decoration: underline">interface</span> que doivent implémenter toutes les classes qui veulent profiter des possibilités offertes par la classe <a href="Legend.html">Legend</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Legendable.html#method.getLegendLineStyle">getLegendLineStyle</a>()
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Legendable.html#method.getLegendLineThickness">getLegendLineThickness</a>()
</li>
<li>
<span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Legendable.html#method.getLegendLineColor">getLegendLineColor</a>()
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Legendable.html#method.getLegendBackground">getLegendBackground</a>()
</li>
<li>
<span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="Legendable.html#method.getLegendMark">getLegendMark</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="method">
<a id="method.getLegendLineStyle"></a><span class="access">public</span> <span class="type">int</span> <a href="Legendable.html#method.getLegendLineStyle">getLegendLineStyle</a>()
<div class="description">
Retourne le type de ligne utilisé (<a href="Line.html#constant.SOLID">Line::SOLID</a>, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> ou <a href="Line.html#constant.DASHED">Line::DASHED</a>).
</div>
<div class="description-bottom"><a href="Legendable.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLegendLineThickness"></a><span class="access">public</span> <span class="type">int</span> <a href="Legendable.html#method.getLegendLineThickness">getLegendLineThickness</a>()
<div class="description">
Retourne une épaisseur de ligne pour la légende.
</div>
<div class="description-bottom"><a href="Legendable.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLegendLineColor"></a><span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Legendable.html#method.getLegendLineColor">getLegendLineColor</a>()
<div class="description">
Retourne une couleur de ligne pour la légende.
</div>
<div class="description-bottom"><a href="Legendable.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLegendBackground"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Legendable.html#method.getLegendBackground">getLegendBackground</a>()
<div class="description">
Retourne une couleur de fond pour la légende.
</div>
<div class="description-bottom"><a href="Legendable.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLegendMark"></a><span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="Legendable.html#method.getLegendMark">getLegendMark</a>()
<div class="description">
Retourne l'objet qui gère les marques affichées sur les éléments représentatifs de la classe qui implémente cette interface.
</div>
<div class="description-bottom"><a href="Legendable.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/TTFFont.html
New file
0,0 → 1,58
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class TTFFont</h2><div class="extends"><ul>
<li><a href="FileFont.html">FileFont</a></li>
<ul><li>TTFFont</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="TTFFont.html">TTFFont</a> permet de manipuler des polices TrueType.
Quelques polices sont disponibles dans le répertoire <span style="font-weight: bold">font/</span> de Artichow.
Si vous connaissez d'autres polices intéressantes et dans le domaine public, n'hésitez pas à le signaler à <span style="text-decoration: underline">vincent</span> sur <span style="text-decoration: underline">artichow point org</span>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <span class="type">int</span> <a href="TTFFont.html#property.size"><span class="argument">$size</span></a>
</li></ul><ul class="methods"><li>
<span class="access">public</span> <a href="TTFFont.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$font</span>, <span class="type">int</span> <span class="argument">$size</span>)
</li></ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.size"></a><span class="access">public</span> <span class="type">int</span> <a href="TTFFont.html#property.size"><span class="argument">$size</span></a><div class="description">
La taille de la police en pixels.
</div>
<div class="description-bottom"><a href="TTFFont.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="TTFFont.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$font</span>, <span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Construit la police $font de taille $size pixels.
La chaîne $font peut être soit le chemin vers un fichier de police TrueType, soit juste le nom de ce fichier. Dans ce dernier cas, le fichier de police sera recherché dans le dossier <span style="font-weight: bold">font/</span> du répertoire d'Artichow qui contient les quelques polices disponible de base.
</div>
<div class="description-bottom"><a href="TTFFont.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Drawer.html
New file
0,0 → 1,425
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Driver</h2><div class="description">
<p>
La classe <a href="Driver.html">Driver</a> est une couche d'abstraction à GD et permet de dessiner toutes sortes de formes géométriques sur une <a href="Image.html">Image</a>.
</p>
<p>
Sur une image, l'axe des abscisses rejoint l'axe des ordonnées sur le coin haut-gauche. Le coin haut-gauche de l'image a donc pour coordonnées (0, 0) et le coin bas-droite (largeur, hauteur). Par exemple, sur une image de largeur 100 et de hauteur 50, un point à 50 sur l'axe des abscisses et 25 sur l'axe des ordonnées sera au centre de l'image.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">resource</span> <a href="Driver.html#property.resource"><span class="argument">$resource</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageWidth"><span class="argument">$imageWidth</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageHeight"><span class="argument">$imageHeight</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Driver.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.init">init</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.initFromFile">initFromFile</a>(<a href="FileImage.html"><span class="type">FileImage</span></a> <span class="argument">$fileImage</span>, <span class="type">string</span> <span class="argument">$file</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setImageSize">setImageSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.movePosition">movePosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$w</span>, <span class="type">float</span> <span class="argument">$h</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Driver.html#method.getSize">getSize</a>()
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Driver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.send">send</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.get">get</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.copyImage">copyImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.copyResizeImage">copyResizeImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d2</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s2</span>, <span class="type">bool</span> <span class="argument">$resampled</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.string">string</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.point">point</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.line">line</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.arc">arc</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledArc">filledArc</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.ellipse">ellipse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledEllipse">filledEllipse</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.rectangle">rectangle</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledRectangle">filledRectangle</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.polygon">polygon</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledPolygon">filledPolygon</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.resource"></a><span class="access">public</span> <span class="type">resource</span> <a href="Driver.html#property.resource"><span class="argument">$resource</span></a><div class="description">
La ressource GD utilisée par le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.imageWidth"></a><span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageWidth"><span class="argument">$imageWidth</span></a><div class="description">
La largeur de l'image gérée par le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.imageHeight"></a><span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageHeight"><span class="argument">$imageHeight</span></a><div class="description">
La hauteur de l'image gérée par le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.antiAliasing"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span><div class="description">
Doit-on utiliser l'anti-aliasing sur ce dessin ?
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Driver.html#method.__construct">__construct</a>()
<div class="description">
Construit le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.init"></a><span class="access">public</span> <a href="Driver.html#method.init">init</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Crée la ressource GD dont a besoin le Driver pour dessiner l'Image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.initFromFile"></a><span class="access">public</span> <a href="Driver.html#method.initFromFile">initFromFile</a>(<a href="FileImage.html"><span class="type">FileImage</span></a> <span class="argument">$fileImage</span>, <span class="type">string</span> <span class="argument">$file</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Crée la ressource GD dont a besoin le Driver à partir d'un fichier déjà existant dont le nom est $file.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setImageSize"></a><span class="access">public</span> <a href="Driver.html#method.setImageSize">setImageSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Change la taille de l'image gérée par le pilote pour la largeur $width et la hauteur $height.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPosition"></a><span class="access">public</span> <a href="Driver.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Informe le pilote de la position de la sous-image sur l'image.
Les positions X et Y sont données via les paramètres $x et $y, qui représentent une fraction de la taille de l'image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.movePosition"></a><span class="access">public</span> <a href="Driver.html#method.movePosition">movePosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Demande au pilote de déplacer la position de la sous-image sur l'image.
$x et $y représentent respectivement les déplacements latéral et vertical de la position en pixels.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsPosition"></a><span class="access">public</span> <a href="Driver.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Informe le pilote de la position de la sous-image sur l'image.
Les positions X et Y sont données via les paramètres $x et $y, dont l'unité est le pixel.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Driver.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$w</span>, <span class="type">float</span> <span class="argument">$h</span>)
<div class="description">
Informe le pilote de la taille de la sous-image sur l'image.
Les largeur et hauteur de la sous-image sont données via les paramètres $w et $h, qui représentent une fraction de la taille de l'image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsSize"></a><span class="access">public</span> <a href="Driver.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
<div class="description">
Informe le pilote de la taille de la sous-image sur l'image.
Les largeur et hauteur de la sous-image sont données via les paramètres $w et $h, dont l'unité est le pixel.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSize"></a><span class="access">public</span> <span class="type">array</span> <a href="Driver.html#method.getSize">getSize</a>()
<div class="description">
Retourne la taille de la sous-image en pixels.
Les valeurs sont retournées sous la forme d'un tableau, de la forme array(largeur, hauteur).
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <span class="type">int</span> <a href="Driver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Retourne la couleur sous la forme d'un entier numérique, utilisable ensuite avec les fonctions GD de PHP.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.send"></a><span class="access">public</span> <a href="Driver.html#method.send">send</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<div class="description">
Construit l'image passée en paramètre et l'envoie sur la sortie standard accompagnée des en-têtes HTTP correspondants.
A aucun moment vous ne devriez avoir besoin d'appeler vous-même cette méthode. Pour générez les images, utilisez <a href="Graph.html#method.draw">Graph::draw()</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.get"></a><span class="access">public</span> <a href="Driver.html#method.get">get</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Construit l'image passée en paramètre et la renvoie sous forme de données binaires. Vous pouvez donc la stocker dans une variable si vous voulez faire des manipulations spécifiques.
A aucun moment vous ne devriez avoir besoin d'appeler vous-même cette méthode. Pour générez les images, utilisez <a href="Graph.html#method.draw">Graph::draw()</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAntiAliasing"></a><span class="access">public</span> <a href="Driver.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Active ou désactive l'anti-aliasing lors du dessin.
L'anti-aliasing permet d'avoir des graphiques plus propres mais demande plus de ressources.
L'anti-aliasing n'est pas activé par défaut.
<div class="see">
Voir aussi :
<ul><li><a href="Image.html#method.setAntiAliasing">Image::setAntiAliasing()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.copyImage"></a><span class="access">public</span> <a href="Driver.html#method.copyImage">copyImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Copie l'image $image vers la sous-image courante.
L'image sera copiée sur la sous-image du point $p1 (coin haut-gauche) ou point $p2 (coin bas-droit).
Les coordonnées de $p1 et $p2 doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.copyResizeImage"></a><span class="access">public</span> <a href="Driver.html#method.copyResizeImage">copyResizeImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d2</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s2</span>, <span class="type">bool</span> <span class="argument">$resampled</span>)
<div class="description">
Copie l'image $image vers l'image courante.
L'image $image sera copiée des points $s1 (coin haut-gauche) et $s2 (coin bas-droit) vers les points $d1 (coin haut-gauche) et $d2 (coin bas-droit) de l'image courante.
Si $resampled est placé à TRUE, l'image sera rééchantillonée.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.string"></a><span class="access">public</span> <a href="Driver.html#method.string">string</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
<div class="description">
Dessine la chaîne de caractères $text à partir du point $point.
Les coordonnées de $point doivent être relatives à celles de la sous-image.
Le paramètre $width permet de spécifier la largeur maximale en pixels de la boîte de texte.
<div class="see">
Voir aussi :
<ul>
<li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li>
<li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.point"></a><span class="access">public</span> <a href="Driver.html#method.point">point</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Dessine un pixel de couleur $color au point $point.
Les coordonnées de $point doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.line"></a><span class="access">public</span> <a href="Driver.html#method.line">line</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
<div class="description">
Dessine la ligne $line de couleur $color.
Les coordonnées de la ligne doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.arc"></a><span class="access">public</span> <a href="Driver.html#method.arc">arc</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
<div class="description">
Dessine un arc d'ellipse de couleur $color dont les deux extrémités sont reliées au centre de l'ellipse.
L'ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
L'angle de départ pour l'arc est $from et l'angle d'arrivée $to.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledArc">Driver::filledArc()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledArc"></a><span class="access">public</span> <a href="Driver.html#method.filledArc">filledArc</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
<div class="description">
Dessine un arc d'ellipse dont les deux extrémités sont reliées au centre de l'ellipse et le remplit avec la couleur ou le dégradé $background.
L'ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
L'angle de départ pour l'arc est $from et l'angle d'arrivée $to.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.arc">Driver::arc()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.ellipse"></a><span class="access">public</span> <a href="Driver.html#method.ellipse">ellipse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Dessine une ellipse de couleur $color, ayant pour centre $center et de largeur et hauteur respectives $width et $height.
Les coordonnées de l'ellipse doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledEllipse">Driver::filledEllipse()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledEllipse"></a><span class="access">public</span> <a href="Driver.html#method.filledEllipse">filledEllipse</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Dessine et remplit une ellipse avec la couleur ou le dégradé $background. Cette ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
Les coordonnées de l'ellipse doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.ellipse">Driver::ellipse()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.rectangle"></a><span class="access">public</span> <a href="Driver.html#method.rectangle">rectangle</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Dessine un rectangle de couleur $color des points $p1 à $p2 (le segment qui relie ces points représente la diagonale du rectangle).
Les coordonnées du rectangle doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledRectangle">Driver::filledRectangle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledRectangle"></a><span class="access">public</span> <a href="Driver.html#method.filledRectangle">filledRectangle</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Dessine et remplit un rectangle avec la couleur ou le dégradé $background des points $p1 à $p2 (le segment qui relie ces points représente la diagonale du rectangle).
Les coordonnées du rectangle doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.rectangle">Driver::rectangle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.polygon"></a><span class="access">public</span> <a href="Driver.html#method.polygon">polygon</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<div class="description">
Dessine le polygone $polygon de couleur $color.
Les coordonnées de chaque point du polygone doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledPolygon">Driver::filledPolygon()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledPolygon"></a><span class="access">public</span> <a href="Driver.html#method.filledPolygon">filledPolygon</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<div class="description">
Dessine et remplit le polygone $polygon avec la couleur ou le dégradé $background.
Les coordonnées de chaque point du polygone doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.polygon">Driver::polygon()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Side.html
New file
0,0 → 1,94
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Side</h2><div class="description">
<p>
La classe <a href="Side.html">Side</a> est un objet qui fournit des méthodes pour gérer des situations où il est besoin de valoriser les côtés gauche, droit, haut et bas avec des entiers.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.left"><span class="argument">$left</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.right"><span class="argument">$right</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.top"><span class="argument">$top</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.bottom"><span class="argument">$bottom</span></a> := <span class="default">0</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Side.html#method.__construct">__construct</a>(<span class="type">mixed</span> <span class="argument">$left</span>, <span class="type">mixed</span> <span class="argument">$right</span>, <span class="type">mixed</span> <span class="argument">$top</span>, <span class="type">mixed</span> <span class="argument">$bottom</span>)
</li>
<li>
<span class="access">public</span> <a href="Side.html#method.set">set</a>(<span class="type">mixed</span> <span class="argument">$left</span>, <span class="type">mixed</span> <span class="argument">$right</span>, <span class="type">mixed</span> <span class="argument">$top</span>, <span class="type">mixed</span> <span class="argument">$bottom</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.left"></a><span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.left"><span class="argument">$left</span></a> := <span class="default">0</span><div class="description">
Le côté gauche.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.right"></a><span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.right"><span class="argument">$right</span></a> := <span class="default">0</span><div class="description">
Le côté droit.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.top"></a><span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.top"><span class="argument">$top</span></a> := <span class="default">0</span><div class="description">
Le côté haut.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.bottom"></a><span class="access">public</span> <span class="type">int</span> <a href="Side.html#property.bottom"><span class="argument">$bottom</span></a> := <span class="default">0</span><div class="description">
Le côté bas.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Side.html#method.__construct">__construct</a>(<span class="type">mixed</span> <span class="argument">$left</span>, <span class="type">mixed</span> <span class="argument">$right</span>, <span class="type">mixed</span> <span class="argument">$top</span>, <span class="type">mixed</span> <span class="argument">$bottom</span>)
<div class="description">
Construit l'objet <a href="Side.html">Side</a> avec les valeurs $left, $right, $top et $bottom pour les côtés gauche, droit, haut et bas.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.set"></a><span class="access">public</span> <a href="Side.html#method.set">set</a>(<span class="type">mixed</span> <span class="argument">$left</span>, <span class="type">mixed</span> <span class="argument">$right</span>, <span class="type">mixed</span> <span class="argument">$top</span>, <span class="type">mixed</span> <span class="argument">$bottom</span>)
<div class="description">
Change les valeurs associées aux côtés gauche, droit, haut et bas.
Laisser un paramètre à NULL permet d'éviter que la valeur du côté soit modifiée.
</div>
<div class="description-bottom"><a href="Side.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Text.html
New file
0,0 → 1,186
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Text</h2><div class="description">
<p>
La classe <a href="Text.html">Text</a> permet de manipuler du texte de manière uniforme sur Artichow.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Text.html#property.border"><span class="argument">$border</span></a>
</li></ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Text.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$text</span>, <a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span> := <span class="default">new Font(Text::FONT_2)</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$angle</span> := <span class="default">0</span>)
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="Text.html#method.getText">getText</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setText">setText</a>(<span class="type">string</span> <span class="argument">$text</span>)
</li>
<li>
<span class="access">public</span> <a href="Font.html"><span class="type">Font</span></a> <a href="Text.html#method.getFont">getFont</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setFont">setFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Text.html#method.getAngle">getAngle</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setAngle">setAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Text.html#method.getColor">getColor</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Text.html#method.getBackground">getBackground</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Text.html#method.getPadding">getPadding</a>()
</li>
<li>
<span class="access">public</span> <a href="Text.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.border"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Text.html#property.border"><span class="argument">$border</span></a><div class="description">
La bordure qui entoure le texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Text.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$text</span>, <a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span> := <span class="default">new Font(Text::FONT_2)</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$angle</span> := <span class="default">0</span>)
<div class="description">
Créé un nouveau pavé de texte avec pour texte $text. $font représente la police utilisée pour le texte tandis que $color représente sa couleur.
L'angle est définit par le paramètre $angle, qui peut prendre les valeurs de 0 et 90°.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getText"></a><span class="access">public</span> <span class="type">string</span> <a href="Text.html#method.getText">getText</a>()
<div class="description">
Retourne le texte de la classe.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setText"></a><span class="access">public</span> <a href="Text.html#method.setText">setText</a>(<span class="type">string</span> <span class="argument">$text</span>)
<div class="description">
Change le texte associé à l'objet pour $text.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getFont"></a><span class="access">public</span> <a href="Font.html"><span class="type">Font</span></a> <a href="Text.html#method.getFont">getFont</a>()
<div class="description">
Retourne la police utilisée pour le texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFont"></a><span class="access">public</span> <a href="Text.html#method.setFont">setFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
<div class="description">
Change la police utilisée pour le texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getAngle"></a><span class="access">public</span> <span class="type">int</span> <a href="Text.html#method.getAngle">getAngle</a>()
<div class="description">
Retourne l'angle du texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAngle"></a><span class="access">public</span> <a href="Text.html#method.setAngle">setAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
<div class="description">
Change l'angle du texte. Les valeurs possibles sont 0 ou 90°.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <span class="type">int</span> <a href="Text.html#method.getColor">getColor</a>()
<div class="description">
Retourne la couleur du texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Text.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur du texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getBackground"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Text.html#method.getBackground">getBackground</a>()
<div class="description">
Retourne le fond du texte. Si aucun fond n'a été spécifié, cette méthode retourne NULL.
Dans le cas contraire, elle retourne un objet de la classe Color pour les couleurs, soit une instance de Gradient pour les dégradés.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Text.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond du texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Text.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond du texte.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getPadding"></a><span class="access">public</span> <span class="type">array</span> <a href="Text.html#method.getPadding">getPadding</a>()
<div class="description">
Retourne la valeur de l'espace qui entoure le texte par rapport à sa bordure. Cette méthode retourne un tableau de quatre valeurs, qui correspondent à l'espace de gauche, droite, haut et bas.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPadding"></a><span class="access">public</span> <a href="Text.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
<div class="description">
Change la valeur de l'espace qui entoure le texte par rapport à sa bordure.
</div>
<div class="description-bottom"><a href="Text.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/style.css
New file
0,0 → 1,383
body {
font-family: "Trebuchet MS", Geneva, Arial, Helvetica, SunSans-Regular, Verdana, sans-serif;
font-size: 0.75em;
margin: 0px;
padding: 0px;
background-color: #c2d2c4;
background-image: url("image/fond.png");
background-repeat: repeat-x;
padding-top: 20px;
}
 
 
a {
color: #000055;
text-decoration: none;
}
 
a:hover {
color: #295F37;
text-decoration: underline;
}
 
p {
padding-left: 1em;
padding-right: 1em;
text-align: justify;
}
 
p:first-letter {
float: left;
font-size: 160%;
font-weight: bold;
color: #646464;
background-color: white;
margin-top: -7px;
margin-right: 3px;
padding-right: 0px;
padding-left: 2px;
margin-bottom: -10px;
}
 
pre {
margin: 0px;
padding: 0px;
font-size: 1.25em;
}
 
span.php4 {
color: red;
font-weight: bold;
}
 
.borderhg {
border-top: 1px solid black;
border-left: 1px solid black;
}
 
.borderd {
border-right: 1px solid black;
}
 
.borderg {
border-left: 1px solid black;
}
 
.borderh {
border-top: 1px solid black;
}
 
.borderb {
border-bottom: 1px solid black;
}
 
 
table#page {
width: 900px;
margin: auto;
text-align: left;
}
 
table#page td {
vertical-align: top;
}
 
table#page div.logo {
text-align: center;
}
 
table#page td table.features td {
vertical-align: middle;
}
 
table#menuhaut, table#menubas {
width: 200px;
background-color: white;
}
 
table#menuhaut td.cornerhg {
width: 30px;
height: 30px;
background: transparent url("image/coin-hg.gif") no-repeat;
}
table#menubas td.cornerbg {
width: 30px;
height: 30px;
background: url("image/coin-bg.gif") no-repeat;
}
 
 
div#menu {
border-left: 1px solid black;
background-color: white;
}
 
 
div#menu ul.ulmenu {
padding: 0px;
margin: 0px;
background-color: #dddddd;
}
 
div#menu ul.ulmenu li {
margin: 0px;
list-style-type: none;
}
 
div#menu ul.ulmenu a {
display: block;
text-decoration: none;
padding-left: 1em;
color: black;
width: 100%;
border-top: 1px solid black;
 
}
 
div#menu ul.ulmenu a:hover {
color: #dddddd;
background-color: #a43030;
display: block;
}
 
table#contenu {
width: 100%;
color: #2d2d2d;
background-color: white;
}
 
table#contenu td.cornerhd, table#contenu td.cornerhg, table#contenu td.cornerbd, table#contenu td.cornerbg {
width: 30px;
height: 30px;
}
 
table#contenu td.cornerhd {
background: transparent url("image/coin-hd.gif") no-repeat;
}
 
table#contenu td.cornerbd {
background: url("image/coin-bd.gif") no-repeat;
}
 
table#contenu td.cornerbg {
background: url("image/coin-bg.gif") no-repeat;
}
 
table#contenu table {
width: 95%;
margin: auto;
}
 
table#contenu h1 {
text-align: center;
margin: auto;
width: 100%;
color: #a43030;
}
 
table#contenu h2:after {
border: 0px;
background-color: transparent;
display: block;
margin-left: -1px;
padding-top: 31px;
width: 97%;
line-height: 1em;
margin-bottom: -25px;
text-align: left;
background: transparent url("image/back-rayures.png") repeat-x;
content: "";
 
}
 
table#contenu h4 {
margin-top: 0.3em;
margin-left: 1em;
margin-bottom: 0.5em;
font-size: 1.25em;
}
 
table#contenu h5 {
margin-top: 0.3em;
margin-left: 1em;
margin-bottom: 0.5em;
font-size: 1.0em;
}
 
table#contenu pre {
margin-left: 1em;
}
 
table#contenu ul.features li {
list-style-type: armenian;
margin-left: 3em;
}
 
table#contenu div.graph {
padding-top: 8px;
text-align: center;
}
 
table#contenu div.graph img {
border: 0px;
}
 
table#contenu div.image {
text-align: center;
margin-top: 2em;
}
 
table#contenu span.type {
color: #0000FF;
}
 
table#contenu span.default {
color: #A000A0;
}
 
table#contenu span.interface {
font-weight: bold;
}
 
table#contenu span.argument {
color: #880000;
}
 
table#contenu span.access {
font-weight: bold;
color: #3B3F3C;
 
}
 
table#contenu div.description {
margin-right: 3em;
margin-left: 2em;
border: 1px solid #A7BFAD;
padding: 4px;
}
 
table#contenu ul.news li {
list-style-type: none;
}
 
table#contenu ul.news li ul li {
list-style-type: square;
margin-left: 20px;
}
 
table#contenu div.description ul li {
list-style-type: circle;
font-size: 95%;
}
 
table#contenu div.description div.see {
margin-right: 1em;
margin-left: 1em;
background-color: #f0f0f0;
padding: 3px;
}
 
table#contenu div.description div.see ul li {
list-style-type: circle;
margin-bottom: 0em;
margin-top: 0em;
padding-bottom: 0em;
padding-top: 0em;
}
 
table#contenu div.inherit {
border-bottom: 1px solid #a43030;
margin-right: 3em;
margin-left: 2em;
padding: 4px;
}
 
 
table#contenu ul.doc li.method {
}
 
table#contenu ul.doc li.property {
}
 
table#contenu ul.doc li {
margin-bottom: 0.5em;
padding: 0.3em;
}
 
table#contenu ul {
margin-left: 1.5em;
padding-left: 0px;
padding-right: 1em;
}
 
table#contenu ul li {
list-style-type: square;
margin-left: 1em;
}
 
table#contenu ul.constants li, table#contenu ul.methods li, table#contenu ul.properties li,
table#contenu ul li.constant, table#contenu ul li.method, table#contenu ul li.property
{
list-style-type: none;
margin-left: 0px;
}
 
table#contenu ul.links li {
}
 
table#contenu a.easy {
color: red;
}
 
div.release {
background-color: #eeeeee;
padding-left: 20px;
}
 
div#imagemenu {
background-image: url("mini.php");
height: 100px;
width: 150px;
margin-left: 25px;
margin-top: 30px;
border: 0px;
}
 
td#textebas {
text-align: center;
}
table#bas {
float:left;
width: 100%;
background-color: white;
margin-top: 10px;
}
 
table#bas td.cornerhd, table#bas td.cornerhg, table#bas td.cornerbd, table#bas td.cornerbg {
width: 30px;
height: 30px;
}
 
table#bas td.cornerhd {
background: url("image/coin-hd-transparent.gif") no-repeat;
}
 
table#bas td.cornerhg {
background: url("image/coin-hg-transparent.gif") no-repeat;
}
 
table#bas td.cornerbd {
background: url("image/coin-bd.gif") no-repeat;
}
 
table#bas td.cornerbg {
background: url("image/coin-bg.gif") no-repeat;
}
 
table#contenu ul.demo li {
list-style-type : circle;
}
/trunk/bibliotheque/artichow/doc/Grid.html
New file
0,0 → 1,157
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Grid</h2><div class="description">
<p>
La classe <a href="Grid.html">Grid</a> permet de manipuler des grilles de fond sur les <a href="Plot.html">Plot</a> ou <a href="PlotGroup.html">groupes de Plot</a>.
Une grille facilite la lecture des données pour l'utilisateur.
Un exemple de grille est montré ci-dessous.
</p>
<div class="image">
<img src="image/grid.png">
</div>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods">
<li>
<span class="access">public</span> <a href="Grid.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.hideHorizontal">hideHorizontal</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.hideVertical">hideVertical</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setType">setType</a>(<span class="type">int</span> <span class="argument">$type</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$hInterval</span>, <span class="type">int</span> <span class="argument">$vInterval</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.setGrid">setGrid</a>(<span class="type">array</span> <span class="argument">$xgrid</span>, <span class="type">array</span> <span class="argument">$ygrid</span>)
</li>
<li>
<span class="access">public</span> <a href="Grid.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Grid.html#method.__construct">__construct</a>()
<div class="description">
Construit et initialise une grille.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Grid.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Cache ou affiche la grille sur le composant.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideHorizontal"></a><span class="access">public</span> <a href="Grid.html#method.hideHorizontal">hideHorizontal</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Cache ou affiche les lignes horizontales de la grille sur le composant.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideVertical"></a><span class="access">public</span> <a href="Grid.html#method.hideVertical">hideVertical</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Cache ou affiche les lignes verticales de la grille sur le composant.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Grid.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la grille pour la couleur $color.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Grid.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond de la grille pour la couleur $color.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setType"></a><span class="access">public</span> <a href="Grid.html#method.setType">setType</a>(<span class="type">int</span> <span class="argument">$type</span>)
<div class="description">
Change le type de ligne à utiliser sur la grille. $type peut être <a href="Line.html#constant.SOLID">Line::SOLID</a> pour une ligne continue, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> pour une ligne pointillée ou encore <a href="Line.html#constant.DASHED">Line::DASHED</a>.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setInterval"></a><span class="access">public</span> <a href="Grid.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$hInterval</span>, <span class="type">int</span> <span class="argument">$vInterval</span>)
<div class="description">
Change l'interval d'affichage des lignes horizontales de la grille avec $hInterval et verticales avec $vInterval.
Par défaut, cet interval est à 1 et toutes les lignes sont affichées.
Si vous choisissez un interval de 2 par exemple, une ligne sur deux sera affichée sur la grille.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSpace"></a><span class="access">public</span> <a href="Grid.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
<div class="description">
Change l'espace interne de la grille.
Les valeurs $left, $right, $top et $bottom représentent respectivement les nouvelles valeurs pour l'espace gauche, droit, haut et bas de la grille.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setGrid"></a><span class="access">public</span> <a href="Grid.html#method.setGrid">setGrid</a>(<span class="type">array</span> <span class="argument">$xgrid</span>, <span class="type">array</span> <span class="argument">$ygrid</span>)
<div class="description">
Précise la position sur la grille des lignes horizontales avec $ygrid et verticales avec $xgrid.
Ces deux paramètres sont des tableaux qui contiennent des entiers entre 0 et 1. Chaque valeur représente la position d'une ligne comme une fraction de la taille de la grille.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Grid.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>)
<div class="description">
Dessine la grille avec le pilote $driver.
La grille sera dessinée dans un rectangle dont la diagonale est le segment qui relie les points ($x1, $y1) et ($x2, $y2).
Les lignes dessinées auront été préalablement précisées avec <a href="Grid.html#method.setGrid">setGrid()</a>.
</div>
<div class="description-bottom"><a href="Grid.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Shadow.html
New file
0,0 → 1,234
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Shadow</h2><div class="description">
<p>
La classe <a href="Shadow.html">Shadow</a> permet de manipuler des ombres sur des rectangles.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.LEFT_TOP">LEFT_TOP</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.LEFT_BOTTOM">LEFT_BOTTOM</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.RIGHT_TOP">RIGHT_TOP</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.RIGHT_BOTTOM">RIGHT_BOTTOM</a> := <span class="default">4</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.IN">IN</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.OUT">OUT</a> := <span class="default">2</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Shadow.html#property.size"><span class="argument">$size</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Shadow.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Color(100, 100, 100)</span>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Shadow.html#property.position"><span class="argument">$position</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Shadow.html#property.hide"><span class="argument">$hide</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Shadow.html#property.smooth"><span class="argument">$smooth</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Shadow.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$position</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.setPosition">setPosition</a>(<span class="type">int</span> <span class="argument">$position</span>)
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.smooth">smooth</a>(<span class="type">bool</span> <span class="argument">$smooth</span>)
</li>
<li>
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Shadow.html#method.getSpace">getSpace</a>()
</li>
<li>
<span class="access">public</span> <a href="Shadow.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>, <span class="type">int</span> <span class="argument">$mode</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.LEFT_TOP"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.LEFT_TOP">LEFT_TOP</a> := <span class="default">1</span><div class="description">
Dessine l'ombre sur les côtés haut et gauche.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.LEFT_BOTTOM"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.LEFT_BOTTOM">LEFT_BOTTOM</a> := <span class="default">2</span><div class="description">
Dessine l'ombre sur les côtés bas et gauche.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RIGHT_TOP"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.RIGHT_TOP">RIGHT_TOP</a> := <span class="default">3</span><div class="description">
Dessine l'ombre sur les côtés haut et droit.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RIGHT_BOTTOM"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.RIGHT_BOTTOM">RIGHT_BOTTOM</a> := <span class="default">4</span><div class="description">
Dessine l'ombre sur les côtés bas et droit.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.IN"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.IN">IN</a> := <span class="default">1</span><div class="description">
Spécifie que l'ombre doit être dessinée à l'intérieur.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.OUT"></a><span class="access">const</span> <span class="type">int</span> <a href="Shadow.html#constant.OUT">OUT</a> := <span class="default">2</span><div class="description">
Spécifie que l'ombre doit être dessinée à l'extérieur.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.size"></a><span class="access">protected</span> <span class="type">int</span> <a href="Shadow.html#property.size"><span class="argument">$size</span></a> := <span class="default">0</span><div class="description">
Taille de l'ombre.
Cette valeur est par défaut à 0, ce qui signifie qu'aucune ombre n'est affichée.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.color"></a><span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Shadow.html#property.color"><span class="argument">$color</span></a> := <span class="default">new Color(100, 100, 100)</span><div class="description">
Taille de l'ombre.
Cette valeur est par défaut à 0, ce qui signifie qu'aucune ombre n'est affichée.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.position"></a><span class="access">protected</span> <span class="type">int</span> <a href="Shadow.html#property.position"><span class="argument">$position</span></a><div class="description">
Détermine la position de l'ombre.
Les valeurs possible sont <a href="Shadow.html#constant.LEFT_TOP">Shadow::LEFT_TOP</a>, <a href="Shadow.html#constant.RIGHT_TOP">Shadow::RIGHT_TOP</a>, <a href="Shadow.html#constant.LEFT_BOTTOM">Shadow::LEFT_BOTTOM</a> ou <a href="Shadow.html#constant.RIGHT_BOTTOM">Shadow::RIGHT_BOTTOM</a>.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hide"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Shadow.html#property.hide"><span class="argument">$hide</span></a><div class="description">
Détermine si l'ombre doit être cachée.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.smooth"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Shadow.html#property.smooth"><span class="argument">$smooth</span></a><div class="description">
Détermine si l'ombre doit être lissée ou non.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Shadow.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$position</span>)
<div class="description">
Déclare une ombre à la position $position.
$position peut prendre les valeurs <a href="Shadow.html#constant.LEFT_TOP">Shadow::LEFT_TOP</a>, <a href="Shadow.html#constant.RIGHT_TOP">Shadow::RIGHT_TOP</a>, <a href="Shadow.html#constant.LEFT_BOTTOM">Shadow::LEFT_BOTTOM</a> ou <a href="Shadow.html#constant.RIGHT_BOTTOM">Shadow::RIGHT_BOTTOM</a>.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Shadow.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Détermine si l'ombre doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Shadow.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
<div class="description">
Détermine si l'ombre doit être affichée ou non.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Shadow.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Change la taille de l'ombre pour $size.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Shadow.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de l'ombre pour $color.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPosition"></a><span class="access">public</span> <a href="Shadow.html#method.setPosition">setPosition</a>(<span class="type">int</span> <span class="argument">$position</span>)
<div class="description">
Change la position de l'ombre.
$position peut prendre les valeurs <a href="Shadow.html#constant.LEFT_TOP">Shadow::LEFT_TOP</a>, <a href="Shadow.html#constant.RIGHT_TOP">Shadow::RIGHT_TOP</a>, <a href="Shadow.html#constant.LEFT_BOTTOM">Shadow::LEFT_BOTTOM</a> ou <a href="Shadow.html#constant.RIGHT_BOTTOM">Shadow::RIGHT_BOTTOM</a>.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.smooth"></a><span class="access">public</span> <a href="Shadow.html#method.smooth">smooth</a>(<span class="type">bool</span> <span class="argument">$smooth</span>)
<div class="description">
Détermine si l'ombre doit être lissée ou non.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSpace"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Shadow.html#method.getSpace">getSpace</a>()
<div class="description">
Retourne l'espace pris par l'ombre à gauche, droit, en haut et en bas.
Les espaces sont retournés en pixels.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Shadow.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>, <span class="type">int</span> <span class="argument">$mode</span>)
<div class="description">
Dessine l'ombre avec le pilote $driver dans un rectangle dont la diagonale est le segment qui relie les points $p1 et $p2.
Le paramètre $mode détermine le mode d'affichage de l'ombre. Si <a href="Shadow.html#constant.OUT">Shadow::OUT</a> est spécifié, alors l'ombre sera dessinée en dehors du rectangle. Si <a href="Shadow.html#constant.IN">Shadow::IN</a> est spécifié, alors l'ombre sera dessinée à l'intérieur du rectangle.
</div>
<div class="description-bottom"><a href="Shadow.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Line.html
New file
0,0 → 1,279
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Line</h2><div class="extends"><ul>
<li><a href="Shape.html">Shape</a></li>
<ul><li>Line</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="Line.html">Line</a> permet de manipuler des lignes de manière uniforme sur Artichow. Une ligne est composée de deux Point.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Line :
<ul><li><a href="Vector.html">Vector</a></li></ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Line.html#property.p1"><span class="argument">$p1</span></a>
</li>
<li>
<span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Line.html#property.p2"><span class="argument">$p2</span></a>
</li>
<li>
<span class="access">private</span> <span class="type">float</span> <a href="Line.html#property.slope"><span class="argument">$slope</span></a>
</li>
<li>
<span class="access">private</span> <span class="type">float</span> <a href="Line.html#property.origin"><span class="argument">$origin</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Line.html#method.__construct">__construct</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>, <span class="type">int</span> <span class="argument">$style</span> := <span class="default">Line::SOLID</span>, <span class="type">int</span> <span class="argument">$thickness</span> := <span class="default">1</span>)
</li>
<li>
<span class="access">public static</span> <a href="Line.html#method.build">build</a>(<span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>)
</li>
<li>
<span class="access">public</span> <a href="Line.html#method.setX">setX</a>(<span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$x2</span>)
</li>
<li>
<span class="access">public</span> <a href="Line.html#method.setY">setY</a>(<span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$y2</span>)
</li>
<li>
<span class="access">public</span> <a href="Line.html#method.setLocation">setLocation</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Line.html#method.getLocation">getLocation</a>()
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getSize">getSize</a>()
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getSlope">getSlope</a>()
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getOrigin">getOrigin</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Line.html#method.getEquation">getEquation</a>()
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getXFrom">getXFrom</a>(<span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getYFrom">getYFrom</a>(<span class="type">float</span> <span class="argument">$x</span>)
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isPoint">isPoint</a>()
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isHorizontal">isHorizontal</a>()
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isVertical">isVertical</a>()
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isTopToBottom">isTopToBottom</a>(<a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isLeftToRight">isLeftToRight</a>(<a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.p1"></a><span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Line.html#property.p1"><span class="argument">$p1</span></a><div class="description">
Le premier point de la ligne.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.p2"></a><span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Line.html#property.p2"><span class="argument">$p2</span></a><div class="description">
Le second point de la ligne.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.slope"></a><span class="access">private</span> <span class="type">float</span> <a href="Line.html#property.slope"><span class="argument">$slope</span></a><div class="description">
La pente (ou coefficient directeur) de la droite.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.origin"></a><span class="access">private</span> <span class="type">float</span> <a href="Line.html#property.origin"><span class="argument">$origin</span></a><div class="description">
La valeur de l'ordonnée à l'origine de la droite.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Line.html#method.__construct">__construct</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>, <span class="type">int</span> <span class="argument">$style</span> := <span class="default">Line::SOLID</span>, <span class="type">int</span> <span class="argument">$thickness</span> := <span class="default">1</span>)
<div class="description">
Déclare une nouvelle ligne des points $p1 à $p2. La ligne est de style $style (<a href="Line.html#constant.SOLID">Line::SOLID</a> pour une ligne continue, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> pour une ligne pointillée ou encore <a href="Line.html#constant.DASHED">Line::DASHED</a>) et d'épaisseur $thickness.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.build"></a><span class="access">public static</span> <a href="Line.html#method.build">build</a>(<span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>)
<div class="description">
Construit une ligne à partir des coordonnées ($x1, $y1) et ($x2, $y2)
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setX"></a><span class="access">public</span> <a href="Line.html#method.setX">setX</a>(<span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$x2</span>)
<div class="description">
Change les coordonnées X des deux points de la ligne pour $x1 et $x2.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setY"></a><span class="access">public</span> <a href="Line.html#method.setY">setY</a>(<span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$y2</span>)
<div class="description">
Change les coordonnées Y des deux points de la ligne pour $y1 et $y2.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLocation"></a><span class="access">public</span> <a href="Line.html#method.setLocation">setLocation</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Change l'emplacement de la ligne pour les points $p1 et $p2 passés en paramètre.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLocation"></a><span class="access">public</span> <span class="type">array</span> <a href="Line.html#method.getLocation">getLocation</a>()
<div class="description">
Retourne la position de la ligne dans un tableau à deux valeurs.
<pre>
 
&lt;?php
$line = new Line(new Point(1, 2), new Point(3, 4));
list($p1, $p2) = $line-&gt;getLocation();
// $p1 == new Point(1, 2)
// $p2 == new Point(3, 4)
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSize"></a><span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getSize">getSize</a>()
<div class="description">
Retourne la taille de la ligne en pixels.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSlope"></a><span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getSlope">getSlope</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie la valeur de la pente de la ligne.
Si celle-ci est verticale, la pente vaudra NULL; si elle est horizontale, la pente vaudra 0.
La valeur est calculée uniquement lorsqu'elle est demandée.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getOrigin"></a><span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getOrigin">getOrigin</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie la valeur de l'ordonnée à l'origine.
Si la ligne est verticale, l'ordonnée à l'origine vaudra NULL.
La valeur est calculée uniquement lorsqu'elle est demandée.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getEquation"></a><span class="access">public</span> <span class="type">array</span> <a href="Line.html#method.getEquation">getEquation</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie un tableau contenant la pente et l'ordonnée à l'origine de la ligne.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getXFrom"></a><span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getXFrom">getXFrom</a>(<span class="type">float</span> <span class="argument">$y</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie la valeur de l'abscisse du point d'ordonnée $y situé sur la droite portant la ligne.
Si la ligne est horizontale et que $y est différent de l'ordonnée à l'origine, aucun point ne pourra être trouvé et la méthode renverra NULL.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getYFrom"></a><span class="access">public</span> <span class="type">float</span> <a href="Line.html#method.getYFrom">getYFrom</a>(<span class="type">float</span> <span class="argument">$x</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie la valeur de l'ordonnée du point d'abscisse $x situé sur la droite portant la ligne.
Si la ligne est verticale et qu'aucun point correspondant à $x ne peut être trouvé, la méthode renverra NULL.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isPoint"></a><span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isPoint">isPoint</a>()
<div class="description">
Retourne TRUE si la ligne peut être considérée comme un point, FALSE sinon.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isHorizontal"></a><span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isHorizontal">isHorizontal</a>()
<div class="description">
Retourne TRUE si la ligne est horizontale, FALSE sinon.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isVertical"></a><span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isVertical">isVertical</a>()
<div class="description">
Retourne TRUE si la ligne est verticale, FALSE sinon.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isTopToBottom"></a><span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isTopToBottom">isTopToBottom</a>(<a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie TRUE si la ligne remplit toute la hauteur du rectangle encadrant le polygone $polygon, FALSE sinon.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isLeftToRight"></a><span class="access">public</span> <span class="type">bool</span> <a href="Line.html#method.isLeftToRight">isLeftToRight</a>(<a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie TRUE si la ligne remplit toute la largeur du rectangle encadrant le polygone $polygon, FALSE sinon.
</div>
<div class="description-bottom"><a href="Line.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/MathPlot.html
New file
0,0 → 1,124
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class MathPlot</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul><li>MathPlot</li></ul>
</ul></div><div class="description">
<p>
Cette classe permet de représenter simplement des fonctions f(x) sur un graphique.
L'archive de Artichow contient plusieurs exemples pour vous aider dans la conception de ces graphiques.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="MathPlot.html#property.grid"><span class="argument">$grid</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.xAxis"><span class="argument">$xAxis</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.yAxis"><span class="argument">$yAxis</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="MathPlot.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$xMin</span>, <span class="type">float</span> <span class="argument">$xMax</span>, <span class="type">float</span> <span class="argument">$yMax</span>, <span class="type">float</span> <span class="argument">$yMin</span>)
</li>
<li>
<span class="access">public</span> <a href="MathPlot.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
</li>
<li>
<span class="access">public</span> <a href="MathPlot.html#method.add">add</a>(<a href="MathFunction.html"><span class="type">MathFunction</span></a> <span class="argument">$function</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.grid"></a><span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="MathPlot.html#property.grid"><span class="argument">$grid</span></a><div class="description">
Représente la grille de fond du graphique.
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.xAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.xAxis"><span class="argument">$xAxis</span></a><div class="description">
Représente l'axe des abscisses.
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.yAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="MathPlot.html#property.yAxis"><span class="argument">$yAxis</span></a><div class="description">
Représente l'axe des ordonnées.
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="MathPlot.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$xMin</span>, <span class="type">float</span> <span class="argument">$xMax</span>, <span class="type">float</span> <span class="argument">$yMax</span>, <span class="type">float</span> <span class="argument">$yMin</span>)
<div class="description">
Construit le graphique.
L'axe des X va des valeurs $xMin à $xMax tandis que l'axe de Y va des valeurs $yMin à $yMax.
<pre>
 
&lt;?php
 
require_once "MathPlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(300, 300);
 
 
$plot = new <a href="MathPlot.html">MathPlot</a>(-3, 3, 3, -3);
$plot-&gt;<a href="MathPlot.html#method.setInterval">setInterval</a>(0.1);
 
// On dessine cos(x)
$function = new <a href="MathFunction.html">MathFunction</a>('cos');
$plot-&gt;<a href="MathPlot.html#method.add">add</a>($function);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setInterval"></a><span class="access">public</span> <a href="MathPlot.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
<div class="description">
Change l'interval sur lequel sont calculées les valeurs affichées sur le graphique.
Par défaut, cet interval est de 1, c'est-à-dire que Artichow calcule f(x) pour toutes les valeurs entières de x.
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.add"></a><span class="access">public</span> <a href="MathPlot.html#method.add">add</a>(<a href="MathFunction.html"><span class="type">MathFunction</span></a> <span class="argument">$function</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
<div class="description">
Ajoute une fonction mathématique au graphique.
Sur la légende, la fonction aura pour nom $name et le type de légende utilisé sera $type (<a href="Legend.html#constant.LINE">Legend::LINE</a>, <a href="Legend.html#constant.BACKGROUND">Legend::BACKGROUND</a> ou encore <a href="Legend.html#constant.MARK">Legend::MARK</a>).
Si vous ne souhaitez pas associer de légende à cette fonction, laissez l'argument $name à NULL.
</div>
<div class="description-bottom"><a href="MathPlot.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Point.html
New file
0,0 → 1,134
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Point</h2><div class="extends"><ul>
<li><a href="Shape.html">Shape</a></li>
<ul><li>Point</li></ul>
</ul></div><div class="description">
<p>La classe <a href="Point.html">Point</a> permet de manipuler des points dans un espace de deux dimensions.</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Point.html#property.x"><span class="argument">$x</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Point.html#property.y"><span class="argument">$y</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Point.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html#method.setX">setX</a>(<span class="type">float</span> <span class="argument">$x</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html#method.setY">setY</a>(<span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html#method.setLocation">setLocation</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Point.html#method.getLocation">getLocation</a>()
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Point.html#method.getDistance">getDistance</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html#method.move">move</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.x"></a><span class="access">public</span> <span class="type">float</span> <a href="Point.html#property.x"><span class="argument">$x</span></a><div class="description">
La position du point sur l'axe des abscisses.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.y"></a><span class="access">public</span> <span class="type">float</span> <a href="Point.html#property.y"><span class="argument">$y</span></a><div class="description">
La position du point sur l'axe des ordonnées.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Point.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Déclare un nouveau point avec des coordonnées x et y.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setX"></a><span class="access">public</span> <a href="Point.html#method.setX">setX</a>(<span class="type">float</span> <span class="argument">$x</span>)
<div class="description">
Change la position X du point.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setY"></a><span class="access">public</span> <a href="Point.html#method.setY">setY</a>(<span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Change la position Y du point.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLocation"></a><span class="access">public</span> <a href="Point.html#method.setLocation">setLocation</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Change la position du point pour les valeurs x et y passées en paramètre.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLocation"></a><span class="access">public</span> <span class="type">array</span> <a href="Point.html#method.getLocation">getLocation</a>()
<div class="description">
Retourne la position du point dans un tableau à deux valeurs.
<pre>
 
&lt;?php
$p = new Point(3, 7);
list($x, $y) = $p-&gt;getLocation(); // array(3, 7)
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getDistance"></a><span class="access">public</span> <span class="type">float</span> <a href="Point.html#method.getDistance">getDistance</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p</span>)
<div class="description">
Retourne la distance entre le point et le point $p.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.move"></a><span class="access">public</span> <a href="Point.html#method.move">move</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Change la position du point en ajoutant à ses coordonnées actuelles les valeurs x et y passées en paramètre.
</div>
<div class="description-bottom"><a href="Point.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Mark.html
New file
0,0 → 1,265
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Mark</h2><div class="description">
<p>
La classe <a href="Mark.html">Mark</a> permet de créer des marques, qui peuvent être affichées n'importe où sur une image.
Typiquement, les marques sont affichées sur les courbes pour mettre en valeur chaque point.
</p>
<div class="image">
<img src="doc/image/marks.png">
</div>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.CIRCLE">CIRCLE</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.SQUARE">SQUARE</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.TRIANGLE">TRIANGLE</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.INVERTED_TRIANGLE">INVERTED_TRIANGLE</a> := <span class="default">4</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.RHOMBUS">RHOMBUS</a> := <span class="default">5</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.CROSS">CROSS</a> := <span class="default">6</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.PLUS">PLUS</a> := <span class="default">7</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.IMAGE">IMAGE</a> := <span class="default">8</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.STAR">STAR</a> := <span class="default">9</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.PAPERCLIP">PAPERCLIP</a> := <span class="default">10</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.BOOK">BOOK</a> := <span class="default">11</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Mark.html#property.move"><span class="argument">$move</span></a>
</li>
<li>
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Mark.html#property.border"><span class="argument">$border</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Mark.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.setType">setType</a>(<span class="type">int</span> <span class="argument">$type</span>, <span class="type">int</span> <span class="argument">$size</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.setFill">setFill</a>(<span class="type">mixed</span> <span class="argument">$fill</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.setImage">setImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Mark.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.CIRCLE"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.CIRCLE">CIRCLE</a> := <span class="default">1</span><div class="description">
Pour les marques de la forme d'un cercle.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.SQUARE"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.SQUARE">SQUARE</a> := <span class="default">2</span><div class="description">
Pour les marques de la forme d'un carré.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.TRIANGLE"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.TRIANGLE">TRIANGLE</a> := <span class="default">3</span><div class="description">
Pour les marques de la forme d'un trianble.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.INVERTED_TRIANGLE"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.INVERTED_TRIANGLE">INVERTED_TRIANGLE</a> := <span class="default">4</span><div class="description">
Pour les marques de la forme d'un triangle inversé (sommet vers le bas).
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RHOMBUS"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.RHOMBUS">RHOMBUS</a> := <span class="default">5</span><div class="description">
Représente une marque de type rhombus (carré à 45°).
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.CROSS"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.CROSS">CROSS</a> := <span class="default">6</span><div class="description">
Représente une marque de la forme d'une croix (X).
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.PLUS"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.PLUS">PLUS</a> := <span class="default">7</span><div class="description">
Représente une marque de la forme d'un plus (+).
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.IMAGE"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.IMAGE">IMAGE</a> := <span class="default">8</span><div class="description">
Pour les marques de type image.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.STAR"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.STAR">STAR</a> := <span class="default">9</span><div class="description">
Représente une marque de type étoile.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.PAPERCLIP"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.PAPERCLIP">PAPERCLIP</a> := <span class="default">10</span><div class="description">
Représente une marque de type trombonne.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BOOK"></a><span class="access">const</span> <span class="type">int</span> <a href="Mark.html#constant.BOOK">BOOK</a> := <span class="default">11</span><div class="description">
Représente une marque de type livre.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.move"></a><span class="access">protected</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Mark.html#property.move"><span class="argument">$move</span></a><div class="description">
Le déplacement de la marque défini par l'utilisateur.
<div class="see">
Voir aussi :
<ul><li><a href="Mark.html#method.move">Mark::move()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.border"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Mark.html#property.border"><span class="argument">$border</span></a><div class="description">
La bordure qui entoure la marque.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Mark.html#method.__construct">__construct</a>()
<div class="description">
Construit un nouvel objet qui permettra l'affichage de marques sur une image.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.move"></a><span class="access">public</span> <a href="Mark.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Déplace l'affichage des marques de $x pixels sur l'axe des abscisses et de $y pixels sur l'axe des ordonnées.
Les appels à <a href="Mark.html#method.move">move()</a> sont cumulés, c'est-à-dire qu'un appel avec de nouvelles valeurs additionnera ces valeurs avec les anciennes.
Par défaut, $x et $y sont à 0 pixel.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Mark.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Permet de cacher (par défaut) ou d'afficher les marques.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Mark.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
<div class="description">
Permet d'afficher (par défaut) ou de cacher les marques.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Mark.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Change la taille des marques pour $size. Cette méthode n'a aucun effet pour les marques de type <a href="Mark.html#constant.IMAGE"></a>, <a href="Mark.html#constant.STAR"></a>, <a href="Mark.html#constant.PAPERCLIP"></a> ou <a href="Mark.html#constant.BOOK"></a>.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setType"></a><span class="access">public</span> <a href="Mark.html#method.setType">setType</a>(<span class="type">int</span> <span class="argument">$type</span>, <span class="type">int</span> <span class="argument">$size</span> := <span class="default">NULL</span>)
<div class="description">
Change le type de marque à utiliser.
Les valeurs possibles sont <a href="Mark.html#constant.CIRCLE"></a>, <a href="Mark.html#constant.SQUARE"></a>, <a href="Mark.html#constant.TRIANGLE"></a>, <a href="Mark.html#constant.IMAGE"></a>, <a href="Mark.html#constant.STAR"></a>, <a href="Mark.html#constant.PAPERCLIP"></a> ou encore <a href="Mark.html#constant.BOOK"></a>.
L'argument optionnel $size permet de déterminer la taille de la marque et n'a aucun effet sur <a href="Mark.html#constant.IMAGE"></a>, <a href="Mark.html#constant.PAPERCLIP"></a> et <a href="Mark.html#constant.BOOK"></a>.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFill"></a><span class="access">public</span> <a href="Mark.html#method.setFill">setFill</a>(<span class="type">mixed</span> <span class="argument">$fill</span>)
<div class="description">
Remplit la marque avec la couleur ou le dégradé $fill. Cette méthode n'a aucun effet pour les marques de type <a href="Mark.html#constant.IMAGE">Mark::IMAGE</a>.
<div class="see">
Voir aussi :
<ul><li><a href="Mark.html#method.setType">Mark::setType()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setImage"></a><span class="access">public</span> <a href="Mark.html#method.setImage">setImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<div class="description">
Change l'image à afficher sur la marque. Cette méthode n'a de sens que pour les marques de type <a href="Mark.html#constant.IMAGE">Mark::IMAGE</a>.
<div class="see">
Voir aussi :
<ul><li><a href="Mark.html#method.setType">Mark::setType()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Mark.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Dessine la marque avec le pilote $driver. Le centre de la marque sera sur le point $point.
</div>
<div class="description-bottom"><a href="Mark.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Tick.html
New file
0,0 → 1,188
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Tick</h2><div class="description">
<p>
La classe <a href="Tick.html">Tick</a> permet de représenter des ticks, petits traits réguliers associés à un axe.
</p>
<div class="image">
<img src="doc/image/ticks-out.png" style="margin-right: 42px" alt="Ticks à l'extérieur">
<img src="doc/image/ticks-in.png" alt="Ticks à l'intérieur">
</div>
<p>
De nombreuses méthodes de la classe <a href="Tick.html">Tick</a> ne sont pas documentées,
car elles ne sont utilisées qu'en interne par Artichow.
Néanmoins, si vous développez Artichow, vous aurez besoin de ces méthodes.
N'hésitez donc pas à parcourir le code source de cette classe.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.OUT">OUT</a> := <span class="default">0</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.IN">IN</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.IN_OUT">IN_OUT</a> := <span class="default">2</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Tick.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$number</span>, <span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.setNumber">setNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.hideFirst">hideFirst</a>(<span class="type">bool</span> <span class="argument">$hideFirst</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.hideLast">hideLast</a>(<span class="type">bool</span> <span class="argument">$hideLast</span>)
</li>
<li>
<span class="access">public</span> <a href="Tick.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Vector.html"><span class="type">Vector</span></a> <span class="argument">$vector</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.OUT"></a><span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.OUT">OUT</a> := <span class="default">0</span><div class="description">
Indique que les ticks doivent être tournés vers l'extérieur.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.IN"></a><span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.IN">IN</a> := <span class="default">1</span><div class="description">
Indique que les types doivent être tournés vers l'intérieur.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.IN_OUT"></a><span class="access">const</span> <span class="type">string</span> <a href="Tick.html#constant.IN_OUT">IN_OUT</a> := <span class="default">2</span><div class="description">
Indique que les ticks sont et tournés vers l'extérieur, et tournés vers l'intérieur.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Tick.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$number</span>, <span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Construit un nouvel objet <a href="Tick.html">Tick</a>.
$number représente un nombre de ticks et $size leur taille en pixels.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStyle"></a><span class="access">public</span> <a href="Tick.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style des ticks. Peut être <a href="Tick.html#constant.IN">Tick::IN</a>, <a href="Tick.html#constant.OUT">Tick::OUT</a> ou <a href="Tick.html#constant.IN_OUT">Tick::IN_OUT</a>.
Dans le premier cas, les ticks seront tournés vers l'intérieur. Dans le second vers l'extérieur et dans le troisième et vers l'extérieur et vers l'intérieur.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="Tick.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur des ticks pour $color.
Par défaut, les ticks sont dessinés en noir.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Tick.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Change la taille des ticks pour $size.
$size doit être donné en pixels.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setInterval"></a><span class="access">public</span> <a href="Tick.html#method.setInterval">setInterval</a>(<span class="type">int</span> <span class="argument">$interval</span>)
<div class="description">
Change l'intervalle d'affichage des ticks par rapport à leur nombre.
Si $interval vaut 1, alors tous les ticks seront affichés.
Si $interval vaut 0.5, alors un tick sur deux sera affiché.
<div class="see">
Voir aussi :
<ul><li><a href="Tick.html#method.setNumber">Tick::setNumber()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setNumber"></a><span class="access">public</span> <a href="Tick.html#method.setNumber">setNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
<div class="description">
Change le nombre de ticks à afficher pour $number.
<div class="see">
Voir aussi :
<ul><li><a href="Tick.html#method.setInterval">Tick::setInterval()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Tick.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Permet de cache ou d'afficher les ticks.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideFirst"></a><span class="access">public</span> <a href="Tick.html#method.hideFirst">hideFirst</a>(<span class="type">bool</span> <span class="argument">$hideFirst</span>)
<div class="description">
Permet de cache ou d'afficher le premier tick.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideLast"></a><span class="access">public</span> <a href="Tick.html#method.hideLast">hideLast</a>(<span class="type">bool</span> <span class="argument">$hideLast</span>)
<div class="description">
Permet de cache ou d'afficher le dernier tick.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Tick.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Vector.html"><span class="type">Vector</span></a> <span class="argument">$vector</span>)
<div class="description">
Dessine les ticks sur le vecteur $vector.
</div>
<div class="description-bottom"><a href="Tick.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Gradient.html
New file
0,0 → 1,82
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2>
<small>abstract</small> Class Gradient</h2><div class="description">
<p>
Toutes les classes qui décrivent un dégradé dérivent de cette classe abstraite.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Gradient :
<ul>
<li><a href="LinearGradient.html">LinearGradient</a></li>
<li><a href="RadialGradient.html">RadialGradient</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Gradient.html#property.from"><span class="argument">$from</span></a>
</li>
<li>
<span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Gradient.html#property.to"><span class="argument">$to</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Gradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>)
</li>
<li>
<span class="access">public</span> <a href="Gradient.html#method.free">free</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.from"></a><span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Gradient.html#property.from"><span class="argument">$from</span></a><div class="description">
La couleur de départ pour le dégradé
</div>
<div class="description-bottom"><a href="Gradient.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.to"></a><span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Gradient.html#property.to"><span class="argument">$to</span></a><div class="description">
La couleur d'arrivée pour le dégradé
</div>
<div class="description-bottom"><a href="Gradient.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Gradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>)
<div class="description">
Construit une nouveu dégradé. Cette méthode doit être appelée par toutes les classes qui dérivent de celle-ci. Le paramètre $from décrit la couleur de départ du dégradé et le paramètre $to celle de fin.
</div>
<div class="description-bottom"><a href="Gradient.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.free"></a><span class="access">public</span> <a href="Gradient.html#method.free">free</a>()
<div class="description">
Libère les ressources allouées lors de la création du dégradé.
</div>
<div class="description-bottom"><a href="Gradient.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Legend.html
New file
0,0 → 1,442
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Legend</h2><div class="description">
<p>
La classe <a href="Legend.html">Legend</a> permet de manipuler des légendes.
Un objet de la classe <a href="Legend.html">Legend</a> est disponible sur tous les <a href="Component.html">composants</a>.
N'importe quel objet peut être légendé à condition qu'il implémente l'interface <a href="Legendable.html">Legendable</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.LINE">LINE</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.BACKGROUND">BACKGROUND</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MARK">MARK</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MARKONLY">MARKONLY</a> := <span class="default">4</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MODEL_RIGHT">MODEL_RIGHT</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MODEL_BOTTOM">MODEL_BOTTOM</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.LEFT">LEFT</a> := <span class="default">0</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.RIGHT">RIGHT</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.CENTER">CENTER</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.TOP">TOP</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.BOTTOM">BOTTOM</a> := <span class="default">4</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MIDDLE">MIDDLE</a> := <span class="default">5</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="Legend.html#property.shadow"><span class="argument">$shadow</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Legend.html#property.hide"><span class="argument">$hide</span></a>
</li>
<li>
<span class="access">protected</span> <a href="ArrayOject.html"><span class="type">ArrayOject</span></a> <a href="Legend.html#property.legends"><span class="argument">$legends</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Legend.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$model</span> := <span class="default">Legend::MODEL_RIGHT</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setModel">setModel</a>(<span class="type">int</span> <span class="argument">$model</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.add">add</a>(<a href="Legendable.html"><span class="type">Legendable</span></a> <span class="argument">$legendable</span>, <span class="type">string</span> <span class="argument">$title</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setColumns">setColumns</a>(<span class="type">int</span> <span class="argument">$columns</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setRows">setRows</a>(<span class="type">int</span> <span class="argument">$rows</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$y</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Legend.html#method.getPosition">getPosition</a>()
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setTextFont">setTextFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setTextMargin">setTextMargin</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setTextColor">setTextColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setBackground">setBackground</a>(<span class="type">mixed</span> <span class="argument">$background</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setBorderSize">setBorderSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.setBorderColor">setBorderColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Legend.html#method.count">count</a>()
</li>
<li>
<span class="access">public</span> <a href="Legend.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.LINE"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.LINE">LINE</a> := <span class="default">1</span><div class="description">
Utilise une couleur de ligne pour identifier un objet dans la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BACKGROUND"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.BACKGROUND">BACKGROUND</a> := <span class="default">2</span><div class="description">
Utilise une couleur de fond pour identifier un objet dans la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MARK"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MARK">MARK</a> := <span class="default">3</span><div class="description">
Utilise un objet Mark et une ligne pour identifier un objet dans la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MARKONLY"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MARKONLY">MARKONLY</a> := <span class="default">4</span><div class="description">
Utilise un objet Mark seulement pour identifier un objet dans la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MODEL_RIGHT"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MODEL_RIGHT">MODEL_RIGHT</a> := <span class="default">1</span><div class="description">
Modèle prédéfini qui place la légende à droite.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MODEL_BOTTOM"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MODEL_BOTTOM">MODEL_BOTTOM</a> := <span class="default">2</span><div class="description">
Modèle prédéfini qui place la légende en bas.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.LEFT"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.LEFT">LEFT</a> := <span class="default">0</span><div class="description">
Aligne horizontalement la légende à gauche.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RIGHT"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.RIGHT">RIGHT</a> := <span class="default">1</span><div class="description">
Aligne horizontalement la légende à droite.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.CENTER"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.CENTER">CENTER</a> := <span class="default">2</span><div class="description">
Centre la légende horizontalement.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.TOP"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.TOP">TOP</a> := <span class="default">3</span><div class="description">
Aligne verticalement la légende en haut.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BOTTOM"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.BOTTOM">BOTTOM</a> := <span class="default">4</span><div class="description">
Aligne verticalement la légende en bas.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MIDDLE"></a><span class="access">const</span> <span class="type">int</span> <a href="Legend.html#constant.MIDDLE">MIDDLE</a> := <span class="default">5</span><div class="description">
Aligne verticalement la légende au milieu.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.shadow"></a><span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="Legend.html#property.shadow"><span class="argument">$shadow</span></a><div class="description">
Cette propriété permet de manipuler l'ombre associée éventuellement avec la légende.
Par défaut, aucune ombre n'est affichée. Si vous souhaitez afficher une ombre, il vous suffit de lui donner une taille :
<pre>
 
&lt;?php
 
require_once "Tools.class.php";
 
$legend = new <a href="Legend.html">Legend</a>();
 
// On associe une ombre de 4 pixels à la légende
$legend-&gt;shadow-&gt;<a href="Legend.html#method.setSize">setSize</a>(4);
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hide"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Legend.html#property.hide"><span class="argument">$hide</span></a><div class="description">
Détermine si la légende doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.legends"></a><span class="access">protected</span> <a href="ArrayOject.html"><span class="type">ArrayOject</span></a> <a href="Legend.html#property.legends"><span class="argument">$legends</span></a><div class="description">
Les objets <a href="Legendable.html">Legendable</a> à afficher sur la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Legend.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$model</span> := <span class="default">Legend::MODEL_RIGHT</span>)
<div class="description">
Construit une nouvelle légende avec le modèle $model.
Les valeurs possibles pour $model sont <a href="Legend.html#constant.MODEL_BOTTOM">Legend::MODEL_BOTTOM</a> et <a href="Legend.html#constant.MODEL_RIGHT">Legend::MODEL_RIGHT</a>.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Legend.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span> := <span class="default">TRUE</span>)
<div class="description">
Permet de cacher (par défaut) ou d'afficher la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Legend.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span> := <span class="default">TRUE</span>)
<div class="description">
Permet d'afficher (par défaut) ou de cacher la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setModel"></a><span class="access">public</span> <a href="Legend.html#method.setModel">setModel</a>(<span class="type">int</span> <span class="argument">$model</span>)
<div class="description">
Change le modèle de légende pour $model.
L'appel à cette méthode peut écraser les valeurs passées à d'autres méthodes comme <a href="Legend.html#method.setPadding">setPadding()</a> ou <a href="Legend.html#method.setHorizontalAlign">setHorizontalAlign()</a> par exemple (liste non exhaustive).
Les valeurs possibles pour $model sont <a href="Legend.html#constant.MODEL_BOTTOM">Legend::MODEL_BOTTOM</a> et <a href="Legend.html#constant.MODEL_RIGHT">Legend::MODEL_RIGHT</a>.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.add"></a><span class="access">public</span> <a href="Legend.html#method.add">add</a>(<a href="Legendable.html"><span class="type">Legendable</span></a> <span class="argument">$legendable</span>, <span class="type">string</span> <span class="argument">$title</span>, <span class="type">int</span> <span class="argument">$type</span> := <span class="default">Legend::LINE</span>)
<div class="description">
Ajoute un nouvel objet <a href="Legendable.html">légendable</a> avec pour titre $title à cette légende.
$type permet de spécifier le type de légende, qui peut être <a href="Legend.html#constant.LINE">Legend::LINE</a>, <a href="Legend.html#constant.BACKGROUND">Legend::BACKGROUND</a>, <a href="Legend.html#constant.MARK">Legend::MARK</a> ou encore <a href="Legend.html#constant.MARKONLY">Legend::MARKONLY</a>.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPadding"></a><span class="access">public</span> <a href="Legend.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>, <span class="type">int</span> <span class="argument">$top</span>, <span class="type">int</span> <span class="argument">$bottom</span>)
<div class="description">
Change l'espace interne de la légende.
Les nouvelles valeurs doivent être données en pixels.
Laissez les paramètres dont vous ne souhaitez pas modifier la valeur à NULL.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSpace"></a><span class="access">public</span> <a href="Legend.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
<div class="description">
Change l'espace entre chaque valeur.
Cet espace doit être donné en pixels.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAlign"></a><span class="access">public</span> <a href="Legend.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
<div class="description">
Change l'alignement de la légende par rapport au point où elle sera affichée.
$h correspond à l'alignement horizontal (<a href="Legend.html#constant.LEFT">Legend::LEFT</a>, <a href="Legend.html#constant.RIGHT">Legend::RIGHT</a> ou <a href="Legend.html#constant.CENTER">Legend::CENTER</a>) et $v à l'alignement vertical (<a href="Legend.html#constant.TOP">Legend::TOP</a>, <a href="Legend.html#constant.BOTTOM">Legend::BOTTOM</a> ou <a href="Legend.html#constant.MIDDLE">Legend::MIDDLE</a>).
Si vous ne souhaitez pas modifier une des deux valeurs, vous pouvez passer NULL.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColumns"></a><span class="access">public</span> <a href="Legend.html#method.setColumns">setColumns</a>(<span class="type">int</span> <span class="argument">$columns</span>)
<div class="description">
Change le nombre de colonnes qui seront affichées dans la légende pour $columns.
Cette méthode est incompatible avec <a href="Legend.html#method.setRows">setRows()</a>.
<div class="see">
Voir aussi :
<ul><li><a href="Legend.html#method.setColumns">Legend::setColumns()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setRows"></a><span class="access">public</span> <a href="Legend.html#method.setRows">setRows</a>(<span class="type">int</span> <span class="argument">$rows</span>)
<div class="description">
Change le nombre de lignes qui seront affichées dans la légende pour $rows.
Cette méthode est incompatible avec <a href="Legend.html#method.setColumns">setColumns()</a>.
<div class="see">
Voir aussi :
<ul><li><a href="Legend.html#method.setRows">Legend::setRows()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPosition"></a><span class="access">public</span> <a href="Legend.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$y</span> := <span class="default">NULL</span>)
<div class="description">
Change la position de la légende sur l'objet légendé.
Les positions $x et $y sont des fractions des largeur et hauteur de l'objet légendé.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getPosition"></a><span class="access">public</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Legend.html#method.getPosition">getPosition</a>()
<div class="description">
Retourne la position courante de la légende sur l'objet légendé sous la forme d'un <a href="Point.html">point</a>.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTextFont"></a><span class="access">public</span> <a href="Legend.html#method.setTextFont">setTextFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
<div class="description">
Change la police à utiliser sur la légende.
Voir la classe <a href="Font.html">Font</a> pour une liste des polices disponibles.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTextMargin"></a><span class="access">public</span> <a href="Legend.html#method.setTextMargin">setTextMargin</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$right</span>)
<div class="description">
Change la marge gauche et droite autour du texte des légendes.
$left et $right sont à donner en pixels.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTextColor"></a><span class="access">public</span> <a href="Legend.html#method.setTextColor">setTextColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur du texte de la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackground"></a><span class="access">public</span> <a href="Legend.html#method.setBackground">setBackground</a>(<span class="type">mixed</span> <span class="argument">$background</span>)
<div class="description">
Change le fond de la légende.
$background peut être soit une couleur, soit un dégradé.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Legend.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond de la légende.
<div class="see">
Voir aussi :
<ul><li><a href="Legend.html#method.setBackground">Legend::setBackground()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Legend.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond de la légende.
<div class="see">
Voir aussi :
<ul><li><a href="Legend.html#method.setBackground">Legend::setBackground()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBorderSize"></a><span class="access">public</span> <a href="Legend.html#method.setBorderSize">setBorderSize</a>(<span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Change la taille de la bordure qui entoure la légende.
Les valeurs possibles sont 0 et 1.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBorderColor"></a><span class="access">public</span> <a href="Legend.html#method.setBorderColor">setBorderColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la bordure qui entoure la légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.count"></a><span class="access">public</span> <span class="type">int</span> <a href="Legend.html#method.count">count</a>()
<div class="description">
Retourne le nombre d'objets <a href="Legendable.html">légendable</a> qui ont été ajoutés à cette légende.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="Legend.html#method.draw">draw</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Dessine la légende avec le pilote $driver.
</div>
<div class="description-bottom"><a href="Legend.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/MathFunction.html
New file
0,0 → 1,87
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class MathFunction</h2><div class="description">
<p>
Cette classe permet de représenter une fonction mathématique f(x) à afficher sur un graphique de type <a href="MathPlot.html">MathPlot</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Line.html"><span class="type">Line</span></a> <a href="MathFunction.html#property.line"><span class="argument">$line</span></a>
</li>
<li>
<span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="MathFunction.html#property.mark"><span class="argument">$mark</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="MathFunction.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$f</span>, <span class="type">float</span> <span class="argument">$fromX</span>, <span class="type">float</span> <span class="argument">$toX</span>)
</li>
<li>
<span class="access">public</span> <a href="MathFunction.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="MathFunction.html#method.getColor">getColor</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.line"></a><span class="access">public</span> <a href="Line.html"><span class="type">Line</span></a> <a href="MathFunction.html#property.line"><span class="argument">$line</span></a><div class="description">
La ligne qui sera utilisée pour représenter la fonction.
</div>
<div class="description-bottom"><a href="MathFunction.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.mark"></a><span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="MathFunction.html#property.mark"><span class="argument">$mark</span></a><div class="description">
Les marques qui seront affichés sur chaque point calculé.
</div>
<div class="description-bottom"><a href="MathFunction.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="MathFunction.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$f</span>, <span class="type">float</span> <span class="argument">$fromX</span>, <span class="type">float</span> <span class="argument">$toX</span>)
<div class="description">
Créé un objet <a href="MathFunction.html">MathFunction</a> avec la fonction $f.
$f est une fonction qui prend un paramètre $x en paramètre et qui doit retourner une valeur $y.
Les valeurs $fromX et $toX représentent les valeurs de X à partir desquelles commencer et terminer le calcul de la courbe représentative de la fonction.
</div>
<div class="description-bottom"><a href="MathFunction.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="MathFunction.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la courbe représentative de la fonction pour $color.
</div>
<div class="description-bottom"><a href="MathFunction.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <a href="Color.html"><span class="type">Color</span></a> <a href="MathFunction.html#method.getColor">getColor</a>()
<div class="description">
Retourne la couleur de la courbe représentative de la fonction.
</div>
<div class="description-bottom"><a href="MathFunction.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Graph.html
New file
0,0 → 1,214
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Graph</h2><div class="extends"><ul>
<li><a href="Image.html">Image</a></li>
<ul><li>Graph</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="Graph.html">Graph</a> permet de générer des graphiques, de les mettre éventuellement en cache et d'afficher le temps de génération de l'image. Il est possible de dessiner plusieurs <a href="Component.html">composants</a> sur une <a href="Image.html">image</a> de type <a href="Graph.html">Graph</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_RETURN">DRAW_RETURN</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_DISPLAY">DRAW_DISPLAY</a> := <span class="default">2</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">protected</span> <span class="type">string</span> <a href="Graph.html#property.name"><span class="argument">$name</span></a> := <span class="default">NULL</span>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Graph.html#property.timeout"><span class="argument">$timeout</span></a> := <span class="default">0</span>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Graph.html#property.timing"><span class="argument">$timing</span></a> := <span class="default">FALSE</span>
</li>
<li>
<span class="access">protected</span> <span class="type">array</span> <a href="Graph.html#property.labels"><span class="argument">$labels</span></a>
</li>
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Graph.html#property.title"><span class="argument">$title</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Graph.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$height</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$timeout</span> := <span class="default">0</span>)
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Graph.html#method.deleteFromCache">deleteFromCache</a>(<span class="type">string</span> <span class="argument">$name</span>)
</li>
<li>
<span class="access">public</span> <a href="Graph.html#method.deleteAllCache">deleteAllCache</a>()
</li>
<li>
<span class="access">public</span> <a href="Graph.html#method.setTiming">setTiming</a>(<span class="type">bool</span> <span class="argument">$timing</span>)
</li>
<li>
<span class="access">public</span> <a href="Graph.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
</li>
<li>
<span class="access">public</span> <a href="Graph.html#method.addLabel">addLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Graph.html#method.addAbsLabel">addAbsLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Graph.html#method.draw">draw</a>(<span class="type">string</span> <span class="argument">
$mode</span> := <span class="default">Graph::DRAW_DISPLAY</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.DRAW_RETURN"></a><span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_RETURN">DRAW_RETURN</a> := <span class="default">1</span><div class="description">
Pour retourner le graphique après du dessin.
<div class="see">
Voir aussi :
<ul><li><a href="Graph.html#method.draw">Graph::draw()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.DRAW_DISPLAY"></a><span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_DISPLAY">DRAW_DISPLAY</a> := <span class="default">2</span><div class="description">
Pour afficher le graphique après du dessin.
<div class="see">
Voir aussi :
<ul><li><a href="Graph.html#method.draw">Graph::draw()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.name"></a><span class="access">protected</span> <span class="type">string</span> <a href="Graph.html#property.name"><span class="argument">$name</span></a> := <span class="default">NULL</span><div class="description">
Nom du graphique.
Peut être laissé à NULL pour ne donner aucun nom au graphique.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.timeout"></a><span class="access">protected</span> <span class="type">int</span> <a href="Graph.html#property.timeout"><span class="argument">$timeout</span></a> := <span class="default">0</span><div class="description">
Peut prendre comme valeur 0 pour ne pas utiliser la mise en cache, ou spécifier un timestamp comme date d'expiration de l'image dans le cache.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.timing"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Graph.html#property.timing"><span class="argument">$timing</span></a> := <span class="default">FALSE</span><div class="description">
Activer l'affichage du temps de génération de l'image ?
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.labels"></a><span class="access">protected</span> <span class="type">array</span> <a href="Graph.html#property.labels"><span class="argument">$labels</span></a><div class="description">
Une liste de <a href="Label.html">Label</a> qui seront affichés sur le graphique.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.title"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Graph.html#property.title"><span class="argument">$title</span></a><div class="description">
Permet de donner un titre au graphique.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Graph.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$height</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$timeout</span> := <span class="default">0</span>)
<div class="description">
Construit une image de largeur $width et de hauteur $height au nom $name (ce nom peut être laissé à NULL) et qui expirera dans le cache au timestamp $timeout. Si vous ne souhaitez pas utiliser le cache, vous pouvez laisser ce timestamp à 0.
$name ne représente pas le titre du graphique, c'est uniquement un moyen d'identification pour le cache.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.deleteFromCache"></a><span class="access">public</span> <span class="type">bool</span> <a href="Graph.html#method.deleteFromCache">deleteFromCache</a>(<span class="type">string</span> <span class="argument">$name</span>)
<div class="description">
Supprime manuellement l'image au nom $name du cache.
Cette méthode retourne TRUE si une image a été effectivement supprimée, FALSE sinon.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.deleteAllCache"></a><span class="access">public</span> <a href="Graph.html#method.deleteAllCache">deleteAllCache</a>()
<div class="description">
Supprime toutes les images mises en cache par Artichow.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setTiming"></a><span class="access">public</span> <a href="Graph.html#method.setTiming">setTiming</a>(<span class="type">bool</span> <span class="argument">$timing</span>)
<div class="description">
Active/désactive l'affichage du temps de génération de l'image sur l'image elle-même.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.add"></a><span class="access">public</span> <a href="Graph.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
<div class="description">
Ajoute un <a href="Component.html">composant</a> à dessiner sur l'image.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.addLabel"></a><span class="access">public</span> <a href="Graph.html#method.addLabel">addLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Ajoute une étiquette $label aux positions $x et $y.
Les nouvelles positions $x et $y représentent une fraction des largeur et hauteur du graphique.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.addAbsLabel"></a><span class="access">public</span> <a href="Graph.html#method.addAbsLabel">addAbsLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Ajoute une étiquette $label en position absolue sur le graphique aux coordonnées X et Y spécifiées par le point $point.
Le point (0, 0) se situe sur le coin haut-gauche du graphique.
</div>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Graph.html#method.draw">draw</a>(<span class="type">string</span> <span class="argument">
$mode</span> := <span class="default">Graph::DRAW_DISPLAY</span>)
<div class="description">
Créé et affiche l'image à l'utilisateur. Tous les composants précédemment ajoutés avec <a href="Graph.html#method.add">add()</a> sont dessinés sur l'image.
Cette méthode appelle successivement <a href="Image.html#method.create">create()</a>, <a href="Image.html#method.drawComponent">drawComponent()</a> autant de fois que de composants ont été ajoutés et <a href="Image.html#method.send">send()</a>.
</div>
<ul class="arguments">
<li class="property">
<span class="type">string</span> <a href="Graph.html#property.mode"><span class="argument">$mode</span></a> := <span class="default">Graph::DRAW_DISPLAY</span><ul class="version"><li>
Disponible depuis Artichow 1.0.8</li></ul>
</li>
<li class="property">
<span class="type">string</span> <a href="Graph.html#property.file"><span class="argument">$file</span></a> := <span class="default">NULL</span><ul class="version"><li>
Supprimé à partir d'Artichow 1.0.8</li></ul>
<div class="description">
Si vous souhaitez enregistrer l'image dans un fichier plutôt qu'à l'écran, indiquez un nom de fichier destination pour le paramètre $file.
Ce paramètre est optionnel, et si il n'est pas rempli, alors l'image sera affichée à l'écran.
</div>
</li>
</ul>
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Vector.html
New file
0,0 → 1,48
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Vector</h2><div class="extends"><ul>
<li><a href="Shape.html">Shape</a></li>
<ul>
<li><a href="Line.html">Line</a></li>
<ul><li>Vector</li></ul>
</ul>
</ul></div><div class="description">
<p>
La classe <a href="Vector.html">Vector</a> permet de représenter un vecteur.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods"><li>
<span class="access">public</span> <span class="type">float</span> <a href="Vector.html#method.getAngle">getAngle</a>()
</li></ul><h2>Documentation</h2><ul class="doc"><li class="method">
<a id="method.getAngle"></a><span class="access">public</span> <span class="type">float</span> <a href="Vector.html#method.getAngle">getAngle</a>()
<div class="description">
Retourne l'angle du vecteur en radians.
</div>
<div class="description-bottom"><a href="Vector.html#top">Remonter</a></div>
</li></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Component.html
New file
0,0 → 1,464
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2>
<small>abstract</small> Class Component</h2><div class="description">
<p>
Un composant est un objet qui peut être ajouté à une <a href="Image.html">Image</a>. Les composants sont indépendants les uns des autres. La classe <a href="Component.html">Component</a> est une classe abstraite, dont doivent dériver tous les objets qui vont pouvoir être ajoutés sur une image.
</p>
<p>
Sur un composant, l'axe des abscisses rejoint l'axe des ordonnées sur le coin haut-gauche. Le coin haut-gauche du composant a donc pour coordonnées (0, 0) et le coin bas-droite (largeur, hauteur). Par exemple, sur une image de largeur 100 et de hauteur 50, un point à 50 sur l'axe des abscisses et 25 sur l'axe des ordonnées sera au centre de l'image.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Component :
<ul>
<li><a href="ComponentGroup.html">ComponentGroup</a></li>
<li><a href="MathPlot.html">MathPlot</a></li>
<li><a href="Pie.html">Pie</a></li>
<li><a href="Plot.html">Plot</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Component.html#property.driver"><span class="argument">$driver</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.width"><span class="argument">$width</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.height"><span class="argument">$height</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.x"><span class="argument">$x</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.y"><span class="argument">$y</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.w"><span class="argument">$w</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.h"><span class="argument">$h</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.top"><span class="argument">$top</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.left"><span class="argument">$left</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">mixed</span> <a href="Component.html#property.background"><span class="argument">$background</span></a>
</li>
<li>
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.padding"><span class="argument">$padding</span></a>
</li>
<li>
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.space"><span class="argument">$space</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Component.html#property.auto"><span class="argument">$auto</span></a>
</li>
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Component.html#property.title"><span class="argument">$title</span></a>
</li>
<li>
<span class="access">public</span> <a href="Legend.html"><span class="type">Legend</span></a> <a href="Component.html#property.legend"><span class="argument">$legend</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Component.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$width</span>, <span class="type">float</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setBackgroundImage">setBackgroundImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Component.html#method.getBackground">getBackground</a>(<span class="type">int</span> <span class="argument">$type</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setCenter">setCenter</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$top</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.init">init</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">public</span> <a href="Component.html#method.finalize">finalize</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">abstract public</span> <span class="type">array</span> <a href="Component.html#method.getPosition">getPosition</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">abstract public</span> <a href="Component.html#method.drawEnvelope">drawEnvelope</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
</li>
<li>
<span class="access">abstract public</span> <a href="Component.html#method.drawComponent">drawComponent</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>, <span class="type">bool</span> <span class="argument">$aliasing</span>)
</li>
<li>
<span class="access">protected</span> <a href="Component.html#method.getSpace">getSpace</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.driver"></a><span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Component.html#property.driver"><span class="argument">$driver</span></a><div class="description">
Un objet <a href="Driver.html">Driver</a> pour dessiner sur l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.width"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.width"><span class="argument">$width</span></a><div class="description">
Largeur du composant entre 0 et 1. Représente une fraction de la largeur de l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.height"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.height"><span class="argument">$height</span></a><div class="description">
Hauteur du composant entre 0 et 1. Représente une fraction de la hauteur de l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.x"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.x"><span class="argument">$x</span></a><div class="description">
Position du composant sur l'axe des abscisses entre 0 et 1. Représente une fraction de la largeur de l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.y"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.y"><span class="argument">$y</span></a><div class="description">
Position du composant sur l'axe des ordonnées entre 0 et 1. Représente une fraction de la hauteur de l'image.
Attention, la position 0 correspond au haut de l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.w"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.w"><span class="argument">$w</span></a><div class="description">
Largeur du composant en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.h"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.h"><span class="argument">$h</span></a><div class="description">
Hauteur du composant en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.top"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.top"><span class="argument">$top</span></a><div class="description">
Position du composant sur l'axe des ordonnées en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.left"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.left"><span class="argument">$left</span></a><div class="description">
Position du composant sur l'axe des abscisses en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.background"></a><span class="access">protected</span> <span class="type">mixed</span> <a href="Component.html#property.background"><span class="argument">$background</span></a><div class="description">
Fond du composant. Peut être une <a href="Color.html">couleur</a>, un <a href="Gradient.html">dégradé</a> ou peut être laissé à NULL pour ne spécifier aucune couleur de fond.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.padding"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.padding"><span class="argument">$padding</span></a><div class="description">
Espace interne du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.space"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.space"><span class="argument">$space</span></a><div class="description">
Espace interne dans la zone de dessin effective du composant. Les valeurs doivent être données en pourcentage de la taille de la zone de dessin.
Le zone de dessin est la zone dans laquelle est dessiné le composant, c'est-à-dire la zone du composant amputée des axes et de l'<a href="Component.html#property.padding">espace interne</a>.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.auto"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Component.html#property.auto"><span class="argument">$auto</span></a><div class="description">
Doit-on ajuster automatiquement le composant ?
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.title"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Component.html#property.title"><span class="argument">$title</span></a><div class="description">
Le titre du composant.
Si un titre est spécifié, il sera affiché sur l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.legend"></a><span class="access">public</span> <a href="Legend.html"><span class="type">Legend</span></a> <a href="Component.html#property.legend"><span class="argument">$legend</span></a><div class="description">
La légende associée au composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Component.html#method.__construct">__construct</a>()
<div class="description">
Construit le composant en lui affectant une taille égale à celle de l'image et en le positionnant au centre de cette image.
Le composant remplit donc toute la surface de l'image.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.auto"></a><span class="access">public</span> <a href="Component.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
<div class="description">
TRUE si le composant doit être automatiquement ajusté, FALSE sinon.
La notion d'ajustage automatique est propre à chaque classe qui dérive de celle-ci.
Par exemple, sur les histogrammes, si le composant n'est pas automatiquement ajusté, alors les barres ne seront pas centrées sur zéro mais sur leur valeur minimum.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Component.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$width</span>, <span class="type">float</span> <span class="argument">$height</span>)
<div class="description">
Change la largeur $width et la hauteur $height du composant.
Les nouvelles valeurs doivent être comprises entre 0 et 1 et correspondent à une fraction des largeur et hauteur de l'image à laquelle le composant appartient.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// LinePLot dérive de Component
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
 
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsSize"></a><span class="access">public</span> <a href="Component.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
<div class="description">
Donne une taille absolue au composant.
La largeur $width et la hauteur $height doivent être données en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundImage"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundImage">setBackgroundImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<div class="description">
Change l'image de fond du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getBackground"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Component.html#method.getBackground">getBackground</a>(<span class="type">int</span> <span class="argument">$type</span>)
<div class="description">
Retourne le fond de l'image. Cela peut être une <a href="Color.html">couleur</a>, un <a href="Gradient.html">dégradé</a> ou encore une <a href="Image.html">image</a>. Si aucun fond n'a été spécifié, cette méthode retourne NULL.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPadding"></a><span class="access">public</span> <a href="Component.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
<div class="description">
Change l'espace interne du composant.
Les valeurs doivent être données en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSpace"></a><span class="access">public</span> <a href="Component.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
<div class="description">
Change l'espace interne dans la zone de dessin effective du composant. Les valeurs doivent être données en pourcentage de la taille de la zone de dessin.
Le zone de dessin est la zone dans laquelle est dessiné le composant, c'est-à-dire la zone du composant amputée des axes et de l'<a href="Component.html#property.padding">espace interne</a>.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$plot = new <a href="LinePlot.html">LinePlot</a>(array(43, 23, 65, 37));
$plot-&gt;<a href="Component.html#method.setSpace">setSpace</a>(10, 10, 20, 20);
 
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setCenter"></a><span class="access">public</span> <a href="Component.html#method.setCenter">setCenter</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Change la position du centre du composant sur l'image.
Les nouvelles positions $x et $y représentent une fraction des largeur et hauteur de l'image.
Attention, la position 0 pour $y place le centre du composant en haut de l'image. La position 1 le place en bas de l'image.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// LinePLot dérive de Component
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
 
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
// Place le composant en haut à gauche
$plot-&gt;<a href="Component.html#method.setCenter">setCenter</a>(1 / 6, 1 / 6);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsPosition"></a><span class="access">public</span> <a href="Component.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$top</span>)
<div class="description">
Change la position du composant sur l'image.
Contrairement à <a href="Component.html#method.setCenter">setCenter()</a>, cette méthode ne place pas le composant par rapport à son centre, mais par rapport à son coin haut-gauche. Les positions $left à gauche et $top pour la hauteur doivent être données en pixels.
Attention, la position 0 pour $top place le composant en haut de l'image.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// LinePLot dérive de Component
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
 
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
// Place le composant en haut à gauche
$plot-&gt;<a href="Component.html#method.setAbsPosition">setAbsPosition</a>(0, 0);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.init"></a><span class="access">public</span> <a href="Component.html#method.init">init</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Initialise le composant avant son affichage.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.finalize"></a><span class="access">public</span> <a href="Component.html#method.finalize">finalize</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Finalize l'affichage du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getPosition"></a><span class="access">abstract public</span> <span class="type">array</span> <a href="Component.html#method.getPosition">getPosition</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Retourne la position de la zone de dessin effective du composant.
Les coordonnées doivent être retournées sous la forme d'un tableau de quatre valeurs.
Les première et deuxième valeurs sont les positions en abscisse et en ordonnée du coin haut-gauche de la zone de dessin.
Les troisième et quatrième valeurs sont les positions en abscisse et en ordonnée du coin bas-droit de la zone de dessin.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.drawEnvelope"></a><span class="access">abstract public</span> <a href="Component.html#method.drawEnvelope">drawEnvelope</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
<div class="description">
Dessine l'enveloppe autour de la zone de dessin effective du composant.
Cette enveloppe comprend généralement les axes et la grille du composant.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.drawComponent"></a><span class="access">abstract public</span> <a href="Component.html#method.drawComponent">drawComponent</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>, <span class="type">bool</span> <span class="argument">$aliasing</span>)
<div class="description">
Dessine effectivement le composant, c'est-à-dire le graphique.
Le paramètre $aliasing est à TRUE si l'anti-aliasing est activé, FALSE sinon.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSpace"></a><span class="access">protected</span> <a href="Component.html#method.getSpace">getSpace</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Convertit l'espace interne du composant de pourcentages en pixels, en fonction de la taille $width et de la hauteur $height, exprimées en pixels.
</div>
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/PlotAxis.html
New file
0,0 → 1,79
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class PlotAxis</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul>
<li><a href="ComponentGroup.html">ComponentGroup</a></li>
<ul><li>PlotAxis</li></ul>
</ul>
</ul></div><div class="description">
<p>
La classe <a href="PlotAxis.html">PlotAxis</a> permet d'utiliser des axes sur les <a href="PlotGroup.html">PlotGroup</a>.
Quatre axes sont disponibles (gauche, bas, droite et haut).
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.left"><span class="argument">$left</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.right"><span class="argument">$right</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.top"><span class="argument">$top</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.bottom"><span class="argument">$bottom</span></a>
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.left"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.left"><span class="argument">$left</span></a><div class="description">
L'axe de gauche
</div>
<div class="description-bottom"><a href="PlotAxis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.right"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.right"><span class="argument">$right</span></a><div class="description">
L'axe de droite
</div>
<div class="description-bottom"><a href="PlotAxis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.top"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.top"><span class="argument">$top</span></a><div class="description">
L'axe du haut
</div>
<div class="description-bottom"><a href="PlotAxis.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.bottom"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="PlotAxis.html#property.bottom"><span class="argument">$bottom</span></a><div class="description">
L'axe du bas
</div>
<div class="description-bottom"><a href="PlotAxis.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/BilinearGradient.html
New file
0,0 → 1,61
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class BilinearGradient</h2><div class="extends"><ul>
<li><a href="Gradient.html">Gradient</a></li>
<ul>
<li><a href="LinearGradient.html">LinearGradient</a></li>
<ul><li>BilinearGradient</li></ul>
</ul>
</ul></div><div class="description">
<p>
Cette classe permet de décrire un dégradé bilinéaire. Un dégradé bilinéaire à ceci de particulier par rapport au dégradé linéaire que son centre peut être décalé.
</p>
<p style="font-weight: bold">
ATTENTION, les dégradés bilinéaires sont en cours de développement et ne sont pas encore disponibles sur Artichow.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <span class="type">int</span> <a href="BilinearGradient.html#property.center"><span class="argument">$center</span></a>
</li></ul><ul class="methods"><li>
<span class="access">public</span> <a href="BilinearGradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>, <span class="type">int</span> <span class="argument">$angle</span>, <span class="type">float</span> <span class="argument">$center</span> := <span class="default">0.5</span>)
</li></ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.center"></a><span class="access">public</span> <span class="type">int</span> <a href="BilinearGradient.html#property.center"><span class="argument">$center</span></a><div class="description">
Décrit la position du centre du dégradé. Cette valeur doit être comprise entre 0 et 1.
</div>
<div class="description-bottom"><a href="BilinearGradient.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="BilinearGradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>, <span class="type">int</span> <span class="argument">$angle</span>, <span class="type">float</span> <span class="argument">$center</span> := <span class="default">0.5</span>)
<div class="description">
Construit une nouveu dégradé. Cette méthode doit être appelée par toutes les classes qui dérivent de celle-ci. Le paramètre $from décrit la couleur de départ du dégradé et le paramètre $to celle de fin. Le troisième paramètre $angle décrit l'angle du dégradé. Ce peut être un dégradé horizontal (angle de 0°) ou un dégradé vertical (angle de 90°). Le dernier paramètre doit être compris entre 0 et 1 permet de spécifier le centre du dégradé. Une valeur de 0.5 signifie que le dégradé sera symétrique.
</div>
<div class="description-bottom"><a href="BilinearGradient.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/BarPlot.html
New file
0,0 → 1,199
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class BarPlot</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul>
<li><a href="Plot.html">Plot</a></li>
<ul><li>BarPlot <span class="interface">implements</span> <a href="Legendable.html">Legendable</a>
</li></ul>
</ul>
</ul></div><div class="description">
<p>
Cette classe permet de dessiner des histogrammes.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="BarPlot.html#property.label"><span class="argument">$label</span></a>
</li>
<li>
<span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="BarPlot.html#property.barShadow"><span class="argument">$barShadow</span></a>
</li>
<li>
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="BarPlot.html#property.barBorder"><span class="argument">$barBorder</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="BarPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$identifier</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$number</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$depth</span> := <span class="default">0</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.setBarPadding">setBarPadding</a>(<span class="type">float</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$right</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.setBarSize">setBarSize</a>(<span class="type">float</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.setBarSpace">setBarSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.setBarColor">setBarColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <a href="BarPlot.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="BarPlot.html#property.label"><span class="argument">$label</span></a><div class="description">
Représente les étiquettes affichées au-dessus de chaque barre de l'histogramme.
Ces étiquettes contiennent la valeur de chaque barre.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.barShadow"></a><span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="BarPlot.html#property.barShadow"><span class="argument">$barShadow</span></a><div class="description">
Représente l'ombre associée à chaque barre de l'histogramme.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.barBorder"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="BarPlot.html#property.barBorder"><span class="argument">$barBorder</span></a><div class="description">
La bordure à afficher autour de chaque barre de l'histogramme.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="BarPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$identifier</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$number</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$depth</span> := <span class="default">0</span>)
<div class="description">
Créé un nouvel histogramme avec les valeurs présentes dans $values.
$number représente le nombre d'histogrammes affichés en parallèle tandis que $identifier permet de spécifier où se situe l'histogramme courant.
$depth représente la profondeur de l'histogramme en pixels.
Le tableau $values doit être une liste de valeurs dans un tableau incrémental, c'est-à-dire dont les clés valent de 0 à n - 1 (où n est la taille du tableau).
<pre>
 
&lt;?php
 
require_once "BarPlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// Tableau de valeurs
$x = array(-19, 42, 31);
 
$plot = new <a href="BarPlot.html">BarPlot</a>($x);
$plot-&gt;<a href="Plot.html#method.setXAxisZero">setXAxisZero</a>(TRUE);
$plot-&gt;<a href="BarPlot.html#method.setBarColor">setBarColor</a>(
new <a href="Color.html">Color</a>(240, 185, 130, 20)
);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBarPadding"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarPadding">setBarPadding</a>(<span class="type">float</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$right</span> := <span class="default">NULL</span>)
<div class="description">
Change l'espace interne de gauche et de droite sur chaque barre.
Laisser $left ou $right à NULL permet de ne pas modifier l'ancienne valeur.
Les valeurs données doivent être comprises entre 0 et 1 et représentent une fraction de l'espace réservé à chaque barre.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBarSize"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarSize">setBarSize</a>(<span class="type">float</span> <span class="argument">$size</span>)
<div class="description">
Change la taille de chaque barre pour $size.
Les valeurs données doivent être comprises entre 0 et 1 et représentent une fraction de l'espace réservé à chaque barre.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBarSpace"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarSpace">setBarSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
<div class="description">
Change l'espace entre les histogrammes affichés en parallèle pour $space.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBarColor"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarColor">setBarColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur des barres de l'histogrammes.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBarGradient"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond des barres de l'histogramme.
Le dégradé de fond remplit le polygone définit par tous les points de la ligne additionés des points extrêmes de l'axe des abscisses.
<pre>
 
&lt;?php
 
require_once "BarPlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$x = array(19, 30, 31, -42, 11);
 
$plot = new <a href="BarPlot.html">BarPlot</a>($x);
$plot-&gt;<a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(
new <a href="LinearGradient.html">LinearGradient</a>(
new <a href="Color.html">Color</a>(255, 20, 20, 30),
new <a href="Color.html">Color</a>(20, 255, 20, 30),
90
)
);
 
$plot-&gt;<a href="Plot.html#method.setYMin">setYMin</a>(-100);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.move"></a><span class="access">public</span> <a href="BarPlot.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Déplace chaque barre de $x pixels sur l'horizontale et $y pixels sur la vertical avant le dessin.
</div>
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/ScatterPlot.html
New file
0,0 → 1,164
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class ScatterPlot</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul>
<li><a href="Plot.html">Plot</a></li>
<ul><li>ScatterPlot <span class="interface">implements</span> <a href="Legendable.html">Legendable</a>
</li></ul>
</ul>
</ul></div><div class="description">
<p>
Les ScatterPlot (ou graphiques libres) permettent de dessiner des points aux coordonnées (x, y) sur une image.
Ce type de graphique est plus pluissant que les <a href="LinePlot.html">LinePlot</a> car plusieurs points de même abscisse peuvent être placés sur le même graphique.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="ScatterPlot.html#property.mark"><span class="argument">$mark</span></a>
</li>
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="ScatterPlot.html#property.label"><span class="argument">$label</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$datay</span>, <span class="type">array</span> <span class="argument">$datax</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.setImpulse">setImpulse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.link">link</a>(<span class="type">bool</span> <span class="argument">$link</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.linkNull">linkNull</a>(<span class="type">bool</span> <span class="argument">$linkNull</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <a href="ScatterPlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.mark"></a><span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="ScatterPlot.html#property.mark"><span class="argument">$mark</span></a><div class="description">
Représente les marques affichées sur chaque point.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="ScatterPlot.html#property.label"><span class="argument">$label</span></a><div class="description">
Représente les étiquettes affichées au-dessus de chaque point.
Ces étiquettes ne sont pas affichées par défaut.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="ScatterPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$datay</span>, <span class="type">array</span> <span class="argument">$datax</span> := <span class="default">NULL</span>)
<div class="description">
Créé un nouveau ScatterPlot avec des points d'abscisses $datax et d'ordonnées $datay.
Si la valeur $datax est laissée à NULL, alors la librairie utilisera des valeurs incrémentales pour X, en commençant par zéro.
<pre>
 
&lt;?php
 
require_once "ScatterPlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// Tableaux de valeurs
$y = array(2, 4, 6);
$x = array(1, 4, 3);
 
// On dessine les points (1, 2), (4, 4) et (3, 6)
$plot = new <a href="ScatterPlot.html">ScatterPlot</a>($y, $x);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setImpulse"></a><span class="access">public</span> <a href="ScatterPlot.html#method.setImpulse">setImpulse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Si vous appelez cette méthode, les points de la courbe seront reliés à l'axe des abscisses par des segments de droite verticaux de couleur $color.
Cette méthode permet notamment de représenter des graphiques à impulsions.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.link"></a><span class="access">public</span> <a href="ScatterPlot.html#method.link">link</a>(<span class="type">bool</span> <span class="argument">$link</span>)
<div class="description">
Permet de lier les points du graphique entre eux.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.linkNull"></a><span class="access">public</span> <a href="ScatterPlot.html#method.linkNull">linkNull</a>(<span class="type">bool</span> <span class="argument">$linkNull</span>)
<div class="description">
Si $linkNull vaut TRUE, alors les valeurs en ordonnée égales à nulles n'interrompront pas le lien entre tous les points.
A l'inverse, si $linkNull vaut FALSE, alors le lien sera rompu à chaque fois qu'une valeur égale à NULL sera trouvée.
Cette méthode n'a de sens que lorsque vous avez choisi de relier les points entre eux.
<div class="see">
Voir aussi :
<ul><li><a href="ScatterPlot.html#method.link">ScatterPlot::link()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="ScatterPlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la ligne qui relie les points du composant entre eux.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStyle"></a><span class="access">public</span> <a href="ScatterPlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style de ligne (<a href="Line.html#constant.SOLID">Line::SOLID</a>, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> ou <a href="Line.html#constant.DASHED">Line::DASHED</a>) qui relie chaque point.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setThickness"></a><span class="access">public</span> <a href="ScatterPlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
<div class="description">
Change l'épaisseur de la ligne qui relie les points du composant entre eux.
L'épaisseur de la ligne doit être toujours positive.
</div>
<div class="description-bottom"><a href="ScatterPlot.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/index.html
New file
0,0 → 1,138
<html>
<head>
<title>Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" />
</head>
 
<body>
<div align='center'>
<table cellpadding="0" cellspacing="0" id="contenu" class="round" style='width: 80%; margin-bottom: 20px'>
<tr>
<td class="borderhg">&nbsp;</td>
<td class="borderh">&nbsp;</td>
<td class="cornerhd"></td>
</tr>
<tr>
<td class="borderg">&nbsp;</td>
<td>
<h2>La documentation de Artichow</h2>
<p>
Cette documentation vous explique comment utiliser les classes de Artichow.
Vous retrouverez sur le site de Artichow une <a href="http://www.artichow.org/documentation">documentation plus complète</a>, ainsi que des <a href="http://www.artichow.org/tutorial">tutoriels</a>.
Attention, cette documentation est conçue pour la version <em>PHP 5</em> de Artichow, qui est incompatible avec la version <em>PHP 4 &amp; 5</em>.
Vous pouvez retrouver sur le site une <a href="http://www.artichow.org/incompatibility">liste de ces incompatibilités</a> afin de pouvoir utiliser tout de même cette documentation.
</p>
 
<h2>Les classes de Artichow</h2>
 
<h4>Classes de traitement de l'image</h4>
<ul class='list'>
<li>
<a href='Image.html'>Image</a>
<ul>
<li><a href='Graph.html'>Graph</a></li>
<li><a href='FileImage.html'>FileImage</a></li>
</ul>
</li>
<li><a href='Pattern.html'>Pattern</a></li>
</ul>
 
<h4>Classes de traitement des composants</h4>
<ul class='list'>
<li><a href='AntiSpam.html'>AntiSpam</a></li>
<li>
<a href='Component.html'>Component</a>
<ul>
<li>
<a href='ComponentGroup.html'>ComponentGroup</a>
<ul>
<li><a href='PlotGroup.html'>PlotGroup</a></li>
</ul>
</li>
<li><a href='MathPlot.html'>MathPlot</a> (voir aussi <a href='MathFunction.html'>MathFunction</a>)</li>
<li>
<a href='Plot.html'>Plot</a>
<ul>
<li><a href='LinePlot.html'>LinePlot</a></li>
<li><a href='BarPlot.html'>BarPlot</a></li>
<li><a href='ScatterPlot.html'>ScatterPlot</a></li>
</ul>
</li>
<li><a href='Pie.html'>Pie</a></li>
</ul>
</li>
</ul>
 
<h4>Classe graphique</h4>
<ul class='list'>
<li><a href='Drawer.html'>Drawer</a></li>
</ul>
 
<h4>Classes de dessin</h4>
<ul class='list'>
<li><a href='Color.html'>Color</a></li>
<li>
<a href='Gradient.html'>Gradient</a>
<ul>
<li>
<a href='RadialGradient.html'>RadialGradient</a>
<ul>
<li><a href='BilinearGradient.html'>BilinearGradient</a></li>
</ul>
</li>
<li><a href='LinearGradient.html'>LinearGradient</a></li>
</ul>
</li>
<li>
<a href='Font.html'>Font</a>
<ul>
<li><a href='TTFFont.html'>TTFFont</a></li>
</ul>
</li>
<li><a href='Text.html'>Text</a></li>
</ul>
 
<h4>Classes pour le traitement géométrique</h4>
<ul class='list'>
<li>
<a href='Shape.html'>Shape</a>
<ul>
<li><a href='Point.html'>Point</a></li>
<li>
<a href='Line.html'>Line</a>
<ul>
<li><a href='Vector.html'>Vector</a></li>
</ul>
</li>
<li><a href='Polygon.html'>Polygon</a></li>
</ul>
</li>
</ul>
 
<h4>Outils d'aide au dessin</h4>
<ul class='list'>
<li><a href='Axis.html'>Axis</a></li>
<li><a href='Grid.html'>Grid</a></li>
<li><a href='Border.html'>Border</a></li>
<li><a href='Label.html'>Label</a></li>
<li><a href='Legend.html'>Legend</a></li>
<li><a href='Mark.html'>Mark</a></li>
<li><a href='Shadow.html'>Shadow</a></li>
<li><a href='Side.html'>Side</a></li>
<li><a href='Tick.html'>Tick</a></li>
</ul>
 
</td>
<td class="borderd">&nbsp;</td>
</tr>
<tr>
<td class="cornerbg"></td>
<td class="borderb">&nbsp;</td>
<td class="cornerbd"></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/RadialGradient.html
New file
0,0 → 1,35
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class RadialGradient</h2><div class="extends"><ul>
<li><a href="Gradient.html">Gradient</a></li>
<ul><li>RadialGradient</li></ul>
</ul></div><div class="description">
<p>Cette classe permet de décrire un dégradé radial.</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><h2>Documentation</h2><ul class="doc"></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/AntiSpam.html
New file
0,0 → 1,137
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class AntiSpam</h2><div class="extends"><ul>
<li><a href="Image.html">Image</a></li>
<ul><li>AntiSpam</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="AntiSpam.html">AntiSpam</a> permet de créer des images pour interdire des requêtes automatisées sur certaines pages.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">protected</span> <span class="type">string</span> <a href="AntiSpam.html#property.string"><span class="argument">$string</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="AntiSpam.html#property.noise"><span class="argument">$noise</span></a> := <span class="default">0</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="AntiSpam.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$string</span> := <span class="default">''</span>)
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="AntiSpam.html#method.setRand">setRand</a>(<span class="type">int</span> <span class="argument">$length</span>)
</li>
<li>
<span class="access">public</span> <a href="AntiSpam.html#method.setNoise">setNoise</a>(<span class="type">int</span> <span class="argument">$noise</span>)
</li>
<li>
<span class="access">public</span> <a href="AntiSpam.html#method.save">save</a>(<span class="type">string</span> <span class="argument">$qName</span>)
</li>
<li>
<span class="access">public</span> <a href="AntiSpam.html#method.check">check</a>(<span class="type">string</span> <span class="argument">$qName</span>, <span class="type">string</span> <span class="argument">$value</span>, <span class="type">bool</span> <span class="argument">$case</span> := <span class="default">TRUE</span>)
</li>
<li>
<span class="access">public</span> <a href="AntiSpam.html#method.draw">draw</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.string"></a><span class="access">protected</span> <span class="type">string</span> <a href="AntiSpam.html#property.string"><span class="argument">$string</span></a><div class="description">
La chaîne de caractère que devra retaper l'utilisateur.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.noise"></a><span class="access">protected</span> <span class="type">int</span> <a href="AntiSpam.html#property.noise"><span class="argument">$noise</span></a> := <span class="default">0</span><div class="description">
Degré de bruit à afficher sur l'image (entre 0 et 10).
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="AntiSpam.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">$string</span> := <span class="default">''</span>)
<div class="description">
Construit une image anti-spam. Vous pouvez définir la chaîne de caractères à afficher sur l'image avec $string.
Si vous ne donnez aucune chaîne de caractères, voyez <a href="AntiSpam.html#method.setRand">AntiSpam::setRand()</a> pour générer une valeur aléatoire.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setRand"></a><span class="access">public</span> <span class="type">string</span> <a href="AntiSpam.html#method.setRand">setRand</a>(<span class="type">int</span> <span class="argument">$length</span>)
<div class="description">
Génère une chaîne de caractère aléatoire de taille $length pour l'image anti-spam.
La chaîne de caractère ainsi créée est ensuite retournée.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setNoise"></a><span class="access">public</span> <a href="AntiSpam.html#method.setNoise">setNoise</a>(<span class="type">int</span> <span class="argument">$noise</span>)
<div class="description">
Ajoute du bruit sur l'image.
Les valeurs possibles sont de 0 à 10, avec 0 pour ne pas afficher de bruit et 10 pour afficher un bruit maximal.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.save"></a><span class="access">public</span> <a href="AntiSpam.html#method.save">save</a>(<span class="type">string</span> <span class="argument">$qName</span>)
<div class="description">
Enregistre la valeur de l'image anti-spam dans la session de l'utilisateur sous le nom $qName.
Cette méthode doit être utilisée en combinaison avec <a href="AntiSpam.html#method.check">AntiSpam::check()</a>.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.check"></a><span class="access">public</span> <a href="AntiSpam.html#method.check">check</a>(<span class="type">string</span> <span class="argument">$qName</span>, <span class="type">string</span> <span class="argument">$value</span>, <span class="type">bool</span> <span class="argument">$case</span> := <span class="default">TRUE</span>)
<div class="description">
Vérifie que la valeur $value correspond à la valeur enregistrée sous le nom $qName avec <a href="AntiSpam.html#method.save">AntiSpam::save()</a>.
Si $case est mis à TRUE, alors la vérification NE sera PAS sensible à la casse, elle le sera à FALSE.
Cette méthode doit être utilisée en combinaison avec <a href="AntiSpam.html#method.save">AntiSpam::save()</a>.
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.draw"></a><span class="access">public</span> <a href="AntiSpam.html#method.draw">draw</a>()
<div class="description">
Affiche l'image anti-spam à l'écran.
<pre>
 
&lt;?php
 
require_once "AntiSpam.class.php";
 
$object = new <a href="AntiSpam.html">AntiSpam</a>();
$object-&gt;<a href="AntiSpam.html#method.setRand">setRand</a>(5);
$object-&gt;<a href="AntiSpam.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="AntiSpam.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Pattern.html
New file
0,0 → 1,40
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Pattern</h2><div class="description">
<p>
La classe <a href="Pattern.html">Pattern</a> simplifie la création de graphiques avec Artichow.
</p>
<p style="color: red; font-weight: bold">
Cette partie de la documentation est encore en cours de réalisation.
Pour obtenir la liste des méthodes de cette classe, voyez le fichier Pattern.class.php.
Pour savoir comment utiliser cette classe, n'hésitez pas à aller jeter un coup d'oeil aux exemples (examples/pattern-*.php)
fournis avec l'archive de Artichow.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><h2>Documentation</h2><ul class="doc"></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Pie.html
New file
0,0 → 1,233
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Pie</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul><li>Pie</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="Pie.html">Pie</a> permet de générer des camemberts en deux ou trois dimensions.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.DARK">DARK</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.COLORED">COLORED</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.AQUA">AQUA</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.EARTH">EARTH</a> := <span class="default">4</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">protected</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Pie.html#property.border"><span class="argument">$border</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Pie.html#property.values"><span class="argument">$values</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Pie.html#property.colors"><span class="argument">$colors</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Pie.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">mixed</span> <span class="argument">$colors</span> := <span class="default">Pie::COLORED</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setLegend">setLegend</a>(<span class="type">array</span> <span class="argument">$legend</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setBorder">setBorder</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setBorderColor">setBorderColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.set3D">set3D</a>(<span class="type">int</span> <span class="argument">$size</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setStartAngle">setStartAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setLabelPrecision">setLabelPrecision</a>(<span class="type">int</span> <span class="argument">$precision</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setLabelPosition">setLabelPosition</a>(<span class="type">int</span> <span class="argument">$position</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setLabelNumber">setLabelNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.setLabelMinimum">setLabelMinimum</a>(<span class="type">int</span> <span class="argument">$minimum</span>)
</li>
<li>
<span class="access">public</span> <a href="Pie.html#method.explode">explode</a>(<span class="type">array</span> <span class="argument">$explode</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.DARK"></a><span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.DARK">DARK</a> := <span class="default">1</span><div class="description">
Un thème sombre pour les camemberts.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.COLORED"></a><span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.COLORED">COLORED</a> := <span class="default">2</span><div class="description">
Un thème coloré pour les camemberts (thème par défaut).
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.AQUA"></a><span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.AQUA">AQUA</a> := <span class="default">3</span><div class="description">
Un thème plutôt bleu pour les camemberts.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.EARTH"></a><span class="access">const</span> <span class="type">int</span> <a href="Pie.html#constant.EARTH">EARTH</a> := <span class="default">4</span><div class="description">
Un thème aux couleurs de la Terre pour les camemberts.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.border"></a><span class="access">protected</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Pie.html#property.border"><span class="argument">$border</span></a><div class="description">
La bordure qui entoure chaque part du camembert.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.values"></a><span class="access">public</span> <span class="type">array</span> <a href="Pie.html#property.values"><span class="argument">$values</span></a><div class="description">
Les valeurs du camembert.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.colors"></a><span class="access">public</span> <span class="type">array</span> <a href="Pie.html#property.colors"><span class="argument">$colors</span></a><div class="description">
Les couleurs des parts du camembert.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Pie.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">mixed</span> <span class="argument">$colors</span> := <span class="default">Pie::COLORED</span>)
<div class="description">
Construit un nouveau camembert avec comme valeurs $values.
Le paramètre $colors peut soit être un tableau de couleurs, soit un thème prédéfini (<a href="Pie.html#constant.DARK">Pie::DARK</a>, <a href="Pie.html#constant.COLORED">Pie::COLORED</a>, <a href="Pie.html#constant.AQUA">Pie::AQUA</a> ou <a href="Pie.html#constant.EARTH">Pie::EARTH</a>).
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLegend"></a><span class="access">public</span> <a href="Pie.html#method.setLegend">setLegend</a>(<span class="type">array</span> <span class="argument">$legend</span>)
<div class="description">
Change les valeurs de la légende associée au camembert.
$legend est un tableau qui contient autant d'entrées que de valeurs présentes sur le camembert.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBorder"></a><span class="access">public</span> <a href="Pie.html#method.setBorder">setBorder</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<ul class="version"><li>
Déprécié depuis Artichow 1.0.9</li></ul>
<div class="description">
Change la couleur de la bordure entourant le camembert et séparant chaque part.
Cette méthode a été remplacée par Pie::setBorderColor() depuis Artichow 1.0.9.
<div class="see">
Voir aussi :
<ul><li><a href="Pie.html#method.setBorderColor">Pie::setBorderColor()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBorderColor"></a><span class="access">public</span> <a href="Pie.html#method.setBorderColor">setBorderColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Change la couleur de la bordure entourant le camembert et séparant chaque part.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.set3D"></a><span class="access">public</span> <a href="Pie.html#method.set3D">set3D</a>(<span class="type">int</span> <span class="argument">$size</span>)
<div class="description">
Associe au camembert à un effet 3D de taille $size (à spécifier en pixels).
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStartAngle"></a><span class="access">public</span> <a href="Pie.html#method.setStartAngle">setStartAngle</a>(<span class="type">int</span> <span class="argument">$angle</span>)
<div class="description">
Angle initial en degrés pour commencer le dessin du camembert.
La valeur par défaut est de 0°.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelPrecision"></a><span class="access">public</span> <a href="Pie.html#method.setLabelPrecision">setLabelPrecision</a>(<span class="type">int</span> <span class="argument">$precision</span>)
<div class="description">
Change la précision des étiquettes associées à chaque part du camembert.
Par défaut à 0, cette précision donne le nombre de chiffres après la virgule à afficher.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelPosition"></a><span class="access">public</span> <a href="Pie.html#method.setLabelPosition">setLabelPosition</a>(<span class="type">int</span> <span class="argument">$position</span>)
<div class="description">
Change la distance des étiquettes par rapport au camembert.
La valeur est à donner en pixels et vaut par défaut 15 pixels.
Elle peut également être négative.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelNumber"></a><span class="access">public</span> <a href="Pie.html#method.setLabelNumber">setLabelNumber</a>(<span class="type">int</span> <span class="argument">$number</span>)
<div class="description">
Permet de choisir le nombre maximale d'étiquettes à afficher autour du camembert.
Par défaut, toutes les étiquettes sont affichées.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setLabelMinimum"></a><span class="access">public</span> <a href="Pie.html#method.setLabelMinimum">setLabelMinimum</a>(<span class="type">int</span> <span class="argument">$minimum</span>)
<div class="description">
Permet de choisir une valeur minimum pour l'affichage des étiquettes.
Tout part dont le pourcentage sera inférieur à $minimum n'aura aucune étiquette associée.
Par défaut, il n'y a aucun minimum.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.explode"></a><span class="access">public</span> <a href="Pie.html#method.explode">explode</a>(<span class="type">array</span> <span class="argument">$explode</span>)
<div class="description">
Cette méthode permet de séparer une ou plusieurs parts du camembert.
Le paramètre $explode est un tableau dont les clés représente les numéros des parts à séparer et les valeurs la distance de séparation.
</div>
<div class="description-bottom"><a href="Pie.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Plot.html
New file
0,0 → 1,316
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Plot</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul><li>Plot</li></ul>
</ul></div><div class="description">
<p>
Cette classe est la base des <a href="LinePlot.html">courbes</a> et <a href="BarPlot.html">histogrammes</a> sur Artichow.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Plot :
<ul>
<li><a href="LinePlot.html">LinePlot</a></li>
<li><a href="BarPlot.html">BarPlot</a></li>
<li><a href="ScatterPlot.html">ScatterPlot</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.LEFT">LEFT</a> := <span class="default">left</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.RIGHT">RIGHT</a> := <span class="default">right</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.TOP">TOP</a> := <span class="default">top</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.BOTTOM">BOTTOM</a> := <span class="default">bottom</span>
</li>
<li>
<span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.BOTH">BOTH</a> := <span class="default">both</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Plot.html#property.datay"><span class="argument">$datay</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Plot.html#property.datax"><span class="argument">$datax</span></a>
</li>
<li>
<span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="Plot.html#property.grid"><span class="argument">$grid</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="Plot.html#property.xAxis"><span class="argument">$xAxis</span></a>
</li>
<li>
<span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="Plot.html#property.yAxis"><span class="argument">$yAxis</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Plot.html#property.xAxisZero"><span class="argument">$xAxisZero</span></a> := <span class="default">TRUE</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Plot.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.reduce">reduce</a>(<a href="number.html"><span class="type">number</span></a> <span class="argument">$number</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setXAxis">setXAxis</a>(<span class="type">string</span> <span class="argument">$axis</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setYAxis">setYAxis</a>(<span class="type">string</span> <span class="argument">$axis</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setXAxisZero">setXAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setYAxisZero">setYAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setYMin">setYMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setYMax">setYMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setXMin">setXMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="Plot.html#method.setXMax">setXMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.LEFT"></a><span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.LEFT">LEFT</a> := <span class="default">left</span><div class="description">
Dessine l'axe des abscisses sur la gauche du graph.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RIGHT"></a><span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.RIGHT">RIGHT</a> := <span class="default">right</span><div class="description">
Dessine l'axe des abscisses sur la droite du graph.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.TOP"></a><span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.TOP">TOP</a> := <span class="default">top</span><div class="description">
Dessine l'axe des ordonnées sur le haut du graph.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BOTTOM"></a><span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.BOTTOM">BOTTOM</a> := <span class="default">bottom</span><div class="description">
Dessine l'axe des ordonnées sur le bas du graph.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BOTH"></a><span class="access">const</span> <span class="type">string</span> <a href="Plot.html#constant.BOTH">BOTH</a> := <span class="default">both</span><div class="description">
Dessine l'axe des abscisses (ou des ordonnées) sur la gauche et la droite (ou le haut et la bas) du graph.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.datay"></a><span class="access">public</span> <span class="type">array</span> <a href="Plot.html#property.datay"><span class="argument">$datay</span></a><div class="description">
Les valeurs de l'axe des Y.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.datax"></a><span class="access">public</span> <span class="type">array</span> <a href="Plot.html#property.datax"><span class="argument">$datax</span></a><div class="description">
Les valeurs de l'axe des X.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.grid"></a><span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="Plot.html#property.grid"><span class="argument">$grid</span></a><div class="description">
Représente la grille de fond du composant.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.xAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="Plot.html#property.xAxis"><span class="argument">$xAxis</span></a><div class="description">
L'axe des abscisses
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.yAxis"></a><span class="access">public</span> <a href="Axis.html"><span class="type">Axis</span></a> <a href="Plot.html#property.yAxis"><span class="argument">$yAxis</span></a><div class="description">
L'axe des ordonnées
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.xAxisZero"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Plot.html#property.xAxisZero"><span class="argument">$xAxisZero</span></a> := <span class="default">TRUE</span><div class="description">
Est-ce le ou les axes des abscisses doivent être centrés sur zéro ?
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Plot.html#method.__construct">__construct</a>()
<div class="description">
Construit le composant.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.reduce"></a><span class="access">public</span> <a href="Plot.html#method.reduce">reduce</a>(<a href="number.html"><span class="type">number</span></a> <span class="argument">$number</span>)
<div class="description">
Réduit le nombre de valeurs à afficher sur le composant à $number.<br>
Cette fonctionnalité est utile dans le cas où vous souhaitez afficher plus de 400 ou 500 valeurs sur un graphique.
En effet, au delà d'un certain nombre de valeurs, toutes ne seront pas affichées et le temps de création du graphique sera très élevé.
La solution est de réduire le nombre de valeurs sur votre graphique, ce que permet cette fonction.
Le processus de réduction se fait à travers un système de moyennes, afin de garder une courbe identique à celle que vous auriez eu en affichant toutes les valeurs.
Le nombre $number que vous spécifiez en paramètre est un nombre maximal. Pas plus de $number valeurs seront affichées sur le graphique. En revanche, dans certains cas, il est possible qu'un nombre inférieur de valeurs soient affichées.
Voici un exemple d'utilisation de cette fonctionnalité :
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$datay = array();
$datax = array();
 
// On créé un tableau avec 3000 valeurs
for($i = 1; $i &lt;= 3000; $i++) {
$datay[] = log($i);
$datax[] = $i;
}
 
$plot = new <a href="LinePlot.html">LinePlot</a>($datay);
$plot-&gt;xAxis-&gt;<a href="Axis.html#method.setLabelText">setLabelText</a>($datax);
$plot-&gt;xAxis-&gt;label-&gt;<a href="Label.html#method.setAngle">setAngle</a>(90);
 
// On réduit le nombre de valeurs à afficher sur le graphique à 30,
// soit 100 fois moins
$plot-&gt;<a href="Plot.html#method.reduce">reduce</a>(30);
 
// On affiche le graphique
// Les valeurs de l'axe des X ont été automatiquement mises à jour
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
// Finalement, la courbe représentative de log(x) apparaît très correctement
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXAxis"></a><span class="access">public</span> <a href="Plot.html#method.setXAxis">setXAxis</a>(<span class="type">string</span> <span class="argument">$axis</span>)
<div class="description">
Change l'axe de abscisses qui sera affiché sur l'image.
Cela peut être <a href="Plot.html#constant.TOP">Plot::TOP</a>, <a href="Plot.html#constant.BOTTOM">Plot::BOTTOM</a> ou <a href="Plot.html#constant.BOTH">Plot::BOTH</a>.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYAxis"></a><span class="access">public</span> <a href="Plot.html#method.setYAxis">setYAxis</a>(<span class="type">string</span> <span class="argument">$axis</span>)
<div class="description">
Change l'axe de ordonnées qui sera affiché sur l'image.
Cela peut être <a href="Plot.html#constant.LEFT">Plot::LEFT</a>, <a href="Plot.html#constant.RIGHT">Plot::RIGHT</a> ou <a href="Plot.html#constant.BOTH">Plot::BOTH</a>.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXAxisZero"></a><span class="access">public</span> <a href="Plot.html#method.setXAxisZero">setXAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
<div class="description">
Précise si le ou les axes des abscisses doivent être centrés sur le zéro de l'axe des ordonnées.
Comme il peut y avoir plus axes des ordonnées, l'axe de gauche est choisi en premier pour sélectionner la valeur du zéro. S'il n'existe pas, alors on utilise l'axe de droite.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYAxisZero"></a><span class="access">public</span> <a href="Plot.html#method.setYAxisZero">setYAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
<div class="description">
Précise si le ou les axes des ordonnées doivent être centrés sur le zéro de l'axe des abscisses.
Comme il peut y avoir plus axes des abscisses, l'axe du bas est choisi en premier pour sélectionner la valeur du zéro. S'il n'existe pas, alors on utilise l'axe du haut.
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYMin"></a><span class="access">public</span> <a href="Plot.html#method.setYMin">setYMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur minimale de l'axe des ordonnées à $value.
L'appel à cette méthode désactive la gestion automatique de l'axe des ordonnées.
<div class="see">
Voir aussi :
<ul>
<li><a href="Plot.html#method.setYMax">Plot::setYMax()</a></li>
<li><a href="Axis.html#method.auto">Axis::auto()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYMax"></a><span class="access">public</span> <a href="Plot.html#method.setYMax">setYMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur maximale de l'axe des ordonnées à $value.
L'appel à cette méthode désactive la gestion automatique de l'axe des ordonnées.
<div class="see">
Voir aussi :
<ul>
<li><a href="Plot.html#method.setYMin">Plot::setYMin()</a></li>
<li><a href="Axis.html#method.auto">Axis::auto()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXMin"></a><span class="access">public</span> <a href="Plot.html#method.setXMin">setXMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur minimale de l'axe des abscisses à $value.
<div class="see">
Voir aussi :
<ul><li><a href="Plot.html#method.setXMax">Plot::setXMax()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXMax"></a><span class="access">public</span> <a href="Plot.html#method.setXMax">setXMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur maximale de l'axe des abscisses à $value.
<div class="see">
Voir aussi :
<ul><li><a href="Plot.html#method.setXMin">Plot::setXMin()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Plot.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/ComponentGroup.html
New file
0,0 → 1,72
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2>
<small>abstract</small> Class ComponentGroup</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul><li>ComponentGroup</li></ul>
</ul></div><div class="description">
<p>
Un groupe de composant permet de gérer plusieurs <a href="Component.html">composants</a>.
Cette classe est abstraite et doit être redéfinit pour être utilisée avec les composants que vous aurez choisis.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de ComponentGroup :
<ul><li><a href="PlotGroup.html">PlotGroup</a></li></ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">protected</span> <span class="type">array</span> <a href="ComponentGroup.html#property.components"><span class="argument">$components</span></a>
</li></ul><ul class="methods">
<li>
<span class="access">public</span> <a href="ComponentGroup.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="ComponentGroup.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.components"></a><span class="access">protected</span> <span class="type">array</span> <a href="ComponentGroup.html#property.components"><span class="argument">$components</span></a><div class="description">
Les <a href="Component.html">composants</a> gérés par ce groupe de composants.
</div>
<div class="description-bottom"><a href="ComponentGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="ComponentGroup.html#method.__construct">__construct</a>()
<div class="description">
Construit le groupe de composants.
</div>
<div class="description-bottom"><a href="ComponentGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.add"></a><span class="access">public</span> <a href="ComponentGroup.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
<div class="description">
Ajoute le composant $component au groupe.
</div>
<div class="description-bottom"><a href="ComponentGroup.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/FontDriver.html
New file
0,0 → 1,107
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class FontDriver</h2><div class="description">
<p>
La classe abstraite <a href="FontDriver.html">FontDriver</a> définit toutes les méthodes devant être implémentées pour gérer l'affichage et les calculs à effectuer sur les polices. On dérivera cette classe une fois pour chaque classe enfant de <a href="Font.html">Font</a>, en l'occurence <a href="PHPFontDriver.html">PHPFontDriver</a> pour <a href="PHPFont.html">PHPFont</a> et <a href="FileFontDriver.html">FileFontDriver</a> pour <a href="FileFont.html">FileFont</a>.
</p>
<p>
A aucun moment vous ne devriez avoir à instancier un objet de ce type. La documentation est là à titre informatif pour les développeurs en herbe.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de FontDriver :
<ul>
<li><a href="PHPFontDriver.html">PHPFontDriver</a></li>
<li><a href="FileFontDriver.html">FileFontDriver</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods">
<li>
<span class="access">public</span> <a href="FontDriver.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="FontDriver.html#method.string">string</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="FontDriver.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
<li>
<span class="access">public</span> <a href="FontDriver.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="FontDriver.html#method.__construct">__construct</a>()
<div class="description">
Simple constructeur. Ne fait rien pour l'instant.
</div>
<div class="description-bottom"><a href="FontDriver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.string"></a><span class="access">public</span> <a href="FontDriver.html#method.string">string</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
<div class="description">
Dessine le texte $text.
Le pilote $driver sera utilisé pour le dessin tandis que le texte sera positionné au point $point.
Le paramètre $width permet de spécifier la largeur maximale en pixels de la boîte de texte.
</div>
<div class="description-bottom"><a href="FontDriver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextWidth"></a><span class="access">public</span> <a href="FontDriver.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Retourne la largeur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul>
<li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li>
<li><a href="FontDriver.html#method.getTextHeight">FontDriver::getTextHeight()</a></li>
<li><a href="FontDriver.html#method.getTextWidth">FontDriver::getTextWidth()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="FontDriver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextHeight"></a><span class="access">public</span> <a href="FontDriver.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Supprimé à partir d'Artichow 1.1</li></ul>
<div class="description">
Retourne la hauteur en pixels occupée par l'objet <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul>
<li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li>
<li><a href="FontDriver.html#method.getTextHeight">FontDriver::getTextHeight()</a></li>
<li><a href="FontDriver.html#method.getTextWidth">FontDriver::getTextWidth()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="FontDriver.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/FileFontDriver.html
New file
0,0 → 1,40
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class FileFontDriver</h2><div class="extends"><ul>
<li><a href="FontDriver.html">FontDriver</a></li>
<ul><li>FileFontDriver</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="FileFontDriver.html">FileFontDriver</a> s'occupe des calculs et de l'affichage liés aux polices de type <a href="FileFont.html">FileFont</a>.
</p>
<p>
A aucun moment vous ne devriez avoir à instancier un objet de ce type. La documentation est là à titre informatif pour les développeurs en herbe.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><h2>Documentation</h2><ul class="doc"></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Image.html
New file
0,0 → 1,354
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2>
<small>abstract</small> Class Image</h2><div class="description">
<p>
La classe <a href="Image.html">Image</a> est une classe abstraite à la base de toutes les images sur Artichow. Une image peut être copiée sur d'autres images et chaque image peut être générée soit au format PNG, soit au format JPEG.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Image :
<ul>
<li><a href="Graph.html">Graph</a></li>
<li><a href="FileImage.html">FileImage</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.JPEG">JPEG</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.PNG">PNG</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.GIF">GIF</a> := <span class="default">3</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Image.html#property.width"><span class="argument">$width</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Image.html#property.height"><span class="argument">$height</span></a>
</li>
<li>
<span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="Image.html#property.shadow"><span class="argument">$shadow</span></a>
</li>
<li>
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Image.html#property.border"><span class="argument">$border</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">int</span> <a href="Image.html#property.format"><span class="argument">$format</span></a> := <span class="default">Image::PNG</span>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Image.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span>
</li>
<li>
<span class="access">protected</span> <span class="type">resource</span> <a href="Image.html#property.resource"><span class="argument">$resource</span></a>
</li>
<li>
<span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Image.html#property.driver"><span class="argument">$driver</span></a>
</li>
<li>
<span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Image.html#property.background"><span class="argument">$background</span></a> := <span class="default">new Color(255, 255, 255)</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Image.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Image.html#method.getDriver">getDriver</a>(<span class="type">int</span> <span class="argument">$w</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$h</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$x</span> := <span class="default">0.5</span>, <span class="type">int</span> <span class="argument">$y</span> := <span class="default">0.5</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.setFormat">setFormat</a>(<span class="type">int</span> <span class="argument">$format</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Image.html#method.getFormat">getFormat</a>()
</li>
<li>
<span class="access">public</span> <span class="type">string</span> <a href="Image.html#method.getFormatString">getFormatString</a>()
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.create">create</a>()
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.drawComponent">drawComponent</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.send">send</a>()
</li>
<li>
<span class="access">public</span> <span class="type">resource</span> <a href="Image.html#method.get">get</a>()
</li>
<li>
<span class="access">public</span> <a href="Image.html#method.sendHeaders">sendHeaders</a>()
</li>
<li>
<span class="access">public static</span> <a href="Image.html#method.drawError">drawError</a>(<span class="type">string</span> <span class="argument">
$message</span>)
</li>
<li>
<span class="access">public static</span> <a href="Image.html#method.drawErrorFile">drawErrorFile</a>(<span class="type">string</span> <span class="argument">
$error</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.JPEG"></a><span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.JPEG">JPEG</a> := <span class="default">1</span><div class="description">
Indique que l'image est au format JPEG.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.PNG"></a><span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.PNG">PNG</a> := <span class="default">2</span><div class="description">
Indique que l'image est au format PNG.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.GIF"></a><span class="access">const</span> <span class="type">int</span> <a href="Image.html#constant.GIF">GIF</a> := <span class="default">3</span><div class="description">
Indique que l'image est au format GIF.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.width"></a><span class="access">public</span> <span class="type">int</span> <a href="Image.html#property.width"><span class="argument">$width</span></a><div class="description">
La largeur de l'image en pixels.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.height"></a><span class="access">public</span> <span class="type">int</span> <a href="Image.html#property.height"><span class="argument">$height</span></a><div class="description">
La hauteur de l'image en pixels.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.shadow"></a><span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="Image.html#property.shadow"><span class="argument">$shadow</span></a><div class="description">
L'ombre associée à l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.border"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="Image.html#property.border"><span class="argument">$border</span></a><div class="description">
La bordure associée à l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.format"></a><span class="access">protected</span> <span class="type">int</span> <a href="Image.html#property.format"><span class="argument">$format</span></a> := <span class="default">Image::PNG</span><div class="description">
Le format de l'image. Cela peut être <a href="Image.html#constant.PNG">Image::PNG</a> ou <a href="Image.html#constant.JPEG">Image::JPEG</a>.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.antiAliasing"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Image.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span><div class="description">
Doit-on utiliser l'anti aliasing sur cette image ?
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.resource"></a><span class="access">protected</span> <span class="type">resource</span> <a href="Image.html#property.resource"><span class="argument">$resource</span></a><div class="description">
La ressource GD créée par PHP pour gérer l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.driver"></a><span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Image.html#property.driver"><span class="argument">$driver</span></a><div class="description">
Représente un objet de la classe <a href="Driver.html">Driver</a> qui sera utilisé pour dessiner toutes sortes de données sur cette image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.background"></a><span class="access">protected</span> <a href="Color.html"><span class="type">Color</span></a> <a href="Image.html#property.background"><span class="argument">$background</span></a> := <span class="default">new Color(255, 255, 255)</span><div class="description">
La couleur de fond de l'image. Par défaut, le fond d'une image est blanc.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Image.html#method.__construct">__construct</a>()
<div class="description">
Construit l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getDriver"></a><span class="access">public</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Image.html#method.getDriver">getDriver</a>(<span class="type">int</span> <span class="argument">$w</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$h</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$x</span> := <span class="default">0.5</span>, <span class="type">int</span> <span class="argument">$y</span> := <span class="default">0.5</span>)
<div class="description">
Retourne un objet de type <a href="Driver.html">Driver</a> qui permet de dessiner sur l'image.
Le <a href="Driver.html">Driver</a> aura une largeur $w et une hauteur $h, et son centre sera positionné au point ($x, $y).
La largeur doit être comprise entre 0 et 1 et représente une fraction de la taille réelle de l'image.
La position doit être elle aussi comprise entre 0 et 1.
Les paramètres par défaut centrent le pilote au milieu de l'image et lui donnent la taille de l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Image.html#method.setSize">setSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Permet de déterminer la taille de l'image à une largeur $width et une hauteur $height.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Image.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond de l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Image.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond de l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAntiAliasing"></a><span class="access">public</span> <a href="Image.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
<div class="description">
Active ou désactive l'anti-aliasing sur l'image.
L'anti-aliasing permet d'avoir des graphiques plus propres mais demande plus de ressources.
L'anti-aliasing n'est pas activé par défaut.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.setAntiAliasing">Driver::setAntiAliasing()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFormat"></a><span class="access">public</span> <a href="Image.html#method.setFormat">setFormat</a>(<span class="type">int</span> <span class="argument">$format</span>)
<div class="description">
Change le format de l'image. La nouvelle valeur peut être <a href="Image.html#constant.PNG">Image::PNG</a>, <a href="Image.html#constant.JPEG">Image::JPEG</a> ou <a href="Image.html#constant.GIF">Image::GIF</a>.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getFormat"></a><span class="access">public</span> <span class="type">int</span> <a href="Image.html#method.getFormat">getFormat</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Renvoie le format de l'image comme un entier.
Les valeurs possibles sont <a href="Image.html#constant.PNG">Image::PNG</a>, <a href="Image.html#constant.JPEG">Image::JPEG</a> ou <a href="Image.html#constant.GIF">Image::GIF</a>.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getFormatString"></a><span class="access">public</span> <span class="type">string</span> <a href="Image.html#method.getFormatString">getFormatString</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Renvoie le format de l'image comme une chaîne de caractères.
Les valeurs possibles sont "jpeg", "png", ou "gif".
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.create"></a><span class="access">public</span> <a href="Image.html#method.create">create</a>()
<div class="description">
Créé l'image en vue d'y ajouter des composants.
Il n'est possible de créer une image qu'après lui avoir affecté une taille avec <a href="Image.html#method.setSize">setSize()</a>.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.drawComponent"></a><span class="access">public</span> <a href="Image.html#method.drawComponent">drawComponent</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
<div class="description">
Dessine le composant $component sur l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.send"></a><span class="access">public</span> <a href="Image.html#method.send">send</a>()
<div class="description">
Construit l'image et l'envoie sur la sortie standard accompagnée des en-têtes HTTP correspondants.
Cette fonction ne prend plus d'arguments depuis Artichow 1.1.0. Pour récupérer les données brutes de l'image, utilisez la méthode <a href="Image.html#method.get">get()</a>. Pour sauvegarder l'image dans un fichier sur le disque, voyez la méthode <a href="Graph.html#method.draw">Graph::draw()</a>.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.get"></a><span class="access">public</span> <span class="type">resource</span> <a href="Image.html#method.get">get</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.1.0</li></ul>
<div class="description">
Construit l'image et la renvoie sous forme de données binaires. Vous pouvez donc la stocker dans une variable si vous voulez faire des manipulations spécifiques.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.sendHeaders"></a><span class="access">public</span> <a href="Image.html#method.sendHeaders">sendHeaders</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Envoie l'en-tête HTTP correspondant au format de l'image.
</div>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.drawError"></a><span class="access">public static</span> <a href="Image.html#method.drawError">drawError</a>(<span class="type">string</span> <span class="argument">
$message</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.8</li></ul>
<div class="description">
Affiche une erreur de façon lisible sous forme graphique.
</div>
<ul class="arguments"><li class="property">
<span class="type">string</span> <a href="Image.html#property.message"><span class="argument">$message</span></a><div class="description">
Le message d'erreur à afficher.
</div>
</li></ul>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.drawErrorFile"></a><span class="access">public static</span> <a href="Image.html#method.drawErrorFile">drawErrorFile</a>(<span class="type">string</span> <span class="argument">
$error</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.8</li></ul>
<div class="description">
Affiche une erreur à partir d'une image présente dans le dossier <em>images/erreurs/</em>.
</div>
<ul class="arguments"><li class="property">
<span class="type">string</span> <a href="Image.html#property.error"><span class="argument">$error</span></a><div class="description">
Le nom de l'erreur à afficher.
L'image correspondant à cette erreur sera récupérée dans le dossier <em>images/erreurs/</em>.
</div>
</li></ul>
<div class="description-bottom"><a href="Image.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/FileImage.html
New file
0,0 → 1,47
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class FileImage</h2><div class="extends"><ul>
<li><a href="Image.html">Image</a></li>
<ul><li>FileImage</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="FileImage.html">FileImage</a> permet de charger une image existante à partir d'un fichier. L'image ainsi créée peut être utilisée avec un <a href="Driver.html">Driver</a> pour être copiée sur une autre image par exemple.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="methods"><li>
<span class="access">public</span> <a href="FileImage.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">
$file</span>)
</li></ul><h2>Documentation</h2><ul class="doc"><li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="FileImage.html#method.__construct">__construct</a>(<span class="type">string</span> <span class="argument">
$file</span>)
<div class="description">
Construit l'image à partir de l'image contenue dans le fichier $file.
</div>
<div class="description-bottom"><a href="FileImage.html#top">Remonter</a></div>
</li></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/LinePlot.html
New file
0,0 → 1,230
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class LinePlot</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul>
<li><a href="Plot.html">Plot</a></li>
<ul><li>LinePlot <span class="interface">implements</span> <a href="Legendable.html">Legendable</a>
</li></ul>
</ul>
</ul></div><div class="description">
<p>
Cette classe permet de dessiner des courbes.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.LINE">LINE</a> := <span class="default">0</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.MIDDLE">MIDDLE</a> := <span class="default">1</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="LinePlot.html#property.mark"><span class="argument">$mark</span></a>
</li>
<li>
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="LinePlot.html#property.label"><span class="argument">$label</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="LinePlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$mode</span> := <span class="default">LinePlor::LINE</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.hideLine">hideLine</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setFilledArea">setFilledArea</a>(<span class="type">int</span> <span class="argument">$start</span>, <span class="type">int</span> <span class="argument">$stop</span>, <span class="type">mixed</span> <span class="argument">$background</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setFillColor">setFillColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.LINE"></a><span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.LINE">LINE</a> := <span class="default">0</span><div class="description">
Dessine une courbe.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MIDDLE"></a><span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.MIDDLE">MIDDLE</a> := <span class="default">1</span><div class="description">
Dessine une courbe dont les pics sont centrés sur l'axe des X (idéal pour cumuler courbe et histogramme).
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.mark"></a><span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="LinePlot.html#property.mark"><span class="argument">$mark</span></a><div class="description">
Représente les marques affichées sur chaque pointe de la courbe.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="LinePlot.html#property.label"><span class="argument">$label</span></a><div class="description">
Représente les étiquettes affichées au-dessus de chaque pointe de la courbe.
Ces étiquettes contiennent la valeur de chaque pointe.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="LinePlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$mode</span> := <span class="default">LinePlor::LINE</span>)
<div class="description">
Créé une nouvelle courbe de type $mode avec les valeurs présentes dans $values.
Le tableau $values doit être une liste de valeurs dans un tableau incrémental, c'est-à-dire dont les clés valent de 0 à n - 1 (où n est la taille du tableau).
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
// Tableau de valeurs
$x = array(1, 4, 3);
 
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hideLine"></a><span class="access">public</span> <a href="LinePlot.html#method.hideLine">hideLine</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Cache ou ne cache pas la ligne qui relie les valeurs de la courbe.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFilledArea"></a><span class="access">public</span> <a href="LinePlot.html#method.setFilledArea">setFilledArea</a>(<span class="type">int</span> <span class="argument">$start</span>, <span class="type">int</span> <span class="argument">$stop</span>, <span class="type">mixed</span> <span class="argument">$background</span>)
<div class="description">
Permet de remplir une aire sous la courbe des points $start à $stop.
L'aire sera remplie avec la couleur ou le dégradé $background.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setColor"></a><span class="access">public</span> <a href="LinePlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de la ligne qui relie les valeurs de la courbe.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStyle"></a><span class="access">public</span> <a href="LinePlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style de ligne (<a href="Line.html#constant.SOLID">Line::SOLID</a>, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> ou <a href="Line.html#constant.DASHED">Line::DASHED</a>).
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setThickness"></a><span class="access">public</span> <a href="LinePlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
<div class="description">
Change l'épaisseur de la ligne.
L'épaisseur de la ligne doit être toujours positive.
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFillColor"></a><span class="access">public</span> <a href="LinePlot.html#method.setFillColor">setFillColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Change la couleur de fond de la ligne qui relie les valeurs de la courbe.
La couleur de fond remplit le polygone définit par tous les points de la ligne additionés des points extrêmes de l'axe des abscisses.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$x = array(1, 10, 3, -4, 1);
 
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
$plot-&gt;<a href="LinePlot.html#method.setFillColor">setFillColor</a>(new <a href="Color.html">Color</a>(255, 20, 20, 30));
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setFillGradient"></a><span class="access">public</span> <a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
<div class="description">
Change le dégradé de fond de la ligne qui relie les valeurs de la courbe.
Le dégradé de fond remplit le polygone définit par tous les points de la ligne additionés des points extrêmes de l'axe des abscisses.
<pre>
 
&lt;?php
 
require_once "LinePlot.class.php";
 
$graph = new <a href="Graph.html">Graph</a>(400, 400);
 
$x = array(1, 10, 3, -4, 1);
 
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
$plot-&gt;<a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(
new <a href="LinearGradient.html">LinearGradient</a>(
new <a href="Color.html">Color</a>(255, 20, 20, 30),
new <a href="Color.html">Color</a>(20, 255, 20, 30),
90
)
);
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
 
?&gt;
 
</pre>
</div>
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Polygon.html
New file
0,0 → 1,147
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Polygon</h2><div class="extends"><ul>
<li><a href="Shape.html">Shape</a></li>
<ul><li>Polygon</li></ul>
</ul></div><div class="description">
<p>
Un polygone est une succcession de points.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">protected</span> <span class="type">array</span> <a href="Polygon.html#property.points"><span class="argument">$points</span></a>
</li></ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Polygon.html#method.set">set</a>(<span class="type">int</span> <span class="argument">$pos</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
<li>
<span class="access">public</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Polygon.html#method.get">get</a>(<span class="type">int</span> <span class="argument">$pos</span>)
</li>
<li>
<span class="access">public</span> <a href="Polygon.html#method.append">append</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Polygon.html#method.count">count</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.all">all</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getLines">getLines</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxPoints">getBoxPoints</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxYRange">getBoxYRange</a>()
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxXRange">getBoxXRange</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.points"></a><span class="access">protected</span> <span class="type">array</span> <a href="Polygon.html#property.points"><span class="argument">$points</span></a><div class="description">
Stocke tous les points du polygone.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.set"></a><span class="access">public</span> <a href="Polygon.html#method.set">set</a>(<span class="type">int</span> <span class="argument">$pos</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Ajoute ou remplace un point $point dans le polygon à la position $pos.
Cette méthode accepte la valeur NULL pour spécifier que ce point doit être ignoré.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.get"></a><span class="access">public</span> <a href="Point.html"><span class="type">Point</span></a> <a href="Polygon.html#method.get">get</a>(<span class="type">int</span> <span class="argument">$pos</span>)
<div class="description">
Retourne le point du polygone à la position $pos.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.append"></a><span class="access">public</span> <a href="Polygon.html#method.append">append</a>(<a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Ajoute un point $point à la fin du polygone.
Cette méthode accepte la valeur NULL pour spécifier que ce point doit être ignoré.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.count"></a><span class="access">public</span> <span class="type">int</span> <a href="Polygon.html#method.count">count</a>()
<div class="description">
Retourne le nombre de points contenus dans le polygone.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.all"></a><span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.all">all</a>()
<div class="description">
Permet de récupérer tous les points du polygone.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getLines"></a><span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getLines">getLines</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie un tableau contenant toutes les lignes formant le polygone.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getBoxPoints"></a><span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxPoints">getBoxPoints</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie un tableau contenant les points supérieur droit et inférieur gauche du rectangle encadrant le polygone.
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getBoxYRange"></a><span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxYRange">getBoxYRange</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie un tableau contenant les ordonnées minimales et maximales de n'importe quel point appartenant au polygone (c'est à dire l'étendue du polygone le long de l'axe des ordonnées).
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getBoxXRange"></a><span class="access">public</span> <span class="type">array</span> <a href="Polygon.html#method.getBoxXRange">getBoxXRange</a>()
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Renvoie un tableau contenant les abscisses minimales et maximales de n'importe quel point appartenant au polygone (c'est à dire l'étendue du polygone le long de l'axe des abscisses).
</div>
<div class="description-bottom"><a href="Polygon.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/LinearGradient.html
New file
0,0 → 1,58
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class LinearGradient</h2><div class="extends"><ul>
<li><a href="Gradient.html">Gradient</a></li>
<ul><li>LinearGradient</li></ul>
</ul></div><div class="description">
<p>
Cette classe permet de décrire un dégradé linéaire.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de LinearGradient :
<ul><li><a href="BilinearGradient.html">BilinearGradient</a></li></ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties"><li>
<span class="access">public</span> <span class="type">int</span> <a href="LinearGradient.html#property.angle"><span class="argument">$angle</span></a>
</li></ul><ul class="methods"><li>
<span class="access">public</span> <a href="LinearGradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>, <span class="type">int</span> <span class="argument">$angle</span>)
</li></ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.angle"></a><span class="access">public</span> <span class="type">int</span> <a href="LinearGradient.html#property.angle"><span class="argument">$angle</span></a><div class="description">
Décrit l'angle du dégradé. Les valeurs possibles sont 0 et 90°.
</div>
<div class="description-bottom"><a href="LinearGradient.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="LinearGradient.html#method.__construct">__construct</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$from</span>, <a href="Color.html"><span class="type">Color</span></a> <span class="argument">$to</span>, <span class="type">int</span> <span class="argument">$angle</span>)
<div class="description">
Construit une nouveu dégradé. Cette méthode doit être appelée par toutes les classes qui dérivent de celle-ci. Le paramètre $from décrit la couleur de départ du dégradé et le paramètre $to celle de fin. Le troisième paramètre $angle décrit l'angle du dégradé. Ce peut être un dégradé horizontal (angle de 0°) ou un dégradé vertical (angle de 90°).
</div>
<div class="description-bottom"><a href="LinearGradient.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Positionable.html
New file
0,0 → 1,101
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Positionable</h2><div class="description">
<p>
<a href="Positionable.html">Positionable</a> est une <span style="text-decoration: underline">interface</span> que doivent implémenter les classes peuvent être positionnées par rapport à un <a href="Point.html">Point</a>.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.LEFT">LEFT</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.RIGHT">RIGHT</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.CENTER">CENTER</a> := <span class="default">3</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.TOP">TOP</a> := <span class="default">4</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.BOTTOM">BOTTOM</a> := <span class="default">5</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.MIDDLE">MIDDLE</a> := <span class="default">6</span>
</li>
</ul><ul class="methods"><li>
<span class="access">public</span> <a href="Positionable.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
</li></ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.LEFT"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.LEFT">LEFT</a> := <span class="default">1</span><div class="description">
Désigne un alignement à gauche.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.RIGHT"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.RIGHT">RIGHT</a> := <span class="default">2</span><div class="description">
Désigne un alignement à droite.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.CENTER"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.CENTER">CENTER</a> := <span class="default">3</span><div class="description">
Désigne un alignement au centre.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.TOP"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.TOP">TOP</a> := <span class="default">4</span><div class="description">
Désigne un alignement en haut.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.BOTTOM"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.BOTTOM">BOTTOM</a> := <span class="default">5</span><div class="description">
Désigne un alignement en bas.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.MIDDLE"></a><span class="access">const</span> <span class="type">int</span> <a href="Positionable.html#constant.MIDDLE">MIDDLE</a> := <span class="default">6</span><div class="description">
Désigne un alignement au centre.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAlign"></a><span class="access">public</span> <a href="Positionable.html#method.setAlign">setAlign</a>(<span class="type">int</span> <span class="argument">$h</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$v</span> := <span class="default">NULL</span>)
<div class="description">
Change l'alignement par rapport au point où l'objet sera affiché.
$h correspond à l'alignement horizontal (<a href="Positionable.html#constant.LEFT">Positionable::LEFT</a>, <a href="Positionable.html#constant.RIGHT">Positionable::RIGHT</a> ou <a href="Positionable.html#constant.CENTER">Positionable::CENTER</a>) et $v à l'alignement vertical (<a href="Positionable.html#constant.TOP">Positionable::TOP</a>, <a href="Positionable.html#constant.BOTTOM">Positionable::BOTTOM</a> ou <a href="Positionable.html#constant.MIDDLE">Positionable::MIDDLE</a>).
Si vous ne souhaitez pas modifier une des deux valeurs, vous pouvez passer NULL.
</div>
<div class="description-bottom"><a href="Positionable.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/PHPFontDriver.html
New file
0,0 → 1,40
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class PHPFontDriver</h2><div class="extends"><ul>
<li><a href="FontDriver.html">FontDriver</a></li>
<ul><li>PHPFontDriver</li></ul>
</ul></div><div class="description">
<p>
La classe <a href="PHPFontDriver.html">PHPFontDriver</a> s'occupe des calculs et de l'affichage liés aux polices de type <a href="PHPFont.html">PHPFont</a>.
</p>
<p>
A aucun moment vous ne devriez avoir à instancier un objet de ce type. La documentation est là à titre informatif pour les développeurs en herbe.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><h2>Documentation</h2><ul class="doc"></ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/PlotGroup.html
New file
0,0 → 1,156
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class PlotGroup</h2><div class="extends"><ul>
<li><a href="Component.html">Component</a></li>
<ul>
<li><a href="ComponentGroup.html">ComponentGroup</a></li>
<ul><li>PlotGroup</li></ul>
</ul>
</ul></div><div class="description">
<p>
Cette classe permet de gérer plusieurs objets <a href="Plot.html">Plot</a> sur le même graphique.
</p>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="PlotGroup.html#property.grid"><span class="argument">$grid</span></a>
</li>
<li>
<span class="access">public</span> <a href="PlotAxis.html"><span class="type">PlotAxis</span></a> <a href="PlotGroup.html#property.axis"><span class="argument">$axis</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="PlotGroup.html#property.xAxisZero"><span class="argument">$xAxisZero</span></a> := <span class="default">TRUE</span>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setXAxisZero">setXAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setYAxisZero">setYAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setYMin">setYMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setYMax">setYMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setXMin">setXMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
<li>
<span class="access">public</span> <a href="PlotGroup.html#method.setXMax">setXMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.grid"></a><span class="access">public</span> <a href="Grid.html"><span class="type">Grid</span></a> <a href="PlotGroup.html#property.grid"><span class="argument">$grid</span></a><div class="description">
Représente la grille de fond du groupe de <a href="Plot.html">Plot</a>.
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.axis"></a><span class="access">public</span> <a href="PlotAxis.html"><span class="type">PlotAxis</span></a> <a href="PlotGroup.html#property.axis"><span class="argument">$axis</span></a><div class="description">
Représente les axes de gauche, droite, du haut et du bas du groupe de <a href="Plot.html">Plot</a>.
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.xAxisZero"></a><span class="access">protected</span> <span class="type">bool</span> <a href="PlotGroup.html#property.xAxisZero"><span class="argument">$xAxisZero</span></a> := <span class="default">TRUE</span><div class="description">
Est-ce le ou les axes des abscisses doivent être centrés sur zéro ?
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="PlotGroup.html#method.__construct">__construct</a>()
<div class="description">
Construit le groupe de <a href="Plot.html">Plot</a>.
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXAxisZero"></a><span class="access">public</span> <a href="PlotGroup.html#method.setXAxisZero">setXAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
<div class="description">
Précise si le ou les axes des abscisses doivent être centrés sur le zéro de l'axe des ordonnées.
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYAxisZero"></a><span class="access">public</span> <a href="PlotGroup.html#method.setYAxisZero">setYAxisZero</a>(<span class="type">bool</span> <span class="argument">$zero</span>)
<div class="description">
Précise si le ou les axes des ordonnées doivent être centrés sur le zéro de l'axe des abscisses.
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYMin"></a><span class="access">public</span> <a href="PlotGroup.html#method.setYMin">setYMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur minimale de l'axe des ordonnées à $value.
<div class="see">
Voir aussi :
<ul><li><a href="PlotGroup.html#method.setYMax">PlotGroup::setYMax()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setYMax"></a><span class="access">public</span> <a href="PlotGroup.html#method.setYMax">setYMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur maximale de l'axe des ordonnées à $value.
<div class="see">
Voir aussi :
<ul><li><a href="PlotGroup.html#method.setYMin">PlotGroup::setYMin()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXMin"></a><span class="access">public</span> <a href="PlotGroup.html#method.setXMin">setXMin</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur minimale de l'axe des abscisses à $value.
<div class="see">
Voir aussi :
<ul><li><a href="PlotGroup.html#method.setXMax">PlotGroup::setXMax()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setXMax"></a><span class="access">public</span> <a href="PlotGroup.html#method.setXMax">setXMax</a>(<span class="type">float</span> <span class="argument">$value</span>)
<div class="description">
Force la valeur maximale de l'axe des abscisses à $value.
<div class="see">
Voir aussi :
<ul><li><a href="PlotGroup.html#method.setXMin">PlotGroup::setXMin()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="PlotGroup.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Driver.html
New file
0,0 → 1,494
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Driver</h2><div class="description">
<p>
La classe abstraite <a href="Driver.html">Driver</a> rassemble toutes les méthodes permettant de dessiner sur une <a href="Image.html">Image</a>. Cette classe ne contient aucune implémentation. Celle-ci doit être effectué à l'intérieur de chaque pilote dérivant de <a href="Driver.html">Driver</a>.
</p>
<p>
Sur une image, l'axe des abscisses rejoint l'axe des ordonnées sur le coin haut-gauche. Le coin haut-gauche de l'image a donc pour coordonnées (0, 0) et le coin bas-droite (largeur, hauteur). Par exemple, sur une image de largeur 100 et de hauteur 50, un point à 50 sur l'axe des abscisses et 25 sur l'axe des ordonnées sera au centre de l'image.
</p>
</div><div class="inherit">
Les classes suivantes dérivent de Driver :
<ul><li><a href="GDDriver.html">GDDriver</a></li></ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageWidth"><span class="argument">$imageWidth</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageHeight"><span class="argument">$imageHeight</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span>
</li>
<li>
<span class="access">protected</span> <span class="type">string</span> <a href="Driver.html#property.driverString"><span class="argument">$driverString</span></a>
</li>
<li>
<span class="access">protected</span> <a href="PHPFontDriver.html"><span class="type">PHPFontDriver</span></a> <a href="Driver.html#property.phpFontDriver"><span class="argument">$phpFontDriver</span></a>
</li>
<li>
<span class="access">protected</span> <a href="FileFontDriver.html"><span class="type">FileFontDriver</span></a> <a href="Driver.html#property.fileFontDriver"><span class="argument">$fileFontDriver</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Driver.html#method.__construct">__construct</a>()
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.init">init</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.initFromFile">initFromFile</a>(<a href="FileImage.html"><span class="type">FileImage</span></a> <span class="argument">$fileImage</span>, <span class="type">string</span> <span class="argument">$file</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setImageSize">setImageSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.movePosition">movePosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$w</span>, <span class="type">float</span> <span class="argument">$h</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
</li>
<li>
<span class="access">public</span> <span class="type">array</span> <a href="Driver.html#method.getSize">getSize</a>()
</li>
<li>
<span class="access">public</span> <span class="type">mixed</span> <a href="Driver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.send">send</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.get">get</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.copyImage">copyImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.copyResizeImage">copyResizeImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d2</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s2</span>, <span class="type">bool</span> <span class="argument">$resampled</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.string">string</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.point">point</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.line">line</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.arc">arc</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledArc">filledArc</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.ellipse">ellipse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledEllipse">filledEllipse</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.rectangle">rectangle</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledRectangle">filledRectangle</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.polygon">polygon</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
<li>
<span class="access">public</span> <a href="Driver.html#method.filledPolygon">filledPolygon</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Driver.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
<li>
<span class="access">public</span> <span class="type">float</span> <a href="Driver.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#method.isCompatibleWithFont">isCompatibleWithFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="property">
<a id="property.imageWidth"></a><span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageWidth"><span class="argument">$imageWidth</span></a><div class="description">
La largeur de l'image gérée par le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.imageHeight"></a><span class="access">public</span> <span class="type">int</span> <a href="Driver.html#property.imageHeight"><span class="argument">$imageHeight</span></a><div class="description">
La hauteur de l'image gérée par le pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.antiAliasing"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#property.antiAliasing"><span class="argument">$antiAliasing</span></a> := <span class="default">FALSE</span><div class="description">
Doit-on utiliser l'anti-aliasing sur ce dessin ?
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.driverString"></a><span class="access">protected</span> <span class="type">string</span> <a href="Driver.html#property.driverString"><span class="argument">$driverString</span></a><div class="description">
Représente le type du pilote sous forme de chaîne.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.phpFontDriver"></a><span class="access">protected</span> <a href="PHPFontDriver.html"><span class="type">PHPFontDriver</span></a> <a href="Driver.html#property.phpFontDriver"><span class="argument">$phpFontDriver</span></a><div class="description">
Un objet <a href="PHPFontDriver.html">PHPFontDriver</a> gérant l'affichage et les calculs sur les polices de type <a href="PHPFont.html">PHPFont</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.fileFontDriver"></a><span class="access">protected</span> <a href="FileFontDriver.html"><span class="type">FileFontDriver</span></a> <a href="Driver.html#property.fileFontDriver"><span class="argument">$fileFontDriver</span></a><div class="description">
Un objet <a href="FileFontDriver.html">FileFontDriver</a> gérant l'affichage et les calculs sur les polices de type <a href="FileFont.html">FileFont</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Driver.html#method.__construct">__construct</a>()
<div class="description">
Construit le pilote.
Instancie les <a href="FontDriver.html">FontDriver</a> et initialise la propriété <a href="Driver.html#property.driverString">driverString</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.init"></a><span class="access">public</span> <a href="Driver.html#method.init">init</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Initialise le pilote pour l'<a href="Image.html">Image</a> $image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.initFromFile"></a><span class="access">public</span> <a href="Driver.html#method.initFromFile">initFromFile</a>(<a href="FileImage.html"><span class="type">FileImage</span></a> <span class="argument">$fileImage</span>, <span class="type">string</span> <span class="argument">$file</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Initialise le pilote à partir d'une <a href="FileImage.html">FileImage</a> $fileImage.
Le chemin d'accès au fichier proprement dit est contenu dans $file.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setImageSize"></a><span class="access">public</span> <a href="Driver.html#method.setImageSize">setImageSize</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Change la taille de l'image gérée par le pilote pour la largeur $width et la hauteur $height.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setPosition"></a><span class="access">public</span> <a href="Driver.html#method.setPosition">setPosition</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Informe le pilote de la position de la sous-image sur l'image.
Les positions X et Y sont données via les paramètres $x et $y, qui représentent une fraction de la taille de l'image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.movePosition"></a><span class="access">public</span> <a href="Driver.html#method.movePosition">movePosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Demande au pilote de déplacer la position de la sous-image sur l'image.
$x et $y représentent respectivement les déplacements latéral et vertical de la position en pixels.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsPosition"></a><span class="access">public</span> <a href="Driver.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
<div class="description">
Informe le pilote de la position de la sous-image sur l'image.
Les positions X et Y sont données via les paramètres $x et $y, dont l'unité est le pixel.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setSize"></a><span class="access">public</span> <a href="Driver.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$w</span>, <span class="type">float</span> <span class="argument">$h</span>)
<div class="description">
Informe le pilote de la taille de la sous-image sur l'image.
Les largeur et hauteur de la sous-image sont données via les paramètres $w et $h, qui représentent une fraction de la taille de l'image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAbsSize"></a><span class="access">public</span> <a href="Driver.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
<div class="description">
Informe le pilote de la taille de la sous-image sur l'image.
Les largeur et hauteur de la sous-image sont données via les paramètres $w et $h, dont l'unité est le pixel.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getSize"></a><span class="access">public</span> <span class="type">array</span> <a href="Driver.html#method.getSize">getSize</a>()
<div class="description">
Retourne la taille de la sous-image en pixels.
Les valeurs sont retournées sous la forme d'un tableau, de la forme array(largeur, hauteur).
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getColor"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Driver.html#method.getColor">getColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
<div class="description">
Convertit un objet <a href="Color.html">Color</a> pour qu'il soit exploitable directement par les fonctions de dessins employées par le pilote.
Le type de donnée renvoyée dépend du pilote.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.send"></a><span class="access">public</span> <a href="Driver.html#method.send">send</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<div class="description">
Construit l'image passée en paramètre et l'envoie sur la sortie standard accompagnée des en-têtes HTTP correspondants.
A aucun moment vous ne devriez avoir besoin d'appeler vous-même cette méthode. Pour générez les images, utilisez <a href="Graph.html#method.draw">Graph::draw()</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.get"></a><span class="access">public</span> <a href="Driver.html#method.get">get</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Construit l'image passée en paramètre et la renvoie sous forme de données binaires. Vous pouvez donc la stocker dans une variable si vous voulez faire des manipulations spécifiques.
A aucun moment vous ne devriez avoir besoin d'appeler vous-même cette méthode. Pour générez les images, utilisez <a href="Graph.html#method.draw">Graph::draw()</a>.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setAntiAliasing"></a><span class="access">public</span> <a href="Driver.html#method.setAntiAliasing">setAntiAliasing</a>(<span class="type">bool</span> <span class="argument">$bool</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.0.9</li></ul>
<div class="description">
Active ou désactive l'anti-aliasing lors du dessin.
L'anti-aliasing permet d'avoir des graphiques plus propres mais demande plus de ressources.
L'anti-aliasing n'est pas activé par défaut.
<div class="see">
Voir aussi :
<ul><li><a href="Image.html#method.setAntiAliasing">Image::setAntiAliasing()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.copyImage"></a><span class="access">public</span> <a href="Driver.html#method.copyImage">copyImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$p2</span>)
<div class="description">
Copie l'image $image vers la sous-image courante.
L'image sera copiée sur la sous-image du point $p1 (coin haut-gauche) ou point $p2 (coin bas-droit).
Les coordonnées de $p1 et $p2 doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.copyResizeImage"></a><span class="access">public</span> <a href="Driver.html#method.copyResizeImage">copyResizeImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$d2</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s1</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$s2</span>, <span class="type">bool</span> <span class="argument">$resampled</span>)
<div class="description">
Copie l'image $image vers l'image courante.
L'image $image sera copiée des points $s1 (coin haut-gauche) et $s2 (coin bas-droit) vers les points $d1 (coin haut-gauche) et $d2 (coin bas-droit) de l'image courante.
Si $resampled est placé à TRUE, l'image sera rééchantillonée.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.string"></a><span class="access">public</span> <a href="Driver.html#method.string">string</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>, <span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>)
<div class="description">
Dessine la chaîne de caractères $text à partir du point $point.
Les coordonnées de $point doivent être relatives à celles de la sous-image.
Le paramètre $width permet de spécifier la largeur maximale en pixels de la boîte de texte.
<div class="see">
Voir aussi :
<ul>
<li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li>
<li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li>
</ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.point"></a><span class="access">public</span> <a href="Driver.html#method.point">point</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
<div class="description">
Dessine un pixel de couleur $color au point $point.
Les coordonnées de $point doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.line"></a><span class="access">public</span> <a href="Driver.html#method.line">line</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
<div class="description">
Dessine la ligne $line de couleur $color.
Les coordonnées de la ligne doivent être relatives à celles de la sous-image.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.arc"></a><span class="access">public</span> <a href="Driver.html#method.arc">arc</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
<div class="description">
Dessine un arc d'ellipse de couleur $color dont les deux extrémités sont reliées au centre de l'ellipse.
L'ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
L'angle de départ pour l'arc est $from et l'angle d'arrivée $to.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledArc">Driver::filledArc()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledArc"></a><span class="access">public</span> <a href="Driver.html#method.filledArc">filledArc</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>, <span class="type">float</span> <span class="argument">$from</span>, <span class="type">float</span> <span class="argument">$to</span>)
<div class="description">
Dessine un arc d'ellipse dont les deux extrémités sont reliées au centre de l'ellipse et le remplit avec la couleur ou le dégradé $background.
L'ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
L'angle de départ pour l'arc est $from et l'angle d'arrivée $to.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.arc">Driver::arc()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.ellipse"></a><span class="access">public</span> <a href="Driver.html#method.ellipse">ellipse</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Dessine une ellipse de couleur $color, ayant pour centre $center et de largeur et hauteur respectives $width et $height.
Les coordonnées de l'ellipse doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledEllipse">Driver::filledEllipse()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledEllipse"></a><span class="access">public</span> <a href="Driver.html#method.filledEllipse">filledEllipse</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$center</span>, <span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
<div class="description">
Dessine et remplit une ellipse avec la couleur ou le dégradé $background. Cette ellipse a pour centre $center et est de largeur et hauteur respectives $width et $height.
Les coordonnées de l'ellipse doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.ellipse">Driver::ellipse()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.rectangle"></a><span class="access">public</span> <a href="Driver.html#method.rectangle">rectangle</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
<div class="description">
Dessine un rectangle de couleur $color dont la ligne $line représente la diagonale.
Les coordonnées du rectangle doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledRectangle">Driver::filledRectangle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledRectangle"></a><span class="access">public</span> <a href="Driver.html#method.filledRectangle">filledRectangle</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Line.html"><span class="type">Line</span></a> <span class="argument">$line</span>)
<div class="description">
Dessine et remplit un rectangle avec la couleur ou le dégradé $background dont la ligne $line représente la diagonale.
Les coordonnées du rectangle doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.rectangle">Driver::rectangle()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.polygon"></a><span class="access">public</span> <a href="Driver.html#method.polygon">polygon</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<div class="description">
Dessine le polygone $polygon de couleur $color.
Les coordonnées de chaque point du polygone doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.filledPolygon">Driver::filledPolygon()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.filledPolygon"></a><span class="access">public</span> <a href="Driver.html#method.filledPolygon">filledPolygon</a>(<span class="type">mixed</span> <span class="argument">$background</span>, <a href="Polygon.html"><span class="type">Polygon</span></a> <span class="argument">$polygon</span>)
<div class="description">
Dessine et remplit le polygone $polygon avec la couleur ou le dégradé $background.
Les coordonnées de chaque point du polygone doivent être relatives à celles de la sous-image.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.polygon">Driver::polygon()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextWidth"></a><span class="access">public</span> <span class="type">float</span> <a href="Driver.html#method.getTextWidth">getTextWidth</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie la largeur prise sur l'image par le <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextHeight">Driver::getTextHeight()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getTextHeight"></a><span class="access">public</span> <span class="type">float</span> <a href="Driver.html#method.getTextHeight">getTextHeight</a>(<a href="Text.html"><span class="type">Text</span></a> <span class="argument">$text</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie la hauteur prise sur l'image par le <a href="Text.html">Text</a> $text.
<div class="see">
Voir aussi :
<ul><li><a href="Driver.html#method.getTextWidth">Driver::getTextWidth()</a></li></ul>
</div>
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isCompatibleWithFont"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Driver.html#method.isCompatibleWithFont">isCompatibleWithFont</a>(<a href="Font.html"><span class="type">Font</span></a> <span class="argument">$font</span>)
<ul class="version"><li>
Disponible depuis Artichow 1.1</li></ul>
<div class="description">
Renvoie TRUE si le pilote actuel est compatible avec la police $font, FALSE sinon.
Chaque pilote doit définir les polices avec lesquelles il est compatible.
</div>
<div class="description-bottom"><a href="Driver.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/doc/Shape.html
New file
0,0 → 1,177
<html>
<head>
<title>Documentation</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='style.css' />
</head>
 
<body>
<div align='center'>
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
<tr>
<td class='borderhg'>&nbsp;</td>
<td class='borderh'>&nbsp;</td>
<td class='cornerhd'></td>
</tr>
<tr>
<td class='borderg'>&nbsp;</td>
<td><a id="top"></a><h2> Class Shape</h2><div class="description">
<p>La classe <a href="Shape.html">Shape</a> permet de représenter toutes sortes de formes sur Artichow.</p>
</div><div class="inherit">
Les classes suivantes dérivent de Shape :
<ul>
<li><a href="Point.html">Point</a></li>
<li><a href="Line.html">Line</a></li>
<li><a href="Polygon.html">Polygon</a></li>
</ul>
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.SOLID">SOLID</a> := <span class="default">1</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.DOTTED">DOTTED</a> := <span class="default">2</span>
</li>
<li>
<span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.DASHED">DASHED</a> := <span class="default">3</span>
</li>
</ul><ul class="properties">
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Shape.html#property.style"><span class="argument">$style</span></a>
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Shape.html#property.thickness"><span class="argument">$thickness</span></a>
</li>
<li>
<span class="access">protected</span> <span class="type">bool</span> <a href="Shape.html#property.hide"><span class="argument">$hide</span></a>
</li>
</ul><ul class="methods">
<li>
<span class="access">public</span> <a href="Shape.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
</li>
<li>
<span class="access">public</span> <a href="Shape.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Shape.html#method.getStyle">getStyle</a>()
</li>
<li>
<span class="access">public</span> <a href="Shape.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
</li>
<li>
<span class="access">public</span> <span class="type">int</span> <a href="Shape.html#method.getThickness">getThickness</a>()
</li>
<li>
<span class="access">public</span> <a href="Shape.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
</li>
<li>
<span class="access">public</span> <a href="Shape.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
</li>
<li>
<span class="access">public</span> <span class="type">bool</span> <a href="Shape.html#method.isHidden">isHidden</a>()
</li>
</ul><h2>Documentation</h2><ul class="doc">
<li class="constant">
<a id="constant.SOLID"></a><span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.SOLID">SOLID</a> := <span class="default">1</span><div class="description">
Désigne une ligne continue.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.DOTTED"></a><span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.DOTTED">DOTTED</a> := <span class="default">2</span><div class="description">
Désigne une ligne pointillée.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="constant">
<a id="constant.DASHED"></a><span class="access">const</span> <span class="type">int</span> <a href="Shape.html#constant.DASHED">DASHED</a> := <span class="default">3</span><div class="description">
Désigne une ligne avec de larges pointillés.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.style"></a><span class="access">public</span> <span class="type">int</span> <a href="Shape.html#property.style"><span class="argument">$style</span></a><div class="description">
Décrit le style du pourtour de la forme. Peut être <a href="Shape.html#constant.DOTTED">Shape::DOTTED</a>, <a href="Shape.html#constant.SOLID">Shape::SOLID</a> ou <a href="Shape.html#constant.DASHED">Shape::DASHED</a>.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.thickness"></a><span class="access">public</span> <span class="type">int</span> <a href="Shape.html#property.thickness"><span class="argument">$thickness</span></a><div class="description">
L'épaisseur du pourtour de la forme.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="property">
<a id="property.hide"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Shape.html#property.hide"><span class="argument">$hide</span></a><div class="description">
Déterminer si la forme doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.__construct"></a><span class="access">public</span> <a href="Shape.html#method.__construct">__construct</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
<div class="description">
Déclare un nouveau point avec des coordonnées x et y.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setStyle"></a><span class="access">public</span> <a href="Shape.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
<div class="description">
Change le style du pourtour de la forme. Peut être <a href="Shape.html#constant.SOLID">Shape::SOLID</a> pour un pourtour continu, <a href="Shape.html#constant.DOTTED">Shape::DOTTED</a> pour un pourtour pointillé ou encore <a href="Shape.html#constant.DASHED">Shape::DASHED</a>.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getStyle"></a><span class="access">public</span> <span class="type">int</span> <a href="Shape.html#method.getStyle">getStyle</a>()
<div class="description">
Retourne le style actuel de la forme.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.setThickness"></a><span class="access">public</span> <a href="Shape.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
<div class="description">
Change l'épaisseur du pourtour de la forme. Cette épaisseur doit être donnée en pixels.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.getThickness"></a><span class="access">public</span> <span class="type">int</span> <a href="Shape.html#method.getThickness">getThickness</a>()
<div class="description">
Retourne l'épaisseur du pourtour de la forme.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.hide"></a><span class="access">public</span> <a href="Shape.html#method.hide">hide</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
<div class="description">
Détermine si la forme doit être cachée ou non.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.show"></a><span class="access">public</span> <a href="Shape.html#method.show">show</a>(<span class="type">bool</span> <span class="argument">$show</span>)
<div class="description">
Détermine si la forme doit être affichée ou non.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
<li class="method">
<a id="method.isHidden"></a><span class="access">public</span> <span class="type">bool</span> <a href="Shape.html#method.isHidden">isHidden</a>()
<div class="description">
Retourne TRUE si la forme est cachée, FALSE si elle est visible.
</div>
<div class="description-bottom"><a href="Shape.html#top">Remonter</a></div>
</li>
</ul>
</td>
<td class='borderd'>&nbsp;</td>
</tr>
<tr>
<td class='cornerbg'></td>
<td class='borderb'>&nbsp;</td>
<td class='cornerbd'></td>
</tr>
</table>
</div>
</body>
</html>
/trunk/bibliotheque/artichow/images/book.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/book.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/images/paperclip.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/paperclip.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/images/error.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/error.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/images/errors/missing-anti-aliasing.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/errors/missing-anti-aliasing.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/images/errors/missing-gd2.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/errors/missing-gd2.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/images/star.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/trunk/bibliotheque/artichow/images/star.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/trunk/bibliotheque/artichow/AntiSpam.class.php
New file
0,0 → 1,224
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Image.class.php";
 
/**
* AntiSpam
* String printed on the images are case insensitive.
*
* @package Artichow
*/
class awAntiSpam extends awImage {
 
/**
* Anti-spam string
*
* @var string
*/
protected $string;
 
/**
* Noise intensity
*
* @var int
*/
protected $noise = 0;
/**
* Construct a new awAntiSpam image
*
* @param string $string A string to display
*/
public function __construct($string = '') {
parent::__construct();
$this->string = (string)$string;
}
/**
* Create a random string
*
* @param int $length String length
* @return string String created
*/
public function setRand($length) {
$length = (int)$length;
$this->string = '';
$letters = 'aAbBCDeEFgGhHJKLmMnNpPqQRsStTuVwWXYZz2345679';
$number = strlen($letters);
for($i = 0; $i < $length; $i++) {
$this->string .= $letters{mt_rand(0, $number - 1)};
}
return $this->string;
}
/**
* Set noise on image
*
* @param int $nois Noise intensity (from 0 to 10)
*/
public function setNoise($noise) {
if($noise < 0) {
$noise = 0;
}
if($noise > 10) {
$noise = 10;
}
$this->noise = (int)$noise;
}
/**
* Save string value in session
* You can use check() to verify the value later
*
* @param string $qName A name that identify the anti-spam image
*/
public function save($qName) {
$this->session();
$session = 'artichow_'.(string)$qName;
$_SESSION[$session] = $this->string;
}
/**
* Verify user entry
*
* @param string $qName A name that identify the anti-spam image
* @param string $value User-defined value
* @param bool $case TRUE for case insensitive check, FALSE for case sensitive check ? (default to TRUE)
* @return bool TRUE if the value is correct, FALSE otherwise
*/
public function check($qName, $value, $case = TRUE) {
$this->session();
$session = 'artichow_'.(string)$qName;
return (
array_key_exists($session, $_SESSION) === TRUE and
$case ?
(strtolower($_SESSION[$session]) === strtolower((string)$value)) :
($_SESSION[$session] === (string)$value)
);
}
/**
* Draw image
*/
public function draw() {
 
$fonts = array(
'Tuffy',
'TuffyBold',
'TuffyItalic',
'TuffyBoldItalic'
);
$sizes = array(12, 12.5, 13, 13.5, 14, 15, 16, 17, 18, 19);
$widths = array();
$heights = array();
$texts = array();
// Set up a temporary driver to allow font size calculations...
$this->setSize(10, 10);
$driver = $this->getDriver();
for($i = 0; $i < strlen($this->string); $i++) {
$fontKey = array_rand($fonts);
$sizeKey = array_rand($sizes);
$font = new awTTFFont(
$fonts[$fontKey], $sizes[$sizeKey]
);
$text = new awText(
$this->string{$i},
$font,
NULL,
mt_rand(-15, 15)
);
$widths[] = $driver->getTextWidth($text);
$heights[] = $driver->getTextHeight($text);
$texts[] = $text;
}
// ... and get rid of it.
$this->driver = NULL;
$width = array_sum($widths);
$height = array_max($heights);
$totalWidth = $width + 10 + count($texts) * 10;
$totalHeight = $height + 20;
$this->setSize($totalWidth, $totalHeight);
$this->create();
for($i = 0; $i < strlen($this->string); $i++) {
$this->driver->string(
$texts[$i],
new awPoint(
5 + array_sum(array_slice($widths, 0, $i)) + $widths[$i] / 2 + $i * 10,
10 + ($height - $heights[$i]) / 2
)
);
}
$this->drawNoise($totalWidth, $totalHeight);
$this->send();
}
protected function drawNoise($width, $height) {
$points = $this->noise * 30;
$color = new awColor(0, 0, 0);
for($i = 0; $i < $points; $i++) {
$this->driver->point(
$color,
new awPoint(
mt_rand(0, $width),
mt_rand(0, $height)
)
);
}
}
protected function session() {
// Start session if needed
if(!session_id()) {
session_start();
}
}
 
}
 
registerClass('AntiSpam');
?>
/trunk/bibliotheque/artichow/font/TuffyItalic.ttf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/font/TuffyItalic.ttf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/font/TuffyBoldItalic.ttf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/font/TuffyBoldItalic.ttf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/font/Tuffy.ttf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/font/Tuffy.ttf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/font/TuffyBold.ttf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/bibliotheque/artichow/font/TuffyBold.ttf
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/trunk/bibliotheque/artichow/Pie.class.php
New file
0,0 → 1,695
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Component.class.php";
/**
* Pie
*
* @package Artichow
*/
class awPie extends awComponent {
 
/**
* A dark theme for pies
*
*
* @var int
*/
const DARK = 1;
 
/**
* A colored theme for pies
*
* @var int
*/
const COLORED = 2;
 
/**
* A water theme for pies
*
* @var int
*/
const AQUA = 3;
 
/**
* A earth theme for pies
*
* @var int
*/
const EARTH = 4;
/**
* Pie values
*
* @var array
*/
protected $values;
/**
* Pie colors
*
* @var array
*/
protected $colors;
/**
* Pie legend
*
* @var array
*/
protected $legendValues = array();
/**
* Intensity of the 3D effect
*
* @var int
*/
protected $size;
/**
* Border color
*
* @var Color
*/
protected $border;
/**
* Pie explode
*
* @var array
*/
protected $explode = array();
/**
* Initial angle
*
* @var int
*/
protected $angle = 0;
/**
* Labels precision
*
* @var int
*/
protected $precision;
/**
* Labels number
*
* @var int
*/
protected $number;
/**
* Labels minimum
*
* @var int
*/
protected $minimum;
/**
* Labels position
*
* @var int
*/
protected $position = 15;
/**
* Labels of your pie
*
* @var Label
*/
public $label;
/**
* Build the plot
*
* @param array $values Pie values
*/
public function __construct($values, $colors = awPie::COLORED) {
$this->setValues($values);
if(is_array($colors)) {
$this->colors = $colors;
} else {
switch($colors) {
case awPie::AQUA :
$this->colors = array(
new awColor(131, 220, 215),
new awColor(131, 190, 215),
new awColor(131, 160, 215),
new awColor(160, 140, 215),
new awColor(190, 131, 215),
new awColor(220, 131, 215)
);
break;
case awPie::EARTH :
$this->colors = array(
new awColor(97, 179, 110),
new awColor(130, 179, 97),
new awColor(168, 179, 97),
new awColor(179, 147, 97),
new awColor(179, 108, 97),
new awColor(99, 107, 189),
new awColor(99, 165, 189)
);
break;
case awPie::DARK :
$this->colors = array(
new awColor(140, 100, 170),
new awColor(130, 170, 100),
new awColor(160, 160, 120),
new awColor(150, 110, 140),
new awColor(130, 150, 160),
new awColor(90, 170, 140)
);
break;
default :
$this->colors = array(
new awColor(187, 213, 151),
new awColor(223, 177, 151),
new awColor(111, 186, 132),
new awColor(197, 160, 230),
new awColor(165, 169, 63),
new awColor(218, 177, 89),
new awColor(116, 205, 121),
new awColor(200, 201, 78),
new awColor(127, 205, 177),
new awColor(205, 160, 160),
new awColor(190, 190, 190)
);
break;
}
}
parent::__construct();
$this->label = new awLabel;
$this->label->setCallbackFunction('callbackPerCent');
}
/**
* Change legend values
*
* @param array $legend An array of values for each part of the pie
*/
public function setLegend($legend) {
$this->legendValues = (array)$legend;
}
/**
* Set a border all around the pie
*
* @param awColor $color A color for the border
*/
public function setBorderColor(awColor $color) {
$this->border = $color;
}
/**
* Set a border all around the pie
*
* @param awColor $color A color for the border
*/
public function setBorder(awColor $color) {
if(ARTICHOW_DEPRECATED === TRUE) {
awImage::drawError('Class Pie: Method setBorder() has been deprecated since Artichow 1.0.9. Please use setBorderColor() instead.');
} else {
$this->setBorderColor($color);
}
}
/**
* Change 3D effect intensity
*
* @param int $size Effect size
*/
public function set3D($size) {
$this->size = (int)$size;
}
/**
* Change initial angle
*
* @param int $angle New angle in degrees
*/
public function setStartAngle($angle) {
$this->angle = (int)$angle;
}
/**
* Change label precision
*
* @param int $precision New precision
*/
public function setLabelPrecision($precision) {
$this->precision = (int)$precision;
}
/**
* Change label position
*
* @param int $position New position in pixels
*/
public function setLabelPosition($position) {
$this->position = (int)$position;
}
/**
* Change label number
*
* @param int $number New number
*/
public function setLabelNumber($number) {
$this->number = is_null($number) ? $number : (int)$number;
}
/**
* Change label minimum
*
* @param int $minimum New minimum
*/
public function setLabelMinimum($minimum) {
$this->minimum = is_null($minimum) ? $minimum : (int)$minimum;
}
/**
* Change Pie explode
*
* @param array $explode
*/
public function explode($explode) {
$this->explode = (array)$explode;
}
public function drawEnvelope(awDriver $driver) {
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
$count = count($this->values);
$sum = array_sum($this->values);
$width = $x2 - $x1;
$height = $y2 - $y1;
if($aliasing) {
$x = $width / 2;
$y = $height / 2;
} else {
$x = $width / 2 + $x1;
$y = $height / 2 + $y1;
}
$position = $this->angle;
$values = array();
$parts = array();
$angles = 0;
if($aliasing) {
$side = new awSide(0, 0, 0, 0);
}
foreach($this->values as $key => $value) {
$angle = ($value / $sum * 360);
if($key === $count - 1) {
$angle = 360 - $angles;
}
$angles += $angle;
if(array_key_exists($key, $this->explode)) {
$middle = 360 - ($position + $angle / 2);
$posX = $this->explode[$key] * cos($middle * M_PI / 180);
$posY = $this->explode[$key] * sin($middle * M_PI / 180) * -1;
if($aliasing) {
$explode = new awPoint(
$posX * 2,
$posY * 2
);
$side->set(
max($side->left, $posX * -2),
max($side->right, $posX * 2),
max($side->top, $posY * -2),
max($side->bottom, $posY * 2)
);
} else {
$explode = new awPoint(
$posX,
$posY
);
}
} else {
$explode = new awPoint(0, 0);
}
$values[$key] = array(
$position, ($position + $angle), $explode
);
$color = $this->colors[$key % count($this->colors)];
$parts[$key] = new awPiePart($color);
// Add part to the legend
$legend = array_key_exists($key, $this->legendValues) ? $this->legendValues[$key] : $key;
$this->legend->add($parts[$key], $legend, awLegend::BACKGROUND);
$position += $angle;
}
if($aliasing) {
$mainDriver = $driver;
$x *= 2;
$y *= 2;
$width *= 2;
$height *= 2;
$this->size *= 2;
$image = new awImage;
$image->border->hide();
// Adds support for antialiased pies on non-white background
$background = $this->getBackground();
if($background instanceof awColor) {
$image->setBackgroundColor($background);
}
// elseif($background instanceof awGradient) {
// $image->setBackgroundColor(new White(100));
// }
$image->setSize(
$width + $side->left + $side->right,
$height + $side->top + $side->bottom + $this->size + 1 /* bugs.php.net ! */
);
$driver = $image->getDriver(
$width / $image->width,
$height / $image->height,
($width / 2 + $side->left) / $image->width,
($height / 2 + $side->top) / $image->height
);
}
// Draw 3D effect
for($i = $this->size; $i > 0; $i--) {
foreach($values as $key => $value) {
$color = clone $this->colors[$key % count($this->colors)];
$color->brightness(-50);
list($from, $to, $explode) = $value;
$driver->filledArc($color, $explode->move($x, $y + $i), $width, $height, $from, $to);
unset($color);
if($this->border instanceof awColor) {
$point = $explode->move($x, $y);
if($i === $this->size) {
$driver->arc($this->border, $point->move(0, $this->size), $width, $height, $from, $to);
}
}
}
}
foreach($values as $key => $value) {
$color = $this->colors[$key % count($this->colors)];
list($from, $to, $explode) = $value;
$driver->filledArc($color, $explode->move($x, $y), $width, $height, $from, $to);
if($this->border instanceof awColor) {
$point = $explode->move($x, $y);
$driver->arc($this->border, $point, $width, $height, $from, $to);
}
}
if($aliasing) {
$x = $x / 2 + $x1;
$y = $y / 2 + $y1;
$width /= 2;
$height /= 2;
$this->size /= 2;
foreach($values as $key => $value) {
$old = $values[$key][2];
$values[$key][2] = new awPoint(
$old->x / 2, $old->y / 2
);
}
$mainDriver->copyResizeImage(
$image,
new awPoint($x1 - $side->left / 2, $y1 - $side->top / 2),
new awPoint($x1 - $side->left / 2 + $image->width / 2, $y1 - $side->top / 2 + $image->height/ 2),
new awPoint(0, 0),
new awPoint($image->width, $image->height),
TRUE
);
$driver = $mainDriver;
}
// Get labels values
$pc = array();
foreach($this->values as $key => $value) {
$pc[$key] = round($value / $sum * 100, $this->precision);
}
if($this->label->count() === 0) { // Check that there is no user defined values
$this->label->set($pc);
}
$position = 0;
foreach($pc as $key => $value) {
// Limit number of labels to display
if($position === $this->number) {
break;
}
if(is_null($this->minimum) === FALSE and $value < $this->minimum) {
continue;
}
$position++;
list($from, $to, $explode) = $values[$key];
$angle = $from + ($to - $from) / 2;
$angleRad = (360 - $angle) * M_PI / 180;
$point = new awPoint(
$x + $explode->x + cos($angleRad) * ($width / 2 + $this->position),
$y + $explode->y - sin($angleRad) * ($height / 2 + $this->position)
);
$angle %= 360;
// We don't display labels on the 3D effect
if($angle > 0 and $angle < 180) {
$point = $point->move(0, -1 * sin($angleRad) * $this->size);
}
if($angle >= 45 and $angle < 135) {
$this->label->setAlign(awLabel::CENTER, awLabel::BOTTOM);
} else if($angle >= 135 and $angle < 225) {
$this->label->setAlign(awLabel::RIGHT, awLabel::MIDDLE);
} else if($angle >= 225 and $angle < 315) {
$this->label->setAlign(awLabel::CENTER, awLabel::TOP);
} else {
$this->label->setAlign(awLabel::LEFT, awLabel::MIDDLE);
}
$this->label->draw(
$driver,
$point,
$key
);
}
}
/**
* Return margins around the component
*
* @return array Left, right, top and bottom margins
*/
public function getMargin() {
// Get axis informations
$leftAxis = $this->padding->left;
$rightAxis = $this->padding->right;
$topAxis = $this->padding->top;
$bottomAxis = $this->padding->bottom;
return array($leftAxis, $rightAxis, $topAxis, $bottomAxis);
}
/**
* Change values of Y axis
* This method ignores not numeric values
*
* @param array $values
*/
public function setValues($values) {
$this->checkArray($values);
$this->values = $values;
}
/**
* Return values of Y axis
*
* @return array
*/
public function getValues() {
return $this->values;
}
private function checkArray(&$array) {
if(is_array($array) === FALSE) {
awImage::drawError("Class Pie: You tried to set values that are not an array.");
}
foreach($array as $key => $value) {
if(is_numeric($value) === FALSE) {
unset($array[$key]);
}
}
if(count($array) < 1) {
awImage::drawError("Class Pie: Your graph must have at least 1 value.");
}
}
 
}
 
registerClass('Pie');
 
/**
* Pie
*
* @package Artichow
*/
class awPiePart implements awLegendable {
 
/**
* Pie part color
*
* @var Color
*/
protected $color;
 
/**
* Build a new awPiePart
*
* @param awColor $color Pie part color
*/
public function __construct(awColor $color) {
$this->color = $color;
}
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground() {
return $this->color;
}
 
/**
* Get the line thickness
*
* @return NULL
*/
public function getLegendLineThickness() {
}
 
/**
* Get the line type
*
* @return NULL
*/
public function getLegendLineStyle() {
}
 
/**
* Get the color of line
*
* @return NULL
*/
public function getLegendLineColor() {
}
 
/**
* Get a mark object
*
* @return NULL
*/
public function getLegendMark() {
}
 
}
 
registerClass('PiePart');
 
function callbackPerCent($value) {
return $value.'%';
}
?>
/trunk/bibliotheque/artichow/Pattern.class.php
New file
0,0 → 1,97
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Graph.class.php";
 
/**
* All patterns must derivate from this class
*
* @package Artichow
*/
abstract class awPattern {
 
/**
* Pattern arguments
*
* @var array
*/
protected $args = array();
/**
* Load a pattern
*
* @param string $pattern Pattern name
* @return Component
*/
public static function get($pattern) {
$file = ARTICHOW_PATTERN.DIRECTORY_SEPARATOR.$pattern.'.php';
if(is_file($file)) {
require_once $file;
$class = $pattern.'Pattern';
if(class_exists($class)) {
return new $class;
} else {
awImage::drawError("Class Pattern: Class '".$class."' does not exist.");
}
} else {
awImage::drawError("Class Pattern: Pattern '".$pattern."' does not exist.");
}
}
/**
* Change pattern argument
*
* @param string $name Argument name
* @param mixed $value Argument value
*/
public function setArg($name, $value) {
if(is_string($name)) {
$this->args[$name] = $value;
}
}
/**
* Get an argument
*
* @param string $name
* @param mixed $default Default value if the argument does not exist (default to NULL)
* @return mixed Argument value
*/
protected function getArg($name, $default = NULL) {
if(array_key_exists($name, $this->args)) {
return $this->args[$name];
} else {
return $default;
}
}
/**
* Change several arguments
*
* @param array $args New arguments
*/
public function setArgs($args) {
if(is_array($args)) {
foreach($args as $name => $value) {
$this->setArg($name, $value);
}
}
}
 
}
 
registerClass('Pattern', TRUE);
?>
/trunk/bibliotheque/artichow/Plot.class.php
New file
0,0 → 1,1464
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/Component.class.php";
/**
* Graph using X and Y axis
*
* @package Artichow
*/
abstract class awPlot extends awComponent {
/**
* Values for Y axis
*
* @var array
*/
protected $datay;
 
/**
* Values for X axis
*
* @var array
*/
protected $datax;
/**
* Grid properties
*
* @var Grid
*/
public $grid;
/**
* X axis
*
* @var Axis
*/
public $xAxis;
/**
* Y axis
*
* @var Axis
*/
public $yAxis;
/**
* Position of X axis
*
* @var int
*/
protected $xAxisPosition = awPlot::BOTTOM;
/**
* Set X axis on zero ?
*
* @var bool
*/
protected $xAxisZero = TRUE;
/**
* Set Y axis on zero ?
*
* @var bool
*/
protected $yAxisZero = FALSE;
/**
* Position of Y axis
*
* @var int
*/
protected $yAxisPosition = awPlot::LEFT;
/**
* Change min value for Y axis
*
* @var mixed
*/
private $yMin = NULL;
/**
* Change max value for Y axis
*
* @var mixed
*/
private $yMax = NULL;
/**
* Change min value for X axis
*
* @var mixed
*/
private $xMin = NULL;
/**
* Change max value for X axis
*
* @var mixed
*/
private $xMax = NULL;
/**
* Left axis
*
* @var int
*/
const LEFT = 'left';
/**
* Right axis
*
* @var int
*/
const RIGHT = 'right';
/**
* Top axis
*
* @var int
*/
const TOP = 'top';
/**
* Bottom axis
*
* @var int
*/
const BOTTOM = 'bottom';
/**
* Both left/right or top/bottom axis
*
* @var int
*/
const BOTH = 'both';
/**
* Build the plot
*
*/
public function __construct() {
parent::__construct();
$this->grid = new awGrid;
$this->grid->setBackgroundColor(new awWhite);
 
$this->padding->add(20, 0, 0, 20);
$this->xAxis = new awAxis;
$this->xAxis->addTick('major', new awTick(0, 5));
$this->xAxis->addTick('minor', new awTick(0, 3));
$this->xAxis->setTickStyle(awTick::OUT);
$this->xAxis->label->setFont(new awTuffy(7));
$this->yAxis = new awAxis;
$this->yAxis->auto(TRUE);
$this->yAxis->addTick('major', new awTick(0, 5));
$this->yAxis->addTick('minor', new awTick(0, 3));
$this->yAxis->setTickStyle(awTick::OUT);
$this->yAxis->setNumberByTick('minor', 'major', 3);
$this->yAxis->label->setFont(new awTuffy(7));
$this->yAxis->title->setAngle(90);
}
/**
* Get plot values
*
* @return array
*/
public function getValues() {
return $this->datay;
}
/**
* Reduce number of values in the plot
*
* @param int $number Reduce number of values to $number
*/
public function reduce($number) {
$count = count($this->datay);
$ratio = ceil($count / $number);
if($ratio > 1) {
$tmpy = $this->datay;
$datay = array();
$datax = array();
$cbLabel = $this->xAxis->label->getCallbackFunction();
for($i = 0; $i < $count; $i += $ratio) {
$slice = array_slice($tmpy, $i, $ratio);
$datay[] = array_sum($slice) / count($slice);
// Reduce data on X axis if needed
if($cbLabel !== NULL) {
$datax[] = $cbLabel($i + round($ratio / 2));
}
}
$this->setValues($datay);
if($cbLabel !== NULL) {
$this->xAxis->setLabelText($datax);
}
}
}
/**
* Count values in the plot
*
* @return int
*/
public function getXAxisNumber() {
list($min, $max) = $this->xAxis->getRange();
return ($max - $min + 1);
}
/**
* Change X axis
*
* @param int $axis
*/
public function setXAxis($axis) {
$this->xAxisPosition = $axis;
}
/**
* Get X axis
*
* @return int
*/
public function getXAxis() {
return $this->xAxisPosition;
}
/**
* Set X axis on zero
*
* @param bool $zero
*/
public function setXAxisZero($zero) {
$this->xAxisZero = (bool)$zero;
}
/**
* Set Y axis on zero
*
* @param bool $zero
*/
public function setYAxisZero($zero) {
$this->yAxisZero = (bool)$zero;
}
/**
* Change Y axis
*
* @param int $axis
*/
public function setYAxis($axis) {
$this->yAxisPosition = $axis;
}
/**
* Get Y axis
*
* @return int
*/
public function getYAxis() {
return $this->yAxisPosition;
}
/**
* Change min value for Y axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setYMin($value) {
$this->yMin = $value;
$this->yAxis->auto(FALSE);
$this->updateAxis();
}
/**
* Change max value for Y axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setYMax($value) {
$this->yMax = $value;
$this->yAxis->auto(FALSE);
$this->updateAxis();
}
/**
* Change min value for X axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setXMin($value) {
$this->xMin = $value;
$this->updateAxis();
}
/**
* Change max value for X axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setXMax($value) {
$this->xMax = $value;
$this->updateAxis();
}
/**
* Get min value for Y axis
*
* @return float $value
*/
public function getYMin() {
if($this->auto) {
if(is_null($this->yMin)) {
$min = array_min($this->datay);
if($min > 0) {
return 0;
}
}
}
return is_null($this->yMin) ? array_min($this->datay) : (float)$this->yMin;
}
/**
* Get max value for Y axis
*
* @return float $value
*/
public function getYMax() {
if($this->auto) {
if(is_null($this->yMax)) {
$max = array_max($this->datay);
if($max < 0) {
return 0;
}
}
}
return is_null($this->yMax) ? array_max($this->datay) : (float)$this->yMax;
}
/**
* Get min value for X axis
*
* @return float $value
*/
public function getXMin() {
return floor(is_null($this->xMin) ? array_min($this->datax) : $this->xMin);
}
/**
* Get max value for X axis
*
* @return float $value
*/
public function getXMax() {
return (ceil(is_null($this->xMax) ? array_max($this->datax) : (float)$this->xMax)) + ($this->getXCenter() ? 1 : 0);
}
/**
* Get min value with spaces for Y axis
*
* @return float $value
*/
public function getRealYMin() {
$min = $this->getYMin();
if($this->space->bottom !== NULL) {
$interval = ($this->getYMax() - $min) * $this->space->bottom / 100;
return $min - $interval;
} else {
return is_null($this->yMin) ? $min : (float)$this->yMin;
}
}
/**
* Get max value with spaces for Y axis
*
* @return float $value
*/
public function getRealYMax() {
$max = $this->getYMax();
if($this->space->top !== NULL) {
$interval = ($max - $this->getYMin()) * $this->space->top / 100;
return $max + $interval;
} else {
return is_null($this->yMax) ? $max : (float)$this->yMax;
}
}
public function init(awDriver $driver) {
list($x1, $y1, $x2, $y2) = $this->getPosition();
// Get space informations
list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
$this->xAxis->setPadding($leftSpace, $rightSpace);
if($this->space->bottom > 0 or $this->space->top > 0) {
list($min, $max) = $this->yAxis->getRange();
$interval = $max - $min;
$this->yAxis->setRange(
$min - $interval * $this->space->bottom / 100,
$max + $interval * $this->space->top / 100
);
}
// Auto-scaling mode
$this->yAxis->autoScale();
// Number of labels is not specified
if($this->yAxis->getLabelNumber() === NULL) {
$number = round(($y2 - $y1) / 75) + 2;
$this->yAxis->setLabelNumber($number);
}
$this->xAxis->line->setX($x1, $x2);
$this->yAxis->line->setY($y2, $y1);
// Set ticks
$this->xAxis->tick('major')->setNumber($this->getXAxisNumber());
$this->yAxis->tick('major')->setNumber($this->yAxis->getLabelNumber());
// Center X axis on zero
if($this->xAxisZero) {
$this->xAxis->setYCenter($this->yAxis, 0);
}
// Center Y axis on zero
if($this->yAxisZero) {
$this->yAxis->setXCenter($this->xAxis, 0);
}
// Set axis labels
$labels = array();
list($xMin, $xMax) = $this->xAxis->getRange();
for($i = $xMin; $i <= $xMax; $i++) {
$labels[] = $i;
}
$this->xAxis->label->set($labels);
parent::init($driver);
list($x1, $y1, $x2, $y2) = $this->getPosition();
list($leftSpace, $rightSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
// Create the grid
$this->createGrid();
// Draw the grid
$this->grid->setSpace($leftSpace, $rightSpace, 0, 0);
$this->grid->draw($driver, $x1, $y1, $x2, $y2);
}
public function drawEnvelope(awDriver $driver) {
list($x1, $y1, $x2, $y2) = $this->getPosition();
if($this->getXCenter()) {
$size = $this->xAxis->getDistance(0, 1);
$this->xAxis->label->move($size / 2, 0);
$this->xAxis->label->hideLast(TRUE);
}
// Draw top axis
if($this->xAxisPosition === awPlot::TOP or $this->xAxisPosition === awPlot::BOTH) {
$top = clone $this->xAxis;
if($this->xAxisZero === FALSE) {
$top->line->setY($y1, $y1);
}
$top->label->setAlign(NULL, awLabel::TOP);
$top->label->move(0, -3);
$top->title->move(0, -25);
$top->draw($driver);
}
// Draw bottom axis
if($this->xAxisPosition === awPlot::BOTTOM or $this->xAxisPosition === awPlot::BOTH) {
$bottom = clone $this->xAxis;
if($this->xAxisZero === FALSE) {
$bottom->line->setY($y2, $y2);
}
$bottom->label->setAlign(NULL, awLabel::BOTTOM);
$bottom->label->move(0, 3);
$bottom->reverseTickStyle();
$bottom->title->move(0, 25);
$bottom->draw($driver);
}
// Draw left axis
if($this->yAxisPosition === awPlot::LEFT or $this->yAxisPosition === awPlot::BOTH) {
$left = clone $this->yAxis;
if($this->yAxisZero === FALSE) {
$left->line->setX($x1, $x1);
}
$left->label->setAlign(awLabel::RIGHT);
$left->label->move(-6, 0);
$left->title->move(-25, 0);
$left->draw($driver);
}
// Draw right axis
if($this->yAxisPosition === awPlot::RIGHT or $this->yAxisPosition === awPlot::BOTH) {
$right = clone $this->yAxis;
if($this->yAxisZero === FALSE) {
$right->line->setX($x2, $x2);
}
$right->label->setAlign(awLabel::LEFT);
$right->label->move(6, 0);
$right->reverseTickStyle();
$right->title->move(25, 0);
$right->draw($driver);
}
}
protected function createGrid() {
$max = $this->getRealYMax();
$min = $this->getRealYMin();
 
$number = $this->yAxis->getLabelNumber() - 1;
if($number < 1) {
return;
}
// Horizontal lines of the grid
$h = array();
for($i = 0; $i <= $number; $i++) {
$h[] = $i / $number;
}
// Vertical lines
$major = $this->yAxis->tick('major');
$interval = $major->getInterval();
$number = $this->getXAxisNumber() - 1;
$w = array();
if($number > 0) {
for($i = 0; $i <= $number; $i++) {
if($i%$interval === 0) {
$w[] = $i / $number;
}
}
}
$this->grid->setGrid($w, $h);
}
/**
* Change values of Y axis
* This method ignores not numeric values
*
* @param array $datay
* @param array $datax
*/
public function setValues($datay, $datax = NULL) {
$this->checkArray($datay);
foreach($datay as $key => $value) {
unset($datay[$key]);
$datay[(int)$key] = $value;
}
if($datax === NULL) {
$datax = array();
for($i = 0; $i < count($datay); $i++) {
$datax[] = $i;
}
} else {
foreach($datax as $key => $value) {
unset($datax[$key]);
$datax[(int)$key] = $value;
}
}
$this->checkArray($datax);
if(count($datay) === count($datax)) {
// Set values
$this->datay = $datay;
$this->datax = $datax;
// Update axis with the new awvalues
$this->updateAxis();
} else {
awImage::drawError("Class Plot: Plots must have the same number of X and Y points.");
}
}
/**
* Return begin and end values
*
* @return array
*/
protected function getLimit() {
$i = 0;
while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) {
$i++;
}
$start = $i;
$i = count($this->datay) - 1;
while(array_key_exists($i, $this->datay) and $this->datay[$i] === NULL) {
$i--;
}
$stop = $i;
return array($start, $stop);
}
/**
* Return TRUE if labels must be centered on X axis, FALSE otherwise
*
* @return bool
*/
abstract public function getXCenter();
private function updateAxis() {
$this->xAxis->setRange(
$this->getXMin(),
$this->getXMax()
);
$this->yAxis->setRange(
$this->getRealYMin(),
$this->getRealYMax()
);
}
private function checkArray(&$array) {
if(is_array($array) === FALSE) {
awImage::drawError("Class Plot: You tried to set a value that is not an array.");
}
foreach($array as $key => $value) {
if(is_numeric($value) === FALSE and is_null($value) === FALSE) {
awImage::drawError("Class Plot: Expected numeric values for the plot.");
}
}
if(count($array) < 1) {
awImage::drawError("Class Plot: Your plot must have at least 1 value.");
}
}
 
}
 
registerClass('Plot', TRUE);
 
class awPlotAxis {
 
/**
* Left axis
*
* @var Axis
*/
public $left;
 
/**
* Right axis
*
* @var Axis
*/
public $right;
 
/**
* Top axis
*
* @var Axis
*/
public $top;
 
/**
* Bottom axis
*
* @var Axis
*/
public $bottom;
 
/**
* Build the group of axis
*/
public function __construct() {
$this->left = new awAxis;
$this->left->auto(TRUE);
$this->left->label->setAlign(awLabel::RIGHT);
$this->left->label->move(-6, 0);
$this->yAxis($this->left);
$this->left->setTickStyle(awTick::OUT);
$this->left->title->move(-25, 0);
$this->right = new awAxis;
$this->right->auto(TRUE);
$this->right->label->setAlign(awLabel::LEFT);
$this->right->label->move(6, 0);
$this->yAxis($this->right);
$this->right->setTickStyle(awTick::IN);
$this->right->title->move(25, 0);
$this->top = new awAxis;
$this->top->label->setAlign(NULL, awLabel::TOP);
$this->top->label->move(0, -3);
$this->xAxis($this->top);
$this->top->setTickStyle(awTick::OUT);
$this->top->title->move(0, -25);
$this->bottom = new awAxis;
$this->bottom->label->setAlign(NULL, awLabel::BOTTOM);
$this->bottom->label->move(0, 3);
$this->xAxis($this->bottom);
$this->bottom->setTickStyle(awTick::IN);
$this->bottom->title->move(0, 25);
}
protected function xAxis(awAxis $axis) {
$axis->addTick('major', new awTick(0, 5));
$axis->addTick('minor', new awTick(0, 3));
$axis->label->setFont(new awTuffy(7));
}
protected function yAxis(awAxis $axis) {
$axis->addTick('major', new awTick(0, 5));
$axis->addTick('minor', new awTick(0, 3));
$axis->setNumberByTick('minor', 'major', 3);
$axis->label->setFont(new awTuffy(7));
$axis->title->setAngle(90);
}
 
}
 
registerClass('PlotAxis');
 
/**
* A graph with axis can contain some groups of components
*
* @package Artichow
*/
class awPlotGroup extends awComponentGroup {
/**
* Grid properties
*
* @var Grid
*/
public $grid;
/**
* Left, right, top and bottom axis
*
* @var PlotAxis
*/
public $axis;
/**
* Set the X axis on zero
*
* @var bool
*/
protected $xAxisZero = TRUE;
/**
* Set the Y axis on zero
*
* @var bool
*/
protected $yAxisZero = FALSE;
/**
* Real axis used for Y axis
*
* @var string
*/
private $yRealAxis = awPlot::LEFT;
/**
* Real axis used for X axis
*
* @var string
*/
private $xRealAxis = awPlot::BOTTOM;
/**
* Change min value for Y axis
*
* @var mixed
*/
private $yMin = NULL;
/**
* Change max value for Y axis
*
* @var mixed
*/
private $yMax = NULL;
/**
* Change min value for X axis
*
* @var mixed
*/
private $xMin = NULL;
/**
* Change max value for X axis
*
* @var mixed
*/
private $xMax = NULL;
/**
* Build the PlotGroup
*
*/
public function __construct() {
parent::__construct();
$this->grid = new awGrid;
$this->grid->setBackgroundColor(new awWhite);
$this->axis = new awPlotAxis;
}
/**
* Set the X axis on zero or not
*
* @param bool $zero
*/
public function setXAxisZero($zero) {
$this->xAxisZero = (bool)$zero;
}
/**
* Set the Y axis on zero or not
*
* @param bool $zero
*/
public function setYAxisZero($zero) {
$this->yAxisZero = (bool)$zero;
}
/**
* Change min value for Y axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setYMin($value) {
$this->axis->left->auto(FALSE);
$this->axis->right->auto(FALSE);
$this->yMin = $value;
}
/**
* Change max value for Y axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setYMax($value) {
$this->axis->left->auto(FALSE);
$this->axis->right->auto(FALSE);
$this->yMax = $value;
}
/**
* Change min value for X axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setXMin($value) {
$this->xMin = $value;
}
/**
* Change max value for X axis
* Set NULL for auto selection.
*
* @param float $value
*/
public function setXMax($value) {
$this->xMax = $value;
}
/**
* Get min value for X axis
*
* @return float $value
*/
public function getXMin() {
return $this->getX('min');
}
/**
* Get max value for X axis
*
* @return float $value
*/
public function getXMax() {
return $this->getX('max');
}
private function getX($type) {
switch($type) {
case 'max' :
if($this->xMax !== NULL) {
return $this->xMax;
}
break;
case 'min' :
if($this->xMin !== NULL) {
return $this->xMin;
}
break;
}
$value = NULL;
$get = 'getX'.ucfirst($type);
for($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
if($value === NULL) {
$value = $component->$get();
} else {
$value = $type($value, $component->$get());
}
}
return $value;
}
/**
* Get min value with spaces for Y axis
*
* @param string $axis Axis name
* @return float $value
*/
public function getRealYMin($axis = NULL) {
if($axis === NULL) {
return NULL;
}
$min = $this->getRealY('min', $axis);
$max = $this->getRealY('max', $axis);
if($this->space->bottom !== NULL) {
$interval = ($min - $max) * $this->space->bottom / 100;
return $min + $interval;
} else {
return $min;
}
}
/**
* Get max value with spaces for Y axis
*
* @param string $axis Axis name
* @return float $value
*/
public function getRealYMax($axis = NULL) {
if($axis === NULL) {
return NULL;
}
$min = $this->getRealY('min', $axis);
$max = $this->getRealY('max', $axis);
if($this->space->top !== NULL) {
$interval = ($max - $min) * $this->space->top / 100;
return $max + $interval;
} else {
return $max;
}
}
private function getRealY($type, $axis) {
switch($type) {
case 'max' :
if($this->yMax !== NULL) {
return $this->yMax;
}
break;
case 'min' :
if($this->yMin !== NULL) {
return $this->yMin;
}
break;
}
$value = NULL;
$get = 'getY'.ucfirst($type);
for($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
switch($axis) {
case awPlot::LEFT :
case awPlot::RIGHT :
$test = ($component->getYAxis() === $axis);
break;
default :
$test = FALSE;
}
if($test) {
$auto = $component->yAxis->isAuto();
$this->axis->{$axis}->auto($auto);
if($value === NULL) {
$value = $component->$get();
} else {
$value = $type($value, $component->$get());
}
}
}
return $value;
}
public function init(awDriver $driver) {
list($x1, $y1, $x2, $y2) = $this->getPosition();
// Get PlotGroup space
list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
// Count values in the group
$values = $this->getXAxisNumber();
// Init the PlotGroup
$this->axis->top->line->setX($x1, $x2);
$this->axis->bottom->line->setX($x1, $x2);
$this->axis->left->line->setY($y2, $y1);
$this->axis->right->line->setY($y2, $y1);
$this->axis->top->setPadding($leftSpace, $rightSpace);
$this->axis->bottom->setPadding($leftSpace, $rightSpace);
$xMin = $this->getXMin();
$xMax = $this->getXMax();
$this->axis->top->setRange($xMin, $xMax);
$this->axis->bottom->setRange($xMin, $xMax);
for($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
$component->auto($this->auto);
// Copy space to the component
$component->setSpace($this->space->left, $this->space->right, $this->space->top, $this->space->bottom);
$component->xAxis->setPadding($leftSpace, $rightSpace);
$component->xAxis->line->setX($x1, $x2);
$component->yAxis->line->setY($y2, $y1);
}
// Set Y axis range
foreach(array('left', 'right') as $axis) {
if($this->isAxisUsed($axis)) {
$min = $this->getRealYMin($axis);
$max = $this->getRealYMax($axis);
$interval = $max - $min;
$this->axis->{$axis}->setRange(
$min - $interval * $this->space->bottom / 100,
$max + $interval * $this->space->top / 100
);
// Auto-scaling mode
if($this->axis->{$axis}->isAuto()) {
$this->axis->{$axis}->autoScale();
}
}
}
if($this->axis->left->getLabelNumber() === NULL) {
$number = round(($y2 - $y1) / 75) + 2;
$this->axis->left->setLabelNumber($number);
}
if($this->axis->right->getLabelNumber() === NULL) {
$number = round(($y2 - $y1) / 75) + 2;
$this->axis->right->setLabelNumber($number);
}
// Center labels on X axis if needed
$test = array(awPlot::TOP => FALSE, awPlot::BOTTOM => FALSE);
for($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
if($component->getValues() !== NULL) {
$axis = $component->getXAxis();
if($test[$axis] === FALSE) {
// Center labels for bar plots
if($component->getXCenter()) {
$size = $this->axis->{$axis}->getDistance(0, 1);
$this->axis->{$axis}->label->move($size / 2, 0);
$this->axis->{$axis}->label->hideLast(TRUE);
$test[$axis] = TRUE;
}
}
}
}
// Set axis labels
$labels = array();
for($i = $xMin; $i <= $xMax; $i++) {
$labels[] = $i;
}
if($this->axis->top->label->count() === 0) {
$this->axis->top->label->set($labels);
}
if($this->axis->bottom->label->count() === 0) {
$this->axis->bottom->label->set($labels);
}
// Set ticks
$this->axis->top->tick('major')->setNumber($values);
$this->axis->bottom->tick('major')->setNumber($values);
$this->axis->left->tick('major')->setNumber($this->axis->left->getLabelNumber());
$this->axis->right->tick('major')->setNumber($this->axis->right->getLabelNumber());
// Set X axis on zero
if($this->xAxisZero) {
$axis = $this->selectYAxis();
$this->axis->bottom->setYCenter($axis, 0);
$this->axis->top->setYCenter($axis, 0);
}
// Set Y axis on zero
if($this->yAxisZero) {
$axis = $this->selectXAxis();
$this->axis->left->setXCenter($axis, 1);
$this->axis->right->setXCenter($axis, 1);
}
parent::init($driver);
list($leftSpace, $rightSpace, $topSpace, $bottomSpace) = $this->getSpace($x2 - $x1, $y2 - $y1);
// Create the grid
$this->createGrid();
// Draw the grid
$this->grid->setSpace($leftSpace, $rightSpace, 0, 0);
$this->grid->draw($driver, $x1, $y1, $x2, $y2);
}
public function drawComponent(awDriver $driver, $x1, $y1, $x2, $y2, $aliasing) {
$xMin = $this->getXMin();
$xMax = $this->getXMax();
$maxLeft = $this->getRealYMax(awPlot::LEFT);
$maxRight = $this->getRealYMax(awPlot::RIGHT);
$minLeft = $this->getRealYMin(awPlot::LEFT);
$minRight = $this->getRealYMin(awPlot::RIGHT);
foreach($this->components as $component) {
$min = $component->getYMin();
$max = $component->getYMax();
// Set component minimum and maximum
if($component->getYAxis() === awPlot::LEFT) {
list($min, $max) = $this->axis->left->getRange();
$component->setYMin($min);
$component->setYMax($max);
} else {
list($min, $max) = $this->axis->right->getRange();
$component->setYMin($min);
$component->setYMax($max);
}
$component->setXAxisZero($this->xAxisZero);
$component->setYAxisZero($this->yAxisZero);
$component->xAxis->setRange($xMin, $xMax);
$component->drawComponent(
$driver,
$x1, $y1,
$x2, $y2,
$aliasing
);
$component->setYMin($min);
$component->setYMax($max);
}
}
public function drawEnvelope(awDriver $driver) {
list($x1, $y1, $x2, $y2) = $this->getPosition();
// Hide unused axis
foreach(array(awPlot::LEFT, awPlot::RIGHT, awPlot::TOP, awPlot::BOTTOM) as $axis) {
if($this->isAxisUsed($axis) === FALSE) {
$this->axis->{$axis}->hide(TRUE);
}
}
// Draw top axis
$top = $this->axis->top;
if($this->xAxisZero === FALSE) {
$top->line->setY($y1, $y1);
}
$top->draw($driver);
// Draw bottom axis
$bottom = $this->axis->bottom;
if($this->xAxisZero === FALSE) {
$bottom->line->setY($y2, $y2);
}
$bottom->draw($driver);
// Draw left axis
$left = $this->axis->left;
if($this->yAxisZero === FALSE) {
$left->line->setX($x1, $x1);
}
$left->draw($driver);
// Draw right axis
$right = $this->axis->right;
if($this->yAxisZero === FALSE) {
$right->line->setX($x2, $x2);
}
$right->draw($driver);
}
/**
* Is the specified axis used ?
*
* @param string $axis Axis name
* @return bool
*/
protected function isAxisUsed($axis) {
for($i = 0; $i < count($this->components); $i++) {
$component = $this->components[$i];
switch($axis) {
case awPlot::LEFT :
case awPlot::RIGHT :
if($component->getYAxis() === $axis) {
return TRUE;
}
break;
case awPlot::TOP :
case awPlot::BOTTOM :
if($component->getXAxis() === $axis) {
return TRUE;
}
break;
}
}
return FALSE;
}
protected function createGrid() {
$max = $this->getRealYMax(awPlot::LEFT);
$min = $this->getRealYMin(awPlot::RIGHT);
// Select axis (left if possible, right otherwise)
$axis = $this->selectYAxis();
$number = $axis->getLabelNumber() - 1;
if($number < 1) {
return;
}
// Horizontal lines of grid
$h = array();
for($i = 0; $i <= $number; $i++) {
$h[] = $i / $number;
}
// Vertical lines
$major = $axis->tick('major');
$interval = $major->getInterval();
$number = $this->getXAxisNumber() - 1;
$w = array();
if($number > 0) {
for($i = 0; $i <= $number; $i++) {
if($i%$interval === 0) {
$w[] = $i / $number;
}
}
}
$this->grid->setGrid($w, $h);
}
protected function selectYAxis(){
// Select axis (left if possible, right otherwise)
if($this->isAxisUsed(awPlot::LEFT)) {
$axis = $this->axis->left;
} else {
$axis = $this->axis->right;
}
return $axis;
}
protected function selectXAxis(){
// Select axis (bottom if possible, top otherwise)
if($this->isAxisUsed(awPlot::BOTTOM)) {
$axis = $this->axis->bottom;
} else {
$axis = $this->axis->top;
}
return $axis;
}
protected function getXAxisNumber() {
$offset = $this->components[0];
$max = $offset->getXAxisNumber();
for($i = 1; $i < count($this->components); $i++) {
$offset = $this->components[$i];
$max = max($max, $offset->getXAxisNumber());
}
return $max;
}
 
}
 
registerClass('PlotGroup');
?>
/trunk/bibliotheque/artichow/inc/Math.class.php
New file
0,0 → 1,832
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
abstract class awShape {
/**
* Is the shape hidden ?
*
* @var bool
*/
protected $hide = FALSE;
/**
* Shape style
*
* @var int
*/
public $style;
/**
* Shape thickness
*
* @var int
*/
public $thickness;
/**
* Solid shape
*
* @var int
*/
const SOLID = 1;
/**
* Dotted shape
*
* @var int
*/
const DOTTED = 2;
/**
* Dashed shape
*
* @var int
*/
const DASHED = 3;
/**
* Change shape style
*
* @param int $style Line style
*/
public function setStyle($style) {
$this->style = (int)$style;
}
/**
* Return shape style
*
* @return int
*/
public function getStyle() {
return $this->style;
}
/**
* Change shape thickness
*
* @param int $thickness Shape thickness in pixels
*/
public function setThickness($thickness) {
$this->thickness = (int)$thickness;
}
/**
* Return shape thickness
*
* @return int
*/
public function getThickness() {
return $this->thickness;
}
/**
* Hide the shape
*
* @param bool $hide
*/
public function hide($hide) {
$this->hide = (bool)$hide;
}
/**
* Show the shape
*
* @param bool $shape
*/
public function show($shape) {
$this->hide = (bool)!$shape;
}
/**
* Is the line hidden ?
*
* @return bool
*/
public function isHidden() {
return $this->hide;
}
}
 
registerClass('Shape', TRUE);
 
/**
* Describe a point
*
* @package Artichow
*/
class awPoint extends awShape {
 
/**
* X coord
*
* @var float
*/
public $x;
 
/**
* Y coord
*
* @var float
*/
public $y;
/**
* Build a new awpoint
*
* @param float $x
* @param float $y
*/
public function __construct($x, $y) {
$this->setLocation($x, $y);
}
/**
* Change X value
*
* @param float $x
*/
public function setX($x) {
$this->x = (float)$x;
}
/**
* Change Y value
*
* @param float $y
*/
public function setY($y) {
$this->y = (float)$y;
}
/**
* Change point location
*
* @param float $x
* @param float $y
*/
public function setLocation($x, $y) {
$this->setX($x);
$this->setY($y);
}
/**
* Get point location
*
* @param array Point location
*/
public function getLocation() {
return array($this->x, $this->y);
}
/**
* Get distance to another point
*
* @param awPoint $p A point
* @return float
*/
public function getDistance(awPoint $p) {
return sqrt(pow($p->x - $this->x, 2) + pow($p->y - $this->y, 2));
}
/**
* Move the point to another location
*
* @param Point A Point with the new awlocation
*/
public function move($x, $y) {
return new awPoint(
$this->x + $x,
$this->y + $y
);
}
 
}
 
registerClass('Point');
 
/**
* Describe a line
*
* @package Artichow
*/
class awLine extends awShape {
 
/**
* Line first point
*
* @param Point
*/
public $p1;
 
/**
* Line second point
*
* @param Point
*/
public $p2;
/**
* The line slope (the m in y = mx + p)
*
* @param float
*/
private $slope;
/**
* The y-intercept value of the line (the p in y = mx + p)
*
* @param float
*/
private $origin;
/**
* Build a new awline
*
* @param awPoint $p1 First point
* @param awPoint $p2 Second point
* @param int $type Style of line (default to solid)
* @param int $thickness Line thickness (default to 1)
*/
public function __construct($p1 = NULL, $p2 = NULL, $type = awLine::SOLID, $thickness = 1) {
$this->setLocation($p1, $p2);
$this->setStyle($type);
$this->setThickness($thickness);
}
/**
* Build a line from 4 coords
*
* @param int $x1 Left position
* @param int $y1 Top position
* @param int $x2 Right position
* @param int $y2 Bottom position
*/
public static function build($x1, $y1, $x2, $y2) {
return new awLine(
new awPoint($x1, $y1),
new awPoint($x2, $y2)
);
}
/**
* Change X values of the line
*
* @param int $x1 Begin value
* @param int $x2 End value
*/
public function setX($x1, $x2) {
$this->p1->setX($x1);
$this->p2->setX($x2);
// Resets slope and origin values so they are
// recalculated when and if needed.
$this->slope = NULL;
$this->origin = NULL;
}
/**
* Change Y values of the line
*
* @param int $y1 Begin value
* @param int $y2 End value
*/
public function setY($y1, $y2) {
$this->p1->setY($y1);
$this->p2->setY($y2);
// Resets slope and origin values so they are
// recalculated when and if needed.
$this->slope = NULL;
$this->origin = NULL;
}
/**
* Change line location
*
* @param awPoint $p1 First point
* @param awPoint $p2 Second point
*/
public function setLocation($p1, $p2) {
if(is_null($p1) or $p1 instanceof awPoint) {
$this->p1 = $p1;
}
if(is_null($p2) or $p2 instanceof awPoint) {
$this->p2 = $p2;
}
// Resets slope and origin values so they are
// recalculated when and if needed.
$this->slope = NULL;
$this->origin = NULL;
}
/**
* Get line location
*
* @param array Line location
*/
public function getLocation() {
return array($this->p1, $this->p2);
}
/**
* Get the line size
*
* @return float
*/
public function getSize() {
$square = pow($this->p2->x - $this->p1->x, 2) + pow($this->p2->y - $this->p1->y, 2);
return sqrt($square);
}
/**
* Calculate the line slope
*
*/
private function calculateSlope() {
if($this->isHorizontal()) {
$this->slope = 0;
} else {
$slope = ($this->p1->y - $this->p2->y) / ($this->p1->x - $this->p2->x);
$this->slope = $slope;
}
}
/**
* Calculate the y-intercept value of the line
*
*/
private function calculateOrigin() {
if($this->isHorizontal()) {
$this->origin = $this->p1->y; // Or p2->y
} else {
$y1 = $this->p1->y;
$y2 = $this->p2->y;
$x1 = $this->p1->x;
$x2 = $this->p2->x;
$origin = ($y2 * $x1 - $y1 * $x2) / ($x1 - $x2);
$this->origin = $origin;
}
}
/**
* Calculate the slope and y-intercept value of the line
*
*/
private function calculateEquation() {
$this->calculateSlope();
$this->calculateOrigin();
}
/**
* Get the line slope value
*
* @return float
*/
public function getSlope() {
if($this->isVertical()) {
return NULL;
} elseif($this->slope !== NULL) {
return $this->slope;
} else {
$this->calculateSlope();
return $this->slope;
}
}
/**
* Get the line y-intercept value
*
* @return float
*/
public function getOrigin() {
if($this->isVertical()) {
return NULL;
} elseif($this->origin !== NULL) {
return $this->origin;
} else {
$this->calculateOrigin();
return $this->origin;
}
}
/**
* Get the line equation
*
* @return array An array containing the slope and y-intercept value of the line
*/
public function getEquation() {
$slope = $this->getSlope();
$origin = $this->getOrigin();
return array($slope, $origin);
}
/**
* Return the x coordinate of a point on the line
* given its y coordinate.
*
* @param float $y The y coordinate of the Point
* @return float $x The corresponding x coordinate
*/
public function getXFrom($y) {
$x = NULL;
if($this->isVertical()) {
list($p, ) = $this->getLocation();
$x = $p->x;
} else {
list($slope, $origin) = $this->getEquation();
if($slope !== 0) {
$y = (float)$y;
$x = ($y - $origin) / $slope;
}
}
return $x;
}
/**
* Return the y coordinate of a point on the line
* given its x coordinate.
*
* @param float $x The x coordinate of the Point
* @return float $y The corresponding y coordinate
*/
public function getYFrom($x) {
$y = NULL;
if($this->isHorizontal()) {
list($p, ) = $this->getLocation();
$y = $p->y;
} else {
list($slope, $origin) = $this->getEquation();
if($slope !== NULL) {
$x = (float)$x;
$y = $slope * $x + $origin;
}
}
return $y;
}
/**
* Test if the line can be considered as a point
*
* @return bool
*/
public function isPoint() {
return ($this->p1->x === $this->p2->x and $this->p1->y === $this->p2->y);
}
/**
* Test if the line is a vertical line
*
* @return bool
*/
public function isVertical() {
return ($this->p1->x === $this->p2->x);
}
/**
* Test if the line is an horizontal line
*
* @return bool
*/
public function isHorizontal() {
return ($this->p1->y === $this->p2->y);
}
/**
* Returns TRUE if the line is going all the way from the top
* to the bottom of the polygon surrounding box.
*
* @param $polygon Polygon A Polygon object
* @return bool
*/
public function isTopToBottom(awPolygon $polygon) {
list($xMin, $xMax) = $polygon->getBoxXRange();
list($yMin, $yMax) = $polygon->getBoxYRange();
if($this->isHorizontal()) {
return FALSE;
} else {
if($this->p1->y < $this->p2->y) {
$top = $this->p1;
$bottom = $this->p2;
} else {
$top = $this->p2;
$bottom = $this->p1;
}
return (
$this->isOnBoxTopSide($top, $xMin, $xMax, $yMin)
and
$this->isOnBoxBottomSide($bottom, $xMin, $xMax, $yMax)
);
}
}
/**
* Returns TRUE if the line is going all the way from the left side
* to the right side of the polygon surrounding box.
*
* @param $polygon Polygon A Polygon object
* @return bool
*/
public function isLeftToRight(awPolygon $polygon) {
list($xMin, $xMax) = $polygon->getBoxXRange();
list($yMin, $yMax) = $polygon->getBoxYRange();
if($this->isVertical()) {
return FALSE;
} else {
if($this->p1->x < $this->p2->x) {
$left = $this->p1;
$right = $this->p2;
} else {
$left = $this->p2;
$right = $this->p1;
}
}
return (
$this->isOnBoxLeftSide($left, $yMin, $yMax, $xMin)
and
$this->isOnBoxRightSide($right, $yMin, $yMax, $xMax)
);
}
private function isOnBoxTopSide(awPoint $point, $xMin, $xMax, $yMin) {
if(
$point->y === $yMin
and
$point->x >= $xMin
and
$point->x <= $xMax
) {
return TRUE;
} else {
return FALSE;
}
}
 
private function isOnBoxBottomSide(awPoint $point, $xMin, $xMax, $yMax) {
if(
$point->y === $yMax
and
$point->x >= $xMin
and
$point->x <= $xMax
) {
return TRUE;
} else {
return FALSE;
}
}
private function isOnBoxLeftSide(awPoint $point, $yMin, $yMax, $xMin) {
if(
$point->x === $xMin
and
$point->y >= $yMin
and
$point->y <= $yMax
) {
return TRUE;
} else {
return FALSE;
}
}
private function isOnBoxRightSide(awPoint $point, $yMin, $yMax, $xMax) {
if(
$point->x === $xMax
and
$point->y >= $yMin
and
$point->y <= $yMax
) {
return TRUE;
} else {
return FALSE;
}
}
}
 
registerClass('Line');
 
/**
* A vector is a type of line
* The sense of the vector goes from $p1 to $p2.
*
* @package Artichow
*/
class awVector extends awLine {
/**
* Get vector angle in radians
*
* @return float
*/
public function getAngle() {
if($this->isPoint()) {
return 0.0;
}
$size = $this->getSize();
$width = ($this->p2->x - $this->p1->x);
$height = ($this->p2->y - $this->p1->y) * -1;
if($width >= 0 and $height >= 0) {
return acos($width / $size);
} else if($width <= 0 and $height >= 0) {
return acos($width / $size);
} else {
$height *= -1;
if($width >= 0 and $height >= 0) {
return 2 * M_PI - acos($width / $size);
} else if($width <= 0 and $height >= 0) {
return 2 * M_PI - acos($width / $size);
}
}
}
 
}
 
registerClass('Vector');
 
/**
* Describe a polygon
*
* @package Artichow
*/
class awPolygon extends awShape {
 
/**
* Polygon points
*
* @var array
*/
protected $points = array();
 
/**
* Set a point in the polygon
*
* @param int $pos Point position
* @param awPoint $point
*/
public function set($pos, $point) {
if(is_null($point) or $point instanceof awPoint) {
$this->points[$pos] = $point;
}
}
/**
* Add a point at the end of the polygon
*
* @param awPoint $point
*/
public function append($point) {
if(is_null($point) or $point instanceof awPoint) {
$this->points[] = $point;
}
}
/**
* Get a point at a position in the polygon
*
* @param int $pos Point position
* @return Point
*/
public function get($pos) {
return $this->points[$pos];
}
/**
* Count number of points in the polygon
*
* @return int
*/
public function count() {
return count($this->points);
}
/**
* Returns all points in the polygon
*
* @return array
*/
public function all() {
return $this->points;
}
/**
* Returns the different lines formed by the polygon vertices
*
* @return array
*/
public function getLines() {
$lines = array();
$count = $this->count();
for($i = 0; $i < $count - 1; $i++) {
$lines[] = new Line($this->get($i), $this->get($i + 1));
}
// "Close" the polygon
$lines[] = new Line($this->get($count - 1), $this->get(0));
 
return $lines;
}
/**
* Get the upper-left and lower-right points
* of the bounding box around the polygon
*
* @return array An array of two Point objects
*/
public function getBoxPoints() {
$count = $this->count();
$x = $y = array();
for($i = 0; $i < $count; $i++) {
$point = $this->get($i);
list($x[], $y[]) = $point->getLocation();
}
$upperLeft = new Point(min($x), min($y));
$lowerRight = new Point(max($x), max($y));
return array($upperLeft, $lowerRight);
}
/**
* Return the range of the polygon on the y axis,
* i.e. the minimum and maximum y value of any point in the polygon
*
* @return array
*/
public function getBoxYRange() {
list($p1, $p2) = $this->getBoxPoints();
list(, $yMin) = $p1->getLocation();
list(, $yMax) = $p2->getLocation();
return array($yMin, $yMax);
}
/**
* Return the range of the polygon on the x axis,
* i.e. the minimum and maximum x value of any point in the polygon
*
* @return array
*/
public function getBoxXRange() {
list($p1, $p2) = $this->getBoxPoints();
list($xMin, ) = $p1->getLocation();
list($xMax, ) = $p2->getLocation();
return array($xMin, $xMax);
}
 
}
 
registerClass('Polygon');
?>
/trunk/bibliotheque/artichow/inc/Mark.class.php
New file
0,0 → 1,490
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Draw marks
*
* @package Artichow
*/
class awMark {
 
/**
* Circle mark
*
* @var int
*/
const CIRCLE = 1;
 
/**
* Square mark
*
* @var int
*/
const SQUARE = 2;
 
/**
* Triangle mark
*
* @var int
*/
const TRIANGLE = 3;
/**
* Inverted triangle mark
*
* @var int
*/
const INVERTED_TRIANGLE = 4;
 
/**
* Rhombus mark
*
* @var int
*/
const RHOMBUS = 5;
 
/**
* Cross (X) mark
*
* @var int
*/
const CROSS = 6;
 
/**
* Plus mark
*
* @var int
*/
const PLUS = 7;
 
/**
* Image mark
*
* @var int
*/
const IMAGE = 8;
 
/**
* Star mark
*
* @var int
*/
const STAR = 9;
 
/**
* Paperclip mark
*
* @var int
*/
const PAPERCLIP = 10;
 
/**
* Book mark
*
* @var int
*/
const BOOK = 11;
 
/**
* Must marks be hidden ?
*
* @var bool
*/
protected $hide;
 
/**
* Mark type
*
* @var int
*/
protected $type;
 
/**
* Mark size
*
* @var int
*/
protected $size = 8;
 
/**
* Fill mark
*
* @var Color, Gradient
*/
protected $fill;
 
/**
* Mark image
*
* @var Image
*/
protected $image;
 
/**
* To draw marks
*
* @var Driver
*/
protected $driver;
 
/**
* Move position from this vector
*
* @var Point
*/
protected $move;
/**
* Marks border
*
* @var Border
*/
public $border;
 
/**
* Build the mark
*/
public function __construct() {
$this->fill = new awColor(255, 0, 0, 0);
$this->border = new awBorder;
$this->border->hide();
$this->move = new awPoint(0, 0);
}
/**
* Change mark position
*
* @param int $x Add this interval to X coord
* @param int $y Add this interval to Y coord
*/
public function move($x, $y) {
$this->move = $this->move->move($x, $y);
}
/**
* Hide marks ?
*
* @param bool $hide TRUE to hide marks, FALSE otherwise
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Show marks ?
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = (bool)!$show;
}
/**
* Change mark type
*
* @param int $size Size in pixels
*/
public function setSize($size) {
$this->size = (int)$size;
}
/**
* Change mark type
*
* @param int $type New mark type
* @param int $size Mark size (can be NULL)
*/
public function setType($type, $size = NULL) {
$this->type = (int)$type;
if($size !== NULL) {
$this->setSize($size);
}
}
/**
* Fill the mark with a color or a gradient
*
* @param mixed $fill A color or a gradient
*/
public function setFill($fill) {
if($fill instanceof awColor or $fill instanceof awGradient) {
$this->fill = $fill;
}
}
/**
* Set an image
* Only for awMark::IMAGE type.
*
* @param Image An image
*/
public function setImage(awImage $image) {
$this->image = $image;
}
/**
* Draw the mark
*
* @param awDriver $driver
* @param awPoint $point Mark center
*/
public function draw(awDriver $driver, awPoint $point) {
// Hide marks ?
if($this->hide) {
return;
}
// Check if we can print marks
if($this->type !== NULL) {
$this->driver = $driver;
$realPoint = $this->move->move($point->x, $point->y);
switch($this->type) {
case awMark::CIRCLE :
$this->drawCircle($realPoint);
break;
case awMark::SQUARE :
$this->drawSquare($realPoint);
break;
case awMark::TRIANGLE :
$this->drawTriangle($realPoint);
break;
 
case awMark::INVERTED_TRIANGLE :
$this->drawTriangle($realPoint, TRUE);
break;
case awMark::RHOMBUS :
$this->drawRhombus($realPoint);
break;
 
case awMark::CROSS :
$this->drawCross($realPoint);
break;
case awMark::PLUS :
$this->drawCross($realPoint, TRUE);
break;
case awMark::IMAGE :
$this->drawImage($realPoint);
break;
case awMark::STAR :
$this->changeType('star');
$this->draw($driver, $point);
break;
case awMark::PAPERCLIP :
$this->changeType('paperclip');
$this->draw($driver, $point);
break;
case awMark::BOOK :
$this->changeType('book');
$this->draw($driver, $point);
break;
}
}
}
protected function changeType($image) {
$this->setType(awMARK::IMAGE);
$this->setImage(new awFileImage(ARTICHOW_IMAGE.DIRECTORY_SEPARATOR.$image.'.png'));
}
protected function drawCircle(awPoint $point) {
$this->driver->filledEllipse(
$this->fill,
$point,
$this->size, $this->size
);
$this->border->ellipse(
$this->driver,
$point,
$this->size, $this->size
);
}
protected function drawSquare(awPoint $point) {
list($x, $y) = $point->getLocation();
$x1 = (int)($x - $this->size / 2);
$x2 = $x1 + $this->size;
$y1 = (int)($y - $this->size / 2);
$y2 = $y1 + $this->size;
$this->border->rectangle($this->driver, new awPoint($x1, $y1), new awPoint($x2, $y2));
$size = $this->border->visible() ? 1 : 0;
$this->driver->filledRectangle(
$this->fill,
new awLine(
new awPoint($x1 + $size, $y1 + $size),
new awPoint($x2 - $size, $y2 - $size)
)
);
}
protected function drawTriangle(awPoint $point, $inverted = FALSE) {
list($x, $y) = $point->getLocation();
$size = $this->size;
$triangle = new awPolygon;
// Set default style and thickness
$triangle->setStyle(awPolygon::SOLID);
$triangle->setThickness(1);
if($inverted === TRUE) {
// Bottom of the triangle
$triangle->append(new awPoint($x, $y + $size / sqrt(3)));
// Upper left corner
$triangle->append(new awPoint($x - $size / 2, $y - $size / (2 * sqrt(3))));
 
// Upper right corner
$triangle->append(new awPoint($x + $size / 2, $y - $size / (2 * sqrt(3))));
} else {
// Top of the triangle
$triangle->append(new awPoint($x, $y - $size / sqrt(3)));
// Lower left corner
$triangle->append(new awPoint($x - $size / 2, $y + $size / (2 * sqrt(3))));
// Lower right corner
$triangle->append(new awPoint($x + $size / 2, $y + $size / (2 * sqrt(3))));
}
 
$this->driver->filledPolygon($this->fill, $triangle);
if($this->border->visible()) {
$this->border->polygon($this->driver, $triangle);
}
}
protected function drawRhombus(awPoint $point) {
list($x, $y) = $point->getLocation();
 
$rhombus = new awPolygon;
// Set default style and thickness
$rhombus->setStyle(awPolygon::SOLID);
$rhombus->setThickness(1);
// Top of the rhombus
$rhombus->append(new awPoint($x, $y - $this->size / 2));
// Right of the rhombus
$rhombus->append(new awPoint($x + $this->size / 2, $y));
// Bottom of the rhombus
$rhombus->append(new awPoint($x, $y + $this->size / 2));
// Left of the rhombus
$rhombus->append(new awPoint($x - $this->size / 2, $y));
$this->driver->filledPolygon($this->fill, $rhombus);
if($this->border->visible()) {
$this->border->polygon($this->driver, $rhombus);
}
}
protected function drawCross(awPoint $point, $upright = FALSE) {
list($x, $y) = $point->getLocation();
 
if($upright === TRUE) {
$x11 = (int)($x);
$y11 = (int)($y - $this->size / 2);
$x12 = (int)($x);
$y12 = (int)($y + $this->size / 2);
$y21 = (int)($y);
$y22 = (int)($y);
} else {
$x11 = (int)($x - $this->size / 2);
$y11 = (int)($y + $this->size / 2);
$x12 = (int)($x + $this->size / 2);
$y12 = (int)($y - $this->size / 2);
 
$y21 = (int)($y - $this->size / 2);
$y22 = (int)($y + $this->size / 2);
}
$x21 = (int)($x - $this->size / 2);
$x22 = (int)($x + $this->size / 2);
$this->driver->line(
$this->fill,
new awLine(
new awPoint($x11, $y11),
new awPoint($x12, $y12)
)
);
$this->driver->line(
$this->fill,
new awLine(
new awPoint($x21, $y21),
new awPoint($x22, $y22)
)
);
}
 
protected function drawImage(awPoint $point) {
if($this->image instanceof awImage) {
$width = $this->image->width;
$height = $this->image->height;
list($x, $y) = $point->getLocation();
$x1 = (int)($x - $width / 2);
$x2 = $x1 + $width;
$y1 = (int)($y - $width / 2);
$y2 = $y1 + $height;
$this->border->rectangle($this->driver, new awPoint($x1 - 1, $y1 - 1), new awPoint($x2 + 1, $y2 + 1));
$this->driver->copyImage($this->image, new awPoint($x1, $y1), new awPoint($x2, $y2));
}
}
 
}
 
registerClass('Mark');
?>
/trunk/bibliotheque/artichow/inc/Tick.class.php
New file
0,0 → 1,344
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Handle ticks
*
* @package Artichow
*/
class awTick {
 
/**
* Ticks style
*
* @var int
*/
protected $style = awTick::IN;
 
/**
* Ticks size
*
* @var int
*/
protected $size;
 
/**
* Ticks color
*
* @var Color
*/
protected $color;
 
/**
* Ticks number
*
* @var int
*/
protected $number;
 
/**
* Ticks number by other tick
*
* @var array
*/
protected $numberByTick;
 
/**
* Ticks interval
*
* @var int
*/
protected $interval = 1;
 
/**
* Hide ticks
*
* @var bool
*/
protected $hide = FALSE;
 
/**
* Hide first tick
*
* @var bool
*/
protected $hideFirst = FALSE;
 
/**
* Hide last tick
*
* @var bool
*/
protected $hideLast = FALSE;
/**
* In mode
*
* @param int
*/
const IN = 0;
/**
* Out mode
*
* @param int
*/
const OUT = 1;
/**
* In and out mode
*
* @param int
*/
const IN_OUT = 2;
/**
* Build the ticks
*
* @param int $number Number of ticks
* @param int $size Ticks size
*/
public function __construct($number, $size) {
$this->setSize($size);
$this->setNumber($number);
$this->setColor(new awBlack);
$this->style = awTick::IN;
}
/**
* Change ticks style
*
* @param int $style
*/
public function setStyle($style) {
$this->style = (int)$style;
}
/**
* Get ticks style
*
* @return int
*/
public function getStyle() {
return $this->style;
}
/**
* Change ticks color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Change ticks size
*
* @param int $size
*/
public function setSize($size) {
$this->size = (int)$size;
}
/**
* Change interval of ticks
*
* @param int $interval
*/
public function setInterval($interval) {
$this->interval = (int)$interval;
}
/**
* Get interval between each tick
*
* @return int
*/
public function getInterval() {
return $this->interval;
}
/**
* Change number of ticks
*
* @param int $number
*/
public function setNumber($number) {
$this->number = (int)$number;
}
/**
* Get number of ticks
*
* @return int
*/
public function getNumber() {
return $this->number;
}
/**
* Change number of ticks relative to others ticks
*
* @param awTick $tick Ticks reference
* @param int $number Number of ticks
*/
public function setNumberByTick(awTick $tick, $number) {
$this->numberByTick = array($tick, (int)$number);
}
/**
* Hide ticks
*
* @param bool $hide
*/
public function hide($hide) {
$this->hide = (bool)$hide;
}
/**
* Hide first tick
*
* @param bool $hide
*/
public function hideFirst($hide) {
$this->hideFirst = (bool)$hide;
}
/**
* Hide last tick
*
* @param bool $hide
*/
public function hideLast($hide) {
$this->hideLast = (bool)$hide;
}
/**
* Draw ticks on a vector
*
* @param awDriver $driver A driver
* @param awVector $vector A vector
*/
public function draw(awDriver $driver, awVector $vector) {
if($this->numberByTick !== NULL) {
list($tick, $number) = $this->numberByTick;
$this->number = 1 + ($tick->getNumber() - 1) * ($number + 1);
$this->interval = $tick->getInterval();
}
if($this->number < 2 or $this->hide) {
return;
}
$angle = $vector->getAngle();
// echo "INIT:".$angle."<br>";
switch($this->style) {
case awTick::IN :
$this->drawTicks($driver, $vector, NULL, $angle + M_PI / 2);
break;
case awTick::OUT :
$this->drawTicks($driver, $vector, $angle + 3 * M_PI / 2, NULL);
break;
default :
$this->drawTicks($driver, $vector, $angle + M_PI / 2, $angle + 3 * M_PI / 2);
break;
}
}
protected function drawTicks(awDriver $driver, awVector $vector, $from, $to) {
// Draw last tick
if($this->hideLast === FALSE) {
//echo '<b>';
if(($this->number - 1) % $this->interval === 0) {
$this->drawTick($driver, $vector->p2, $from, $to);
}
//echo '</b>';
}
$number = $this->number - 1;
$size = $vector->getSize();
// Get tick increment in pixels
$inc = $size / $number;
// Check if we must hide the first tick
$start = $this->hideFirst ? $inc : 0;
$stop = $inc * $number;
$position = 0;
for($i = $start; round($i, 6) < $stop; $i += $inc) {
if($position % $this->interval === 0) {
$p = $vector->p1->move(
round($i * cos($vector->getAngle()), 6),
round($i * sin($vector->getAngle() * -1), 6)
);
$this->drawTick($driver, $p, $from, $to);
}
$position++;
}
//echo '<br><br>';
}
protected function drawTick(awDriver $driver, awPoint $p, $from, $to) {
// echo $this->size.':'.$angle.'|<b>'.cos($angle).'</b>/';
// The round avoid some errors in the calcul
// For example, 12.00000008575245 becomes 12
$p1 = $p;
$p2 = $p;
if($from !== NULL) {
$p1 = $p1->move(
round($this->size * cos($from), 6),
round($this->size * sin($from) * -1, 6)
);
}
if($to !== NULL) {
$p2 = $p2->move(
round($this->size * cos($to), 6),
round($this->size * sin($to) * -1, 6)
);
}
//echo $p1->x.':'.$p2->x.'('.$p1->y.':'.$p2->y.')'.'/';
$vector = new awVector(
$p1, $p2
);
$driver->line(
$this->color,
$vector
);
}
 
}
 
registerClass('Tick');
?>
/trunk/bibliotheque/artichow/inc/Driver.class.php
New file
0,0 → 1,725
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Draw your objects
*
* @package Artichow
*/
abstract class awDriver {
/**
* Image width
*
* @var int
*/
public $imageWidth;
/**
* Image height
*
* @var int
*/
public $imageHeight;
/**
* Driver X position
*
* @var int
*/
public $x;
/**
* Driver Y position
*
* @var int
*/
public $y;
/**
* Use anti-aliasing ?
*
* @var bool
*/
protected $antiAliasing = FALSE;
/**
* The FontDriver object that will be used to draw text
* with PHP fonts.
*
* @var awPHPFontDriver
*/
protected $phpFontDriver;
/**
* The FontDriver object that will be used to draw text
* with TTF or FDB fonts.
*
* @var awFileFontDriver
*/
protected $fileFontDriver;
/**
* A string representing the type of the driver
*
* @var string
*/
protected $driverString;
 
private $w;
private $h;
public function __construct() {
$this->phpFontDriver = new awPHPFontDriver();
$this->fileFontDriver = new awFileFontDriver();
}
 
/**
* Initialize the driver for a particular awImage object
*
* @param awImage $image
*/
abstract public function init(awImage $image);
/**
* Initialize the Driver for a particular FileImage object
*
* @param awFileImage $fileImage The FileImage object to work on
* @param string $file Image filename
*/
abstract public function initFromFile(awFileImage $fileImage, $file);
/**
* Change the image size
*
* @param int $width Image width
* @param int $height Image height
*/
abstract public function setImageSize($width, $height);
/**
* Inform the driver of the position of your image
*
* @param float $x Position on X axis of the center of the component
* @param float $y Position on Y axis of the center of the component
*/
abstract public function setPosition($x, $y);
/**
* Inform the driver of the position of your image
* This method need absolutes values
*
* @param int $x Left-top corner X position
* @param int $y Left-top corner Y position
*/
abstract public function setAbsPosition($x, $y);
/**
* Move the position of the image
*
* @param int $x Add this value to X axis
* @param int $y Add this value to Y axis
*/
abstract public function movePosition($x, $y);
/**
* Inform the driver of the size of your image
* Height and width must be between 0 and 1.
*
* @param int $w Image width
* @param int $h Image height
* @return array Absolute width and height of the image
*/
abstract public function setSize($w, $h);
/**
* Inform the driver of the size of your image
* You can set absolute size with this method.
*
* @param int $w Image width
* @param int $h Image height
*/
abstract public function setAbsSize($w, $h);
/**
* Get the size of the component handled by the driver
*
* @return array Absolute width and height of the component
*/
abstract public function getSize();
/**
* Turn antialiasing on or off
*
* @var bool $bool
*/
abstract public function setAntiAliasing($bool);
/**
* When passed a Color object, returns the corresponding
* color identifier (driver dependant).
*
* @param awColor $color A Color object
* @return int $rgb A color identifier representing the color composed of the given RGB components
*/
abstract public function getColor(awColor $color);
/**
* Draw an image here
*
* @param awImage $image Image
* @param int $p1 Image top-left point
* @param int $p2 Image bottom-right point
*/
abstract public function copyImage(awImage $image, awPoint $p1, awPoint $p2);
/**
* Draw an image here
*
* @param awImage $image Image
* @param int $d1 Destination top-left position
* @param int $d2 Destination bottom-right position
* @param int $s1 Source top-left position
* @param int $s2 Source bottom-right position
* @param bool $resample Resample image ? (default to TRUE)
*/
abstract public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE);
/**
* Draw a string
*
* @var awText $text Text to print
* @param awPoint $point Draw the text at this point
* @param int $width Text max width
*/
abstract public function string(awText $text, awPoint $point, $width = NULL);
/**
* Draw a pixel
*
* @param awColor $color Pixel color
* @param awPoint $p
*/
abstract public function point(awColor $color, awPoint $p);
/**
* Draw a colored line
*
* @param awColor $color Line color
* @param awLine $line
* @param int $thickness Line tickness
*/
abstract public function line(awColor $color, awLine $line);
/**
* Draw a color arc
* @param awColor $color Arc color
* @param awPoint $center Point center
* @param int $width Ellipse width
* @param int $height Ellipse height
* @param int $from Start angle
* @param int $to End angle
*/
abstract public function arc(awColor $color, awPoint $center, $width, $height, $from, $to);
/**
* Draw an arc with a background color
*
* @param awColor $color Arc background color
* @param awPoint $center Point center
* @param int $width Ellipse width
* @param int $height Ellipse height
* @param int $from Start angle
* @param int $to End angle
*/
abstract public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to);
/**
* Draw a colored ellipse
*
* @param awColor $color Ellipse color
* @param awPoint $center Ellipse center
* @param int $width Ellipse width
* @param int $height Ellipse height
*/
abstract public function ellipse(awColor $color, awPoint $center, $width, $height);
/**
* Draw an ellipse with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param awPoint $center Ellipse center
* @param int $width Ellipse width
* @param int $height Ellipse height
*/
abstract public function filledEllipse($background, awPoint $center, $width, $height);
/**
* Draw a colored rectangle
*
* @param awColor $color Rectangle color
* @param awLine $line Rectangle diagonale
* @param awPoint $p2
*/
abstract public function rectangle(awColor $color, awLine $line);
/**
* Draw a rectangle with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param awLine $line Rectangle diagonale
*/
abstract public function filledRectangle($background, awLine $line);
/**
* Draw a polygon
*
* @param awColor $color Polygon color
* @param Polygon A polygon
*/
abstract public function polygon(awColor $color, awPolygon $polygon);
/**
* Draw a polygon with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param Polygon A polygon
*/
abstract public function filledPolygon($background, awPolygon $polygon);
 
/**
* Sends the image, as well as the correct HTTP headers, to the browser
*
* @param awImage $image The Image object to send
*/
abstract public function send(awImage $image);
/**
* Get the image as binary data
*
* @param awImage $image
*/
abstract public function get(awImage $image);
/**
* Return the width of some text
*
* @param awText $text
*/
abstract public function getTextWidth(awText $text);
/**
* Return the height of some text
*
* @param awText $text
*/
abstract public function getTextHeight(awText $text);
/**
* Return the string representing the type of driver
*
* @return string
*/
public function getDriverString() {
return $this->driverString;
}
/**
* Returns whether or not the driver is compatible with the given font type
*
* @param awFont $font
* @return bool
*/
abstract protected function isCompatibleWithFont(awFont $font);
// abstract private function drawImage(awImage $image, $return = FALSE, $header = TRUE);
}
 
registerClass('Driver', TRUE);
 
/**
* Abstract class for font drivers.
* Those are used to do all the grunt work on fonts.
*
* @package Artichow
*/
 
abstract class awFontDriver {
public function __construct() {
}
/**
* Draw the actual text.
*
* @param awDriver $driver The Driver object to draw upon
* @param awText $text The Text object
* @param awPoint $point Where to draw the text
* @param float $width The width of the area containing the text
*/
abstract public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL);
/**
* Calculate the width of a given Text.
*
* @param awText $text The Text object
* @param awDriver $driver The awDriver object used to draw the graph
*/
abstract public function getTextWidth(awText $text, awDriver $driver);
 
/**
* Calculate the height of a given Text.
*
* @param awText $text The Text object
* @param awDriver $driver The awDriver object used to draw the graph
*/
abstract public function getTextHeight(awText $text, awDriver $driver);
}
 
registerClass('FontDriver', TRUE);
 
/**
* Class to handle calculations on PHPFont objects
*
* @package Artichow
*/
class awPHPFontDriver extends awFontDriver {
public function __construct() {
parent::__construct();
}
public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL) {
 
switch ($driver->getDriverString()) {
case 'gd':
$this->gdString($driver, $text, $point, $width);
break;
default:
awImage::drawError('Class PHPFontDriver: Incompatibility between driver and font - You should never see this error message: have you called awDriver::isCompatibleWithFont() properly?');
break;
}
}
/**
* Draw a string onto a GDDriver object
*
* @param awGDDriver $driver The GDDriver to draw the text upon
* @param awText $text The awText object containing the string to draw
* @param awPoint $point Where to draw the text
* @param float $width The width of the text
*/
private function gdString(awGDDriver $driver, awText $text, awPoint $point, $width = NULL) {
$angle = $text->getAngle();
if($angle !== 90 and $angle !== 0) {
awImage::drawError("Class PHPFontDriver: You can only use 0° and 90° angles.");
}
 
if($angle === 90) {
$function = 'imagestringup';
$addAngle = $this->getGDTextHeight($text);
} else {
$function = 'imagestring';
$addAngle = 0;
}
 
$color = $text->getColor();
$rgb = $driver->getColor($color);
 
$textString = $text->getText();
$textString = str_replace("\r", "", $textString);
$textHeight = $this->getGDTextHeight($text);
// Split text if needed
if($width !== NULL) {
 
$characters = floor($width / ($this->getGDTextWidth($text) / strlen($textString)));
 
if($characters > 0) {
$textString = wordwrap($textString, $characters, "\n", TRUE);
}
 
}
$font = $text->getFont();
$lines = explode("\n", $textString);
 
foreach($lines as $i => $line) {
 
// Line position handling
if($angle === 90) {
$addX = $i * $textHeight;
$addY = 0;
} else {
$addX = 0;
$addY = $i * $textHeight;
}
 
$function(
$driver->resource,
$font->font,
$driver->x + $point->x + $addX,
$driver->y + $point->y + $addY + $addAngle,
$line,
$rgb
);
 
}
}
public function getTextWidth(awText $text, awDriver $driver) {
switch ($driver->getDriverString()) {
case 'gd':
return $this->getGDTextWidth($text);
default:
awImage::drawError('Class PHPFontDriver: Cannot get text width - incompatibility between driver and font');
break;
}
}
public function getTextHeight(awText $text, awDriver $driver) {
switch ($driver->getDriverString()) {
case 'gd':
return $this->getGDTextHeight($text);
default:
awImage::drawError('Class PHPFontDriver: Cannot get text height - incompatibility between driver and font');
break;
}
}
/**
* Return the width of a text for a GDDriver
*
* @param awText $text
* @return int $fontWidth
*/
private function getGDTextWidth(awText $text) {
$font = $text->getFont();
if($text->getAngle() === 90) {
$text->setAngle(45);
return $this->getGDTextHeight($text);
} else if($text->getAngle() === 45) {
$text->setAngle(90);
}
 
$fontWidth = imagefontwidth($font->font);
 
if($fontWidth === FALSE) {
awImage::drawError("Class PHPFontDriver: Unable to get font size.");
}
 
return (int)$fontWidth * strlen($text->getText());
}
/**
* Return the height of a text for a GDDriver
*
* @param awText $text
* @return int $fontHeight
*/
private function getGDTextHeight(awText $text) {
$font = $text->getFont();
if($text->getAngle() === 90) {
$text->setAngle(45);
return $this->getGDTextWidth($text);
} else if($text->getAngle() === 45) {
$text->setAngle(90);
}
 
$fontHeight = imagefontheight($font->font);
 
if($fontHeight === FALSE) {
awImage::drawError("Class PHPFontDriver: Unable to get font size.");
}
 
return (int)$fontHeight;
}
}
 
registerClass('PHPFontDriver');
 
/**
* Class to handle calculations on FileFont objects
*
* @package Artichow
*/
class awFileFontDriver extends awFontDriver {
public function __construct() {
parent::__construct();
}
public function string(awDriver $driver, awText $text, awPoint $point, $width = NULL) {
switch ($driver->getDriverString()) {
case 'gd':
$this->gdString($driver, $text, $point, $width);
break;
default:
awImage::drawError('Class fileFontDriver: Incompatibility between driver and font - You should never see this error message: have you called awDriver::isCompatibleWithFont() properly?');
break;
}
}
/**
* Draw an awFileFont object on a GD ressource
*
* @param awGDDriver $driver The awGDDriver object containing the ressource to draw upon
* @param awText $text The awText object containing the string to draw
* @param awPoint $point Where to draw the string from
* @param float $width The width of the area containing the text
*/
private function gdString(awGDDriver $driver, awText $text, awPoint $point, $width = NULL) {
// Make easier font positionment
$text->setText($text->getText()." ");
 
$font = $text->getFont();
if($font instanceof awTTFFont === FALSE and $font->getExtension() === NULL) {
$font->setExtension('ttf');
}
$filePath = $font->getName().'.'.$font->getExtension();
 
$box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText());
$textHeight = - $box[5];
 
$box = imagettfbbox($font->getSize(), 90, $filePath, $text->getText());
$textWidth = abs($box[6] - $box[2]);
 
// Restore old text
$text->setText(substr($text->getText(), 0, strlen($text->getText()) - 1));
 
$textString = $text->getText();
 
// Split text if needed
if($width !== NULL) {
 
$characters = floor($width / $this->getGDAverageWidth($font));
$textString = wordwrap($textString, $characters, "\n", TRUE);
 
}
$color = $text->getColor();
$rgb = $driver->getColor($color);
imagettftext(
$driver->resource,
$font->getSize(),
$text->getAngle(),
$driver->x + $point->x + $textWidth * sin($text->getAngle() / 180 * M_PI),
$driver->y + $point->y + $textHeight,
$rgb,
$filePath,
$textString
);
}
public function getTextWidth(awText $text, awDriver $driver) {
switch ($driver->getDriverString()) {
case 'gd':
return $this->getGDTextWidth($text);
default:
awImage::drawError('Class FileFontDriver: Cannot get text width - incompatibility between driver and font');
break;
}
}
public function getTextHeight(awText $text, awDriver $driver) {
switch ($driver->getDriverString()) {
case 'gd':
return $this->getGDTextHeight($text);
default:
awImage::drawError('Class FileFontDriver: Cannot get text height - incompatibility between driver and font');
break;
}
}
private function getGDTextWidth(awText $text) {
$font = $text->getFont();
if($font->getExtension() === NULL) {
$font->setExtension('ttf');
}
$filePath = $font->getName().'.'.$font->getExtension();
$box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText());
 
if($box === FALSE) {
awImage::drawError("Class FileFontDriver: Unable to get font width (GD).");
}
 
list(, , $x2, , , , $x1, ) = $box;
 
return abs($x2 - $x1);
}
private function getGDTextHeight(awText $text) {
$font = $text->getFont();
if($font->getExtension() === NULL) {
$font->setExtension('ttf');
}
$filePath = $font->getName().'.'.$font->getExtension();
$box = imagettfbbox($font->getSize(), $text->getAngle(), $filePath, $text->getText());
 
if($box === FALSE) {
awImage::drawError("Class FileFontDriver: Unable to get font height (GD).");
}
 
list(, , , $y2, , , , $y1) = $box;
 
return abs($y2 - $y1);
}
private function getGDAverageWidth(awFileFont $font) {
 
$text = "azertyuiopqsdfghjklmmmmmmmwxcvbbbn,;:!?.";
 
$box = imagettfbbox($font->getSize(), 0, $font->getName().'.'.$font->getExtension(), $text);
 
if($box === FALSE) {
awImage::drawError("Class FileFontDriver: Unable to get font average width.");
}
 
list(, , $x2, $y2, , , $x1, $y1) = $box;
 
return abs($x2 - $x1) / strlen($text);
 
}
}
 
registerClass('FileFontDriver');
 
// Include ARTICHOW_DRIVER by default to preserve backward compatibility.
require_once dirname(__FILE__).'/drivers/'.ARTICHOW_DRIVER.'.class.php';
 
?>
/trunk/bibliotheque/artichow/inc/Gradient.class.php
New file
0,0 → 1,135
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/../Graph.class.php";
 
 
/**
* Create your gradients
*
* @package Artichow
*/
abstract class awGradient {
 
/**
* From color
*
* @var Color
*/
public $from;
 
/**
* To color
*
* @var Color
*/
public $to;
/**
* Build the gradient
*
* @param awColor $from From color
* @param awColor $to To color
*/
public function __construct(awColor $from, awColor $to) {
$this->from = $from;
$this->to = $to;
}
 
}
 
registerClass('Gradient', TRUE);
 
 
/**
* Create a linear gradient
*
* @package Artichow
*/
class awLinearGradient extends awGradient {
 
/**
* Gradient angle
*
* @var int
*/
public $angle;
/**
* Build the linear gradient
*
* @param awColor $from From color
* @param awColor $to To color
* @param int $angle Gradient angle
*/
public function __construct($from, $to, $angle) {
parent::__construct(
$from, $to
);
$this->angle = (int)$angle;
}
 
}
 
registerClass('LinearGradient');
 
 
/**
* Create a bilinear gradient
*
* @package Artichow
*/
class awBilinearGradient extends awLinearGradient {
 
/**
* Gradient center
*
* @var float Center between 0 and 1
*/
public $center;
/**
* Build the bilinear gradient
*
* @param awColor $from From color
* @param awColor $to To color
* @param int $angle Gradient angle
* @param int $center Gradient center
*/
public function __construct($from, $to, $angle, $center = 0.5) {
parent::__construct(
$from, $to, $angle
);
$this->center = (float)$center;
}
 
}
 
registerClass('BilinearGradient');
 
/**
* Create a radial gradient
*
* @package Artichow
*/
class awRadialGradient extends awGradient {
 
}
 
registerClass('RadialGradient');
?>
/trunk/bibliotheque/artichow/inc/Legend.class.php
New file
0,0 → 1,710
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Some legends
*
* @package Artichow
*/
class awLegend implements awPositionable {
 
/**
* Legends added
*
* @var array
*/
protected $legends = array();
 
/**
* The current component
*
* @var Component
*/
protected $component;
/**
* Background color or gradient
*
* @var Color, Gradient
*/
protected $background;
/**
* Text color
*
* @var Color
*/
protected $textColor;
/**
* Text font
*
* @var Font
*/
protected $textFont;
/**
* Text margin
*
* @var Side
*/
protected $textMargin;
/**
* Number of columns
*
* @var int
*/
protected $columns = NULL;
/**
* Number of rows
*
* @var int
*/
protected $rows = NULL;
/**
* Legend position
*
* @var Point
*/
protected $position;
/**
* Hide legend ?
*
* @var bool
*/
protected $hide = FALSE;
/**
* Space between each legend
*
* @var int
*/
protected $space = 4;
/**
* Horizontal alignment
*
* @var int
*/
protected $hAlign;
/**
* Vertical alignment
*
* @var int
*/
protected $vAlign;
 
/**
* Margin
*
* @var array Array for left, right, top and bottom margins
*/
private $margin;
/**
* Legend shadow
*
* @var Shadow
*/
public $shadow;
/**
* Legend border
*
* @var Border
*/
public $border;
/**
* Line legend
*
* @var int
*/
const LINE = 1;
/**
* Color/Gradient background legend
*
* @var int
*/
const BACKGROUND = 2;
/**
* Use marks and line as legend
*
* @var int
*/
const MARK = 3;
/**
* Use marks as legend
*
* @var int
*/
const MARKONLY = 4;
/**
* Right side model
*
* @var int
*/
const MODEL_RIGHT = 1;
/**
* Bottom side model
*
* @var int
*/
const MODEL_BOTTOM = 2;
 
/**
* Build the legend
*
* @param int $model Legend model
*/
public function __construct($model = awLegend::MODEL_RIGHT) {
$this->shadow = new awShadow(awShadow::LEFT_BOTTOM);
$this->border = new awBorder;
$this->textMargin = new awSide(4);
$this->setModel($model);
}
/**
* Set a predefined model for the legend
*
* @param int $model
*/
public function setModel($model) {
$this->setBackgroundColor(new awColor(255, 255, 255, 15));
$this->setPadding(8, 8, 8, 8);
$this->setTextFont(new awFont2);
$this->shadow->setSize(3);
switch($model) {
case awLegend::MODEL_RIGHT :
$this->setColumns(1);
$this->setAlign(awLegend::RIGHT, awLegend::MIDDLE);
$this->setPosition(0.96, 0.50);
break;
case awLegend::MODEL_BOTTOM :
$this->setRows(1);
$this->setAlign(awLegend::CENTER, awLegend::TOP);
$this->setPosition(0.50, 0.92);
break;
default :
$this->setPosition(0.5, 0.5);
break;
}
}
/**
* Hide legend ?
*
* @param bool $hide TRUE to hide legend, FALSE otherwise
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Show legend ?
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = (bool)!$show;
}
/**
* Add a Legendable object to the legend
*
* @param awLegendable $legendable
* @param string $title Legend title
* @param int $type Legend type (default to awLegend::LINE)
*/
public function add(awLegendable $legendable, $title, $type = awLegend::LINE) {
$legend = array($legendable, $title, $type);
$this->legends[] = $legend;
}
/**
* Change legend padding
*
* @param int $left
* @param int $right
* @param int $top
* @param int $bottom
*/
public function setPadding($left, $right, $top, $bottom) {
$this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom);
}
/**
* Change space between each legend
*
* @param int $space
*/
public function setSpace($space) {
$this->space = (int)$space;
}
/**
* Change alignment
*
* @param int $h Horizontal alignment
* @param int $v Vertical alignment
*/
public function setAlign($h = NULL, $v = NULL) {
if($h !== NULL) {
$this->hAlign = (int)$h;
}
if($v !== NULL) {
$this->vAlign = (int)$v;
}
}
/**
* Change number of columns
*
* @param int $columns
*/
public function setColumns($columns) {
$this->rows = NULL;
$this->columns = (int)$columns;
}
/**
* Change number of rows
*
* @param int $rows
*/
public function setRows($rows) {
$this->columns = NULL;
$this->rows = (int)$rows;
}
/**
* Change legend position
* X and Y positions must be between 0 and 1.
*
* @param float $x
* @param float $y
*/
public function setPosition($x = NULL, $y = NULL) {
$x = (is_null($x) and !is_null($this->position)) ? $this->position->x : $x;
$y = (is_null($y) and !is_null($this->position)) ? $this->position->y : $y;
$this->position = new awPoint($x, $y);
}
/**
* Get legend position
*
* @return Point
*/
public function getPosition() {
return $this->position;
}
/**
* Change text font
*
* @param awFont $font
*/
public function setTextFont(awFont $font) {
$this->textFont = $font;
}
/**
* Change text margin
*
* @param int $left
* @param int $right
*/
public function setTextMargin($left, $right) {
$this->textMargin->set($left, $right);
}
/**
* Change text color
*
* @param awColor $color
*/
public function setTextColor(awColor $color) {
$this->textColor = $color;
}
/**
* Change background
*
* @param mixed $background
*/
public function setBackground($background) {
$this->background = $background;
}
/**
* Change background color
*
* @param awColor $color
*/
public function setBackgroundColor(awColor $color) {
$this->background = $color;
}
/**
* Change background gradient
*
* @param awGradient $gradient
*/
public function setBackgroundGradient(awGradient $gradient) {
$this->background = $gradient;
}
/**
* Count the number of Legendable objects in the legend
*
* @return int
*/
public function count() {
return count($this->legends);
}
public function draw(awDriver $driver) {
if($this->hide) {
return;
}
$count = $this->count();
// No legend to print
if($count === 0) {
return;
}
// Get text widths and heights of each element of the legend
$widths = array();
$heights = array();
$texts = array();
for($i = 0; $i < $count; $i++) {
list(, $title, ) = $this->legends[$i];
$text = new awText(
$title,
$this->textFont,
$this->textColor,
0
);
// $font = $text->getFont();
$widths[$i] = $driver->getTextWidth($text) + $this->textMargin->left + $this->textMargin->right;
$heights[$i] = $driver->getTextHeight($text);
$texts[$i] = $text;
}
// Maximum height of the font used
$heightMax = array_max($heights);
// Get number of columns
if($this->columns !== NULL) {
$columns = $this->columns;
} else if($this->rows !== NULL) {
$columns = ceil($count / $this->rows);
} else {
$columns = $count;
}
// Number of rows
$rows = (int)ceil($count / $columns);
// Get maximum with of each column
$widthMax = array();
for($i = 0; $i < $count; $i++) {
// Get column width
$column = $i % $columns;
if(array_key_exists($column, $widthMax) === FALSE) {
$widthMax[$column] = $widths[$i];
} else {
$widthMax[$column] = max($widthMax[$column], $widths[$i]);
}
}
$width = $this->padding[0] + $this->padding[1] - $this->space;
for($i = 0; $i < $columns; $i++) {
$width += $this->space + 5 + 10 + $widthMax[$i];
}
$height = ($heightMax + $this->space) * $rows - $this->space + $this->padding[2] + $this->padding[3];
// Look for legends position
list($x, $y) = $driver->getSize();
$p = new awPoint(
$this->position->x * $x,
$this->position->y * $y
);
switch($this->hAlign) {
case awLegend::CENTER :
$p->x -= $width / 2;
break;
case awLegend::RIGHT :
$p->x -= $width;
break;
}
switch($this->vAlign) {
case awLegend::MIDDLE :
$p->y -= $height / 2;
break;
case awLegend::BOTTOM :
$p->y -= $height;
break;
}
// Draw legend shadow
$this->shadow->draw(
$driver,
$p,
$p->move($width, $height),
awShadow::OUT
);
// Draw legends base
$this->drawBase($driver, $p, $width, $height);
// Draw each legend
for($i = 0; $i < $count; $i++) {
list($component, $title, $type) = $this->legends[$i];
$column = $i % $columns;
$row = (int)floor($i / $columns);
// Get width of all previous columns
$previousColumns = 0;
for($j = 0; $j < $column; $j++) {
$previousColumns += $this->space + 10 + 5 + $widthMax[$j];
}
// Draw legend text
$driver->string(
$texts[$i],
$p->move(
$this->padding[0] + $previousColumns + 10 + 5 + $this->textMargin->left,
$this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $heights[$i] / 2
)
);
// Draw legend icon
switch($type) {
case awLegend::LINE :
case awLegend::MARK :
case awLegend::MARKONLY :
// Get vertical position
$x = $this->padding[0] + $previousColumns;
$y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - $component->getLegendLineThickness();
// Draw two lines
if($component->getLegendLineColor() !== NULL) {
$color = $component->getLegendLineColor();
if($color instanceof awColor and $type !== awLegend::MARKONLY) {
$driver->line(
$color,
new awLine(
$p->move(
$x, // YaPB ??
$y + $component->getLegendLineThickness() / 2
),
$p->move(
$x + 10,
$y + $component->getLegendLineThickness() / 2
),
$component->getLegendLineStyle(),
$component->getLegendLineThickness()
)
);
unset($color);
}
}
if($type === awLegend::MARK or $type === awLegend::MARKONLY) {
$mark = $component->getLegendMark();
if($mark !== NULL) {
$mark->draw(
$driver,
$p->move(
$x + 5.5,
$y + $component->getLegendLineThickness() / 2
)
);
}
unset($mark);
}
break;
case awLegend::BACKGROUND :
// Get vertical position
$x = $this->padding[0] + $previousColumns;
$y = $this->padding[2] + $row * ($heightMax + $this->space) + $heightMax / 2 - 5;
$from = $p->move(
$x,
$y
);
$to = $p->move(
$x + 10,
$y + 10
);
$background = $component->getLegendBackground();
if($background !== NULL) {
$driver->filledRectangle(
$component->getLegendBackground(),
new awLine($from, $to)
);
// Draw rectangle border
$this->border->rectangle(
$driver,
$from->move(0, 0),
$to->move(0, 0)
);
}
unset($background, $from, $to);
break;
}
}
}
private function drawBase(awDriver $driver, awPoint $p, $width, $height) {
 
$this->border->rectangle(
$driver,
$p,
$p->move($width, $height)
);
$size = $this->border->visible() ? 1 : 0;
$driver->filledRectangle(
$this->background,
new awLine(
$p->move($size, $size),
$p->move($width - $size, $height - $size)
)
);
}
 
}
 
registerClass('Legend');
 
/**
* You can add a legend to components which implements this interface
*
* @package Artichow
*/
interface awLegendable {
 
/**
* Get the line type
*
* @return int
*/
public function getLegendLineStyle();
 
/**
* Get the line thickness
*
* @return int
*/
public function getLegendLineThickness();
 
/**
* Get the color of line
*
* @return Color
*/
public function getLegendLineColor();
 
/**
* Get the background color or gradient of an element of the component
*
* @return Color, Gradient
*/
public function getLegendBackground();
 
/**
* Get a Mark object
*
* @return Mark
*/
public function getLegendMark();
 
}
 
registerInterface('Legendable');
?>
/trunk/bibliotheque/artichow/inc/Tools.class.php
New file
0,0 → 1,175
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Objects capable of being positioned
*
* @package Artichow
*/
interface awPositionable {
 
/**
* Left align
*
* @var int
*/
const LEFT = 1;
 
/**
* Right align
*
* @var int
*/
const RIGHT = 2;
 
/**
* Center align
*
* @var int
*/
const CENTER = 3;
 
/**
* Top align
*
* @var int
*/
const TOP = 4;
 
/**
* Bottom align
*
* @var int
*/
const BOTTOM = 5;
 
/**
* Middle align
*
* @var int
*/
const MIDDLE = 6;
/**
* Change alignment
*
* @param int $h Horizontal alignment
* @param int $v Vertical alignment
*/
public function setAlign($h = NULL, $v = NULL);
}
 
registerInterface('Positionable');
 
/**
* Manage left, right, top and bottom sides
*
* @package Artichow
*/
class awSide {
 
/**
* Left side
*
* @var int
*/
public $left = 0;
 
/**
* Right side
*
* @var int
*/
public $right = 0;
 
/**
* Top side
*
* @var int
*/
public $top = 0;
 
/**
* Bottom side
*
* @var int
*/
public $bottom = 0;
/**
* Build the side
*
* @param mixed $left
* @param mixed $right
* @param mixed $top
* @param mixed $bottom
*/
public function __construct($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
$this->set($left, $right, $top, $bottom);
}
/**
* Change side values
*
* @param mixed $left
* @param mixed $right
* @param mixed $top
* @param mixed $bottom
*/
public function set($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
if($left !== NULL) {
$this->left = (float)$left;
}
if($right !== NULL) {
$this->right = (float)$right;
}
if($top !== NULL) {
$this->top = (float)$top;
}
if($bottom !== NULL) {
$this->bottom = (float)$bottom;
}
}
/**
* Add values to each side
*
* @param mixed $left
* @param mixed $right
* @param mixed $top
* @param mixed $bottom
*/
public function add($left = NULL, $right = NULL, $top = NULL, $bottom = NULL) {
if($left !== NULL) {
$this->left += (float)$left;
}
if($right !== NULL) {
$this->right += (float)$right;
}
if($top !== NULL) {
$this->top += (float)$top;
}
if($bottom !== NULL) {
$this->bottom += (float)$bottom;
}
}
 
}
 
registerClass('Side');
?>
/trunk/bibliotheque/artichow/inc/Axis.class.php
New file
0,0 → 1,769
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Handle axis
*
* @package Artichow
*/
class awAxis {
 
/**
* Axis line
*
* @var Line
*/
public $line;
 
/**
* Axis labels
*
* @var Label
*/
public $label;
 
/**
* Axis title
*
* @var Label
*/
public $title;
 
/**
* Title position
*
* @var float
*/
protected $titlePosition = 0.5;
 
/**
* Labels number
*
* @var int
*/
protected $labelNumber;
 
/**
* Axis ticks
*
* @var array
*/
protected $ticks = array();
 
/**
* Axis and ticks color
*
* @var Color
*/
protected $color;
 
/**
* Axis left and right padding
*
* @var Side
*/
protected $padding;
 
/**
* Axis range
*
* @var array
*/
protected $range;
 
/**
* Hide axis
*
* @var bool
*/
protected $hide = FALSE;
 
/**
* Auto-scaling mode
*
* @var bool
*/
protected $auto = TRUE;
 
/**
* Axis range callback function
*
* @var array
*/
protected $rangeCallback = array(
'toValue' => 'toProportionalValue',
'toPosition' => 'toProportionalPosition'
);
 
/**
* Build the axis
*
* @param float $min Begin of the range of the axis
* @param float $max End of the range of the axis
*/
public function __construct($min = NULL, $max = NULL) {
 
$this->line = new awVector(
new awPoint(0, 0),
new awPoint(0, 0)
);
 
$this->label = new awLabel;
$this->padding = new awSide;
 
$this->title = new awLabel(
NULL,
NULL,
NULL,
0
);
 
$this->setColor(new awBlack);
 
if($min !== NULL and $max !== NULL) {
$this->setRange($min, $max);
}
 
}
 
/**
* Enable/disable auto-scaling mode
*
* @param bool $auto
*/
public function auto($auto) {
$this->auto = (bool)$auto;
}
 
/**
* Get auto-scaling mode status
*
* @return bool
*/
public function isAuto() {
return $this->auto;
}
 
/**
* Hide axis
*
* @param bool $hide
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
 
/**
* Show axis
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = !(bool)$show;
}
 
/**
* Return a tick object from its name
*
* @param string $name Tick object name
* @return Tick
*/
public function tick($name) {
return array_key_exists($name, $this->ticks) ? $this->ticks[$name] : NULL;
}
 
/**
* Add a tick object
*
* @param string $name Tick object name
* @param awTick $tick Tick object
*/
public function addTick($name, awTick $tick) {
$this->ticks[$name] = $tick;
}
 
/**
* Delete a tick object
*
* @param string $name Tick object name
*/
public function deleteTick($name) {
if(array_key_exists($name, $this->ticks)) {
unset($this->ticks[$name]);
}
}
 
/**
* Hide all ticks
*
* @param bool $hide Hide or not ?
*/
public function hideTicks($hide = TRUE) {
foreach($this->ticks as $tick) {
$tick->hide($hide);
}
}
 
/**
* Change ticks style
*
* @param int $style Ticks style
*/
public function setTickStyle($style) {
foreach($this->ticks as $tick) {
$tick->setStyle($style);
}
}
 
/**
* Change ticks interval
*
* @param int $interval Ticks interval
*/
public function setTickInterval($interval) {
foreach($this->ticks as $tick) {
$tick->setInterval($interval);
}
}
 
/**
* Change number of ticks relative to others ticks
*
* @param awTick $to Change number of theses ticks
* @param awTick $from Ticks reference
* @param float $number Number of ticks by the reference
*/
public function setNumberByTick($to, $from, $number) {
$this->ticks[$to]->setNumberByTick($this->ticks[$from], $number);
}
 
/**
* Reverse ticks style
*/
public function reverseTickStyle() {
foreach($this->ticks as $tick) {
if($tick->getStyle() === awTick::IN) {
$tick->setStyle(awTick::OUT);
} else if($tick->getStyle() === awTick::OUT) {
$tick->setStyle(awTick::IN);
}
}
}
 
/**
* Change interval of labels
*
* @param int $interval Interval
*/
public function setLabelInterval($interval) {
$this->auto(FALSE);
$this->setTickInterval($interval);
$this->label->setInterval($interval);
}
 
/**
* Change number of labels
*
* @param int $number Number of labels to display (can be NULL)
*/
public function setLabelNumber($number) {
$this->auto(FALSE);
$this->labelNumber = is_null($number) ? NULL : (int)$number;
}
 
/**
* Get number of labels
*
* @return int
*/
public function getLabelNumber() {
return $this->labelNumber;
}
 
/**
* Change precision of labels
*
* @param int $precision Precision
*/
public function setLabelPrecision($precision) {
$this->auto(FALSE);
$function = 'axis'.time().'_'.(microtime() * 1000000);
eval('function '.$function.'($value) {
return sprintf("%.'.(int)$precision.'f", $value);
}');
$this->label->setCallbackFunction($function);
}
 
/**
* Change text of labels
*
* @param array $texts Some texts
*/
public function setLabelText($texts) {
if(is_array($texts)) {
$this->auto(FALSE);
$function = 'axis'.time().'_'.(microtime() * 1000000);
eval('function '.$function.'($value) {
$texts = '.var_export($texts, TRUE).';
return isset($texts[$value]) ? $texts[$value] : \'?\';
}');
$this->label->setCallbackFunction($function);
}
}
 
/**
* Get the position of a point
*
* @param awAxis $xAxis X axis
* @param awAxis $yAxis Y axis
* @param awPoint $p Position of the point
* @return Point Position on the axis
*/
public static function toPosition(awAxis $xAxis, awAxis $yAxis, awPoint $p) {
 
$p1 = $xAxis->getPointFromValue($p->x);
$p2 = $yAxis->getPointFromValue($p->y);
 
return new awPoint(
round($p1->x),
round($p2->y)
);
 
}
 
/**
* Change title alignment
*
* @param int $alignment New Alignment
*/
public function setTitleAlignment($alignment) {
 
switch($alignment) {
 
case awLabel::TOP :
$this->setTitlePosition(1);
$this->title->setAlign(NULL, awLabel::BOTTOM);
break;
 
case awLabel::BOTTOM :
$this->setTitlePosition(0);
$this->title->setAlign(NULL, awLabel::TOP);
break;
 
case awLabel::LEFT :
$this->setTitlePosition(0);
$this->title->setAlign(awLabel::LEFT);
break;
 
case awLabel::RIGHT :
$this->setTitlePosition(1);
$this->title->setAlign(awLabel::RIGHT);
break;
 
}
 
}
 
/**
* Change title position on the axis
*
* @param float $position A new awposition between 0 and 1
*/
public function setTitlePosition($position) {
$this->titlePosition = (float)$position;
}
 
/**
* Change axis and axis title color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
$this->title->setColor($color);
}
 
/**
* Change axis padding
*
* @param int $left Left padding in pixels
* @param int $right Right padding in pixels
*/
public function setPadding($left, $right) {
$this->padding->set($left, $right);
}
 
/**
* Get axis padding
*
* @return Side
*/
public function getPadding() {
return $this->padding;
}
 
/**
* Change axis range
*
* @param float $min
* @param float $max
*/
public function setRange($min, $max) {
if($min !== NULL) {
$this->range[0] = (float)$min;
}
if($max !== NULL) {
$this->range[1] = (float)$max;
}
}
 
/**
* Get axis range
*
* @return array
*/
public function getRange() {
return $this->range;
}
 
/**
* Change axis range callback function
*
* @param string $toValue Transform a position between 0 and 1 to a value
* @param string $toPosition Transform a value to a position between 0 and 1 on the axis
*/
public function setRangeCallback($toValue, $toPosition) {
$this->rangeCallback = array(
'toValue' => (string)$toValue,
'toPosition' => (string)$toPosition
);
}
 
/**
* Center X values of the axis
*
* @param awAxis $axis An axis
* @param float $value The reference value on the axis
*/
public function setXCenter(awAxis $axis, $value) {
 
// Check vector angle
if($this->line->isVertical() === FALSE) {
awImage::drawError("Class Axis: setXCenter() can only be used on vertical axes.");
}
 
$p = $axis->getPointFromValue($value);
 
$this->line->setX(
$p->x,
$p->x
);
 
}
 
/**
* Center Y values of the axis
*
* @param awAxis $axis An axis
* @param float $value The reference value on the axis
*/
public function setYCenter(awAxis $axis, $value) {
 
// Check vector angle
if($this->line->isHorizontal() === FALSE) {
awImage::drawError("Class Axis: setYCenter() can only be used on horizontal axes.");
}
 
$p = $axis->getPointFromValue($value);
 
$this->line->setY(
$p->y,
$p->y
);
 
}
 
/**
* Get the distance between to values on the axis
*
* @param float $from The first value
* @param float $to The last value
* @return Point
*/
public function getDistance($from, $to) {
 
$p1 = $this->getPointFromValue($from);
$p2 = $this->getPointFromValue($to);
 
return $p1->getDistance($p2);
 
}
 
/**
* Get a point on the axis from a value
*
* @param float $value
* @return Point
*/
protected function getPointFromValue($value) {
 
$callback = $this->rangeCallback['toPosition'];
 
list($min, $max) = $this->range;
$position = $callback($value, $min, $max);
 
return $this->getPointFromPosition($position);
 
}
 
/**
* Get a point on the axis from a position
*
* @param float $position A position between 0 and 1
* @return Point
*/
protected function getPointFromPosition($position) {
 
$vector = $this->getVector();
 
$angle = $vector->getAngle();
$size = $vector->getSize();
 
return $vector->p1->move(
cos($angle) * $size * $position,
-1 * sin($angle) * $size * $position
);
 
}
 
/**
* Draw axis
*
* @param awDriver $driver A driver
*/
public function draw(awDriver $driver) {
 
if($this->hide) {
return;
}
 
$vector = $this->getVector();
 
// Draw axis ticks
$this->drawTicks($driver, $vector);
 
// Draw axis line
$this->line($driver);
 
// Draw labels
$this->drawLabels($driver);
 
// Draw axis title
$p = $this->getPointFromPosition($this->titlePosition);
$this->title->draw($driver, $p);
 
}
 
public function autoScale() {
 
if($this->isAuto() === FALSE) {
return;
}
 
list($min, $max) = $this->getRange();
$interval = $max - $min;
 
if($interval > 0) {
$partMax = $max / $interval;
$partMin = $min / $interval;
} else {
$partMax = 0;
$partMin = 0;
}
 
$difference = log($interval) / log(10);
$difference = floor($difference);
 
$pow = pow(10, $difference);
 
if($pow > 0) {
$intervalNormalize = $interval / $pow;
} else {
$intervalNormalize = 0;
}
 
if($difference <= 0) {
 
$precision = $difference * -1 + 1;
 
if($intervalNormalize > 2) {
$precision--;
}
 
} else {
$precision = 0;
}
 
if($min != 0 and $max != 0) {
$precision++;
}
 
if($this->label->getCallbackFunction() === NULL) {
$this->setLabelPrecision($precision);
}
 
if($intervalNormalize <= 1.5) {
$intervalReal = 1.5;
$labelNumber = 4;
} else if($intervalNormalize <= 2) {
$intervalReal = 2;
$labelNumber = 5;
} else if($intervalNormalize <= 3) {
$intervalReal = 3;
$labelNumber = 4;
} else if($intervalNormalize <= 4) {
$intervalReal = 4;
$labelNumber = 5;
} else if($intervalNormalize <= 5) {
$intervalReal = 5;
$labelNumber = 6;
} else if($intervalNormalize <= 8) {
$intervalReal = 8;
$labelNumber = 5;
} else if($intervalNormalize <= 10) {
$intervalReal = 10;
$labelNumber = 6;
}
 
if($min == 0) {
 
$this->setRange(
$min,
$intervalReal * $pow
);
 
} else if($max == 0) {
 
$this->setRange(
$intervalReal * $pow * -1,
0
);
 
}
 
$this->setLabelNumber($labelNumber);
 
}
 
protected function line(awDriver $driver) {
 
$driver->line(
$this->color,
$this->line
);
 
}
 
protected function drawTicks(awDriver $driver, awVector $vector) {
 
foreach($this->ticks as $tick) {
$tick->setColor($this->color);
$tick->draw($driver, $vector);
}
 
}
 
protected function drawLabels($driver) {
 
if($this->labelNumber !== NULL) {
list($min, $max) = $this->range;
$number = $this->labelNumber - 1;
if($number < 1) {
return;
}
$function = $this->rangeCallback['toValue'];
$labels = array();
for($i = 0; $i <= $number; $i++) {
$labels[] = $function($i / $number, $min, $max);
}
$this->label->set($labels);
}
 
$labels = $this->label->count();
 
for($i = 0; $i < $labels; $i++) {
 
$p = $this->getPointFromValue($this->label->get($i));
$this->label->draw($driver, $p, $i);
 
}
 
}
 
protected function getVector() {
 
$angle = $this->line->getAngle();
 
// Compute paddings
$vector = new awVector(
$this->line->p1->move(
cos($angle) * $this->padding->left,
-1 * sin($angle) * $this->padding->left
),
$this->line->p2->move(
-1 * cos($angle) * $this->padding->right,
-1 * -1 * sin($angle) * $this->padding->right
)
);
 
return $vector;
 
}
 
public function __clone() {
 
$this->label = clone $this->label;
$this->line = clone $this->line;
$this->title = clone $this->title;
 
foreach($this->ticks as $name => $tick) {
$this->ticks[$name] = clone $tick;
}
 
}
 
}
 
registerClass('Axis');
 
function toProportionalValue($position, $min, $max) {
return $min + ($max - $min) * $position;
}
 
function toProportionalPosition($value, $min, $max) {
if($max - $min == 0) {
return 0;
}
return ($value - $min) / ($max - $min);
}
?>
/trunk/bibliotheque/artichow/inc/Font.class.php
New file
0,0 → 1,263
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Common font characteristics and methods.
* Declared abstract only so that it can't be instanciated.
* Users have to call 'new awPHPFont' or 'new awFileFont',
* or any of their inherited classes (awFont1, awTuffy, awTTFFont, etc.)
*
* @package Artichow
*/
abstract class awFont {
 
/**
* Build the font
*
*/
public function __construct() {
}
 
/**
* Draw a text
*
* @param awDriver $driver
* @param awPoint $p Draw text at this point
* @param awText $text The text
* @param int $width Text box width
*/
public function draw(awDriver $driver, awPoint $point, awText $text, $width = NULL) {
$driver->string($this, $text, $point, $width);
}
 
}
 
registerClass('Font', TRUE);
 
/**
* Class for fonts that cannot be transformed,
* like the built-in PHP fonts for example.
*
* @package Artichow
*/
class awPHPFont extends awFont {
/**
* The used font identifier
*
* @var int
*/
public $font;
public function __construct($font = NULL) {
parent::__construct();
if($font !== NULL) {
$this->font = (int)$font;
}
}
}
 
registerClass('PHPFont');
 
/**
* Class for fonts that can be transformed (rotated, skewed, etc.),
* like TTF or FDB fonts for example.
*
* @package Artichow
*/
class awFileFont extends awFont {
/**
* The name of the font, without the extension
*
* @var string
*/
protected $name;
/**
* The size of the font
*
* @var int
*/
protected $size;
/**
* The font filename extension
*
* @var string
*/
protected $extension;
public function __construct($name, $size) {
parent::__construct();
$this->setName($name);
$this->setSize($size);
}
/**
* Set the name of the font. The $name variable can contain the full path,
* or just the filename. Artichow will try to do The Right Thing,
* as well as set the extension property correctly if possible.
*
* @param string $name
*/
public function setName($name) {
$fontInfo = pathinfo((string)$name);
if(strpos($fontInfo['dirname'], '/') !== 0) {
// Path is not absolute, use ARTICHOW_FONT
$name = ARTICHOW_FONT.DIRECTORY_SEPARATOR.$fontInfo['basename'];
$fontInfo = pathinfo($name);
}
$this->name = $fontInfo['dirname'].DIRECTORY_SEPARATOR.$fontInfo['basename'];
if(array_key_exists('extension', $fontInfo) and $fontInfo['extension'] !== '') {
$this->setExtension($fontInfo['extension']);
}
}
/**
* Return the name of the font, i.e. the absolute path and the filename, without the extension.
*
* @return string
*/
public function getName() {
return $this->name;
}
/**
* Set the size of the font, in pixels
*
* @param int $size
*/
public function setSize($size) {
$this->size = (int)$size;
}
/**
* Return the size of the font, in pixels
*
* @return int
*/
public function getSize() {
return $this->size;
}
/**
* Set the extension, without the dot
*
* @param string $extension
*/
public function setExtension($extension) {
$this->extension = (string)$extension;
}
/**
* Get the filename extension for that font
*
* @return string
*/
public function getExtension() {
return $this->extension;
}
 
}
 
registerClass('FileFont');
 
/**
* Class representing TTF fonts
*
* @package Artichow
*/
class awTTFFont extends awFileFont {
public function __construct($name, $size) {
parent::__construct($name, $size);
if($this->getExtension() === NULL) {
$this->setExtension('ttf');
}
}
 
}
 
registerClass('TTFFont');
 
 
 
$php = '';
 
for($i = 1; $i <= 5; $i++) {
 
$php .= '
class awFont'.$i.' extends awPHPFont {
 
public function __construct() {
parent::__construct('.$i.');
}
 
}
';
 
if(ARTICHOW_PREFIX !== 'aw') {
$php .= '
class '.ARTICHOW_PREFIX.'Font'.$i.' extends awFont'.$i.' {
}
';
}
 
}
 
eval($php);
 
$php = '';
 
foreach($fonts as $font) {
 
$php .= '
class aw'.$font.' extends awFileFont {
 
public function __construct($size) {
parent::__construct(\''.$font.'\', $size);
}
 
}
';
 
if(ARTICHOW_PREFIX !== 'aw') {
$php .= '
class '.ARTICHOW_PREFIX.$font.' extends aw'.$font.' {
}
';
}
 
}
 
eval($php);
 
 
 
/*
* Environment modification for GD2 and TTF fonts
*/
if(function_exists('putenv')) {
putenv('GDFONTPATH='.ARTICHOW_FONT);
}
 
?>
/trunk/bibliotheque/artichow/inc/Border.class.php
New file
0,0 → 1,198
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
/**
* Draw border
*
* @package Artichow
*/
class awBorder {
 
/**
* Border color
*
* @var Color
*/
protected $color;
 
/**
* Hide border ?
*
* @var bool
*/
protected $hide = FALSE;
 
/**
* Border line style
*
* @var int
*/
protected $style;
/**
* Build the border
*
* @param awColor $color Border color
* @param int $style Border style
*/
public function __construct($color = NULL, $style = awLine::SOLID) {
$this->setStyle($style);
if($color instanceof awColor) {
$this->setColor($color);
} else {
$this->setColor(new awBlack);
}
}
/**
* Change border color
* This method automatically shows the border if it is hidden
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
$this->show();
}
/**
* Change border style
*
* @param int $style
*/
public function setStyle($style) {
$this->style = (int)$style;
}
/**
* Hide border ?
*
* @param bool $hide
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Show border ?
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = (bool)!$show;
}
/**
* Is the border visible ?
*
* @return bool
*/
public function visible() {
return !$this->hide;
}
/**
* Draw border as a rectangle
*
* @param awDriver $driver
* @param awPoint $p1 Top-left corner
* @param awPoint $p2 Bottom-right corner
*/
public function rectangle(awDriver $driver, awPoint $p1, awPoint $p2) {
// Border is hidden
if($this->hide) {
return;
}
$line = new awLine;
$line->setStyle($this->style);
$line->setLocation($p1, $p2);
$driver->rectangle($this->color, $line);
}
/**
* Draw border as an ellipse
*
* @param awDriver $driver
* @param awPoint $center Ellipse center
* @param int $width Ellipse width
* @param int $height Ellipse height
*/
public function ellipse(awDriver $driver, awPoint $center, $width, $height) {
// Border is hidden
if($this->hide) {
return;
}
switch($this->style) {
case awLine::SOLID :
$driver->ellipse($this->color, $center, $width, $height);
break;
default :
awImage::drawError("Class Border: Dashed and dotted borders and not yet implemented on ellipses.");
break;
}
}
/**
* Draw border as a polygon
*
* @param awDriver $driver A Driver object
* @param awPolygon $polygon A Polygon object
*/
public function polygon(awDriver $driver, awPolygon $polygon) {
// Border is hidden
if($this->hide) {
return;
}
$polygon->setStyle($this->style);
$driver->polygon($this->color, $polygon);
// In case of Line::SOLID, Driver::polygon() uses imagepolygon()
// which automatically closes the shape. In any other case,
// we have to do it manually here.
if($this->style !== Line::SOLID) {
$this->closePolygon($driver, $polygon);
}
}
/**
* Draws the last line of a Polygon, between the first and last point
*
* @param awDriver $driver A Driver object
* @param awPolygon $polygon The polygon object to close
*/
private function closePolygon(awDriver $driver, awPolygon $polygon) {
$first = $polygon->get(0);
$last = $polygon->get($polygon->count() - 1);
$line = new awLine($first, $last, $this->style, $polygon->getThickness());
$driver->line($this->color, $line);
}
}
 
registerClass('Border');
?>
/trunk/bibliotheque/artichow/inc/Color.class.php
New file
0,0 → 1,165
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Create your colors
*
* @package Artichow
*/
class awColor {
public $red;
public $green;
public $blue;
public $alpha;
 
/**
* Build your color
*
* @var int $red Red intensity (from 0 to 255)
* @var int $green Green intensity (from 0 to 255)
* @var int $blue Blue intensity (from 0 to 255)
* @var int $alpha Alpha channel (from 0 to 100)
*/
public function __construct($red, $green, $blue, $alpha = 0) {
$this->red = (int)$red;
$this->green = (int)$green;
$this->blue = (int)$blue;
$this->alpha = (int)round($alpha * 127 / 100);
}
/**
* Get RGB and alpha values of your color
*
* @return array
*/
public function getColor() {
return $this->rgba();
}
/**
* Change color brightness
*
* @param int $brightness Add this intensity to the color (betweeen -255 and +255)
*/
public function brightness($brightness) {
$brightness = (int)$brightness;
$this->red = min(255, max(0, $this->red + $brightness));
$this->green = min(255, max(0, $this->green + $brightness));
$this->blue = min(255, max(0, $this->blue + $brightness));
}
 
/**
* Get RGB and alpha values of your color
*
* @return array
*/
public function rgba() {
return array($this->red, $this->green, $this->blue, $this->alpha);
}
 
}
 
registerClass('Color');
 
$colors = array(
'Black' => array(0, 0, 0),
'AlmostBlack' => array(48, 48, 48),
'VeryDarkGray' => array(88, 88, 88),
'DarkGray' => array(128, 128, 128),
'MidGray' => array(160, 160, 160),
'LightGray' => array(195, 195, 195),
'VeryLightGray' => array(220, 220, 220),
'White' => array(255, 255, 255),
'VeryDarkRed' => array(64, 0, 0),
'DarkRed' => array(128, 0, 0),
'MidRed' => array(192, 0, 0),
'Red' => array(255, 0, 0),
'LightRed' => array(255, 192, 192),
'VeryDarkGreen' => array(0, 64, 0),
'DarkGreen' => array(0, 128, 0),
'MidGreen' => array(0, 192, 0),
'Green' => array(0, 255, 0),
'LightGreen' => array(192, 255, 192),
'VeryDarkBlue' => array(0, 0, 64),
'DarkBlue' => array(0, 0, 128),
'MidBlue' => array(0, 0, 192),
'Blue' => array(0, 0, 255),
'LightBlue' => array(192, 192, 255),
'VeryDarkYellow' => array(64, 64, 0),
'DarkYellow' => array(128, 128, 0),
'MidYellow' => array(192, 192, 0),
'Yellow' => array(255, 255, 2),
'LightYellow' => array(255, 255, 192),
'VeryDarkCyan' => array(0, 64, 64),
'DarkCyan' => array(0, 128, 128),
'MidCyan' => array(0, 192, 192),
'Cyan' => array(0, 255, 255),
'LightCyan' => array(192, 255, 255),
'VeryDarkMagenta' => array(64, 0, 64),
'DarkMagenta' => array(128, 0, 128),
'MidMagenta' => array(192, 0, 192),
'Magenta' => array(255, 0, 255),
'LightMagenta' => array(255, 192, 255),
'DarkOrange' => array(192, 88, 0),
'Orange' => array(255, 128, 0),
'LightOrange' => array(255, 168, 88),
'VeryLightOrange' => array(255, 220, 168),
'DarkPink' => array(192, 0, 88),
'Pink' => array(255, 0, 128),
'LightPink' => array(255, 88, 168),
'VeryLightPink' => array(255, 168, 220),
'DarkPurple' => array(88, 0, 192),
'Purple' => array(128, 0, 255),
'LightPurple' => array(168, 88, 255),
'VeryLightPurple' => array(220, 168, 255),
);
 
 
 
$php = '';
 
foreach($colors as $name => $color) {
 
list($red, $green, $blue) = $color;
 
$php .= '
class aw'.$name.' extends awColor {
public function __construct($alpha = 0) {
parent::__construct('.$red.', '.$green.', '.$blue.', $alpha);
}
}
';
if(ARTICHOW_PREFIX !== 'aw') {
$php .= '
class '.ARTICHOW_PREFIX.$name.' extends aw'.$name.' {
}
';
}
 
}
 
eval($php);
 
 
 
?>
/trunk/bibliotheque/artichow/inc/Label.class.php
New file
0,0 → 1,588
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
/**
* Draw labels
*
* @package Artichow
*/
class awLabel implements awPositionable {
 
/**
* Label border
*
* @var int
*/
public $border;
 
/**
* Label texts
*
* @var array
*/
protected $texts;
 
/**
* Text font
*
* @var int
*/
protected $font;
 
/**
* Text angle
*
* @var int
*/
protected $angle = 0;
 
/**
* Text color
*
* @var Color
*/
protected $color;
 
/**
* Text background
*
* @var Color, Gradient
*/
private $background;
 
/**
* Callback function
*
* @var string
*/
private $function;
 
/**
* Padding
*
* @var int
*/
private $padding;
 
/**
* Move position from this vector
*
* @var Point
*/
protected $move;
 
/**
* Label interval
*
* @var int
*/
protected $interval = 1;
 
/**
* Horizontal align
*
* @var int
*/
protected $hAlign = awLabel::CENTER;
 
/**
* Vertical align
*
* @var int
*/
protected $vAlign = awLabel::MIDDLE;
/**
* Hide all labels ?
*
* @var bool
*/
protected $hide = FALSE;
/**
* Keys to hide
*
* @var array
*/
protected $hideKey = array();
/**
* Values to hide
*
* @var array
*/
protected $hideValue = array();
/**
* Hide first label
*
* @var bool
*/
protected $hideFirst = FALSE;
/**
* Hide last label
*
* @var bool
*/
protected $hideLast = FALSE;
/**
* Build the label
*
* @param string $label First label
*/
public function __construct($label = NULL, $font = NULL, $color = NULL, $angle = 0) {
if(is_array($label)) {
$this->set($label);
} else if(is_string($label)) {
$this->set(array($label));
}
if($font === NULL) {
$font = new awFont2;
}
$this->setFont($font);
$this->setAngle($angle);
if($color instanceof awColor) {
$this->setColor($color);
} else {
$this->setColor(new awColor(0, 0, 0));
}
$this->move = new awPoint(0, 0);
$this->border = new awBorder;
$this->border->hide();
}
/**
* Get an element of the label from its key
*
* @param int $key Element key
* @return string A value
*/
public function get($key) {
return array_key_exists($key, $this->texts) ? $this->texts[$key] : NULL;
}
/**
* Get all labels
*
* @return array
*/
public function all() {
return $this->texts;
}
/**
* Set one or several labels
*
* @param array $labels Array of string or a string
*/
public function set($labels) {
if(is_array($labels)) {
$this->texts = $labels;
} else {
$this->texts = array((string)$labels);
}
}
/**
* Count number of texts in the label
*
* @return int
*/
public function count() {
return is_array($this->texts) ? count($this->texts) : 0;
}
/**
* Set a callback function for labels
*
* @param string $function
*/
public function setCallbackFunction($function) {
$this->function = is_null($function) ? $function : (string)$function;
}
/**
* Return the callback function for labels
*
* @return string
*/
public function getCallbackFunction() {
return $this->function;
}
/**
* Change labels format
*
* @param string $format New format (printf style: %.2f for example)
*/
public function setFormat($format) {
$function = 'label'.time().'_'.(microtime() * 1000000);
eval('function '.$function.'($value) {
return sprintf("'.addcslashes($format, '"').'", $value);
}');
$this->setCallbackFunction($function);
}
/**
* Change font for label
*
* @param awFont $font New font
* @param awColor $color Font color (can be NULL)
*/
public function setFont(awFont $font, $color = NULL) {
$this->font = $font;
if($color instanceof awColor) {
$this->setColor($color);
}
}
/**
* Change font angle
*
* @param int $angle New angle
*/
public function setAngle($angle) {
$this->angle = (int)$angle;
}
/**
* Change font color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Change text background
*
* @param mixed $background
*/
public function setBackground($background) {
$this->background = $background;
}
/**
* Change text background color
*
* @param Color
*/
public function setBackgroundColor(awColor $color) {
$this->background = $color;
}
/**
* Change text background gradient
*
* @param Gradient
*/
public function setBackgroundGradient(awGradient $gradient) {
$this->background = $gradient;
}
 
/**
* Change padding
*
* @param int $left Left padding
* @param int $right Right padding
* @param int $top Top padding
* @param int $bottom Bottom padding
*/
public function setPadding($left, $right, $top, $bottom) {
$this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom);
}
/**
* Hide all labels ?
*
* @param bool $hide
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Show all labels ?
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = (bool)!$show;
}
/**
* Hide a key
*
* @param int $key The key to hide
*/
public function hideKey($key) {
$this->hideKey[$key] = TRUE;
}
/**
* Hide a value
*
* @param int $value The value to hide
*/
public function hideValue($value) {
$this->hideValue[] = $value;
}
/**
* Hide first label
*
* @param bool $hide
*/
public function hideFirst($hide) {
$this->hideFirst = (bool)$hide;
}
/**
* Hide last label
*
* @param bool $hide
*/
public function hideLast($hide) {
$this->hideLast = (bool)$hide;
}
/**
* Set label interval
*
* @param int
*/
public function setInterval($interval) {
$this->interval = (int)$interval;
}
/**
* Change label position
*
* @param int $x Add this interval to X coord
* @param int $y Add this interval to Y coord
*/
public function move($x, $y) {
$this->move = $this->move->move($x, $y);
}
/**
* Change alignment
*
* @param int $h Horizontal alignment
* @param int $v Vertical alignment
*/
public function setAlign($h = NULL, $v = NULL) {
if($h !== NULL) {
$this->hAlign = (int)$h;
}
if($v !== NULL) {
$this->vAlign = (int)$v;
}
}
/**
* Get a text from the labele
*
* @param mixed $key Key in the array text
* @return Text
*/
public function getText($key) {
if(is_array($this->texts) and array_key_exists($key, $this->texts)) {
$value = $this->texts[$key];
if(is_string($this->function)) {
$value = call_user_func($this->function, $value);
}
$text = new awText($value);
$text->setFont($this->font);
$text->setAngle($this->angle);
$text->setColor($this->color);
if($this->background instanceof awColor) {
$text->setBackgroundColor($this->background);
} else if($this->background instanceof awGradient) {
$text->setBackgroundGradient($this->background);
}
$text->border = $this->border;
if($this->padding !== NULL) {
call_user_func_array(array($text, 'setPadding'), $this->padding);
}
return $text;
} else {
return NULL;
}
}
/**
* Get max width of all texts
*
* @param awDriver $driver A driver
* @return int
*/
public function getMaxWidth(awDriver $driver) {
return $this->getMax($driver, 'getTextWidth');
}
/**
* Get max height of all texts
*
* @param awDriver $driver A driver
* @return int
*/
public function getMaxHeight(awDriver $driver) {
return $this->getMax($driver, 'getTextHeight');
}
/**
* Draw the label
*
* @param awDriver $driver
* @param awPoint $p Label center
* @param int $key Text position in the array of texts (default to zero)
*/
public function draw(awDriver $driver, awPoint $p, $key = 0) {
if(($key % $this->interval) !== 0) {
return;
}
// Hide all labels
if($this->hide) {
return;
}
// Key is hidden
if(array_key_exists($key, $this->hideKey)) {
return;
}
// Hide first label
if($key === 0 and $this->hideFirst) {
return;
}
// Hide last label
if($key === count($this->texts) - 1 and $this->hideLast) {
return;
}
$text = $this->getText($key);
if($text !== NULL) {
// Value must be hidden
if(in_array($text->getText(), $this->hideValue)) {
return;
}
$x = $p->x;
$y = $p->y;
// Get padding
list($left, $right, $top, $bottom) = $text->getPadding();
// $font = $text->getFont();
$width = $driver->getTextWidth($text);
$height = $driver->getTextHeight($text);
switch($this->hAlign) {
case awLabel::RIGHT :
$x -= ($width + $right);
break;
case awLabel::CENTER :
$x -= ($width - $left + $right) / 2;
break;
case awLabel::LEFT :
$x += $left;
break;
}
switch($this->vAlign) {
case awLabel::TOP :
$y -= ($height + $bottom);
break;
case awLabel::MIDDLE :
$y -= ($height - $top + $bottom) / 2;
break;
case awLabel::BOTTOM :
$y += $top;
break;
}
$driver->string($text, $this->move->move($x, $y));
}
}
protected function getMax(awDriver $driver, $function) {
$max = NULL;
foreach($this->texts as $key => $text) {
$text = $this->getText($key);
$font = $text->getFont();
if(is_null($max)) {
$max = $font->{$function}($text);
} else {
$max = max($max, $font->{$function}($text));
}
}
return $max;
}
 
}
 
registerClass('Label');
?>
/trunk/bibliotheque/artichow/inc/Text.class.php
New file
0,0 → 1,233
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* To handle text
*
* @package Artichow
*/
class awText {
 
/**
* Your text
*
* @var string
*/
private $text;
 
/**
* Text font
*
* @var Font
*/
private $font;
 
/**
* Text angle
* Can be 0 or 90
*
* @var int
*/
private $angle;
 
/**
* Text color
*
* @var Color
*/
private $color;
 
/**
* Text background
*
* @var Color, Gradient
*/
private $background;
 
/**
* Padding
*
* @var array Array for left, right, top and bottom paddings
*/
private $padding;
 
/**
* Text border
*
* @var Border
*/
public $border;
/**
* Build a new awtext
*
* @param string $text Your text
*/
public function __construct($text, $font = NULL, $color = NULL, $angle = 0) {
if(is_null($font)) {
$font = new awFont2;
}
$this->setText($text);
$this->setFont($font);
// Set default color to black
if($color === NULL) {
$color = new awColor(0, 0, 0);
}
$this->setColor($color);
$this->setAngle($angle);
$this->border = new awBorder;
$this->border->hide();
}
/**
* Get text
*
* @return string
*/
public function getText() {
return $this->text;
}
/**
* Change text
*
* @param string $text New text
*/
public function setText($text) {
$this->text = (string)$text;
$this->text = str_replace("\r", "", $text);
}
 
/**
* Change text font
*
* @param Font
*/
public function setFont(awFont $font) {
$this->font = $font;
}
/**
* Get text font
*
* @return int
*/
public function getFont() {
return $this->font;
}
 
/**
* Change text angle
*
* @param int
*/
public function setAngle($angle) {
$this->angle = (int)$angle;
}
/**
* Get text angle
*
* @return int
*/
public function getAngle() {
return $this->angle;
}
 
/**
* Change text color
*
* @param Color
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Get text color
*
* @return Color
*/
public function getColor() {
return $this->color;
}
/**
* Change text background
*
* @param mixed $background
*/
public function setBackground($background) {
if($background instanceof awColor) {
$this->setBackgroundColor($background);
} elseif($background instanceof awGradient) {
$this->setBackgroundGradient($background);
}
}
/**
* Change text background color
*
* @param awColor $color
*/
public function setBackgroundColor(awColor $color) {
$this->background = $color;
}
/**
* Change text background gradient
*
* @param awGradient $gradient
*/
public function setBackgroundGradient(awGradient $gradient) {
$this->background = $gradient;
}
/**
* Get text background
*
* @return Color, Gradient
*/
public function getBackground() {
return $this->background;
}
 
/**
* Change padding
*
* @param int $left Left padding
* @param int $right Right padding
* @param int $top Top padding
* @param int $bottom Bottom padding
*/
public function setPadding($left, $right, $top, $bottom) {
$this->padding = array((int)$left, (int)$right, (int)$top, (int)$bottom);
}
/**
* Get current padding
*
* @return array
*/
public function getPadding() {
return $this->padding;
}
 
}
 
registerClass('Text');
?>
/trunk/bibliotheque/artichow/inc/drivers/gd.class.php
New file
0,0 → 1,1336
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Driver.class.php";
 
/**
* Draw your objects
*
* @package Artichow
*/
 
class awGDDriver extends Driver {
/**
* A GD resource
*
* @var $resource
*/
public $resource;
public function __construct() {
parent::__construct();
$this->driverString = 'gd';
}
 
public function init(awImage $image) {
if($this->resource === NULL) {
$this->setImageSize($image->width, $image->height);
// Create image
$this->resource = imagecreatetruecolor($this->imageWidth, $this->imageHeight);
if(!$this->resource) {
awImage::drawError("Class Image: Unable to create a graph.");
}
imagealphablending($this->resource, TRUE);
// Antialiasing is now handled by the Driver object
$this->setAntiAliasing($image->getAntiAliasing());
// Original color
$this->filledRectangle(
new awWhite,
new awLine(
new awPoint(0, 0),
new awPoint($this->imageWidth, $this->imageHeight)
)
);
$shadow = $image->shadow;
if($shadow !== NULL) {
$shadow = $shadow->getSpace();
$p1 = new awPoint($shadow->left, $shadow->top);
$p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1);
// Draw image background
$this->filledRectangle($image->getBackground(), new awLine($p1, $p2));
// Draw image border
$image->border->rectangle($this, $p1, $p2);
}
}
}
public function initFromFile(awFileImage $fileImage, $file) {
$image = @getimagesize((string)$file);
if($image and in_array($image[2], array(2, 3))) {
$fileImage->setSize($image[0], $image[1]);
switch($image[2]) {
case 2 :
$this->resource = imagecreatefromjpeg($file);
break;
case 3 :
$this->resource = imagecreatefrompng($file);
break;
}
 
$this->setImageSize($fileImage->width, $fileImage->height);
} else {
awImage::drawError("Class FileImage: Artichow does not support the format of this image (must be in PNG or JPEG)");
}
}
public function setImageSize($width, $height) {
$this->imageWidth = $width;
$this->imageHeight = $height;
}
public function setPosition($x, $y) {
// Calculate absolute position
$this->x = round($x * $this->imageWidth - $this->w / 2);
$this->y = round($y * $this->imageHeight - $this->h / 2);
}
public function setAbsPosition($x, $y) {
$this->x = $x;
$this->y = $y;
}
public function movePosition($x, $y) {
 
$this->x += (int)$x;
$this->y += (int)$y;
}
public function setSize($w, $h) {
// Calcul absolute size
$this->w = round($w * $this->imageWidth);
$this->h = round($h * $this->imageHeight);
return $this->getSize();
}
public function setAbsSize($w, $h) {
$this->w = $w;
$this->h = $h;
return $this->getSize();
}
public function getSize() {
return array($this->w, $this->h);
}
public function setAntiAliasing($bool) {
if(function_exists('imageantialias')) {
imageantialias($this->resource, (bool)$bool);
 
$this->antiAliasing = (bool)$bool;
} else {
awImage::drawErrorFile('missing-anti-aliasing');
}
}
public function getColor(awColor $color) {
 
if($color->alpha === 0 or function_exists('imagecolorallocatealpha') === FALSE) {
$gdColor = imagecolorallocate($this->resource, $color->red, $color->green, $color->blue);
} else {
$gdColor = imagecolorallocatealpha($this->resource, $color->red, $color->green, $color->blue, $color->alpha);
}
 
return $gdColor;
}
public function copyImage(awImage $image, awPoint $p1, awPoint $p2) {
list($x1, $y1) = $p1->getLocation();
list($x2, $y2) = $p2->getLocation();
$driver = $image->getDriver();
imagecopy($this->resource, $driver->resource, $this->x + $x1, $this->y + $y1, 0, 0, $x2 - $x1, $y2 - $y1);
}
public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE) {
if($resample) {
$function = 'imagecopyresampled';
} else {
$function = 'imagecopyresized';
}
$driver = $image->getDriver();
$function(
$this->resource,
$driver->resource,
$this->x + $d1->x, $this->y + $d1->y,
$s1->x, $s1->y,
$d2->x - $d1->x, $d2->y - $d1->y,
$s2->x - $s1->x, $s2->y - $s1->y
);
}
public function string(awText $text, awPoint $point, $width = NULL) {
$font = $text->getFont();
// Can we deal with that font?
if($this->isCompatibleWithFont($font) === FALSE) {
awImage::drawError('Class GDDriver: Incompatible font type (\''.get_class($font).'\')');
}
// Check which FontDriver to use
if($font instanceof awPHPFont) {
$fontDriver = $this->phpFontDriver;
} else {
$fontDriver = $this->fileFontDriver;
}
if($text->getBackground() !== NULL or $text->border->visible()) {
list($left, $right, $top, $bottom) = $text->getPadding();
 
$textWidth = $fontDriver->getTextWidth($text, $this);
$textHeight = $fontDriver->getTextHeight($text, $this);
$x1 = floor($point->x - $left);
$y1 = floor($point->y - $top);
$x2 = $x1 + $textWidth + $left + $right;
$y2 = $y1 + $textHeight + $top + $bottom;
$this->filledRectangle(
$text->getBackground(),
awLine::build($x1, $y1, $x2, $y2)
);
$text->border->rectangle(
$this,
new awPoint($x1 - 1, $y1 - 1),
new awPoint($x2 + 1, $y2 + 1)
);
}
$fontDriver->string($this, $text, $point, $width);
}
public function point(awColor $color, awPoint $p) {
if($p->isHidden() === FALSE) {
$rgb = $this->getColor($color);
imagesetpixel($this->resource, $this->x + round($p->x), $this->y + round($p->y), $rgb);
}
}
public function line(awColor $color, awLine $line) {
if($line->thickness > 0 and $line->isHidden() === FALSE) {
$rgb = $this->getColor($color);
$thickness = $line->thickness;
list($p1, $p2) = $line->getLocation();
$this->startThickness($thickness);
switch($line->getStyle()) {
case awLine::SOLID :
imageline($this->resource, $this->x + round($p1->x), $this->y + round($p1->y), $this->x + round($p2->x), $this->y + round($p2->y), $rgb);
break;
case awLine::DOTTED :
$size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2));
$cos = ($p2->x - $p1->x) / $size;
$sin = ($p2->y - $p1->y) / $size;
for($i = 0; $i <= $size; $i += 2) {
$p = new awPoint(
round($i * $cos + $p1->x),
round($i * $sin + $p1->y)
);
$this->point($color, $p);
}
break;
case awLine::DASHED :
$width = $p2->x - $p1->x;
$height = $p2->y - $p1->y;
$size = sqrt(pow($height, 2) + pow($width, 2));
if($size == 0) {
return;
}
$cos = $width / $size;
$sin = $height / $size;
$functionX = ($width > 0) ? 'min' : 'max';
$functionY = ($height > 0) ? 'min' : 'max';
for($i = 0; $i <= $size; $i += 6) {
$t1 = new awPoint(
round($i * $cos + $p1->x),
round($i * $sin + $p1->y)
);
$t2 = new awPoint(
round($functionX(($i + 3) * $cos, $width) + $p1->x),
round($functionY(($i + 3) * $sin, $height) + $p1->y)
);
$this->line($color, new awLine($t1, $t2));
}
break;
}
$this->stopThickness($thickness);
}
}
public function arc(awColor $color, awPoint $center, $width, $height, $from, $to) {
imagefilledarc(
$this->resource,
$this->x + $center->x, $this->y + $center->y,
$width, $height,
$from, $to,
$this->getColor($color),
IMG_ARC_EDGED | IMG_ARC_NOFILL
);
}
public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to) {
imagefilledarc(
$this->resource,
$this->x + $center->x, $this->y + $center->y,
$width, $height,
$from, $to,
$this->getColor($color),
IMG_ARC_PIE
);
}
public function ellipse(awColor $color, awPoint $center, $width, $height) {
list($x, $y) = $center->getLocation();
$rgb = $this->getColor($color);
imageellipse(
$this->resource,
$this->x + $x,
$this->y + $y,
$width,
$height,
$rgb
);
}
public function filledEllipse($background, awPoint $center, $width, $height) {
if($background instanceof awColor) {
list($x, $y) = $center->getLocation();
$rgb = $this->getColor($background);
imagefilledellipse(
$this->resource,
$this->x + $x,
$this->y + $y,
$width,
$height,
$rgb
);
} else if($background instanceof awGradient) {
list($x, $y) = $center->getLocation();
$x1 = $x - round($width / 2);
$y1 = $y - round($height / 2);
$x2 = $x1 + $width;
$y2 = $y1 + $height;
$gradientDriver = new awGDGradientDriver($this);
$gradientDriver->filledEllipse(
$background,
$x1, $y1,
$x2, $y2
);
}
}
public function rectangle(awColor $color, awLine $line) {
list($p1, $p2) = $line->getLocation();
switch($line->getStyle()) {
case awLine::SOLID :
$thickness = $line->getThickness();
$this->startThickness($thickness);
$rgb = $this->getColor($color);
imagerectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb);
$this->stopThickness($thickness);
break;
default :
$side = clone $line;
// Top side
$side->setLocation(
new awPoint($p1->x, $p1->y),
new awPoint($p2->x, $p1->y)
);
$this->line($color, $side);
// Right side
$side->setLocation(
new awPoint($p2->x, $p1->y),
new awPoint($p2->x, $p2->y)
);
$this->line($color, $side);
// Bottom side
$side->setLocation(
new awPoint($p1->x, $p2->y),
new awPoint($p2->x, $p2->y)
);
$this->line($color, $side);
// Left side
$side->setLocation(
new awPoint($p1->x, $p1->y),
new awPoint($p1->x, $p2->y)
);
$this->line($color, $side);
break;
}
}
public function filledRectangle($background, awLine $line) {
$p1 = $line->p1;
$p2 = $line->p2;
if($background instanceof awColor) {
$rgb = $this->getColor($background);
imagefilledrectangle($this->resource, $this->x + $p1->x, $this->y + $p1->y, $this->x + $p2->x, $this->y + $p2->y, $rgb);
} else if($background instanceof awGradient) {
$gradientDriver = new awGDGradientDriver($this);
$gradientDriver->filledRectangle($background, $p1, $p2);
}
}
public function polygon(awColor $color, awPolygon $polygon) {
switch($polygon->getStyle()) {
case awPolygon::SOLID :
$thickness = $polygon->getThickness();
$this->startThickness($thickness);
$points = $this->getPolygonPoints($polygon);
$rgb = $this->getColor($color);
imagepolygon($this->resource, $points, $polygon->count(), $rgb);
$this->stopThickness($thickness);
break;
default :
if($polygon->count() > 1) {
$prev = $polygon->get(0);
$line = new awLine;
$line->setStyle($polygon->getStyle());
$line->setThickness($polygon->getThickness());
for($i = 1; $i < $polygon->count(); $i++) {
$current = $polygon->get($i);
$line->setLocation($prev, $current);
$this->line($color, $line);
$prev = $current;
}
// Close the polygon
$line->setLocation($prev, $polygon->get(0));
$this->line($color, $line);
}
}
}
public function filledPolygon($background, awPolygon $polygon) {
if($background instanceof awColor) {
$points = $this->getPolygonPoints($polygon);
$rgb = $this->getColor($background);
imagefilledpolygon($this->resource, $points, $polygon->count(), $rgb);
} else if($background instanceof awGradient) {
$gradientDriver = new awGDGradientDriver($this);
$gradientDriver->filledPolygon($background, $polygon);
}
 
}
 
public function send(awImage $image) {
 
$this->drawImage($image);
 
}
public function get(awImage $image) {
return $this->drawImage($image, TRUE, FALSE);
}
public function getTextWidth(awText $text) {
$font = $text->getFont();
if($font instanceof awPHPFont) {
$fontDriver = $this->phpFontDriver;
} else {
$fontDriver = $this->fileFontDriver;
}
return $fontDriver->getTextWidth($text, $this);
}
public function getTextHeight(awText $text) {
$font = $text->getFont();
if($font instanceof awPHPFont) {
$fontDriver = $this->phpFontDriver;
} else {
$fontDriver = $this->fileFontDriver;
}
return $fontDriver->getTextHeight($text, $this);
}
protected function isCompatibleWithFont(awFont $font) {
if($font instanceof awFDBFont) {
return FALSE;
} else {
return TRUE;
}
}
private function drawImage(awImage $image, $return = FALSE, $header = TRUE) {
$format = $image->getFormatString();
// Test if format is available
if((imagetypes() & $image->getFormat()) === FALSE) {
awImage::drawError("Class Image: Format '".$format."' is not available on your system. Check that your PHP has been compiled with the good libraries.");
}
// Get some infos about this image
switch($format) {
case 'jpeg' :
$function = 'imagejpeg';
break;
case 'png' :
$function = 'imagepng';
break;
case 'gif' :
$function = 'imagegif';
break;
}
// Send headers to the browser
if($header === TRUE) {
$image->sendHeaders();
}
if($return) {
ob_start();
}
$function($this->resource);
if($return) {
return ob_get_clean();
}
}
private function getPolygonPoints(awPolygon $polygon) {
$points = array();
foreach($polygon->all() as $point) {
$points[] = $point->x + $this->x;
$points[] = $point->y + $this->y;
}
return $points;
}
private function startThickness($thickness) {
if($thickness > 1) {
// Beurk :'(
if($this->antiAliasing and function_exists('imageantialias')) {
imageantialias($this->resource, FALSE);
}
imagesetthickness($this->resource, $thickness);
}
}
private function stopThickness($thickness) {
if($thickness > 1) {
if($this->antiAliasing and function_exists('imageantialias')) {
imageantialias($this->resource, TRUE);
}
imagesetthickness($this->resource, 1);
}
}
 
}
 
registerClass('GDDriver');
 
/**
* To your gradients
*
* @package Artichow
*/
 
class awGDGradientDriver {
 
/**
* A driver
*
* @var awGDDriver
*/
protected $driver;
 
/**
* Build your GDGradientDriver
*
* @var awGDDriver $driver
*/
public function __construct(awGDDriver $driver) {
$this->driver = $driver;
}
public function drawFilledFlatTriangle(awGradient $gradient, awPoint $a, awPoint $b, awPoint $c) {
if($gradient->angle !== 0) {
awImage::drawError("Class GDGradientDriver: Flat triangles can only be used with 0 degree gradients.");
}
// Look for right-angled triangle
if($a->x !== $b->x and $b->x !== $c->x) {
awImage::drawError("Class GDGradientDriver: Not right-angled flat triangles are not supported yet.");
}
if($a->x === $b->x) {
$d = $a;
$e = $c;
} else {
$d = $c;
$e = $a;
}
$this->init($gradient, $b->y - $d->y);
for($i = $c->y + 1; $i < $b->y; $i++) {
$color = $this->color($i - $d->y);
$pos = ($i - $d->y) / ($b->y - $d->y);
$p1 = new awPoint($e->x, $i);
$p2 = new awPoint(1 + floor($e->x - $pos * ($e->x - $d->x)), $i);
$this->driver->filledRectangle($color, new awLine($p1, $p2));
unset($color);
}
}
protected function drawFilledTriangle(awGradient $gradient, awPolygon $polygon) {
if($gradient->angle === 0) {
$this->drawFilledTriangleVertically($gradient, $polygon);
} elseif($gradient->angle === 90) {
$this->drawFilledTriangleHorizontally($gradient, $polygon);
}
}
private function drawFilledTriangleVertically(awGradient $gradient, awPolygon $polygon) {
list($yMin, $yMax) = $polygon->getBoxYRange();
$this->init($gradient, $yMax - $yMin);
// Get the triangle line we will draw our lines from
$fromLine = NULL;
$lines = $polygon->getLines();
$count = count($lines);
// Pick the side of the triangle going from the top
// to the bottom of the surrounding box
for($i = 0; $i < $count; $i++) {
if($lines[$i]->isTopToBottom($polygon)) {
list($fromLine) = array_splice($lines, $i, 1);
break;
}
}
// If for some reason the three points are aligned,
// $fromLine will still be NULL
if($fromLine === NULL) {
return;
}
$fillLine = NULL;
for($y = round($yMin); $y < round($yMax); $y++) {
$fromX = $fromLine->getXFrom($y);
$toX = array();
foreach($lines as $line) {
$xValue = $line->getXFrom($y);
if(!is_null($xValue)) {
$toX[] = $xValue;
}
}
if(count($toX) === 1) {
$fillLine = new Line(
new Point($fromX, $y),
new Point($toX[0], $y)
);
} else {
$line1 = new Line(
new Point($fromX, $y),
new Point($toX[0], $y)
);
$line2 = new Line(
new Point($fromX, $y),
new Point($toX[1], $y)
);
if($line1->getSize() < $line2->getSize()) {
$fillLine = $line1;
} else {
$fillLine = $line2;
}
}
if(!$fillLine->isPoint()) {
$color = $this->color($y - $yMin);
$this->driver->line($color, $fillLine);
unset($color);
}
}
}
private function drawFilledTriangleHorizontally(awGradient $gradient, awPolygon $polygon) {
list($xMin, $xMax) = $polygon->getBoxXRange();
$this->init($gradient, $xMax - $xMin);
// Get the triangle line we will draw our lines from
$fromLine = NULL;
$lines = $polygon->getLines();
$count = count($lines);
// Pick the side of the triangle going all the way
// from the left side to the right side of the surrounding box
for($i = 0; $i < $count; $i++) {
if($lines[$i]->isLeftToRight($polygon)) {
list($fromLine) = array_splice($lines, $i, 1);
break;
}
}
// If for some reason the three points are aligned,
// $fromLine will still be NULL
if($fromLine === NULL) {
return;
}
 
$fillLine = NULL;
for($x = round($xMin); $x < round($xMax); $x++) {
$fromY = floor($fromLine->getYFrom($x));
$toY = array();
foreach($lines as $line) {
$yValue = $line->getYFrom($x);
if(!is_null($yValue)) {
$toY[] = floor($yValue);
}
}
if(count($toY) === 1) {
$fillLine = new Line(
new Point($x, $fromY),
new Point($x, $toY[0])
);
} else {
$line1 = new Line(
new Point($x, $fromY),
new Point($x, $toY[0])
);
$line2 = new Line(
new Point($x, $fromY),
new Point($x, $toY[1])
);
if($line1->getSize() < $line2->getSize()) {
$fillLine = $line1;
} else {
$fillLine = $line2;
}
}
$color = $this->color($x - $xMin);
if($fillLine->isPoint()) {
$this->driver->point($color, $fillLine->p1);
} elseif($fillLine->getSize() >= 1) {
$this->driver->line($color, $fillLine);
}
unset($color);
}
}
public function filledRectangle(awGradient $gradient, awPoint $p1, awPoint $p2) {
list($x1, $y1) = $p1->getLocation();
list($x2, $y2) = $p2->getLocation();
if($y1 < $y2) {
$y1 ^= $y2 ^= $y1 ^= $y2;
}
if($x2 < $x1) {
$x1 ^= $x2 ^= $x1 ^= $x2;
}
if($gradient instanceof awLinearGradient) {
$this->rectangleLinearGradient($gradient, new awPoint($x1, $y1), new awPoint($x2, $y2));
} else {
awImage::drawError("Class GDGradientDriver: This gradient is not supported by rectangles.");
}
}
public function filledPolygon(awGradient $gradient, awPolygon $polygon) {
if($gradient instanceof awLinearGradient) {
$this->polygonLinearGradient($gradient, $polygon);
} else {
awImage::drawError("Class GDGradientDriver: This gradient is not supported by polygons.");
}
}
protected function rectangleLinearGradient(awLinearGradient $gradient, awPoint $p1, awPoint $p2) {
list($x1, $y1) = $p1->getLocation();
list($x2, $y2) = $p2->getLocation();
if($y1 - $y2 > 0) {
if($gradient->angle === 0) {
$this->init($gradient, $y1 - $y2);
for($i = $y2; $i <= $y1; $i++) {
$color = $this->color($i - $y2);
$p1 = new awPoint($x1, $i);
$p2 = new awPoint($x2, $i);
$this->driver->filledRectangle($color, new awLine($p1, $p2));
unset($color);
}
} else if($gradient->angle === 90) {
$this->init($gradient, $x2 - $x1);
for($i = $x1; $i <= $x2; $i++) {
$color = $this->color($i - $x1);
$p1 = new awPoint($i, $y2);
$p2 = new awPoint($i, $y1);
$this->driver->filledRectangle($color, new awLine($p1, $p2));
unset($color);
}
}
}
}
public function filledEllipse(awGradient $gradient, $x1, $y1, $x2, $y2) {
if($y1 < $y2) {
$y1 ^= $y2 ^= $y1 ^= $y2;
}
if($x2 < $x1) {
$x1 ^= $x2 ^= $x1 ^= $x2;
}
if($gradient instanceof awRadialGradient) {
$this->ellipseRadialGradient($gradient, $x1, $y1, $x2, $y2);
} else if($gradient instanceof awLinearGradient) {
$this->ellipseLinearGradient($gradient, $x1, $y1, $x2, $y2);
} else {
awImage::drawError("Class GDGradientDriver: This gradient is not supported by ellipses.");
}
}
protected function ellipseRadialGradient(awGradient $gradient, $x1, $y1, $x2, $y2) {
if($y1 - $y2 > 0) {
if($y1 - $y2 != $x2 - $x1) {
awImage::drawError("Class GDGradientDriver: Radial gradients are only implemented on circle, not ellipses.");
}
$c = new awPoint($x1 + ($x2 - $x1) / 2, $y1 + ($y2 - $y1) / 2);
$r = ($x2 - $x1) / 2;
$ok = array();
// Init gradient
$this->init($gradient, $r);
for($i = 0; $i <= $r; $i += 0.45) {
$p = ceil((2 * M_PI * $i));
if($p > 0) {
$interval = 360 / $p;
} else {
$interval = 360;
}
$color = $this->color($i);
for($j = 0; $j < 360; $j += $interval) {
$rad = ($j / 360) * (2 * M_PI);
$x = round($i * cos($rad));
$y = round($i * sin($rad));
$l = sqrt($x * $x + $y * $y);
if($l <= $r) {
if(
array_key_exists((int)$x, $ok) === FALSE or
array_key_exists((int)$y, $ok[$x]) === FALSE
) {
// Print the point
$this->driver->point($color, new awPoint($c->x + $x, $c->y + $y));
$ok[(int)$x][(int)$y] = TRUE;
}
}
}
unset($color);
}
}
}
protected function ellipseLinearGradient(awGradient $gradient, $x1, $y1, $x2, $y2) {
// Gauche->droite : 90°
if($y1 - $y2 > 0) {
if($y1 - $y2 != $x2 - $x1) {
awImage::drawError("Class GDGradientDriver: Linear gradients are only implemented on circle, not ellipses.");
}
$r = ($x2 - $x1) / 2;
// Init gradient
$this->init($gradient, $x2 - $x1);
for($i = -$r; $i <= $r; $i++) {
$h = sin(acos($i / $r)) * $r;
$color = $this->color($i + $r);
if($gradient->angle === 90) {
// Print the line
$p1 = new awPoint(
$x1 + $i + $r,
round(max($y2 + $r - $h + 1, $y2))
);
$p2 = new awPoint(
$x1 + $i + $r,
round(min($y1 - $r + $h - 1, $y1))
);
} else {
// Print the line
$p1 = new awPoint(
round(max($x1 + $r - $h + 1, $x1)),
$y2 + $i + $r
);
$p2 = new awPoint(
round(min($x2 - $r + $h - 1, $x2)),
$y2 + $i + $r
);
}
$this->driver->filledRectangle($color, new awLine($p1, $p2));
unset($color);
}
}
}
protected function polygonLinearGradient(awLinearGradient $gradient, awPolygon $polygon) {
$count = $polygon->count();
if($count >= 4) {
$left = $polygon->get(0);
$right = $polygon->get($count - 1);
if($gradient->angle === 0) {
// Get polygon maximum and minimum
$offset = $polygon->get(0);
$max = $min = $offset->y;
for($i = 1; $i < $count - 1; $i++) {
$offset = $polygon->get($i);
$max = max($max, $offset->y);
$min = min($min, $offset->y);
}
$this->init($gradient, $max - $min);
$prev = $polygon->get(1);
$sum = 0;
for($i = 2; $i < $count - 1; $i++) {
$current = $polygon->get($i);
$interval = 1;
if($i !== $count - 2) {
$current->x -= $interval;
}
if($current->x - $prev->x > 0) {
// Draw rectangle
$x1 = $prev->x;
$x2 = $current->x;
$y1 = max($prev->y, $current->y);
$y2 = $left->y;
$gradient = new awLinearGradient(
$this->color($max - $min - ($y2 - $y1)),
$this->color($max - $min),
0
);
if($y1 > $y2) {
$y2 = $y1;
}
$this->driver->filledRectangle(
$gradient,
awLine::build($x1, $y1, $x2, $y2)
);
$top = ($prev->y < $current->y) ? $current : $prev;
$bottom = ($prev->y >= $current->y) ? $current : $prev;
$gradient = new awLinearGradient(
$this->color($bottom->y - $min),
$this->color($max - $min - ($y2 - $y1)),
0
);
$gradientDriver = new awGDGradientDriver($this->driver);
$gradientDriver->drawFilledFlatTriangle(
$gradient,
new awPoint($prev->x, min($prev->y, $current->y)),
$top,
new awPoint($current->x, min($prev->y, $current->y))
);
unset($gradientDriver);
$sum += $current->x - $prev->x;
}
$prev = $current;
$prev->x += $interval;
}
} else if($gradient->angle === 90) {
$width = $right->x - $left->x;
$this->init($gradient, $width);
$pos = 1;
$next = $polygon->get($pos++);
$this->next($polygon, $pos, $prev, $next);
for($i = 0; $i <= $width; $i++) {
$x = $left->x + $i;
$y1 = round($prev->y + ($next->y - $prev->y) * (($i + $left->x - $prev->x) / ($next->x - $prev->x)));
$y2 = $left->y;
// Draw line
$color = $this->color($i);
// YaPB : PHP does not handle alpha on lines
$this->driver->filledRectangle($color, awLine::build($x, $y1, $x, $y2));
 
unset($color);
// Jump to next point
if($next->x == $i + $left->x) {
$this->next($polygon, $pos, $prev, $next);
}
}
}
} else if($count === 3) {
$this->drawFilledTriangle(
$gradient,
$polygon
);
}
}
private function next($polygon, &$pos, &$prev, &$next) {
do {
$prev = $next;
$next = $polygon->get($pos++);
}
while($next->x - $prev->x == 0 and $pos < $polygon->count());
}
/**
* Start colors
*
* @var int
*/
private $r1, $g1, $b1, $a1;
/**
* Stop colors
*
* @var int
*/
private $r2, $g2, $b2, $a2;
/**
* Gradient size in pixels
*
* @var int
*/
private $size;
private function init(awGradient $gradient, $size) {
list(
$this->r1, $this->g1, $this->b1, $this->a1
) = $gradient->from->rgba();
list(
$this->r2, $this->g2, $this->b2, $this->a2
) = $gradient->to->rgba();
$this->size = $size;
}
private function color($pos) {
return new awColor(
$this->getRed($pos),
$this->getGreen($pos),
$this->getBlue($pos),
$this->getAlpha($pos)
);
}
private function getRed($pos) {
if((float)$this->size !== 0.0) {
return (int)round($this->r1 + ($pos / $this->size) * ($this->r2 - $this->r1));
} else {
return 0;
}
}
private function getGreen($pos) {
if((float)$this->size !== 0.0) {
return (int)round($this->g1 + ($pos / $this->size) * ($this->g2 - $this->g1));
} else {
return 0;
}
}
private function getBlue($pos) {
if((float)$this->size !== 0.0) {
return (int)round($this->b1 + ($pos / $this->size) * ($this->b2 - $this->b1));
} else {
return 0;
}
}
private function getAlpha($pos) {
if((float)$this->size !== 0.0) {
return (int)round(($this->a1 + ($pos / $this->size) * ($this->a2 - $this->a1)) / 127 * 100);
} else {
return 0;
}
}
 
}
 
registerClass('GDGradientDriver');
 
/*
* Check for GD2
*/
if(function_exists('imagecreatetruecolor') === FALSE) {
awImage::drawErrorFile('missing-gd2');
}
 
?>
/trunk/bibliotheque/artichow/inc/drivers/ming.class.php
New file
0,0 → 1,774
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Driver.class.php";
 
/**
* Draw your objects
*
* @package Artichow
*/
class awMingDriver extends awDriver {
/**
* The Flash movie
*
* @var $movie
*/
public $movie;
public function __construct() {
parent::__construct();
$this->driverString = 'ming';
// Nice defaults
ming_setScale(20.0);
ming_useswfversion(6);
 
}
/**
* Initialize the driver for a particular awImage object
*
* @param awImage $image
*/
public function init(awImage $image) {
 
if($this->movie === NULL) {
$this->setImageSize($image->width, $image->height);
// Create movie
$this->movie = new SWFMovie();
if(!$this->movie) {
awImage::drawError("Class Image: Unable to create a graph.");
}
$this->movie->setDimension($image->width, $image->height);
$this->setAntiAliasing($image->getAntiAliasing());
// Original color
$this->filledRectangle(
new awWhite,
new awLine(
new awPoint(0, 0),
new awPoint($this->imageWidth, $this->imageHeight)
)
);
$shadow = $image->shadow;
if($shadow !== NULL) {
$shadow = $shadow->getSpace();
$p1 = new awPoint($shadow->left, $shadow->top);
$p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1);
// Draw image background
$this->filledRectangle($image->getBackground(), new awLine($p1, $p2));
// Draw image border
$image->border->rectangle($this, $p1, $p2);
}
}
}
/**
* Initialize the Driver for a particular FileImage object
*
* @param awFileImage $fileImage The FileImage object to work on
* @param string $file Image filename
*/
public function initFromFile(awFileImage $fileImage, $file) {
}
/**
* Change the image size
*
* @param int $width Image width
* @param int $height Image height
*/
public function setImageSize($width, $height) {
$this->imageWidth = $width;
$this->imageHeight = $height;
}
/**
* Inform the driver of the position of your image
*
* @param float $x Position on X axis of the center of the component
* @param float $y Position on Y axis of the center of the component
*/
public function setPosition($x, $y) {
// Calculate absolute position
$this->x = round($x * $this->imageWidth - $this->w / 2);
$this->y = round($y * $this->imageHeight - $this->h / 2);
}
/**
* Inform the driver of the position of your image
* This method need absolutes values
*
* @param int $x Left-top corner X position
* @param int $y Left-top corner Y position
*/
public function setAbsPosition($x, $y) {
$this->x = $x;
$this->y = $y;
}
/**
* Move the position of the image
*
* @param int $x Add this value to X axis
* @param int $y Add this value to Y axis
*/
public function movePosition($x, $y) {
$this->x += (int)$x;
$this->y += (int)$y;
}
/**
* Inform the driver of the size of your image
* Height and width must be between 0 and 1.
*
* @param int $w Image width
* @param int $h Image height
* @return array Absolute width and height of the image
*/
public function setSize($w, $h) {
// Calcul absolute size
$this->w = round($w * $this->imageWidth);
$this->h = round($h * $this->imageHeight);
return $this->getSize();
}
/**
* Inform the driver of the size of your image
* You can set absolute size with this method.
*
* @param int $w Image width
* @param int $h Image height
*/
public function setAbsSize($w, $h) {
$this->w = $w;
$this->h = $h;
return $this->getSize();
}
/**
* Get the size of the component handled by the driver
*
* @return array Absolute width and height of the component
*/
public function getSize() {
return array($this->w, $this->h);
}
/**
* Turn antialiasing on or off
*
* @var bool $bool
*/
public function setAntiAliasing($bool) {
if($this->movie !== NULL) {
 
$actionscript = '
_quality = "%s";
';
 
if((bool)$bool) {
$actionscript = sprintf($actionscript, 'high');
} else {
$actionscript = sprintf($actionscript, 'low');
}
$this->movie->add(new SWFAction(str_replace("\r", "", $actionscript)));
}
}
/**
* When passed a Color object, returns the corresponding
* color identifier (driver dependant).
*
* @param awColor $color A Color object
* @return array $rgba A color identifier representing the color composed of the given RGB components
*/
public function getColor(awColor $color) {
// Ming simply works with R, G, B and Alpha values.
list($red, $green, $blue, $alpha) = $color->rgba();
// However, the Ming alpha channel ranges from 255 (opaque) to 0 (transparent),
// while the awColor alpha channel ranges from 0 (opaque) to 100 (transparent).
// First, we convert from 0-100 to 0-255.
$alpha = (int)($alpha * 255 / 100);
// Then from 0-255 to 255-0.
$alpha = abs($alpha - 255);
return array($red, $green, $blue, $alpha);
}
/**
* Draw an image here
*
* @param awImage $image Image
* @param int $p1 Image top-left point
* @param int $p2 Image bottom-right point
*/
public function copyImage(awImage $image, awPoint $p1, awPoint $p2) {
}
/**
* Draw an image here
*
* @param awImage $image Image
* @param int $d1 Destination top-left position
* @param int $d2 Destination bottom-right position
* @param int $s1 Source top-left position
* @param int $s2 Source bottom-right position
* @param bool $resample Resample image ? (default to TRUE)
*/
public function copyResizeImage(awImage $image, awPoint $d1, awPoint $d2, awPoint $s1, awPoint $s2, $resample = TRUE) {
}
/**
* Draw a string
*
* @var awText $text Text to print
* @param awPoint $point Draw the text at this point
* @param int $width Text max width
*/
public function string(awText $text, awPoint $point, $width = NULL) {
$font = $text->getFont();
// Can we deal with that font?
if($this->isCompatibleWithFont($font) === FALSE) {
awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')');
}
// Ming can only work with awFileFont objects for now
// (i.e. awFDBFont, or awTuffy et al.)
$fontDriver = $this->fileFontDriver;
if($text->getBackground() !== NULL or $text->border->visible()) {
list($left, $right, $top, $bottom) = $text->getPadding();
 
$textWidth = $fontDriver->getTextWidth($text, $this);
$textHeight = $fontDriver->getTextHeight($text, $this);
$x1 = floor($point->x - $left);
$y1 = floor($point->y - $top);
$x2 = $x1 + $textWidth + $left + $right;
$y2 = $y1 + $textHeight + $top + $bottom;
$this->filledRectangle(
$text->getBackground(),
awLine::build($x1, $y1, $x2, $y2)
);
$text->border->rectangle(
$this,
new awPoint($x1 - 1, $y1 - 1),
new awPoint($x2 + 1, $y2 + 1)
);
}
$fontDriver->string($this, $text, $point, $width);
}
/**
* Draw a pixel
*
* @param awColor $color Pixel color
* @param awPoint $p
*/
public function point(awColor $color, awPoint $p) {
if($p->isHidden() === FALSE) {
list($red, $green, $blue, $alpha) = $this->getColor($color);
$point = new SWFShape();
$point->setLine(1, $red, $green, $blue, $alpha);
$point->movePenTo($this->x + round($p->x), $this->y + round($p->y));
$point->drawLine(0.5, 0.5);
$point->movePen(-0.5, 0);
$point->drawLine(0.5, -0.5);
$this->movie->add($point);
}
}
/**
* Draw a colored line
*
* @param awColor $color Line color
* @param awLine $line
* @param int $thickness Line tickness
*/
public function line(awColor $color, awLine $line) {
if($line->getThickness() > 0 and $line->isHidden() === FALSE) {
list($red, $green, $blue, $alpha) = $this->getColor($color);
 
$mingLine = new SWFShape();
$mingLine->setLine($line->getThickness(), $red, $green, $blue, $alpha);
 
list($p1, $p2) = $line->getLocation();
$mingLine->movePenTo($this->x + round($p1->x), $this->y + round($p1->y));
 
switch($line->getStyle()) {
case awLine::SOLID :
$mingLine->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y));
$this->movie->add($mingLine);
break;
case awLine::DOTTED :
$size = sqrt(pow($p2->y - $p1->y, 2) + pow($p2->x - $p1->x, 2));
$cos = ($p2->x - $p1->x) / $size;
$sin = ($p2->y - $p1->y) / $size;
for($i = 0; $i <= $size; $i += 2) {
$p = new awPoint(
round($i * $cos + $p1->x),
round($i * $sin + $p1->y)
);
$this->point($color, $p);
}
break;
case awLine::DASHED :
$width = $p2->x - $p1->x;
$height = $p2->y - $p1->y;
$size = sqrt(pow($height, 2) + pow($width, 2));
if($size == 0) {
return;
}
$cos = $width / $size;
$sin = $height / $size;
$functionX = ($width > 0) ? 'min' : 'max';
$functionY = ($height > 0) ? 'min' : 'max';
for($i = 0; $i <= $size; $i += 6) {
$t1 = new awPoint(
round($i * $cos + $p1->x),
round($i * $sin + $p1->y)
);
$t2 = new awPoint(
round($functionX(($i + 3) * $cos, $width) + $p1->x),
round($functionY(($i + 3) * $sin, $height) + $p1->y)
);
$this->line($color, new awLine($t1, $t2));
}
break;
}
}
}
/**
* Draw a color arc
* @param awColor $color Arc color
* @param awPoint $center Point center
* @param int $width Ellipse width
* @param int $height Ellipse height
* @param int $from Start angle
* @param int $to End angle
*/
public function arc(awColor $color, awPoint $center, $width, $height, $from, $to) {
}
/**
* Draw an arc with a background color
*
* @param awColor $color Arc background color
* @param awPoint $center Point center
* @param int $width Ellipse width
* @param int $height Ellipse height
* @param int $from Start angle
* @param int $to End angle
*/
public function filledArc(awColor $color, awPoint $center, $width, $height, $from, $to) {
}
/**
* Draw a colored ellipse
*
* @param awColor $color Ellipse color
* @param awPoint $center Ellipse center
* @param int $width Ellipse width
* @param int $height Ellipse height
*/
public function ellipse(awColor $color, awPoint $center, $width, $height) {
}
/**
* Draw an ellipse with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param awPoint $center Ellipse center
* @param int $width Ellipse width
* @param int $height Ellipse height
*/
public function filledEllipse($background, awPoint $center, $width, $height) {
}
/**
* Draw a colored rectangle
*
* @param awColor $color Rectangle color
* @param awLine $line Rectangle diagonale
* @param awPoint $p2
*/
public function rectangle(awColor $color, awLine $line) {
list($p1, $p2) = $line->getLocation();
// Get Red, Green, Blue and Alpha values for the line
list($r, $g, $b, $a) = $this->getColor($color);
// Calculate the coordinates of the two other points of the rectangle
$p3 = new Point($p1->x, $p2->y);
$p4 = new Point($p2->x, $p1->y);
$side = clone $line;
// Draw the four sides of the rectangle, clockwise
if(
($p1->x <= $p2->x and $p1->y <= $p2->y)
or
($p1->x >= $p2->x and $p1->y >= $p2->y)
) {
$side->setLocation($p1, $p4);
$this->line($color, $side);
$side->setLocation($p4, $p2);
$this->line($color, $side);
$side->setLocation($p2, $p3);
$this->line($color, $side);
$side->setLocation($p3, $p1);
$this->line($color, $side);
} else {
$side->setLocation($p1, $p3);
$this->line($color, $side);
$side->setLocation($p3, $p2);
$this->line($color, $side);
$side->setLocation($p2, $p4);
$this->line($color, $side);
$side->setLocation($p4, $p1);
$this->line($color, $side);
}
}
/**
* Draw a rectangle with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param awLine $line Rectangle diagonale
*/
public function filledRectangle($background, awLine $line) {
list($p1, $p2) = $line->getLocation();
// Common shape settings
$shape = new SWFShape();
$shape->setLine(0);
if($background instanceof awColor) {
// Get the Red, Green, Blue and Alpha values
list($r, $g, $b, $a) = $this->getColor($background);
$shape->setRightFill($r, $g, $b, $a);
} else if($background instanceof awGradient) {
// Get the Gradient object as an SWFGradient one
list($flashGradient, $style) = $this->getGradient($background);
$fill = $shape->addFill($flashGradient, $style);
// Angles between Artichow and Ming don't match.
// Don't use abs() or vertical gradients get inverted.
$angle = $background->angle - 90;
$fill->rotateTo($angle);
// Move the gradient based on the position of the rectangle we're drawing
$centerX = min($p1->x, $p2->y) + abs($p1->x - $p2->x) / 2;
$centerY = min($p1->y, $p2->y) + abs($p1->y - $p2->y) / 2;
$fill->moveTo($centerX, $centerY);
// Ming draws its gradients on a 1600x1600 image,
// so we have to resize it.
if($angle === -90) {
$ratio = abs($p1->y - $p2->y) / 1600;
} else {
$ratio = abs($p1->x - $p2->x) / 1600;
}
$fill->scaleTo($ratio);
$shape->setRightFill($fill);
}
// Set starting position
$shape->movePenTo($this->x + round($p1->x), $this->y + round($p1->y));
// Depending on the points' relative positions,
// we have two drawing possibilities
if(
($p1->x <= $p2->x and $p1->y <= $p2->y)
or
($p1->x >= $p2->x and $p1->y >= $p2->y)
) {
$shape->drawLineTo($this->x + round($p2->x), $this->y + round($p1->y));
$shape->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y));
$shape->drawLineTo($this->x + round($p1->x), $this->y + round($p2->y));
$shape->drawLineTo($this->x + round($p1->x), $this->y + round($p1->y));
} else {
$shape->drawLineTo($this->x + round($p1->x), $this->y + round($p2->y));
$shape->drawLineTo($this->x + round($p2->x), $this->y + round($p2->y));
$shape->drawLineTo($this->x + round($p2->x), $this->y + round($p1->y));
$shape->drawLineTo($this->x + round($p1->x), $this->y + round($p1->y));
}
$this->movie->add($shape);
}
/**
* Draw a polygon
*
* @param awColor $color Polygon color
* @param Polygon A polygon
*/
public function polygon(awColor $color, awPolygon $polygon) {
$points = $polygon->all();
$count = count($points);
if($count > 1) {
$side = new awLine;
$side->setStyle($polygon->getStyle());
$side->setThickness($polygon->getThickness());
$prev = $points[0];
for($i = 1; $i < $count; $i++) {
$current = $points[$i];
$side->setLocation($prev, $current);
$this->line($color, $side);
$prev = $current;
}
// Close the polygon
$side->setLocation($prev, $points[0]);
$this->line($color, $side);
}
}
/**
* Draw a polygon with a background
*
* @param mixed $background Background (can be a color or a gradient)
* @param Polygon A polygon
*/
public function filledPolygon($background, awPolygon $polygon) {
$shape = new SWFShape();
if($background instanceof awColor) {
list($red, $green, $blue, $alpha) = $this->getColor($background);
$shape->setRightFill($red, $green, $blue, $alpha);
} elseif($background instanceof awGradient) {
list($flashGradient, $style) = $this->getGradient($background);
$fill = $shape->addFill($flashGradient, $style);
list($xMin, $xMax) = $polygon->getBoxXRange();
list($yMin, $yMax) = $polygon->getBoxYRange();
if($background->angle === 0) {
$fill->scaleTo(($yMax - $yMin) / 1600);
} else {
$fill->scaleTo(($xMax - $xMin) / 1600);
}
$fill->moveTo($xMin + ($xMax - $xMin) / 2, $yMin + ($yMax - $yMin) / 2);
$shape->setRightFill($fill);
}
$points = $polygon->all();
$count = count($points);
if($count > 1) {
$prev = $points[0];
$shape->movePenTo($prev->x, $prev->y);
for($i = 1; $i < $count; $i++) {
$current = $points[$i];
$shape->drawLineTo($current->x, $current->y);
}
// Close the polygon
$shape->drawLineTo($prev->x, $prev->y);
$this->movie->add($shape);
}
}
 
/**
* Sends the image, as well as the correct HTTP headers, to the browser
*
* @param awImage $image The Image object to send
*/
public function send(awImage $image) {
$this->drawImage($image);
}
/**
* Get the image as binary data
*
* @param awImage $image
*/
public function get(awImage $image) {
return $this->drawImage($image, TRUE, FALSE);
}
public function getTextWidth(awText $text) {
$font = $text->getFont();
if($this->isCompatibleWithFont($font) === FALSE) {
awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')');
}
// Ming only supports FileFont
$fontDriver = $this->fileFontDriver;
return $fontDriver->getTextWidth($text, $this);
}
public function getTextHeight(awText $text) {
$font = $text->getFont();
if($this->isCompatibleWithFont($font) === FALSE) {
awImage::drawError('Class MingDriver: Incompatible font type (\''.get_class($font).'\')');
}
// Ming only supports FileFont
$fontDriver = $this->fileFontDriver;
return $fontDriver->getTextHeight($text, $this);
}
protected function isCompatibleWithFont(awFont $font) {
if($font instanceof awTTFFont or $font instanceof awPHPFont) {
return FALSE;
} else {
return TRUE;
}
}
private function drawImage(awImage $image, $return = FALSE, $header = TRUE) {
// Send headers to the browser
if($header === TRUE) {
$image->sendHeaders();
}
if($return) {
ob_start();
}
$this->movie->output();
if($return) {
return ob_get_clean();
}
}
 
/**
* Convert an awGradient object to an SWFGradient one.
* Returns an object as well as the style of the Flash gradient.
*
* @param awGradient $gradient The awGradient object to convert
* @return array
*/
private function getGradient(awGradient $gradient) {
$flashGradient = new SWFGradient();
// Get RGBA values for the gradient boundaries
list($r1, $g1, $b1, $a1) = $this->getColor($gradient->from);
list($r2, $g2, $b2, $a2) = $this->getColor($gradient->to);
$flashGradient->addEntry(0, $r1, $g1, $b1, $a1);
if($gradient instanceof awBilinearGradient) {
$flashGradient->addEntry($gradient->center, $r2, $g2, $b2, $a2);
$flashGradient->addEntry(1, $r1, $g1, $b1, $a1);
return array($flashGradient, SWFFILL_LINEAR_GRADIENT);
} else {
 
$flashGradient->addEntry(1, $r2, $g2, $b2, $a2);
if($gradient instanceof awLinearGradient) {
return array($flashGradient, SWFFILL_LINEAR_GRADIENT);
} else {
return array($flashGradient, SWFFILL_RADIAL_GRADIENT);
}
}
}
// abstract private function getPolygonPoints(awPolygon $polygon);
 
}
 
registerClass('MingDriver');
 
/*
* Check for ming presence
*/
if(function_exists('ming_useswfversion') === FALSE) {
awImage::drawErrorFile('missing-ming');
}
 
?>
/trunk/bibliotheque/artichow/inc/Grid.class.php
New file
0,0 → 1,291
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
/**
* Grid
*
* @package Artichow
*/
class awGrid {
/**
* Vertical lines of the grid
*
* @var array
*/
private $xgrid = array();
/**
* Horizontal lines of the grid
*
* @var array
*/
private $ygrid = array();
 
/**
* Is the component grid hidden ?
*
* @var bool
*/
private $hide = FALSE;
 
/**
* Are horizontal lines hidden ?
*
* @var bool
*/
private $hideHorizontal = FALSE;
 
/**
* Are vertical lines hidden ?
*
* @var bool
*/
private $hideVertical = FALSE;
/**
* Grid color
*
* @var Color
*/
private $color;
/**
* Grid space
*
* @var int
*/
private $space;
/**
* Line type
*
* @var int
*/
private $type = awLine::SOLID;
/**
* Grid interval
*
* @var int
*/
private $interval = array(1, 1);
/**
* Grid background color
*
* @var Color
*/
private $background;
/**
* Build the factory
*/
public function __construct() {
// Set a grid default color
$this->color = new awColor(210, 210, 210);
$this->background = new awColor(255, 255, 255, 100);
}
/**
* Hide grid ?
*
* @param bool $hide
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Hide horizontal lines ?
*
* @param bool $hideHorizontal
*/
public function hideHorizontal($hide = TRUE) {
$this->hideHorizontal = (bool)$hide;
}
/**
* Hide vertical lines ?
*
* @param bool $hideVertical
*/
public function hideVertical($hide = TRUE) {
$this->hideVertical = (bool)$hide;
}
/**
* Change grid color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Remove grid background
*/
public function setNoBackground() {
$this->background = NULL;
}
/**
* Change grid background color
*
* @param awColor $color
*/
public function setBackgroundColor(awColor $color) {
$this->background = $color;
}
/**
* Change line type
*
* @param int $type
*/
public function setType($type) {
$this->type = (int)$type;
}
/**
* Change grid interval
*
* @param int $hInterval
* @param int $vInterval
*/
public function setInterval($hInterval, $vInterval) {
$this->interval = array((int)$hInterval, (int)$vInterval);
}
/**
* Set grid space
*
* @param int $left Left space in pixels
* @param int $right Right space in pixels
* @param int $top Top space in pixels
* @param int $bottom Bottom space in pixels
*/
public function setSpace($left, $right, $top, $bottom) {
$this->space = array((int)$left, (int)$right, (int)$top, (int)$bottom);
}
/**
* Change the current grid
*
* @param array $xgrid Vertical lines
* @param array $ygrid Horizontal lines
*/
public function setGrid($xgrid, $ygrid) {
if(empty($this->xgrid)) {
$this->xgrid = $xgrid;
}
if(empty($this->ygrid)) {
$this->ygrid = $ygrid;
}
}
/**
* Draw grids
*
* @param awDriver $driver A driver object
* @param int $x1
* @param int $y1
* @param int $x2
* @param int $y2
*/
public function draw(awDriver $driver, $x1, $y1, $x2, $y2) {
if($this->background instanceof awColor) {
// Draw background color
$driver->filledRectangle(
$this->background,
awLine::build($x1, $y1, $x2, $y2)
);
}
 
if($this->hide === FALSE) {
$this->drawGrid(
$driver,
$this->color,
$this->hideVertical ? array() : $this->xgrid,
$this->hideHorizontal ? array() : $this->ygrid,
$x1, $y1, $x2, $y2,
$this->type,
$this->space,
$this->interval[0],
$this->interval[1]
);
}
}
private function drawGrid(
awDriver $driver, awColor $color,
$nx, $ny, $x1, $y1, $x2, $y2,
$type, $space, $hInterval, $vInterval
) {
list($left, $right, $top, $bottom) = $space;
$width = $x2 - $x1 - $left - $right;
$height = $y2 - $y1 - $top - $bottom;
foreach($nx as $key => $n) {
if(($key % $vInterval) === 0) {
$pos = (int)round($x1 + $left + $n * $width);
$driver->line(
$color,
new awLine(
new awPoint($pos, $y1),
new awPoint($pos, $y2),
$type
)
);
}
}
foreach($ny as $key => $n) {
if(($key % $hInterval) === 0) {
$pos = (int)round($y1 + $top + $n * $height);
$driver->line(
$color,
new awLine(
new awPoint($x1, $pos),
new awPoint($x2, $pos),
$type
)
);
}
}
}
 
}
 
registerClass('Grid');
?>
/trunk/bibliotheque/artichow/inc/Shadow.class.php
New file
0,0 → 1,406
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once dirname(__FILE__)."/../Graph.class.php";
 
/**
* Draw shadows
*
*/
class awShadow {
 
/**
* Shadow on left and top sides
*
* @var int
*/
const LEFT_TOP = 1;
 
/**
* Shadow on left and bottom sides
*
* @var int
*/
const LEFT_BOTTOM = 2;
 
/**
* Shadow on right and top sides
*
* @var int
*/
const RIGHT_TOP = 3;
 
/**
* Shadow on right and bottom sides
*
* @var int
*/
const RIGHT_BOTTOM = 4;
/**
* In mode
*
* @var int
*/
const IN = 1;
/**
* Out mode
*
* @var int
*/
const OUT = 2;
 
/**
* Shadow size
*
* @var int
*/
private $size = 0;
/**
* Hide shadow ?
*
* @var bool
*/
protected $hide = FALSE;
 
/**
* Shadow color
*
* @var Color
*/
private $color;
 
/**
* Shadow position
*
* @var int
*/
private $position;
 
/**
* Smooth shadow ?
*
* @var bool
*/
private $smooth = FALSE;
/**
* Shadow constructor
*
* @param int $position Shadow position
*/
public function __construct($position) {
$this->setPosition($position);
}
/**
* Hide shadow ?
*
* @param bool $hide
*/
public function hide($hide = TRUE) {
$this->hide = (bool)$hide;
}
/**
* Show shadow ?
*
* @param bool $show
*/
public function show($show = TRUE) {
$this->hide = (bool)!$show;
}
/**
* Change shadow size
*
* @param int $size
* @param bool $smooth Smooth the shadow (facultative argument)
*/
public function setSize($size, $smooth = NULL) {
$this->size = (int)$size;
if($smooth !== NULL) {
$this->smooth($smooth);
}
}
/**
* Change shadow color
*
* @param awColor $color
*/
public function setColor(awColor $color) {
$this->color = $color;
}
/**
* Change shadow position
*
* @param int $position
*/
public function setPosition($position) {
$this->position = (int)$position;
}
/**
* Smooth shadow ?
*
* @param bool $smooth
*/
public function smooth($smooth) {
$this->smooth = (bool)$smooth;
}
/**
* Get the space taken by the shadow
*
* @return Side
*/
public function getSpace() {
return new awSide(
($this->position === awShadow::LEFT_TOP or $this->position === awShadow::LEFT_BOTTOM) ? $this->size : 0,
($this->position === awShadow::RIGHT_TOP or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0,
($this->position === awShadow::LEFT_TOP or $this->position === awShadow::RIGHT_TOP) ? $this->size : 0,
($this->position === awShadow::LEFT_BOTTOM or $this->position === awShadow::RIGHT_BOTTOM) ? $this->size : 0
);
}
/**
* Draw shadow
*
* @param awDriver $driver
* @param awPoint $p1 Top-left point
* @param awPoint $p2 Right-bottom point
* @param int Drawing mode
*/
public function draw(awDriver $driver, awPoint $p1, awPoint $p2, $mode) {
if($this->hide) {
return;
}
if($this->size <= 0) {
return;
}
$driver = clone $driver;
$color = ($this->color instanceof awColor) ? $this->color : new awColor(125, 125, 125);
switch($this->position) {
case awShadow::RIGHT_BOTTOM :
if($mode === awShadow::OUT) {
$t1 = $p1->move(0, 0);
$t2 = $p2->move($this->size + 1, $this->size + 1);
} else { // PHP 4 compatibility
$t1 = $p1->move(0, 0);
$t2 = $p2->move(0, 0);
}
$width = $t2->x - $t1->x;
$height = $t2->y - $t1->y;
$driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($width - $this->size, $this->size),
new awPoint($width - 1, $height - 1)
)
);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($this->size, $height - $this->size),
new awPoint($width - $this->size - 1, $height - 1)
)
);
$this->smoothPast($driver, $color, $width, $height);
break;
case awShadow::LEFT_TOP :
if($mode === awShadow::OUT) {
$t1 = $p1->move(- $this->size, - $this->size);
$t2 = $p2->move(0, 0);
} else { // PHP 4 compatibility
$t1 = $p1->move(0, 0);
$t2 = $p2->move(0, 0);
}
$width = $t2->x - $t1->x;
$height = $t2->y - $t1->y;
$driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y);
$height = max($height + 1, $this->size);
$driver->filledRectangle(
$color,
new awLine(
new awPoint(0, 0),
new awPoint($this->size - 1, $height - $this->size - 1)
)
);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($this->size, 0),
new awPoint($width - $this->size - 1, $this->size - 1)
)
);
$this->smoothPast($driver, $color, $width, $height);
break;
case awShadow::RIGHT_TOP :
if($mode === awShadow::OUT) {
$t1 = $p1->move(0, - $this->size);
$t2 = $p2->move($this->size + 1, 0);
} else { // PHP 4 compatibility
$t1 = $p1->move(0, 0);
$t2 = $p2->move(0, 0);
}
$width = $t2->x - $t1->x;
$height = $t2->y - $t1->y;
$driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y);
$height = max($height + 1, $this->size);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($width - $this->size, 0),
new awPoint($width - 1, $height - $this->size - 1)
)
);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($this->size, 0),
new awPoint($width - $this->size - 1, $this->size - 1)
)
);
$this->smoothFuture($driver, $color, $width, $height);
break;
case awShadow::LEFT_BOTTOM :
if($mode === awShadow::OUT) {
$t1 = $p1->move(- $this->size, 0);
$t2 = $p2->move(0, $this->size + 1);
} else { // PHP 4 compatibility
$t1 = $p1->move(0, 0);
$t2 = $p2->move(0, 0);
}
$width = $t2->x - $t1->x;
$height = $t2->y - $t1->y;
$driver->setAbsPosition($t1->x + $driver->x, $t1->y + $driver->y);
$driver->filledRectangle(
$color,
new awLine(
new awPoint(0, $this->size),
new awPoint($this->size - 1, $height - 1)
)
);
$driver->filledRectangle(
$color,
new awLine(
new awPoint($this->size, $height - $this->size),
new awPoint($width - $this->size - 1, $height - 1)
)
);
$this->smoothFuture($driver, $color, $width, $height);
break;
}
}
private function smoothPast(awDriver $driver, awColor $color, $width, $height) {
if($this->smooth) {
for($i = 0; $i < $this->size; $i++) {
for($j = 0; $j <= $i; $j++) {
$driver->point(
$color,
new awPoint($i, $j + $height - $this->size)
);
}
}
for($i = 0; $i < $this->size; $i++) {
for($j = 0; $j <= $i; $j++) {
$driver->point(
$color,
new awPoint($width - $this->size + $j, $i)
);
}
}
}
}
private function smoothFuture(awDriver $driver, awColor $color, $width, $height) {
if($this->smooth) {
for($i = 0; $i < $this->size; $i++) {
for($j = 0; $j <= $i; $j++) {
$driver->point(
$color,
new awPoint($i, $this->size - $j - 1)
);
}
}
for($i = 0; $i < $this->size; $i++) {
for($j = 0; $j <= $i; $j++) {
$driver->point(
$color,
new awPoint($width - $this->size + $j, $height - $i - 1)
);
}
}
}
}
 
}
 
registerClass('Shadow');
?>