Class SvgConfiguration

java.lang.Object
com.deltaxml.htmlcompare.SvgConfiguration

public class SvgConfiguration extends Object
Configuration object that contains parameters that describe how SVG comparison takes place and is presented.
  • Constructor Details

    • SvgConfiguration

      public SvgConfiguration()
      Create a new SvgConfiguration object.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Gets whether SVG-aware comparison is currently enabled.
      Returns:
      whether SVG-aware comparison is enabled.
    • setEnabled

      public void setEnabled(boolean value)
      Sets whether SVG-aware comparison should take place. SVG comparison is recommended as it will use SVG-aware features when comparing two SVG images to ensure that the result can be rendered.
      Parameters:
      value - whether to use SVG comparison
    • getSvgGranularity

      public SvgGranularity getSvgGranularity()
      Get the current value of the SVG granularity parameter.
      Returns:
      the value of the SVG granularity parameter.
      See Also:
    • setSvgGranularity

      public void setSvgGranularity(SvgGranularity value)
      Set the new value of the SVG granularity parameter.
      Parameters:
      value - the new value of the SVG granularity parameter.
      See Also:
    • isSvgNumericToleranceEnabled

      public boolean isSvgNumericToleranceEnabled()
      Get whether SVG numeric tolerance is enabled.
      Returns:
      whether SVG numeric tolerance is enabled.
      See Also:
    • setSvgNumericToleranceEnabled

      public void setSvgNumericToleranceEnabled(boolean value)
      Sets whether to use a numeric tolerance when comparing SVGs. SVG comparison will check co-ordinate values are within a configurable tolerance and therefore can be considered having negligible change.
      Parameters:
      value - whether to use a numeric tolerance in SVG comparison.
    • getSvgNumericToleranceValue

      public String getSvgNumericToleranceValue()
      Gets the numeric tolerance value for SVG comparison.
      Returns:
      the string value of the SVG numeric tolerance
    • setSvgNumericToleranceValue

      public void setSvgNumericToleranceValue(String value)
      Sets the numeric tolerance value for SVG comparison results. This value is used to check if co-ordinate values are within specified tolerance and therefore can be considered having negligible change. The default value is "1%".
      Parameters:
      value - a value for SVG numeric tolerance either fixed value or percentage
    • isSvgZIndexEnabled

      public boolean isSvgZIndexEnabled()
      Returns whether Z-index changes are shown in the SVG Comparisons.
      Returns:
      whether Z-index changes will be shown in the comparison result.
    • setSvgZIndexEnabled

      public void setSvgZIndexEnabled(boolean value)
      Sets whether the comparison should show Z-index changes in an SVG comparison. Z-index changes in SVG comparisons are recommended as it will and render any Z-index changes with an alternate colour.
      Parameters:
      value - whether to show Z-index changes in the SVG comparison
    • getZIndexMarkupStyle

      public String getZIndexMarkupStyle()
      Gets the current Z-index SVG markup style used for SVG comparison results.
      Returns:
      the current Z-index SVG markup style.
    • setZIndexMarkupStyle

      public void setZIndexMarkupStyle(String value)
      Sets the Z-index SVG markup style used for SVG comparison results. The default is "purple", hex colours are also valid.
      Parameters:
      value - the Z-index SVG markup style to set.
    • isSvgFallbackEnabled

      public boolean isSvgFallbackEnabled()
      Get the value of the SVG fallback parameter.
      Returns:
      whether SVG fallback is enabled.
      See Also:
    • setSvgFallbackEnabled

      public void setSvgFallbackEnabled(boolean value)
      Sets whether to fall back to SvgGranularity.ADJACENT. SVG comparison granularity will fall back to SvgGranularity.ADJACENT if SVG exceeds the percentage of changed elements defined by the fallback changed percentage.
      Parameters:
      value - whether SVG fallback should be used.
    • getSvgFallbackChangedPercentage

      public double getSvgFallbackChangedPercentage()
      Gets the value of the fallback changed percentage parameter.
      Returns:
      the fallback changed percentage parameter value.
    • setSvgFallbackChangedPercentage

      public void setSvgFallbackChangedPercentage(double value)
      Sets fall back changed percentage parameter for SVG comparison. If more than the given percentage threshold elements have changed between the two SVG inputs, the SVG fallback mechanism will be engaged as described in setSvgFallbackEnabled(boolean).

      The default value is 30.0 (30%).

      Parameters:
      value - the threshold value for changed elements before engaging SVG fallback.