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

The following examples show how to use javafx.scene.layout.HBox#setMinHeight() . 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: NotificationBarPane.java    From thundernetwork with GNU Affero General Public License v3.0 6 votes vote down vote up
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 2
Source File: NotificationBarPane.java    From devcoretalk with GNU General Public License v2.0 6 votes vote down vote up
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: NotificationBarPane.java    From GreenBits with GNU General Public License v3.0 6 votes vote down vote up
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 4
Source File: NotificationBarPane.java    From thunder with GNU Affero General Public License v3.0 6 votes vote down vote up
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 5
Source File: NotificationBarPane.java    From green_android with GNU General Public License v3.0 6 votes vote down vote up
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: 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 7
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 8
Source File: FindFrame.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {
	this.setTitle("查找");
	this.setWidth(900);
	this.setHeight(600);
	this.setTitlePaneStyle(2);
	this.setRadius(5);
	BorderPane rootBox = new BorderPane();
	this.setCenter(rootBox);
	this.setResizable(false);

	HBox hBox = new HBox();
	hBox.setMinHeight(50);
	// rootBox.getChildren().add(hBox);
	// rootBox.getChildren().add(tabPanel);
	rootBox.setTop(hBox);
	rootBox.setCenter(tabPanel);

	Image normalImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");
	Image hoverImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");
	Image selectedImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");

	tabPanel.add("找人", Font.font("微软雅黑", 16), Color.WHITE, normalImage, hoverImage, selectedImage, findUserPanel);

	normalImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");
	hoverImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");
	selectedImage = ImageBox.getImageClassPath("/classics/images/find/[email protected]");

	tabPanel.add("找群", Font.font("微软雅黑", 16), Color.WHITE, normalImage, hoverImage, selectedImage, findGroupPanel);
}
 
Example 9
Source File: MultipleListPane.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {

		StackPane logoStackPane = new StackPane();
		logoStackPane.setPadding(new Insets(20, 0, 0, 0));
		logoStackPane.getChildren().add(logoImageView);

		HBox lineHBox = new HBox();
		lineHBox.setMinHeight(1);
		lineHBox.setStyle("-fx-background-color:#ed3a3a;");

		textLabel.setStyle("-fx-text-fill:rgba(255, 255, 255, 1);-fx-font-size: 16px;");

		HBox textLabelHBox = new HBox();
		textLabelHBox.setAlignment(Pos.CENTER);
		textLabelHBox.getChildren().add(textLabel);

		loginButton.setText("登录微信");
		loginButton.setPrefSize(220, 35);

		HBox loginButtonHBox = new HBox();
		loginButtonHBox.setPadding(new Insets(0, 4, 10, 4));
		loginButtonHBox.setAlignment(Pos.CENTER);
		loginButtonHBox.getChildren().add(loginButton);

		VBox vBox = new VBox();
		vBox.setSpacing(20);
		vBox.setStyle("-fx-background-color:#26292e;");
		vBox.getChildren().add(logoStackPane);
		vBox.getChildren().add(lineHBox);
		vBox.getChildren().add(textLabelHBox);
		vBox.getChildren().add(loginButtonHBox);

		this.setTop(vBox);
		this.setCenter(listRooPane);
		this.setStyle("-fx-background-color:#2e3238;");
	}
 
Example 10
Source File: UiUtils.java    From jmonkeybuilder with Apache License 2.0 5 votes vote down vote up
/**
 * Update an edited cell.
 *
 * @param cell the edited cell.
 */
@FxThread
public static void updateEditedCell(final Labeled cell) {

    final javafx.scene.Node graphic = cell.getGraphic();

    if (graphic instanceof HBox) {
        final HBox hbox = (HBox) graphic;
        hbox.setAlignment(Pos.CENTER_LEFT);
        hbox.setMinHeight(cell.getMinHeight());
    }
}
 
