Search in sources :

Example 1 with ProgressBar

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;
}
Also used : Text(javafx.scene.text.Text) VBox(javafx.scene.layout.VBox) ProgressBar(javafx.scene.control.ProgressBar)

Example 2 with ProgressBar

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;
}
Also used : Button(javafx.scene.control.Button) Worker(javafx.concurrent.Worker) Pos(javafx.geometry.Pos) Scene(javafx.scene.Scene) WebEngine(javafx.scene.web.WebEngine) Arrays(java.util.Arrays) AllIcons(com.intellij.icons.AllIcons) HashMap(java.util.HashMap) JFXPanel(javafx.embed.swing.JFXPanel) CookieManager(org.stepik.plugin.auth.webkit.network.CookieManager) Insets(javafx.geometry.Insets) ProgressBar(javafx.scene.control.ProgressBar) CookieHandler(java.net.CookieHandler) Map(java.util.Map) Tooltip(javafx.scene.control.Tooltip) HBox(javafx.scene.layout.HBox) WebView(javafx.scene.web.WebView) WebHistory(javafx.scene.web.WebHistory) BufferedImage(java.awt.image.BufferedImage) Node(javafx.scene.Node) WritableImage(javafx.scene.image.WritableImage) Platform(javafx.application.Platform) java.awt(java.awt) Urls(org.stepik.api.urls.Urls) ImageView(javafx.scene.image.ImageView) SwingFXUtils(javafx.embed.swing.SwingFXUtils) ObservableValue(javafx.beans.value.ObservableValue) Templater(org.stepik.core.templates.Templater) BorderPane(javafx.scene.layout.BorderPane) StepikAuthManager(org.stepik.core.stepik.StepikAuthManager) ChangeListener(javafx.beans.value.ChangeListener) NotNull(org.jetbrains.annotations.NotNull) javax.swing(javax.swing) Worker(javafx.concurrent.Worker) ProgressBar(javafx.scene.control.ProgressBar) HashMap(java.util.HashMap) Map(java.util.Map) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ProgressBar

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;
}
Also used : Tooltip(javafx.scene.control.Tooltip) ProgressBar(javafx.scene.control.ProgressBar)

Example 4 with ProgressBar

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;
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) Text(javafx.scene.text.Text) ProgressBar(javafx.scene.control.ProgressBar)

Example 5 with ProgressBar

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();
}
Also used : ProgressBar(javafx.scene.control.ProgressBar)

Aggregations

ProgressBar (javafx.scene.control.ProgressBar)9 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 Tooltip (javafx.scene.control.Tooltip)3 VBox (javafx.scene.layout.VBox)3 Button (javafx.scene.control.Button)2 Label (javafx.scene.control.Label)2 ImageView (javafx.scene.image.ImageView)2 HBox (javafx.scene.layout.HBox)2 Text (javafx.scene.text.Text)2 AllIcons (com.intellij.icons.AllIcons)1 JFXProgressBar (com.jfoenix.controls.JFXProgressBar)1 java.awt (java.awt)1 BufferedImage (java.awt.image.BufferedImage)1 CookieHandler (java.net.CookieHandler)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 KeyFrame (javafx.animation.KeyFrame)1 KeyValue (javafx.animation.KeyValue)1