final protected function addCompositeRenderer(
        SwatCellRenderer $renderer,
        $key
    ) {
        if (array_key_exists($key, $this->composite_renderers)) {
            throw new SwatDuplicateIdException(
                sprintf(
                    "A composite renderer with the key '%s' already exists in " .
                        "this renderer.",
                    $key
                ),
                0,
                $key
            );
        }

        if ($renderer->parent !== null) {
            throw new SwatException(
                'Cannot add a composite renderer that ' .
                    'already has a parent.'
            );
        }

        $this->composite_renderers[$key] = $renderer;
        $renderer->parent = $this;
    }