Java Code Examples for javafx.scene.layout.VBox#setMinWidth()

The following examples show how to use javafx.scene.layout.VBox#setMinWidth() . 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: ProcessController.java    From tools-ocr with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ProcessController(){
    VBox vBox = new VBox();
    vBox.setAlignment(Pos.BASELINE_CENTER);
    vBox.setMinWidth(300);
    vBox.setBackground(new Background(new BackgroundFill(Color.rgb(250, 250, 250), CornerRadii.EMPTY, Insets.EMPTY)));
    ProgressIndicator progressIndicator = new ProgressIndicator();
    progressIndicator.setStyle(CommUtils.STYLE_TRANSPARENT);
    int circleSize = 75;
    progressIndicator.setMinWidth(circleSize);
    progressIndicator.setMinHeight(circleSize);
    Label topLab = new Label("正在识别图片,请稍等.....");
    topLab.setFont(Font.font(18));
    vBox.setSpacing(10);
    vBox.setPadding(new Insets(20, 0, 20, 0));
    vBox.getChildren().add(progressIndicator);
    vBox.getChildren().add(topLab);
    Scene scene = new Scene(vBox, Color.TRANSPARENT);
    setScene(scene);
    initStyle(StageStyle.TRANSPARENT);
    CommUtils.initStage(this);
}
 
Example 2
Source File: MultipleMainPane.java    From oim-fx with MIT License 6 votes vote down vote up
private void initComponent() {

		multipleListPane.setPrefWidth(228);
		multipleListPane.setPrefHeight(600);
		
		VBox lineVBox = new VBox();
		lineVBox.setMinWidth(1);
		lineVBox.setStyle("-fx-background-color:#000000;");

		BorderPane lineBorderPane = new BorderPane();
		lineBorderPane.setLeft(multipleListPane);
		lineBorderPane.setRight(lineVBox);

		rootBorderPane.setLeft(lineBorderPane);

		this.getChildren().add(rootBorderPane);
	}
 
Example 3
Source File: PreferencePane.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
@Inject
public PreferencePane(PreferenceAppearencePane appearence, PreferenceBehaviorPane behavior,
        PreferenceWorkspacePane workspace, PreferenceOutputPane output) {
    getStyleClass().add("dashboard-container");
    VBox left = new VBox(Style.DEFAULT_SPACING);
    left.setMinWidth(USE_PREF_SIZE);
    addSectionTitle(DefaultI18nContext.getInstance().i18n("Appearance"), left);
    left.getChildren().add(appearence);
    addSectionTitle(DefaultI18nContext.getInstance().i18n("Behavior"), left);
    left.getChildren().add(behavior);
    VBox right = new VBox(Style.DEFAULT_SPACING);
    HBox.setHgrow(right, Priority.ALWAYS);
    addSectionTitle(DefaultI18nContext.getInstance().i18n("Workspace"), right);
    right.getChildren().add(workspace);
    addSectionTitle(DefaultI18nContext.getInstance().i18n("Output"), right);
    right.getChildren().add(output);
    getChildren().addAll(left, right);
}
 
Example 4
Source File: ParameterListInputPane.java    From constellation with Apache License 2.0 5 votes vote down vote up
private ParameterItem(final Pane parameterPane) {
    this.parameterPane = parameterPane;
    buttonBar = new VBox();
    buttonBar.setMinWidth(45);
    removeItemButton = new Button(null, new ImageView(UserInterfaceIconProvider.CROSS.buildImage(16)));
    moveUpButton = new Button(null, new ImageView(UserInterfaceIconProvider.CHEVRON_UP.buildImage(16)));
    moveDownButton = new Button(null, new ImageView(UserInterfaceIconProvider.CHEVRON_DOWN.buildImage(16)));
    buttonBar.getChildren().addAll(removeItemButton, moveUpButton, moveDownButton);
    buttonBar.setSpacing(10);
    getChildren().addAll(parameterPane, buttonBar);
    HBox.setHgrow(parameterPane, Priority.ALWAYS);

}
 
Example 5
Source File: ADCCanvasView.java    From arma-dialog-creator with MIT License 5 votes vote down vote up
ADCCanvasView() {
	EditorManager editorManager = EditorManager.instance;
	this.display = editorManager.getEditingDisplay();
	canvasControls = new CanvasControls(this);
	this.uiCanvasEditor = new UICanvasEditor(editorManager.getResolution(), canvasControls, display);
	initializeUICanvasEditor(display);

	//init notification pane
	{
		VBox vboxNotifications = new VBox(10);
		vboxNotifications.setFillWidth(true);
		vboxNotifications.setAlignment(Pos.BOTTOM_RIGHT);
		vboxNotifications.setPadding(new Insets(5));
		vboxNotifications.setMinWidth(120);

		notificationPane = new NotificationPane(vboxNotifications);
		Notifications.setDefaultNotificationPane(notificationPane);
	}

	final StackPane stackPane = new StackPane(uiCanvasEditor, notificationPane.getContentPane());
	notificationPane.getContentPane().setMouseTransparent(true);

	this.getChildren().addAll(stackPane, canvasControls);
	HBox.setHgrow(canvasControls, Priority.ALWAYS);

	setOnMouseMoved(new CanvasViewMouseEvent(this));
	focusToCanvas(true);
}
 
