@Override protected void initGraphics() {
        // Set initial size
        if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
            Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
            if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
                clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
            } else {
                clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        sectionsAndAreasCtx    = sectionsAndAreasCanvas.getGraphicsContext2D();

        tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        tickCtx    = tickCanvas.getGraphicsContext2D();

        alarmPane = new Pane();

        hour  = new Path();
        hour.setFillRule(FillRule.EVEN_ODD);
        hour.setStroke(null);
        hour.getTransforms().setAll(hourRotate);

        minute = new Path();
        minute.setFillRule(FillRule.EVEN_ODD);
        minute.setStroke(null);
        minute.getTransforms().setAll(minuteRotate);

        second = new Path();
        second.setFillRule(FillRule.EVEN_ODD);
        second.setStroke(null);
        second.getTransforms().setAll(secondRotate);
        second.setVisible(clock.isSecondsVisible());
        second.setManaged(clock.isSecondsVisible());

        centerDot = new Circle();
        centerDot.setFill(Color.WHITE);

        dropShadow = new DropShadow();
        dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
        dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
        dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
        dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

        shadowGroupHour   = new Group(hour);
        shadowGroupMinute = new Group(minute);
        shadowGroupSecond = new Group(second);

        shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
        shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null);
        shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null);

        title = new Text("");
        title.setVisible(clock.isTitleVisible());
        title.setManaged(clock.isTitleVisible());

        dateText = new Text("");
        dateText.setVisible(clock.isDateVisible());
        dateText.setManaged(clock.isDateVisible());

        dateNumber = new Text("");
        dateNumber.setVisible(clock.isDateVisible());
        dateNumber.setManaged(clock.isDateVisible());

        text = new Text("");
        text.setVisible(clock.isTextVisible());
        text.setManaged(clock.isTextVisible());

        pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, dateNumber, text, shadowGroupMinute, shadowGroupHour, shadowGroupSecond, centerDot);
        pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
        pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

        getChildren().setAll(pane);
    }
@ Override protected void initGraphics ( ) { if ( Double . compare ( clock . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( clock . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( clock . getHeight ( ) , 0.0 ) <= 0 ) { if ( clock . getPrefWidth ( ) > 0 && clock . getPrefHeight ( ) > 0 ) { clock . setPrefSize ( clock . getPrefWidth ( ) , clock . getPrefHeight ( ) ) ; } else { clock . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } sectionsAndAreasCanvas = new Canvas ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; sectionsAndAreasCtx = sectionsAndAreasCanvas . getGraphicsContext2D ( ) ; tickCanvas = new Canvas ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; tickCtx = tickCanvas . getGraphicsContext2D ( ) ; alarmPane = new Pane ( ) ; hour = new Path ( ) ; hour . setFillRule ( FillRule . EVEN_ODD ) ; hour . setStroke ( null ) ; hour . getTransforms ( ) . setAll ( hourRotate ) ; minute = new Path ( ) ; minute . setFillRule ( FillRule . EVEN_ODD ) ; minute . setStroke ( null ) ; minute . getTransforms ( ) . setAll ( minuteRotate ) ; second = new Path ( ) ; second . setFillRule ( FillRule . EVEN_ODD ) ; second . setStroke ( null ) ; second . getTransforms ( ) . setAll ( secondRotate ) ; second . setVisible ( clock . isSecondsVisible ( ) ) ; second . setManaged ( clock . isSecondsVisible ( ) ) ; centerDot = new Circle ( ) ; centerDot . setFill ( Color . WHITE ) ; dropShadow = new DropShadow ( ) ; dropShadow . setColor ( Color . rgb ( 0 , 0 , 0 , 0.25 ) ) ; dropShadow . setBlurType ( BlurType . TWO_PASS_BOX ) ; dropShadow . setRadius ( 0.015 * PREFERRED_WIDTH ) ; dropShadow . setOffsetY ( 0.015 * PREFERRED_WIDTH ) ; shadowGroupHour = new Group ( hour ) ; shadowGroupMinute = new Group ( minute ) ; shadowGroupSecond = new Group ( second ) ; shadowGroupHour . setEffect ( clock . getShadowsEnabled ( ) ? dropShadow : null ) ; shadowGroupMinute . setEffect ( clock . getShadowsEnabled ( ) ? dropShadow : null ) ; shadowGroupSecond . setEffect ( clock . getShadowsEnabled ( ) ? dropShadow : null ) ; title = new Text ( "" ) ; title . setVisible ( clock . isTitleVisible ( ) ) ; title . setManaged ( clock . isTitleVisible ( ) ) ; dateText = new Text ( "" ) ; dateText . setVisible ( clock . isDateVisible ( ) ) ; dateText . setManaged ( clock . isDateVisible ( ) ) ; dateNumber = new Text ( "" ) ; dateNumber . setVisible ( clock . isDateVisible ( ) ) ; dateNumber . setManaged ( clock . isDateVisible ( ) ) ; text = new Text ( "" ) ; text . setVisible ( clock . isTextVisible ( ) ) ; text . setManaged ( clock . isTextVisible ( ) ) ; pane = new Pane ( sectionsAndAreasCanvas , tickCanvas , alarmPane , title , dateText , dateNumber , text , shadowGroupMinute , shadowGroupHour , shadowGroupSecond , centerDot ) ; pane . setBorder ( new Border ( new BorderStroke ( clock . getBorderPaint ( ) , BorderStrokeStyle . SOLID , new CornerRadii ( 1024 ) , new BorderWidths ( clock . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( clock . getBackgroundPaint ( ) , new CornerRadii ( 1024 ) , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ; }
******************** Initialization ************************************