Class PaintServer

    • Constructor Detail

      • PaintServer

        protected PaintServer()
        No instance of this class is required.
    • Method Detail

      • convertMarkers

        public static ShapePainter convertMarkers​(org.w3c.dom.Element e,
                                                  ShapeNode node,
                                                  BridgeContext ctx)
        Returns a ShapePainter defined on the specified element and for the specified shape node.
        Parameters:
        e - the element with the marker CSS properties
        node - the shape node
        ctx - the bridge context
      • convertMarker

        public static Marker convertMarker​(org.w3c.dom.Element e,
                                           Value v,
                                           BridgeContext ctx)
        Returns a Marker defined on the specified element by the specified value, and for the specified shape node.
        Parameters:
        e - the painted element
        v - the CSS value describing the marker to construct
        ctx - the bridge context
      • convertFillAndStroke

        public static ShapePainter convertFillAndStroke​(org.w3c.dom.Element e,
                                                        ShapeNode node,
                                                        BridgeContext ctx)
        Returns a ShapePainter defined on the specified element and for the specified shape node, and using the specified bridge context.
        Parameters:
        e - the element interested in a shape painter
        node - the shape node
        ctx - the bridge context
      • convertStrokePaint

        public static java.awt.Paint convertStrokePaint​(org.w3c.dom.Element strokedElement,
                                                        GraphicsNode strokedNode,
                                                        BridgeContext ctx)
        Converts for the specified element, its stroke paint properties to a Paint object.
        Parameters:
        strokedElement - the element interested in a Paint
        strokedNode - the graphics node to stroke
        ctx - the bridge context
      • convertFillPaint

        public static java.awt.Paint convertFillPaint​(org.w3c.dom.Element filledElement,
                                                      GraphicsNode filledNode,
                                                      BridgeContext ctx)
        Converts for the specified element, its fill paint properties to a Paint object.
        Parameters:
        filledElement - the element interested in a Paint
        filledNode - the graphics node to fill
        ctx - the bridge context
      • convertPaint

        public static java.awt.Paint convertPaint​(org.w3c.dom.Element paintedElement,
                                                  GraphicsNode paintedNode,
                                                  Value paintDef,
                                                  float opacity,
                                                  BridgeContext ctx)
        Converts a Paint definition to a concrete java.awt.Paint instance according to the specified parameters.
        Parameters:
        paintedElement - the element interested in a Paint
        paintedNode - the graphics node to paint (objectBoundingBox)
        paintDef - the paint definition
        opacity - the opacity to consider for the Paint
        ctx - the bridge context
      • silentConvertURIPaint

        public static java.awt.Paint silentConvertURIPaint​(org.w3c.dom.Element paintedElement,
                                                           GraphicsNode paintedNode,
                                                           Value paintDef,
                                                           float opacity,
                                                           BridgeContext ctx)
        Converts a Paint specified by URI without sending any error. if a problem occured while processing the URI, it just returns null (same effect as 'none')
        Parameters:
        paintedElement - the element interested in a Paint
        paintedNode - the graphics node to paint (objectBoundingBox)
        paintDef - the paint definition
        opacity - the opacity to consider for the Paint
        ctx - the bridge context
        Returns:
        the paint object or null when impossible
      • convertURIPaint

        public static java.awt.Paint convertURIPaint​(org.w3c.dom.Element paintedElement,
                                                     GraphicsNode paintedNode,
                                                     Value paintDef,
                                                     float opacity,
                                                     BridgeContext ctx)
        Converts a Paint specified as a URI.
        Parameters:
        paintedElement - the element interested in a Paint
        paintedNode - the graphics node to paint (objectBoundingBox)
        paintDef - the paint definition
        opacity - the opacity to consider for the Paint
        ctx - the bridge context
      • convertRGBICCColor

        public static java.awt.Color convertRGBICCColor​(org.w3c.dom.Element paintedElement,
                                                        Value colorDef,
                                                        Value iccColor,
                                                        float opacity,
                                                        BridgeContext ctx)
        Returns a Color object that corresponds to the input Paint's ICC color value or an RGB color if the related color profile could not be used or loaded for any reason.
        Parameters:
        paintedElement - the element using the color
        colorDef - the color definition
        iccColor - the ICC color definition
        opacity - the opacity
        ctx - the bridge context to use
      • convertICCColor

        public static java.awt.Color convertICCColor​(org.w3c.dom.Element e,
                                                     ICCColor c,
                                                     float opacity,
                                                     BridgeContext ctx)
        Returns a Color object that corresponds to the input Paint's ICC color value or null if the related color profile could not be used or loaded for any reason.
        Parameters:
        e - the element using the color
        c - the ICC color definition
        opacity - the opacity
        ctx - the bridge context to use
      • convertICCNamedColor

        public static java.awt.Color convertICCNamedColor​(org.w3c.dom.Element e,
                                                          ICCNamedColor c,
                                                          float opacity,
                                                          BridgeContext ctx)
        Returns a Color object that corresponds to the input Paint's ICC named color value or null if the related color profile could not be used or loaded for any reason.
        Parameters:
        e - the element using the color
        c - the ICC named color definition
        opacity - the opacity
        ctx - the bridge context to use
      • convertCIELabColor

        public static java.awt.Color convertCIELabColor​(org.w3c.dom.Element e,
                                                        CIELabColor c,
                                                        float opacity,
                                                        BridgeContext ctx)
        Returns a Color object that corresponds to the input Paint's CIE Lab color value.
        Parameters:
        e - the element using the color
        c - the CIE Lab color definition
        opacity - the opacity
        ctx - the bridge context to use
      • convertDeviceColor

        public static java.awt.Color convertDeviceColor​(org.w3c.dom.Element e,
                                                        Value srgb,
                                                        DeviceColor c,
                                                        float opacity,
                                                        BridgeContext ctx)
        Returns a Color object that corresponds to the input Paint's device-specific color value.
        Parameters:
        e - the element using the color
        srgb - the sRGB fallback color
        c - the device-specific color definition
        opacity - the opacity
        ctx - the bridge context to use
      • convertColor

        public static java.awt.Color convertColor​(Value c,
                                                  float opacity)
        Converts the given Value and opacity to a Color object.
        Parameters:
        c - The CSS color to convert.
        opacity - The opacity value (0 <= o <= 1).
      • convertStroke

        public static java.awt.Stroke convertStroke​(org.w3c.dom.Element e)
        Converts a Stroke object defined on the specified element.
        Parameters:
        e - the element on which the stroke is specified
      • convertStrokeDasharray

        public static float[] convertStrokeDasharray​(Value v)
        Converts the 'stroke-dasharray' property to a list of float number in user units.
        Parameters:
        v - the CSS value describing the dasharray property
      • convertStrokeMiterlimit

        public static float convertStrokeMiterlimit​(Value v)
        Converts the 'miterlimit' property to the appropriate float number.
        Parameters:
        v - the CSS value describing the miterlimit property
      • convertStrokeLinecap

        public static int convertStrokeLinecap​(Value v)
        Converts the 'linecap' property to the appropriate BasicStroke constant.
        Parameters:
        v - the CSS value describing the linecap property
      • convertStrokeLinejoin

        public static int convertStrokeLinejoin​(Value v)
        Converts the 'linejoin' property to the appropriate BasicStroke constant.
        Parameters:
        v - the CSS value describing the linejoin property
      • resolveColorComponent

        public static int resolveColorComponent​(Value v)
        Returns the value of one color component (0 <= result <= 255).
        Parameters:
        v - the value that defines the color component
      • convertOpacity

        public static float convertOpacity​(Value v)
        Returns the opacity represented by the specified CSSValue.
        Parameters:
        v - the value that represents the opacity
        Returns:
        the opacity between 0 and 1