Prepends a renderer to the beginning of renderer chain
@param string $renderer
@throws \UnexpectedValueException
@return \Altamira\ChartRenderer
551608
public static function unshiftRenderer( $renderer )
    {
        if (! in_array( 'Altamira\ChartRenderer\RendererInterface', class_implements( $renderer ) ) ) {
            throw new \UnexpectedValueException( "Renderer must be instance of or string name of a class implementing RendererInterface" );
        }

        array_unshift( self::$rendererChain, $renderer );
        
        return self::getInstance();
    }
1245421
public function render($renderer)
    {
        if ($this->x1 === ReportBaseElement::CURRENT_POSITION) {
            $this->x1 = $renderer->getX();
        }
        if ($this->y1 === ReportBaseElement::CURRENT_POSITION) {
            $this->y1 = $renderer->getY();
        }
        if ($this->x2 === ReportBaseElement::CURRENT_POSITION) {
            $this->x2 = $renderer->getRemainingWidth();
        }
        if ($this->y2 === ReportBaseElement::CURRENT_POSITION) {
            $this->y2 = $renderer->getY();
        }
        // Vertical line
        if ($this->x1 == $this->x2) {
            echo '<div style="position:absolute;overflow:hidden;border-', $renderer->alignRTL, ':solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:1pt;height:', $this->y2 - $this->y1, "pt;\"> </div>\n";
        }
        // Horizontal line
        if ($this->y1 == $this->y2) {
            echo '<div style="position:absolute;overflow:hidden;border-top:solid black 1pt;', $renderer->alignRTL, ':', $this->x1, 'pt;top:', $this->y1 + 1, 'pt;width:', $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n";
        }
        // Keep max Y updated
        // One or the other will be higher... lasy mans way...
        $renderer->addMaxY($this->y1);
        $renderer->addMaxY($this->y2);
    }
337089
public function render(HTML_QuickForm2_Renderer $renderer)
    {
        $renderer->startForm($this);
        $renderer->getJavascriptBuilder()->startForm($this);
        foreach ($this as $element) {
            $element->render($renderer);
        }
        $renderer->finishForm($this);
        return $renderer;
    }
1119789
protected static function createRenderer( $renderer, ezpContent $content, ezpRestMvcController $controller )
    {
        $rendererOptions = new ezpExtensionOptions();
        $rendererOptions->iniFile = 'rest.ini';
        $rendererOptions->iniSection = 'OutputSettings';
        $rendererOptions->iniVariable = 'RendererClass';
        $rendererOptions->handlerIndex = $renderer;
        $rendererOptions->handlerParams = array( $content, $controller );

        $rendererInstance = eZExtension::getHandlerClass( $rendererOptions );

        if ( !( $rendererInstance instanceof ezpRestContentRendererInterface ) )
            throw new ezpRestContentRendererNotFoundException( $renderer );

        return $rendererInstance;
    }
21717
public function render(ResultsRenderer $renderer)
    {
        $output = '';
        if ($this->result->headersDifferent()) {
            $output .= sprintf(
                "%s      %s\n%s  %s",
                $renderer->style('YOUR HEADERS:', ['bold', 'yellow']),
                $this->headers($this->result->getActualHeaders(), $renderer),
                $renderer->style('EXPECTED HEADERS:', ['bold', 'yellow']),
                $this->headers($this->result->getExpectedHeaders(), $renderer, false)
            );
        }

        if ($this->result->bodyDifferent()) {
            if ($this->result->headersAndBodyDifferent()) {
                $output .= "\n" . $renderer->style('- - - - - - - - -', ['default', 'bold']) . "\n\n";
            }

            $output .= sprintf(
                "%s       %s\n\n%s   %s\n",
                $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']),
                $renderer->style(sprintf('"%s"', $this->result->getActualOutput()), 'red'),
                $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']),
                $renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green')
            );
        }

        return $output;
    }
