当前位置: 首页>>代码示例>>Java>>正文


Java ProgressIndicator.setProgress方法代码示例

本文整理汇总了Java中javafx.scene.control.ProgressIndicator.setProgress方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressIndicator.setProgress方法的具体用法?Java ProgressIndicator.setProgress怎么用?Java ProgressIndicator.setProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.ProgressIndicator的用法示例。


在下文中一共展示了ProgressIndicator.setProgress方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
@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);
    }

    final VBox vb = new VBox();
    vb.setSpacing(5);
    vb.getChildren().addAll(hbs);
    scene.setRoot(vb);
    stage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:29,代码来源:ProgressSample.java

示例2: drawNode

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
@Override
public Node drawNode() {
    GridPane root = new GridPane();
    root.setVgap(spacing / 2);
    root.setHgap(spacing);
    double d, _d = -0.25;
    for (int i = 0; _d < 1; i++) {
        d = _d + 0.25;
        _d = d;
        ProgressIndicator ind = progressIndicatorCreate();
        VBox box = new VBox();
        box.setAlignment(Pos.CENTER);
        box.getChildren().add(new Label("[" + d + "]"));
        ind.setProgress(d);
        if (ind.getProgress() != d) {
            reportGetterFailure("progress_indicator.getProgress()");
        }
        box.getChildren().add(ind);
        root.add(box, i % 3, i / 3);
    }
    return root;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:23,代码来源:ProgressApp.java

示例3: showProgressDialog

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public static Stage showProgressDialog(ObservableValue<? extends Number> ov, String message) {
	Stage progress = WSeminar.createDialog("progress", "Fortschritt", WSeminar.window, StageStyle.TRANSPARENT, Modality.NONE);
	
	if (message == null) {
		progress.getScene().setFill(null);
		progress.getScene().getRoot().setStyle("-fx-background-color: transparent");
	}
	
	Label msgLabel = (Label) progress.getScene().lookup("#message");
	msgLabel.setVisible(message == null);
	msgLabel.setText(message);
	
	progress.setAlwaysOnTop(true);
	
	ProgressIndicator pi = ((ProgressIndicator) progress.getScene().lookup("#progress"));
	pi.setProgress(0);
	
	ChangeListener<Number> cl = (obs, newVal, oldVal) -> Platform.runLater(() -> {
		pi.setProgress(Math.round(newVal.doubleValue() * 100) / 100.0);
	});
	
	ov.addListener(cl);
	progress.setOnHiding(e -> ov.removeListener(cl));
	
	return progress;
}
 
开发者ID:Dakror,项目名称:WSeminar,代码行数:27,代码来源:MainController.java

示例4: ProgressIndicatorSample

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public ProgressIndicatorSample() {
    super(400,400);
    
    GridPane g = new GridPane();

    ProgressIndicator p1 = new ProgressIndicator();
    p1.setPrefSize(50, 50);

    ProgressIndicator p2 = new ProgressIndicator();
    p2.setPrefSize(50, 50);
    p2.setProgress(0.25F);

    ProgressIndicator p3 = new ProgressIndicator();
    p3.setPrefSize(50, 50);
    p3.setProgress(0.5F);

    ProgressIndicator p4 = new ProgressIndicator();
    p4.setPrefSize(50, 50);
    p4.setProgress(1.0F);

    g.add(p1, 1, 0);
    g.add(p2, 0, 1);
    g.add(p3, 1, 1);
    g.add(p4, 2, 1);

    g.setHgap(40);
    g.setVgap(40);
    
    getChildren().add(g);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:31,代码来源:ProgressIndicatorSample.java

示例5: start

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
@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();
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:31,代码来源:ProgressSample.java

示例6: start

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
@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);
    }
 
    final VBox vb = new VBox();
    vb.setSpacing(5);
    vb.getChildren().addAll(hbs);
    scene.setRoot(vb);
    stage.show();
}
 
开发者ID:thirdy,项目名称:blackmarket,代码行数:29,代码来源:ProgressSample.java

示例7: initFxComponents

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
private void initFxComponents() {
    try {
        progressIndicator = new ProgressIndicator();
        progressIndicator.setProgress(0);
        BorderPane pane = new BorderPane(progressIndicator);
        JFXPanel wrap = SwingCore.wrap(pane);
        extraProgressPanel.add(wrap, BorderLayout.CENTER);
    } catch (InterruptedException ex) {
        Ui.handle(ex);
    }
}
 
开发者ID:gg-net,项目名称:dwoss,代码行数:12,代码来源:ClientView.java

示例8: DownloadCell

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public DownloadCell(){
	indicator = new JFXSpinner();
	zero = new ProgressIndicator();
	zero.setProgress(0.0);
}
 
开发者ID:Team-IVIag,项目名称:IVIag-Viewer,代码行数:6,代码来源:DownloadCell.java

示例9: setProgress

import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
private void setProgress(double value) {
    ProgressIndicator indicator = getProgressIndicator();
    indicator.setProgress(value);
    setGraphic(indicator);
}
 
开发者ID:fflewddur,项目名称:archivo,代码行数:6,代码来源:StatusCellFactory.java


注:本文中的javafx.scene.control.ProgressIndicator.setProgress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。