Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe

Commits:

11 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineTableModel.java
    ... ... @@ -112,7 +112,7 @@ public class GearUseFeaturesLonglineTableModel extends ContentTableModel<TripLon
    112 112
                 measurements = measurementsTableModel.getData();
    
    113 113
             }
    
    114 114
     
    
    115
    -        rowBean.setGearUseFeaturesMeasurement(Sets.newLinkedHashSet(measurements));
    
    115
    +        rowBean.setGearUseFeaturesMeasurement(measurements);
    
    116 116
     
    
    117 117
             super.updateRowFromEditBean();
    
    118 118
     
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.longline;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -46,6 +46,7 @@ import fr.ird.observe.dto.referential.GearDto;
    46 46
     import fr.ird.observe.dto.referential.GearReference;
    
    47 47
     import fr.ird.observe.dto.result.SaveResultDto;
    
    48 48
     import fr.ird.observe.services.service.referential.ReferentialService;
    
    49
    +import org.apache.commons.lang3.StringUtils;
    
    49 50
     import org.apache.commons.logging.Log;
    
    50 51
     import org.apache.commons.logging.LogFactory;
    
    51 52
     import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    ... ... @@ -62,6 +63,7 @@ import java.awt.GridBagConstraints;
    62 63
     import java.awt.Insets;
    
    63 64
     import java.beans.PropertyChangeListener;
    
    64 65
     import java.util.Collections;
    
    66
    +import java.util.Comparator;
    
    65 67
     import java.util.HashSet;
    
    66 68
     import java.util.List;
    
    67 69
     import java.util.Set;
    
    ... ... @@ -80,10 +82,9 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    80 82
     
    
    81 83
         /** Logger */
    
    82 84
         private static final Log log = LogFactory.getLog(GearUseFeaturesLonglineUIHandler.class);
    
    83
    -
    
    85
    +    private final Comparator<GearUseFeaturesMeasurementLonglineDto> GEAR_USE_FEATURES_MEASUREMENT_LONGLINE_DTO_COMPARATOR;
    
    84 86
         // Compute valid state of tab from the error table
    
    85 87
         protected final TableModelListener computeTabValidStateListener;
    
    86
    -
    
    87 88
         private final PropertyChangeListener measurementsTableModelModified;
    
    88 89
     
    
    89 90
         GearUseFeaturesLonglineUIHandler() {
    
    ... ... @@ -95,6 +96,7 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    95 96
     
    
    96 97
             };
    
    97 98
             measurementsTableModelModified = evt -> onMeasurementsTableModelModified((Boolean) evt.getNewValue());
    
    99
    +        GEAR_USE_FEATURES_MEASUREMENT_LONGLINE_DTO_COMPARATOR = Comparator.comparing(m -> StringUtils.leftPad(m.getGearCaracteristic().getCode(), 6, "0"));
    
    98 100
         }
    
    99 101
     
    
    100 102
         @Override
    
    ... ... @@ -168,12 +170,12 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    168 170
     
    
    169 171
                 ObserveMainUI mainUI = ObserveSwingApplicationContext.get().getMainUI();
    
    170 172
                 int response = UIHelper.askUser(mainUI,
    
    171
    -                                            t("observe.title.delete"),
    
    172
    -                                            t("observe.common.GearUseFeatures.delete"),
    
    173
    -                                            JOptionPane.WARNING_MESSAGE,
    
    174
    -                                            new Object[]{t("observe.choice.confirm.delete"),
    
    175
    -                                                    t("observe.choice.cancel")},
    
    176
    -                                            1);
    
    173
    +                    t("observe.title.delete"),
    
    174
    +                    t("observe.common.GearUseFeatures.delete"),
    
    175
    +                    JOptionPane.WARNING_MESSAGE,
    
    176
    +                    new Object[]{t("observe.choice.confirm.delete"),
    
    177
    +                            t("observe.choice.cancel")},
    
    178
    +                    1);
    
    177 179
     
    
    178 180
                 if (response != 0) {
    
    179 181
     
    
    ... ... @@ -205,6 +207,7 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    205 207
                         }
    
    206 208
                         return measurementLonglineDto;
    
    207 209
                     })
    
    210
    +                .sorted(GEAR_USE_FEATURES_MEASUREMENT_LONGLINE_DTO_COMPARATOR)
    
    208 211
                     .collect(Collectors.toList());
    
    209 212
         }
    
    210 213
     
    
    ... ... @@ -296,14 +299,14 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    296 299
                 JTable table = getUi().getTable();
    
    297 300
     
    
    298 301
                 UIHelper.setI18nTableHeaderRenderer(table,
    
    299
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.gear"),
    
    300
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.gear.tip"),
    
    301
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.number"),
    
    302
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.number.tip"),
    
    303
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.usedInTrip"),
    
    304
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.usedInTrip.tip"),
    
    305
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.comment"),
    
    306
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.comment.tip"));
    
    302
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.gear"),
    
    303
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.gear.tip"),
    
    304
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.number"),
    
    305
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.number.tip"),
    
    306
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.usedInTrip"),
    
    307
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.usedInTrip.tip"),
    
    308
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.comment"),
    
    309
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.comment.tip"));
    
    307 310
     
    
    308 311
                 UIHelper.setTableColumnRenderer(table, 0, UIHelper.newReferentialReferenceDecorateTableCellRenderer(renderer, GearReference.class));
    
    309 312
                 UIHelper.setTableColumnRenderer(table, 1, UIHelper.newEmptyNumberTableCellRenderer(renderer));
    
    ... ... @@ -316,10 +319,10 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    316 319
                 JTable table = getUi().getMeasurementsTable();
    
    317 320
     
    
    318 321
                 UIHelper.setI18nTableHeaderRenderer(table,
    
    319
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.gearCaracteristic"),
    
    320
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.gearCaracteristic.tip"),
    
    321
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.value"),
    
    322
    -                                                n("observe.common.GearUseFeaturesLonglineDto.table.value.tip"));
    
    322
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.gearCaracteristic"),
    
    323
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.gearCaracteristic.tip"),
    
    324
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.value"),
    
    325
    +                    n("observe.common.GearUseFeaturesLonglineDto.table.value.tip"));
    
    323 326
     
    
    324 327
                 UIHelper.setTableColumnRenderer(table, 0, UIHelper.newReferentialReferenceDecorateTableCellRenderer(renderer, GearCaracteristicReference.class));
    
    325 328
                 UIHelper.setTableColumnRenderer(table, 1, new GearUseFeatureMeasurementCellRenderer(0, renderer));
    
    ... ... @@ -334,12 +337,12 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    334 337
                 UIHelper.setTableColumnEditor(table, 1, new GearUseFeatureMeasurementCellEditor(0));
    
    335 338
     
    
    336 339
                 initInlineTable(getUi().getMeasurementsScrollPane(),
    
    337
    -                            table,
    
    338
    -                            getModel().getMeasurementsTableModel(),
    
    339
    -                            measurementsTableModelModified,
    
    340
    -                            getUi().getMeasurementsTablePopup(),
    
    341
    -                            getUi().getAddMeasurement(),
    
    342
    -                            getUi().getDeleteSelectedMeasurement());
    
    340
    +                    table,
    
    341
    +                    getModel().getMeasurementsTableModel(),
    
    342
    +                    measurementsTableModelModified,
    
    343
    +                    getUi().getMeasurementsTablePopup(),
    
    344
    +                    getUi().getAddMeasurement(),
    
    345
    +                    getUi().getDeleteSelectedMeasurement());
    
    343 346
     
    
    344 347
             }
    
    345 348
     
    
    ... ... @@ -406,9 +409,9 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    406 409
             // mode lecture : la marée n'est pas ouverte
    
    407 410
     
    
    408 411
             addMessage(getUi(),
    
    409
    -                   NuitonValidatorScope.INFO,
    
    410
    -                   getTypeI18nKey(TripLonglineDto.class),
    
    411
    -                   t("observe.common.TripLonglineDto.message.not.open"));
    
    412
    +                NuitonValidatorScope.INFO,
    
    413
    +                getTypeI18nKey(TripLonglineDto.class),
    
    414
    +                t("observe.common.TripLonglineDto.message.not.open"));
    
    412 415
     
    
    413 416
             return ContentMode.READ;
    
    414 417
         }
    
    ... ... @@ -475,6 +478,9 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
    475 478
         protected void loadEditBean(String beanId) {
    
    476 479
             Form<TripLonglineGearUseDto> form = getTripLonglineGearUseService().loadForm(beanId);
    
    477 480
             loadReferentialReferenceSetsInModel(form);
    
    481
    +        for (GearUseFeaturesLonglineDto gearUseFeaturesLonglineDto : form.getObject().getGearUseFeaturesLongline()) {
    
    482
    +            gearUseFeaturesLonglineDto.getGearUseFeaturesMeasurement().sort(GEAR_USE_FEATURES_MEASUREMENT_LONGLINE_DTO_COMPARATOR);
    
    483
    +        }
    
    478 484
             getModel().setForm(form);
    
    479 485
             TripLonglineGearUseHelper.copyTripLonglineGearUseDto(form.getObject(), getBean());
    
    480 486
         }
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesMeasurementLonglinesTableModel.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.longline;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -101,10 +101,12 @@ public class GearUseFeaturesMeasurementLonglinesTableModel extends EditableTable
    101 101
             switch (columnIndex) {
    
    102 102
                 case 0:
    
    103 103
                     measure.setGearCaracteristic((GearCaracteristicReference) aValue);
    
    104
    -                String gearCaracteristicTypeId = measure.getGearCaracteristic().getGearCaracteristicTypeId();
    
    105
    -                if (GearCaracteristicTypeHelper.isBoolean(gearCaracteristicTypeId)) {
    
    106
    -                    // on force à avoir false par défaut
    
    107
    -                    measure.setMeasurementValue("false");
    
    104
    +                if (aValue != null) {
    
    105
    +                    String gearCaracteristicTypeId = measure.getGearCaracteristic().getGearCaracteristicTypeId();
    
    106
    +                    if (GearCaracteristicTypeHelper.isBoolean(gearCaracteristicTypeId)) {
    
    107
    +                        // on force à avoir false par défaut
    
    108
    +                        measure.setMeasurementValue("false");
    
    109
    +                    }
    
    108 110
                     }
    
    109 111
                     break;
    
    110 112
                 case 1:
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/seine/GearUseFeaturesMeasurementSeinesTableModel.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.seine;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -101,10 +101,12 @@ public class GearUseFeaturesMeasurementSeinesTableModel extends EditableTableWit
    101 101
             switch (columnIndex) {
    
    102 102
                 case 0:
    
    103 103
                     measure.setGearCaracteristic((GearCaracteristicReference) aValue);
    
    104
    -                String gearCaracteristicTypeId = measure.getGearCaracteristic().getGearCaracteristicTypeId();
    
    105
    -                if (GearCaracteristicTypeHelper.isBoolean(gearCaracteristicTypeId)) {
    
    106
    -                    // on force à avoir false par défaut
    
    107
    -                    measure.setMeasurementValue("false");
    
    104
    +                if (aValue != null) {
    
    105
    +                    String gearCaracteristicTypeId = measure.getGearCaracteristic().getGearCaracteristicTypeId();
    
    106
    +                    if (GearCaracteristicTypeHelper.isBoolean(gearCaracteristicTypeId)) {
    
    107
    +                        // on force à avoir false par défaut
    
    108
    +                        measure.setMeasurementValue("false");
    
    109
    +                    }
    
    108 110
                     }
    
    109 111
                     break;
    
    110 112
                 case 1:
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/seine/GearUseFeaturesSeineTableModel.java
    ... ... @@ -10,19 +10,18 @@ package fr.ird.observe.client.ui.content.data.seine;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22 22
      * #L%
    
    23 23
      */
    
    24 24
     
    
    25
    -import com.google.common.collect.Sets;
    
    26 25
     import fr.ird.observe.client.ui.content.table.ContentTableMeta;
    
    27 26
     import fr.ird.observe.client.ui.content.table.ContentTableModel;
    
    28 27
     import fr.ird.observe.client.ui.content.table.ObserveContentTableUI;
    
    ... ... @@ -113,11 +112,8 @@ public class GearUseFeaturesSeineTableModel extends ContentTableModel<TripSeineG
    113 112
                 measurements = measurementsTableModel.getData();
    
    114 113
             }
    
    115 114
     
    
    116
    -        rowBean.setGearUseFeaturesMeasurement(Sets.newLinkedHashSet(measurements));
    
    117
    -
    
    115
    +        rowBean.setGearUseFeaturesMeasurement(measurements);
    
    118 116
             super.updateRowFromEditBean();
    
    119
    -
    
    120
    -
    
    121 117
         }
    
    122 118
     
    
    123 119
         @Override
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/seine/GearUseFeaturesSeineUIHandler.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.seine;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -46,6 +46,7 @@ import fr.ird.observe.dto.referential.GearDto;
    46 46
     import fr.ird.observe.dto.referential.GearReference;
    
    47 47
     import fr.ird.observe.dto.result.SaveResultDto;
    
    48 48
     import fr.ird.observe.services.service.referential.ReferentialService;
    
    49
    +import org.apache.commons.lang3.StringUtils;
    
    49 50
     import org.apache.commons.logging.Log;
    
    50 51
     import org.apache.commons.logging.LogFactory;
    
    51 52
     import org.nuiton.jaxx.runtime.spi.UIHandler;
    
    ... ... @@ -62,6 +63,7 @@ import java.awt.GridBagConstraints;
    62 63
     import java.awt.Insets;
    
    63 64
     import java.beans.PropertyChangeListener;
    
    64 65
     import java.util.Collections;
    
    66
    +import java.util.Comparator;
    
    65 67
     import java.util.HashSet;
    
    66 68
     import java.util.List;
    
    67 69
     import java.util.Set;
    
    ... ... @@ -81,6 +83,8 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    81 83
         /** Logger */
    
    82 84
         private static final Log log = LogFactory.getLog(GearUseFeaturesSeineUIHandler.class);
    
    83 85
     
    
    86
    +    private final Comparator<GearUseFeaturesMeasurementSeineDto> GEAR_USE_FEATURES_MEASUREMENT_SEINE_DTO_COMPARATOR;
    
    87
    +
    
    84 88
         // Compute valid state of tab from the error table
    
    85 89
         protected final TableModelListener computeTabValidStateListener;
    
    86 90
     
    
    ... ... @@ -95,6 +99,7 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    95 99
     
    
    96 100
             };
    
    97 101
             measurementsTableModelModified = evt -> onMeasurementsTableModelModified((Boolean) evt.getNewValue());
    
    102
    +        GEAR_USE_FEATURES_MEASUREMENT_SEINE_DTO_COMPARATOR = Comparator.comparing(m -> StringUtils.leftPad(m.getGearCaracteristic().getCode(), 6, "0"));
    
    98 103
         }
    
    99 104
     
    
    100 105
         @Override
    
    ... ... @@ -169,11 +174,11 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    169 174
     
    
    170 175
                 ObserveMainUI mainUI = ObserveSwingApplicationContext.get().getMainUI();
    
    171 176
                 int response = UIHelper.askUser(mainUI,
    
    172
    -                                            t("observe.title.delete"),
    
    173
    -                                            t("observe.common.GearUseFeatures.delete"),
    
    174
    -                                            JOptionPane.WARNING_MESSAGE,
    
    175
    -                                            new Object[]{t("observe.choice.confirm.delete"), t("observe.choice.cancel")},
    
    176
    -                                            1);
    
    177
    +                    t("observe.title.delete"),
    
    178
    +                    t("observe.common.GearUseFeatures.delete"),
    
    179
    +                    JOptionPane.WARNING_MESSAGE,
    
    180
    +                    new Object[]{t("observe.choice.confirm.delete"), t("observe.choice.cancel")},
    
    181
    +                    1);
    
    177 182
     
    
    178 183
                 if (response != 0) {
    
    179 184
     
    
    ... ... @@ -205,6 +210,7 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    205 210
                         measurementSeineDto.setGearCaracteristic(input);
    
    206 211
                         return measurementSeineDto;
    
    207 212
                     })
    
    213
    +                .sorted(GEAR_USE_FEATURES_MEASUREMENT_SEINE_DTO_COMPARATOR)
    
    208 214
                     .collect(Collectors.toList());
    
    209 215
     
    
    210 216
         }
    
    ... ... @@ -295,14 +301,14 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    295 301
                 JTable table = getUi().getTable();
    
    296 302
     
    
    297 303
                 UIHelper.setI18nTableHeaderRenderer(table,
    
    298
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.gear"),
    
    299
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.gear.tip"),
    
    300
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.number"),
    
    301
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.number.tip"),
    
    302
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.usedInTrip"),
    
    303
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.usedInTrip.tip"),
    
    304
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.comment"),
    
    305
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.comment.tip"));
    
    304
    +                    n("observe.common.GearUseFeaturesSeineDto.table.gear"),
    
    305
    +                    n("observe.common.GearUseFeaturesSeineDto.table.gear.tip"),
    
    306
    +                    n("observe.common.GearUseFeaturesSeineDto.table.number"),
    
    307
    +                    n("observe.common.GearUseFeaturesSeineDto.table.number.tip"),
    
    308
    +                    n("observe.common.GearUseFeaturesSeineDto.table.usedInTrip"),
    
    309
    +                    n("observe.common.GearUseFeaturesSeineDto.table.usedInTrip.tip"),
    
    310
    +                    n("observe.common.GearUseFeaturesSeineDto.table.comment"),
    
    311
    +                    n("observe.common.GearUseFeaturesSeineDto.table.comment.tip"));
    
    306 312
     
    
    307 313
                 UIHelper.setTableColumnRenderer(table, 0, UIHelper.newReferentialReferenceDecorateTableCellRenderer(renderer, GearReference.class));
    
    308 314
                 UIHelper.setTableColumnRenderer(table, 1, UIHelper.newEmptyNumberTableCellRenderer(renderer));
    
    ... ... @@ -315,10 +321,10 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    315 321
                 JTable table = getUi().getMeasurementsTable();
    
    316 322
     
    
    317 323
                 UIHelper.setI18nTableHeaderRenderer(table,
    
    318
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.gearCaracteristic"),
    
    319
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.gearCaracteristic.tip"),
    
    320
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.value"),
    
    321
    -                                                n("observe.common.GearUseFeaturesSeineDto.table.value.tip"));
    
    324
    +                    n("observe.common.GearUseFeaturesSeineDto.table.gearCaracteristic"),
    
    325
    +                    n("observe.common.GearUseFeaturesSeineDto.table.gearCaracteristic.tip"),
    
    326
    +                    n("observe.common.GearUseFeaturesSeineDto.table.value"),
    
    327
    +                    n("observe.common.GearUseFeaturesSeineDto.table.value.tip"));
    
    322 328
     
    
    323 329
                 UIHelper.setTableColumnRenderer(table, 0, UIHelper.newReferentialReferenceDecorateTableCellRenderer(renderer, GearCaracteristicReference.class));
    
    324 330
                 UIHelper.setTableColumnRenderer(table, 1, new GearUseFeatureMeasurementCellRenderer(0, renderer));
    
    ... ... @@ -333,12 +339,12 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    333 339
                 UIHelper.setTableColumnEditor(table, 1, new GearUseFeatureMeasurementCellEditor(0));
    
    334 340
     
    
    335 341
                 initInlineTable(getUi().getMeasurementsScrollPane(),
    
    336
    -                            table,
    
    337
    -                            getModel().getMeasurementsTableModel(),
    
    338
    -                            measurementsTableModelModified,
    
    339
    -                            getUi().getMeasurementsTablePopup(),
    
    340
    -                            getUi().getAddMeasurement(),
    
    341
    -                            getUi().getDeleteSelectedMeasurement());
    
    342
    +                    table,
    
    343
    +                    getModel().getMeasurementsTableModel(),
    
    344
    +                    measurementsTableModelModified,
    
    345
    +                    getUi().getMeasurementsTablePopup(),
    
    346
    +                    getUi().getAddMeasurement(),
    
    347
    +                    getUi().getDeleteSelectedMeasurement());
    
    342 348
     
    
    343 349
             }
    
    344 350
     
    
    ... ... @@ -405,9 +411,9 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    405 411
             // mode lecture
    
    406 412
     
    
    407 413
             addMessage(getUi(),
    
    408
    -                   NuitonValidatorScope.INFO,
    
    409
    -                   getTypeI18nKey(TripSeineDto.class),
    
    410
    -                   t("observe.common.TripSeineDto.message.not.open"));
    
    414
    +                NuitonValidatorScope.INFO,
    
    415
    +                getTypeI18nKey(TripSeineDto.class),
    
    416
    +                t("observe.common.TripSeineDto.message.not.open"));
    
    411 417
     
    
    412 418
             return ContentMode.READ;
    
    413 419
         }
    
    ... ... @@ -475,6 +481,9 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei
    475 481
         protected void loadEditBean(String beanId) {
    
    476 482
             Form<TripSeineGearUseDto> form = getTripSeineGearUseService().loadForm(beanId);
    
    477 483
             loadReferentialReferenceSetsInModel(form);
    
    484
    +        for (GearUseFeaturesSeineDto gearUseFeaturesSeineDto : form.getObject().getGearUseFeaturesSeine()) {
    
    485
    +            gearUseFeaturesSeineDto.getGearUseFeaturesMeasurement().sort(GEAR_USE_FEATURES_MEASUREMENT_SEINE_DTO_COMPARATOR);
    
    486
    +        }
    
    478 487
             getModel().setForm(form);
    
    479 488
             TripSeineGearUseHelper.copyTripSeineGearUseDto(form.getObject(), getBean());
    
    480 489
         }
    

  • dto/src/main/models/Observe.model
    ... ... @@ -190,7 +190,7 @@ lineType {*:1} fr.ird.observe.dto.referential.longline.LineTypeReference
    190 190
     data.longline.GearUseFeaturesLongline > data.Commentable | references=number,usedInTrip
    
    191 191
     number + {*:1} Integer
    
    192 192
     usedInTrip + {*:1} Boolean
    
    193
    -gearUseFeaturesMeasurement + {*} data.longline.GearUseFeaturesMeasurementLongline | ordered unique
    
    193
    +gearUseFeaturesMeasurement + {*} data.longline.GearUseFeaturesMeasurementLongline | ordered
    
    194 194
     gear {*:1} fr.ird.observe.dto.referential.GearReference
    
    195 195
     
    
    196 196
     data.longline.GearUseFeaturesMeasurementLongline > data.Data
    
    ... ... @@ -349,7 +349,7 @@ data.longline.TripLonglineActivity > data.Data
    349 349
     timeStamp + {*:1} Date
    
    350 350
     
    
    351 351
     data.longline.TripLonglineGearUse > data.Data | form=data.longline.GearUseFeaturesLongline
    
    352
    -gearUseFeaturesLongline + {*} data.longline.GearUseFeaturesLongline | ordered unique
    
    352
    +gearUseFeaturesLongline + {*} data.longline.GearUseFeaturesLongline | ordered
    
    353 353
     
    
    354 354
     data.longline.WeightMeasure > data.Data | references=weightMeasureTypeLabel,weight
    
    355 355
     weight + {*:1} Float
    
    ... ... @@ -671,7 +671,7 @@ gearCaracteristic {*:1} fr.ird.observe.dto.referential.GearCaracteristicReferenc
    671 671
     data.seine.GearUseFeaturesSeine > data.Commentable | references=number,usedInTrip
    
    672 672
     number + {*:1} Integer
    
    673 673
     usedInTrip + {*:1} Boolean
    
    674
    -gearUseFeaturesMeasurement + {*} data.seine.GearUseFeaturesMeasurementSeine | unique
    
    674
    +gearUseFeaturesMeasurement + {*} data.seine.GearUseFeaturesMeasurementSeine | ordered
    
    675 675
     gear {*:1} fr.ird.observe.dto.referential.GearReference
    
    676 676
     
    
    677 677
     data.seine.NonTargetCatch > data.Commentable | references=speciesLabel,speciesFateLabel
    
    ... ... @@ -838,4 +838,4 @@ route {*} data.seine.RouteStub | ordered unique
    838 838
     program {*:1} fr.ird.observe.dto.referential.ProgramReference
    
    839 839
     
    
    840 840
     data.seine.TripSeineGearUse > data.Data | form=data.seine.GearUseFeaturesSeine
    
    841
    -gearUseFeaturesSeine + {*} data.seine.GearUseFeaturesSeine | ordered unique
    841
    +gearUseFeaturesSeine + {*} data.seine.GearUseFeaturesSeine | ordered

  • persistence/src/main/java/fr/ird/observe/binder/data/longline/GearUseFeaturesLonglineEntityDtoBinder.java
    ... ... @@ -58,7 +58,7 @@ public class GearUseFeaturesLonglineEntityDtoBinder extends DataEntityDtoBinderS
    58 58
             dto.setNumber(entity.getNumber());
    
    59 59
             dto.setUsedInTrip(entity.getUsedInTrip());
    
    60 60
             dto.setGear(toReferentialReference(referentialLocale, entity.getGear()));
    
    61
    -        dto.setGearUseFeaturesMeasurement(toLinkedHashSetData(referentialLocale, entity.getGearUseFeaturesMeasurement()));
    
    61
    +        dto.setGearUseFeaturesMeasurement(toListData(referentialLocale, entity.getGearUseFeaturesMeasurement()));
    
    62 62
     
    
    63 63
         }
    
    64 64
     }

  • persistence/src/main/java/fr/ird/observe/binder/data/longline/TripLonglineGearUseEntityDtoBinder.java
    ... ... @@ -40,19 +40,13 @@ public class TripLonglineGearUseEntityDtoBinder extends DataEntityDtoBinderSuppo
    40 40
     
    
    41 41
         @Override
    
    42 42
         public void copyToEntity(ReferentialLocale referentialLocale, TripLonglineGearUseDto dto, TripLongline entity) {
    
    43
    -
    
    44 43
             copyDtoDataFieldsToEntity(dto, entity);
    
    45
    -
    
    46 44
             entity.setGearUseFeaturesLongline(toEntitySet(referentialLocale, dto.getGearUseFeaturesLongline(), entity.getGearUseFeaturesLongline()));
    
    47
    -
    
    48 45
         }
    
    49 46
     
    
    50 47
         @Override
    
    51 48
         public void copyToDto(ReferentialLocale referentialLocale, TripLongline entity, TripLonglineGearUseDto dto) {
    
    52
    -
    
    53 49
             copyEntityDataFieldsToDto(entity, dto);
    
    54
    -
    
    55
    -        dto.setGearUseFeaturesLongline(toLinkedHashSetData(referentialLocale, entity.getGearUseFeaturesLongline()));
    
    56
    -
    
    50
    +        dto.setGearUseFeaturesLongline(toListData(referentialLocale, entity.getGearUseFeaturesLongline()));
    
    57 51
         }
    
    58 52
     }

  • persistence/src/main/java/fr/ird/observe/binder/data/seine/GearUseFeaturesSeineEntityDtoBinder.java
    ... ... @@ -40,26 +40,20 @@ public class GearUseFeaturesSeineEntityDtoBinder extends DataEntityDtoBinderSupp
    40 40
     
    
    41 41
         @Override
    
    42 42
         public void copyToEntity(ReferentialLocale referentialLocale, GearUseFeaturesSeineDto dto, GearUseFeaturesSeine entity) {
    
    43
    -
    
    44 43
             copyDtoDataFieldsToEntity(dto, entity);
    
    45
    -
    
    46 44
             entity.setNumber(dto.getNumber());
    
    47 45
             entity.setUsedInTrip(dto.getUsedInTrip());
    
    48 46
             entity.setGear(toEntity(dto.getGear()));
    
    49 47
             entity.setGearUseFeaturesMeasurement(toEntityCollection(referentialLocale, dto.getGearUseFeaturesMeasurement(), entity.getGearUseFeaturesMeasurement()));
    
    50
    -
    
    51 48
         }
    
    52 49
     
    
    53 50
         @Override
    
    54 51
         public void copyToDto(ReferentialLocale referentialLocale, GearUseFeaturesSeine entity, GearUseFeaturesSeineDto dto) {
    
    55
    -
    
    56 52
             copyEntityDataFieldsToDto(entity, dto);
    
    57
    -
    
    58 53
             dto.setNumber(entity.getNumber());
    
    59 54
             dto.setUsedInTrip(entity.getUsedInTrip());
    
    60 55
             dto.setGear(toReferentialReference(referentialLocale, entity.getGear()));
    
    61
    -        dto.setGearUseFeaturesMeasurement(toLinkedHashSetData(referentialLocale, entity.getGearUseFeaturesMeasurement()));
    
    62
    -
    
    56
    +        dto.setGearUseFeaturesMeasurement(toListData(referentialLocale, entity.getGearUseFeaturesMeasurement()));
    
    63 57
         }
    
    64 58
     
    
    65 59
     }

  • persistence/src/main/java/fr/ird/observe/binder/data/seine/TripSeineGearUseEntityDtoBinder.java
    ... ... @@ -40,20 +40,14 @@ public class TripSeineGearUseEntityDtoBinder extends DataEntityDtoBinderSupport<
    40 40
     
    
    41 41
         @Override
    
    42 42
         public void copyToEntity(ReferentialLocale referentialLocale, TripSeineGearUseDto dto, TripSeine entity) {
    
    43
    -
    
    44 43
             copyDtoDataFieldsToEntity(dto, entity);
    
    45
    -
    
    46 44
             entity.setGearUseFeaturesSeine(toEntityCollection(referentialLocale, dto.getGearUseFeaturesSeine(), entity.getGearUseFeaturesSeine()));
    
    47
    -
    
    48 45
         }
    
    49 46
     
    
    50 47
         @Override
    
    51 48
         public void copyToDto(ReferentialLocale referentialLocale, TripSeine entity, TripSeineGearUseDto dto) {
    
    52
    -
    
    53 49
             copyEntityDataFieldsToDto(entity, dto);
    
    54
    -
    
    55
    -        dto.setGearUseFeaturesSeine(toLinkedHashSetData(referentialLocale, entity.getGearUseFeaturesSeine()));
    
    56
    -
    
    50
    +        dto.setGearUseFeaturesSeine(toListData(referentialLocale, entity.getGearUseFeaturesSeine()));
    
    57 51
         }
    
    58 52
     
    
    59 53
     }