Class Fill

  • All Implemented Interfaces:
    Comparable<AbstractStyle>

    public class Fill
    extends AbstractStyle
    Class representing a Fill (background) entry. The Fill entry is used to define background colors and fill patterns
    Author:
    Raphael Stoeckli
    • Constructor Detail

      • Fill

        public Fill()
        Default constructor
      • Fill

        public Fill​(String foreground,
                    String background)
        Constructor with foreground and background color
        Parameters:
        foreground - Foreground color of the fill
        background - Background color of the fill
      • Fill

        public Fill​(String value,
                    Fill.FillType fillType)
        Constructor with color value and fill type
        Parameters:
        value - Color value
        fillType - Fill type (fill or pattern)
    • Method Detail

      • getPatternName

        public static String getPatternName​(Fill.PatternValue pattern)
        Gets the pattern name from the enum
        Parameters:
        pattern - Enum to process
        Returns:
        The valid value of the pattern as String
      • getIndexedColor

        public int getIndexedColor()
        Gets the indexed color (Default is 64)
        Returns:
        Indexed color
      • setIndexedColor

        public void setIndexedColor​(int indexedColor)
        Sets the indexed color (Default is 64)
        Parameters:
        indexedColor - Indexed color
      • getPatternFill

        public Fill.PatternValue getPatternFill()
        Gets the pattern type of the fill (Default is none)
        Returns:
        Pattern type of the fill
      • setPatternFill

        public void setPatternFill​(Fill.PatternValue patternFill)
        Sets the pattern type of the fill (Default is none)
        Parameters:
        patternFill - Pattern type of the fill
      • getForegroundColor

        public String getForegroundColor()
        Gets the foreground color of the fill. The value is expressed as hex string with the format AARRGGBB. AA (Alpha) is usually FF
        Returns:
        Foreground color of the fill
      • setForegroundColor

        public void setForegroundColor​(String foregroundColor)
        Sets the foreground color of the fill. The value is expressed as hex string with the format AARRGGBB. AA (Alpha) is usually FF
        Parameters:
        foregroundColor - Foreground color of the fill
      • getBackgroundColor

        public String getBackgroundColor()
        Gets the Background color of the fill. The value is expressed as hex string with the format AARRGGBB. AA (Alpha) is usually FF
        Returns:
        Background color of the fill
      • setBackgroundColor

        public void setBackgroundColor​(String backgroundColor)
        Sets the background color of the fill. The value is expressed as hex string with the format AARRGGBB. AA (Alpha) is usually FF
        Parameters:
        backgroundColor - Background color of the fill
      • setColor

        public void setColor​(String value,
                             Fill.FillType fillType)
        Sets the color and the depending fill type
        Parameters:
        value - Color value
        fillType - Fill type (fill or pattern)
      • toString

        public String toString()
        Override toString method
        Overrides:
        toString in class Object
        Returns:
        String of a class instance
      • copy

        public Fill copy()
        Method to copy the current object to a new one
        Specified by:
        copy in class AbstractStyle
        Returns:
        Copy of the current object without the internal ID
      • hashCode

        public int hashCode()
        Override method to calculate the hash of this component
        Overrides:
        hashCode in class Object
        Returns:
        Calculated hash as string