/** * 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]); } }
/** * 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)); } } }