Enum UIFactory.Colors

    • Method Detail

      • values

        public static UIFactory.Colors[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UIFactory.Colors c : UIFactory.Colors.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UIFactory.Colors valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isConfigurable

        public boolean isConfigurable()
      • getDefaultValue

        public java.lang.String getDefaultValue()
        Getter for default String-encoded color value. Is used for Color.decode() and should be formatted similarly
        Returns:
        Default String-encoded color value
      • getValue

        public java.awt.Color getValue()
        Getter for current color value. It is loaded from preferences if no color is set previously.
        Returns:
        Current color value
      • setValue

        public java.awt.Color setValue​(java.awt.Color c)
        Setter for current color value.
        Returns:
        Old color value
      • getPreferencesName

        public java.lang.String getPreferencesName()
        Get color name used in preferences file. It is formed from enum name. E.g. colors.input.invalid for INPUT_INVALID
        Returns:
        Color name used in preferences file
      • readColorFromPreferences

        public java.awt.Color readColorFromPreferences()
        Read color value from preferences ignoring current color value that is returned by getValue();
        Returns:
        Color value from preferences file
      • valueOfByPreferencesName

        public static UIFactory.Colors valueOfByPreferencesName​(java.lang.String prefsName)
        Find Colors by color preferences name.
        Parameters:
        prefsName - Color preferences name (e.g. "colors.input.default")
        Returns:
        Colors associated with such preferences name
        Throws:
        java.lang.IllegalArgumentException - in case there is no Colors with such name
      • getColorByPreferencesName

        public static java.awt.Color getColorByPreferencesName​(java.lang.String prefsName)
        Get Color by colors preferences name.
        Parameters:
        prefsName - Color preferences name (e.g. "colors.input.default")
        Returns:
        Color if Preferences contain this color. Returns default value if exists
        null otherwise
      • getColorsNames

        public static java.lang.String[] getColorsNames()
        Get array with all colors names used in preferences
        Returns:
        Names array
      • decodeRGBA

        public static java.awt.Color decodeRGBA​(java.lang.String color)
                                         throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • encodeARGB

        public static java.lang.String encodeARGB​(java.awt.Color color)