protected function assertDrawCircle(ComplexAttribute $attribute, $color, $radius, Point $centerPoint, $fillType) { $gc = $this->getMock('PHPPdf\\Core\\Engine\\GraphicsContext'); $node = $this->getMockBuilder('PHPPdf\\Core\\Node\\Circle')->setMethods(array('getGraphicsContext', 'getMiddlePoint'))->getMock(); $node->setAttribute('radius', $radius); $node->expects($this->atLeastOnce())->method('getGraphicsContext')->will($this->returnValue($gc)); $node->expects($this->atLeastOnce())->method('getMiddlePoint')->will($this->returnValue($centerPoint)); $gc->expects($this->once())->method('drawEllipse')->with($centerPoint->getX(), $centerPoint->getY(), $radius * 2, $radius * 2, $fillType); $attribute->enhance($node, $this->document); }
public function __construct($color = null, $type = self::TYPE_ALL, $size = 1, $radius = null, $style = self::STYLE_SOLID, $position = 0) { parent::__construct($color, $radius); $this->setType($type); $this->setStyle($style); $this->setSize($size); $this->setPosition($position); }
public function __construct($color = null, $image = null, $repeat = self::REPEAT_NONE, $radius = null, $useRealDimension = false, $imageWidth = null, $imageHeight = null, $positionX = self::POSITION_LEFT, $positionY = self::POSITION_TOP) { parent::__construct($color, $radius); $this->image = $image; $this->setRepeat($repeat); $this->useRealDimension = Util::convertBooleanValue($useRealDimension); $this->setImageDimension($imageWidth, $imageHeight); $this->setPosition($positionX, $positionY); }
protected function insertComplexAttributeTask(ComplexAttribute $complexAttribute, DrawingTaskHeap $tasks, Document $document) { $callback = array($complexAttribute, 'enhance'); $args = array($this, $document); $priority = $complexAttribute->getPriority() + $this->getPriority(); $tasks->insert(new DrawingTask($callback, $args, $priority)); }