Java Code Examples for javafx.scene.layout.HBox#setMaxHeight()

The following examples show how to use javafx.scene.layout.HBox#setMaxHeight() . 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: TabPanel.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {

		// topBox.setPrefHeight(35);
		topBox.setMinHeight(35);

		Separator separator = new Separator();
		// separator.setOrientation(Orientation.HORIZONTAL);
		separator.setPrefHeight(1);
		separator.setMaxHeight(1);
		separator.setBorder(Border.EMPTY);
		// separator.setAlignment(Pos.CENTER_LEFT);
		// separator.getStyleClass().remove("line");
		// separator.r
		separator.setStyle("-fx-background-color:rgba(0, 0, 0, 0.3);");
		// separator.setBackground(Background.EMPTY);
		HBox line = new HBox();
		line.setMinHeight(1);
		line.setMaxHeight(1);
		line.setStyle("-fx-background-color:rgba(0, 0, 0, 0.1);");
		topRootBox.getChildren().add(topBox);

		this.setCenter(box);
		this.setTop(topRootBox);

		// setStyle("-fx-background-color:rgba(240, 240, 240, 1)");
		// this.getChildren().add(topRootBox);
		// this.getChildren().add(box);
	}
 
Example 2
Source File: ImageCropperPaneFrame.java    From oim-fx with MIT License 5 votes vote down vote up
private void init() {
	this.setBackground("Resources/Images/Wallpaper/18.jpg");
	this.setTitle("分页");
	this.setWidth(440);
	this.setHeight(460);
	this.setCenter(rootPane);

	HBox box = new HBox();
	box.setPrefHeight(50);
	box.setMaxHeight(50);
	
	box.getChildren().add(button);
	rootPane.setTop(box);
	
	VBox vBox = new VBox();
	vBox.getChildren().add(mp);
	//vBox.getChildren().add(scrollPane);
	
	rootPane.setCenter(vBox);

	Image i=new	Image(getClass().getResource("/resources/common/images/cropper/CircleMask.png").toExternalForm());
	mp.setCoverImage(i);
	
	Image image = ImageBox.getImagePath("Resources/Temp/1.jpg");
	mp.setImage(image);
	rootPane.setPrefSize(120, 140);
	rootPane.setMaxSize(120, 140);
	mp.setMaxSize(120, 140);
	
	//imageView.setPreserveRatio(true);
	imagePane.getChildren().add(imageView);
	scrollPane.setContent(imagePane);
	scrollPane.setPrefSize(120, 140);
	rootPane.setBottom(scrollPane);
}
 
Example 3
Source File: TaskBar.java    From desktoppanefx with Apache License 2.0 5 votes vote down vote up
public TaskBar() {
    taskBarContentPane = new HBox();
    taskBarContentPane.setSpacing(3);
    taskBarContentPane.setMaxHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
    taskBarContentPane.setMinHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
    taskBarContentPane.setAlignment(Pos.CENTER_LEFT);

    taskBar = new ScrollPane(taskBarContentPane);
    taskBar.setMaxHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
    taskBar.setMinHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
    taskBar.setVbarPolicy(javafx.scene.control.ScrollPane.ScrollBarPolicy.NEVER);
    taskBar.setVmax(0);
    taskBar.getStyleClass().add("desktoppane-taskbar");

    taskBar.visibleProperty().bind(visible);
    taskBar.managedProperty().bind(visible);

    taskBarContentPane.widthProperty().addListener((o, v, n) -> {
        Platform.runLater(() -> {
            if (n.doubleValue() <= taskBar.getWidth()) {
                taskBar.setMaxHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
                taskBar.setPrefHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
                taskBar.setMinHeight(TASKBAR_HEIGHT_WITHOUT_SCROLL);
            } else {
                taskBar.setMaxHeight(TASKBAR_HEIGHT_WITH_SCROLL);
                taskBar.setPrefHeight(TASKBAR_HEIGHT_WITH_SCROLL);
                taskBar.setMinHeight(TASKBAR_HEIGHT_WITH_SCROLL);
            }
        });
    });
}
 
