View Javadoc
1   package fr.ifremer.reefdb.ui.swing.content.synchro.program;
2   
3   /*
4    * #%L
5    * Reef DB :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
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   * Modele pour la zone des programmes.
35   */
36  public class ProgramSelectUIModel extends AbstractEmptyUIModel<ProgramSelectUIModel> {
37  
38      /** Constant <code>PROPERTY_SEARCH_DATE="searchDate"</code> */
39      public static final String PROPERTY_SEARCH_DATE = "searchDate";
40      /** Constant <code>PROPERTY_START_DATE="startDate"</code> */
41      public static final String PROPERTY_START_DATE = "startDate";
42      /** Constant <code>PROPERTY_END_DATE="endDate"</code> */
43      public static final String PROPERTY_END_DATE = "endDate";
44      /** Constant <code>PROPERTY_DIRTY_ONLY="dirtyOnly"</code> */
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       * <p>Getter for the field <code>selectedPrograms</code>.</p>
57       *
58       * @return a {@link java.util.List} object.
59       */
60      public List<ProgramDTO> getSelectedPrograms() {
61          return selectedPrograms;
62      }
63  
64      /**
65       * <p>Setter for the field <code>selectedPrograms</code>.</p>
66       *
67       * @param selectedPrograms a {@link java.util.List} object.
68       */
69      public void setSelectedPrograms(List<ProgramDTO> selectedPrograms) {
70          this.selectedPrograms = selectedPrograms;
71      }
72  
73      /**
74       * <p>isDirtyOnly.</p>
75       *
76       * @return a boolean.
77       */
78      public boolean isDirtyOnly() {
79          return dirtyOnly;
80      }
81  
82      /**
83       * <p>Setter for the field <code>dirtyOnly</code>.</p>
84       *
85       * @param dirtyOnly a boolean.
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      * <p>Getter for the field <code>searchDate</code>.</p>
103      *
104      * @return a {@link fr.ifremer.reefdb.dto.SearchDateDTO} object.
105      */
106     public SearchDateDTO getSearchDate() {
107         return searchDate;
108     }
109 
110     /**
111      * <p>getSearchDateId.</p>
112      *
113      * @return a {@link java.lang.Integer} object.
114      */
115     public Integer getSearchDateId() {
116         return getSearchDate() == null ? null : getSearchDate().getId();
117     }
118 
119     /**
120      * <p>Setter for the field <code>searchDate</code>.</p>
121      *
122      * @param searchDate a {@link fr.ifremer.reefdb.dto.SearchDateDTO} object.
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      * <p>Getter for the field <code>startDate</code>.</p>
132      *
133      * @return a {@link java.util.Date} object.
134      */
135     public Date getStartDate() {
136         return startDate;
137     }
138 
139     /**
140      * <p>Setter for the field <code>startDate</code>.</p>
141      *
142      * @param startDate a {@link java.util.Date} object.
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      * <p>Getter for the field <code>endDate</code>.</p>
152      *
153      * @return a {@link java.util.Date} object.
154      */
155     public Date getEndDate() {
156         return endDate;
157     }
158 
159     /**
160      * <p>Setter for the field <code>endDate</code>.</p>
161      *
162      * @param endDate a {@link java.util.Date} object.
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 }