public FirstWin() {
        initComponents();

        try {
            mapModel = new MapModel ();
            mapView = new MapView ( mapModel );
            windowModel = new WindowModel ( mapView );
        } catch ( Exception e ) {
            e.printStackTrace ( System.err );
        }
        //drawSpace.setBackground(Color.yellow);// I CHANGED
        windowModel.setDrawSpace ( drawSpace );
        

        HexEventRegister.getInstance ().registerHandlerForEvent (
            RedrawTile.class,
            new HexEventHandler < RedrawTile > () {
                @Override
                public void handle ( RedrawTile event ) throws Exception {
                    TileModel tile = event.getTile ();

                    if ( tile == null )
                        throw new Exception ( "Tile bound the redraw event is null" );

                    if ( //the tile is not visible in the drawSpace
                        (
                            tile.getEndX () < windowModel.getOffsetX () &&
                            tile.getEndY () < windowModel.getOffsetY ()
                        ) ||
                        (
                            tile.getStartX () > windowModel.getOffsetX () + drawSpace.getWidth () &&
                            tile.getStartY () > windowModel.getOffsetY () + drawSpace.getHeight ()
                        )
                    )
                        return; //no need to draw;

                    int mapStartX = Math.max ( tile.getStartX () - windowModel.getOffsetX (), 0 );
                    int mapStartY = Math.max ( tile.getStartY () - windowModel.getOffsetY (), 0 );
                    int mapEndX = Math.min ( tile.getEndX () - windowModel.getOffsetX (), drawSpace.getWidth () );
                    int mapEndY = Math.min ( tile.getEndY () - windowModel.getOffsetY (), drawSpace.getHeight () );

                    int imgStartX = mapStartX + windowModel.getOffsetX ();
                    int imgStartY = mapStartY + windowModel.getOffsetY ();
                    int imgEndX = mapEndX + windowModel.getOffsetX ();
                    int imgEndY = mapEndY + windowModel.getOffsetY ();

                    drawSpace.getGraphics ().drawImage (
                        mapView.getMap (),
                        mapStartX,
                        mapStartY,
                        mapEndX,
                        mapEndY,
                        imgStartX,
                        imgStartY,
                        imgEndX,
                        imgEndY,
                        drawSpace
                    );
                }
            },
            "mapRequest"
        );

        HexEventRegister.getInstance ().registerHandlerForEvent (
            RedrawMap.class,
            new HexEventHandler < RedrawMap > () {
                @Override
                public void handle ( RedrawMap event ) throws Exception {
                    redrawMap ();
                }
            },
            "mapRequest"
        );

        HexEventRegister.getInstance ().registerHandlerForEvent (
            TilesDistance.class,
            new HexEventHandler < TilesDistance > () {
                @Override
                public void handle ( TilesDistance event ) throws Exception {
                    distanceField.setText ( String.valueOf ( event.getDistance () ) );
                }
            }
        );
    }