package seedu.taskell.ui;

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

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label description;
    @FXML
    private Label id;
    @FXML
    private Label startDate;
    @FXML
    private Label endDate;
    @FXML
    private Label startTime;
    @FXML
    private Label endTime;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

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

    @FXML
    public void initialize() {
        id.setText(displayedIndex + ". ");
        description.setText(task.getDescription().description);
        tags.setText(task.tagsString());
        startDate.setText(task.getStartDate().getDisplayDate());
        endDate.setText(task.getEndDate().getDisplayDate());
        startTime.setText(task.getStartTime().taskTime);
        endTime.setText(task.getEndTime().taskTime);
        
        if (task.getTaskType().equals(Task.FLOATING_TASK)) {
            startDate.setVisible(false);
            endDate.setVisible(false);
            startTime.setVisible(false);
            endTime.setVisible(false);
        }
    }

    public HBox getLayout() {
        return cardPane;
    }

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

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

@@ -222,16 +222,62 @@
 sk.Task;
+%0Aimport seedu.taskell.model.task.TaskPriority;
 %0A%0Apublic
@@ -1433,16 +1433,136 @@
        %0A
+        setCardPaneBackground();%0A        setDateTimeVisibility();%0A    %7D%0A    %0A    private void setDateTimeVisibility() %7B%0A
         
@@ -1785,24 +1785,572 @@
      %7D%0A    %7D
+%0A    %0A    private void setCardPaneBackground() %7B%0A        if (task.getTaskPriority().taskPriority.equals(TaskPriority.HIGH_PRIORITY)) %7B%0A            cardPane.setStyle(TaskPriority.HIGH_PRIORITY_BACKGROUND);%0A        %7D else if (task.getTaskPriority().taskPriority.equals(TaskPriority.MEDIUM_PRIORITY)) %7B%0A            cardPane.setStyle(TaskPriority.MEDIUM_PRIORITY_BACKGROUND);%0A        %7D else if (task.getTaskPriority().taskPriority.equals(TaskPriority.LOW_PRIORITY)) %7B%0A            cardPane.setStyle(TaskPriority.LOW_PRIORITY_BACKGROUND);%0A        %7D%0A    %7D
 %0A%0A    public

Add background colour to differentiate priority