<commit_before>package seedu.tasklist.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import seedu.tasklist.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";
    
    private static final String FX_BACKGROUND_PALE_GREEN = "-fx-background-color: #98FB98;";
    private static final String FX_BACKGROUND_PALE_YELLOW = "-fx-background-color: #FFFFCC;";
    private static final String FX_BACKGROUND_PALE_RED = "-fx-background-color: #ff9999;";
    private static final String FX_BACKGROUND_WHITE = "-fx-background-color: white;";
    
    private static final int NOT_REQUIRED = -1;
    
    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label id;
    @FXML
    private Label startDateTime;
    @FXML
    private Label endDateTime;
    @FXML
    private Label description;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;
    private boolean isNotRequired;

    public TaskCard() {

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        if (displayedIndex == NOT_REQUIRED) card.isNotRequired = true;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        initializeId();
        initializeTitle();
        initializeDateTime();
        initializeDescription();
        initializeTags();
        setStyle();
    }
    
    private void initializeId() {
        if (isNotRequired) {
            id.setText(null);
        } else {
            id.setText(displayedIndex + ". ");
        }
    }
    
    private void initializeTitle() {
        name.setText(task.getTitle().fullTitle);
    }
    
    private void initializeDescription() {
        if (task.getDescription().description.equals("") || isNotRequired) {
            description.setManaged(false);
        } else {
            description.setManaged(true);
            description.setText(task.getDescription().description);
        }
    }

    private void initializeDateTime() {
        if (task.getStartDateTime().toString().isEmpty() || isNotRequired) {
            startDateTime.setManaged(false);
        } else {
            startDateTime.setManaged(true);
            startDateTime.setText("Start:  " + task.getStartDateTime().toString().replaceAll(" ", "    Time:  "));
        }
        
        if(task.getEndDateTime().toString().isEmpty()){
            endDateTime.setManaged(false);
        } else {
            endDateTime.setManaged(true);
            endDateTime.setText("End:    " + task.getEndDateTime().toString().replaceAll(" ", "    Time:  "));
        }
    }
    
    private void initializeTags() {
        tags.setText(task.tagsString());
    }
    
    public void setStyle() {
        if (task.isCompleted()) {
            cardPane.setStyle(FX_BACKGROUND_PALE_GREEN);
        } else if (task.isFloating()) {
            cardPane.setStyle(FX_BACKGROUND_PALE_YELLOW);
        } else if (task.isOverdue()){
            cardPane.setStyle(FX_BACKGROUND_PALE_RED);
        } else {
            cardPane.setStyle(FX_BACKGROUND_WHITE);
        }
    }
    
    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}
<commit_msg>update to taskcard<commit_after>package seedu.tasklist.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import seedu.tasklist.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";
    
    private static final String FX_BACKGROUND_PALE_GREEN = "-fx-background-color: #98FB98;";
    private static final String FX_BACKGROUND_PALE_YELLOW = "-fx-background-color: #FFFFCC;";
    private static final String FX_BACKGROUND_PALE_RED = "-fx-background-color: #ff9999;";
    private static final String FX_BACKGROUND_WHITE = "-fx-background-color: white;";
    
    private static final int NOT_REQUIRED = -1;
    
    @FXML
    private HBox cardPane;
    @FXML
    private Label name;
    @FXML
    private Label id;
    @FXML
    private Label startDateTime;
    @FXML
    private Label endDateTime;
    @FXML
    private Label description;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;
    private boolean isNotRequired;

    public TaskCard() {

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        if (displayedIndex == NOT_REQUIRED) card.isNotRequired = true;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        initializeId();
        initializeTitle();
        initializeDateTime();
        initializeDescription();
        initializeTags();
        setStyle();
    }
    
    private void initializeId() {
        if (isNotRequired) {
            id.setText(null);
        } else {
            id.setText(displayedIndex + ". ");
        }
    }
    
    private void initializeTitle() {
        name.setText(task.getTitle().fullTitle);
    }
    
    private void initializeDescription() {
        description.setText(task.getDescription().description);
        
        if (task.getDescription().description.equals("") || isNotRequired) {
            description.setManaged(false);
        } else {
            description.setManaged(true);
        }
    }

    private void initializeDateTime() {
        startDateTime.setText("Start:  " + task.getStartDateTime().toString().replaceAll(" ", "    Time:  "));
        
        if (task.getStartDateTime().toString().isEmpty() || (isNotRequired && task.isCompleted())) {
            startDateTime.setManaged(false);
        } else {
            startDateTime.setManaged(true);
        }
        
        endDateTime.setText("End:    " + task.getEndDateTime().toString().replaceAll(" ", "    Time:  "));
        
        if(task.getEndDateTime().toString().isEmpty() || (isNotRequired && task.isCompleted())){
            endDateTime.setManaged(false);
        } else {
            endDateTime.setManaged(true);
        }
    }
    
    private void initializeTags() {
        tags.setText(task.tagsString());
        if (task.isCompleted()) {
            tags.setManaged(false);
        } else {
            tags.setManaged(true);
        }
    }
    
    public void setStyle() {
        if (task.isCompleted()) {
            cardPane.setStyle(FX_BACKGROUND_PALE_GREEN);
        } else if (task.isFloating()) {
            cardPane.setStyle(FX_BACKGROUND_PALE_YELLOW);
        } else if (task.isOverdue()){
            cardPane.setStyle(FX_BACKGROUND_PALE_RED);
        } else {
            cardPane.setStyle(FX_BACKGROUND_WHITE);
        }
    }
    
    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

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

{'fraction_non_alphanumeric': 0.10856989102650343, 'fraction_numerical': 0.002421633257096731, 'mean_word_length': 2.32171581769437, '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': '361753', 'n_tokens_mistral': 2161, 'n_tokens_neox': 2108, 'n_words': 424}