/**
  * Finds a path for the connection and draws it
  * @param zibo\library\image\Image $image The image to draw upon
  * @param zibo\library\diagram\Diagram $diagram The diagram we're drawing
  * @param zibo\library\diagram\DiagramConnection $connection The connection to draw
  * @return boolean True if the connection has been drawn, false otherwise
  */
 private function drawConnection(Image $image, Diagram $diagram, DiagramConnection $connection)
 {
     try {
         $connection->preDraw($diagram);
         $begin = $connection->getBegin();
         $end = $connection->getEnd();
         $beginPoint = $this->getDiagramObjectPoint($begin, $diagram);
         $endPoint = $this->getDiagramObjectPoint($end, $diagram);
         $path = false;
         foreach ($this->pathFinders as $pathFinder) {
             $pathFinder->setDiagram($diagram);
             $path = $pathFinder->findPath($beginPoint, $endPoint);
             if ($path) {
                 break;
             }
         }
         if (!$path) {
             Zibo::getInstance()->runEvent(Zibo::EVENT_LOG, 'Could not find a path for the connection ' . $connection->getId(), $begin . ' -> ' . $end, 1);
             return false;
         }
         $points = $this->getImagePoints($path, $diagram);
         $connection->setPoints($points);
         $connection->draw($image);
     } catch (DiagramException $e) {
         Zibo::getInstance()->runEvent(Zibo::EVENT_LOG, 'Exception: ' . $e->getMessage(), $e->getTraceAsString(), 1);
         return false;
     }
     return true;
 }