Example 4
Source File: TakeOfferView.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private VBox getTradeFeeFieldsBox() {
    tradeFeeInBtcLabel = new Label();
    tradeFeeInBtcLabel.setMouseTransparent(true);
    tradeFeeInBtcLabel.setId("trade-fee-textfield");

    tradeFeeInBsqLabel = new Label();
    tradeFeeInBsqLabel.setMouseTransparent(true);
    tradeFeeInBsqLabel.setId("trade-fee-textfield");

    VBox vBox = new VBox();
    vBox.setSpacing(6);
    vBox.setMaxWidth(300);
    vBox.setAlignment(DevEnv.isDaoActivated() ? Pos.CENTER_RIGHT : Pos.CENTER_LEFT);
    vBox.getChildren().addAll(tradeFeeInBtcLabel, tradeFeeInBsqLabel);

    tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton();
    tradeFeeInBtcToggle.setText("BTC");
    tradeFeeInBtcToggle.setPadding(new Insets(-8, 5, -10, 5));

    tradeFeeInBsqToggle = new AutoTooltipSlideToggleButton();
    tradeFeeInBsqToggle.setText("BSQ");
    tradeFeeInBsqToggle.setPadding(new Insets(-9, 5, -9, 5));

    VBox tradeFeeToggleButtonBox = new VBox();
    tradeFeeToggleButtonBox.getChildren().addAll(tradeFeeInBtcToggle, tradeFeeInBsqToggle);

    HBox hBox = new HBox();
    hBox.getChildren().addAll(vBox, tradeFeeToggleButtonBox);
    hBox.setMinHeight(47);
    hBox.setMaxHeight(hBox.getMinHeight());
    HBox.setHgrow(vBox, Priority.ALWAYS);
    HBox.setHgrow(tradeFeeToggleButtonBox, Priority.NEVER);

    final Tuple2<Label, VBox> tradeInputBox = getTradeInputBox(hBox, Res.get("createOffer.tradeFee.descriptionBSQEnabled"));

    tradeFeeDescriptionLabel = tradeInputBox.first;

    return tradeInputBox.second;
}
 
Example 5
Source File: MilestonePickerDialog.java    From HubTurbo with GNU Lesser General Public License v3.0 5 votes vote down vote up
private HBox createPreviouslyAssignedMilestoneBox() {
    HBox milestoneBox = new HBox();
    milestoneBox.setPrefWidth(120);
    milestoneBox.setPrefHeight(PREV_ASSIGNED_MILESTONE_HEIGHT);
    milestoneBox.setMaxHeight(PREV_ASSIGNED_MILESTONE_HEIGHT);
    milestoneBox.setStyle("-fx-border-radius: 3;-fx-border-style: dotted;-fx-alignment:center");
    return milestoneBox;
}
 
Example 6
Source File: MutableOfferView.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private VBox getTradeFeeFieldsBox() {
    tradeFeeInBtcLabel = new Label();
    tradeFeeInBtcLabel.setMouseTransparent(true);
    tradeFeeInBtcLabel.setId("trade-fee-textfield");

    tradeFeeInBsqLabel = new Label();
    tradeFeeInBsqLabel.setMouseTransparent(true);
    tradeFeeInBsqLabel.setId("trade-fee-textfield");

    VBox vBox = new VBox();
    vBox.setSpacing(6);
    vBox.setMaxWidth(300);
    vBox.setAlignment(DevEnv.isDaoActivated() ? Pos.CENTER_RIGHT : Pos.CENTER_LEFT);
    vBox.getChildren().addAll(tradeFeeInBtcLabel, tradeFeeInBsqLabel);

    tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton();
    tradeFeeInBtcToggle.setText("BTC");
    tradeFeeInBtcToggle.setVisible(false);
    tradeFeeInBtcToggle.setPadding(new Insets(-8, 5, -10, 5));

    tradeFeeInBsqToggle = new AutoTooltipSlideToggleButton();
    tradeFeeInBsqToggle.setText("BSQ");
    tradeFeeInBsqToggle.setVisible(false);
    tradeFeeInBsqToggle.setPadding(new Insets(-9, 5, -9, 5));

    VBox tradeFeeToggleButtonBox = new VBox();
    tradeFeeToggleButtonBox.getChildren().addAll(tradeFeeInBtcToggle, tradeFeeInBsqToggle);

    HBox hBox = new HBox();
    hBox.getChildren().addAll(vBox, tradeFeeToggleButtonBox);
    hBox.setMinHeight(47);
    hBox.setMaxHeight(hBox.getMinHeight());
    HBox.setHgrow(vBox, Priority.ALWAYS);
    HBox.setHgrow(tradeFeeToggleButtonBox, Priority.NEVER);

    final Tuple2<Label, VBox> tradeInputBox = getTradeInputBox(hBox, Res.get("createOffer.tradeFee.descriptionBSQEnabled"));

    tradeFeeDescriptionLabel = tradeInputBox.first;

    return tradeInputBox.second;
}