Java 类javafx.scene.control.ProgressBar 实例源码

项目:CryptoPayAPI    文件:CryptoTest.java   
private Resource(Scene start, String name, int startCost, long value, long delay, double mult, final MoneyListener listener){
    System.out.println(name);
    this.prog = (ProgressBar) start.lookup("#" + name + "_progress");
    this.made = (Label) start.lookup("#" + name + "_money");
    this.buy = (Button) start.lookup("#" + name + "_buy");

    this.multiply = mult;
    this.name = name;
    this.print = (name.charAt(0) + "").toUpperCase() + name.substring(1);
    this.value = value;
    this.cost = startCost;
    this.delay = delay;
    this.listener = listener;

    setText(made, print + " Earnings: " + format.format(money));
    setText(buy, "(" + miners + ") Buy Miner: " + format.format((long)cost));

    this.buy.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent event) {
            listener.buyMiner(Resource.this.name);
        }
    });
}
项目:titanium    文件:LoadingStage.java   
public LoadingStage(String title, String  noticeText) {
    this.setWidth(WIDTH);
    this.setHeight(HEIGHT);

    this.setTitle(title);
    progressBar = new ProgressBar();
    this.notice = new Label(noticeText);
    BorderPane mainPane = new BorderPane();
    Scene s = new Scene(mainPane);

    progressBar.setPrefWidth(WIDTH - 25);

    mainPane.setTop(notice);
    mainPane.setCenter(progressBar);

    mainPane.setPadding(new Insets(15));

    this.setScene(s);
}
项目:hygene    文件:HygenePreloader.java   
@Override
public void start(final Stage primaryStage) throws IOException, UIInitialisationException {
    stage = primaryStage;
    primaryStage.setTitle(Hygene.TITLE);
    primaryStage.initStyle(StageStyle.UNDECORATED);

    progress = new ProgressBar();

    final URL resource = getClass().getResource(PRELOADER_VIEW);
    final Parent root = FXMLLoader.load(resource);
    if (root == null) {
        throw new UIInitialisationException("Root of Preloader could not be found.");
    }

    final Scene rootScene = new Scene(root);
    primaryStage.setScene(rootScene);
    primaryStage.show();
}
项目:marathonv5    文件:ProgressSample.java   
@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();
}
项目:marathonv5    文件:RFXProgressBarTest.java   
@Test public void getText() {
    ProgressBar progressBar = (ProgressBar) getPrimaryStage().getScene().getRoot().lookup(".progress-bar");
    LoggingRecorder lr = new LoggingRecorder();
    List<String> text = new ArrayList<>();
    Platform.runLater(() -> {
        RFXProgressBar rfxProgressBar = new RFXProgressBar(progressBar, null, null, lr);
        progressBar.setProgress(0.56);
        rfxProgressBar.mouseReleased(null);
        text.add(rfxProgressBar.getAttribute("text"));
    });
    new Wait("Waiting for progress bar text.") {
        @Override public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertEquals("0.56", text.get(0));
}
项目:creacoinj    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:Clipcon-Client    文件:ProgressBarScene.java   
@Override
public void initialize(URL location, ResourceBundle resources) {
    ui.setProgressBarScene(this);

    for (int i = 0; i < progressBarArray.length; i++) {
        if (ui.getMainScene().getProgressBarStageArray()[i] == null) {
            index = i;
            break;
        }
    }

    number++;

    textArray[index] = text;
    if (RetrofitDownloadData.isDownloading) {
        textArray[index].setText("Downloading");
    }

    progressBarArray[index] = progressBar;
    progressBarArray[index].setProgress(ProgressBar.INDETERMINATE_PROGRESS);
}
项目:legendary-guide    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:ChessBot    文件:ChessBotAppSplash.java   
public void init() {
    ImageView splash = new ImageView(new Image(
            SPLASH_IMAGE
    ));
    loadProgress = new ProgressBar();
    loadProgress.setPrefWidth(SPLASH_WIDTH - 20);
    loadProgress.setStyle("-fx-padding: 10; ");
    progressText = new Label("Loading Chess Bot");
    splashLayout = new VBox();
    splashLayout.getChildren().addAll(splash, loadProgress, progressText);
    progressText.setAlignment(Pos.CENTER);
    splashLayout.setStyle(
            "-fx-padding: 10; "
            + "-fx-background-color: white; "
            + "-fx-border-width:3; "
            + "-fx-border-color: "
            + "linear-gradient("
            + "to bottom, "
            + "chocolate, "
            + "derive(chocolate, 50%)"
            + ");"
    );
    splashLayout.setEffect(new DropShadow());
}
项目:BatpackJava    文件:batteryMonitorLayoutController.java   
private void updateModule(Group group, BatteryModule module) {
        //System.out.println(group.getChildren());
        //voltage, percentage, progressbar, name(is ok)
        Label moduleVolt = (Label) group.getChildren().get(0);
        Label modulePercent = (Label) group.getChildren().get(1);
        ProgressBar progress = (ProgressBar) group.getChildren().get(2);
        Label averageTemperature = (Label) group.getChildren().get(4);

        double progressValue = ((module.getVoltage() - 48) / (66.666 - 48));
        int percentage = (int) (progressValue * 100);

        moduleVolt.setText(module.getVoltageAsString());
        modulePercent.setText(percentage + " %");
        progress.setProgress(progressValue);
//        if(module.getId()==1){
//            System.out.println("module 1 average temp: "+module.getAverageTemperatureAsString());
//        }
        averageTemperature.setText(module.getAverageTemperatureAsString());
    }
项目:BatpackJava    文件:batteryMonitorLayoutController.java   
private void updateCell(Group cellDisp, BatteryCell cell) {
        //disp: V, %, progressbar, name
        Label voltage = (Label) cellDisp.getChildren().get(0);
        Label percentage = (Label) cellDisp.getChildren().get(1);
        ProgressBar progressBar = (ProgressBar) cellDisp.getChildren().get(2);
        Label temperature = (Label) cellDisp.getChildren().get(4);

        double progress = (double) cell.getStateOfCharge();
        int percent = (int) (progress);

        voltage.setText(cell.getVoltageAsString());
        percentage.setText(percent + " %");
        progressBar.setProgress(progress / 100);
//        System.out.println("cell id: " + cell.getId());
        temperature.setText(cell.getTemperatureAsString());
    }
项目:Validation-Emails-List    文件:TalkWithSMTP.java   
public TalkWithSMTP(Domain domain) {

        this.domain = domain;
        hbox = new HBox();

        midProgress = new ProgressBar();
        midProgress.setProgress(0.0d);

        progresLabel = new Label(domain.getName());

        List<String> inside = new ArrayList<>();
        int count = 0;
        for (String email : domain.getEmails()) {
            if (count == 10) {
                count = 0;
                this.emails.add(new ArrayList<>(inside));
                inside.clear();
            }

            inside.add(email);
            count++;
        }
    }
项目:willow-browser    文件:LoadingProgressDisplay.java   
/**
 * Creates a UI display monitor for provided worker.
 *
 * Assumes the worker is reporting progress as work done on a scale from 0 to 100 (other values indicate indeterminate progress).
 *
 * @param worker the worker whose progress is to be monitored and displayed.
 */
public LoadingProgressDisplay(Worker worker) {
    setMaxWidth(Double.MAX_VALUE);

    ColorAdjust bleach = new ColorAdjust();
    bleach.setSaturation(-0.6);
    setEffect(bleach);

    HBox.setHgrow(this, Priority.ALWAYS);

    visibleProperty().bind(worker.runningProperty());

    // as the webview load progresses update progress.
    worker.workDoneProperty().addListener((observableValue, oldNumber, newNumber) -> {
        if (newNumber == null) newNumber = -1.0;
        final double newValue = newNumber.doubleValue();
        if (newValue < 0.0 || newValue > 100.0) {
            setProgress(ProgressBar.INDETERMINATE_PROGRESS);
        }
        setProgress(newValue / 100.0);
    });
}
项目:FXGLGames    文件:App.java   
private void createUI() {
    ProgressBar hpBar = new ProgressBar();
    hpBar.setTranslateX(50);
    hpBar.setTranslateY(50);
    hpBar.setStyle("-fx-accent: rgb(0, 255, 0);");
    hpBar.progressProperty().bind(player.health.divide(10.0f));

    ProgressBar gBar = new ProgressBar();
    gBar.setTranslateX(50);
    gBar.setTranslateY(75);
    gBar.progressProperty().bind(player.power.divide(player.maxPower.multiply(1.0f)));

    Text score = new Text();
    score.setTranslateX(50);
    score.setTranslateY(25);
    score.setFont(Config.FONT);
    score.setFill(Color.GOLD);
    score.textProperty().bind(player.score.asString());

    UI_ROOT.getChildren().setAll(score, hpBar, gBar, createInfo());
}
项目:cryptwallet    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:photometric-data-retriever    文件:MainPreloader.java   
@Override
public void start(Stage primaryStage) throws Exception {
    logger.debug("Starting Preloader");
    preloaderStage = primaryStage;
    VBox loading = new VBox(20);
    loading.setMaxWidth(Region.USE_PREF_SIZE);
    loading.setMaxHeight(Region.USE_PREF_SIZE);
    ProgressBar progressBar = new ProgressBar();
    progressBar.setPrefWidth(240);
    loading.getChildren().add(progressBar);
    infoLabel = new Label("Initializing application...");
    loading.getChildren().add(infoLabel);
    BorderPane root = new BorderPane(loading);
    Scene scene = new Scene(root);
    primaryStage.setWidth(300);
    primaryStage.setHeight(150);
    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setScene(scene);
    primaryStage.show();
}
项目:Retrospector    文件:Retrospector.java   
@Override
public void init() {
    ImageView splash = new ImageView(new Image(
            SPLASH_IMAGE,
            SPLASH_WIDTH,
            SPLASH_HEIGHT,
            true,
            true
    ));
    loadProgress = new ProgressBar(0);
    loadProgress.setPrefWidth(SPLASH_WIDTH);
    progressText = new Label("Initializing . . .");
    progressText.setBackground(new Background(new BackgroundFill(Color.GHOSTWHITE,new CornerRadii(5),new Insets(0))));
    splashLayout = new VBox();
    splashLayout.getChildren().addAll(splash, loadProgress, progressText);
    progressText.setAlignment(Pos.CENTER);
    splashLayout.setBackground(Background.EMPTY);
}
项目:Retrospector    文件:AchievementFX.java   
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());

    Integer progress = achievement.getProgress();
    ProgressBar bar = new ProgressBar(progress*1.0/100);
    Tooltip.install(bar,new Tooltip("["+progress+"%] "+achievement.getHint()));

    box.getChildren().add(title);
    box.getChildren().add(image);

    if(achievement.isUnlocked())
        box.getChildren().add(desc);
    else
        box.getChildren().add(bar);
    return box;
}
项目:amperfi    文件:Mp3ImportProgress.java   
public Mp3ImportProgress() {
    this.getStyleClass().add("import-progress");

    setAlignment(Pos.CENTER);
    setSpacing(35);

    Label lblTitle = new Label("Importing mp3s");
    lblTitle.getStyleClass().add("settings-page-title");

    pbImporting = new ProgressBar();
    pbImporting.setProgress(0.5);
    pbImporting.maxWidthProperty().bind(this.widthProperty().multiply(.8));

    lblPath = new Label();
    lblPath.getStyleClass().add("settings-page-title2");

    btnCancel = new Button("Cancel");
    btnCancel.getStyleClass().add("btn-cancel");

    this.getChildren().addAll(lblTitle, pbImporting, lblPath, btnCancel);
}
项目:openjfx-8u-dev-tests    文件:ProgressApp.java   
@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;
        ProgressBar bar = progressBarCreate();
        VBox box = new VBox();
        box.setAlignment(Pos.CENTER);
        box.getChildren().add(new Label("[" + d + "]"));
        bar.setProgress(d);
        if (bar.getProgress() != d) {
            reportGetterFailure("progress_indicator.getProgress()");
        }
        box.getChildren().add(bar);
        root.add(box, i % 3, i / 3);
    }
    return root;
}
项目:openjfx-8u-dev-tests    文件:TreeTableCellsTest.java   
@Test(timeout = 30000)
public void progressBarCellFactoryTest() {
    doFactoryChange(CellType.ProgressBar);
    final Lookup lookup = testedControl.as(Parent.class, Node.class).lookup(new LookupCriteria() {
        public boolean check(Object cntrl) {
            if (cntrl instanceof ProgressBar) {
                //Some cells are created for caching purposes, ignore them.
                if (!((Control) cntrl).getParent().getParent().getParent().isVisible()
                        || !((Control) cntrl).getParent().getParent().isVisible()
                        || !((Control) cntrl).getParent().isVisible()) {
                    return false;
                }
                return true;
            }
            return false;
        }
    });
    Wrap<? extends ProgressBar> progressBar = lookup.wrap();
    assertEquals("Initial value is incorrect", getProgressBarValue(progressBar), 0.5, 0.0001);
    changeProgressValues(0.75);
    assertEquals("Initial value is incorrect", getProgressBarValue(progressBar), 0.75, 0.0001);
    assertEquals("Amount of progress bars", lookup.size(), DATA_ITEMS_SIZE);
}
项目:benchmarkjfx    文件:BenchmarkJFX.java   
@Override
public void start(Stage primaryStage) throws Exception {

    List<Stage> benchmarkList = new ArrayList<>();

    benchmarkList.add(new VectorBall(false));
    benchmarkList.add(new VectorBall(true));
    benchmarkList.add(new BitmapBall(false));
    benchmarkList.add(new BitmapBall(true));
    benchmarkList.add(new ListViewBenchmark(false));
    benchmarkList.add(new ListViewBenchmark(true));
    benchmarkList.add(new AreaChartBenchmark(false));
    benchmarkList.add(new AreaChartBenchmark(true));

    ProgressBar bar = getProgressBar(primaryStage);
    for (int i = 0; i < benchmarkList.size(); i++) {
        if (benchmarkList.size() != 0) {
            bar.setProgress((double) i / (double) benchmarkList.size());
        }
        benchmarkList.get(i).showAndWait();
        Thread.sleep(2000);
    }
    primaryStage.close();
}
项目:thunder    文件:NotificationBarPane.java   
public NotificationBarPane (Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) {
            return;
        }
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:helloiot    文件:MQTTMainNode.java   
public void showConnecting() {
    if (connectingdialog == null) {
        Label l = new Label(resources.getString("message.waitingconnection"));
        l.setAlignment(Pos.CENTER);
        l.setMaxSize(Integer.MAX_VALUE, Integer.MAX_VALUE);

        ProgressBar p = new ProgressBar();
        p.setMaxSize(Integer.MAX_VALUE, Integer.MAX_VALUE);

        VBox box = new VBox();
        box.setSpacing(5.0);
        box.setPadding(new Insets(0.0, 0.0, 50.0, 0.0));
        box.getChildren().addAll(l, p);

        connectingdialog = new DialogView();
        connectingdialog.setMaster(true);
        connectingdialog.setContent(box);
        connectingdialog.show(MessageUtils.getRoot(rootpane));
    }
}
项目:JttDesktop    文件:DynamicCssOnlyPropertiesTest.java   
@Ignore
@Test public void manual() throws InterruptedException{
   progressBar = new ProgressBar( 0.4 );
   TestApplication.launch( () -> new BorderPane( progressBar ) );
   systemUnderTest = new DynamicCssOnlyProperties();

   Thread.sleep( 2000 );
   systemUnderTest.applyCustomColours( Color.BLACK, Color.AQUAMARINE, progressBar );

   Thread.sleep( 2000 );
   systemUnderTest.applyCustomColours( Color.ORANGE, Color.SEASHELL, progressBar );

   Thread.sleep( 2000 );
   systemUnderTest.applyCustomColours( Color.INDIGO, Color.PEACHPUFF, progressBar );

   Thread.sleep( 1000000 );
}
项目:FXGLGames    文件:App.java   
private void createUI() {
    ProgressBar hpBar = new ProgressBar();
    hpBar.setTranslateX(50);
    hpBar.setTranslateY(50);
    hpBar.setStyle("-fx-accent: rgb(0, 255, 0);");
    hpBar.progressProperty().bind(player.health.divide(10.0f));

    ProgressBar gBar = new ProgressBar();
    gBar.setTranslateX(50);
    gBar.setTranslateY(75);
    gBar.progressProperty().bind(player.power.divide(player.maxPower.multiply(1.0f)));

    Text score = new Text();
    score.setTranslateX(50);
    score.setTranslateY(25);
    score.setFont(Config.FONT);
    score.setFill(Color.GOLD);
    score.textProperty().bind(player.score.asString());

    UI_ROOT.getChildren().setAll(score, hpBar, gBar, createInfo());
}
项目:namecoinj    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:StudyGuide    文件:ProgressCreator.java   
/**
 * A util method to display a blocking progress pop-up with the given parameters.
 *
 * @param progressObservable the observable object that gives us the progress
 * @param message the message to display while waiting
 * @return the stage of the opened dialog with the progress bar
 */
public static Stage showProgress(ProgressObservable progressObservable, String message) {
    Stage dialogStage = new Stage();
    ProgressBar progressBar = new ProgressBar();

    dialogStage.initStyle(StageStyle.DECORATED);
    dialogStage.setResizable(false);
    dialogStage.initModality(Modality.APPLICATION_MODAL);

    final Label label = new Label();
    label.setText(message);

    progressBar.progressProperty().bind(progressObservable.progressProperty());

    final VBox vBox = new VBox();
    vBox.setAlignment(Pos.CENTER);
    vBox.getChildren().addAll(label, progressBar);

    Scene scene = new Scene(vBox);
    dialogStage.setScene(scene);
    dialogStage.toFront();
    dialogStage.setOnCloseRequest(Event::consume); // prevent closing of the dialog window
    dialogStage.show();
    return dialogStage;
}
项目:FXImgurUploader    文件:SplashPreloader.java   
private Scene createPreloaderScene() {
    splash = new ImageView(new Image(SPLASH_IMAGE));
    loadProgress = new ProgressBar();
    loadProgress.setPrefWidth(SPLASH_WIDTH);
    progressText = new Label();
    progressText.setAlignment(Pos.CENTER);
    progressText.setStyle("-fx-font-weight: bold; -fx-fill: rgb(43,43,43);");
    splashLayout = new VBox(10);
    splashLayout.getChildren().addAll(splash, loadProgress, progressText);
    splashLayout.setAlignment(Pos.CENTER);
    splashLayout.setPadding(new Insets(10, 5, 5, 5));
    splash.setEffect(new DropShadow());
    progressText.setEffect(new DropShadow(4, Color.rgb(133, 191, 37)));
    Scene scene = new Scene(splashLayout, SPLASH_WIDTH, SPLASH_HEIGHT, Color.TRANSPARENT);
    scene.getStylesheets().add("css/styles.css");
    return scene;
}
项目:CoinJoin    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:Map-Projections    文件:ProgressBarDialog.java   
public ProgressBarDialog() {
    DialogPane pane = this.getDialogPane();

    this.bar = new ProgressBar();
    this.bar.setPrefWidth(300);

    this.words = new Label();
    this.words.setMinWidth(50);
    this.words.setAlignment(Pos.BASELINE_RIGHT);

    this.box = new HBox(5);

    this.setTitle("");  // set the words on it
    pane.setHeaderText("Please wait.");
    pane.getButtonTypes().addAll(new ButtonType[] { ButtonType.CLOSE });
    ((Button) pane.lookupButton(ButtonType.CLOSE)).setText("Run in background");    // you can't close it
    ((Button) pane.lookupButton(ButtonType.CLOSE)).setTooltip(new Tooltip("Oh, did you want a cancel button? Well, TOO BAD. Cancel buttons are hard."));
    this.resetBar();

    this.setResultConverter((btn) -> {  // set the return value
        return null;
    });
}
项目:ViMixer    文件:ProgressView.java   
@Override
public void initial(ViFile observable, BaseController controller) {
    lock.lock();
    try {
        progressBar = new ProgressBar(observable.infoProperty().get().computeProgress());
        progressLabel = new Label(" " + observable.infoProperty().get().computeProgressPercent());
        progressLabel.setAlignment(Pos.CENTER_RIGHT);
        //          progressLabel.textProperty().bind(Bindings.convert(progressBar.progressProperty()));
        this.getChildren().add(progressBar);
        this.getChildren().add(progressLabel);

        progressBar.progressProperty().addListener((obser, oldvalue, newvalue) -> {
            Double percent = newvalue.doubleValue() * 100;
            progressLabel.setText(" " + percent.intValue() + "%");
        });

        initailized.set(true);
        this.setCache(true);
        //bind this overview pane width to the right width property in MainFrame
        this.progressBar.prefWidthProperty().bind(
                ((MainFrameController) controller).getBlockPaneWidthProperty().add(-35));
    } finally {
        lock.unlock();
    }
}
项目:thundernetwork    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:FXTutorials    文件:DownloaderApp.java   
private Parent createContent() {
    VBox root = new VBox();
    root.setPrefSize(400, 600);

    TextField fieldURL = new TextField();
    root.getChildren().addAll(fieldURL);

    fieldURL.setOnAction(event -> {
        Task<Void> task = new DownloadTask(fieldURL.getText());
        ProgressBar progressBar = new ProgressBar();
        progressBar.setPrefWidth(350);
        progressBar.progressProperty().bind(task.progressProperty());
        root.getChildren().add(progressBar);

        fieldURL.clear();

        Thread thread = new Thread(task);
        thread.setDaemon(true);
        thread.start();
    });

    return root;
}
项目:digibytej-alice    文件:NotificationBarPane.java   
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
项目:YTSubscriber    文件:ProgressDialog.java   
/**
 * ProgressDialog constructor.
 *
 * @throws IOException An exception occurred while getting the theme
 */
public ProgressDialog() throws IOException {
    dialogStage = new Stage();
    dialogStage.initStyle(StageStyle.UTILITY);
    dialogStage.initModality(Modality.APPLICATION_MODAL);
    dialogStage.setTitle("Update");

    mBar = new ProgressBar();
    mBar.setPrefWidth(WIDTH);
    mBar.setProgress(-1);
    mMessage = new Label("");

    final VBox hb = new VBox();
    hb.setPadding(new Insets(5, 5, 5, 5));
    hb.setSpacing(5);
    hb.setAlignment(Pos.CENTER_LEFT);
    hb.getChildren().addAll(mMessage, mBar);

    Scene scene = new Scene(hb);
    scene.getStylesheets().add(ProgressDialog.class.getResource(
            Theme.getProgressCss(Theme.getTheme())).toExternalForm());
    dialogStage.setScene(scene);
}
项目:exchange    文件:SeparatedPhaseBars.java   
private void addLabels() {
    Label titleLabel = new Label(Res.get("dao.compensation.active.phase"));

    Label startLabel = new Label(Res.get("dao.compensation.active.startBlock"));
    AnchorPane startLabelPane = new AnchorPane();
    AnchorPane.setLeftAnchor(startLabel, 0d);
    startLabelPane.getChildren().add(startLabel);

    Label endLabel = new Label(Res.get("dao.compensation.active.endBlock"));
    AnchorPane endLabelPane = new AnchorPane();
    AnchorPane.setRightAnchor(endLabel, 0d);
    endLabelPane.getChildren().add(endLabel);

    ProgressBar progressBar = new ProgressBar();
    progressBar.setMinHeight(9);
    progressBar.setMaxHeight(9);
    progressBar.setVisible(false);

    vBoxLabels = new VBox();
    vBoxLabels.setSpacing(5);
    vBoxLabels.getChildren().addAll(titleLabel, progressBar, startLabelPane, endLabelPane);
    vBoxLabels.setAlignment(Pos.CENTER);
    vBoxLabels.setPadding(new Insets(0, 10, 0, 0));
    getChildren().add(vBoxLabels);
}
项目:livestreamer_twitch_gui    文件:BrowserController.java   
private void setupProgressBar() {
    final VBox vbox = new VBox();
    final ProgressBar browserProgressBar = new ProgressBar();
    browserProgressBar.setVisible(false);
    browserProgressBar.setMinHeight(PROGRESS_BAR_MIN_HEIGHT);
    browserProgressBar.setMaxWidth(Double.MAX_VALUE);
    vbox.getChildren().add(browserProgressBar);
    this.browserRootBorderPane.setBottom(vbox);
    final DoubleProperty progress = new SimpleDoubleProperty();
    TwitchBrowserUpdateService.activeServicesProperty().addListener((observable, oldValue, newValue) -> {
        final int size = observable.getValue().size();
        if (size == 0) {
            progress.set(1.0D);
            browserProgressBar.setVisible(false);
        } else {
            browserProgressBar.setVisible(true);
            progress.set(1.0D / observable.getValue().size());
        }
    });
    browserProgressBar.progressProperty().bind(progress);
}
项目:netentionj-desktop    文件:LoadingProgressDisplay.java   
/**
 * Creates a UI display monitor for provided worker.
 *
 * Assumes the worker is reporting progress as work done on a scale from 0 to 100 (other values indicate indeterminate progress).
 *
 * @param worker the worker whose progress is to be monitored and displayed.
 */
