StyleSettings

Inheritance: java.lang.Object

public class StyleSettings

This class represents style settings for text formatting.

Use this class to customize the font color, highlight color, style attributes (bold, underline, italic, strikethrough), string separators, original sizes, and word separators for text.

Example usage:


 try (Comparer comparer = new Comparer(sourceFile)) {
    comparer.add(targetFile);

    StyleSettings styleSettings = new StyleSettings();
    styleSettings.setFontColor(Color.GREEN);
    styleSettings.setBold(true);
    styleSettings.setUnderline(true);

    final CompareOptions compareOptions = new CompareOptions();
    compareOptions.setInsertedItemStyle(styleSettings);

    comparer.compare(resultFile, compareOptions);
 }
 

Constructors

Constructor Description
StyleSettings() Initializes a new instance of the StyleSettings class.

Methods

Method Description
getFontColor() Gets the font color.
setFontColor(Color value) Sets the font color.
getHighlightColor() Gets the highlight color.
setHighlightColor(Color value) Sets the highlight color.
isBold() Gets a flag that indicates whether the text will be bold or not.
setBold(boolean value) Sets a flag that indicates whether the text should be bold or not.
isUnderline() Gets a flag that indicates whether the text will be underlined or not.
setUnderline(boolean value) Sets a flag that indicates whether the text should be underlined or not.
isItalic() Gets a flag that indicates whether the text will be italic or not.
setItalic(boolean value) Sets a flag that indicates whether the text should be italic or not.
isStrikethrough() Gets a flag that indicates whether the text will be strike through or not.
setStrikethrough(boolean value) Sets a flag that indicates whether the text should be strike through or not.
getStartStringSeparator() Gets the start string separator.
setStartStringSeparator(String value) Sets the start string separator.
getEndStringSeparator() Gets the end string separator.
setEndStringSeparator(String value) Sets the end string separator.
getOriginalSize() Gets the original size of comparing documents.
setOriginalSize(Size value) Sets the original size of comparing documents.
getWordsSeparators() Gets the word separator chars.
setWordsSeparators(char[] value) Sets the word separator chars.

StyleSettings()

public StyleSettings()

Initializes a new instance of the StyleSettings class.

getFontColor()

public final Color getFontColor()

Gets the font color.

Returns: java.awt.Color - the font color.

setFontColor(Color value)

public final void setFontColor(Color value)

Sets the font color.

Parameters:

Parameter Type Description
value java.awt.Color The new font color.

getHighlightColor()

public final Color getHighlightColor()

Gets the highlight color.

Returns: java.awt.Color - the highlight color.

setHighlightColor(Color value)

public final void setHighlightColor(Color value)

Sets the highlight color.

Parameters:

Parameter Type Description
value java.awt.Color The new highlight color.

isBold()

public final boolean isBold()

Gets a flag that indicates whether the text will be bold or not.

Returns: boolean - true if the text will be bold, false otherwise.

setBold(boolean value)

public final void setBold(boolean value)

Sets a flag that indicates whether the text should be bold or not.

Parameters:

Parameter Type Description
value boolean true if the text should be bold, false otherwise.

isUnderline()

public final boolean isUnderline()

Gets a flag that indicates whether the text will be underlined or not.

Returns: boolean - true if the text will be underlined, false otherwise.

setUnderline(boolean value)

public final void setUnderline(boolean value)

Sets a flag that indicates whether the text should be underlined or not.

Parameters:

Parameter Type Description
value boolean true if the text should be underlined, false otherwise.

isItalic()

public final boolean isItalic()

Gets a flag that indicates whether the text will be italic or not.

Returns: boolean - true if the text will be italic, false otherwise.

setItalic(boolean value)

public final void setItalic(boolean value)

Sets a flag that indicates whether the text should be italic or not.

Parameters:

Parameter Type Description
value boolean true if the text should be italic, false otherwise.

isStrikethrough()

public final boolean isStrikethrough()

Gets a flag that indicates whether the text will be strike through or not.

Returns: boolean - true if the text will be strike through, false otherwise.

setStrikethrough(boolean value)

public final void setStrikethrough(boolean value)

Sets a flag that indicates whether the text should be strike through or not.

Parameters:

Parameter Type Description
value boolean true if the text should be strike through, false otherwise.

getStartStringSeparator()

public final String getStartStringSeparator()

Gets the start string separator.

Returns: java.lang.String - the start string separator.

setStartStringSeparator(String value)

public final void setStartStringSeparator(String value)

Sets the start string separator.

Parameters:

Parameter Type Description
value java.lang.String The new start string separator.

getEndStringSeparator()

public final String getEndStringSeparator()

Gets the end string separator.

Returns: java.lang.String - the end string separator.

setEndStringSeparator(String value)

public final void setEndStringSeparator(String value)

Sets the end string separator.

Parameters:

Parameter Type Description
value java.lang.String The new end string separator.

getOriginalSize()

public final Size getOriginalSize()

Gets the original size of comparing documents.

Returns: Size - the original size of comparing documents.

setOriginalSize(Size value)

public final void setOriginalSize(Size value)

Sets the original size of comparing documents.

Parameters:

Parameter Type Description
value Size The new original size of comparing documents.

getWordsSeparators()

public final char[] getWordsSeparators()

Gets the word separator chars.

Returns: char[] - the word separators.

setWordsSeparators(char[] value)

public final void setWordsSeparators(char[] value)

Sets the word separator chars.

Parameters:

Parameter Type Description
value char[] The new word separators.