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

Commits:

8 changed files:

Changes:

  • client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/data/map/TripMapContentBuilderSupport.java
    ... ... @@ -331,12 +331,17 @@ public abstract class TripMapContentBuilderSupport implements TripMapContentBuil
    331 331
             return DATE_FORMAT.format(date);
    
    332 332
         }
    
    333 333
     
    
    334
    +    protected void addLine(DefaultFeatureCollection linesFeatures, String lineName, Coordinate[] coordinates) {
    
    335
    +        LineString line = getGeometryFactory().createLineString(coordinates);
    
    336
    +        lineBuilder.add(line);
    
    337
    +        lineBuilder.add(lineName);
    
    338
    +        linesFeatures.add(lineBuilder.buildFeature(null));
    
    339
    +    }
    
    340
    +
    
    334 341
         protected void addLine(DefaultFeatureCollection linesFeatures, String lineName, Coordinate[] coordinates, Date date) {
    
    335 342
             LineString line = getGeometryFactory().createLineString(coordinates);
    
    336 343
             lineBuilder.add(line);
    
    337
    -        if (date != null) {
    
    338
    -            lineBuilder.add(formatDate(date));
    
    339
    -        }
    
    344
    +        lineBuilder.add(date == null ? null : formatDate(date));
    
    340 345
             lineBuilder.add(lineName);
    
    341 346
             linesFeatures.add(lineBuilder.buildFeature(null));
    
    342 347
         }
    

  • client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripMapContentBuilder.java
    ... ... @@ -159,7 +159,7 @@ public class TripMapContentBuilder extends TripMapContentBuilderSupport {
    159 159
             if (!lines.isEmpty()) {
    
    160 160
                 lineTypes.add(lineType);
    
    161 161
                 for (Coordinate[] tripLine : lines) {
    
    162
    -                addLine(linesFeatures, lineType, tripLine, null);
    
    162
    +                addLine(linesFeatures, lineType, tripLine);
    
    163 163
                 }
    
    164 164
             }
    
    165 165
         }
    

  • client/datasource/editor/ps/src/main/i18n/getters/java.getter
    ... ... @@ -45,8 +45,7 @@ observe.ui.action.copyFloatingObjectPartToRight.tip
    45 45
     observe.ui.choice.cancel
    
    46 46
     observe.ui.choice.dcp.default
    
    47 47
     observe.ui.choice.save
    
    48
    -observe.ui.datasource.editor.content.map.legend.logbook.tripBetweenTwoDays
    
    49
    -observe.ui.datasource.editor.content.map.legend.logbook.tripDay
    
    48
    +observe.ui.datasource.editor.content.map.legend.logbook.tripSegment
    
    50 49
     observe.ui.datasource.editor.content.map.legend.obs.tripBetweenTwoDays
    
    51 50
     observe.ui.datasource.editor.content.map.legend.obs.tripDay
    
    52 51
     observe.ui.datasource.editor.content.map.logbook.points.not.valid
    

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripMapContentBuilder.java
    ... ... @@ -109,15 +109,19 @@ public class TripMapContentBuilder extends fr.ird.observe.client.datasource.edit
    109 109
         public void addLines(TripMapConfigDto tripMapConfig, List<TripMapPoint> tripMapPoints) {
    
    110 110
             if (tripMapConfig.isAddObservations()) {
    
    111 111
                 addLines0(tripMapPoints.stream().filter(f -> f.getType().isTrip() || f.getType().isObs()).collect(Collectors.toList()),
    
    112
    -                      "observation",
    
    112
    +                      "observationDay",
    
    113
    +                      "observationNight",
    
    114
    +                      true,
    
    113 115
                           t("observe.ui.datasource.editor.content.map.legend.obs.tripDay"),
    
    114 116
                           t("observe.ui.datasource.editor.content.map.legend.obs.tripBetweenTwoDays"));
    
    115 117
             }
    
    116 118
             if (tripMapConfig.isAddLogbook()) {
    
    117 119
                 addLines0(tripMapPoints.stream().filter(f -> f.getType().isTrip() || f.getType().isLogbook()).collect(Collectors.toList()),
    
    118
    -                      "logbook",
    
    119
    -                      t("observe.ui.datasource.editor.content.map.legend.logbook.tripDay"),
    
    120
    -                      t("observe.ui.datasource.editor.content.map.legend.logbook.tripBetweenTwoDays"));
    
    120
    +                      "logbookSegment",
    
    121
    +                      "logbookSegment",
    
    122
    +                      false,
    
    123
    +                      t("observe.ui.datasource.editor.content.map.legend.logbook.tripSegment"),
    
    124
    +                      null);
    
    121 125
             }
    
    122 126
         }
    
    123 127
     
    
    ... ... @@ -128,14 +132,12 @@ public class TripMapContentBuilder extends fr.ird.observe.client.datasource.edit
    128 132
             }
    
    129 133
         }
    
    130 134
     
    
    131
    -    protected void addTripBetweenTwoDay(DefaultFeatureCollection linesFeatures, String label, TripMapPoint previousPoint, TripMapPoint point) {
    
    135
    +    protected void addTripBetweenTwoDay(DefaultFeatureCollection linesFeatures, String label, TripMapPoint previousPoint, TripMapPoint point, boolean addTime) {
    
    132 136
             Coordinate[] coordinates = create(previousPoint, point);
    
    133
    -        addLine(linesFeatures, label, coordinates, previousPoint.getTime());
    
    137
    +        addLine(linesFeatures, label, coordinates, addTime ? previousPoint.getTime() : null);
    
    134 138
         }
    
    135 139
     
    
    136
    -    protected void addLines0(List<TripMapPoint> tripMapPoints, String prefix, String pointDayLabel, String pointNightLabel) {
    
    137
    -        String pointDay = prefix + "Day";
    
    138
    -        String pointNight = prefix + "Night";
    
    140
    +    protected void addLines0(List<TripMapPoint> tripMapPoints, String pointDay, String pointNight, boolean addDate, String pointDayLabel, String pointNightLabel) {
    
    139 141
             if (tripMapPoints.size() == 2 && tripMapPoints.stream().allMatch(t -> t.getType().isTrip())) {
    
    140 142
                 // Got only trip points, nothing to display then
    
    141 143
                 return;
    
    ... ... @@ -152,7 +154,7 @@ public class TripMapContentBuilder extends fr.ird.observe.client.datasource.edit
    152 154
                 if (previousPoint != null && !DateUtils.isSameDay(previousPoint.getTime(), point.getTime())) {
    
    153 155
                     // changing day
    
    154 156
                     addTripDay(linesFeatures, pointDay, coordinatesByDay, previousPoint);
    
    155
    -                addTripBetweenTwoDay(linesFeatures, pointNight, previousPoint, point);
    
    157
    +                addTripBetweenTwoDay(linesFeatures, pointNight, previousPoint, point, addDate);
    
    156 158
                     coordinatesByDay.clear();
    
    157 159
                 }
    
    158 160
                 coordinatesByDay.add(coordinate);
    
    ... ... @@ -167,6 +169,9 @@ public class TripMapContentBuilder extends fr.ird.observe.client.datasource.edit
    167 169
                 mapContent.addLayer(layerLines);
    
    168 170
             }
    
    169 171
             addLineLegend(styleLines, pointDay, pointDayLabel);
    
    170
    -        addLineLegend(styleLines, pointNight, pointNightLabel);
    
    172
    +        if (pointNightLabel != null) {
    
    173
    +            addLineLegend(styleLines, pointNight, pointNightLabel);
    
    174
    +        }
    
    171 175
         }
    
    172
    -}
    176
    +
    
    177
    +}
    \ No newline at end of file

  • client/datasource/editor/ps/src/main/resources/map/ps-style.xml
    ... ... @@ -84,13 +84,14 @@
    84 84
               <ogc:Filter>
    
    85 85
                 <ogc:PropertyIsEqualTo>
    
    86 86
                   <ogc:PropertyName>type</ogc:PropertyName>
    
    87
    -              <ogc:Literal>logbookDay</ogc:Literal>
    
    87
    +              <ogc:Literal>logbookSegment</ogc:Literal>
    
    88 88
                 </ogc:PropertyIsEqualTo>
    
    89 89
               </ogc:Filter>
    
    90 90
               <LineSymbolizer>
    
    91 91
                 <Stroke>
    
    92 92
                   <CssParameter name="stroke">${mapPsStyleLogbookLineColor}</CssParameter>
    
    93 93
                   <CssParameter name="stroke-width">2</CssParameter>
    
    94
    +              <CssParameter name="stroke-dasharray">6 4</CssParameter>
    
    94 95
                 </Stroke>
    
    95 96
               </LineSymbolizer>
    
    96 97
               <TextSymbolizer>
    
    ... ... @@ -113,23 +114,6 @@
    113 114
               </TextSymbolizer>
    
    114 115
             </Rule>
    
    115 116
           </FeatureTypeStyle>
    
    116
    -      <FeatureTypeStyle>
    
    117
    -        <Rule>
    
    118
    -          <ogc:Filter>
    
    119
    -            <ogc:PropertyIsEqualTo>
    
    120
    -              <ogc:PropertyName>type</ogc:PropertyName>
    
    121
    -              <ogc:Literal>logbookNight</ogc:Literal>
    
    122
    -            </ogc:PropertyIsEqualTo>
    
    123
    -          </ogc:Filter>
    
    124
    -          <LineSymbolizer>
    
    125
    -            <Stroke>
    
    126
    -              <CssParameter name="stroke">${mapPsStyleLogbookLineColor}</CssParameter>
    
    127
    -              <CssParameter name="stroke-width">2</CssParameter>
    
    128
    -              <CssParameter name="stroke-dasharray">6 4</CssParameter>
    
    129
    -            </Stroke>
    
    130
    -          </LineSymbolizer>
    
    131
    -        </Rule>
    
    132
    -      </FeatureTypeStyle>
    
    133 117
         </UserStyle>
    
    134 118
       </NamedLayer>
    
    135 119
     
    

  • client/runner/src/main/i18n/translations/client-runner_en_GB.properties
    ... ... @@ -712,8 +712,7 @@ observe.ui.datasource.editor.content.map.legend=Legend
    712 712
     observe.ui.datasource.editor.content.map.legend.logbook.hauling=Logbook - Hauling
    
    713 713
     observe.ui.datasource.editor.content.map.legend.logbook.setting=Logbook - Setting
    
    714 714
     observe.ui.datasource.editor.content.map.legend.logbook.trip=Logbook - Route
    
    715
    -observe.ui.datasource.editor.content.map.legend.logbook.tripBetweenTwoDays=Night trip
    
    716
    -observe.ui.datasource.editor.content.map.legend.logbook.tripDay=Logbook - Day trip
    
    715
    +observe.ui.datasource.editor.content.map.legend.logbook.tripSegment=Logbook - Segment
    
    717 716
     observe.ui.datasource.editor.content.map.legend.not.valid.count=( %d points are not displayed )
    
    718 717
     observe.ui.datasource.editor.content.map.legend.obs.hauling=Observation - Hauling
    
    719 718
     observe.ui.datasource.editor.content.map.legend.obs.setting=Observation - Setting
    

  • client/runner/src/main/i18n/translations/client-runner_es_ES.properties
    ... ... @@ -712,8 +712,7 @@ observe.ui.datasource.editor.content.map.legend=Legend \#TODO
    712 712
     observe.ui.datasource.editor.content.map.legend.logbook.hauling=Logbook - Arrastre
    
    713 713
     observe.ui.datasource.editor.content.map.legend.logbook.setting=Logbook - Calada
    
    714 714
     observe.ui.datasource.editor.content.map.legend.logbook.trip=Logbook - Trayecto
    
    715
    -observe.ui.datasource.editor.content.map.legend.logbook.tripBetweenTwoDays=Logbook - Trayecto del noche
    
    716
    -observe.ui.datasource.editor.content.map.legend.logbook.tripDay=Logbook - Trayecto del día
    
    715
    +observe.ui.datasource.editor.content.map.legend.logbook.tripSegment=Logbook - Trayecto
    
    717 716
     observe.ui.datasource.editor.content.map.legend.not.valid.count=( %d points are not displayed )
    
    718 717
     observe.ui.datasource.editor.content.map.legend.obs.hauling=Observation - Arrastre
    
    719 718
     observe.ui.datasource.editor.content.map.legend.obs.setting=Observation - Calada
    

  • client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
    ... ... @@ -712,8 +712,7 @@ observe.ui.datasource.editor.content.map.legend=Légende
    712 712
     observe.ui.datasource.editor.content.map.legend.logbook.hauling=Livre de bord - Virage
    
    713 713
     observe.ui.datasource.editor.content.map.legend.logbook.setting=Livre de bord - Filage
    
    714 714
     observe.ui.datasource.editor.content.map.legend.logbook.trip=Livre de bord - Trajet
    
    715
    -observe.ui.datasource.editor.content.map.legend.logbook.tripBetweenTwoDays=Livre de bord - Trajet de nuit
    
    716
    -observe.ui.datasource.editor.content.map.legend.logbook.tripDay=Livre de bord - Trajet de jour
    
    715
    +observe.ui.datasource.editor.content.map.legend.logbook.tripSegment=Livre de bord - Trajet
    
    717 716
     observe.ui.datasource.editor.content.map.legend.not.valid.count=( dont %d points non affichés )
    
    718 717
     observe.ui.datasource.editor.content.map.legend.obs.hauling=Observation - Virage
    
    719 718
     observe.ui.datasource.editor.content.map.legend.obs.setting=Observation - Filage