Пример #1
0
 /**
  * @throws \Exception
  */
 public function draw(AbstractGraphic $graphic)
 {
     if ($this->state instanceof AbstractState) {
         $graphic->addLegend($this->label, $this->styleAttributes);
         $this->state->draw($graphic);
     } else {
         throw new \Exception('State is not Set!');
     }
     return $graphic->draw();
 }