Example 6
Source File: DaoLaunchWindow.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void createContent() {
    HBox slidingContentWithPagingBox = new HBox();
    slidingContentWithPagingBox.setPadding(new Insets(30, 0, 0, 0));
    slidingContentWithPagingBox.setAlignment(Pos.CENTER);
    Button prevButton = getIconButton(MaterialDesignIcon.ARROW_LEFT, "dao-launch-paging-button");
    prevButton.setOnAction(event -> {
        autoPlayTimeline.stop();
        goToPrevSection();
    });
    Button nextButton = getIconButton(MaterialDesignIcon.ARROW_RIGHT, "dao-launch-paging-button");
    nextButton.setOnAction(event -> {
        autoPlayTimeline.stop();
        goToNextSection();
    });
    VBox slidingContent = new VBox();
    slidingContent.setMinWidth(616);
    slidingContent.setSpacing(20);
    sectionDescriptionLabel = new Label();
    sectionDescriptionLabel.setTextAlignment(TextAlignment.CENTER);
    sectionDescriptionLabel.getStyleClass().add("dao-launch-description");
    sectionDescriptionLabel.setMaxWidth(562);
    sectionDescriptionLabel.setWrapText(true);


    selectedSection = sections.get(currentSectionIndex.get());

    sectionDescriptionLabel.setText(selectedSection.description);
    sectionScreenshot = new ImageView();
    sectionScreenshot.setOpacity(0);
    sectionScreenshot.setId(selectedSection.imageId);

    slidingContent.setAlignment(Pos.CENTER);
    slidingContent.getChildren().addAll(sectionDescriptionLabel, sectionScreenshot);
    slidingContentWithPagingBox.getChildren().addAll(prevButton, slidingContent, nextButton);

    GridPane.setRowIndex(slidingContentWithPagingBox, ++rowIndex);
    GridPane.setColumnSpan(slidingContentWithPagingBox, 2);
    GridPane.setHgrow(slidingContent, Priority.ALWAYS);
    gridPane.getChildren().add(slidingContentWithPagingBox);
}
 
Example 7
Source File: SearchBox.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public SearchBox() {
    setId("SearchBox");
    setMinHeight(24);
    setPrefSize(150, 24);
    setMaxHeight(24);
    textBox = new TextField();
    textBox.setPromptText("Search");
    clearButton = new Button();
    clearButton.setVisible(false);
    getChildren().addAll(textBox, clearButton);
    clearButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent actionEvent) {
            textBox.setText("");
            textBox.requestFocus();
        }
    });
    textBox.setOnKeyReleased(new EventHandler<KeyEvent>() {
        @Override public void handle(KeyEvent keyEvent) {
            if (keyEvent.getCode() == KeyCode.DOWN) {
                ///System.out.println("SearchBox.handle DOWN");
                contextMenu.setFocused(true);
            }
        }
    });
    textBox.textProperty().addListener(new ChangeListener<String>() {
        @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            clearButton.setVisible(textBox.getText().length() != 0);
            if (textBox.getText().length() == 0) {
                if (contextMenu != null) contextMenu.hide();
                showError(null);
            } else {
                boolean haveResults = false;
                Map<DocumentType, List<SearchResult>> results = null;
                try {
                    if (indexSearcher == null) indexSearcher = new IndexSearcher();
                    results = indexSearcher.search(
                            textBox.getText() + (textBox.getText().matches("\\w+") ? "*" : "")
                    );
                    // check if we have any results
                    for (List<SearchResult> categoryResults: results.values()) {
                        if (categoryResults.size() > 0) {
                            haveResults = true;
                            break;
                        }
                    }
                } catch (ParseException e) {
                    showError(e.getMessage().substring("Cannot parse ".length()));
                }
                if (haveResults) {
                    showError(null);
                    populateMenu(results);
                    if (!contextMenu.isShowing()) contextMenu.show(SearchBox.this, Side.BOTTOM, 10,-5);
                } else {
                    if (searchErrorTooltip.getText() == null) showError("No matches");
                    contextMenu.hide();
                }
                contextMenu.setFocused(true);
            }
        }
    });
    // create info popup
    infoBox = new VBox();
    infoBox.setId("search-info-box");
    infoBox.setFillWidth(true);
    infoBox.setMinWidth(USE_PREF_SIZE);
    infoBox.setPrefWidth(350);
    infoName = new Label();
    infoName.setId("search-info-name");
    infoName.setMinHeight(USE_PREF_SIZE);
    infoName.setPrefHeight(28);
    infoDescription = new Label();
    infoDescription.setId("search-info-description");
    infoDescription.setWrapText(true);
    infoDescription.setPrefWidth(infoBox.getPrefWidth()-24);
    infoBox.getChildren().addAll(infoName,infoDescription);
    extraInfoPopup.getContent().add(infoBox);
    // hide info popup when context menu is hidden
    contextMenu.setOnHidden(new EventHandler<WindowEvent>() {
        @Override public void handle(WindowEvent windowEvent) {
            extraInfoPopup.hide();
        }
    });
}
 
