-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task.java
123 lines (97 loc) · 2.62 KB
/
Task.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.commando.model;
import java.time.LocalDate;
import java.time.LocalTime;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
/**
* Model class for a Task
*
* @author Kyle
*
*/
public class Task {
private final StringProperty taskName;
private final StringProperty comment;
private final ObjectProperty<LocalDate> startDate;
private final ObjectProperty<LocalTime> startTime;
private final ObjectProperty<LocalDate> dueDate;
private final ObjectProperty<LocalTime> dueTime;
/**
* Default constructor.
*/
public Task() {
this(null);
}
/**
* Constructor with some initial data.
*
* @param taskName
*/
public Task(String taskName) {
this.taskName = new SimpleStringProperty(taskName);
// Some dummy data
this.comment = new SimpleStringProperty("-");
this.startDate = new SimpleObjectProperty<LocalDate>(LocalDate.of(1992, 9, 12));
this.startTime = new SimpleObjectProperty<LocalTime>(LocalTime.of(12,0));
this.dueDate = new SimpleObjectProperty<LocalDate>(LocalDate.of(1992, 9, 12));
this.dueTime = new SimpleObjectProperty<LocalTime>(LocalTime.of(12,0));
}
public String getTaskName() {
return taskName.get();
}
public void setTaskName(String taskName) {
this.taskName.set(taskName);
}
public StringProperty taskNameProperty() {
return taskName;
}
public String getComment() {
return comment.get();
}
public void setComment(String comment) {
this.comment.set(comment);
}
public StringProperty commentProperty() {
return comment;
}
public LocalDate getStartDate() {
return startDate.get();
}
public void setStartDate(LocalDate startDate) {
this.startDate.set(startDate);
}
public ObjectProperty<LocalDate> startDateProperty() {
return startDate;
}
public LocalTime getStartTime() {
return startTime.get();
}
public void setStartTime(LocalTime startTime) {
this.startTime.set(startTime);
}
public ObjectProperty<LocalTime> startTimeProperty() {
return startTime;
}
public LocalDate getDueDate() {
return dueDate.get();
}
public void setDueDate(LocalDate dueDate) {
this.dueDate.set(dueDate);
}
public ObjectProperty<LocalDate> dueDateProperty() {
return dueDate;
}
public LocalTime getDueTime() {
return dueTime.get();
}
public void setDueTime(LocalTime dueTime) {
this.dueTime.set(dueTime);
}
public ObjectProperty<LocalTime> dueTimeProperty() {
return dueTime;
}
}