Class ProgressBar


  • public final class ProgressBar
    extends SingleRowSection
    A horizontal progress bar over the range 0 to 1, drawn with block glyphs and an optional centered percentage.
    • Constructor Detail

      • ProgressBar

        public ProgressBar()
    • Method Detail

      • value

        public ProgressBar value​(double value)
        Sets progress as a fraction, clamped to the range [0, 1].
        Parameters:
        value - the progress fraction
        Returns:
        this ProgressBar for chaining
      • progress

        public ProgressBar progress​(int current,
                                    int max)
        Sets progress as a ratio of current to max; a non-positive max yields zero progress.
        Parameters:
        current - the current amount
        max - the maximum amount
        Returns:
        this ProgressBar for chaining
      • showPercent

        public ProgressBar showPercent​(boolean show)
        Sets whether the centered percentage is shown.
        Parameters:
        show - true to overlay the percentage
        Returns:
        this ProgressBar for chaining
      • filledStyle

        public ProgressBar filledStyle​(Style style)
        Sets the style of the filled portion.
        Parameters:
        style - the filled style
        Returns:
        this ProgressBar for chaining
      • emptyStyle

        public ProgressBar emptyStyle​(Style style)
        Sets the style of the empty portion.
        Parameters:
        style - the empty style
        Returns:
        this ProgressBar for chaining
      • value

        public double value()
        Returns:
        the progress fraction in the range [0, 1]