當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。