javafx.scene.control.ProgressIndicator Java Examples

The following examples show how to use javafx.scene.control.ProgressIndicator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProgressIndicatorTest.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
private Parent createRoot() {
	StackPane stackPane = new StackPane();

	BorderPane controlsPane = new BorderPane();
	controlsPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
	stackPane.getChildren().add(controlsPane);
	controlsPane.setCenter(new TableView<Void>());

	ProgressIndicator indicator = new ProgressIndicator();
	indicator.setMaxSize(120, 120);
	stackPane.getChildren().add(indicator);
	StackPane.setAlignment(indicator, Pos.BOTTOM_RIGHT);
	StackPane.setMargin(indicator, new Insets(20));

	return stackPane;
}
 
Example #2
Source File: dashboardBase.java    From Client with MIT License 6 votes vote down vote up
private VBox getLoadingPane()
{
    //This returns the loading screen

    //Base pane
    VBox loadingPane = new VBox();
    loadingPane.setSpacing(5);
    loadingPane.setAlignment(Pos.CENTER);

    //Loading Indicator (will be customised to match with the design language later)
    loadingIndicator = new ProgressIndicator(0);
    //enable caching to improve performance
    loadingIndicator.setCache(true);
    loadingIndicator.setCacheHint(CacheHint.SPEED);

    //Loading info Label
    loadingInfoLabel = new Label();

    //Add them and return the node
    loadingPane.getChildren().addAll(loadingIndicator, loadingInfoLabel);
    return loadingPane;
}
 
Example #3
Source File: MessagesConsumer.java    From ns-usbloader with GNU General Public License v3.0 6 votes vote down vote up
MessagesConsumer(EModule appModuleType, BlockingQueue<String> msgQueue, BlockingQueue<Double> progressQueue, HashMap<String, EFileStatus> statusMap){
    this.appModuleType = appModuleType;
    this.isInterrupted = false;

    this.msgQueue = msgQueue;
    this.logsArea = MediatorControl.getInstance().getContoller().logArea;

    this.progressQueue = progressQueue;
    this.progressBar = MediatorControl.getInstance().getContoller().progressBar;

    this.statusMap = statusMap;
    this.tableViewController = MediatorControl.getInstance().getContoller().FrontTabController.tableFilesListController;

    progressBar.setProgress(0.0);

    progressBar.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
    MediatorControl.getInstance().setBgThreadActive(true, appModuleType);
}
 
Example #4
Source File: ProcessController.java    From tools-ocr with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ProcessController(){
    VBox vBox = new VBox();
    vBox.setAlignment(Pos.BASELINE_CENTER);
    vBox.setMinWidth(300);
    vBox.setBackground(new Background(new BackgroundFill(Color.rgb(250, 250, 250), CornerRadii.EMPTY, Insets.EMPTY)));
    ProgressIndicator progressIndicator = new ProgressIndicator();
    progressIndicator.setStyle(CommUtils.STYLE_TRANSPARENT);
    int circleSize = 75;
    progressIndicator.setMinWidth(circleSize);
    progressIndicator.setMinHeight(circleSize);
    Label topLab = new Label("正在识别图片,请稍等.....");
    topLab.setFont(Font.font(18));
    vBox.setSpacing(10);
    vBox.setPadding(new Insets(20, 0, 20, 0));
    vBox.getChildren().add(progressIndicator);
    vBox.getChildren().add(topLab);
    Scene scene = new Scene(vBox, Color.TRANSPARENT);
    setScene(scene);
    initStyle(StageStyle.TRANSPARENT);
    CommUtils.initStage(this);
}
 
Example #5
Source File: Minimal.java    From JavaFX with MIT License 6 votes vote down vote up
private Node createLoadPane() {
	loadPane = new TilePane(5, 5);
	loadPane.setPrefColumns(3);
	loadPane.setPadding(new Insets(5));
	for (int i = 0; i < 9; i++) {
		StackPane waitingPane = new StackPane();
		Rectangle background = new Rectangle((380) / 3, (380) / 3,
				Color.WHITE);
		indicators[i] = new ProgressIndicator();
		indicators[i].setPrefSize(50, 50);
		indicators[i].setMaxSize(50, 50);
		indicators[i].setTranslateY(-25);
		indicators[i].setTranslateX(-10);
		loading[i] = new Label();
		loading[i].setTranslateY(25);
		waitingPane.getChildren().addAll(background, indicators[i],
				loading[i]);
		loadPane.getChildren().add(waitingPane);
	}

	return loadPane;
}
 
