本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
}
示例8: DownloadCell
import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
public DownloadCell(){
indicator = new JFXSpinner();
zero = new ProgressIndicator();
zero.setProgress(0.0);
}
示例9: setProgress
import javafx.scene.control.ProgressIndicator; //导入方法依赖的package包/类
private void setProgress(double value) {
ProgressIndicator indicator = getProgressIndicator();
indicator.setProgress(value);
setGraphic(indicator);
}