Class AbstractTickGenerator

    • Field Detail

      • m_Ticks

        protected List<Tick> m_Ticks
        the list of ticks to return.
      • m_Labels

        protected HashSet<String> m_Labels
        for avoiding duplicate labels.
    • Constructor Detail

      • AbstractTickGenerator

        public AbstractTickGenerator()
    • Method Detail

      • hasLabel

        protected boolean hasLabel​(String label)
        Checks whether the label is already present. If not already present, gets added to the internal list of labels generated so far.
        Parameters:
        label - the label to check
        Returns:
        true if already present, false otherwise (or if null)
      • fixLabel

        protected String fixLabel​(String label)
        Fixes the label, i.e., sets it to null if either NaN or already present.
        Parameters:
        label - the label to fix
        Returns:
        the (potentially) fixed label
      • addLabel

        protected void addLabel​(String label)
        Adds the label to the internal list of labels generated so far.
        Parameters:
        label - the label to add
      • preGenerate

        protected void preGenerate()
        Gets executed before generating the ticks.
      • doGenerate

        protected abstract void doGenerate()
        Generate the ticks of this axis.
      • postGenerate

        protected void postGenerate()
        Gets executed after generating the ticks.
      • getTicks

        public List<Tick> getTicks()
        Returns the ticks of this axis.
        Specified by:
        getTicks in interface TickGenerator
        Returns:
        the current ticks to display
      • shallowCopy

        public TickGenerator shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface ShallowCopySupporter<TickGenerator>
        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 TickGenerator 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 TickGenerator 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