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

The following examples show how to use javafx.scene.layout.Pane#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: CComponentBand.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public Node getNode(
		PageActionManager actionmanager,
		CPageData inputdata,
		Window parentwindow,
		TabPane[] parenttabpanes,
		CollapsibleNode nodetocollapsewhenactiontriggered) {
	Pane thispane = CComponentBand.returnBandPane(direction);
	this.bandpane = thispane;
	if (this.minwidth != 0)
		thispane.setMinWidth(this.minwidth);
	for (int i = 0; i < elements.size(); i++) {
		Node currentnode = elements.get(i).getNode(actionmanager, inputdata, parentwindow, parenttabpanes,nodetocollapsewhenactiontriggered);
		// if node is null (e.g. CObjectIdStorage), then do not add it to the graphic
		if (currentnode != null)
			thispane.getChildren().add(currentnode);

	}
	
	return thispane;
}
 
Example 2
Source File: DockUIPanel.java    From AnchorFX with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void buildNode(String title, Image iconImage) {

        Objects.requireNonNull(iconImage);
        Objects.requireNonNull(title);
        
        barPanel = new Pane();

        String titleBarStyle = (!subStationStype) ? "docknode-title-bar" : "substation-title-bar";

        barPanel.getStyleClass().add(titleBarStyle);

        barPanel.setPrefHeight(BAR_HEIGHT);
        barPanel.relocate(0, 0);
        barPanel.prefWidthProperty().bind(widthProperty());

        titleLabel = new Label(title);

        String titleTextStyle = (!subStationStype) ? "docknode-title-text" : "substation-title-text";
        
        iconView = new ImageView(iconImage);
        iconView.setFitWidth(15);
        iconView.setFitHeight(15);
        iconView.setPreserveRatio(false);
        iconView.setSmooth(true);
        iconView.relocate(1,(BAR_HEIGHT-iconView.getFitHeight()) / 2);
         
        titleLabel.getStyleClass().add(titleTextStyle);
        barPanel.getChildren().addAll(iconView,titleLabel);
        titleLabel.relocate(25, 5);

        contentPanel = new StackPane();
        contentPanel.getStyleClass().add("docknode-content-panel");
        contentPanel.relocate(0, BAR_HEIGHT);
        contentPanel.prefWidthProperty().bind(widthProperty());
        contentPanel.prefHeightProperty().bind(heightProperty().subtract(BAR_HEIGHT));
        contentPanel.getChildren().add(nodeContent);
        
        contentPanel.setCache(true);
        contentPanel.setCacheHint(CacheHint.SPEED);
        
        if (nodeContent instanceof Pane)
        {
            Pane nodeContentPane = (Pane)nodeContent;
            nodeContentPane.setMinHeight(USE_COMPUTED_SIZE);
            nodeContentPane.setMinWidth(USE_COMPUTED_SIZE);
            nodeContentPane.setMaxWidth(USE_COMPUTED_SIZE);
            nodeContentPane.setMaxHeight(USE_COMPUTED_SIZE);
        }

        getChildren().addAll(barPanel, contentPanel);
    }