Class SVGFilterElementBridge

All Implemented Interfaces:
SVGAnimationTargetContext, Bridge, BridgeUpdateHandler, ErrorConstants, FilterBridge, GenericBridge, XMLConstants, SVGContext, CSSConstants, SVGConstants

public class SVGFilterElementBridge extends AnimatableGenericSVGBridge implements FilterBridge, ErrorConstants
Bridge class for the <filter> element.
Version:
$Id: SVGFilterElementBridge.java 1805408 2017-08-18 12:21:52Z ssteiner $
  • Field Details

    • TRANSPARENT_BLACK

      protected static final Color TRANSPARENT_BLACK
      Transparent black color.
  • Constructor Details

    • SVGFilterElementBridge

      public SVGFilterElementBridge()
      Constructs a new bridge for the <filter> element.
  • Method Details

    • getLocalName

      public String getLocalName()
      Returns 'filter'.
      Specified by:
      getLocalName in interface Bridge
    • createFilter

      public Filter createFilter(BridgeContext ctx, Element filterElement, Element filteredElement, GraphicsNode filteredNode)
      Creates a Filter according to the specified parameters.
      Specified by:
      createFilter in interface FilterBridge
      Parameters:
      ctx - the bridge context to use
      filterElement - the element that defines the filter
      filteredElement - the element that references the filter element
      filteredNode - the graphics node to filter
    • createEmptyFilter

      protected static Filter createEmptyFilter(Element filterElement, Rectangle2D filterRegion, Element filteredElement, GraphicsNode filteredNode, BridgeContext ctx)
      Creates a new returns a new filter that fills its output with transparent black. This is used when a <filter> element has no filter primitive children.
    • buildFilterPrimitives

      protected static Filter buildFilterPrimitives(Element filterElement, Rectangle2D filterRegion, Element filteredElement, GraphicsNode filteredNode, Filter in, Map filterNodeMap, BridgeContext ctx)
      Builds the filter primitives of filter chain of the specified filter element and returns the last filter primitive created. Filter primitives can be children of the filter or defined on one of its 'ancestor' (linked with the xlink:href attribute).
      Parameters:
      filterElement - the filter element
      filterRegion - the filter chain region
      filteredElement - the filtered element
      filteredNode - the filtered node
      in - the input Filter
      filterNodeMap - the map used by named filter primitives
      ctx - the bridge context
      Returns:
      the last filter primitive created
    • buildLocalFilterPrimitives

      protected static Filter buildLocalFilterPrimitives(Element filterElement, Rectangle2D filterRegion, Element filteredElement, GraphicsNode filteredNode, Filter in, Map filterNodeMap, BridgeContext ctx)
      Builds the filter primitives of filter chain of the specified filter element and returns the last filter primitive created or 'in' if no filter primitive has been specified.
      Parameters:
      filterElement - the filter element
      filterRegion - the filter chain region
      filteredElement - the filtered element
      filteredNode - the filtered node
      in - the input Filter
      filterNodeMap - the map used by named filter primitives
      ctx - the bridge context
      Returns:
      the last filter primitive created or 'in'