Java code for global map generation