Top Description Fields Constructors Methods
com.dlsc.gemsfx

public Class CircleProgressIndicator

extends ArcProgressIndicator
Class Inheritance
Imports
com.dlsc.gemsfx.skins.CircleProgressIndicatorSkin, javafx.beans.property.DoubleProperty, .SimpleDoubleProperty, javafx.scene.control.Skin, java.util.Objects

CircleProgressIndicator is a visual control used to indicate the progress of a task. It represents progress in a circular form, with options to show determinate or indeterminate states.

In a determinate state, the circle fills up based on the progress value, which ranges from 0.0 to 1.0, where 0.0 indicates no progress and 1.0 indicates completion.

In an indeterminate state, the circle shows a cyclic animation, indicating that progress is ongoing but the exact status is unknown. This state is useful for tasks where the progress cannot be determined.

The control also supports displaying a text or graphic inside the circle to provide additional information or visual feedback to the user.

Usage examples include file downloads, file transfers, or any long-running tasks where visual feedback on progress is beneficial.

The CircleProgressIndicator extends ArcProgressIndicator and adds a start angle property that defines the starting angle of the arc used to display the progress. The default start angle is 90 degrees, which corresponds to the top of the circle.

Pseudo class: Beyond the inherited , indeterminate and determinate pseudo-classes from ProgressIndicator, CircleProgressIndicator introduces a completed pseudo-class. This pseudo-class can be used in CSS to apply custom styles when the progress reaches 1.0 (100%).

Tips: If you prefer not to instantiate the animation object during initialization, pass a 0.0 as the initial progress. This setup indicates no progress but avoids entering the indeterminate state, which would otherwise instantiate and start the animation.

Usage examples:

    // Initializes with no progress and no animation.
    CircleProgressIndicator progressIndicator = new CircleProgressIndicator(0.0);

Field Summary

Modifier and TypeField and Description
private static final double
private static final String
private DoubleProperty

Constructor Summary

AccessConstructor and Description
public
public
CircleProgressIndicator(double progress)

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.ProgressIndicator.createDefaultSkin.

Create a new instance of the default skin for this control.

public final double
public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final void
setStartAngle(double startAngle)

public final DoubleProperty

Returns:

the start angle property
startAngleProperty
()

The start angle property defines the starting angle of the arc that is used to display the progress.

Inherited from com.dlsc.gemsfx.ArcProgressIndicator:
converterPropertygetClassCssMetaDatagetControlCssMetaDatagetConvertergetGraphicgetProgressArcTypegetStyleTypegetTrackArcTypegraphicPropertyprogressArcTypePropertysetConvertersetGraphicsetProgressArcTypesetStyleTypesetTrackArcTypestyleTypePropertytrackArcTypeProperty

Field Detail

DEFAULT_START_ANGLEback to summary
private static final double DEFAULT_START_ANGLE
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS

Hides com.dlsc.gemsfx.ArcProgressIndicator.DEFAULT_STYLE_CLASS.

startAngleback to summary
private DoubleProperty startAngle

Constructor Detail

CircleProgressIndicatorback to summary
public CircleProgressIndicator()
CircleProgressIndicatorback to summary
public CircleProgressIndicator(double progress)

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.ProgressIndicator.createDefaultSkin.

Doc from javafx.scene.control.ProgressIndicator.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(...).

Annotations
@Override
getStartAngleback to summary
public final double getStartAngle()
getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
setStartAngleback to summary
public final void setStartAngle(double startAngle)
startAnglePropertyback to summary
public final DoubleProperty startAngleProperty()

The start angle property defines the starting angle of the arc that is used to display the progress. The default value is 90 degrees, which corresponds to the top of the circle.

Returns:DoubleProperty

the start angle property