Class AbstractColorGradientGenerator

    • Constructor Detail

      • AbstractColorGradientGenerator

        public AbstractColorGradientGenerator()
    • Method Detail

      • check

        protected void check()
        Hook method for performing checks on the setup.

        Default implementation does nothing.
      • doGenerate

        protected abstract Color[] doGenerate()
        Performs the actual generation.
        Returns:
        the generated colors
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Specified by:
        compareTo in interface ColorGradientGenerator
        Specified by:
        compareTo in interface Comparable
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Specified by:
        equals in interface ColorGradientGenerator
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • shallowCopy

        public ColorGradientGenerator shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface ColorGradientGenerator
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getGenerators

        public static String[] getGenerators()
        Returns a list with classnames of generators.
        Returns:
        the generator classnames
      • forName

        public static ColorGradientGenerator forName​(String classname,
                                                     String[] options)
        Instantiates the generator with the given options.
        Parameters:
        classname - the classname of the generator to instantiate
        options - the options for the generator
        Returns:
        the instantiated generator or null if an error occurred
      • forCommandLine

        public static ColorGradientGenerator forCommandLine​(String cmdline)
        Instantiates the generator from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the generator to instantiate
        Returns:
        the instantiated generator or null if an error occurred