Class AbstractBranchSvgNodeRenderer

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • VIEWBOX_VALUES_NUMBER

        @Deprecated
        protected static final int VIEWBOX_VALUES_NUMBER
        Deprecated.
        The number of viewBox values. Deprecate in favour of SvgConstants.Values.VIEWBOX_VALUES_NUMBER
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractBranchSvgNodeRenderer

        public AbstractBranchSvgNodeRenderer()
    • Method Detail

      • doDraw

        protected void doDraw​(SvgDrawContext context)
        Method that will set properties to be inherited by this branch renderer's children and will iterate over all children in order to draw them.
        Specified by:
        doDraw in class AbstractSvgNodeRenderer
        Parameters:
        context - the object that knows the place to draw this element and maintains its state
      • applyViewBox

        void applyViewBox​(SvgDrawContext context)
        Applies a transformation based on a viewBox for a given branch node.
        Parameters:
        context - current svg draw context
      • applyViewportClip

        private void applyViewportClip​(SvgDrawContext context)
        Applies a clipping operation based on the view port.
        Parameters:
        context - the svg draw context
      • cleanUp

        private void cleanUp​(SvgDrawContext context)
        Cleans up the SvgDrawContext by removing the current viewport and by popping the current canvas.
        Parameters:
        context - context to clean
      • calculateAndApplyViewBox

        void calculateAndApplyViewBox​(SvgDrawContext context,
                                      float[] values,
                                      Rectangle currentViewPort)
      • getBBoxAccordingToVisibleOverflow

        private static Rectangle getBBoxAccordingToVisibleOverflow​(SvgDrawContext context)
        When in the svg element overflow is visible the corresponding formXObject should have a BBox (form XObject’s bounding box; see PDF 32000-1:2008 - 8.10.2 Form Dictionaries) that should cover the entire svg space (page in pdf) in order to be able to show parts of the element which are outside the current element viewPort. To do this, we get the inverse matrix of all the current transformation matrix changes and apply it to the root viewPort. This allows you to get the root rectangle in the final coordinate system.
        Parameters:
        context - current context to get canvases and view ports
        Returns:
        the set to PdfStream bbox