private void resize() {
        width  = getSkinnable().getWidth();
        height = getSkinnable().getHeight();
        if (getSkinnable().isKeepAspect()) {
            if (aspectRatio * width > height) {
                width = 1 / (aspectRatio / height);
            } else if (1 / (aspectRatio / height) > width) {
                height = aspectRatio * width;
            }
        }

        if (width > 0 && height > 0) {
            main.setPrefSize(width, height);
            mainInnerShadow0.setRadius(3.0 / 132.0 * height);
            mainInnerShadow1.setRadius(2.0 / 132.0 * height);

            if (crystalOverlay.isVisible()) {
                crystalClip.setWidth(width);
                crystalClip.setHeight(height);
                crystalOverlay.setImage(createNoiseImage(width, height, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8));
                crystalOverlay.setCache(true);
            }

            threshold.setPrefSize(0.20 * height, 0.20 * height);
            threshold.setTranslateX(0.027961994662429348 * width);
            threshold.setTranslateY(0.75 * height - 2);

            trendDown.setPrefSize(0.06718573425755356 * width, 0.1333622932434082 * height);
            trendDown.setTranslateX(0.1439393939 * width);
            trendDown.setTranslateY(0.8125 * height - 2);

            trendFalling.setPrefSize(0.06982171896732214 * width, 0.13879903157552084 * height);
            trendFalling.setTranslateX(0.1439393939 * width);
            trendFalling.setTranslateY(0.8061291376749674 * height - 2);

            trendSteady.setPrefSize(0.0676060878869259 * width, 0.1342292626698812 * height);
            trendSteady.setTranslateX(0.1439393939 * width);
            trendSteady.setTranslateY(0.8078853289286295 * height - 2);

            trendRising.setPrefSize(0.06982171896732214 * width, 0.13879903157552084 * height);
            trendRising.setTranslateX(0.1439393939 * width);
            trendRising.setTranslateY(0.8050718307495117 * height - 2);

            trendUp.setPrefSize(0.06718573425755356 * width, 0.1333622932434082 * height);
            trendUp.setTranslateX(0.1439393939 * width);
            trendUp.setTranslateY(0.8041377067565918 * height - 2);

            battery.setPrefSize(0.0833333333 * width, 0.1458333333 * height);
            battery.setTranslateX(0.6439393939 * width);
            battery.setTranslateY(0.81 * height - 2);

            signal.setPrefSize(0.0416666667 * height, 0.5 * height);
            signal.setTranslateX(0.0151515152 * width);
            signal.setTranslateY(0.25 * height);

            alarm.setPrefSize(0.1666666667 * height, 0.1666666667 * height);
            alarm.setTranslateX(0.2651515152 * width);
            alarm.setTranslateY(0.7916666667 * height - 2);

            updateFonts();

            // Setup the lcd unit
            unitText.setFont(unitFont);
            unitText.setTextOrigin(VPos.BASELINE);
            unitText.setTextAlignment(TextAlignment.RIGHT);

            unitText.setText(getSkinnable().getUnit());
            if (unitText.visibleProperty().isBound()) {
                unitText.visibleProperty().unbind();
            }
            unitText.visibleProperty().bind(getSkinnable().unitVisibleProperty());

            valueOffsetLeft = height * 0.04;

            if (getSkinnable().isUnitVisible()) {
                unitText.setX((width - unitText.getLayoutBounds().getWidth()) - height * 0.04);
                unitText.setY(height - (text.getLayoutBounds().getHeight() * digitalFontSizeFactor) * 0.5);
                valueOffsetRight = (unitText.getLayoutBounds().getWidth() + height * 0.0833333333); // distance between value and unit
                text.setX(width - 2 - text.getLayoutBounds().getWidth() - valueOffsetRight);
            } else {
                valueOffsetRight = height * 0.0833333333;
                text.setX((width - text.getLayoutBounds().getWidth()) - valueOffsetRight);
            }
            text.setY(height - (text.getLayoutBounds().getHeight() * digitalFontSizeFactor) * 0.5);

            // Visualize the lcd semitransparent background text
            updateBackgroundText();

            if (getSkinnable().isUnitVisible()) {
                backgroundText.setX(width - 2 - backgroundText.getLayoutBounds().getWidth() - valueOffsetRight);
            } else {
                backgroundText.setX((width - backgroundText.getLayoutBounds().getWidth()) - valueOffsetRight);
            }
            backgroundText.setY(height - (backgroundText.getLayoutBounds().getHeight() * digitalFontSizeFactor) * 0.5);

            // Setup the font for the lcd title, number system, min measured, max measure and former value
            // Title
            title.setFont(titleFont);
            title.setTextOrigin(VPos.BASELINE);
            title.setTextAlignment(TextAlignment.CENTER);
            title.setText(getSkinnable().getTitle());
            title.setX((width - title.getLayoutBounds().getWidth()) * 0.5);
            title.setY(main.getLayoutY() + title.getLayoutBounds().getHeight() - 0.04 * height + 2);

            // Info Text
            lowerRightText.setFont(smallFont);
            lowerRightText.setTextOrigin(VPos.BASELINE);
            lowerRightText.setTextAlignment(TextAlignment.RIGHT);
            lowerRightText.setText(getSkinnable().getNumberSystem().toString());
            lowerRightText.setX(main.getLayoutX() + (main.getLayoutBounds().getWidth() - lowerRightText.getLayoutBounds().getWidth()) * 0.5);
            lowerRightText.setY(main.getLayoutY() + height - 3 - 0.0416666667 * height);

            // Min measured value
            upperLeftText.setFont(smallFont);
            upperLeftText.setTextOrigin(VPos.BASELINE);
            upperLeftText.setTextAlignment(TextAlignment.RIGHT);
            upperLeftText.setX(main.getLayoutX() + 0.0416666667 * height);
            upperLeftText.setY(main.getLayoutY() + upperLeftText.getLayoutBounds().getHeight() - 0.04 * height + 2);

            // Max measured value
            upperRightText.setFont(smallFont);
            upperRightText.setTextOrigin(VPos.BASELINE);
            upperRightText.setTextAlignment(TextAlignment.RIGHT);
            upperRightText.setY(main.getLayoutY() + upperRightText.getLayoutBounds().getHeight() - 0.04 * height + 2);

            // Former value
            lowerCenterText.setFont(smallFont);
            lowerCenterText.setTextOrigin(VPos.BASELINE);
            lowerCenterText.setTextAlignment(TextAlignment.CENTER);
            lowerCenterText.setX((width - lowerCenterText.getLayoutBounds().getWidth()) * 0.5);
            lowerCenterText.setY(main.getLayoutY() + height - 3 - 0.0416666667 * height);
        }
    }