View Javadoc
1   package fr.ifremer.tutti.ui.swing.content.operation;
2   
3   /*
4    * #%L
5    * Tutti :: UI
6    * %%
7    * Copyright (C) 2012 - 2014 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the 
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public 
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  import com.google.common.collect.Lists;
26  import fr.ifremer.adagio.core.dao.referential.ObjectTypeCode;
27  import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
28  import fr.ifremer.tutti.persistence.entities.TuttiEntities;
29  import fr.ifremer.tutti.persistence.entities.data.Attachment;
30  import fr.ifremer.tutti.persistence.entities.data.Cruise;
31  import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
32  import fr.ifremer.tutti.persistence.entities.data.FishingOperations;
33  import fr.ifremer.tutti.persistence.entities.referential.Gear;
34  import fr.ifremer.tutti.persistence.entities.referential.Person;
35  import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
36  import fr.ifremer.tutti.persistence.entities.referential.Vessel;
37  import fr.ifremer.tutti.type.CoordinateEditorType;
38  import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
39  import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
40  import fr.ifremer.tutti.util.Distances;
41  import jaxx.runtime.swing.editor.gis.DmdCoordinate;
42  import jaxx.runtime.swing.editor.gis.DmsCoordinate;
43  import org.apache.commons.collections4.CollectionUtils;
44  import org.apache.commons.lang3.StringUtils;
45  import org.nuiton.jaxx.application.swing.tab.TabContentModel;
46  import org.nuiton.util.DateUtil;
47  import org.nuiton.util.beans.Binder;
48  import org.nuiton.util.beans.BinderFactory;
49  
50  import java.util.Calendar;
51  import java.util.Collection;
52  import java.util.Date;
53  import java.util.List;
54  
55  import static org.nuiton.i18n.I18n.n;
56  
57  /**
58   * Model for UI {@link EditFishingOperationUI}.
59   *
60   * @author Tony Chemit - chemit@codelutin.com
61   * @since 0.1
62   */
63  public class EditFishingOperationUIModel extends AbstractTuttiBeanUIModel<FishingOperation, EditFishingOperationUIModel>
64          implements AttachmentModelAware, TabContentModel, FishingOperation {
65  
66      private static final long serialVersionUID = 1L;
67  
68      public static final String TITLE = n("tutti.editFishingOperation.tab.general");
69  
70      public static final String PROPERTY_PERSISTED = "persisted";
71  
72      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS = "gearShootingStartLatitudeDms";
73  
74      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN = "gearShootingStartLatitudeDmsSign";
75  
76      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE = "gearShootingStartLatitudeDmsDegree";
77  
78      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE = "gearShootingStartLatitudeDmsMinute";
79  
80      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND = "gearShootingStartLatitudeDmsSecond";
81  
82      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD = "gearShootingStartLatitudeDmd";
83  
84      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN = "gearShootingStartLatitudeDmdSign";
85  
86      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE = "gearShootingStartLatitudeDmdDegree";
87  
88      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE = "gearShootingStartLatitudeDmdMinute";
89  
90      public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DECIMAL = "gearShootingStartLatitudeDmdDecimal";
91  
92      public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS = "gearShootingStartLongitudeDms";
93  
94      public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN = "gearShootingStartLongitudeDmsSign";
95  
96      public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE = "gearShootingStartLongitudeDmsDegree";
97  
98      public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE = "gearShootingStartLongitudeDmsMinute";
99  
100     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND = "gearShootingStartLongitudeDmsSecond";
101 
102     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD = "gearShootingStartLongitudeDmd";
103 
104     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN = "gearShootingStartLongitudeDmdSign";
105 
106     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE = "gearShootingStartLongitudeDmdDegree";
107 
108     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE = "gearShootingStartLongitudeDmdMinute";
109 
110     public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DECIMAL = "gearShootingStartLongitudeDmdDecimal";
111 
112     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS = "gearShootingEndLatitudeDms";
113 
114     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN = "gearShootingEndLatitudeDmsSign";
115 
116     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE = "gearShootingEndLatitudeDmsDegree";
117 
118     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE = "gearShootingEndLatitudeDmsMinute";
119 
120     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND = "gearShootingEndLatitudeDmsSecond";
121 
122     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD = "gearShootingEndLatitudeDmd";
123 
124     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN = "gearShootingEndLatitudeDmdSign";
125 
126     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE = "gearShootingEndLatitudeDmdDegree";
127 
128     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE = "gearShootingEndLatitudeDmdMinute";
129 
130     public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DECIMAL = "gearShootingEndLatitudeDmdDecimal";
131 
132     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS = "gearShootingEndLongitudeDms";
133 
134     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN = "gearShootingEndLongitudeDmsSign";
135 
136     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE = "gearShootingEndLongitudeDmsDegree";
137 
138     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE = "gearShootingEndLongitudeDmsMinute";
139 
140     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND = "gearShootingEndLongitudeDmsSecond";
141 
142     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD = "gearShootingEndLongitudeDmd";
143 
144     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN = "gearShootingEndLongitudeDmdSign";
145 
146     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE = "gearShootingEndLongitudeDmdDegree";
147 
148     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE = "gearShootingEndLongitudeDmdMinute";
149 
150     public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DECIMAL = "gearShootingEndLongitudeDmdDecimal";
151 
152     public static final String PROPERTY_VALIDATION_CONTEXT = "validationContext";
153 
154     public static final String PROPERTY_SECONDARY_VESSEL_TYPE = "secondaryVesselType";
155 
156     public static final String PROPERTY_SECONDARY_VESSEL_TYPE_ALL = "secondaryVesselTypeAll";
157 
158     public static final String PROPERTY_SECONDARY_VESSEL_TYPE_SCIENTIFIC = "secondaryVesselTypeScientific";
159 
160     public static final String PROPERTY_SECONDARY_VESSEL_TYPE_FISHING = "secondaryVesselTypeFishing";
161 
162     public static final String PROPERTY_SECONDARY_VESSEL_TYPE_ONLY_CRUISE = "secondaryVesselTypeOnlyCruise";
163 
164     /**
165      * Delegate edit object.
166      *
167      * @since 1.3
168      */
169     protected final FishingOperation editObject = FishingOperations.newFishingOperation();
170 
171     /**
172      * To edit gearShootingStartLatitude as dms format.
173      *
174      * @since 2.8
175      */
176     protected final DmsCoordinate gearShootingStartLatitudeDms =
177             DmsCoordinate.empty();
178 
179     /**
180      * To edit gearShootingStartLongitude as dms format.
181      *
182      * @since 2.8
183      */
184     protected final DmsCoordinate gearShootingStartLongitudeDms =
185             DmsCoordinate.empty();
186 
187     /**
188      * To edit gearShootingEndLatitude as dms format.
189      *
190      * @since 2.8
191      */
192     protected final DmsCoordinate gearShootingEndLatitudeDms =
193             DmsCoordinate.empty();
194 
195     /**
196      * To edit gearShootingEndLongitude as dms format.
197      *
198      * @since 2.8
199      */
200     protected final DmsCoordinate gearShootingEndLongitudeDms =
201             DmsCoordinate.empty();
202 
203     /**
204      * To edit gearShootingStartLatitude as dmd format.
205      *
206      * @since 2.8
207      */
208     protected final DmdCoordinate gearShootingStartLatitudeDmd =
209             DmdCoordinate.empty();
210 
211     /**
212      * To edit gearShootingStartLongitude as dmd format.
213      *
214      * @since 2.8
215      */
216     protected final DmdCoordinate gearShootingStartLongitudeDmd =
217             DmdCoordinate.empty();
218 
219     /**
220      * To edit gearShootingEndLatitude as dmd format.
221      *
222      * @since 2.8
223      */
224     protected final DmdCoordinate gearShootingEndLatitudeDmd =
225             DmdCoordinate.empty();
226 
227     /**
228      * To edit gearShootingEndLongitude as dmd format.
229      *
230      * @since 2.8
231      */
232     protected final DmdCoordinate gearShootingEndLongitudeDmd =
233             DmdCoordinate.empty();
234 
235     protected int quadrant;
236 
237     public int getQuadrant() {
238         return quadrant;
239     }
240 
241     public void setQuadrant(int quadrant) {
242         Object oldValue = getQuadrant();
243         this.quadrant = quadrant;
244         firePropertyChange("quadrant", oldValue, quadrant);
245     }
246 
247     protected final List<Attachment> attachment = Lists.newArrayList();
248 
249     protected FishingOperation fishingOperation;
250 
251     protected String validationContext;
252 
253     protected CoordinateEditorType coordinateEditorType;
254 
255     protected boolean loadingData;
256 
257     protected SecondaryVesselTypeEnum secondaryVesselType;
258 
259     protected boolean importFromColumnFileEnabled;
260 
261     protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
262             BinderFactory.newBinder(EditFishingOperationUIModel.class,
263                                     FishingOperation.class);
264 
265     protected static Binder<FishingOperation, EditFishingOperationUIModel> fromBeanBinder =
266             BinderFactory.newBinder(FishingOperation.class, EditFishingOperationUIModel.class);
267 
268     public EditFishingOperationUIModel() {
269         super(fromBeanBinder, toBeanBinder);
270     }
271 
272     public boolean isLoadingData() {
273         return loadingData;
274     }
275 
276     public void setLoadingData(boolean loadingData) {
277         this.loadingData = loadingData;
278     }
279 
280     @Override
281     public String getTitle() {
282         return TITLE;
283     }
284 
285     @Override
286     public String getIcon() {
287         return null;
288     }
289 
290     @Override
291     public boolean isCloseable() {
292         return false;
293     }
294 
295     @Override
296     public boolean isEmpty() {
297         boolean result;
298 
299         switch (coordinateEditorType) {
300 
301             case DMS:
302                 result = gearShootingStartLatitudeDms.isNull()
303                          && gearShootingStartLongitudeDms.isNull()
304                          && gearShootingEndLatitudeDms.isNull()
305                          && gearShootingEndLongitudeDms.isNull();
306                 break;
307             case DMD:
308                 result = gearShootingStartLatitudeDmd.isNull()
309                          && gearShootingStartLongitudeDmd.isNull()
310                          && gearShootingEndLatitudeDmd.isNull()
311                          && gearShootingEndLongitudeDmd.isNull();
312                 break;
313             default:
314                 result = getGearShootingStartLatitude() == null
315                          && getGearShootingStartLongitude() == null
316                          && getGearShootingEndLatitude() == null
317                          && getGearShootingEndLongitude() == null;
318                 break;
319         }
320 
321         return result &&
322                StringUtils.isEmpty(getStationNumber())
323                && getFishingOperationNumber() == null
324                && getStrata() == null
325                && getSubStrata() == null
326                && getLocation() == null
327                && getGearShootingStartDate() == null
328                && getGearShootingEndDate() == null
329                && !isFishingOperationRectiligne()
330                && getTrawlDistance() == null
331                && getFishingOperationValid() == null
332                && CollectionUtils.isEmpty(getRecorderPerson())
333                && getGear() == null
334                && StringUtils.isEmpty(getComment())
335                && CollectionUtils.isEmpty(getAttachment());
336     }
337 
338     @Override
339     protected FishingOperation newEntity() {
340         return fishingOperation;
341     }
342 
343     public FishingOperation getFishingOperation() {
344         return fishingOperation;
345     }
346 
347     public void setFishingOperation(FishingOperation fishingOperation) {
348         this.fishingOperation = fishingOperation;
349         firePropertyChange(PROPERTY_PERSISTED, null, isPersisted());
350     }
351 
352     public boolean isPersisted() {
353         return fishingOperation != null && !TuttiEntities.isNew(fishingOperation);
354     }
355 
356     //------------------------------------------------------------------------//
357     //-- Start Latitude ------------------------------------------------------//
358     //------------------------------------------------------------------------//
359 
360     public DmsCoordinate getGearShootingStartLatitudeDms() {
361         return gearShootingStartLatitudeDms;
362     }
363 
364     public void setGearShootingStartLatitudeDms(Float decimal) {
365         DmsCoordinate position =
366                 DmsCoordinate.valueOf(decimal);
367         setGearShootingStartLatitudeDmsSign(position.isSign());
368         setGearShootingStartLatitudeDmsDegree(position.getDegree());
369         setGearShootingStartLatitudeDmsMinute(position.getMinute());
370         setGearShootingStartLatitudeDmsSecond(position.getSecond());
371         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS, null, getGearShootingStartLatitudeDms());
372     }
373 
374     public boolean isGearShootingStartLatitudeDmsSign() {
375         return gearShootingStartLatitudeDms.isSign();
376     }
377 
378     public void setGearShootingStartLatitudeDmsSign(boolean sign) {
379         Object oldValue = isGearShootingStartLatitudeDmsSign();
380         gearShootingStartLatitudeDms.setSign(sign);
381         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN, oldValue, sign);
382     }
383 
384     public Integer getGearShootingStartLatitudeDmsDegree() {
385         return gearShootingStartLatitudeDms.getDegree();
386     }
387 
388     public void setGearShootingStartLatitudeDmsDegree(Integer degree) {
389         Object oldValue = getGearShootingStartLatitudeDmsDegree();
390         if (degree != null) {
391             degree = Math.abs(degree);
392         }
393         gearShootingStartLatitudeDms.setDegree(degree);
394         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE, oldValue, degree);
395     }
396 
397     public Integer getGearShootingStartLatitudeDmsMinute() {
398         return gearShootingStartLatitudeDms.getMinute();
399     }
400 
401     public void setGearShootingStartLatitudeDmsMinute(Integer minute) {
402         Object oldValue = getGearShootingStartLatitudeDmsMinute();
403         gearShootingStartLatitudeDms.setMinute(minute);
404         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE, oldValue, minute);
405     }
406 
407     public Integer getGearShootingStartLatitudeDmsSecond() {
408         return gearShootingStartLatitudeDms.getSecond();
409     }
410 
411     public void setGearShootingStartLatitudeDmsSecond(Integer second) {
412         Object oldValue = getGearShootingStartLatitudeDmsSecond();
413         gearShootingStartLatitudeDms.setSecond(second);
414         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND, oldValue, second);
415     }
416 
417     public DmdCoordinate getGearShootingStartLatitudeDmd() {
418         return gearShootingStartLatitudeDmd;
419     }
420 
421     public void setGearShootingStartLatitudeDmd(Float decimal) {
422         DmdCoordinate position =
423                 DmdCoordinate.valueOf(decimal);
424         setGearShootingStartLatitudeDmdSign(position.isSign());
425         setGearShootingStartLatitudeDmdDegree(position.getDegree());
426         setGearShootingStartLatitudeDmdMinute(position.getMinute());
427         setGearShootingStartLatitudeDmdDecimal(position.getDecimal());
428         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD, null, getGearShootingStartLatitudeDmd());
429     }
430 
431     public boolean isGearShootingStartLatitudeDmdSign() {
432         return gearShootingStartLatitudeDmd.isSign();
433     }
434 
435     public void setGearShootingStartLatitudeDmdSign(boolean sign) {
436         Object oldValue = isGearShootingStartLatitudeDmdSign();
437         gearShootingStartLatitudeDmd.setSign(sign);
438         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN, oldValue, sign);
439     }
440 
441     public Integer getGearShootingStartLatitudeDmdDegree() {
442         return gearShootingStartLatitudeDmd.getDegree();
443     }
444 
445     public void setGearShootingStartLatitudeDmdDegree(Integer degree) {
446         Object oldValue = getGearShootingStartLatitudeDmdDegree();
447         gearShootingStartLatitudeDmd.setDegree(degree);
448         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE, oldValue, degree);
449     }
450 
451     public Integer getGearShootingStartLatitudeDmdMinute() {
452         return gearShootingStartLatitudeDmd.getMinute();
453     }
454 
455     public void setGearShootingStartLatitudeDmdMinute(Integer minute) {
456         Object oldValue = getGearShootingStartLatitudeDmdMinute();
457         gearShootingStartLatitudeDmd.setMinute(minute);
458         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE, oldValue, minute);
459     }
460 
461     public Integer getGearShootingStartLatitudeDmdDecimal() {
462         return gearShootingStartLatitudeDmd.getDecimal();
463     }
464 
465     public void setGearShootingStartLatitudeDmdDecimal(Integer decimal) {
466         Object oldValue = getGearShootingStartLatitudeDmdDecimal();
467         gearShootingStartLatitudeDmd.setDecimal(decimal);
468         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DECIMAL, oldValue, decimal);
469     }
470 
471     //------------------------------------------------------------------------//
472     //-- Start Longitude -----------------------------------------------------//
473     //------------------------------------------------------------------------//
474 
475     public DmsCoordinate getGearShootingStartLongitudeDms() {
476         return gearShootingStartLongitudeDms;
477     }
478 
479     public void setGearShootingStartLongitudeDms(Float decimal) {
480         DmsCoordinate position =
481                 DmsCoordinate.valueOf(decimal);
482         setGearShootingStartLongitudeDmsSign(position.isSign());
483         setGearShootingStartLongitudeDmsDegree(position.getDegree());
484         setGearShootingStartLongitudeDmsMinute(position.getMinute());
485         setGearShootingStartLongitudeDmsSecond(position.getSecond());
486         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS, null, getGearShootingStartLongitudeDms());
487     }
488 
489     public boolean isGearShootingStartLongitudeDmsSign() {
490         return gearShootingStartLongitudeDms.isSign();
491     }
492 
493     public void setGearShootingStartLongitudeDmsSign(boolean sign) {
494         Object oldValue = isGearShootingStartLongitudeDmsSign();
495         gearShootingStartLongitudeDms.setSign(sign);
496         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN, oldValue, sign);
497     }
498 
499     public Integer getGearShootingStartLongitudeDmsDegree() {
500         return gearShootingStartLongitudeDms.getDegree();
501     }
502 
503     public void setGearShootingStartLongitudeDmsDegree(Integer degree) {
504         Object oldValue = getGearShootingStartLongitudeDmsDegree();
505         if (degree != null) {
506             degree = Math.abs(degree);
507         }
508         gearShootingStartLongitudeDms.setDegree(degree);
509         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE, oldValue, degree);
510     }
511 
512     public Integer getGearShootingStartLongitudeDmsMinute() {
513         return gearShootingStartLongitudeDms.getMinute();
514     }
515 
516     public void setGearShootingStartLongitudeDmsMinute(Integer minute) {
517         Object oldValue = getGearShootingStartLongitudeDmsMinute();
518         gearShootingStartLongitudeDms.setMinute(minute);
519         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE, oldValue, minute);
520     }
521 
522     public Integer getGearShootingStartLongitudeDmsSecond() {
523         return gearShootingStartLongitudeDms.getSecond();
524     }
525 
526     public void setGearShootingStartLongitudeDmsSecond(Integer second) {
527         Object oldValue = getGearShootingStartLongitudeDmsSecond();
528         gearShootingStartLongitudeDms.setSecond(second);
529         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND, oldValue, second);
530     }
531 
532     public DmdCoordinate getGearShootingStartLongitudeDmd() {
533         return gearShootingStartLongitudeDmd;
534     }
535 
536     public void setGearShootingStartLongitudeDmd(Float decimal) {
537         DmdCoordinate position =
538                 DmdCoordinate.valueOf(decimal);
539         setGearShootingStartLongitudeDmdSign(position.isSign());
540         setGearShootingStartLongitudeDmdDegree(position.getDegree());
541         setGearShootingStartLongitudeDmdMinute(position.getMinute());
542         setGearShootingStartLongitudeDmdDecimal(position.getDecimal());
543         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD, null, getGearShootingStartLongitudeDmd());
544     }
545 
546     public boolean isGearShootingStartLongitudeDmdSign() {
547         return gearShootingStartLongitudeDmd.isSign();
548     }
549 
550     public void setGearShootingStartLongitudeDmdSign(boolean sign) {
551         Object oldValue = isGearShootingStartLongitudeDmdSign();
552         gearShootingStartLongitudeDmd.setSign(sign);
553         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN, oldValue, sign);
554     }
555 
556     public Integer getGearShootingStartLongitudeDmdDegree() {
557         return gearShootingStartLongitudeDmd.getDegree();
558     }
559 
560     public void setGearShootingStartLongitudeDmdDegree(Integer degree) {
561         Object oldValue = getGearShootingStartLongitudeDmdDegree();
562         if (degree != null) {
563             degree = Math.abs(degree);
564         }
565         gearShootingStartLongitudeDmd.setDegree(degree);
566         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE, oldValue, degree);
567     }
568 
569     public Integer getGearShootingStartLongitudeDmdMinute() {
570         return gearShootingStartLongitudeDmd.getMinute();
571     }
572 
573     public void setGearShootingStartLongitudeDmdMinute(Integer minute) {
574         Object oldValue = getGearShootingStartLongitudeDmdMinute();
575         gearShootingStartLongitudeDmd.setMinute(minute);
576         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE, oldValue, minute);
577     }
578 
579     public Integer getGearShootingStartLongitudeDmdDecimal() {
580         return gearShootingStartLongitudeDmd.getDecimal();
581     }
582 
583     public void setGearShootingStartLongitudeDmdDecimal(Integer minute) {
584         Object oldValue = getGearShootingStartLongitudeDmdDecimal();
585         gearShootingStartLongitudeDmd.setDecimal(minute);
586         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DECIMAL, oldValue, minute);
587     }
588 
589     //------------------------------------------------------------------------//
590     //-- End Latitude --------------------------------------------------------//
591     //------------------------------------------------------------------------//
592 
593     public DmsCoordinate getGearShootingEndLatitudeDms() {
594         return gearShootingEndLatitudeDms;
595     }
596 
597     public void setGearShootingEndLatitudeDms(Float decimal) {
598         DmsCoordinate position =
599                 DmsCoordinate.valueOf(decimal);
600         setGearShootingEndLatitudeDmsSign(position.isSign());
601         setGearShootingEndLatitudeDmsDegree(position.getDegree());
602         setGearShootingEndLatitudeDmsMinute(position.getMinute());
603         setGearShootingEndLatitudeDmsSecond(position.getSecond());
604         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS, null, getGearShootingEndLatitudeDms());
605     }
606 
607     public boolean isGearShootingEndLatitudeDmsSign() {
608         return gearShootingEndLatitudeDms.isSign();
609     }
610 
611     public void setGearShootingEndLatitudeDmsSign(boolean sign) {
612         Object oldValue = isGearShootingEndLatitudeDmsSign();
613         gearShootingEndLatitudeDms.setSign(sign);
614         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN, oldValue, sign);
615     }
616 
617     public Integer getGearShootingEndLatitudeDmsDegree() {
618         return gearShootingEndLatitudeDms.getDegree();
619     }
620 
621     public void setGearShootingEndLatitudeDmsDegree(Integer degree) {
622         Object oldValue = getGearShootingEndLatitudeDmsDegree();
623         if (degree != null) {
624             degree = Math.abs(degree);
625         }
626         gearShootingEndLatitudeDms.setDegree(degree);
627         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE, oldValue, degree);
628     }
629 
630     public Integer getGearShootingEndLatitudeDmsMinute() {
631         return gearShootingEndLatitudeDms.getMinute();
632     }
633 
634     public void setGearShootingEndLatitudeDmsMinute(Integer minute) {
635         Object oldValue = getGearShootingEndLatitudeDmsMinute();
636         gearShootingEndLatitudeDms.setMinute(minute);
637         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE, oldValue, minute);
638     }
639 
640     public Integer getGearShootingEndLatitudeDmsSecond() {
641         return gearShootingEndLatitudeDms.getSecond();
642     }
643 
644     public void setGearShootingEndLatitudeDmsSecond(Integer second) {
645         Object oldValue = getGearShootingEndLatitudeDmsSecond();
646         gearShootingEndLatitudeDms.setSecond(second);
647         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND, oldValue, second);
648     }
649 
650     public DmdCoordinate getGearShootingEndLatitudeDmd() {
651         return gearShootingEndLatitudeDmd;
652     }
653 
654     public void setGearShootingEndLatitudeDmd(Float decimal) {
655         DmdCoordinate position =
656                 DmdCoordinate.valueOf(decimal);
657         setGearShootingEndLatitudeDmdSign(position.isSign());
658         setGearShootingEndLatitudeDmdDegree(position.getDegree());
659         setGearShootingEndLatitudeDmdMinute(position.getMinute());
660         setGearShootingEndLatitudeDmdDecimal(position.getDecimal());
661         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD, null, getGearShootingEndLatitudeDmd());
662     }
663 
664     public boolean isGearShootingEndLatitudeDmdSign() {
665         return gearShootingEndLatitudeDmd.isSign();
666     }
667 
668     public void setGearShootingEndLatitudeDmdSign(boolean sign) {
669         Object oldValue = isGearShootingEndLatitudeDmdSign();
670         gearShootingEndLatitudeDmd.setSign(sign);
671         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN, oldValue, sign);
672     }
673 
674     public Integer getGearShootingEndLatitudeDmdDegree() {
675         return gearShootingEndLatitudeDmd.getDegree();
676     }
677 
678     public void setGearShootingEndLatitudeDmdDegree(Integer degree) {
679         Object oldValue = getGearShootingEndLatitudeDmdDegree();
680         gearShootingEndLatitudeDmd.setDegree(degree);
681         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE, oldValue, degree);
682     }
683 
684     public Integer getGearShootingEndLatitudeDmdMinute() {
685         return gearShootingEndLatitudeDmd.getMinute();
686     }
687 
688     public void setGearShootingEndLatitudeDmdMinute(Integer minute) {
689         Object oldValue = getGearShootingEndLatitudeDmdMinute();
690         gearShootingEndLatitudeDmd.setMinute(minute);
691         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE, oldValue, minute);
692     }
693 
694     public Integer getGearShootingEndLatitudeDmdDecimal() {
695         return gearShootingEndLatitudeDmd.getDecimal();
696     }
697 
698     public void setGearShootingEndLatitudeDmdDecimal(Integer minute) {
699         Object oldValue = getGearShootingEndLatitudeDmdDecimal();
700         gearShootingEndLatitudeDmd.setDecimal(minute);
701         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DECIMAL, oldValue, minute);
702     }
703 
704     //------------------------------------------------------------------------//
705     //-- End Longitude -------------------------------------------------------//
706     //------------------------------------------------------------------------//
707 
708     public DmsCoordinate getGearShootingEndLongitudeDms() {
709         return gearShootingEndLongitudeDms;
710     }
711 
712     public void setGearShootingEndLongitudeDms(Float decimal) {
713         DmsCoordinate position =
714                 DmsCoordinate.valueOf(decimal);
715         setGearShootingEndLongitudeDmsSign(position.isSign());
716         setGearShootingEndLongitudeDmsDegree(position.getDegree());
717         setGearShootingEndLongitudeDmsMinute(position.getMinute());
718         setGearShootingEndLongitudeDmsSecond(position.getSecond());
719         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS, null, getGearShootingEndLongitudeDms());
720     }
721 
722     public boolean isGearShootingEndLongitudeDmsSign() {
723         return gearShootingEndLongitudeDms.isSign();
724     }
725 
726     public void setGearShootingEndLongitudeDmsSign(boolean sign) {
727         Object oldValue = isGearShootingEndLongitudeDmsSign();
728         gearShootingEndLongitudeDms.setSign(sign);
729         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN, oldValue, sign);
730     }
731 
732     public Integer getGearShootingEndLongitudeDmsDegree() {
733         return gearShootingEndLongitudeDms.getDegree();
734     }
735 
736     public void setGearShootingEndLongitudeDmsDegree(Integer degree) {
737         Object oldValue = getGearShootingEndLongitudeDmsDegree();
738         if (degree != null) {
739             degree = Math.abs(degree);
740         }
741         gearShootingEndLongitudeDms.setDegree(degree);
742         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE, oldValue, degree);
743     }
744 
745     public Integer getGearShootingEndLongitudeDmsMinute() {
746         return gearShootingEndLongitudeDms.getMinute();
747     }
748 
749     public void setGearShootingEndLongitudeDmsMinute(Integer minute) {
750         Object oldValue = getGearShootingEndLongitudeDmsMinute();
751         gearShootingEndLongitudeDms.setMinute(minute);
752         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE, oldValue, minute);
753     }
754 
755     public Integer getGearShootingEndLongitudeDmsSecond() {
756         return gearShootingEndLongitudeDms.getSecond();
757     }
758 
759     public void setGearShootingEndLongitudeDmsSecond(Integer second) {
760         Object oldValue = getGearShootingEndLongitudeDmsSecond();
761         gearShootingEndLongitudeDms.setSecond(second);
762         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND, oldValue, second);
763     }
764 
765     public DmdCoordinate getGearShootingEndLongitudeDmd() {
766         return gearShootingEndLongitudeDmd;
767     }
768 
769     public void setGearShootingEndLongitudeDmd(Float decimal) {
770         DmdCoordinate position =
771                 DmdCoordinate.valueOf(decimal);
772         setGearShootingEndLongitudeDmdSign(position.isSign());
773         setGearShootingEndLongitudeDmdDegree(position.getDegree());
774         setGearShootingEndLongitudeDmdMinute(position.getMinute());
775         setGearShootingEndLongitudeDmdDecimal(position.getDecimal());
776         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD, null, getGearShootingEndLongitudeDmd());
777     }
778 
779     public boolean isGearShootingEndLongitudeDmdSign() {
780         return gearShootingEndLongitudeDmd.isSign();
781     }
782 
783     public void setGearShootingEndLongitudeDmdSign(boolean sign) {
784         Object oldValue = isGearShootingEndLongitudeDmdSign();
785         gearShootingEndLongitudeDmd.setSign(sign);
786         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN, oldValue, sign);
787     }
788 
789     public Integer getGearShootingEndLongitudeDmdDegree() {
790         return gearShootingEndLongitudeDmd.getDegree();
791     }
792 
793     public void setGearShootingEndLongitudeDmdDegree(Integer degree) {
794         Object oldValue = gearShootingEndLongitudeDmd.getDegree();
795         gearShootingEndLongitudeDmd.setDegree(degree);
796         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE, oldValue, degree);
797     }
798 
799     public Integer getGearShootingEndLongitudeDmdMinute() {
800         return gearShootingEndLongitudeDmd.getMinute();
801     }
802 
803     public void setGearShootingEndLongitudeDmdMinute(Integer minute) {
804         Object oldValue = gearShootingEndLongitudeDmd.getMinute();
805         gearShootingEndLongitudeDmd.setMinute(minute);
806         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE, oldValue, minute);
807     }
808 
809     public Integer getGearShootingEndLongitudeDmdDecimal() {
810         return gearShootingEndLongitudeDmd.getDecimal();
811     }
812 
813     public void setGearShootingEndLongitudeDmdDecimal(Integer decimal) {
814         Object oldValue = gearShootingEndLongitudeDmd.getDecimal();
815         gearShootingEndLongitudeDmd.setDecimal(decimal);
816         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DECIMAL, oldValue, decimal);
817     }
818 
819     //------------------------------------------------------------------------//
820     //-- Start - End Time ----------------------------------------------------//
821     //------------------------------------------------------------------------//
822 
823     public void setGearShootingStartTime(Date gearShootingStartDate) {
824         Date currentGearShootingStartDate = getGearShootingStartDate();
825         if (currentGearShootingStartDate != null && gearShootingStartDate != null) {
826             Calendar currentCalendar = DateUtil.getDefaultCalendar(currentGearShootingStartDate);
827             Calendar timeCalendar = DateUtil.getDefaultCalendar(gearShootingStartDate);
828             currentCalendar.set(Calendar.HOUR_OF_DAY, timeCalendar.get(Calendar.HOUR_OF_DAY));
829             currentCalendar.set(Calendar.MINUTE, timeCalendar.get(Calendar.MINUTE));
830             setGearShootingStartDate(currentCalendar.getTime());
831         }
832     }
833 
834     public void setGearShootingEndTime(Date gearShootingEndDate) {
835         Date currentGearShootingEndDate = getGearShootingEndDate();
836         if (currentGearShootingEndDate != null && gearShootingEndDate != null) {
837             Calendar currentCalendar = DateUtil.getDefaultCalendar(currentGearShootingEndDate);
838             Calendar timeCalendar = DateUtil.getDefaultCalendar(gearShootingEndDate);
839             currentCalendar.set(Calendar.HOUR_OF_DAY, timeCalendar.get(Calendar.HOUR_OF_DAY));
840             currentCalendar.set(Calendar.MINUTE, timeCalendar.get(Calendar.MINUTE));
841             setGearShootingEndDate(currentCalendar.getTime());
842         }
843     }
844 
845     public String getValidationContext() {
846         return validationContext;
847     }
848 
849     public void setValidationContext(String validationContext) {
850         Object oldValue = getValidationContext();
851         this.validationContext = validationContext;
852         firePropertyChange(PROPERTY_VALIDATION_CONTEXT, oldValue, validationContext);
853     }
854 
855     public CoordinateEditorType getCoordinateEditorType() {
856         return coordinateEditorType;
857     }
858 
859     public void setCoordinateEditorType(CoordinateEditorType coordinateEditorType) {
860         this.coordinateEditorType = coordinateEditorType;
861     }
862 
863     public boolean isDateInCruise(Date date) {
864         return DateUtil.between(date, getCruise().getBeginDate(), getCruise().getEndDate());
865     }
866 
867     public boolean isValidDuration() {
868         int minutes = DateUtil.getDifferenceInMinutes(getGearShootingStartDate(), getGearShootingEndDate());
869         return minutes <= 45 && minutes >= 20;
870     }
871 
872     public boolean isCoordinateDms() {
873         return CoordinateEditorType.DMS.equals(getCoordinateEditorType());
874     }
875 
876     public boolean isCoordinateDmd() {
877         return CoordinateEditorType.DMD.equals(getCoordinateEditorType());
878     }
879 
880     public void convertGearShootingCoordinatesFromDD() {
881         switch (coordinateEditorType) {
882 
883             case DMS:
884                 setGearShootingStartLatitudeDms(getGearShootingStartLatitude());
885                 setGearShootingStartLongitudeDms(getGearShootingStartLongitude());
886                 setGearShootingEndLatitudeDms(getGearShootingEndLatitude());
887                 setGearShootingEndLongitudeDms(getGearShootingEndLongitude());
888                 break;
889 
890             case DMD:
891                 setGearShootingStartLatitudeDmd(getGearShootingStartLatitude());
892                 setGearShootingStartLongitudeDmd(getGearShootingStartLongitude());
893                 setGearShootingEndLatitudeDmd(getGearShootingEndLatitude());
894                 setGearShootingEndLongitudeDmd(getGearShootingEndLongitude());
895                 break;
896         }
897     }
898 
899     public void convertGearShootingCoordinatesToDD() {
900 
901         switch (coordinateEditorType) {
902 
903             case DMS:
904                 editObject.setGearShootingStartLatitude(
905                         gearShootingStartLatitudeDms.toDecimal());
906 
907                 editObject.setGearShootingStartLongitude(
908                         gearShootingStartLongitudeDms.toDecimal());
909 
910                 editObject.setGearShootingEndLatitude(
911                         gearShootingEndLatitudeDms.toDecimal());
912 
913                 editObject.setGearShootingEndLongitude(
914                         gearShootingEndLongitudeDms.toDecimal());
915                 break;
916 
917             case DMD:
918                 editObject.setGearShootingStartLatitude(
919                         gearShootingStartLatitudeDmd.toDecimal());
920 
921                 editObject.setGearShootingStartLongitude(
922                         gearShootingStartLongitudeDmd.toDecimal());
923 
924                 editObject.setGearShootingEndLatitude(
925                         gearShootingEndLatitudeDmd.toDecimal());
926 
927                 editObject.setGearShootingEndLongitude(
928                         gearShootingEndLongitudeDmd.toDecimal());
929                 break;
930         }
931     }
932 
933     public void computeDistance() {
934 
935         convertGearShootingCoordinatesToDD();
936 
937         if (getGearShootingStartLatitude() != null && getGearShootingStartLongitude() != null
938             && getGearShootingEndLatitude() != null && getGearShootingEndLongitude() != null) {
939             Integer distance = Distances.computeDistanceInMeters(
940                     getGearShootingStartLatitude(),
941                     getGearShootingStartLongitude(),
942                     getGearShootingEndLatitude(),
943                     getGearShootingEndLongitude());
944             setTrawlDistance(distance);
945         }
946     }
947 
948     public SecondaryVesselTypeEnum getSecondaryVesselType() {
949         return secondaryVesselType;
950     }
951 
952     public boolean isSecondaryVesselTypeAll() {
953         return SecondaryVesselTypeEnum.ALL.equals(getSecondaryVesselType());
954     }
955 
956     public boolean isSecondaryVesselTypeScientific() {
957         return SecondaryVesselTypeEnum.SCIENTIFIC.equals(getSecondaryVesselType());
958     }
959 
960     public boolean isSecondaryVesselTypeFishing() {
961         return SecondaryVesselTypeEnum.FISHING.equals(getSecondaryVesselType());
962     }
963 
964     public boolean isSecondaryVesselTypeOnlyCruise() {
965         return SecondaryVesselTypeEnum.ONLY_CRUISE.equals(getSecondaryVesselType());
966     }
967 
968     public void setSecondaryVesselType(SecondaryVesselTypeEnum secondaryVesselType) {
969         this.secondaryVesselType = secondaryVesselType;
970         firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE, null, secondaryVesselType);
971         firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_ALL, null, isSecondaryVesselTypeAll());
972         firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_SCIENTIFIC, null, isSecondaryVesselTypeScientific());
973         firePropertyChange(PROPERTY_SECONDARY_VESSEL_TYPE_FISHING, null, isSecondaryVesselTypeFishing());
974     }
975 
976     //------------------------------------------------------------------------//
977     //-- AttachmentModelAware methods                                       --//
978     //------------------------------------------------------------------------//
979 
980     @Override
981     public ObjectTypeCode getObjectType() {
982         return ObjectTypeCode.OPERATION;
983     }
984 
985     @Override
986     public Integer getObjectId() {
987         return getIdAsInt();
988     }
989 
990     @Override
991     public List<Attachment> getAttachment() {
992         return attachment;
993     }
994 
995     @Override
996     public void addAllAttachment(Collection<Attachment> attachments) {
997         this.attachment.addAll(attachments);
998         firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
999     }
1000 
1001     @Override
1002     public void addAttachment(Attachment attachment) {
1003         this.attachment.add(attachment);
1004         firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
1005     }
1006 
1007     @Override
1008     public void removeAllAttachment(Collection<Attachment> attachments) {
1009         this.attachment.removeAll(attachments);
1010         firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
1011     }
1012 
1013     @Override
1014     public void removeAttachment(Attachment attachment) {
1015         this.attachment.remove(attachment);
1016         firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
1017     }
1018 
1019     //------------------------------------------------------------------------//
1020     //-- FishingOperation methods                                           --//
1021     //------------------------------------------------------------------------//
1022 
1023     @Override
1024     public Cruise getCruise() {
1025         return editObject.getCruise();
1026     }
1027 
1028     @Override
1029     public void setCruise(Cruise cruise) {
1030         editObject.setCruise(cruise);
1031     }
1032 
1033     @Override
1034     public String getStationNumber() {
1035         return editObject.getStationNumber();
1036     }
1037 
1038     @Override
1039     public void setStationNumber(String stationNumber) {
1040         Object oldValue = getStationNumber();
1041         editObject.setStationNumber(stationNumber);
1042         firePropertyChange(PROPERTY_STATION_NUMBER, oldValue, stationNumber);
1043     }
1044 
1045     @Override
1046     public Integer getFishingOperationNumber() {
1047         return editObject.getFishingOperationNumber();
1048     }
1049 
1050     @Override
1051     public void setFishingOperationNumber(Integer fishingOperationNumber) {
1052         Object oldValue = getFishingOperationNumber();
1053         editObject.setFishingOperationNumber(fishingOperationNumber);
1054         firePropertyChange(PROPERTY_FISHING_OPERATION_NUMBER, oldValue, fishingOperationNumber);
1055     }
1056 
1057     @Override
1058     public TuttiLocation getStrata() {
1059         return editObject.getStrata();
1060     }
1061 
1062     @Override
1063     public void setStrata(TuttiLocation strata) {
1064         Object oldValue = getStrata();
1065         editObject.setStrata(strata);
1066         firePropertyChange(PROPERTY_STRATA, oldValue, strata);
1067     }
1068 
1069     @Override
1070     public TuttiLocation getSubStrata() {
1071         return editObject.getSubStrata();
1072     }
1073 
1074     @Override
1075     public void setSubStrata(TuttiLocation subStrata) {
1076         Object oldValue = getSubStrata();
1077         editObject.setSubStrata(subStrata);
1078         firePropertyChange(PROPERTY_SUB_STRATA, oldValue, subStrata);
1079     }
1080 
1081     @Override
1082     public Float getGearShootingStartLatitude() {
1083         return editObject.getGearShootingStartLatitude();
1084     }
1085 
1086     @Override
1087     public void setGearShootingStartLatitude(Float gearShootingStartLatitude) {
1088         Object oldValue = getGearShootingStartLatitude();
1089         editObject.setGearShootingStartLatitude(gearShootingStartLatitude);
1090         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE, oldValue, gearShootingStartLatitude);
1091     }
1092 
1093     @Override
1094     public Float getGearShootingStartLongitude() {
1095         return editObject.getGearShootingStartLongitude();
1096     }
1097 
1098     @Override
1099     public void setGearShootingStartLongitude(Float gearShootingStartLongitude) {
1100         Object oldValue = getGearShootingStartLongitude();
1101         editObject.setGearShootingStartLongitude(gearShootingStartLongitude);
1102         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE, oldValue, gearShootingStartLongitude);
1103     }
1104 
1105     @Override
1106     public Date getGearShootingStartDate() {
1107         return editObject.getGearShootingStartDate();
1108     }
1109 
1110     @Override
1111     public void setGearShootingStartDate(Date gearShootingStartDate) {
1112         Object oldValue = getGearShootingStartDate();
1113         if (gearShootingStartDate != null) {
1114             Calendar calendar = DateUtil.getDefaultCalendar(gearShootingStartDate);
1115             calendar.set(Calendar.SECOND, 0);
1116             editObject.setGearShootingStartDate(calendar.getTime());
1117 
1118         } else {
1119             editObject.setGearShootingStartDate(null);
1120         }
1121         firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DATE, oldValue, getGearShootingStartDate());
1122     }
1123 
1124     @Override
1125     public Float getGearShootingEndLatitude() {
1126         return editObject.getGearShootingEndLatitude();
1127     }
1128 
1129     @Override
1130     public void setGearShootingEndLatitude(Float gearShootingEndLatitude) {
1131         Object oldValue = getGearShootingEndLatitude();
1132         editObject.setGearShootingEndLatitude(gearShootingEndLatitude);
1133         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE, oldValue, gearShootingEndLatitude);
1134     }
1135 
1136     @Override
1137     public Float getGearShootingEndLongitude() {
1138         return editObject.getGearShootingEndLongitude();
1139     }
1140 
1141     @Override
1142     public void setGearShootingEndLongitude(Float gearShootingEndLongitude) {
1143         Object oldValue = getGearShootingEndLongitude();
1144         editObject.setGearShootingEndLongitude(gearShootingEndLongitude);
1145         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE, oldValue, gearShootingEndLongitude);
1146     }
1147 
1148     @Override
1149     public Date getGearShootingEndDate() {
1150         return editObject.getGearShootingEndDate();
1151     }
1152 
1153     @Override
1154     public void setGearShootingEndDate(Date gearShootingEndDate) {
1155         Object oldValue = getGearShootingEndDate();
1156         if (gearShootingEndDate != null) {
1157             Calendar calendar = DateUtil.getDefaultCalendar(gearShootingEndDate);
1158             calendar.set(Calendar.SECOND, 0);
1159             editObject.setGearShootingEndDate(calendar.getTime());
1160 
1161         } else {
1162             editObject.setGearShootingEndDate(null);
1163         }
1164         firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DATE, oldValue, getGearShootingEndDate());
1165     }
1166 
1167     @Override
1168     public boolean isFishingOperationRectiligne() {
1169         return editObject.isFishingOperationRectiligne();
1170     }
1171 
1172     @Override
1173     public void setFishingOperationRectiligne(boolean fishingOperationRectiligne) {
1174         Object oldValue = isFishingOperationRectiligne();
1175         editObject.setFishingOperationRectiligne(fishingOperationRectiligne);
1176         firePropertyChange(PROPERTY_FISHING_OPERATION_RECTILIGNE, oldValue, fishingOperationRectiligne);
1177     }
1178 
1179     @Override
1180     public Integer getTrawlDistance() {
1181         return editObject.getTrawlDistance();
1182     }
1183 
1184     @Override
1185     public void setTrawlDistance(Integer trawlDistance) {
1186         Object oldValue = getTrawlDistance();
1187         editObject.setTrawlDistance(trawlDistance);
1188         firePropertyChange(PROPERTY_TRAWL_DISTANCE, oldValue, trawlDistance);
1189     }
1190 
1191     @Override
1192     public Boolean getFishingOperationValid() {
1193         return editObject.getFishingOperationValid();
1194     }
1195 
1196     @Override
1197     public void setFishingOperationValid(Boolean fishingOperationValid) {
1198         Object oldValue = getFishingOperationValid();
1199         editObject.setFishingOperationValid(fishingOperationValid);
1200         firePropertyChange(PROPERTY_FISHING_OPERATION_VALID, oldValue, fishingOperationValid);
1201     }
1202 
1203     @Override
1204     public TuttiLocation getLocation() {
1205         return editObject.getLocation();
1206     }
1207 
1208     @Override
1209     public void setLocation(TuttiLocation location) {
1210         Object oldValue = getLocation();
1211         editObject.setLocation(location);
1212         firePropertyChange(PROPERTY_LOCATION, oldValue, location);
1213     }
1214 
1215     @Override
1216     public String getComment() {
1217         return editObject.getComment();
1218     }
1219 
1220     @Override
1221     public void setComment(String comment) {
1222         Object oldValue = getComment();
1223         editObject.setComment(comment);
1224         firePropertyChange(PROPERTY_COMMENT, oldValue, comment);
1225     }
1226 
1227     @Override
1228     public String getSynchronizationStatus() {
1229         return editObject.getSynchronizationStatus();
1230     }
1231 
1232     @Override
1233     public void setSynchronizationStatus(String synchronizationStatus) {
1234         String oldValue = getSynchronizationStatus();
1235         editObject.setSynchronizationStatus(synchronizationStatus);
1236         firePropertyChange(PROPERTY_SYNCHRONIZATION_STATUS, oldValue, synchronizationStatus);
1237     }
1238 
1239     @Override
1240     public List<Person> getRecorderPerson() {
1241         return editObject.getRecorderPerson();
1242     }
1243 
1244     @Override
1245     public void setRecorderPerson(List<Person> recorderPerson) {
1246         Object oldValue = null;
1247         List<Person> oldRecorderPerson = getRecorderPerson();
1248         if (oldRecorderPerson != null) {
1249             oldValue = Lists.newArrayList(oldRecorderPerson);
1250         }
1251         editObject.setRecorderPerson(Lists.<Person>newArrayList());
1252         if (recorderPerson != null) {
1253             getRecorderPerson().addAll(recorderPerson);
1254         }
1255         firePropertyChange(PROPERTY_RECORDER_PERSON, oldValue, recorderPerson);
1256     }
1257 
1258     @Override
1259     public Gear getGear() {
1260         return editObject.getGear();
1261     }
1262 
1263     @Override
1264     public void setGear(Gear gear) {
1265         Object oldValue = getGear();
1266         editObject.setGear(gear);
1267         firePropertyChange(PROPERTY_GEAR, oldValue, gear);
1268     }
1269 
1270     @Override
1271     public Vessel getVessel() {
1272         return editObject.getVessel();
1273     }
1274 
1275     @Override
1276     public void setVessel(Vessel vessel) {
1277         Object oldValue = getVessel();
1278         editObject.setVessel(vessel);
1279         firePropertyChange(PROPERTY_VESSEL, oldValue, vessel);
1280     }
1281 
1282     @Override
1283     public String getMultirigAggregation() {
1284         return editObject.getMultirigAggregation();
1285     }
1286 
1287     @Override
1288     public void setMultirigAggregation(String multirigAggregation) {
1289         Object oldValue = getMultirigAggregation();
1290         editObject.setMultirigAggregation(multirigAggregation);
1291         firePropertyChange(PROPERTY_MULTIRIG_AGGREGATION, oldValue, multirigAggregation);
1292     }
1293 
1294     @Override
1295     public Vessel getSecondaryVessel(int index) {
1296         return editObject.getSecondaryVessel(index);
1297     }
1298 
1299     @Override
1300     public boolean isSecondaryVesselEmpty() {
1301         return editObject.isSecondaryVesselEmpty();
1302     }
1303 
1304     @Override
1305     public int sizeSecondaryVessel() {
1306         return editObject.sizeSecondaryVessel();
1307     }
1308 
1309     @Override
1310     public void addSecondaryVessel(Vessel secondaryVessel) {
1311         editObject.addSecondaryVessel(secondaryVessel);
1312         firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
1313     }
1314 
1315     @Override
1316     public void addAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
1317         editObject.addAllSecondaryVessel(secondaryVessel);
1318         firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
1319     }
1320 
1321     @Override
1322     public boolean removeSecondaryVessel(Vessel secondaryVessel) {
1323         boolean result = editObject.removeSecondaryVessel(secondaryVessel);
1324         firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
1325         return result;
1326     }
1327 
1328     @Override
1329     public boolean removeAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
1330         boolean result = editObject.removeAllSecondaryVessel(secondaryVessel);
1331         firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
1332         return result;
1333     }
1334 
1335     @Override
1336     public boolean containsSecondaryVessel(Vessel secondaryVessel) {
1337         return editObject.containsSecondaryVessel(secondaryVessel);
1338     }
1339 
1340     @Override
1341     public boolean containsAllSecondaryVessel(Collection<Vessel> secondaryVessel) {
1342         return editObject.containsAllSecondaryVessel(secondaryVessel);
1343     }
1344 
1345     @Override
1346     public List<Vessel> getSecondaryVessel() {
1347         return editObject.getSecondaryVessel();
1348     }
1349 
1350     @Override
1351     public void setSecondaryVessel(List<Vessel> secondaryVessel) {
1352         editObject.setSecondaryVessel(secondaryVessel);
1353         firePropertyChange(PROPERTY_SECONDARY_VESSEL, null, getSecondaryVessel());
1354     }
1355 
1356     List<Vessel> allSecondaryVessel;
1357 
1358     List<Vessel> onlyCruisSecondaryVessel;
1359 
1360     List<Vessel> scientificSecondaryVessel;
1361 
1362     List<Vessel> fishingSecondaryVessel;
1363 
1364     public List<Vessel> getAllSecondaryVessel() {
1365         return allSecondaryVessel;
1366     }
1367 
1368     public void setAllSecondaryVessel(List<Vessel> allSecondaryVessel) {
1369         this.allSecondaryVessel = allSecondaryVessel;
1370     }
1371 
1372     public List<Vessel> getOnlyCruisSecondaryVessel() {
1373         return onlyCruisSecondaryVessel;
1374     }
1375 
1376     public void setOnlyCruisSecondaryVessel(List<Vessel> onlyCruisSecondaryVessel) {
1377         this.onlyCruisSecondaryVessel = onlyCruisSecondaryVessel;
1378     }
1379 
1380     public List<Vessel> getFishingSecondaryVessel() {
1381         return fishingSecondaryVessel;
1382     }
1383 
1384     public void setFishingSecondaryVessel(List<Vessel> fishingSecondaryVessel) {
1385         this.fishingSecondaryVessel = fishingSecondaryVessel;
1386     }
1387 
1388     public List<Vessel> getScientificSecondaryVessel() {
1389         return scientificSecondaryVessel;
1390     }
1391 
1392     public void setScientificSecondaryVessel(List<Vessel> scientificSecondaryVessel) {
1393         this.scientificSecondaryVessel = scientificSecondaryVessel;
1394     }
1395 
1396     @Override
1397     public boolean isPlanktonObserved() {
1398         return false;
1399     }
1400 
1401     @Override
1402     public void setPlanktonObserved(boolean planktonObserved) {
1403     }
1404 
1405     @Override
1406     public CaracteristicMap getVesselUseFeatures() {
1407         return null;
1408     }
1409 
1410     @Override
1411     public void setVesselUseFeatures(CaracteristicMap vesselUseFeatures) {
1412     }
1413 
1414     @Override
1415     public CaracteristicMap getGearUseFeatures() {
1416         return null;
1417     }
1418 
1419     @Override
1420     public void setGearUseFeatures(CaracteristicMap gearUseFeatures) {
1421     }
1422 
1423     @Override
1424     public boolean isAccidentalObserved() {
1425         return false;
1426     }
1427 
1428     @Override
1429     public void setAccidentalObserved(boolean accidentalObserved) {
1430     }
1431 
1432     @Override
1433     public Person getRecorderPerson(int index) {
1434         return null;
1435     }
1436 
1437     @Override
1438     public boolean isRecorderPersonEmpty() {
1439         return false;
1440     }
1441 
1442     @Override
1443     public int sizeRecorderPerson() {
1444         return 0;
1445     }
1446 
1447     @Override
1448     public void addRecorderPerson(Person recorderPerson) {
1449     }
1450 
1451     @Override
1452     public void addAllRecorderPerson(Collection<Person> recorderPerson) {
1453     }
1454 
1455     @Override
1456     public boolean removeRecorderPerson(Person recorderPerson) {
1457         return false;
1458     }
1459 
1460     @Override
1461     public boolean removeAllRecorderPerson(Collection<Person> recorderPerson) {
1462         return false;
1463     }
1464 
1465     @Override
1466     public boolean containsRecorderPerson(Person recorderPerson) {
1467         return false;
1468     }
1469 
1470     @Override
1471     public boolean containsAllRecorderPerson(Collection<Person> recorderPerson) {
1472         return false;
1473     }
1474 
1475     public boolean isImportFromColumnFileEnabled() {
1476         return importFromColumnFileEnabled;
1477     }
1478 
1479     public void setImportFromColumnFileEnabled(boolean importFromColumnFileEnabled) {
1480         this.importFromColumnFileEnabled = importFromColumnFileEnabled;
1481     }
1482 }