This is an automated email from the git hooks/post-receive script. New commit to branch feature/7133 in repository observe. See http://git.codelutin.com/observe.git commit f21968e1433a4367465ada12fcdb489d58ec0d27 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri May 22 12:18:49 2015 +0200 refs #7132 #7133 : utilisation des id plutot que les code pour les types activité. pour les palangre ne gardé q'un type "au port" (départ et arrivé) --- .../entities/longline/TripLonglineDAOImpl.java | 20 +++++++++----------- .../ird/observe/entities/seine/TripSeineDAOImpl.java | 8 +++----- .../fr/ird/observe/tripMap/TripMapPointType.java | 3 +-- .../resources/i18n/observe-entities_en_GB.properties | 1 + .../resources/i18n/observe-entities_es_ES.properties | 1 + .../resources/i18n/observe-entities_fr_FR.properties | 3 +-- .../ui/util/tripMap/TripMapContentBuilder.java | 4 ++-- .../observe/ui/util/tripMap/TripMapUIHandler.java | 7 ++++++- observe-swing/src/main/map/style.xml | 14 +------------- 9 files changed, 25 insertions(+), 36 deletions(-) diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/longline/TripLonglineDAOImpl.java b/observe-entities/src/main/java/fr/ird/observe/entities/longline/TripLonglineDAOImpl.java index 5677d27..d9fe3d8 100644 --- a/observe-entities/src/main/java/fr/ird/observe/entities/longline/TripLonglineDAOImpl.java +++ b/observe-entities/src/main/java/fr/ird/observe/entities/longline/TripLonglineDAOImpl.java @@ -46,8 +46,8 @@ import java.util.List; public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAOAbstract<E> { - public static final String ACTIVITY_INTERACTION_CODE = "INT"; - public static final String ACTIVITY_STATION_CODE = "SAMP"; + public static final String ACTIVITY_INTERACTION_ID = "fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#1239832686138#0.4"; + public static final String ACTIVITY_STATION_ID = "fr.ird.observe.entities.referentiel.longline.VesselActivityLongline#1239832686138#0.3"; public int findPositionByProgramId(String programId, String tripId) throws TopiaException { int result = 0; @@ -92,7 +92,7 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO departurePoint.setTime(tripLongline.getStartDate()); departurePoint.setLatitude(departureHarbour.getLatitude()); departurePoint.setLongitude(departureHarbour.getLongitude()); - departurePoint.setType(TripMapPointType.LONGLINE_DEPARTURE_HARBOUR); + departurePoint.setType(TripMapPointType.LONGLINE_IN_HARBOUR); tripMapPoints.add(departurePoint); } @@ -112,7 +112,7 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO landingPoint.setTime(tripLongline.getEndDate()); landingPoint.setLatitude(landingHarbour.getLatitude()); landingPoint.setLongitude(landingHarbour.getLongitude()); - landingPoint.setType(TripMapPointType.LONGLINE_LANDING_HARBOUR); + landingPoint.setType(TripMapPointType.LONGLINE_IN_HARBOUR); tripMapPoints.add(landingPoint); } @@ -125,7 +125,7 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO " a.timestamp, " + " a.latitude," + " a.longitude," + - " v.code," + + " a.vesselActivity," + " s.settingStartTimestamp," + " s.settingStartLatitude," + " s.settingStartLongitude," + @@ -139,8 +139,6 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO " s.haulingEndLatitude," + " s.haulingEndLongitude" + " FROM observe_longLine.activity a" + - " LEFT OUTER JOIN observe_longLine.vesselActivity v" + - " ON v.topiaid = a.vesselActivity" + " LEFT OUTER JOIN observe_longLine.set s" + " ON s.topiaId = a.set" + " WHERE a.trip = ?" + @@ -170,12 +168,12 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO activity.setLatitude(resultSet.getFloat(2)); activity.setLongitude(resultSet.getFloat(3)); - String vesselActivityCode = resultSet.getString(4); - if (vesselActivityCode == null) { + String vesselActivityId = resultSet.getString(4); + if (vesselActivityId == null) { activity.setType(TripMapPointType.LONGLINE_ACTIVITY); - } else if (vesselActivityCode.equals(ACTIVITY_INTERACTION_CODE)) { + } else if (vesselActivityId.equals(ACTIVITY_INTERACTION_ID)) { activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_INTERACTION); - } else if (vesselActivityCode.equals(ACTIVITY_STATION_CODE)) { + } else if (vesselActivityId.equals(ACTIVITY_STATION_ID)) { activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_STATION); } else { activity.setType(TripMapPointType.LONGLINE_ACTIVITY); diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/seine/TripSeineDAOImpl.java b/observe-entities/src/main/java/fr/ird/observe/entities/seine/TripSeineDAOImpl.java index 368a267..51f623a 100644 --- a/observe-entities/src/main/java/fr/ird/observe/entities/seine/TripSeineDAOImpl.java +++ b/observe-entities/src/main/java/fr/ird/observe/entities/seine/TripSeineDAOImpl.java @@ -51,7 +51,7 @@ import java.util.List; */ public class TripSeineDAOImpl<E extends TripSeine> extends TripSeineDAOAbstract<E> { - public static final int ACTIVITY_HARBOUR_CODE = 0; + public static final String ACTIVITY_HARBOUR_ID = "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1239832675349#0.363119635949572"; public int findPositionByProgramId(String programId, String tripId) throws TopiaException { int result = 0; @@ -123,13 +123,11 @@ public class TripSeineDAOImpl<E extends TripSeine> extends TripSeineDAOAbstract< " a.time, " + " a.latitude," + " a.longitude," + - " v.code, " + + " a.vesselactivity, " + " s.schoolType" + " FROM observe_seine.route r" + " INNER JOIN observe_seine.activity a" + " ON a.route = r.topiaId" + - " INNER JOIN observe_seine.vesselactivity v" + - " ON a.vesselactivity = v.topiaid" + " LEFT OUTER JOIN observe_seine.set s" + " ON s.topiaId = a.set" + " WHERE r.trip = ?" + @@ -156,7 +154,7 @@ public class TripSeineDAOImpl<E extends TripSeine> extends TripSeineDAOAbstract< point.setTime(time); point.setLatitude(resultSet.getFloat(3)); point.setLongitude(resultSet.getFloat(4)); - if (resultSet.getInt(5) == ACTIVITY_HARBOUR_CODE) { + if (resultSet.getString(5) == ACTIVITY_HARBOUR_ID) { point.setType(TripMapPointType.SEINE_ACTIVITY_IN_HARBOUR); } else if (resultSet.getString(6) == null) { point.setType(TripMapPointType.SEINE_ACTIVITY); diff --git a/observe-entities/src/main/java/fr/ird/observe/tripMap/TripMapPointType.java b/observe-entities/src/main/java/fr/ird/observe/tripMap/TripMapPointType.java index 04fdaa2..173f00d 100644 --- a/observe-entities/src/main/java/fr/ird/observe/tripMap/TripMapPointType.java +++ b/observe-entities/src/main/java/fr/ird/observe/tripMap/TripMapPointType.java @@ -37,8 +37,7 @@ public enum TripMapPointType { SEINE_ACTIVITY_WITH_FREE_SCHOOL_TYPE(n("observe.map.seine.activity.schollType.free")), SEINE_ACTIVITY_WITH_OBJECT_SCHOOL_TYPE(n("observe.map.seine.activity.schollType.object")), - LONGLINE_DEPARTURE_HARBOUR(n("observe.map.longLine.seine.harbour.departure")), - LONGLINE_LANDING_HARBOUR(n("observe.map.longLine.seine.harbour.landing")), + LONGLINE_IN_HARBOUR(n("observe.map.longLine.seine.harbour")), LONGLINE_ACTIVITY(n("observe.map.longLine.activity")), LONGLINE_ACTIVITY_WITH_SETTING_START(n("observe.map.longLine.activity.setting.start")), LONGLINE_ACTIVITY_WITH_SETTING_END(n("observe.map.longLine.activity.setting.end")), diff --git a/observe-entities/src/main/resources/i18n/observe-entities_en_GB.properties b/observe-entities/src/main/resources/i18n/observe-entities_en_GB.properties index a4a8c32..d38c4e5 100644 --- a/observe-entities/src/main/resources/i18n/observe-entities_en_GB.properties +++ b/observe-entities/src/main/resources/i18n/observe-entities_en_GB.properties @@ -27,6 +27,7 @@ observe.map.longLine.activity.interaction= observe.map.longLine.activity.setting.end= observe.map.longLine.activity.setting.start= observe.map.longLine.activity.station= +observe.map.longLine.seine.harbour= observe.map.longLine.seine.harbour.departure= observe.map.longLine.seine.harbour.landing= observe.map.seine.activity= diff --git a/observe-entities/src/main/resources/i18n/observe-entities_es_ES.properties b/observe-entities/src/main/resources/i18n/observe-entities_es_ES.properties index ebb20b1..6e1ff8a 100644 --- a/observe-entities/src/main/resources/i18n/observe-entities_es_ES.properties +++ b/observe-entities/src/main/resources/i18n/observe-entities_es_ES.properties @@ -27,6 +27,7 @@ observe.map.longLine.activity.interaction= observe.map.longLine.activity.setting.end= observe.map.longLine.activity.setting.start= observe.map.longLine.activity.station= +observe.map.longLine.seine.harbour= observe.map.longLine.seine.harbour.departure= observe.map.longLine.seine.harbour.landing= observe.map.seine.activity= diff --git a/observe-entities/src/main/resources/i18n/observe-entities_fr_FR.properties b/observe-entities/src/main/resources/i18n/observe-entities_fr_FR.properties index 74354e3..ead0aa8 100644 --- a/observe-entities/src/main/resources/i18n/observe-entities_fr_FR.properties +++ b/observe-entities/src/main/resources/i18n/observe-entities_fr_FR.properties @@ -27,8 +27,7 @@ observe.map.longLine.activity.interaction=Rencontre observe.map.longLine.activity.setting.end=Fin de virage observe.map.longLine.activity.setting.start=Début de virage observe.map.longLine.activity.station=Station océanographique -observe.map.longLine.seine.harbour.departure=Port de départ -observe.map.longLine.seine.harbour.landing=Port d'arrivée +observe.map.longLine.seine.harbour=Au port observe.map.seine.activity=point d'activité observe.map.seine.activity.inHarbour=Au port observe.map.seine.activity.schollType.free=Banc libre diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java index ad2df49..b9d1d2e 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java @@ -65,8 +65,7 @@ public class TripMapContentBuilder { TripMapPointType.SEINE_ACTIVITY_IN_HARBOUR, TripMapPointType.SEINE_ACTIVITY_WITH_FREE_SCHOOL_TYPE, TripMapPointType.SEINE_ACTIVITY_WITH_OBJECT_SCHOOL_TYPE, - TripMapPointType.LONGLINE_DEPARTURE_HARBOUR, - TripMapPointType.LONGLINE_LANDING_HARBOUR, + TripMapPointType.LONGLINE_IN_HARBOUR, TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_START, TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_END, TripMapPointType.LONGLINE_ACTIVITY_WITH_HAULING_START, @@ -232,6 +231,7 @@ public class TripMapContentBuilder { Polygon polygon = geometryFactory.createPolygon(coordinates); + //polygon = (Polygon) polygon.convexHull(); // permet de transformer un poliqgone croisé en polygon convex polygonBuilder.add(polygon); polygonBuilder.add("longlineFishingZone"); SimpleFeature feature = polygonBuilder.buildFeature(null); diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java index 45359a3..71ab03b 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java @@ -113,10 +113,15 @@ public class TripMapUIHandler { ((CardLayout) view.getLayout()).first(view); ObserveContext.get().getObserveMainUI().setBusy(true); + ObserveMapPane mapPane = getObserveMapPane(); + + if (mapPane.getMapContent() != null) { + // appeler pour libéré les listeners + mapPane.getMapContent().dispose(); + } List<TripMapPoint> tripMapPoints = dataService.loadTripMapActivityPoints(dataSource, tripId); - ObserveMapPane mapPane = getObserveMapPane(); TripMapContentBuilder mapContentBuilder = new TripMapContentBuilder(); mapContentBuilder.setStyledLayerDescriptor(config.getMapStyleFile()); diff --git a/observe-swing/src/main/map/style.xml b/observe-swing/src/main/map/style.xml index bcf9aa8..15b2bd9 100644 --- a/observe-swing/src/main/map/style.xml +++ b/observe-swing/src/main/map/style.xml @@ -160,23 +160,11 @@ <ogc:Or> <ogc:PropertyIsEqualTo> <ogc:PropertyName>pointType</ogc:PropertyName> - <ogc:Literal>SEINE_DEPARTURE_HARBOUR</ogc:Literal> - </ogc:PropertyIsEqualTo> - <ogc:PropertyIsEqualTo> - <ogc:PropertyName>pointType</ogc:PropertyName> - <ogc:Literal>SEINE_LANDING_HARBOUR</ogc:Literal> - </ogc:PropertyIsEqualTo> - <ogc:PropertyIsEqualTo> - <ogc:PropertyName>pointType</ogc:PropertyName> <ogc:Literal>SEINE_ACTIVITY_IN_HARBOUR</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>pointType</ogc:PropertyName> - <ogc:Literal>LONGLINE_DEPARTURE_HARBOUR</ogc:Literal> - </ogc:PropertyIsEqualTo> - <ogc:PropertyIsEqualTo> - <ogc:PropertyName>pointType</ogc:PropertyName> - <ogc:Literal>LONGLINE_LANDING_HARBOUR</ogc:Literal> + <ogc:Literal>LONGLINE_IN_HARBOUR</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Or> </ogc:Filter> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.