<commit_before>package seedu.tasklist.ui;

import javafx.fxml.*;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import seedu.tasklist.commons.core.EventsCenter;
import seedu.tasklist.commons.core.LogsCenter;
import seedu.tasklist.commons.events.model.TaskListChangedEvent;
import seedu.tasklist.model.ReadOnlyTaskList;
import seedu.tasklist.model.task.Task;

import java.util.logging.Logger;

import com.google.common.eventbus.Subscribe;

/**
 * Panel containing the list of persons.
 */
public class CategoryPanel extends UiPart {
    private final Logger logger = LogsCenter.getLogger(CategoryPanel.class);
    private static final String FXML = "CategoryPanel.fxml";
    private AnchorPane gridpane;
    private AnchorPane placeHolderPane;
    private ReadOnlyTaskList latestSavedTaskList;

    @FXML
    private Label overdueNo;
    @FXML
    private Label todayNo;
    @FXML
    private Label tomorrowNo;
    @FXML
    private Label floatingNo;
    @FXML
    private Label otherNo;
    @FXML
    private Label totalNo;
    @FXML
    private Label upcomingNo;
    
    
    
    public CategoryPanel() {
        super();
    }
    
    @Override
    public void setNode(Node node) {
    	gridpane = (AnchorPane) node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }

    @Override
    public void setPlaceholder(AnchorPane pane) {
        this.placeHolderPane = pane;
    }

    public static CategoryPanel load(Stage primaryStage, AnchorPane personListPlaceholder, ReadOnlyTaskList readOnlyTaskList) {
        CategoryPanel categoryPanel =
                UiPartLoader.loadUiPart(primaryStage, personListPlaceholder, new CategoryPanel());
        categoryPanel.configure();
        categoryPanel.overdueNo.setText(Integer.toString(Task.overdueCounter));
        categoryPanel.floatingNo.setText(Integer.toString(Task.floatCounter));
        categoryPanel.totalNo.setText(Integer.toString(readOnlyTaskList.getTaskList().size()));
        EventsCenter.getInstance().registerHandler(categoryPanel);
        return categoryPanel;
    }
    
    @Subscribe
    private void modelChangedEvent(TaskListChangedEvent abce) {
    	overdueNo.setText(Integer.toString(Task.overdueCounter));
    	floatingNo.setText(Integer.toString(Task.floatCounter));
    	totalNo.setText(Integer.toString(abce.data.getTaskList().size()));
    }
    
    private void configure() {
    	gridpane.setStyle("-fx-background-color: #FFFFFF;");
        addToPlaceholder();
    }

    private void setConnections() {
    }

    private void addToPlaceholder() {
        SplitPane.setResizableWithParent(placeHolderPane, false);
        placeHolderPane.getChildren().add(gridpane);
    }
}<commit_msg>Modified categorypanel to read counts off TaskCounter<commit_after>package seedu.tasklist.ui;

import javafx.fxml.*;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import seedu.tasklist.commons.core.EventsCenter;
import seedu.tasklist.commons.core.LogsCenter;
import seedu.tasklist.commons.events.model.TaskCountersChangedEvent;
import seedu.tasklist.model.ReadOnlyTaskList;
import seedu.tasklist.model.TaskCounter;
import seedu.tasklist.model.task.Task;

import java.util.logging.Logger;

import com.google.common.eventbus.Subscribe;

/**
 * Panel containing the list of persons.
 */
public class CategoryPanel extends UiPart {
    private final Logger logger = LogsCenter.getLogger(CategoryPanel.class);
    private static final String FXML = "CategoryPanel.fxml";
    private AnchorPane gridpane;
    private AnchorPane placeHolderPane;

    @FXML
    private Label overdueNo;
    @FXML
    private Label todayNo;
    @FXML
    private Label tomorrowNo;
    @FXML
    private Label floatingNo;
    @FXML
    private Label otherNo;
    @FXML
    private Label totalNo;
    @FXML
    private Label upcomingNo;
    
    
    
    public CategoryPanel() {
        super();
    }
    
    @Override
    public void setNode(Node node) {
    	gridpane = (AnchorPane) node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }

    @Override
    public void setPlaceholder(AnchorPane pane) {
        this.placeHolderPane = pane;
    }

    public static CategoryPanel load(Stage primaryStage, AnchorPane personListPlaceholder, TaskCounter taskCounter) {
        CategoryPanel categoryPanel =
                UiPartLoader.loadUiPart(primaryStage, personListPlaceholder, new CategoryPanel());
        categoryPanel.configure();
        categoryPanel.setCounts(taskCounter);
        EventsCenter.getInstance().registerHandler(categoryPanel);
        return categoryPanel;
    }
    
    @Subscribe
    private void countsChangedEvent(TaskCountersChangedEvent data) {
    	setCounts(data.data);
    }
    
    private void setCounts(TaskCounter newCounts) {
    	overdueNo.setText(Integer.toString(newCounts.getOverdue()));
    	todayNo.setText(Integer.toString(newCounts.getToday()));
    	tomorrowNo.setText(Integer.toString(newCounts.getTomorrow()));
    	floatingNo.setText(Integer.toString(newCounts.getFloating()));
    	otherNo.setText(Integer.toString(newCounts.getOther()));
    	totalNo.setText(Integer.toString(newCounts.getTotal()));
    	upcomingNo.setText(Integer.toString(newCounts.getUpcoming()));
    }
    
    private void configure() {
    	gridpane.setStyle("-fx-background-color: #FFFFFF;");
        addToPlaceholder();
    }

    private void setConnections() {
    }

    private void addToPlaceholder() {
        SplitPane.setResizableWithParent(placeHolderPane, false);
        placeHolderPane.getChildren().add(gridpane);
    }
}
{'fraction_non_alphanumeric': 0.09398625429553265, 'fraction_numerical': 0.0, 'mean_word_length': 3.5654901960784313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '3428897', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1673, 'n_words': 324}