Example #6
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 6 votes vote down vote up
/***************************************************************************
 * *
 * Constructors                                                            *
 * *
 **************************************************************************/

public TaskProgressIndicatorSkin(ProgressIndicator control) {
    super(control, new BehaviorBase<>(control, Collections.emptyList()));

    this.control = control;

    // register listeners
    registerChangeListener(control.indeterminateProperty(), "INDETERMINATE");
    registerChangeListener(control.progressProperty(), "PROGRESS");
    registerChangeListener(control.visibleProperty(), "VISIBLE");
    registerChangeListener(control.parentProperty(), "PARENT");
    registerChangeListener(control.sceneProperty(), "SCENE");

    initialize();
}
 
Example #7
Source File: DownloadPreplannedOfflineMapJobListCell.java    From arcgis-runtime-samples-java with Apache License 2.0 6 votes vote down vote up
@Override
protected void updateItem(DownloadPreplannedOfflineMapJob downloadPreplannedOfflineMapJob, boolean empty) {
    super.updateItem(downloadPreplannedOfflineMapJob, empty);

    if (downloadPreplannedOfflineMapJob != null) {

        // show the job's progress with a progress indicator
        ProgressIndicator progressIndicator = new ProgressIndicator(downloadPreplannedOfflineMapJob.getProgress() / 100.0);

        downloadPreplannedOfflineMapJob.addJobChangedListener(() ->
                progressIndicator.setProgress(downloadPreplannedOfflineMapJob.getProgress() / 100.0)
        );

        setGraphic(progressIndicator);
        setText(downloadPreplannedOfflineMapJob.getParameters().getPreplannedMapArea().getPortalItem().getTitle());
    } else {
        setGraphic(null);
        setText(null);
    }
}
 
Example #8
Source File: EditorFxScene.java    From jmonkeybuilder with Apache License 2.0 6 votes vote down vote up
/**
 * Show the loading process.
 */
@FxThread
private void showLoading() {
    focused = getFocusOwner();

    var loadingLayer = getLoadingLayer();
    loadingLayer.setVisible(true);
    loadingLayer.setManaged(true);
    loadingLayer.toFront();

    progressIndicator = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);
    progressIndicator.setId(CssIds.EDITOR_LOADING_PROGRESS);

    FxUtils.addChild(loadingLayer, progressIndicator);

    var container = getContainer();
    container.setDisable(true);
}
 
Example #9
Source File: BasicView.java    From gluon-samples with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private void updateProductDetails(InAppBillingService service) {
    setBottom(new HBox(10.0, new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS), new Label("Loading Products")));

    Worker<List<Product>> productDetails = service.fetchProductDetails();
    productDetails.stateProperty().addListener((obs, ov, nv) -> {
        switch (nv) {
            case CANCELLED:
                setBottom(new HBox(10.0, new Label("Loading products cancelled."), MaterialDesignIcon.REFRESH.button(e -> updateProductDetails(PlayerService.getInstance().getService().get()))));
                break;
            case SUCCEEDED:
                createProductGrid(productDetails.getValue());
                break;
            case FAILED:
                setBottom(new HBox(10.0, new Label("Failed to load products."), MaterialDesignIcon.REFRESH.button(e -> updateProductDetails(PlayerService.getInstance().getService().get()))));
                break;
        }
    });
}
 
Example #10
Source File: AnalyticResultsPane.java    From constellation with Apache License 2.0 6 votes vote down vote up
public AnalyticResultsPane(final AnalyticController analyticController) {

        // the analytic controller
        this.analyticController = analyticController;

        // the progress indicator pane
        this.progressIndicatorPane = new BorderPane();
        Platform.runLater(() -> {
            final ProgressIndicator progressIndicator = new ProgressIndicator();
            progressIndicator.setMaxSize(50, 50);
            progressIndicatorPane.setCenter(progressIndicator);
        });

        // the internal visualisation pane
        this.internalVisualisationPane = new TabPane();
        internalVisualisationPane.prefWidthProperty().bind(this.widthProperty());

        // the graph visualisation pane
        this.graphVisualisationPane = new ToolBar();
        graphVisualisationPane.prefWidthProperty().bind(this.widthProperty());

        // populate the analytic results pane
        this.getChildren().addAll(internalVisualisationPane, graphVisualisationPane);
    }
 
