<commit_before>package gui;

import javafx.geometry.Bounds;
import javafx.geometry.Insets;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.RowConstraints;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;

/**
 * Class representing the center (main section) of the gui.
 * In other words, the time line view goes here.
 */
class RootCenterArea extends ScrollPane {

    //private double width, height;

    @Getter @Setter
    private int countHeight = 50;
    @Getter @Setter
    private int timelineWidth = 200;
    @Getter @Setter
    private int numberOfTimelines = 5;
    @Getter @Setter
    private int numberOfCounts = 10;

    @Getter
    private RootPane rootPane;

    @Getter
    private GridPane grid;

    @Getter
    private AnchorPane parentPane;

    private ArrayList<SnappingPane> panes;

    /**
     * Constructor class
     * @param rootPane parent pane passed through.
     */
    RootCenterArea(RootPane rootPane) {
        this.rootPane = rootPane;
        parentPane = new AnchorPane();
        grid = new GridPane();
        parentPane.getChildren().add(grid);


        parentPane.setMaxWidth(1000);
        parentPane.setMinWidth(1000);
        parentPane.setMinHeight(1000);
        parentPane.setMinWidth(1000);
        grid.setMaxWidth(1000.0);
        grid.setMinWidth(1000.0);
        grid.setMaxHeight(1000.0);
        grid.setMinHeight(1000.0);
        setContent(parentPane);

        addPanes();

        grid.setGridLinesVisible(true);
        grid.setHgap(50);
        grid.setPadding(new Insets(25, 25, 25, 25));

        // set constraints
        for (int i = 0; i < numberOfTimelines; i++) {
            grid.getColumnConstraints().add(new ColumnConstraints(timelineWidth));
        }
        for (int i = 0; i < numberOfCounts; i++) {
            grid.getRowConstraints().add(new RowConstraints(countHeight));
        }

        TimetableBlock rect1 = new TimetableBlock(this);
        TimetableBlock rect2 = new TimetableBlock(this);

        grid.add(rect1, 0, 0, 1, 2);
        grid.add(rect2, 1, 1, 1, 3);
    }

    /**
     * Add snapping panes to grid.
     */
    private void addPanes() {
        panes = new ArrayList<>();

        for (int i = 0; i < numberOfCounts; i++) {
            for (int j = 0; j < numberOfTimelines; j++) {
                SnappingPane pane = new SnappingPane(i, j, 200, 50);
//                pane.setVisible(true);
//                pane.setStyle("-fx-border-style: solid inside;"
//                        + "-fx-border-width: 3;"
//                        + "-fx-border-color: red;"
//                        + "-fx-background-color: green;");
                grid.add(pane, j, i);
                panes.add(pane);
            }
        }
    }

    /**
     * Get the pane in which the scene coordinates lie.
     * @param x - the x coordinate
     * @param y - the y coordinate
     * @return - the SnappingPane, null if none applicable
     */<commit_msg>removed unnecessary commented code pointed out by code review<commit_after>package gui;

import javafx.geometry.Bounds;
import javafx.geometry.Insets;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.RowConstraints;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;

/**
 * Class representing the center (main section) of the gui.
 * In other words, the time line view goes here.
 */
class RootCenterArea extends ScrollPane {

    //private double width, height;

    @Getter @Setter
    private int countHeight = 50;
    @Getter @Setter
    private int timelineWidth = 200;
    @Getter @Setter
    private int numberOfTimelines = 5;
    @Getter @Setter
    private int numberOfCounts = 10;

    @Getter
    private RootPane rootPane;

    @Getter
    private GridPane grid;

    @Getter
    private AnchorPane parentPane;

    private ArrayList<SnappingPane> panes;

    /**
     * Constructor class
     * @param rootPane parent pane passed through.
     */
    RootCenterArea(RootPane rootPane) {
        this.rootPane = rootPane;
        parentPane = new AnchorPane();
        grid = new GridPane();
        parentPane.getChildren().add(grid);


        parentPane.setMaxWidth(1000);
        parentPane.setMinWidth(1000);
        parentPane.setMinHeight(1000);
        parentPane.setMinWidth(1000);
        grid.setMaxWidth(1000.0);
        grid.setMinWidth(1000.0);
        grid.setMaxHeight(1000.0);
        grid.setMinHeight(1000.0);
        setContent(parentPane);

        addPanes();

        grid.setGridLinesVisible(true);
        grid.setHgap(50);
        grid.setPadding(new Insets(25, 25, 25, 25));

        // set constraints
        for (int i = 0; i < numberOfTimelines; i++) {
            grid.getColumnConstraints().add(new ColumnConstraints(timelineWidth));
        }
        for (int i = 0; i < numberOfCounts; i++) {
            grid.getRowConstraints().add(new RowConstraints(countHeight));
        }

        TimetableBlock rect1 = new TimetableBlock(this);
        TimetableBlock rect2 = new TimetableBlock(this);

        grid.add(rect1, 0, 0, 1, 2);
        grid.add(rect2, 1, 1, 1, 3);
    }

    /**
     * Add snapping panes to grid.
     */
    private void addPanes() {
        panes = new ArrayList<>();

        for (int i = 0; i < numberOfCounts; i++) {
            for (int j = 0; j < numberOfTimelines; j++) {
                SnappingPane pane = new SnappingPane(i, j, 200, 50);
                grid.add(pane, j, i);
                panes.add(pane);
            }
        }
    }

    /**
     * Get the pane in which the scene coordinates lie.
     * @param x - the x coordinate
     * @param y - the y coordinate
     * @return - the SnappingPane, null if none applicable
     */
{'fraction_non_alphanumeric': 0.10975609756097561, 'fraction_numerical': 0.02522552622786502, 'mean_word_length': 2.285949506037322, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, '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': '4759501', 'n_tokens_mistral': 1928, 'n_tokens_neox': 1755, 'n_words': 464}