Example 11
Source File: QueryListPaneFrame.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {
	this.setTitle("设备列表");
	this.setResizable(false);
	this.setWidth(960);
	this.setHeight(600);
	this.setTitlePaneStyle(2);
	this.setRadius(5);
	BorderPane rootPane = new BorderPane();
	this.setCenter(rootPane);

	Label titleLabel = new Label();
	titleLabel.setText("设备列表");
	titleLabel.setFont(Font.font("微软雅黑", 30));
	titleLabel.setStyle("-fx-text-fill:rgba(255, 255, 255, 1)");

	HBox hBox = new HBox();
	hBox.setMinHeight(35);
	hBox.setStyle("-fx-background-color:rgba(18, 98, 217, 1)");
	
	hBox.getChildren().add(titleLabel);
	

	
	rootPane.setTop(hBox);
	rootPane.setCenter(queryListPane);
	this.showWaiting(false, WaitingPane.show_waiting);
	this.setPage(0, 1);
}
 
Example 12
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 13
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;
}
 
Example 14
Source File: WebFrame.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {
	this.setBackground("Resources/Images/Wallpaper/12.jpg");
	this.setTitle("登录");
	this.setMinWidth(320);
	this.setMinHeight(240);

	this.setWidth(800);
	this.setHeight(480);

	VBox rootBox = new VBox();
	this.setCenter(rootBox);

	// webView.setPrefSize(430, 180);

	Label titleLabel = new Label();
	// titleLabel.setText("设备列表");
	titleLabel.setFont(Font.font("微软雅黑", 30));
	titleLabel.setStyle("-fx-text-fill:rgba(255, 255, 255, 1)");

	HBox hBox = new HBox();
	hBox.setMinHeight(30);
	hBox.setStyle("-fx-background-color:rgba(18, 98, 217, 1)");

	hBox.getChildren().add(titleLabel);

	rootBox.setStyle("-fx-background-color:rgba(255, 255, 255, 0.2)");
	rootBox.getChildren().add(hBox);
	rootBox.getChildren().add(webView);
	WebEngine webEngine = webView.getEngine();
	webEngine.locationProperty().addListener(new ChangeListener<String>() {
		@Override
		public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
			System.out.println(newValue);

			// File file = new File(System.getProperty("user.home") +
			// "/Downloads/Ekko Downloads/");
			// String[] downloadableExtensions = {".doc", ".xls", ".zip",
			// ".exe", ".rar", ".pdf", ".jar", ".png", ".jpg", ".gif"};
			// for(String downloadAble : downloadableExtensions) {
			// if (newValue.endsWith(downloadAble)) {
			// try {
			// if(!file.exists()) {
			// file.mkdir();
			// }
			// File download = new File(file + "/" + newValue);
			// if(download.exists()) {
			// Dialogs.create().title("Exists").message("What you're trying
			// to download already exists").showInformation();
			// return;
			// }
			// Dialogs.create().title("Downloading").message("Started
			// Downloading").showInformation();
			// FileUtils.copyURLToFile(new URL(engine.getLocation()),
			// download);
			// Dialogs.create().title("Download").message("Download is
			// completed your download will be in: " +
			// file.getAbsolutePath()).showInformation();
			// } catch(Exception e) {
			// e.printStackTrace();
			// }
			// }
			// }
		}
	});
}
 
