<commit_before>package org.htwkvisu.gui;

import javafx.geometry.BoundingBox;
import javafx.geometry.Point2D;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.CheckBox;
import javafx.scene.image.PixelWriter;
import javafx.scene.paint.Color;
import org.htwkvisu.gui.interpolate.InterpolateConfig;
import org.htwkvisu.org.IMapDrawable;
import org.htwkvisu.org.pois.NormalizedColorCalculator;
import org.htwkvisu.org.pois.ScoringCalculator;
import org.htwkvisu.utils.MathUtils;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Canvas for map.
 */
public class MapCanvas extends BasicCanvas {

    public static final Point2D CITY_LEIPZIG = new Point2D(51.340333, 12.37475);
    private Point2D mapCenter = CITY_LEIPZIG;
    private GraphicsContext gc = getGraphicsContext2D();
    private double widthDistance = 0;
    private double heightDistance = 0;
    private CheckBox colorModeCheckBox;
    private Grid grid = new Grid(this);
    private int displayedElements = 0;

    /**
     * Construct and init canvas
     */
    public MapCanvas(ScoringConfig config) {
        super(config);
    }

    @Override
    protected void drawInfo() {
        if(colorModeCheckBox.isSelected()){
            gc.setFill(Color.GRAY);
        }else{
            gc.setFill(Color.BLACK);
        }

        gc.fillText("Center: " + MathUtils.roundToDecimalsAsString(mapCenter.getX(), 5) + " " +
                MathUtils.roundToDecimalsAsString(mapCenter.getY(), 5), 10, 20);
        gc.fillText("Distance: " + MathUtils.roundToDecimalsAsString(widthDistance, 3) + " km x " + MathUtils.roundToDecimalsAsString(heightDistance, 3) + " km", 10, 40);
        gc.fillText("Elements displayed: " + displayedElements, 10, 60);
        gc.fillText("Scale: " + MathUtils.roundToDecimalsAsString(scale, 2), 10, 80);
        gc.fillText("Bounds: " + getCoordsBoundsAsString(), 10, 100);
    }

    @Override<commit_msg>Fixed MapCanvas, because MapCanvasTest failed<commit_after>package org.htwkvisu.gui;

import javafx.geometry.BoundingBox;
import javafx.geometry.Point2D;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.CheckBox;
import javafx.scene.image.PixelWriter;
import javafx.scene.paint.Color;
import org.htwkvisu.gui.interpolate.InterpolateConfig;
import org.htwkvisu.org.IMapDrawable;
import org.htwkvisu.org.pois.NormalizedColorCalculator;
import org.htwkvisu.org.pois.ScoringCalculator;
import org.htwkvisu.utils.MathUtils;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

/**
 * Canvas for map.
 */
public class MapCanvas extends BasicCanvas {

    public static final Point2D CITY_LEIPZIG = new Point2D(51.340333, 12.37475);
    private Point2D mapCenter = CITY_LEIPZIG;
    private GraphicsContext gc = getGraphicsContext2D();
    private double widthDistance = 0;
    private double heightDistance = 0;
    private CheckBox colorModeCheckBox;
    private Grid grid = new Grid(this);
    private int displayedElements = 0;

    /**
     * Construct and init canvas
     */
    public MapCanvas(ScoringConfig config) {
        super(config);
    }

    @Override
    protected void drawInfo() {
        if(colorModeCheckBox != null && colorModeCheckBox.isSelected()){
            if(colorModeCheckBox.isSelected()) {
                gc.setFill(Color.GRAY);
            }
        }else{
            gc.setFill(Color.BLACK);
        }

        gc.fillText("Center: " + MathUtils.roundToDecimalsAsString(mapCenter.getX(), 5) + " " +
                MathUtils.roundToDecimalsAsString(mapCenter.getY(), 5), 10, 20);
        gc.fillText("Distance: " + MathUtils.roundToDecimalsAsString(widthDistance, 3) + " km x " + MathUtils.roundToDecimalsAsString(heightDistance, 3) + " km", 10, 40);
        gc.fillText("Elements displayed: " + displayedElements, 10, 60);
        gc.fillText("Scale: " + MathUtils.roundToDecimalsAsString(scale, 2), 10, 80);
        gc.fillText("Bounds: " + getCoordsBoundsAsString(), 10, 100);
    }

    @Override
{'fraction_non_alphanumeric': 0.11160275319567355, 'fraction_numerical': 0.024090462143559487, 'mean_word_length': 3.6186152099886493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1206618', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1267, 'n_words': 250}