1 package fr.ifremer.reefdb.ui.swing.content.synchro.program;
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 import fr.ifremer.quadrige3.ui.swing.model.AbstractEmptyUIModel;
27 import fr.ifremer.reefdb.dto.SearchDateDTO;
28 import fr.ifremer.reefdb.dto.configuration.programStrategy.ProgramDTO;
29
30 import java.util.Date;
31 import java.util.List;
32
33
34
35
36 public class ProgramSelectUIModel extends AbstractEmptyUIModel<ProgramSelectUIModel> {
37
38
39 public static final String PROPERTY_SEARCH_DATE = "searchDate";
40
41 public static final String PROPERTY_START_DATE = "startDate";
42
43 public static final String PROPERTY_END_DATE = "endDate";
44
45 public static final String PROPERTY_DIRTY_ONLY = "dirtyOnly";
46 public static final String PROPERTY_ENABLE_PHOTO = "enablePhoto";
47
48 private List<ProgramDTO> selectedPrograms;
49 private boolean dirtyOnly;
50 private boolean enablePhoto;
51 private SearchDateDTO searchDate;
52 private Date startDate;
53 private Date endDate;
54
55
56
57
58
59
60 public List<ProgramDTO> getSelectedPrograms() {
61 return selectedPrograms;
62 }
63
64
65
66
67
68
69 public void setSelectedPrograms(List<ProgramDTO> selectedPrograms) {
70 this.selectedPrograms = selectedPrograms;
71 }
72
73
74
75
76
77
78 public boolean isDirtyOnly() {
79 return dirtyOnly;
80 }
81
82
83
84
85
86
87 public void setDirtyOnly(boolean dirtyOnly) {
88 this.dirtyOnly = dirtyOnly;
89 firePropertyChange(PROPERTY_DIRTY_ONLY, !dirtyOnly, dirtyOnly);
90 }
91
92 public boolean isEnablePhoto() {
93 return enablePhoto;
94 }
95
96 public void setEnablePhoto(boolean enablePhoto) {
97 this.enablePhoto = enablePhoto;
98 firePropertyChange(PROPERTY_ENABLE_PHOTO, !enablePhoto, enablePhoto);
99 }
100
101
102
103
104
105
106 public SearchDateDTO getSearchDate() {
107 return searchDate;
108 }
109
110
111
112
113
114
115 public Integer getSearchDateId() {
116 return getSearchDate() == null ? null : getSearchDate().getId();
117 }
118
119
120
121
122
123
124 public void setSearchDate(SearchDateDTO searchDate) {
125 SearchDateDTO oldSearchDate = getSearchDate();
126 this.searchDate = searchDate;
127 firePropertyChange(PROPERTY_SEARCH_DATE, oldSearchDate, searchDate);
128 }
129
130
131
132
133
134
135 public Date getStartDate() {
136 return startDate;
137 }
138
139
140
141
142
143
144 public void setStartDate(Date startDate) {
145 Date oldDate = getStartDate();
146 this.startDate = startDate;
147 firePropertyChange(PROPERTY_START_DATE, oldDate, startDate);
148 }
149
150
151
152
153
154
155 public Date getEndDate() {
156 return endDate;
157 }
158
159
160
161
162
163
164 public void setEndDate(Date endDate) {
165 Date oldDate = getEndDate();
166 this.endDate = endDate;
167 firePropertyChange(PROPERTY_END_DATE, oldDate, endDate);
168 }
169
170 }