Example usage for javafx.geometry Rectangle2D getHeight

List of usage examples for javafx.geometry Rectangle2D getHeight

Introduction

In this page you can find the example usage for javafx.geometry Rectangle2D getHeight.

Prototype

public double getHeight() 

Source Link

Document

The height of this Rectangle2D .

Usage

From source file:snpviewer.SnpViewer.java

private void fixStageSize(Stage stage, boolean fix) {
    /*provides a fix for annoying bug which means that 
     * setResizable(false) causing windows to grow in size in Windows
     *//*from w  ww .  ja  va2 s  .c  o m*/
    if (fix) {
        stage.setMaxHeight(stage.getHeight());
        stage.setMinHeight(stage.getHeight());
        stage.setMaxWidth(stage.getWidth());
        stage.setMinWidth(stage.getWidth());
    } else {
        Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
        stage.setMaxHeight(primaryScreenBounds.getHeight());
        stage.setMinHeight(300);
        stage.setMaxWidth(primaryScreenBounds.getWidth());
        stage.setMinWidth(500);
    }
}