source: src/main/java/genius/gui/deadline/DeadlineModel.java@ 127

Last change on this file since 127 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 679 bytes
Line 
1package genius.gui.deadline;
2
3import genius.core.Deadline;
4import genius.core.DeadlineType;
5import genius.core.listener.DefaultListenable;
6
7/**
8 * Stores the selected deadline type and can notify about changes.
9 */
10public class DeadlineModel extends DefaultListenable<DeadlineModel> {
11
12 // default values.
13 private Integer value = 180;
14 private DeadlineType type = DeadlineType.ROUND;
15
16 public void setValue(Integer value) {
17 this.value = value;
18 notifyChange(null);
19 }
20
21 public void setType(DeadlineType type) {
22 this.type = type;
23 notifyChange(null);
24 }
25
26 /**
27 * @return the current deadline
28 */
29 public Deadline getDeadline() {
30 return new Deadline(value, type);
31 }
32
33}
Note: See TracBrowser for help on using the repository browser.