Class ProgressIndicator

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable
    Direct Known Subclasses:
    ProgressBar

    public class ProgressIndicator
    extends Control
    A circular control which is used for indicating progress, either infinite (aka indeterminate) or finite. Often used with the Task API for representing progress of background Tasks.

    ProgressIndicator sets focusTraversable to false.

    This first example creates a ProgressIndicator with an indeterminate value:

     ProgressIndicator p1 = new ProgressIndicator();
    Image of the indeterminate progress ProgressIndicator control

    This next example creates a ProgressIndicator which is 25% complete:

     ProgressIndicator p2 = new ProgressIndicator();
     p2.setProgress(0.25F);
    Image of the ProgressIndicator control
    Since:
    JavaFX 2.0
    • Property Detail

      • indeterminate

        public final ReadOnlyBooleanProperty indeterminateProperty
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
        See Also:
        isIndeterminate()
      • progress

        public final DoubleProperty progressProperty
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
        See Also:
        getProgress(), setProgress(double)
    • Constructor Detail

      • ProgressIndicator

        public ProgressIndicator()
        Creates a new indeterminate ProgressIndicator.
      • ProgressIndicator

        public ProgressIndicator​(double progress)
        Creates a new ProgressIndicator with the given progress value.
        Parameters:
        progress - the progress, represented as a value between 0 and 1
    • Method Detail

      • isIndeterminate

        public final boolean isIndeterminate()
        Gets the value of the property indeterminate.
        Property description:
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
      • indeterminateProperty

        public final ReadOnlyBooleanProperty indeterminateProperty()
        A flag indicating whether it is possible to determine the progress of the ProgressIndicator. Typically indeterminate progress bars are rendered with some form of animation indicating potentially "infinite" progress.
        See Also:
        isIndeterminate()
      • setProgress

        public final void setProgress​(double value)
        Sets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • getProgress

        public final double getProgress()
        Gets the value of the property progress.
        Property description:
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
      • progressProperty

        public final DoubleProperty progressProperty()
        The actual progress of the ProgressIndicator. A negative value for progress indicates that the progress is indeterminate. A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%. Any value greater than 1 is interpreted as 100%.
        See Also:
        getProgress(), setProgress(double)
      • createDefaultSkin

        protected Skin<?> createDefaultSkin()
        Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).
        Overrides:
        createDefaultSkin in class Control
        Returns:
        new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.
      • getInitialFocusTraversable

        protected Boolean getInitialFocusTraversable()
        Returns the initial focus traversable state of this control, for use by the JavaFX CSS engine to correctly set its initial value. This method is overridden as by default UI controls have focus traversable set to true, but that is not appropriate for this control.
        Overrides:
        getInitialFocusTraversable in class Control
        Returns:
        the initial focus traversable state of this control
        Since:
        9
      • queryAccessibleAttribute

        public Object queryAccessibleAttribute​(AccessibleAttribute attribute,
                                               Object... parameters)
        This method is called by the assistive technology to request the value for an attribute.

        This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
        If a particular attribute is not handled, the superclass implementation must be called.

        Overrides:
        queryAccessibleAttribute in class Control
        Parameters:
        attribute - the requested attribute
        parameters - optional list of parameters
        Returns:
        the value for the requested attribute
        See Also:
        AccessibleAttribute