Example #11
Source File: DeployFragment.java    From Notebook with Apache License 2.0 6 votes vote down vote up
@Override
public void initData(Parent node, Map<String, String> bundle) {
	btn_deploy = (Button) node.lookup("#btn_deploy");
	progressbar = (ProgressIndicator) node.lookup("#progressbar");

	btn_deploy.setOnAction(e->{
		progressbar.isIndeterminate();// һ ��������ʾ�����ڷ�ȷ��ģʽ,����progressbar����һ����ֵ�и�Сbug������¡�
		progressbar.setVisible(true);
		progressbar.setProgress(-1f);
		progressbar.setProgress(0.5f);
		progressbar.setProgress(-1f);
		btn_deploy.setDisable(true);// �����ظ����

		AnnotationHandler.sendMessage("work",null);
	});

	AnnotationHandler.register(this);

}
 
Example #12
Source File: JFXProgressBarSkin.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateAnimation() {
    ProgressIndicator control = getSkinnable();
    final boolean isTreeVisible = control.isVisible() &&
                                  control.getParent() != null &&
                                  control.getScene() != null;
    if (indeterminateTransition != null) {
        pauseTimeline(!isTreeVisible);
    } else if (isTreeVisible) {
        createIndeterminateTimeline();
    }
}
 
Example #13
Source File: AppPreloader.java    From spring-labs with Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) throws Exception {

	this.stage = stage;

	Scene scene = new Scene(new ProgressIndicator(-1), 100, 100);
	stage.initStyle(StageStyle.TRANSPARENT);
	stage.setScene(scene);
	stage.show();
}
 
Example #14
Source File: StepRepresentationSpin.java    From phoenicis with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void drawStepContent() {
    super.drawStepContent();

    Region spacerAbove = new Region();
    VBox.setVgrow(spacerAbove, Priority.ALWAYS);
    this.addToContentPane(spacerAbove);

    ProgressIndicator progressIndicator = new ProgressIndicator();
    this.addToContentPane(progressIndicator);

    Region spacerBelow = new Region();
    VBox.setVgrow(spacerBelow, Priority.ALWAYS);
    this.addToContentPane(spacerBelow);
}
 
Example #15
Source File: JFXSpinnerSkin.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
protected void updateProgress() {
    final ProgressIndicator control = getSkinnable();
    final boolean isIndeterminate = control.isIndeterminate();
    if (!(isIndeterminate && wasIndeterminate)) {
        arcLength = -360 * control.getProgress();
        control.requestLayout();
    }
    wasIndeterminate = isIndeterminate;
}
 
Example #16
Source File: MainWindowView.java    From phoenicis with GNU Lesser General Public License v3.0 5 votes vote down vote up
private HBox createWaitPanel() {
    final ProgressIndicator progressIndicator = new ProgressIndicator();
    progressIndicator.getStyleClass().add("waiting-indicator");

    final HBox waitPanel = new HBox(progressIndicator);
    waitPanel.getStyleClass().add("rightPane");

    return waitPanel;
}
 
Example #17
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
private void updateAnimation() {
    ProgressIndicator control = getSkinnable();
    final boolean isTreeVisible = control.isVisible() &&
            control.getParent() != null &&
            control.getScene() != null;
    if (indeterminateTransition != null) {
        pauseTimeline(!isTreeVisible);
    } else if (isTreeVisible) {
        createIndeterminateTimeline();
    }
}
 
Example #18
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
public DeterminateIndicator(ProgressIndicator control, Paint fillOverride) {

            getStyleClass().add("determinate-indicator");

            degProgress = (int) (360 * control.getProgress());

            getChildren().clear();

            // The circular background for the progress pie piece
            indicator = new StackPane();
            indicator.setScaleShape(false);
            indicator.setCenterShape(false);
            indicator.getStyleClass().setAll("indicator");
            indicatorCircle = new Circle();
            indicator.setShape(indicatorCircle);

            // The shape for our progress pie piece
            arcShape = new Arc();
            arcShape.setType(ArcType.ROUND);
            arcShape.setStartAngle(90.0F);

            // Our progress pie piece
            progress = new StackPane();
            progress.getStyleClass().setAll("progress");
            progress.setScaleShape(false);
            progress.setCenterShape(false);
            progress.setShape(arcShape);
            progress.getChildren().clear();
            setFillOverride(fillOverride);

            // The check mark that's drawn at 100%
            tick = new StackPane();
            tick.getStyleClass().setAll("tick");

            getChildren().setAll(indicator, progress, tick);
            updateProgress(control.getProgress());
        }
 
