Class AbstractSVGGradientElementBridge

    • Constructor Detail

      • AbstractSVGGradientElementBridge

        protected AbstractSVGGradientElementBridge()
        Constructs a new AbstractSVGGradientElementBridge.
    • Method Detail

      • createPaint

        public java.awt.Paint createPaint​(BridgeContext ctx,
                                          org.w3c.dom.Element paintElement,
                                          org.w3c.dom.Element paintedElement,
                                          GraphicsNode paintedNode,
                                          float opacity)
        Creates a Paint according to the specified parameters.
        Specified by:
        createPaint in interface PaintBridge
        Parameters:
        ctx - the bridge context to use
        paintElement - the element that defines a Paint
        paintedElement - the element referencing the paint
        paintedNode - the graphics node on which the Paint will be applied
        opacity - the opacity of the Paint to create
      • buildGradient

        protected abstract java.awt.Paint buildGradient​(org.w3c.dom.Element paintElement,
                                                        org.w3c.dom.Element paintedElement,
                                                        GraphicsNode paintedNode,
                                                        MultipleGradientPaint.CycleMethodEnum spreadMethod,
                                                        MultipleGradientPaint.ColorSpaceEnum colorSpace,
                                                        java.awt.geom.AffineTransform transform,
                                                        java.awt.Color[] colors,
                                                        float[] offsets,
                                                        BridgeContext ctx)
        Builds a concrete gradient according to the specified parameters.
        Parameters:
        paintElement - the element that defines a Paint
        paintedElement - the element referencing the paint
        paintedNode - the graphics node on which the Paint will be applied
        spreadMethod - the spread method
        colorSpace - the color space (sRGB | LinearRGB)
        transform - the gradient transform
        colors - the colors of the gradient
        offsets - the offsets
        ctx - the bridge context to use
      • convertSpreadMethod

        protected static MultipleGradientPaint.CycleMethodEnum convertSpreadMethod​(org.w3c.dom.Element paintElement,
                                                                                   java.lang.String s,
                                                                                   BridgeContext ctx)
        Converts the spreadMethod attribute.
        Parameters:
        paintElement - the paint Element with a spreadMethod
        s - the spread method
        ctx - the BridgeContext to use for error information
      • extractStop

        protected static java.util.List extractStop​(org.w3c.dom.Element paintElement,
                                                    float opacity,
                                                    BridgeContext ctx)
        Returns the stops elements of the specified gradient element. Stops can be children of the gradients or defined on one of its 'ancestor' (linked with the xlink:href attribute).
        Parameters:
        paintElement - the gradient element
        opacity - the opacity
        ctx - the bridge context to use
      • extractLocalStop

        protected static java.util.List extractLocalStop​(org.w3c.dom.Element gradientElement,
                                                         float opacity,
                                                         BridgeContext ctx)
        Returns a list of Stop elements, children of the specified paintElement can have or null if any.
        Parameters:
        gradientElement - the paint element
        opacity - the opacity
        ctx - the bridge context