Example 15
Source File: ChatPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {

		textLabel.setStyle("-fx-font-size: 16px;");

		HBox line = new HBox();
		line.setMinHeight(1);
		line.setStyle("-fx-background-color:#d6d6d6;");

		middleToolBarBox.setPadding(new Insets(10, 0, 0, 20));
		middleToolBarBox.setMinHeight(25);
		middleToolBarBox.setSpacing(10);
		middleToolBarBox.setAlignment(Pos.CENTER_LEFT);

		VBox writeTempBox = new VBox();

		writeTempBox.getChildren().add(line);
		writeTempBox.getChildren().add(middleToolBarBox);

		chatShowPane.setStyle("-fx-background-color:#f5f5f5;");
		writeBorderPane.setStyle("-fx-background-color:#ffffff;");

		writeBorderPane.setTop(writeTempBox);
		writeBorderPane.setCenter(chatWritePane);

		splitPane.setTop(chatShowPane);
		splitPane.setBottom(writeBorderPane);
		splitPane.setPrefWidth(780);

		HBox textHBox = new HBox();
		textHBox.setPadding(new Insets(28, 0, 15, 28));
		textHBox.setAlignment(Pos.CENTER_LEFT);
		textHBox.getChildren().add(textLabel);

		topRightButtonBox.setAlignment(Pos.CENTER_RIGHT);
		topRightButtonBox.setPadding(new Insets(25, 20, 0, 0));

		VBox topRightButtonVBox = new VBox();
		topRightButtonVBox.setAlignment(Pos.CENTER);
		topRightButtonVBox.getChildren().add(topRightButtonBox);

		BorderPane topBorderPane = new BorderPane();
		topBorderPane.setCenter(textHBox);
		topBorderPane.setRight(topRightButtonVBox);

		HBox topLine = new HBox();
		topLine.setMinHeight(1);
		topLine.setStyle("-fx-background-color:#d6d6d6;");

		VBox topVBox = new VBox();
		topVBox.setPadding(new Insets(0, 0, 0, 0));
		topVBox.getChildren().add(topBorderPane);
		topVBox.getChildren().add(topLine);

		sendButton.setText("发送");

		sendButton.setPrefSize(72, 24);
		sendButton.setFocusTraversable(false);

		bottomButtonBox.setStyle("-fx-background-color:#ffffff;");
		bottomButtonBox.setPadding(new Insets(0, 15, 0, 0));
		bottomButtonBox.setSpacing(5);
		bottomButtonBox.setAlignment(Pos.CENTER_RIGHT);
		bottomButtonBox.setMinHeight(40);
		bottomButtonBox.getChildren().add(sendButton);

		BorderPane borderPane = new BorderPane();
		borderPane.setCenter(splitPane);
		borderPane.setBottom(bottomButtonBox);

		baseBorderPane.setTop(topVBox);
		baseBorderPane.setCenter(borderPane);

		this.getChildren().add(baseBorderPane);
	}
 
Example 16
Source File: ChatPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {

		HBox line = new HBox();
		line.setMinHeight(1);
		line.setStyle("-fx-background-color:#d6d6d6;");

		middleToolBarBox.setPadding(new Insets(5, 0, 0, 15));
		middleToolBarBox.setMinHeight(25);
		middleToolBarBox.setSpacing(10);
		middleToolBarBox.setAlignment(Pos.CENTER_LEFT);

		VBox writeTempBox = new VBox();

		writeTempBox.getChildren().add(line);
		writeTempBox.getChildren().add(middleToolBarBox);

		// chatShowPane.setStyle("-fx-background-color:#f5f5f5;");
		// writeBorderPane.setStyle("-fx-background-color:#ffffff;");
		chatShowPane.setStyle("-fx-background-color:rgba(250, 250, 250, 0.9)");
		writeBorderPane.setStyle("-fx-background-color:rgba(250, 250, 250, 0.9)");

		writeBorderPane.setTop(writeTempBox);
		writeBorderPane.setCenter(chatWritePane);

		splitPane.setTop(chatShowPane);
		splitPane.setBottom(writeBorderPane);
		splitPane.setPrefWidth(780);

		sendButton.setText("发送");

		sendButton.setPrefSize(72, 24);
		sendButton.setFocusTraversable(false);

		bottomButtonBox.setStyle("-fx-background-color:rgba(250, 250, 250, 0.9)");
		bottomButtonBox.setPadding(new Insets(0, 15, 0, 0));
		bottomButtonBox.setSpacing(5);
		bottomButtonBox.setAlignment(Pos.CENTER_RIGHT);
		bottomButtonBox.setMinHeight(40);
		bottomButtonBox.getChildren().add(sendButton);

		BorderPane borderPane = new BorderPane();
		borderPane.setCenter(splitPane);
		borderPane.setBottom(bottomButtonBox);

		baseBorderPane.setTop(chatTopPane);
		baseBorderPane.setCenter(borderPane);

		this.getChildren().add(baseBorderPane);
	}
 