Example #19
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
@Override
public StyleableProperty<Paint> getStyleableProperty(ProgressIndicator n) {
    final TaskProgressIndicatorSkin skin = (TaskProgressIndicatorSkin) n.getSkin();
    if (skin.indeterminateSegmentCount instanceof StyleableProperty) {
        @SuppressWarnings("unchecked")
        StyleableProperty<Paint> property = (StyleableProperty<Paint>) skin.progressColor;
        return property;
    } else {
        throw new RuntimeException("Illegal cast to StyleableProperty<Paint>");
    }
}
 
Example #20
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
@Override
public StyleableProperty<Number> getStyleableProperty(ProgressIndicator n) {
    final TaskProgressIndicatorSkin skin = (TaskProgressIndicatorSkin) n.getSkin();
    if (skin.indeterminateSegmentCount instanceof StyleableProperty) {
        @SuppressWarnings("unchecked")
        StyleableProperty<Number> property = (StyleableProperty<Number>) skin.indeterminateSegmentCount;
        return property;
    } else {
        throw new RuntimeException("Illegal cast to StyleableProperty<Number>");
    }
}
 
Example #21
Source File: AppPreloader.java    From spring-labs with Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) throws Exception {

	this.stage = stage;

	Scene scene = new Scene(new ProgressIndicator(-1), 100, 100);
	stage.initStyle(StageStyle.TRANSPARENT);
	stage.setScene(scene);
	stage.show();
}
 
Example #22
Source File: Footer.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
@EventListener
public void onProgress(PercentageOfWorkDoneChangedEvent event) {
    statusLabel.setText(DefaultI18nContext.getInstance().i18n("Running"));
    if (event.isUndetermined()) {
        bar.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
    } else {
        bar.setProgress(event.getPercentage().divide(new BigDecimal(100)).doubleValue());
        statusLabel.setText(DefaultI18nContext.getInstance().i18n("Running {0}%",
                Integer.toString(event.getPercentage().intValue())));
    }
}
 
Example #23
Source File: JFXProgressBarSkin.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateProgress() {
    final ProgressIndicator control = getSkinnable();
    final boolean isIndeterminate = control.isIndeterminate();
    if (!(isIndeterminate && wasIndeterminate)) {
        barWidth = ((int) (control.getWidth() - snappedLeftInset() - snappedRightInset()) * 2
                    * Math.min(1, Math.max(0, control.getProgress()))) / 2.0F;
        control.requestLayout();
    }
    wasIndeterminate = isIndeterminate;
}
 
Example #24
Source File: ViewContentBeneathTerrainSurfaceSample.java    From arcgis-runtime-samples-java with Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) throws Exception {

  // create stack pane and JavaFX app scene
  StackPane stackPane = new StackPane();
  Scene fxScene = new Scene(stackPane);

  // set title, size, and add JavaFX scene to stage
  stage.setTitle("View Content Beneath Terrain Surface Sample");
  stage.setWidth(800);
  stage.setHeight(700);
  stage.setScene(fxScene);
  stage.show();

  // create a scene from a web scene Url and set it to the scene view
  scene = new ArcGISScene("https://www.arcgis.com/home/item.html?id=91a4fafd747a47c7bab7797066cb9272");
  sceneView = new SceneView();
  sceneView.setArcGISScene(scene);

  // add a progress indicator to show the scene is loading
  ProgressIndicator progressIndicator = new ProgressIndicator(ProgressIndicator.INDETERMINATE_PROGRESS);

  // once the scene has loaded, set the navigation constraint and opacity of the base surface
  scene.addDoneLoadingListener(() -> {
    // ensure the navigation constraint is set to NONE to view content beneath the terrain surface
    scene.getBaseSurface().setNavigationConstraint(NavigationConstraint.NONE);
    // set opacity to view content beneath the base surface
    scene.getBaseSurface().setOpacity(0.4f);
  });

  // hide the progress indicator once the sceneview has completed drawing
  sceneView.addDrawStatusChangedListener(event -> progressIndicator.setVisible(false));

  // add the scene view and progress indicator to the stack pane
  stackPane.getChildren().addAll(sceneView, progressIndicator);
}
 
