/** * Init the drawing of the component */ public function init(awDrawer $drawer) { // 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) { $drawer->copyImage($background, $p1, $p2); } else { $drawer->filledRectangle($background, new awLine($p1, $p2)); } } }
/** * Draw grids * * @param awDrawer $drawer A drawer object * @param int $x1 * @param int $y1 * @param int $x2 * @param int $y2 */ public function draw(awDrawer $drawer, $x1, $y1, $x2, $y2) { if ($this->background instanceof awColor) { // Draw background color $drawer->filledRectangle($this->background, awLine::build($x1, $y1, $x2, $y2)); $this->background->free(); } if ($this->hide === FALSE) { $this->drawGrid($drawer, $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]); } $this->color->free(); }