@Override protected void initGraphics() {
        super.initGraphics();

        mouseHandler     = event -> { if (event.getClickCount() == 2) { centerLocation(); } };
        locationListener = e -> redraw();
        poiListener      = c -> {
            while (c.next()) {
                if (c.wasPermutated()) {      // Get items that have been permutated in list
                    for (int i = c.getFrom(); i < c.getTo(); ++i) {
                        updatePoi(tile.getPoiList().get(i));
                    }
                } else if (c.wasUpdated()) {  // Get items that have been updated in list
                    for (int i = c.getFrom(); i < c.getTo(); ++i) {
                        updatePoi(tile.getPoiList().get(i));
                    }
                } else if (c.wasAdded()) {
                    c.getAddedSubList().forEach(poi -> addPoi(poi));
                } else if (c.wasRemoved()) {
                    c.getRemoved().forEach(poi -> removePoi(poi));
                }
            }
        };

        titleText = new Text();
        titleText.setFill(tile.getTitleColor());
        Helper.enableNode(titleText, !tile.getTitle().isEmpty());

        text = new Text(tile.getText());
        text.setFill(tile.getTextColor());
        Helper.enableNode(text, tile.isTextVisible());

        webView = new WebView();
        webView.setMinSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
        webView.setMaxSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
        webView.setPrefSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
        webEngine = webView.getEngine();
        webEngine.getLoadWorker().stateProperty().addListener((ov, o, n) -> {
            if (Worker.State.SUCCEEDED == n) {
                readyToGo = true;
                if (MapProvider.BW != tile.getMapProvider()) { changeMapProvider(tile.getMapProvider()); }
                updateLocation();
                updateLocationColor();
                tile.getPoiList().forEach(poi -> addPoi(poi));
                addTrack(tile.getTrack());
                updateTrackColor();
            }
        });
        URL maps = Tile.class.getResource("osm.html");
        webEngine.load(maps.toExternalForm());

        getPane().getChildren().addAll(titleText, webView, text);
    }
@ Override protected void initGraphics ( ) { super . initGraphics ( ) ; mouseHandler = event -> { if ( event . getClickCount ( ) == 2 ) { centerLocation ( ) ; } } ; locationListener = e -> redraw ( ) ; poiListener = c -> { while ( c . next ( ) ) { if ( c . wasPermutated ( ) ) { for ( int i = c . getFrom ( ) ; i < c . getTo ( ) ; ++ i ) { updatePoi ( tile . getPoiList ( ) . get ( i ) ) ; } } else if ( c . wasUpdated ( ) ) { for ( int i = c . getFrom ( ) ; i < c . getTo ( ) ; ++ i ) { updatePoi ( tile . getPoiList ( ) . get ( i ) ) ; } } else if ( c . wasAdded ( ) ) { c . getAddedSubList ( ) . forEach ( poi -> addPoi ( poi ) ) ; } else if ( c . wasRemoved ( ) ) { c . getRemoved ( ) . forEach ( poi -> removePoi ( poi ) ) ; } } } ; titleText = new Text ( ) ; titleText . setFill ( tile . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! tile . getTitle ( ) . isEmpty ( ) ) ; text = new Text ( tile . getText ( ) ) ; text . setFill ( tile . getTextColor ( ) ) ; Helper . enableNode ( text , tile . isTextVisible ( ) ) ; webView = new WebView ( ) ; webView . setMinSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; webView . setMaxSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; webView . setPrefSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; webEngine = webView . getEngine ( ) ; webEngine . getLoadWorker ( ) . stateProperty ( ) . addListener ( ( ov , o , n ) -> { if ( Worker . State . SUCCEEDED == n ) { readyToGo = true ; if ( MapProvider . BW != tile . getMapProvider ( ) ) { changeMapProvider ( tile . getMapProvider ( ) ) ; } updateLocation ( ) ; updateLocationColor ( ) ; tile . getPoiList ( ) . forEach ( poi -> addPoi ( poi ) ) ; addTrack ( tile . getTrack ( ) ) ; updateTrackColor ( ) ; } } ) ; URL maps = Tile . class . getResource ( "osm.html" ) ; webEngine . load ( maps . toExternalForm ( ) ) ; getPane ( ) . getChildren ( ) . addAll ( titleText , webView , text ) ; }
******************** Initialization ************************************