Example 8
Source File: SearchBox.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public SearchBox() {
    setId("SearchBox");
    setMinHeight(24);
    setPrefSize(150, 24);
    setMaxHeight(24);
    textBox = new TextField();
    textBox.setPromptText("Search");
    clearButton = new Button();
    clearButton.setVisible(false);
    getChildren().addAll(textBox, clearButton);
    clearButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent actionEvent) {
            textBox.setText("");
            textBox.requestFocus();
        }
    });
    textBox.setOnKeyReleased(new EventHandler<KeyEvent>() {
        @Override public void handle(KeyEvent keyEvent) {
            if (keyEvent.getCode() == KeyCode.DOWN) {
                ///System.out.println("SearchBox.handle DOWN");
                contextMenu.setFocused(true);
            }
        }
    });
    textBox.textProperty().addListener(new ChangeListener<String>() {
        @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            clearButton.setVisible(textBox.getText().length() != 0);
            if (textBox.getText().length() == 0) {
                if (contextMenu != null) contextMenu.hide();
                showError(null);
            } else {
                boolean haveResults = false;
                Map<DocumentType, List<SearchResult>> results = null;
                try {
                    if (indexSearcher == null) indexSearcher = new IndexSearcher();
                    results = indexSearcher.search(
                            textBox.getText() + (textBox.getText().matches("\\w+") ? "*" : "")
                    );
                    // check if we have any results
                    for (List<SearchResult> categoryResults: results.values()) {
                        if (categoryResults.size() > 0) {
                            haveResults = true;
                            break;
                        }
                    }
                } catch (ParseException e) {
                    showError(e.getMessage().substring("Cannot parse ".length()));
                }
                if (haveResults) {
                    showError(null);
                    populateMenu(results);
                    if (!contextMenu.isShowing()) contextMenu.show(SearchBox.this, Side.BOTTOM, 10,-5);
                } else {
                    if (searchErrorTooltip.getText() == null) showError("No matches");
                    contextMenu.hide();
                }
                contextMenu.setFocused(true);
            }
        }
    });
    // create info popup
    infoBox = new VBox();
    infoBox.setId("search-info-box");
    infoBox.setFillWidth(true);
    infoBox.setMinWidth(USE_PREF_SIZE);
    infoBox.setPrefWidth(350);
    infoName = new Label();
    infoName.setId("search-info-name");
    infoName.setMinHeight(USE_PREF_SIZE);
    infoName.setPrefHeight(28);
    infoDescription = new Label();
    infoDescription.setId("search-info-description");
    infoDescription.setWrapText(true);
    infoDescription.setPrefWidth(infoBox.getPrefWidth()-24);
    infoBox.getChildren().addAll(infoName,infoDescription);
    extraInfoPopup.getContent().add(infoBox);
    // hide info popup when context menu is hidden
    contextMenu.setOnHidden(new EventHandler<WindowEvent>() {
        @Override public void handle(WindowEvent windowEvent) {
            extraInfoPopup.hide();
        }
    });
}
 