1305798
public function render(array $arguments = [], $renderer = null) {
        $this->runDynamicCallbacks($arguments);

        return $this->baseRender($arguments, $renderer);
    }
989871
public function register(Renderer $renderer) {
        $this->registerTokenRenderer(CodeRule::NAME . CodeRule::OPEN, 'renderOpen', $renderer);
        $this->registerTokenRenderer(CodeRule::NAME . CodeRule::CLOSE, 'renderClose', $renderer);
        $this->registerTokenRenderer(CodeRule::NAME, 'renderContent', $renderer);

        $this->registerTokenRenderer(CodeAltRule::NAME . CodeAltRule::OPEN, 'renderOpen', $renderer);
        $this->registerTokenRenderer(CodeAltRule::NAME . CodeAltRule::CLOSE, 'renderClose', $renderer);
        $this->registerTokenRenderer(CodeAltRule::NAME, 'renderContent', $renderer);
    }
1187354
public function render($renderer)
    {
        $temptext = str_replace('#PAGENUM#', (string) $renderer->PageNo(), $this->text);
        // underline «title» part of Source item
        $temptext = str_replace([
            '«',
            '»',
        ], [
            '<u>',
            '</u>',
        ], $temptext);

        // Set up the text style
        if ($renderer->getCurrentStyle() !== $this->styleName) {
            $renderer->setCurrentStyle($this->styleName);
        }

        // Background color
        $match = [];
        // Indicates if the cell background must be painted (1) or transparent (0)
        if ($this->fill == 1) {
            if (!empty($this->bgcolor)) {
                // HTML color to RGB
                if (preg_match('/#?(..)(..)(..)/', $this->bgcolor, $match)) {
                    $r = hexdec($match[1]);
                    $g = hexdec($match[2]);
                    $b = hexdec($match[3]);
                    $renderer->SetFillColor($r, $g, $b);
                }
            } else {
                // If no color set then don't fill
                $this->fill = 0;
            }
        }

        // Borders
        if (!empty($this->bocolor)) {
            // HTML color to RGB
            if (preg_match('/#?(..)(..)(..)/', $this->bocolor, $match)) {
                $r = hexdec($match[1]);
                $g = hexdec($match[2]);
                $b = hexdec($match[3]);
                $renderer->SetDrawColor($r, $g, $b);
            }
        }
        // Paint the text color or they might use inherited colors by the previous function
        if (preg_match('/#?(..)(..)(..)/', $this->tcolor, $match)) {
            $r = hexdec($match[1]);
            $g = hexdec($match[2]);
            $b = hexdec($match[3]);
            $renderer->SetTextColor($r, $g, $b);
        } else {
            $renderer->SetTextColor(0, 0, 0);
        }

        // If current position (left)
        if ($this->left === ReportBaseElement::CURRENT_POSITION) {
            $cX = $renderer->GetX();
        } else {
            // For static position add margin (also updates X)
            $cX = $renderer->addMarginX($this->left);
        }

        // Check the width if set to page wide OR set by xml to larger then page wide
        if ($this->width == 0 || $this->width > $renderer->getRemainingWidthPDF()) {
            $this->width = $renderer->getRemainingWidthPDF();
        }
        // For current position
        if ($this->top === ReportBaseElement::CURRENT_POSITION) {
            $this->top = $renderer->GetY();
        } else {
            $renderer->SetY($this->top);
        }

        // Check the last cell height and adjust the current cell height if needed
        if ($renderer->lastCellHeight > $this->height) {
            $this->height = $renderer->lastCellHeight;
        }
        // Check for pagebreak
        if (!empty($temptext)) {
            $cHT = $renderer->getNumLines($temptext, $this->width);
            $cHT = $cHT * $renderer->getCellHeightRatio() * $renderer->getCurrentStyleHeight();
            $cM  = $renderer->getMargins();
            // Add padding
            if (is_array($cM['cell'])) {
                $cHT += ($cM['padding_bottom'] + $cM['padding_top']);
            } else {
                $cHT += ($cM['cell'] * 2);
            }
            // Add a new page if needed
            if ($renderer->checkPageBreakPDF($cHT)) {
                $this->top = $renderer->GetY();
            }
            $temptext = FunctionsRtl::spanLtrRtl($temptext);
        }
        // HTML ready - last value is true
        $renderer->MultiCell(
            $this->width,
            $this->height,
            $temptext,
            $this->border,
            $this->align,
            $this->fill,
            $this->newline,
            $cX,
            $this->top,
            $this->reseth,
            $this->stretch,
            true
        );
        // Reset the last cell height for the next line
        if ($this->newline >= 1) {
            $renderer->lastCellHeight = 0;
        } elseif ($renderer->lastCellHeight < $renderer->getLastH()) {
            // OR save the last height if heigher then before
            $renderer->lastCellHeight = $renderer->getLastH();
        }

        // Set up the url link if exists ontop of the cell
        if (!empty($this->url)) {
            $renderer->Link($cX, $this->top, $this->width, $this->height, $this->url);
        }
        // Reset the border and the text color to black or they will be inherited
        $renderer->SetDrawColor(0, 0, 0);
        $renderer->SetTextColor(0, 0, 0);
    }
