Package com.deltaxml.htmlcompare
Class SvgConfiguration
java.lang.Object
com.deltaxml.htmlcompare.SvgConfiguration
Configuration object that contains parameters that describe how SVG comparison takes place and is presented.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the value of the fallback changed percentage parameter.Get the current value of the SVG granularity parameter.Gets the numeric tolerance value for SVG comparison.Gets the current Z-index SVG markup style used for SVG comparison results.booleanGets whether SVG-aware comparison is currently enabled.booleanGet the value of the SVG fallback parameter.booleanGet whether SVG numeric tolerance is enabled.booleanReturns whether Z-index changes are shown in the SVG Comparisons.voidsetEnabled(boolean value) Sets whether SVG-aware comparison should take place.voidsetSvgFallbackChangedPercentage(double value) Sets fall back changed percentage parameter for SVG comparison.voidsetSvgFallbackEnabled(boolean value) Sets whether to fall back toSvgGranularity.ADJACENT.voidsetSvgGranularity(SvgGranularity value) Set the new value of the SVG granularity parameter.voidsetSvgNumericToleranceEnabled(boolean value) Sets whether to use a numeric tolerance when comparing SVGs.voidSets the numeric tolerance value for SVG comparison results.voidsetSvgZIndexEnabled(boolean value) Sets whether the comparison should show Z-index changes in an SVG comparison.voidsetZIndexMarkupStyle(String value) Sets the Z-index SVG markup style used for SVG comparison results.
-
Constructor Details
-
SvgConfiguration
public SvgConfiguration()Create a newSvgConfigurationobject.
-
-
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
Get the current value of the SVG granularity parameter.- Returns:
- the value of the SVG granularity parameter.
- See Also:
-
setSvgGranularity
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
Gets the numeric tolerance value for SVG comparison.- Returns:
- the string value of the SVG numeric tolerance
-
setSvgNumericToleranceValue
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
Gets the current Z-index SVG markup style used for SVG comparison results.- Returns:
- the current Z-index SVG markup style.
-
setZIndexMarkupStyle
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 toSvgGranularity.ADJACENT. SVG comparison granularity will fall back toSvgGranularity.ADJACENTif 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 insetSvgFallbackEnabled(boolean).The default value is 30.0 (30%).
- Parameters:
value- the threshold value for changed elements before engaging SVG fallback.
-