src/gui/heatmap/ControlPane.java
private HeatMap parseHeatMap(Scanner scanner) {
        Pattern previousDelimiter = scanner.delimiter();
        scanner.useDelimiter("[^0-9]+");
        
        int[][] map = new int[world.xDimension][world.yDimension];
        int max = 0;
        
        for (int y = 0; y < world.yDimension; y++) {
            for (int x = 0; x < world.xDimension; x++) {
                int crimeCount = scanner.nextInt();
                map[x][y] = crimeCount;
                max = crimeCount > max ? crimeCount : max;
            }
        }
        
        scanner.useDelimiter(previousDelimiter);
        return new HeatMap(map, max);
    }
/**
     * Parses a heatmap of the same size as the world using the
     * specified scanner. This only works properly if the scanner
     * position is at the beginning of the heatmap dump.
     */
Parses a heatmap of the same size as the world using the
specified scanner. This only works properly if the scanner
position is at the beginning of the heatmap dump.
Parses a heatmap of the same size as the world using the specified scanner . This only works properly if the scanner position is at the beginning of the heatmap dump .
private HeatMap parseHeatMap(Scanner scanner) {
        Pattern previousDelimiter = scanner.delimiter();
        scanner.useDelimiter("[^0-9]+");
        int[][] map = new int[world.xDimension][world.yDimension];
        int max = 0;
        for (int y = 0; y < world.yDimension; y++) {
            for (int x = 0; x < world.xDimension; x++) {
                int crimeCount = scanner.nextInt();
                map[x][y] = crimeCount;
                max = crimeCount > max ? crimeCount : max;
            }
        }
        scanner.useDelimiter(previousDelimiter);
        return new HeatMap(map, max);
    }
private HeatMap parseHeatMap ( Scanner scanner ) { Pattern previousDelimiter = scanner . delimiter ( ) ; scanner . useDelimiter ( "[^0-9]+" ) ; int [ ] [ ] map = new int [ world . xDimension ] [ world . yDimension ] ; int max = 0 ; for ( int y = 0 ; y < world . yDimension ; y ++ ) { for ( int x = 0 ; x < world . xDimension ; x ++ ) { int crimeCount = scanner . nextInt ( ) ; map [ x ] [ y ] = crimeCount ; max = crimeCount > max ? crimeCount : max ; } } scanner . useDelimiter ( previousDelimiter ) ; return new HeatMap ( map , max ) ; }
Parses a heatmap of the same size as the world using the
 specified scanner.
Parses a heatmap of the same size as the world using the specified scanner .