Class ColorInfo


  • public class ColorInfo
    extends Object
    Data class to hold information on a named color setting.
    • Constructor Detail

      • ColorInfo

        public ColorInfo()
        Constructs a new ColorInfo.
      • ColorInfo

        public ColorInfo​(String category,
                         String source,
                         String name,
                         Color value,
                         Color defaultValue)
        Constructs a new ColorInfo.
        Parameters:
        category - the category of the color setting
        source - the source (related file), can be null
        name - the color name
        value - the color value set in the preferences, null if not set
        defaultValue - the default value for this color setting, can be null
        See Also:
        NamedColorProperty
    • Method Detail

      • getSource

        public String getSource()
        Get the source.
        Returns:
        the source, can be null
      • getName

        public String getName()
        Get the name.
        Returns:
        the name
      • getValue

        public Color getValue()
        Get the color value in the preferences (if set).
        Returns:
        the color value, can be null
      • getDefaultValue

        public Color getDefaultValue()
        Get the default value for this color setting.
        Returns:
        the default value, can be null
      • setCategory

        public void setCategory​(String category)
        Set the category.
        Parameters:
        category - the category
      • setSource

        public void setSource​(String source)
        Set the source.
        Parameters:
        source - the source
      • setName

        public void setName​(String name)
        Set the name.
        Parameters:
        name - the name
      • setValue

        public void setValue​(Color value)
        Set the color value.
        Parameters:
        value - the value
      • setDefaultValue

        public void setDefaultValue​(Color defaultValue)
        Set the default value.
        Parameters:
        defaultValue - the default value
      • fromPref

        public static ColorInfo fromPref​(List<String> lst,
                                         boolean isDefault)
        Constructs a new ColorInfo from raw preference value.
        Parameters:
        lst - the list
        isDefault - if the list represents a default value or not
        Returns:
        corresponding ColorInfo object or null in case of invalid input