use of javafx.scene.control.ProgressBar in project Retrospector by NonlinearFruit.
the class AchievementManager method getDisplay.
public Node getDisplay() {
VBox box = new VBox();
box.setAlignment(Pos.CENTER);
Text title = new Text(achievement.getTitle());
title.setFont(Font.font(20));
Text desc = new Text(achievement.getDescription());
ProgressBar bar = new ProgressBar(achievement.getProgress() * 1.0 / 100);
box.getChildren().add(title);
box.getChildren().add(image);
if (achievement.isUnlocked())
box.getChildren().add(desc);
else
box.getChildren().add(bar);
return box;
}
use of javafx.scene.control.ProgressBar in project intellij-plugins by StepicOrg.
the class AuthDialog method makeProgressBarWithListener.
@NotNull
private ProgressBar makeProgressBarWithListener() {
final ProgressBar progress = new ProgressBar();
Worker<Void> loadWorker = engine.getLoadWorker();
progress.progressProperty().bind(loadWorker.progressProperty());
loadWorker.stateProperty().addListener(new ChangeListener<Worker.State>() {
@Override
public void changed(ObservableValue<? extends Worker.State> ov, Worker.State oldState, Worker.State newState) {
if (newState == Worker.State.CANCELLED) {
return;
}
if (newState == Worker.State.FAILED) {
Map<String, Object> map = new HashMap<>();
map.put("url", engine.getLocation());
String content = Templater.processTemplate("error", map);
engine.loadContent(content);
return;
}
String location = engine.getLocation();
if (location != null) {
if (location.startsWith(Urls.STEPIK_URL + "/#")) {
String paramString = location.split("#")[1];
String[] params = paramString.split("&");
map.clear();
Arrays.stream(params).forEach(param -> {
String[] entry = param.split("=");
String value = "";
if (entry.length > 1) {
value = entry[1];
}
map.put(entry[0], value);
});
hide();
return;
} else if ((Urls.STEPIK_URL + "/?error=access_denied").equals(location)) {
map.put("error", "access_denied");
hide();
return;
}
}
progressBar.setVisible(newState == Worker.State.RUNNING);
if (newState == Worker.State.SUCCEEDED) {
AuthDialog.this.setTitle(engine.getTitle());
}
}
private void hide() {
loadWorker.cancel();
setVisible(false);
}
});
return progress;
}
use of javafx.scene.control.ProgressBar in project VocabHunter by VocabHunter.
the class MiniGraphTool method miniGraph.
public static ProgressBar miniGraph(final StatusModel statusModel) {
ProgressBar bar = new ProgressBar();
bar.getStyleClass().add(STYLE_CLASS);
bar.managedProperty().bind(statusModel.graphShownProperty());
bar.visibleProperty().bind(statusModel.graphShownProperty());
bar.progressProperty().bind(statusModel.markedFractionProperty());
bar.setPrefWidth(WIDTH);
Tooltip tooltip = new Tooltip();
bar.setTooltip(tooltip);
tooltip.textProperty().bind(statusModel.graphTextProperty());
return bar;
}
use of javafx.scene.control.ProgressBar in project jabref by JabRef.
the class LinkedFilesEditor method createFileDisplay.
private static Node createFileDisplay(LinkedFileViewModel linkedFile) {
Text icon = MaterialDesignIconFactory.get().createIcon(linkedFile.getTypeIcon());
Text text = new Text(linkedFile.getLink());
ProgressBar progressIndicator = new ProgressBar();
progressIndicator.progressProperty().bind(linkedFile.downloadProgressProperty());
progressIndicator.visibleProperty().bind(linkedFile.downloadOngoingProperty());
Button acceptAutoLinkedFile = MaterialDesignIconFactory.get().createIconButton(MaterialDesignIcon.BRIEFCASE_CHECK);
acceptAutoLinkedFile.setTooltip(new Tooltip(Localization.lang("This file was found automatically. Do you want to link it to this entry?")));
acceptAutoLinkedFile.visibleProperty().bind(linkedFile.isAutomaticallyFoundProperty());
acceptAutoLinkedFile.setOnAction(event -> linkedFile.acceptAsLinked());
acceptAutoLinkedFile.getStyleClass().setAll("flatButton");
HBox container = new HBox(10);
container.setPrefHeight(Double.NEGATIVE_INFINITY);
container.getChildren().addAll(icon, text, progressIndicator, acceptAutoLinkedFile);
return container;
}
use of javafx.scene.control.ProgressBar in project bitsquare by bitsquare.
the class TradeStepView method addTradeInfoBlock.
protected void addTradeInfoBlock() {
tradeInfoTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 4, "Trade information");
txIdTextField = addLabelTxIdTextField(gridPane, gridRow, "Deposit transaction ID:", Layout.FIRST_ROW_DISTANCE).second;
String id = model.dataModel.txId.get();
if (!id.isEmpty())
txIdTextField.setup(id);
else
txIdTextField.cleanup();
PaymentMethodForm.addAllowedPeriod(gridPane, ++gridRow, model.dataModel.getSellersPaymentAccountContractData(), model.getDateForOpenDispute());
timeLeftTextField = addLabelTextField(gridPane, ++gridRow, "Remaining time:").second;
timeLeftProgressBar = new ProgressBar(0);
timeLeftProgressBar.setOpacity(0.7);
timeLeftProgressBar.setMinHeight(9);
timeLeftProgressBar.setMaxHeight(9);
timeLeftProgressBar.setMaxWidth(Double.MAX_VALUE);
GridPane.setRowIndex(timeLeftProgressBar, ++gridRow);
GridPane.setColumnIndex(timeLeftProgressBar, 1);
GridPane.setFillWidth(timeLeftProgressBar, true);
gridPane.getChildren().add(timeLeftProgressBar);
updateTimeLeft();
}
Aggregations