Example #25
Source File: WaitIndicator.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public WaitIndicator(Stage stage) {	
  	this.stage = stage;
  	//stage = new Stage();
  	indicator = new CircularProgressIndicator();
      StackPane pane = new StackPane(indicator);
      
//stackPane.setScaleX(1.2);
//stackPane.setScaleY(1.2);

      pane.setBackground(Background.EMPTY);
      pane.setStyle(
   		   //"-fx-border-style: none; "
   		   //"-fx-background-color: #231d12; "
      			"-fx-background-color: transparent; "
      			+ 
      			"-fx-background-radius: 1px;"
   		   );
      
      Scene scene = new Scene(pane, 128, 128, true);

scene.setFill(Color.TRANSPARENT);

stage.requestFocus();
      stage.initStyle(StageStyle.TRANSPARENT);
      stage.setTitle("Circular Progress Indicator");
      stage.setScene(scene);
      stage.toFront();
      stage.show();
      
      indicator.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
  }
 
Example #26
Source File: WaitIndicatorDemo.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public void start(Stage stage) {
 // public WaitIndicatorDemo(Stage stage) {	
  	this.stage = stage;
  	//stage = new Stage();
  	indicator = new CircularProgressIndicator();
      StackPane pane = new StackPane(indicator);
      
//stackPane.setScaleX(1.2);
//stackPane.setScaleY(1.2);

      pane.setBackground(Background.EMPTY);
      pane.setStyle(
   		   //"-fx-border-style: none; "
   		   //"-fx-background-color: #231d12; "
      			"-fx-background-color: transparent; "
      			+ 
      			"-fx-background-radius: 1px;"
   		   );
      
      Scene scene = new Scene(pane, 128, 128, true);

scene.setFill(Color.TRANSPARENT);

stage.requestFocus();
      stage.initStyle(StageStyle.TRANSPARENT);
      stage.setTitle("Circular Progress Indicator");
      stage.setScene(scene);
      stage.toFront();
      stage.show();
      
      indicator.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
  }
 
Example #27
Source File: WaitIndicator.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public WaitIndicator(Stage stage) {	
  	this.stage = stage;
  	//stage = new Stage();
  	indicator = new CircularProgressIndicator();
      StackPane pane = new StackPane(indicator);
      
//stackPane.setScaleX(1.2);
//stackPane.setScaleY(1.2);

      pane.setBackground(Background.EMPTY);
      pane.setStyle(
   		   //"-fx-border-style: none; "
   		   //"-fx-background-color: #231d12; "
      			"-fx-background-color: transparent; "
      			+ 
      			"-fx-background-radius: 1px;"
   		   );
      
      Scene scene = new Scene(pane, 128, 128, true);

scene.setFill(Color.TRANSPARENT);

stage.requestFocus();
      stage.initStyle(StageStyle.TRANSPARENT);
      stage.setTitle("Circular Progress Indicator");
      stage.setScene(scene);
      stage.toFront();
      stage.show();
      
      indicator.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
  }
 
Example #28
Source File: RefreshThread.java    From Cryogen with GNU General Public License v2.0 5 votes vote down vote up
public RefreshThread(
        ImageView ImgA, ImageView ImgB, ImageView ImgC, 
        Label NameA, Label NameB, Label NameC, 
        ProgressIndicator ProgA, ProgressIndicator ProgB, ProgressIndicator ProgC
) {
    this.ImgA = ImgA;
    this.ImgB = ImgB;
    this.ImgC = ImgC;
    this.NameA = NameA;
    this.NameB = NameB;
    this.NameC = NameC;
    this.ProgA = ProgA;
    this.ProgB = ProgB;
    this.ProgC = ProgC;
}
 
Example #29
Source File: ProgressSample.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250);
    stage.setScene(scene);
    stage.setTitle("Progress Controls");

    for (int i = 0; i < values.length; i++) {
        final Label label = labels[i] = new Label();
        label.setText("progress:" + values[i]);

        final ProgressBar pb = pbs[i] = new ProgressBar();
        pb.setProgress(values[i]);

        final ProgressIndicator pin = pins[i] = new ProgressIndicator();
        pin.setProgress(values[i]);
        final HBox hb = hbs[i] = new HBox();
        hb.setSpacing(5);
        hb.setAlignment(Pos.CENTER);
        //hb.getChildren().addAll(label, pb, pin);
        hb.getChildren().addAll(pin);

    }

    final VBox vb = new VBox();
    vb.setSpacing(5);
    vb.getChildren().addAll(hbs);
    scene.setRoot(vb);
    stage.show();
}
 
Example #30
Source File: JFXSpinnerSkin.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
private void updateAnimation() {
    ProgressIndicator control = getSkinnable();
    final boolean isTreeVisible = control.isVisible() &&
                                  control.getParent() != null &&
                                  control.getScene() != null;
    if (timeline != null) {
        pauseTimeline(!isTreeVisible);
    } else if (isTreeVisible) {
        createTransition();
    }
}