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

Commits:

7 changed files:

Changes:

  • client/pom.xml
    ... ... @@ -240,6 +240,14 @@
    240 240
                 <groupId>it.geosolutions.jaiext.utilities</groupId>
    
    241 241
                 <artifactId>jt-utilities</artifactId>
    
    242 242
               </exclusion>
    
    243
    +          <exclusion>
    
    244
    +            <groupId>it.geosolutions.jaiext.shadedrelief</groupId>
    
    245
    +            <artifactId>jt-shadedrelief</artifactId>
    
    246
    +          </exclusion>
    
    247
    +          <exclusion>
    
    248
    +            <groupId>it.geosolutions.jaiext.scale2</groupId>
    
    249
    +            <artifactId>jt-scale2</artifactId>
    
    250
    +          </exclusion>
    
    243 251
               <exclusion>
    
    244 252
                 <groupId>org.jaitools</groupId>
    
    245 253
                 <artifactId>jt-zonalstats</artifactId>
    
    ... ... @@ -289,6 +297,11 @@
    289 297
             <artifactId>gt-epsg-hsql</artifactId>
    
    290 298
             <version>${lib.version.geoTools}</version>
    
    291 299
           </dependency>
    
    300
    +      <dependency>
    
    301
    +        <groupId>org.locationtech.jts</groupId>
    
    302
    +        <artifactId>jts-core</artifactId>
    
    303
    +        <version>1.16.0</version>
    
    304
    +      </dependency>
    
    292 305
         </dependencies>
    
    293 306
     
    
    294 307
       </dependencyManagement>
    
    ... ... @@ -598,7 +611,7 @@
    598 611
         </dependency>
    
    599 612
     
    
    600 613
         <dependency>
    
    601
    -      <groupId>com.vividsolutions</groupId>
    
    614
    +      <groupId>org.locationtech.jts</groupId>
    
    602 615
           <artifactId>jts-core</artifactId>
    
    603 616
         </dependency>
    
    604 617
     
    
    ... ... @@ -643,7 +656,6 @@
    643 656
         <dependency>
    
    644 657
           <groupId>org.jetbrains</groupId>
    
    645 658
           <artifactId>annotations</artifactId>
    
    646
    -      <version>16.0.1</version>
    
    647 659
         </dependency>
    
    648 660
     
    
    649 661
       </dependencies>
    

  • client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java
    ... ... @@ -51,12 +51,9 @@ public abstract class GoToTabUIActionSupport extends AbstractContentUIAction {
    51 51
         @Override
    
    52 52
         protected void actionPerformed(ContentUI<?, ?> contentUI) {
    
    53 53
             JTabbedPane mainTabbedPane = (JTabbedPane) contentUI.getObjectById(tabbedPaneName);
    
    54
    -        if (mainTabbedPane == null) {
    
    55
    -
    
    56
    -            // rien à faire
    
    57
    -            return;
    
    54
    +        if (mainTabbedPane != null && mainTabbedPane.isEnabledAt(tabIndex)) {
    
    55
    +            mainTabbedPane.setSelectedIndex(tabIndex);
    
    58 56
             }
    
    59
    -        mainTabbedPane.setSelectedIndex(tabIndex);
    
    60 57
         }
    
    61 58
     
    
    62 59
         @Override
    

  • client/src/main/java/fr/ird/observe/client/ui/util/tripMap/ObserveMapPaneLegendItem.java
    ... ... @@ -10,20 +10,20 @@ package fr.ird.observe.client.ui.util.tripMap;
    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.vividsolutions.jts.geom.Coordinate;
    
    26 25
     import org.geotools.styling.Style;
    
    26
    +import org.locationtech.jts.geom.Coordinate;
    
    27 27
     import org.opengis.feature.simple.SimpleFeature;
    
    28 28
     
    
    29 29
     import java.awt.Color;
    
    ... ... @@ -37,7 +37,15 @@ public class ObserveMapPaneLegendItem {
    37 37
         protected static final int LEGEND_SYMBOL_WIDTH = 50;
    
    38 38
         protected static final int LEGEND_MARGIN = 5;
    
    39 39
         protected static final Color LEGEND_BACKGROUND = new Color(1f, 1f, 1f, 0.8f);
    
    40
    +    protected SimpleFeature simpleFeature;
    
    41
    +    protected Style style;
    
    42
    +    protected String label;
    
    40 43
     
    
    44
    +    public ObserveMapPaneLegendItem(SimpleFeature simpleFeature, Style style, String label) {
    
    45
    +        this.simpleFeature = simpleFeature;
    
    46
    +        this.style = style;
    
    47
    +        this.label = label;
    
    48
    +    }
    
    41 49
     
    
    42 50
         public static Coordinate[] lineCoordinates() {
    
    43 51
             Coordinate[] coordinates = new Coordinate[2];
    
    ... ... @@ -50,19 +58,6 @@ public class ObserveMapPaneLegendItem {
    50 58
             return new Coordinate(LEGEND_SYMBOL_WIDTH / 2, LEGEND_ITEM_HEIGHT / 2);
    
    51 59
         }
    
    52 60
     
    
    53
    -
    
    54
    -    protected SimpleFeature simpleFeature;
    
    55
    -
    
    56
    -    protected Style style;
    
    57
    -
    
    58
    -    protected String label;
    
    59
    -
    
    60
    -    public ObserveMapPaneLegendItem(SimpleFeature simpleFeature, Style style, String label) {
    
    61
    -        this.simpleFeature = simpleFeature;
    
    62
    -        this.style = style;
    
    63
    -        this.label = label;
    
    64
    -    }
    
    65
    -
    
    66 61
         public SimpleFeature getSimpleFeature() {
    
    67 62
             return simpleFeature;
    
    68 63
         }
    

  • client/src/main/java/fr/ird/observe/client/ui/util/tripMap/ObserverMapPanLegendDrawer.java
    ... ... @@ -10,25 +10,25 @@ package fr.ird.observe.client.ui.util.tripMap;
    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.vividsolutions.jts.geom.Geometry;
    
    26 25
     import org.geotools.geometry.jts.LiteShape;
    
    27 26
     import org.geotools.legend.Drawer;
    
    28 27
     import org.geotools.styling.LineSymbolizer;
    
    29 28
     import org.geotools.styling.Rule;
    
    30 29
     import org.geotools.styling.SLD;
    
    31 30
     import org.geotools.styling.Symbolizer;
    
    31
    +import org.locationtech.jts.geom.Geometry;
    
    32 32
     import org.opengis.feature.simple.SimpleFeature;
    
    33 33
     
    
    34 34
     import java.awt.BasicStroke;
    

  • client/src/main/java/fr/ird/observe/client/ui/util/tripMap/TripMapContentBuilder.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.util.tripMap;
    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>.
    
    ... ... @@ -25,11 +25,6 @@ package fr.ird.observe.client.ui.util.tripMap;
    25 25
     import com.google.common.collect.ImmutableSet;
    
    26 26
     import com.google.common.collect.Lists;
    
    27 27
     import com.google.common.collect.Sets;
    
    28
    -import com.vividsolutions.jts.geom.Coordinate;
    
    29
    -import com.vividsolutions.jts.geom.GeometryFactory;
    
    30
    -import com.vividsolutions.jts.geom.LineString;
    
    31
    -import com.vividsolutions.jts.geom.Point;
    
    32
    -import com.vividsolutions.jts.geom.Polygon;
    
    33 28
     import fr.ird.observe.client.ObserveSwingTechnicalException;
    
    34 29
     import fr.ird.observe.dto.I18nEnumHelper;
    
    35 30
     import fr.ird.observe.dto.data.TripMapPoint;
    
    ... ... @@ -56,6 +51,11 @@ import org.geotools.styling.StyleFactory;
    56 51
     import org.geotools.styling.StyledLayer;
    
    57 52
     import org.geotools.styling.StyledLayerDescriptor;
    
    58 53
     import org.geotools.styling.UserLayer;
    
    54
    +import org.locationtech.jts.geom.Coordinate;
    
    55
    +import org.locationtech.jts.geom.GeometryFactory;
    
    56
    +import org.locationtech.jts.geom.LineString;
    
    57
    +import org.locationtech.jts.geom.Point;
    
    58
    +import org.locationtech.jts.geom.Polygon;
    
    59 59
     import org.opengis.feature.simple.SimpleFeature;
    
    60 60
     import org.opengis.feature.simple.SimpleFeatureType;
    
    61 61
     import org.opengis.referencing.FactoryException;
    
    ... ... @@ -80,7 +80,7 @@ public class TripMapContentBuilder {
    80 80
         public static final String TRIP_LONGLINE_FISHING_ZONE_LAYER_NAME = "Trip longline zone";
    
    81 81
         public static final String TRIP_LONGLINE_LINE_LAYER_NAME = "Trip longline line";
    
    82 82
         public static final String TRIP_POINTS_LAYER_NAME = "Trip points";
    
    83
    -
    
    83
    +    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM");
    
    84 84
         protected static final Set<TripMapPointType> TRIP_MAP_POINT_TYPES_IN_LEGEND = ImmutableSet.of(
    
    85 85
                 TripMapPointType.seineActivityInHarbour,
    
    86 86
                 TripMapPointType.seineActivityWithFreeSchoolType,
    
    ... ... @@ -92,12 +92,9 @@ public class TripMapContentBuilder {
    92 92
                 TripMapPointType.longlineActivityWithHaulingEnd,
    
    93 93
                 TripMapPointType.longlineActivityWithStation,
    
    94 94
                 TripMapPointType.longlineActivityWithInteraction);
    
    95
    -
    
    96
    -    public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM");
    
    97
    -
    
    98
    -    protected StyledLayerDescriptor styledLayerDescriptor;
    
    99 95
         protected final MapContent mapContent;
    
    100 96
         protected final List<ObserveMapPaneLegendItem> legendItems;
    
    97
    +    protected StyledLayerDescriptor styledLayerDescriptor;
    
    101 98
     
    
    102 99
         public TripMapContentBuilder() {
    
    103 100
             mapContent = new MapContent();
    
    ... ... @@ -132,7 +129,7 @@ public class TripMapContentBuilder {
    132 129
     
    
    133 130
         public void addTripLine(List<TripMapPoint> tripMapPoints) throws FactoryException {
    
    134 131
     
    
    135
    -        GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
    
    132
    +        org.locationtech.jts.geom.GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
    
    136 133
     
    
    137 134
             SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
    
    138 135
             lineFeatureTypeBuilder.setName("lineBuilder");
    

  • pom.xml
    ... ... @@ -26,7 +26,7 @@
    26 26
       <parent>
    
    27 27
         <groupId>io.ultreia.maven</groupId>
    
    28 28
         <artifactId>pom</artifactId>
    
    29
    -    <version>2018.58</version>
    
    29
    +    <version>2018.59</version>
    
    30 30
       </parent>
    
    31 31
     
    
    32 32
       <groupId>fr.ird.observe</groupId>
    

  • services/src/main/resources/observe-reports.properties
    ... ... @@ -728,7 +728,7 @@ Join r.activitySeine a \
    728 728
     Join a.setSeine.targetSample ts \
    
    729 729
     Join ts.targetLength tl \
    
    730 730
     Where t.id In :tripId \
    
    731
    -And tl.sizeMeasureType = 1 \
    
    731
    +And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499466774#0.529249255312607' \
    
    732 732
     And ts.discarded = false
    
    733 733
     report.targetStoredDistributionLengthsLD1.request.1=0,0|row| \
    
    734 734
     Select tl.length , Sum(tl.count) \
    
    ... ... @@ -739,7 +739,7 @@ Join a.setSeine.targetSample ts \
    739 739
     Join ts.targetLength tl \
    
    740 740
     Where t.id In :tripId \
    
    741 741
       And tl.species.id = :speciesId \
    
    742
    -  And tl.sizeMeasureType = 1 \
    
    742
    +  And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499466774#0.529249255312607' \
    
    743 743
       And ts.discarded = false \
    
    744 744
     Group By tl.length \
    
    745 745
     Order By tl.length
    
    ... ... @@ -759,7 +759,7 @@ Join r.activitySeine a \
    759 759
     Join a.setSeine.targetSample ts \
    
    760 760
     Join ts.targetLength tl \
    
    761 761
     Where t.id In :tripId \
    
    762
    -And tl.sizeMeasureType = 1 \
    
    762
    +And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499466774#0.529249255312607' \
    
    763 763
     And ts.discarded = true
    
    764 764
     report.targetDiscardedDistributionLengthsLD1.request.1=0,0|row| \
    
    765 765
     Select tl.length , Sum(tl.count) \
    
    ... ... @@ -770,7 +770,7 @@ Join a.setSeine.targetSample ts \
    770 770
     Join ts.targetLength tl \
    
    771 771
     Where t.id In :tripId \
    
    772 772
       And tl.species.id = :speciesId \
    
    773
    -  And tl.sizeMeasureType = 1\
    
    773
    +  And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499466774#0.529249255312607'\
    
    774 774
       And ts.discarded = true \
    
    775 775
     Group By tl.length \
    
    776 776
     Order By tl.length
    
    ... ... @@ -790,7 +790,7 @@ Join r.activitySeine a \
    790 790
     Join a.setSeine.targetSample ts \
    
    791 791
     Join ts.targetLength tl \
    
    792 792
     Where t.id In :tripId \
    
    793
    -And tl.sizeMeasureType = 2 \
    
    793
    +And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    794 794
     And ts.discarded = false
    
    795 795
     report.targetStoredDistributionLengthsLF.request.1=0,0|row| \
    
    796 796
     Select tl.length , Sum(tl.count) \
    
    ... ... @@ -801,7 +801,7 @@ Join a.setSeine.targetSample ts \
    801 801
     Join ts.targetLength tl \
    
    802 802
     Where t.id In :tripId \
    
    803 803
       And tl.species.id = :speciesId \
    
    804
    -  And tl.sizeMeasureType = 2 \
    
    804
    +  And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    805 805
       And ts.discarded = false \
    
    806 806
     Group By tl.length \
    
    807 807
     Order By tl.length
    
    ... ... @@ -821,7 +821,7 @@ Join r.activitySeine a \
    821 821
     Join a.setSeine.targetSample ts \
    
    822 822
     Join ts.targetLength tl \
    
    823 823
     Where t.id In :tripId \
    
    824
    -And tl.sizeMeasureType = 2 \
    
    824
    +And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    825 825
     And ts.discarded = true
    
    826 826
     report.targetDiscardedDistributionLengthsLF.request.1=0,0|row| \
    
    827 827
     Select tl.length , Sum(tl.count) \
    
    ... ... @@ -832,7 +832,7 @@ Join a.setSeine.targetSample ts \
    832 832
     Join ts.targetLength tl \
    
    833 833
     Where t.id In :tripId \
    
    834 834
       And tl.species.id = :speciesId \
    
    835
    -  And tl.sizeMeasureType = 2 \
    
    835
    +  And tl.sizeMeasureType = 'fr.ird.observe.entities.referentiel.SizeMeasureType#1433499465700#0.0902433863375336' \
    
    836 836
       And ts.discarded = true \
    
    837 837
     Group By tl.length \
    
    838 838
     Order By tl.length