branch develop updated (c89f5a5 -> ce0400b)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See http://git.codelutin.com/observe.git from c89f5a5 refs #7148 : modification des requêtes pour les tableaux de synthèse new 8de82a1 refs #7154 : modification du rendu de la légende new 33becda refs #7154 : ajout des dates sur les activités de palangre new c3acac6 refs #7154 : ajout de ligne pour les activités autre que les opérations de pèche new ce0400b Merge branch 'feature/7154' into develop The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit ce0400b5cd1031526c513ff14864c772c597044d Merge: c89f5a5 c3acac6 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 14:22:47 2015 +0200 Merge branch 'feature/7154' into develop commit c3acac6c3713cef26c3013748349a0465695a219 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 14:15:41 2015 +0200 refs #7154 : ajout de ligne pour les activités autre que les opérations de pèche commit 33becdafc4f12744fa609818c9030f4fbcc988f5 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 12:35:25 2015 +0200 refs #7154 : ajout des dates sur les activités de palangre commit 8de82a1ce010c1f063a4b4650bbd7278c607768f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 11:17:19 2015 +0200 refs #7154 : modification du rendu de la légende Summary of changes: .../entities/longline/TripLonglineDAOImpl.java | 37 +++--- .../observe/ui/util/tripMap/ObserveMapPane.java | 33 ++++- .../ui/util/tripMap/ObserveMapPaneLegendItem.java | 7 +- .../ui/util/tripMap/TripMapContentBuilder.java | 103 ++++++++------- observe-swing/src/main/map/style.xml | 143 +++++++++++++++++++-- 5 files changed, 242 insertions(+), 81 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 8de82a1ce010c1f063a4b4650bbd7278c607768f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 11:17:19 2015 +0200 refs #7154 : modification du rendu de la légende --- .../observe/ui/util/tripMap/ObserveMapPane.java | 33 +++++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java index 2c32bea..2eb267e 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java @@ -184,6 +184,8 @@ public class ObserveMapPane extends JMapPane { } + protected static int LEGEND_MARGIN = 3; + protected List<ObserveMapPaneLegendItem> legendItems; public List<ObserveMapPaneLegendItem> getLegendItems() { @@ -199,7 +201,7 @@ public class ObserveMapPane extends JMapPane { if (legendItems != null) { int x = 0; - int y = getHeight() - ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT * legendItems.size(); + int y = getHeight() - ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT * legendItems.size() - 2 * LEGEND_MARGIN; ObserverMapPanLegendDrawer drawer = new ObserverMapPanLegendDrawer(); @@ -214,13 +216,24 @@ public class ObserveMapPane extends JMapPane { } + int legendWidth = ObserveMapPaneLegendItem.LEGEND_SYMBOL_WIDTH + maxLabelWidth + ObserveMapPaneLegendItem.LEGEND_MARGIN * 2; + + graphics.setColor(ObserveMapPaneLegendItem.LEGEND_BACKGROUND); + graphics.fillRect( + x, + y, + legendWidth, + LEGEND_MARGIN); + + y += LEGEND_MARGIN; + for (ObserveMapPaneLegendItem item : legendItems) { graphics.setColor(ObserveMapPaneLegendItem.LEGEND_BACKGROUND); graphics.fillRect( x, y, - ObserveMapPaneLegendItem.LEGEND_SYMBOL_WIDTH + maxLabelWidth + ObserveMapPaneLegendItem.LEGEND_MARGIN, + legendWidth, ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT); BufferedImage symbole = new BufferedImage( @@ -242,21 +255,27 @@ public class ObserveMapPane extends JMapPane { } } - graphics.drawImage(symbole, x, y, null); + graphics.drawImage(symbole, x + LEGEND_MARGIN, y, null); graphics.setColor(Color.BLACK); - Rectangle2D labelArea = fm.getStringBounds(item.getLabel(), graphics); - - int labelMarginBottom = (int) ((ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT - labelArea.getHeight()) / 2); + int labelMarginBottom = ((ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT - fm.getHeight()) / 2) + fm.getDescent(); graphics.drawString(item.getLabel(), - x + ObserveMapPaneLegendItem.LEGEND_SYMBOL_WIDTH, + x + LEGEND_MARGIN + ObserveMapPaneLegendItem.LEGEND_SYMBOL_WIDTH, y + ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT - labelMarginBottom); y += ObserveMapPaneLegendItem.LEGEND_ITEM_HEIGHT; } + + graphics.setColor(ObserveMapPaneLegendItem.LEGEND_BACKGROUND); + graphics.fillRect( + x, + y, + legendWidth, + LEGEND_MARGIN); + } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 33becdafc4f12744fa609818c9030f4fbcc988f5 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 12:35:25 2015 +0200 refs #7154 : ajout des dates sur les activités de palangre --- .../ui/util/tripMap/ObserveMapPaneLegendItem.java | 7 +- .../ui/util/tripMap/TripMapContentBuilder.java | 73 ++++++------ observe-swing/src/main/map/style.xml | 125 +++++++++++++++++++-- 3 files changed, 150 insertions(+), 55 deletions(-) diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPaneLegendItem.java b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPaneLegendItem.java index 88c5eef..a0ea0e2 100644 --- a/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPaneLegendItem.java +++ b/observe-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPaneLegendItem.java @@ -46,10 +46,9 @@ public class ObserveMapPaneLegendItem { return coordinates; } - public static Coordinate[] pointCoordinates() { - Coordinate[] coordinates = new Coordinate[1]; - coordinates[0] = new Coordinate(LEGEND_SYMBOL_WIDTH / 2, LEGEND_ITEM_HEIGHT / 2); - return coordinates; + public static Coordinate pointCoordinates() { + Coordinate coordinate = new Coordinate(LEGEND_SYMBOL_WIDTH / 2, LEGEND_ITEM_HEIGHT / 2); + return coordinate; } 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 aa5a9cf..59ef727 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 @@ -22,16 +22,16 @@ package fr.ird.observe.ui.util.tripMap; * #L% */ -import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; -import com.vividsolutions.jts.geom.MultiPoint; +import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; import fr.ird.observe.ObserveTechnicalException; import fr.ird.observe.tripMap.TripMapPoint; @@ -67,7 +67,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -95,8 +94,9 @@ public class TripMapContentBuilder { TripMapPointType.LONGLINE_ACTIVITY_WITH_STATION, TripMapPointType.LONGLINE_ACTIVITY_WITH_INTERACTION); - protected StyledLayerDescriptor styledLayerDescriptor; + public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM"); + protected StyledLayerDescriptor styledLayerDescriptor; protected MapContent mapContent; protected List<ObserveMapPaneLegendItem> legendItems; @@ -132,7 +132,6 @@ public class TripMapContentBuilder { } public void addTripLine(List<TripMapPoint> tripMapPoints) throws FactoryException { - SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM"); GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); @@ -160,7 +159,7 @@ public class TripMapContentBuilder { if (coordinatesByDay.size() > 1) { LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0])); lineBuilder.add(line); - lineBuilder.add(dateFormat.format(previousPoint.getTime())); + lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime())); lineBuilder.add("tripDay"); SimpleFeature feature = lineBuilder.buildFeature(null); @@ -190,7 +189,7 @@ public class TripMapContentBuilder { if (coordinatesByDay.size() > 1) { LineString line = geometryFactory.createLineString(coordinatesByDay.toArray(new Coordinate[0])); lineBuilder.add(line); - lineBuilder.add(dateFormat.format(previousPoint.getTime())); + lineBuilder.add(DATE_FORMAT.format(previousPoint.getTime())); lineBuilder.add("tripDay"); linesFeatures.add(lineBuilder.buildFeature(null)); } @@ -230,6 +229,7 @@ public class TripMapContentBuilder { polygonFeatureTypeBuilder.setName("longlineFishingZoneBuilder"); polygonFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true)); polygonFeatureTypeBuilder.add("zone", Polygon.class); + polygonFeatureTypeBuilder.add("label", String.class); polygonFeatureTypeBuilder.add("type", String.class); SimpleFeatureType polygonFeatureType = polygonFeatureTypeBuilder.buildFeatureType(); @@ -255,6 +255,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(DATE_FORMAT.format(tripMapPoints.get(indexPoint - 3).getTime())); polygonBuilder.add("longlineFishingZone"); SimpleFeature feature = polygonBuilder.buildFeature(null); polygonsFeatures.add(feature); @@ -338,7 +339,8 @@ public class TripMapContentBuilder { SimpleFeatureTypeBuilder pointFeatureTypeBuilder = new SimpleFeatureTypeBuilder(); pointFeatureTypeBuilder.setName("point Builder"); pointFeatureTypeBuilder.setCRS(CRS.decode("EPSG:4326", true)); - pointFeatureTypeBuilder.add("points", MultiPoint.class); + pointFeatureTypeBuilder.add("point", Point.class); + pointFeatureTypeBuilder.add("label", String.class); pointFeatureTypeBuilder.add("pointType", String.class); SimpleFeatureType pointFeatureType = pointFeatureTypeBuilder.buildFeatureType(); @@ -348,45 +350,34 @@ public class TripMapContentBuilder { Style stylePoints = findStyle(styledLayerDescriptor, TRIP_POINTS_LAYER_NAME, null); + Set<TripMapPointType> pointTypeInLegend = Sets.newHashSet(); - for (final TripMapPointType type : TripMapPointType.values()) { - - Iterable<Coordinate> coordinates = Iterables.transform( - Iterables.filter(tripMapPoints, new Predicate<TripMapPoint>() { - @Override - public boolean apply(TripMapPoint input) { - return type.equals(input.getType()); - } - }), - new Function<TripMapPoint, Coordinate>() { - @Override - public Coordinate apply(TripMapPoint input) { - return new Coordinate(input.getLongitude(), input.getLatitude()); - } - }); - - ArrayList<Coordinate> coordinatesArray = Lists.newArrayList(coordinates); - if (! coordinatesArray.isEmpty()) { - MultiPoint points = geometryFactory.createMultiPoint(coordinatesArray.toArray(new Coordinate[0])); - pointBuilder.add(points); - pointBuilder.add(type.name()); - pointsFeatures.add(pointBuilder.buildFeature(null)); + for (TripMapPoint tripMapPoint : tripMapPoints) { + Coordinate coordinate = new Coordinate(tripMapPoint.getLongitude(), tripMapPoint.getLatitude()); + TripMapPointType type = tripMapPoint.getType(); - // add point in legend - if (TRIP_MAP_POINT_TYPES_IN_LEGEND.contains(type)) { - points = geometryFactory.createMultiPoint(ObserveMapPaneLegendItem.pointCoordinates()); - pointBuilder.add(points); - pointBuilder.add(type.name()); + Point point = geometryFactory.createPoint(coordinate); + pointBuilder.add(point); + pointBuilder.add(DATE_FORMAT.format(tripMapPoint.getTime())); + pointBuilder.add(type.name()); + pointsFeatures.add(pointBuilder.buildFeature(null)); - ObserveMapPaneLegendItem legendPoint = new ObserveMapPaneLegendItem( - pointBuilder.buildFeature(null), - stylePoints, - type.getLabel()); - legendItems.add(legendPoint); - } + // add point in legend + if (TRIP_MAP_POINT_TYPES_IN_LEGEND.contains(type) && ! pointTypeInLegend.contains(type)) { + point = geometryFactory.createPoint(ObserveMapPaneLegendItem.pointCoordinates()); + pointBuilder.add(point); + pointBuilder.add(""); + pointBuilder.add(type.name()); + ObserveMapPaneLegendItem legendPoint = new ObserveMapPaneLegendItem( + pointBuilder.buildFeature(null), + stylePoints, + type.getLabel()); + legendItems.add(legendPoint); + pointTypeInLegend.add(type); } + } Layer pointsLayer = new FeatureLayer(pointsFeatures, stylePoints); diff --git a/observe-swing/src/main/map/style.xml b/observe-swing/src/main/map/style.xml index 15b2bd9..02c2971 100644 --- a/observe-swing/src/main/map/style.xml +++ b/observe-swing/src/main/map/style.xml @@ -101,6 +101,27 @@ <CssParameter name="fill-opacity">0.5</CssParameter> </Fill> </PolygonSymbolizer> + <TextSymbolizer> + <Label> + <ogc:PropertyName>label</ogc:PropertyName> + </Label> + <Font> + <CssParameter name="font-size">14</CssParameter> + <CssParameter name="font-style">normal</CssParameter> + <CssParameter name="font-weight">bold</CssParameter> + </Font> + <LabelPlacement> + <PointPlacement> + <AnchorPoint> + <AnchorPointX>0.5</AnchorPointX> + <AnchorPointY>0.5</AnchorPointY> + </AnchorPoint> + </PointPlacement> + </LabelPlacement> + <Fill> + <CssParameter name="fill">#000000</CssParameter> + </Fill> + </TextSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> @@ -157,16 +178,10 @@ <Rule> <Name>Point seine activity in harbour</Name> <ogc:Filter> - <ogc:Or> - <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_IN_HARBOUR</ogc:Literal> - </ogc:PropertyIsEqualTo> - </ogc:Or> + <ogc:PropertyIsEqualTo> + <ogc:PropertyName>pointType</ogc:PropertyName> + <ogc:Literal>SEINE_ACTIVITY_IN_HARBOUR</ogc:Literal> + </ogc:PropertyIsEqualTo> </ogc:Filter> <PointSymbolizer> <Graphic> @@ -353,6 +368,54 @@ <FeatureTypeStyle> <Rule> + <Name>Point seine activity in harbour</Name> + <ogc:Filter> + <ogc:PropertyIsEqualTo> + <ogc:PropertyName>pointType</ogc:PropertyName> + <ogc:Literal>LONGLINE_IN_HARBOUR</ogc:Literal> + </ogc:PropertyIsEqualTo> + </ogc:Filter> + <PointSymbolizer> + <Graphic> + <Mark> + <WellKnownName>Circle</WellKnownName> + <Fill> + <CssParameter name="fill">#7800f6</CssParameter> + </Fill> + <Stroke> + <CssParameter name="stroke">#000000</CssParameter> + <CssParameter name="stroke-width">1</CssParameter> + </Stroke> + </Mark> + <Size>12</Size> + </Graphic> + </PointSymbolizer> + <TextSymbolizer> + <Label> + <ogc:PropertyName>label</ogc:PropertyName> + </Label> + <Font> + <CssParameter name="font-size">14</CssParameter> + <CssParameter name="font-style">normal</CssParameter> + <CssParameter name="font-weight">bold</CssParameter> + </Font> + <LabelPlacement> + <PointPlacement> + <Displacement> + <DisplacementX>5</DisplacementX> + <DisplacementY>5</DisplacementY> + </Displacement> + </PointPlacement> + </LabelPlacement> + <Fill> + <CssParameter name="fill">#000000</CssParameter> + </Fill> + </TextSymbolizer> + </Rule> + </FeatureTypeStyle> + + <FeatureTypeStyle> + <Rule> <Name>Point longline activity with interaction</Name> <ogc:Filter> <ogc:PropertyIsEqualTo> @@ -375,6 +438,27 @@ <Size>12</Size> </Graphic> </PointSymbolizer> + <TextSymbolizer> + <Label> + <ogc:PropertyName>label</ogc:PropertyName> + </Label> + <Font> + <CssParameter name="font-size">14</CssParameter> + <CssParameter name="font-style">normal</CssParameter> + <CssParameter name="font-weight">bold</CssParameter> + </Font> + <LabelPlacement> + <PointPlacement> + <Displacement> + <DisplacementX>5</DisplacementX> + <DisplacementY>5</DisplacementY> + </Displacement> + </PointPlacement> + </LabelPlacement> + <Fill> + <CssParameter name="fill">#000000</CssParameter> + </Fill> + </TextSymbolizer> </Rule> </FeatureTypeStyle> @@ -402,6 +486,27 @@ <Size>16</Size> </Graphic> </PointSymbolizer> + <TextSymbolizer> + <Label> + <ogc:PropertyName>label</ogc:PropertyName> + </Label> + <Font> + <CssParameter name="font-size">14</CssParameter> + <CssParameter name="font-style">normal</CssParameter> + <CssParameter name="font-weight">bold</CssParameter> + </Font> + <LabelPlacement> + <PointPlacement> + <Displacement> + <DisplacementX>5</DisplacementX> + <DisplacementY>5</DisplacementY> + </Displacement> + </PointPlacement> + </LabelPlacement> + <Fill> + <CssParameter name="fill">#000000</CssParameter> + </Fill> + </TextSymbolizer> </Rule> </FeatureTypeStyle> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit c3acac6c3713cef26c3013748349a0465695a219 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 14:15:41 2015 +0200 refs #7154 : ajout de ligne pour les activités autre que les opérations de pèche --- .../entities/longline/TripLonglineDAOImpl.java | 37 ++++++++++++---------- .../ui/util/tripMap/TripMapContentBuilder.java | 30 ++++++++++++++++-- observe-swing/src/main/map/style.xml | 18 +++++++++++ 3 files changed, 66 insertions(+), 19 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 c78ee0c..f8bee26 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 @@ -162,25 +162,28 @@ public class TripLonglineDAOImpl<E extends TripLongline> extends TripLonglineDAO List<TripMapPoint> result = Lists.newLinkedList(); - // activity - TripMapPoint activity = new TripMapPoint(); - activity.setTime(resultSet.getDate(1)); - activity.setLatitude(resultSet.getFloat(2)); - activity.setLongitude(resultSet.getFloat(3)); - - String vesselActivityId = resultSet.getString(4); - if (vesselActivityId == null) { - activity.setType(TripMapPointType.LONGLINE_ACTIVITY); - } else if (ACTIVITY_INTERACTION_ID.equals(vesselActivityId)) { - activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_INTERACTION); - } else if (ACTIVITY_STATION_ID.equals(vesselActivityId)) { - activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_STATION); - } else { - activity.setType(TripMapPointType.LONGLINE_ACTIVITY); + if (resultSet.getString(5) == null) { + + // activity + TripMapPoint activity = new TripMapPoint(); + activity.setTime(resultSet.getDate(1)); + activity.setLatitude(resultSet.getFloat(2)); + activity.setLongitude(resultSet.getFloat(3)); + + String vesselActivityId = resultSet.getString(4); + if (vesselActivityId == null) { + activity.setType(TripMapPointType.LONGLINE_ACTIVITY); + } else if (ACTIVITY_INTERACTION_ID.equals(vesselActivityId)) { + activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_INTERACTION); + } else if (ACTIVITY_STATION_ID.equals(vesselActivityId)) { + activity.setType(TripMapPointType.LONGLINE_ACTIVITY_WITH_STATION); + } else { + activity.setType(TripMapPointType.LONGLINE_ACTIVITY); + } + + result.add(activity); } - result.add(activity); - // settingStart if (resultSet.getString(5) != null) { TripMapPoint settingStart = new TripMapPoint(); 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 59ef727..c859c8d 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 @@ -282,8 +282,10 @@ public class TripMapContentBuilder { DefaultFeatureCollection linesFeatures = new DefaultFeatureCollection(); - for (int indexPoint = 1; indexPoint < tripMapPoints.size(); indexPoint++) { - if (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_END) + List<Coordinate> defaultLineCoordinates = Lists.newLinkedList(); + + for (int indexPoint = 0; indexPoint < tripMapPoints.size(); indexPoint++) { + if (indexPoint > 1 && tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_END) && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_START) || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_HAULING_END) && tripMapPoints.get(indexPoint - 1).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_HAULING_START)) { @@ -300,7 +302,31 @@ public class TripMapContentBuilder { SimpleFeature feature = lineBuilder.buildFeature(null); linesFeatures.add(feature); + defaultLineCoordinates.clear(); + } + + if (! (tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_END) + || tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_HAULING_START))) { + + defaultLineCoordinates.add(new Coordinate(tripMapPoints.get(indexPoint).getLongitude(), tripMapPoints.get(indexPoint).getLatitude())); + + } + + if ((tripMapPoints.get(indexPoint).getType().equals(TripMapPointType.LONGLINE_ACTIVITY_WITH_SETTING_START) + || indexPoint == tripMapPoints.size() - 1) && defaultLineCoordinates.size() > 1) { + + LineString lineString = geometryFactory.createLineString(defaultLineCoordinates.toArray( new Coordinate[0])); + lineBuilder.add(lineString); + lineBuilder.add("trip"); + SimpleFeature feature = lineBuilder.buildFeature(null); + linesFeatures.add(feature); + + defaultLineCoordinates.clear(); + } + + + } Style styleLines = findStyle(styledLayerDescriptor, TRIP_LONGLINE_LINE_LAYER_NAME, null); diff --git a/observe-swing/src/main/map/style.xml b/observe-swing/src/main/map/style.xml index 02c2971..a6de37a 100644 --- a/observe-swing/src/main/map/style.xml +++ b/observe-swing/src/main/map/style.xml @@ -134,6 +134,24 @@ <Title>SLD Cook Book: Simple Line</Title> <FeatureTypeStyle> <Rule> + <Name>Trip</Name> + <ogc:Filter> + <ogc:PropertyIsEqualTo> + <ogc:PropertyName>type</ogc:PropertyName> + <ogc:Literal>trip</ogc:Literal> + </ogc:PropertyIsEqualTo> + </ogc:Filter> + <LineSymbolizer> + <Stroke> + <CssParameter name="stroke">#222222</CssParameter> + <CssParameter name="stroke-width">1</CssParameter> + <CssParameter name="stroke-dasharray">5 7</CssParameter> + </Stroke> + </LineSymbolizer> + </Rule> + </FeatureTypeStyle> + <FeatureTypeStyle> + <Rule> <Name>setting</Name> <ogc:Filter> <ogc:PropertyIsEqualTo> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit ce0400b5cd1031526c513ff14864c772c597044d Merge: c89f5a5 c3acac6 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 14:22:47 2015 +0200 Merge branch 'feature/7154' into develop .../entities/longline/TripLonglineDAOImpl.java | 37 +++--- .../observe/ui/util/tripMap/ObserveMapPane.java | 33 ++++- .../ui/util/tripMap/ObserveMapPaneLegendItem.java | 7 +- .../ui/util/tripMap/TripMapContentBuilder.java | 103 ++++++++------- observe-swing/src/main/map/style.xml | 143 +++++++++++++++++++-- 5 files changed, 242 insertions(+), 81 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm