javafx.scene.control.ProgressBar Java Examples
The following examples show how to use
javafx.scene.control.ProgressBar.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestExporter.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override @Before public void setUp() throws Exception { super.setUp(); exporter = injector.getInstance(Exporter.class); hand.setActivated(true); when(pencil.isActivated()).thenReturn(false); WaitForAsyncUtils.waitForFxEvents(); final TemplateManager template = injector.getInstance(TemplateManager.class); template.templatePane = new FlowPane(); final StatusBarController status = injector.getInstance(StatusBarController.class); Mockito.when(status.getLabel()).thenReturn(new Label()); Mockito.when(status.getProgressBar()).thenReturn(new ProgressBar()); chooser = Mockito.mock(FileChooser.class); Mockito.when(chooser.getExtensionFilters()).thenReturn(FXCollections.observableArrayList()); Mockito.when(chooser.showOpenDialog(Mockito.any())).thenReturn(tmp.newFile()); Mockito.when(chooser.showSaveDialog(Mockito.any())).thenReturn(tmp.newFile()); final Field field = Exporter.class.getDeclaredField("fileChooserExport"); field.setAccessible(true); field.set(exporter, chooser); }
Example #2
Source File: NotificationBarPane.java From devcoretalk with GNU General Public License v2.0 | 6 votes |
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(); }); }
Example #3
Source File: UpdatePreloader.java From Path-of-Leveling with MIT License | 6 votes |
private Scene createPreloaderScene() { bar = new ProgressBar(); //BorderPane p = new BorderPane(); FXMLLoader loader = new FXMLLoader(getClass().getResource("updater.fxml")); AnchorPane p = null; try { p = loader.load(); } catch (IOException ex) { Logger.getLogger(MainApp_Controller.class.getName()).log(Level.SEVERE, null, ex); } //at this point this class has done enough, and we need to contact with the //appropriate controllers. controller = loader.<UpdaterController>getController(); Scene pr = new Scene(p); pr.getStylesheets().add(getClass().getResource("/styles/style.css").toExternalForm()); return pr; }
Example #4
Source File: NewFXPreloader.java From Path-of-Leveling with MIT License | 6 votes |
private Scene createPreloaderScene() { bar = new ProgressBar(); //BorderPane p = new BorderPane(); FXMLLoader loader = new FXMLLoader(getClass().getResource("loading.fxml")); AnchorPane p = null; try { p = loader.load(); } catch (IOException ex) { Logger.getLogger(MainApp_Controller.class.getName()).log(Level.SEVERE, null, ex); } //at this point this class has done enough, and we need to contact with the //appropriate controllers. controller = loader.<Loading_Controller>getController(); Scene pr = new Scene(p); pr.getStylesheets().add(getClass().getResource("/styles/style.css").toExternalForm()); return pr; }
Example #5
Source File: NotificationBarPane.java From thundernetwork with GNU Affero General Public License v3.0 | 6 votes |
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(); }); }
Example #6
Source File: LoadDrawingTest.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override protected void commonCanDoFixture() { final SystemUtils utils = Mockito.mock(SystemUtils.class); Mockito.when(utils.getPathTemplatesDirUser()).thenReturn(""); SystemUtils.setSingleton(utils); ui = Mockito.mock(JfxUI.class); statusWidget = Mockito.mock(Label.class); progressBar = Mockito.mock(ProgressBar.class); mainstage = Mockito.mock(Stage.class); file = Mockito.mock(File.class); modifiedAlert = Mockito.mock(Alert.class); openSaveManager = Mockito.mock(OpenSaver.class); fileChooser = Mockito.mock(FileChooser.class); currentFolder = Optional.empty(); cmd = new LoadDrawing(file, openSaveManager, progressBar, statusWidget, ui, fileChooser, currentFolder, mainstage, modifiedAlert); }
Example #7
Source File: LoadingPane.java From Quelea with GNU General Public License v3.0 | 6 votes |
/** * Create the loading pane. */ public LoadingPane() { setAlignment(Pos.CENTER); VBox content = new VBox(); content.setAlignment(Pos.CENTER); Text text = new Text(LabelGrabber.INSTANCE.getLabel("loading.text") + "..."); text.setStyle(" -fx-font: bold italic 20pt \"Arial\";"); FadeTransition textTransition = new FadeTransition(Duration.seconds(1.5), text); textTransition.setAutoReverse(true); textTransition.setFromValue(0); textTransition.setToValue(1); textTransition.setCycleCount(Transition.INDEFINITE); textTransition.play(); content.getChildren().add(text); bar = new ProgressBar(); content.getChildren().add(bar); getChildren().add(content); setOpacity(0); setStyle("-fx-background-color: #555555;"); setVisible(false); }
Example #8
Source File: DownloaderApp.java From FXTutorials with MIT License | 6 votes |
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; }
Example #9
Source File: StatusPanel.java From Quelea with GNU General Public License v3.0 | 6 votes |
/** * Create a new status panel. * <p/> * @param group the group this panel is part of. * @param labelText the text to put on the label on this panel. * @param index the index of this panel on the group. */ StatusPanel(StatusPanelGroup group, String labelText, int index) { setAlignment(Pos.CENTER); setSpacing(5); this.group = group; this.index = index; label = new Label(labelText); label.setAlignment(Pos.CENTER); label.setMaxHeight(Double.MAX_VALUE); HBox.setMargin(label, new Insets(5)); progressBar = new ProgressBar(); progressBar.setMaxWidth(Double.MAX_VALUE); //Allow progress bar to fill space. HBox.setHgrow(progressBar, Priority.ALWAYS); cancelButton = new Button("", new ImageView(new Image("file:icons/cross.png", 13, 13, false, true))); Utils.setToolbarButtonStyle(cancelButton); cancelButton.setAlignment(Pos.CENTER); getChildren().add(label); getChildren().add(progressBar); getChildren().add(cancelButton); }
Example #10
Source File: SaveDrawingTest.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override protected void commonCanDoFixture() { final SystemUtils utils = Mockito.mock(SystemUtils.class); Mockito.when(utils.getPathTemplatesDirUser()).thenReturn(""); SystemUtils.setSingleton(utils); ui = Mockito.mock(JfxUI.class); statusWidget = Mockito.mock(Label.class); progressBar = Mockito.mock(ProgressBar.class); mainstage = Mockito.mock(Stage.class); file = Mockito.mock(File.class); modifiedAlert = Mockito.mock(Alert.class); openSaveManager = Mockito.mock(OpenSaver.class); fileChooser = Mockito.mock(FileChooser.class); currentFolder = Optional.empty(); injector = Mockito.mock(Injector.class); prefService = Mockito.mock(PreferencesService.class); Mockito.when(injector.getInstance(PreferencesService.class)).thenReturn(prefService); cmd = new SaveDrawing(true, true, currentFolder, fileChooser, injector, file, openSaveManager, progressBar, ui, statusWidget, mainstage, modifiedAlert); }
Example #11
Source File: NotificationBarPane.java From thunder with GNU Affero General Public License v3.0 | 6 votes |
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(); }); }
Example #12
Source File: NotificationBarPane.java From green_android with GNU General Public License v3.0 | 6 votes |
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(); }); }
Example #13
Source File: NewDrawingTest.java From latexdraw with GNU General Public License v3.0 | 6 votes |
@Override protected void commonCanDoFixture() { final SystemUtils utils = Mockito.mock(SystemUtils.class); Mockito.when(utils.getPathTemplatesDirUser()).thenReturn(""); SystemUtils.setSingleton(utils); ui = Mockito.mock(JfxUI.class); statusWidget = Mockito.mock(Label.class); progressBar = Mockito.mock(ProgressBar.class); mainstage = Mockito.mock(Stage.class); file = Mockito.mock(File.class); modifiedAlert = Mockito.mock(Alert.class); openSaveManager = Mockito.mock(OpenSaver.class); fileChooser = Mockito.mock(FileChooser.class); currentFolder = Optional.empty(); cmd = new NewDrawing(file, openSaveManager, progressBar, statusWidget, ui, fileChooser, currentFolder, mainstage, modifiedAlert); }
Example #14
Source File: RFXProgressBarTest.java From marathonv5 with Apache License 2.0 | 6 votes |
@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)); }
Example #15
Source File: LogUI.java From SONDY with GNU General Public License v3.0 | 5 votes |
public LogUI(){ // Initializing the main grid logGrid = new GridPane(); logGrid.setPadding(new Insets(5, 5, 5, 5)); // Adding separators logGrid.add(new Text("Log"),0,0); logGrid.add(new Separator(),0,1); // App status monitoring memoryLabel = new Label(); UIUtils.setSize(memoryLabel, Main.columnWidthLEFT, 24); progressBar = new ProgressBar(0); UIUtils.setSize(progressBar, Main.columnWidthRIGHT, 12); HBox appStatusBox = new HBox(5); appStatusBox.setAlignment(Pos.CENTER); appStatusBox.getChildren().addAll(memoryLabel,progressBar); logGrid.add(appStatusBox,0,2); // Creating the log table logTable = new TableView<>(); UIUtils.setSize(logTable,Main.windowWidth-10,150); TableColumn logTimeColumn = new TableColumn("Time"); logTimeColumn.setMinWidth(90); logTimeColumn.setMaxWidth(90); TableColumn logDetailsColumn = new TableColumn("Log"); logDetailsColumn.setMinWidth(Main.windowWidth-85); logTimeColumn.setCellValueFactory(new PropertyValueFactory<>("time")); logDetailsColumn.setCellValueFactory(new PropertyValueFactory<>("info")); logTable.getColumns().addAll(logTimeColumn,logDetailsColumn); logGrid.add(logTable,0,3); }
Example #16
Source File: ADCWindow.java From arma-dialog-creator with MIT License | 5 votes |
public void preInit() { preInit = true; rootElement = new VBox(); rootElement.setPadding(new Insets(10)); stage.getScene().setRoot(rootElement); StackPane stackPane = new StackPane(); rootElement.getChildren().add(stackPane); ProgressBar bar = new ProgressBar(-1); stackPane.getChildren().add(bar); stage.setWidth(ScreenDimension.D1024.width + CanvasControls.PREFERRED_WIDTH); stage.setHeight(ScreenDimension.D1024.height + 100); }
Example #17
Source File: TextProgressBar.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
private void syncProgress() { if (progress < 0.001) { bar.setProgress(ProgressBar.INDETERMINATE_PROGRESS); } else { bar.setProgress(progress); } bar.setMinHeight(text.getBoundsInLocal().getHeight() + LABEL_HEIGHT_PADDING * 2); bar.setMinWidth(text.getBoundsInLocal().getWidth() + LABEL_WIDTH_PADDING * 2); }
Example #18
Source File: TimeSlider.java From regions with Apache License 2.0 | 5 votes |
public TimeSlider() { getStyleClass().add("track"); setFocusTraversable(true); setMinWidth(200); setMaxWidth(200); slider = new Slider(); slider.setMin(0); progressBar = new ProgressBar(0); }
Example #19
Source File: TerasologyLauncher.java From TerasologyLauncher with Apache License 2.0 | 5 votes |
@Override public void init() { ImageView splash = new ImageView(BundleUtils.getFxImage("splash")); loadProgress = new ProgressBar(); loadProgress.setPrefWidth(SPLASH_WIDTH); progressText = new Label(); splashLayout = new VBox(); splashLayout.getChildren().addAll(splash, loadProgress, progressText); progressText.setAlignment(Pos.CENTER); splashLayout.getStylesheets().add(BundleUtils.getStylesheet("css_splash")); splashLayout.setEffect(new DropShadow()); hostServices = new HostServices(); }
Example #20
Source File: SeparatedPhaseBars.java From bisq with GNU Affero General Public License v3.0 | 5 votes |
public SeparatedPhaseBars(List<SeparatedPhaseBarsItem> items) { this.items = items; setSpacing(10); HBox titlesBars = new HBox(); titlesBars.setSpacing(5); getChildren().add(titlesBars); HBox progressBars = new HBox(); progressBars.setSpacing(5); getChildren().add(progressBars); items.forEach(item -> { String text = item.phase.name().startsWith("BREAK") ? "" : Res.get("dao.phase.separatedPhaseBar." + item.phase); Label titleLabel = new Label(text); titleLabel.setEllipsisString(""); titleLabel.setAlignment(Pos.CENTER); item.setTitleLabel(titleLabel); titlesBars.getChildren().addAll(titleLabel); ProgressBar progressBar = new JFXProgressBar(); progressBar.setMinHeight(9); progressBar.setMaxHeight(9); progressBar.progressProperty().bind(item.progressProperty); progressBar.setOpacity(item.isShowBlocks() ? 1 : 0.25); progressBars.getChildren().add(progressBar); item.setProgressBar(progressBar); }); widthProperty().addListener((observable, oldValue, newValue) -> { updateWidth((double) newValue); }); }
Example #21
Source File: UpdateProgressWindow.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
private VBox createDownloadProgressItem(LabeledDownloadProgressBar progressTracker) { Label downloadLabel = new Label(); downloadLabel.setText(progressTracker.getDownloadLabel()); ProgressBar progressBar = progressTracker.getProgressBar(); VBox downloadProgressItem = new VBox(); downloadProgressItem.setSpacing(20); downloadProgressItem.setPadding(new Insets(20)); downloadProgressItem.setAlignment(Pos.CENTER_LEFT); downloadProgressItem.getChildren().addAll(downloadLabel, progressBar); return downloadProgressItem; }
Example #22
Source File: SplashScreen.java From springboot-javafx-support with MIT License | 5 votes |
/** * Override this to create your own splash pane parent node. * * @return A standard image */ public Parent getParent() { final ImageView imageView = new ImageView(getClass().getResource(getImagePath()).toExternalForm()); final ProgressBar splashProgressBar = new ProgressBar(); splashProgressBar.setPrefWidth(imageView.getImage().getWidth()); final VBox vbox = new VBox(); vbox.getChildren().addAll(imageView, splashProgressBar); return vbox; }
Example #23
Source File: UpdateProgressWindow.java From HubTurbo with GNU Lesser General Public License v3.0 | 5 votes |
/** * Creates a new download progress bar * * @param downloadUri uri of download as identifier to the progress bar * @param downloadLabel label of progress bar * @return the download progress bar created */ public LabeledDownloadProgressBar createNewDownloadProgressBar(URI downloadUri, String downloadLabel) { ProgressBar progressBar = new ProgressBar(-1.0); progressBar.setPrefWidth(400); LabeledDownloadProgressBar downloadProgressBar = new LabeledDownloadProgressBar(downloadUri, downloadLabel, progressBar); downloads.add(downloadProgressBar); reloadWindowLayout(); return downloadProgressBar; }
Example #24
Source File: WikiProgressBar.java From pattypan with MIT License | 5 votes |
private GridPane createContent(double progress) { this.progress = progress; this.setMinWidth(420); this.setMaxWidth(420); this.getStyleClass().add("mw-ui-progressbar-container"); this.getColumnConstraints().addAll( Util.newColumn(33, "%", HPos.LEFT), Util.newColumn(33, "%", HPos.CENTER), Util.newColumn(33, "%", HPos.RIGHT)); ProgressBar pb = new ProgressBar(progress); pb.getStyleClass().addAll("mw-ui-progressbar"); pb.setMinWidth(420); pb.setMaxWidth(420); pb.setMaxHeight(5); this.add(pb, 0, 0, 3, 1); this.addRow(1, createDot(0.0, 1), createDot(1.0, 70), createDot(2.0, 140)); this.addRow(2, createLabel(0.0, labels[0]).setTranslateByHalf(false), createLabel(1.0, labels[1]), createLabel(2.0, labels[2]).setTranslateByHalf(true) ); return this; }
Example #25
Source File: DefaultUIProvider.java From fxlauncher with Apache License 2.0 | 5 votes |
public Parent createUpdater(FXManifest manifest) { progressBar = new ProgressBar(); progressBar.setStyle(manifest.progressBarStyle); Label label = new Label(manifest.updateText); label.setStyle(manifest.updateLabelStyle); VBox wrapper = new VBox(label, progressBar); wrapper.setStyle(manifest.wrapperStyle); return wrapper; }
Example #26
Source File: IndikatorService.java From AsciidocFX with Apache License 2.0 | 5 votes |
public void startProgressBar() { threadService.runActionLater(() -> { ProgressBar progressBar = applicationContoller.getProgressBar(); Timeline timeline = applicationContoller.getProgressBarTimeline(); progressBar.setVisible(true); progressBar.setManaged(true); timeline.playFromStart(); }); }
Example #27
Source File: IndikatorService.java From AsciidocFX with Apache License 2.0 | 5 votes |
public void stopProgressBar() { threadService.runActionLater(() -> { ProgressBar progressBar = applicationContoller.getProgressBar(); Timeline timeline = applicationContoller.getProgressBarTimeline(); progressBar.setVisible(false); progressBar.setManaged(false); timeline.stop(); }); }
Example #28
Source File: RFXProgressBarTest.java From marathonv5 with Apache License 2.0 | 5 votes |
@Test public void select() { ProgressBar progressBar = (ProgressBar) getPrimaryStage().getScene().getRoot().lookup(".progress-bar"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(() -> { RFXProgressBar rfxProgressBar = new RFXProgressBar(progressBar, null, null, lr); progressBar.setProgress(0.56); rfxProgressBar.mouseReleased(null); }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording recording = recordings.get(0); AssertJUnit.assertEquals("recordSelect", recording.getCall()); AssertJUnit.assertEquals("0.56", recording.getParameters()[0]); }
Example #29
Source File: MiniGraphTool.java From VocabHunter with Apache License 2.0 | 5 votes |
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; }
Example #30
Source File: ProgressBarSample.java From marathonv5 with Apache License 2.0 | 5 votes |
public ProgressBarSample() { super(400,100); double y = 15; final double SPACING = 15; ProgressBar p1 = new ProgressBar(); p1.setLayoutY(y); y += SPACING; ProgressBar p2 = new ProgressBar(); p2.setPrefWidth(150); p2.setLayoutY(y); y += SPACING; ProgressBar p3 = new ProgressBar(); p3.setPrefWidth(200); p3.setLayoutY(y); y = 15; ProgressBar p4 = new ProgressBar(); p4.setLayoutX(215); p4.setLayoutY(y); p4.setProgress(0.25); y += SPACING; ProgressBar p5 = new ProgressBar(); p5.setPrefWidth(150); p5.setLayoutX(215); p5.setLayoutY(y); p5.setProgress(0.50); y += SPACING; ProgressBar p6 = new ProgressBar(); p6.setPrefWidth(200); p6.setLayoutX(215); p6.setLayoutY(y); p6.setProgress(1); getChildren().addAll(p1,p2,p3,p4,p5,p6); }