Class AbstractGradientSvgNodeRenderer

All Implemented Interfaces:
IBranchSvgNodeRenderer, INoDrawSvgNodeRenderer, ISvgNodeRenderer, ISvgPaintServer
Direct Known Subclasses:
LinearGradientSvgNodeRenderer, RadialGradientSvgNodeRenderer

public abstract class AbstractGradientSvgNodeRenderer extends AbstractBranchSvgNodeRenderer implements ISvgPaintServer
ISvgNodeRenderer abstract implementation for gradient tags (, ).
  • Field Details

  • Constructor Details

    • AbstractGradientSvgNodeRenderer

      public AbstractGradientSvgNodeRenderer()
  • Method Details

    • doDraw

      protected void doDraw (SvgDrawContext context)
      Gradient node renderers are not directly drawable.
      Overrides:
      doDraw in class AbstractBranchSvgNodeRenderer
      Parameters:
      context - the object that knows the place to draw this element and maintains its state
      Throws:
      UnsupportedOperationException - always, because gradient definitions cannot be drawn as nodes
    • createColor

      public Color createColor (SvgDrawContext context, Rectangle objectBoundingBox, float objectBoundingBoxMargin, float parentOpacity)
      Creates the Color that represents the corresponding paint server for specified object box.
      Specified by:
      createColor in interface ISvgPaintServer
      Parameters:
      context - the current svg draw context
      objectBoundingBox - the coloring object bounding box without any adjustments (additional stroke width or others)
      objectBoundingBoxMargin - the objectBoundingBoxMargin of the object bounding box to be colored (for example - the part of stroke width that exceeds the object bounding box, i.e. the half of stroke width value)
      parentOpacity - current parent opacity modifier
      Returns:
      the created color
    • createGradientBuilderAndConfigureGeometry

      @Deprecated protected IGradientBuilder createGradientBuilderAndConfigureGeometry (SvgDrawContext context, Rectangle objectBoundingBox)
      Deprecated.
      deprecated in failure of making abstract
      Creates and configures gradient builder specific to concrete gradient type.
      Parameters:
      context - the current svg draw context
      objectBoundingBox - target element bounding box
      Returns:
      the configured builder instance for this renderer type
    • isHidden

      protected boolean isHidden()
      Check if this renderer should draw the element based on its attributes (e.g. visibility/display)
      Overrides:
      isHidden in class AbstractSvgNodeRenderer
      Returns:
      true if element won't be drawn, false otherwise
    • isObjectBoundingBoxUnits

      protected boolean isObjectBoundingBoxUnits()
      Checks whether the gradient units values are on user space on use or object bounding box
      Returns:
      false if the 'gradientUnits' value of the gradient tag equals to 'userSpaceOnUse', otherwise true
    • getGradientTransform

      @Deprecated protected AffineTransform getGradientTransform()
      Deprecated.
      will become private
      Evaluates the 'gradientTransform' transformations
      Returns:
      an AffineTransform object representing the specified gradient transformation
    • getGradientTransformToUserSpaceOnUse

      protected AffineTransform getGradientTransformToUserSpaceOnUse (Rectangle objectBoundingBox, boolean isObjectBoundingBox)
      Creates a transformation from the gradient coordinate space to user space.
      Parameters:
      objectBoundingBox - target element bounding box
      isObjectBoundingBox - whether gradient units are object-bounding-box based
      Returns:
      a composed AffineTransform to use for gradient rendering
    • getChildStopRenderers

      @Deprecated protected List<StopSvgNodeRenderer> getChildStopRenderers()
      Deprecated.
      will become private
      Construct a list of child stop renderers
      Returns:
      a list of StopSvgNodeRenderer elements that represents the child stop values
    • parseSpreadMethod

      @Deprecated protected GradientSpreadMethod parseSpreadMethod()
      Deprecated.
      will become private
      Parses the gradient spread method
      Returns:
      the parsed GradientSpreadMethod specified in the gradient