Example 9
Source File: ExpressionEvaluatorPopup.java    From arma-dialog-creator with MIT License 4 votes vote down vote up
public ExpressionEvaluatorPopup() {
	super(ArmaDialogCreator.getPrimaryStage(), new VBox(0), null);

	setTitle(bundle.getString("popup_title"));
	setStageSize(820, 550);

	taConsole.setText(bundle.getString("CodeArea.console_init") + " ");
	String[] commands = ExpressionInterpreter.getSupportedCommands();
	for (String command : commands) {
		taConsole.appendText(command != commands[commands.length - 1] ? command + ", " : command);
	}
	taConsole.appendText("\n\n");
	taConsole.setWrapText(true);

	//setup toolbar
	ToolBar toolBar;
	{
		btnEval = new Button(bundle.getString("Toolbar.evaluate"));
		btnEval.setOnAction(event -> evaluateText());

		btnTerminate = new Button(bundle.getString("Toolbar.terminate"));
		btnTerminate.setDisable(true);
		btnTerminate.setOnAction(event -> {
			activeEvaluateTask.cancel(true);
			btnTerminate.setDisable(false);
		});

		Button btnToggleConsole = new Button(bundle.getString("Toolbar.toggle_console"));
		btnToggleConsole.setOnAction(event -> toggleConsole());

		Button btnHelp = new Button(Lang.ApplicationBundle().getString("Popups.btn_help"));
		btnHelp.setOnAction(event -> help());

		toolBar = new ToolBar(
				btnEval, btnTerminate,
				new Separator(Orientation.VERTICAL),
				btnToggleConsole,
				new Separator(Orientation.VERTICAL),
				btnHelp
		);
	}

	myRootElement.getChildren().add(toolBar);

	//setup code area pane and environment overview
	VBox vboxAfterToolBar = new VBox(10);
	VBox.setVgrow(vboxAfterToolBar, Priority.ALWAYS);
	vboxAfterToolBar.setPadding(new Insets(10));
	vboxAfterToolBar.setMinWidth(300);
	VBox vboxEnvOverview = new VBox(5, new Label(bundle.getString("EnvOverview.label")), environmentOverviewPane);
	HBox hbox = new HBox(5, codeAreaPane, vboxEnvOverview);
	HBox.setHgrow(codeAreaPane, Priority.ALWAYS);
	HBox.setHgrow(vboxEnvOverview, Priority.SOMETIMES);

	VBox.setVgrow(hbox, Priority.ALWAYS);
	vboxAfterToolBar.getChildren().add(hbox);
	vboxAfterToolBar.getChildren().add(stackPaneConsole);

	vboxAfterToolBar.getChildren().add(new HBox(
			5,
			footerValueLabel(bundle.getString("CodeArea.return_value")), stackPaneResult,
			new Separator(Orientation.VERTICAL),
			footerValueLabel(bundle.getString("CodeArea.run_time")), stackPaneRunTime
	));

	ScrollPane scrollPane = new ScrollPane(vboxAfterToolBar);
	scrollPane.setFitToHeight(true);
	scrollPane.setFitToWidth(true);

	VBox.setVgrow(scrollPane, Priority.ALWAYS);

	myRootElement.getChildren().add(scrollPane);

}
 
Example 10
Source File: WelcomeWizard.java    From Lipi with MIT License 4 votes vote down vote up
public static void openDirBlog(File blogDir, Stage primaryStage) {
        if (blogDir != null) {
            try {
                primaryStage.close();
                String selectedDirPath = blogDir.getCanonicalPath();

                //history is saved
                WelcomeWizard.storeBlogHistory(selectedDirPath);

                TomlConfig tomlConfig = new TomlConfig(selectedDirPath + File.separator + "config.toml");

                primaryStage.setTitle("Blog Dashboard: " + tomlConfig.getTomlMap().get("title").toString() + " - Lipi");

                Stage editorStage = new Stage();
                editorStage.setTitle("Lipi Post Editor");
                TabbedHMDPostEditor t = new TabbedHMDPostEditor(editorStage);
                t.getStylesheets().add(Paths.get("res/material.css").toAbsolutePath().toUri().toString());
                t.getStylesheets().add(Paths.get("res/custom.css").toAbsolutePath().toUri().toString());
                editorStage.setScene(new Scene(t));

                editorStage.getIcons().add(
                        new Image(Paths.get("res/lipi-hmdeditor-icon.png").toAbsolutePath().toUri().toString())
                );

                DashboardMain mainDashboard = new DashboardMain(selectedDirPath, t);

                VBox holder = new VBox();
//                holder.setMinHeight(680);
                holder.setMinWidth(1000);
                holder.getChildren().add(mainDashboard);

                holder.getStylesheets().add(Paths.get("res/material.css").toAbsolutePath().toUri().toString());
                holder.getStylesheets().add(Paths.get("res/custom.css").toAbsolutePath().toUri().toString());

                Scene scene = new Scene(holder);

                primaryStage.setScene(scene);

//                primaryStage.setMinHeight(680);
                primaryStage.setMinWidth(1000);

                primaryStage.show();
                primaryStage.centerOnScreen();


            } catch (IOException e) {
                ExceptionAlerter.showException(e);
                e.getMessage();
            }
        }
    }
 
Example 11
Source File: TradeSubView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void addLeftBox() {
    leftVBox = new VBox();
    leftVBox.setSpacing(Layout.SPACING_V_BOX);
    leftVBox.setMinWidth(290);
    getChildren().add(leftVBox);
}