Example 17
Source File: ChatTopPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {
	this.getChildren().add(baseBorderPane);

	nameLabel.setStyle("-fx-font-size:18px;");

	nameHBox.getChildren().add(nameLabel);
	textHBox.getChildren().add(textLabel);

	VBox infoVBox = new VBox();
	infoVBox.setPadding(new Insets(10, 0, 5, 28));
	infoVBox.getChildren().add(nameHBox);
	infoVBox.getChildren().add(textHBox);

	// this.setPadding(new Insets(0, 0, 0, 8));

	// textBox.setStyle("-fx-background-color:rgba(255, 255, 255, 0.92)");

	toolBar.setBackground(Background.EMPTY);
	//toolBar.setPadding(new Insets(0, 0, 0, 0));
	toolBar.setPadding(new Insets(0, 0, 0, 28));
	
	rightToolBox.setAlignment(Pos.CENTER_RIGHT);

	
	HBox toolHBox = new HBox();
	
	toolHBox.setAlignment(Pos.CENTER_LEFT);
	toolHBox.getChildren().add(toolBar);
	
	BorderPane toolBorderPane = new BorderPane();
	toolBorderPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.9)");
	toolBorderPane.setCenter(toolHBox);
	toolBorderPane.setRight(rightToolBox);
	
	HBox topLine = new HBox();
	topLine.setMinHeight(1);
	topLine.setStyle("-fx-background-color:#d6d6d6;");

	VBox topVBox = new VBox();
	topVBox.setPadding(new Insets(0, 0, 0, 0));
	topVBox.getChildren().add(infoVBox);
	topVBox.getChildren().add(topLine);
	
	baseBorderPane.setCenter(topVBox);
	baseBorderPane.setBottom(toolBorderPane);
}
 
Example 18
Source File: ChatPanel.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {
	this.setTop(topPane);
	this.setCenter(showSplitPane);
	this.setRight(rightPane);

	//rightPane.setPrefWidth(140);
	//rightPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.5)");

	topPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.2)");
	topPane.setPrefHeight(80);
	topPane.getChildren().add(topPanel);

	WebView webView = showPanel.getWebView();
	webView.setPrefWidth(20);
	webView.setPrefHeight(50);

	showSplitPane.setTop(showBox);
	showSplitPane.setBottom(writeBox);
	showSplitPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.9)");

	showBox.getChildren().add(webView);
	VBox.setVgrow(webView, Priority.ALWAYS);

	HBox line = new HBox();
	line.setMinHeight(1);
	line.setStyle("-fx-background-color:rgba(180, 180, 180, 1);");

	middleToolBarBox.setMinHeight(25);
	middleToolBarBox.setSpacing(8);
	middleToolBarBox.setAlignment(Pos.CENTER_LEFT);

	rightFunctionBox.setPadding(new Insets(0, 5, 0, 0));
	
	HBox functionRootBox = new HBox();

	functionRootBox.setAlignment(Pos.CENTER_RIGHT);

	functionRootBox.getChildren().add(middleToolBarBox);
	functionRootBox.getChildren().add(rightFunctionBox);

	HBox.setHgrow(middleToolBarBox, Priority.ALWAYS);

	VBox writeTempBox = new VBox();

	writeTempBox.getChildren().add(line);
	writeTempBox.getChildren().add(functionRootBox);

	writeBox.getChildren().add(writeTempBox);
	writeBox.getChildren().add(writePanel);
	writeBox.getChildren().add(bottomButtonBox);

	fontBox.setMinHeight(25);
	fontBox.setSpacing(2);

	bottomButtonBox.setPadding(new Insets(0, 15, 0, 0));
	bottomButtonBox.setSpacing(5);
	bottomButtonBox.setAlignment(Pos.CENTER_RIGHT);
	bottomButtonBox.setMinHeight(40);

	closeButton.setText("关闭");
	sendButton.setText("发送");

	closeButton.setPrefSize(72, 24);
	sendButton.setPrefSize(72, 24);

	closeButton.setFocusTraversable(false);
	sendButton.setFocusTraversable(false);

	bottomButtonBox.getChildren().add(closeButton);
	bottomButtonBox.getChildren().add(sendButton);

}
 
