Class ColorInfo


  • public class ColorInfo
    extends java.lang.Object
    Data class to hold information on a named color setting.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String category  
      private java.awt.Color defaultValue  
      private java.lang.String name  
      private java.lang.String source  
      private java.awt.Color value  
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorInfo()
      Constructs a new ColorInfo.
      ColorInfo​(java.lang.String category, java.lang.String source, java.lang.String name, java.awt.Color value, java.awt.Color defaultValue)
      Constructs a new ColorInfo.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ColorInfo fromPref​(java.util.List<java.lang.String> lst, boolean isDefault)
      Constructs a new ColorInfo from raw preference value.
      java.lang.String getCategory()
      Get the category.
      java.awt.Color getDefaultValue()
      Get the default value for this color setting.
      java.lang.String getName()
      Get the name.
      java.lang.String getSource()
      Get the source.
      java.awt.Color getValue()
      Get the color value in the preferences (if set).
      void setCategory​(java.lang.String category)
      Set the category.
      void setDefaultValue​(java.awt.Color defaultValue)
      Set the default value.
      void setName​(java.lang.String name)
      Set the name.
      void setSource​(java.lang.String source)
      Set the source.
      void setValue​(java.awt.Color value)
      Set the color value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • category

        private java.lang.String category
      • source

        private java.lang.String source
      • name

        private java.lang.String name
      • value

        private java.awt.Color value
    • Constructor Detail

      • ColorInfo

        public ColorInfo()
        Constructs a new ColorInfo.
      • ColorInfo

        public ColorInfo​(java.lang.String category,
                         java.lang.String source,
                         java.lang.String name,
                         java.awt.Color value,
                         java.awt.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

      • getCategory

        public java.lang.String getCategory()
        Get the category.
        Returns:
        the category
      • getSource

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

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

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

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

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

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

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

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

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

        public static ColorInfo fromPref​(java.util.List<java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object