319393
public function render($renderer, $curx = 0, $attrib = true)
    {
        // Set up the style
        if ($renderer->getCurrentStyle() != $this->styleName) {
            $renderer->setCurrentStyle($this->styleName);
        }
        $temptext = str_replace('#PAGENUM#', (string) $renderer->pageNo(), $this->text);
        // underline «title» part of Source item
        $temptext = str_replace([
            '«',
            '»',
        ], [
            '<u>',
            '</u>',
        ], $temptext);

        // If any text at all
        if (!empty($temptext)) {
            // If called by an other element
            if (!$attrib) {
                $renderer->write($temptext, $this->color);
            } else {
                // Save the start positions
                $startX = $renderer->getX();
                $startY = $renderer->getY();
                $width  = $renderer->getRemainingWidth();
                // If text is wider then page width then wrap it
                if ($renderer->getStringWidth($temptext) > $width) {
                    $lines = explode("\n", $temptext);
                    foreach ($lines as $line) {
                        echo '<div style="position:absolute;top:', $startY, 'pt;', $renderer->alignRTL, ':', $startX, 'pt;width:', $width, 'pt;">';
                        $line = $renderer->textWrap($line, $width);
                        $startY += $renderer->getTextCellHeight($line);
                        $renderer->setY($startY);
                        $renderer->write($line, $this->color);
                        echo "</div>\n";
                    }
                } else {
                    echo '<div style="position:absolute;top:', $startY, 'pt;', $renderer->alignRTL, ':', $startX, 'pt;width:', $width, 'pt;">';
                    $renderer->write($temptext, $this->color);
                    echo "</div>\n";
                    $renderer->setX($startX + $renderer->getStringWidth($temptext));
                    if ($renderer->countLines($temptext) != 1) {
                        $renderer->setXy(0, $startY + $renderer->getTextCellHeight($temptext));
                    }
                }
            }
        }
    }
