Example usage for javafx.scene.layout StackPane setPrefSize

List of usage examples for javafx.scene.layout StackPane setPrefSize

Introduction

In this page you can find the example usage for javafx.scene.layout StackPane setPrefSize.

Prototype

public void setPrefSize(double prefWidth, double prefHeight) 

Source Link

Document

Convenience method for overriding the region's computed preferred width and height.

Usage

From source file:de.hs.mannheim.modUro.controller.diagram.fx.ChartViewerSkin.java

/**
 * Creates the node representing this control.
 *
 * @return The node./*www .j  a v  a 2 s .  c om*/
 */
private BorderPane createNode(ChartViewer control) {
    BorderPane borderPane = new BorderPane();
    borderPane.setPrefSize(800, 500);
    StackPane sp = new StackPane();
    sp.setMinSize(10, 10);
    sp.setPrefSize(150, 200);
    this.canvas = new ChartCanvas(getSkinnable().getChart());
    this.canvas.setTooltipEnabled(control.isTooltipEnabled());
    this.canvas.addChartMouseListener(control);
    this.canvas.widthProperty().bind(sp.widthProperty());
    this.canvas.heightProperty().bind(sp.heightProperty());

    this.canvas.addMouseHandler(new ZoomHandlerFX("zoom", control));
    sp.getChildren().add(this.canvas);

    borderPane.setCenter(sp);
    return borderPane;
}