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";
    private static final String WHITESPACE = " ";

    @FXML
    private HBox cardPane;
    @FXML
    private Label description;
    @FXML
    private Label taskType;
    @FXML
    private Label id;
    @FXML
    private Label taskDate;
    @FXML
    private Label taskPriority;
    @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() {
        taskType.setText(WHITESPACE);
        id.setText(displayedIndex + ". ");
        description.setText(task.getDescription().description);
        taskPriority.setText(task.getTaskPriority().taskPriority);
        tags.setText(task.tagsString());
        
        if (task.getTaskType().equals(Task.FLOATING_TASK)) {
            tags.setText(task.tagsString());
        } else if (task.getTaskType().equals(Task.DEADLINE_TASK)) {
            taskDate.setText(task.getTaskDate().taskDate);
            endTime.setText(task.getEndTime().taskTime);
        } else {
            taskDate.setText(task.getTaskDate().taskDate);
            startTime.setText(task.getStartTime().taskTime);
            endTime.setText(task.getEndTime().taskTime);
        }
        
    }

    public HBox getLayout() {
        return cardPane;
    }

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

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

@@ -1264,43 +1264,18 @@
 ext(
-task.getTaskPriority().taskPriority
+WHITESPACE
 );%0A 
@@ -1390,34 +1390,38 @@
 %7B%0A            ta
-g
 s
+kDate
 .setText(task.ta
@@ -1413,33 +1413,110 @@
 setText(
-task.tagsString()
+WHITESPACE);%0A            startTime.setText(WHITESPACE);%0A            endTime.setText(WHITESPACE
 );%0A     
@@ -1641,35 +1641,37 @@
 e);%0A            
-end
+start
 Time.setText(tas
@@ -1687,32 +1687,114 @@
 ime().taskTime);
+  //To accustomed to display format on UI%0A            endTime.setText(WHITESPACE);
 %0A        %7D else 

Update UI display to display according to task types