Example 19
Source File: NodeChatPane.java    From oim-fx with MIT License 4 votes vote down vote up
private void initComponent() {
	this.getChildren().add(rootPane);

	topPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.7)");
	topPane.setPrefHeight(80);
	topPane.getChildren().add(topPanel);

	//rightPane.setPrefWidth(140);
	//rightPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.5)");

	showBox.getChildren().add(messageList);
	splitPane.setId("hiddenSplitter");
	HBox line = new HBox();
	line.setMinHeight(1);
	line.setStyle("-fx-background-color:rgba(180, 180, 180, 1);");

	middleToolBarBox.setMinHeight(25);
	middleToolBarBox.setSpacing(8);
	middleToolBarBox.setAlignment(Pos.CENTER_LEFT);

	HBox functionRootBox = new HBox();
	functionRootBox.setAlignment(Pos.CENTER_RIGHT);

	functionRootBox.getChildren().add(middleToolBarBox);
	functionRootBox.getChildren().add(rightFunctionBox);

	HBox.setHgrow(middleToolBarBox, Priority.ALWAYS);

	fontBox.setMinHeight(25);
	fontBox.setSpacing(2);

	closeButton.setText("关闭");
	sendButton.setText("发送");

	closeButton.setPrefSize(72, 24);
	sendButton.setPrefSize(72, 24);

	closeButton.setFocusTraversable(false);
	sendButton.setFocusTraversable(false);

	bottomButtonBox.setPadding(new Insets(0, 15, 0, 0));
	bottomButtonBox.setSpacing(5);
	bottomButtonBox.setAlignment(Pos.CENTER_RIGHT);
	bottomButtonBox.setMinHeight(40);

	bottomButtonBox.getChildren().add(closeButton);
	bottomButtonBox.getChildren().add(sendButton);

	textArea.setBorder(Border.EMPTY);
	textArea.getStyleClass().clear();
	textArea.setWrapText(true);

	VBox writeTempBox = new VBox();

	writeTempBox.getChildren().add(line);
	writeTempBox.getChildren().add(functionRootBox);

	writeTopPane.setCenter(writeTempBox);

	// writePane.setPrefHeight(150);

	writePane.setTop(writeTopPane);
	writePane.setCenter(textArea);
	writePane.setBottom(bottomButtonBox);

	// splitPane.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);

	splitPane.getItems().add(messageList);
	splitPane.getItems().add(writePane);
	splitPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.9)");

	// splitPane.setDividerPosition(0,0.8f);
	splitPane.setDividerPositions(0.7f, 0.3f);
	splitPane.setOrientation(Orientation.VERTICAL);

	rootPane.setTop(topPane);
	rootPane.setCenter(splitPane);
	rootPane.setRight(rightPane);
}
 
Example 20
Source File: SimpleChatPanel.java    From oim-fx with MIT License 2 votes vote down vote up
private void initComponent() {
	this.setCenter(showSplitPane);

	WebView webView = showPanel.getWebView();
	webView.setPrefWidth(20);
	webView.setPrefHeight(50);

	showSplitPane.setTop(showBox);
	showSplitPane.setBottom(writeBox);
	showSplitPane.setStyle("-fx-background-color:rgba(255, 255, 255, 0.9)");

	showBox.getChildren().add(webView);
	VBox.setVgrow(webView, Priority.ALWAYS);

	HBox line = new HBox();
	line.setMinHeight(1);
	line.setStyle("-fx-background-color:rgba(236, 239, 243, 1);");

	middleToolBarBox.setMinHeight(25);
	middleToolBarBox.setSpacing(8);
	middleToolBarBox.setAlignment(Pos.CENTER_LEFT);

	rightFunctionBox.setPadding(new Insets(0, 5, 0, 0));

	

	middleBox.setAlignment(Pos.CENTER_RIGHT);

	middleBox.getChildren().add(middleToolBarBox);
	middleBox.getChildren().add(rightFunctionBox);

	HBox.setHgrow(middleToolBarBox, Priority.ALWAYS);

	VBox writeTempBox = new VBox();

	writeTempBox.getChildren().add(line);
	writeTempBox.getChildren().add(middleBox);

	writeBox.getChildren().add(writeTempBox);
	writeBox.getChildren().add(writePanel);
	writeBox.getChildren().add(bottomButtonBox);

	fontBox.setMinHeight(25);
	fontBox.setSpacing(2);

	bottomButtonBox.setSpacing(5);
	bottomButtonBox.setPadding(new Insets(0, 15, 0, 0));
	bottomButtonBox.setAlignment(Pos.CENTER_RIGHT);
	bottomButtonBox.setMinHeight(40);

	sendButton.setText("发送");

	sendButton.setPrefSize(72, 24);

	sendButton.setFocusTraversable(false);

	bottomButtonBox.getChildren().add(sendButton);
}