Last change
on this file since 163 was 1, checked in by Wouter Pasman, 7 years ago |
Initial import : Genius 9.0.0
|
File size:
679 bytes
|
Rev | Line | |
---|
[1] | 1 | package genius.gui.deadline;
|
---|
| 2 |
|
---|
| 3 | import genius.core.Deadline;
|
---|
| 4 | import genius.core.DeadlineType;
|
---|
| 5 | import genius.core.listener.DefaultListenable;
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * Stores the selected deadline type and can notify about changes.
|
---|
| 9 | */
|
---|
| 10 | public 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.