Example #1
0
 /**
  * Creates and returns an Buildable literal token element.
  * 
  * @access  private
  * @return Hoathis\Regex\Visitor\Buildable
  */
 private function createLiteralToken($value, $fill_color)
 {
     $textCell = new \Hoathis\GraphicTools\Text($value);
     $textCell->setAttributes(array('text-anchor' => 'middle'));
     $rect = new \Hoathis\GraphicTools\Rect();
     $rect->setHeight($textCell->getHeight() + self::MARGIN * 2);
     $rect->setWidth($textCell->getWidth() + self::MARGIN * 2);
     $rect->setAttributes(array('fill' => $fill_color));
     $rect->setAttributes(array('rx' => SvgCreator::TOKEN_ROUND_CORNER, 'ry' => SvgCreator::TOKEN_ROUND_CORNER));
     $literal = new \Hoathis\GraphicTools\Svg();
     $literal->setHeight($rect->getHeight());
     $literal->setWidth($rect->getWidth());
     $literal->addChild($rect);
     $literal->addChild($textCell);
     return $literal;
 }
Example #2
0
 /**
  * Build a comment for the node.
  *
  * @access private
  */
 private function buildComment()
 {
     $comment = new \Hoathis\GraphicTools\Text($this->comment);
     $comment->setAttributes(array('font-size' => SvgCreator::FONT_SIZE_COMMENT));
     $comment->setAttributes(array('x' => '0', 'y' => SvgCreator::FONT_SIZE_COMMENT));
     //$token = $this->elements[0];
     //$token->setAttribute( 'x', $token->getAttribute( 'x' ) + $comment->getWidth() );
     $this->addElement($comment);
     //$this->setHeight( $this->getHeight() + 14 );
 }