909477
public function setRenderer($renderer)
    {
        if(!$renderer instanceof ComActivitiesActivityRendererInterface)
        {
            if(is_string($renderer) && strpos($renderer, '.') === false )
            {
                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('template', 'helper');
                $identifier['name'] = $renderer;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($renderer);

            $renderer = $identifier;
        }

        $this->_renderer = $renderer;

        return $this;
    }
737128
public function renderFootnote($renderer)
    {
        if ($renderer->getCurrentStyle() != $this->styleName) {
            $renderer->setCurrentStyle($this->styleName);
        }
        $temptext = str_replace('#PAGENUM#', (string) $renderer->PageNo(), $this->text);
        // Set the link to this y/page position
        $renderer->SetLink($this->addlink, -1, -1);
        // Print first the source number
        // working
        if ($renderer->getRTL()) {
            $renderer->writeHTML('<span> .' . $this->num . '</span>', false, false, false, false, '');
        } else {
            $temptext = '<span>' . $this->num . '. </span>' . $temptext;
        }
        // underline «title» part of Source item
        $temptext = str_replace([
            '«',
            '»',
        ], [
            '<u>',
            '</u>',
        ], $temptext);
        $renderer->writeHTML($temptext, true, false, true, false, '');
    }
766848
public function setRenderer($renderer, $condition_callback = null)
	{
		if ($this->hasReplacements()) {
			throw new DataGridException(
				'Use either Column::setReplacement() or Column::setRenderer, not both.'
			);
		}

		if (!is_callable($renderer)) {
			throw new DataGridException(
				'Renderer (method Column::setRenderer()) must be callable.'
			);
		}

		if ($condition_callback != null && !is_callable($condition_callback)) {
			throw new DataGridException(
				'Renderer (method Column::setRenderer()) must be callable.'
			);
		}

		$this->renderer = new Renderer($renderer, $condition_callback);

		return $this;
	}
967478
public final function setRenderingOrder(array $renderingOrder = [])
    {
        foreach ($renderingOrder as $method) {
            if (!method_exists($this, $method)) {
                throw new \Mmi\Form\FormException('Unknown rendering method');
            }
        }
        $this->_renderingOrder = $renderingOrder;
        return $this;
    }
350182
public function render(ResultsRenderer $renderer)
    {
        return sprintf(
            "  %s\n%s\n\n  %s\n%s\n",
            $renderer->style('YOUR OUTPUT:', ['bold', 'yellow']),
            $this->indent($renderer->style(sprintf('"%s"', $this->result->getActualOutput()), 'red')),
            $renderer->style('EXPECTED OUTPUT:', ['bold', 'yellow']),
            $this->indent($renderer->style(sprintf('"%s"', $this->result->getExpectedOutput()), 'green'))
        );
    }
210465
public function render($renderer, $sub = false, $inat = true)
    {
        if (!empty($this->attrs['wt_style'])) {
            $renderer->setCurrentStyle($this->attrs['wt_style']);
        }

        $this->text = $this->getStart() . $this->text;
        foreach ($this->elements as $element) {
            if ($element === 'footnotetexts') {
                $renderer->footnotes();
            } elseif ($element === 'addpage') {
                $renderer->addPage();
            } elseif ($element instanceof ReportBaseHtml) {
                $element->render($renderer, true, false);
            } else {
                $element->render($renderer);
            }
        }
        $this->text .= $this->getEnd();
        if ($sub) {
            return $this->text;
        }

        // If not called by an other attribute
        if ($inat) {
            $startX = $renderer->getX();
            $startY = $renderer->getY();
            $width  = $renderer->getRemainingWidth();
            echo '<div style="position: absolute;top: ', $startY, 'pt;', $renderer->alignRTL, ': ', $startX, 'pt;width: ', $width, 'pt;">';
            $startY += $renderer->getCurrentStyleHeight() + 2;
            $renderer->setY($startY);
        }

        echo $this->text;

        if ($inat) {
            echo "</div>\n";
        }
    }
1135238
public function render(array $arguments = [], $renderer = null) {
        if(empty($this->itemsToDisplay)) {
            return $this->button->render($arguments);
        }

        return $this->baseRender($arguments, $renderer);
    }
1283483
public static function setRenderer($renderer) {
        if(ClassInfo::classImplements($renderer, 'IMarkdownRenderer')) {
            self::$renderer=$renderer;
        }else {
            user_error('The renderer '.$renderer.' does not implement IMarkdownRenderer', E_USER_ERROR);
        }
    }