public LoadingProgressDisplay(Worker worker) {
    setMaxWidth(Double.MAX_VALUE);

    ColorAdjust bleach = new ColorAdjust();
    bleach.setSaturation(-0.6);
    setEffect(bleach);

    HBox.setHgrow(this, Priority.ALWAYS);

    visibleProperty().bind(worker.runningProperty());

    // as the webview load progresses update progress.
    worker.workDoneProperty().addListener((observableValue, oldNumber, newNumber) -> {
        if (newNumber == null) newNumber = -1.0;
        final double newValue = newNumber.doubleValue();
        if (newValue < 0.0 || newValue > 100.0) {
            setProgress(ProgressBar.INDETERMINATE_PROGRESS);
        }
        setProgress(newValue / 100.0);
    });
}
项目:ISAAC    文件:MappingController.java   
private void updateMappingItemsList(MappingSet mappingSet)
{
    clearMappingItems();
    if (mappingSet != null) {
        mappingItemTableView.setPlaceholder(new ProgressBar(-1.0));
        Utility.execute(() ->
        {
            ObservableList<MappingItem> mappingItems = FXCollections.observableList(mappingSet.getMappingItems(activeOnlyToggle.isSelected()));

            Platform.runLater(() ->
            {
                mappingItemTableView.setItems(mappingItems);
                mappingItemTableView.setPlaceholder(new Label("The selected Mapping Set contains no Mapping Items."));

                mappingItemListTitleLabel.setText(mappingSet.getName());
                plusMappingItemButton.setDisable(false);
                minusMappingSetButton.setDisable(false);
                editMappingSetButton.setDisable(false);
                mappingSetSummaryLabel.setText(mappingSet.getSummary(activeOnlyToggle.isSelected()));
            });
        });
    }
}