本文整理匯總了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);
}