branch feature/7587 updated (ac31162 -> b5758f6)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7587 in repository observe. See http://git.codelutin.com/observe.git from ac31162 correction de la validation + ajout des routes dans le DTO de trip seine (refs #7587) new 416d0f8 adpatation des la carte + petite rose de vents (refs #7587) new b5758f6 calcule de la nouvelle position de la marée (refs #7587) The 2 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 b5758f6fd2046d0269cfb49c7d0c085a9bcca873 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 6 16:58:55 2015 +0200 calcule de la nouvelle position de la marée (refs #7587) commit 416d0f84fed1141e99edba226d9880432656c27e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 6 16:14:01 2015 +0200 adpatation des la carte + petite rose de vents (refs #7587) Summary of changes: .../ui/content/open/ContentOpenableUIHandler.java | 41 ++++++++++++++++++++-- .../impl/longline/ActivityLonglineUIHandler.java | 7 +++- .../open/impl/longline/TripLonglineUIHandler.java | 10 ++++-- .../open/impl/seine/ActivitySeineUIHandler.java | 8 +++++ .../ui/content/open/impl/seine/RouteUIHandler.java | 6 ++++ .../open/impl/seine/TripSeineUIHandler.java | 20 ++++++++++- .../observe/ui/util/tripMap/ObserveMapPane.java | 40 ++++++++++++++------- .../ui/util/tripMap/TripMapContentBuilder.java | 17 ++++----- .../observe/ui/util/tripMap/TripMapUIHandler.java | 23 ++++++------ .../services/service/seine/TripSeineService.java | 2 +- 10 files changed, 135 insertions(+), 39 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 feature/7587 in repository observe. See http://git.codelutin.com/observe.git commit 416d0f84fed1141e99edba226d9880432656c27e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 6 16:14:01 2015 +0200 adpatation des la carte + petite rose de vents (refs #7587) --- .../open/impl/seine/TripSeineUIHandler.java | 5 ++- .../observe/ui/util/tripMap/ObserveMapPane.java | 40 +++++++++++++++------- .../ui/util/tripMap/TripMapContentBuilder.java | 17 ++++----- .../observe/ui/util/tripMap/TripMapUIHandler.java | 23 ++++++------- 4 files changed, 52 insertions(+), 33 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java index bc0949d..0926c22 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java @@ -26,6 +26,7 @@ import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.configuration.ObserveSwingApplicationConfig; import fr.ird.observe.services.dto.FormDto; +import fr.ird.observe.services.dto.TripMapDto; import fr.ird.observe.services.dto.seine.TripSeineDto; import fr.ird.observe.services.dto.seine.TripSeineDtos; import fr.ird.observe.services.service.seine.TripSeineService; @@ -137,8 +138,10 @@ public class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> { TripSeineUI ui = getUi(); TripMapUI tripMap = ui.getTripMap(); + TripMapDto tripSeineMap = getTripSeineService().getTripSeineMap(getSelectedId()); - tripMap.getHandler().doOpenMap(getSelectedId()); + + tripMap.getHandler().doOpenMap(tripSeineMap); } }); buildTripMap = false; diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java index 2eb267e..ea0164c 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/ObserveMapPane.java @@ -35,9 +35,11 @@ import org.geotools.swing.event.MapPaneAdapter; import org.geotools.swing.event.MapPaneEvent; import java.awt.Color; +import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Point; +import java.awt.Polygon; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; @@ -144,36 +146,50 @@ public class ObserveMapPane extends JMapPane { } - protected static int AXIS_LENGHT = 30; - protected static int CIRCLE_RADIUS = 20; - protected static int CENTER_MARGIN = 60; + protected static int AXIS_LENGTH = 30; + + protected static int SUB_AXIS_LENGTH = 5; + + protected static int CENTER_MARGIN = 50; + protected static int INTER_AXIS_TEXT = 3; + + protected static double FONT_SIZE = 12; protected void paintCompass(Graphics graphics) { Point center = new Point(getWidth() - CENTER_MARGIN, CENTER_MARGIN); - graphics.drawOval( - center.x - CIRCLE_RADIUS, - center.y - CIRCLE_RADIUS, - CIRCLE_RADIUS * 2, - CIRCLE_RADIUS * 2); + Font font = graphics.getFont(); + Font fontRatio = font.deriveFont((float) (FONT_SIZE)); + graphics.setFont(fontRatio); FontMetrics fm = graphics.getFontMetrics(); for (CardinalPoint cardinalPoint : CardinalPoint.values()) { - Point2D direction = cardinalPoint.getDirection(rotation, AXIS_LENGHT, center); + Point2D direction = cardinalPoint.getDirection(rotation, (int) (AXIS_LENGTH), center); + + Point2D sommet1 = cardinalPoint.getDirection(rotation - Math.PI / 4, (int) (SUB_AXIS_LENGTH), center); + + Point2D sommet2 = cardinalPoint.getDirection(rotation + Math.PI / 4, (int) (SUB_AXIS_LENGTH), center); + + + Polygon polygon = new Polygon(); + polygon.addPoint((int) center.getX(), (int) center.getY()); + polygon.addPoint((int) direction.getX(), (int) direction.getY()); + polygon.addPoint((int) sommet2.getX(), (int) sommet2.getY()); + graphics.fillPolygon(polygon); - graphics.drawLine(center.x, center.y, (int)direction.getX(), (int) direction.getY()); + graphics.drawLine((int) sommet1.getX(), (int) sommet1.getY(), (int) direction.getX(), (int) direction.getY()); Rectangle2D textArea = fm.getStringBounds(cardinalPoint.getLabel(), graphics); // on cherche la ditance entre le centre du text et sa bordure dans le direction donné - double l = cardinalPoint.distanceCenterBorder(rotation, textArea); + double l = cardinalPoint.distanceCenterBorder(rotation, textArea); - Point2D textCenter = cardinalPoint.getDirection(rotation, AXIS_LENGHT + INTER_AXIS_TEXT + l, center); + Point2D textCenter = cardinalPoint.getDirection(rotation, (int) (AXIS_LENGTH + INTER_AXIS_TEXT) + l, center); graphics.drawString( cardinalPoint.getLabel(), diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java index a2f47a0..7b77a75 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapContentBuilder.java @@ -34,7 +34,8 @@ import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.Point; import com.vividsolutions.jts.geom.Polygon; import fr.ird.observe.business.ObserveTechnicalException; -import fr.ird.observe.entities.tripMap.*; +import fr.ird.observe.services.dto.TripMapPointDto; +import fr.ird.observe.services.dto.constants.TripMapPointType; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.geotools.data.FileDataStore; @@ -130,7 +131,7 @@ public class TripMapContentBuilder { mapContent.addLayer(layer); } - public void addTripLine(List<TripMapPoint> tripMapPoints) throws FactoryException { + public void addTripLine(List<TripMapPointDto> tripMapPoints) throws FactoryException { GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); @@ -148,9 +149,9 @@ public class TripMapContentBuilder { List<Coordinate> coordinatesByDay = null; - TripMapPoint previousPoint = null; + TripMapPointDto previousPoint = null; - for (TripMapPoint point : tripMapPoints) { + for (TripMapPointDto point : tripMapPoints) { if (previousPoint == null) { coordinatesByDay = Lists.newLinkedList(); } else if (!DateUtils.isSameDay(previousPoint.getTime(), point.getTime())) { @@ -221,7 +222,7 @@ public class TripMapContentBuilder { } - public void addLonglineFishingZone(List<TripMapPoint> tripMapPoints) throws FactoryException { + public void addLonglineFishingZone(List<TripMapPointDto> tripMapPoints) throws FactoryException { GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); SimpleFeatureTypeBuilder polygonFeatureTypeBuilder = new SimpleFeatureTypeBuilder(); @@ -267,7 +268,7 @@ public class TripMapContentBuilder { mapContent.addLayer(layerLines); } - public void addLonglineLine(List<TripMapPoint> tripMapPoints) throws FactoryException { + public void addLonglineLine(List<TripMapPointDto> tripMapPoints) throws FactoryException { GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); SimpleFeatureTypeBuilder lineFeatureTypeBuilder = new SimpleFeatureTypeBuilder(); @@ -357,7 +358,7 @@ public class TripMapContentBuilder { } - public void addPoints(List<TripMapPoint> tripMapPoints) throws FactoryException { + public void addPoints(List<TripMapPointDto> tripMapPoints) throws FactoryException { GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); @@ -377,7 +378,7 @@ public class TripMapContentBuilder { Set<TripMapPointType> pointTypeInLegend = Sets.newHashSet(); - for (TripMapPoint tripMapPoint : tripMapPoints) { + for (TripMapPointDto tripMapPoint : tripMapPoints) { Coordinate coordinate = new Coordinate(tripMapPoint.getLongitude(), tripMapPoint.getLatitude()); TripMapPointType type = tripMapPoint.getType(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java index ea3216c..06870bc 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/util/tripMap/TripMapUIHandler.java @@ -22,11 +22,13 @@ package fr.ird.observe.ui.util.tripMap; * #L% */ +import com.google.common.collect.Lists; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.ObserveTechnicalException; import fr.ird.observe.configuration.ObserveSwingApplicationConfig; -import fr.ird.observe.entities.tripMap.TripMapPoint; import fr.ird.observe.services.dto.IdDtos; +import fr.ird.observe.services.dto.TripMapDto; +import fr.ird.observe.services.dto.TripMapPointDto; import fr.ird.observe.ui.UIHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -37,8 +39,9 @@ import org.geotools.swing.event.MapPaneEvent; import org.geotools.swing.event.MapPaneListener; import javax.imageio.ImageIO; -import javax.swing.*; -import java.awt.*; +import javax.swing.JOptionPane; +import java.awt.CardLayout; +import java.awt.Point; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; @@ -104,9 +107,7 @@ public class TripMapUIHandler { return view.getObserveMapPane(); } - //FIXME -// public void doOpenMap(DataSource dataSource, DataService dataService, String tripId) { - public void doOpenMap(String tripId) { + public void doOpenMap(TripMapDto tripMapDto) { try { ((CardLayout) view.getLayout()).first(view); @@ -119,9 +120,7 @@ public class TripMapUIHandler { mapPane.getMapContent().dispose(); } - //FIXME -// List<TripMapPoint> tripMapPoints = dataService.loadTripMapActivityPoints(dataSource, tripId); - List<TripMapPoint> tripMapPoints = null; + List<TripMapPointDto> tripMapPoints = Lists.newArrayList(tripMapDto.getPoints()); TripMapContentBuilder mapContentBuilder = new TripMapContentBuilder(); @@ -131,11 +130,11 @@ public class TripMapUIHandler { mapContentBuilder.addLayer(layerFile); } - if (IdDtos.isSeineId(tripId)) { + if (IdDtos.isSeineId(tripMapDto.getId())) { mapContentBuilder.addTripLine(tripMapPoints); - } else if (IdDtos.isLonglineId(tripId)) { + } else if (IdDtos.isLonglineId(tripMapDto.getId())) { mapContentBuilder.addLonglineFishingZone(tripMapPoints); mapContentBuilder.addLonglineLine(tripMapPoints); @@ -146,7 +145,7 @@ public class TripMapUIHandler { // set zoom tripArea = new ReferencedEnvelope(); - for (TripMapPoint point : tripMapPoints) { + for (TripMapPointDto point : tripMapPoints) { tripArea.expandToInclude(new DirectPosition2D(point.getLongitude(), point.getLatitude())); } tripArea.expandBy(1.1); -- 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 feature/7587 in repository observe. See http://git.codelutin.com/observe.git commit b5758f6fd2046d0269cfb49c7d0c085a9bcca873 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 6 16:58:55 2015 +0200 calcule de la nouvelle position de la marée (refs #7587) --- .../ui/content/open/ContentOpenableUIHandler.java | 41 ++++++++++++++++++++-- .../impl/longline/ActivityLonglineUIHandler.java | 7 +++- .../open/impl/longline/TripLonglineUIHandler.java | 10 ++++-- .../open/impl/seine/ActivitySeineUIHandler.java | 8 +++++ .../ui/content/open/impl/seine/RouteUIHandler.java | 6 ++++ .../open/impl/seine/TripSeineUIHandler.java | 15 ++++++++ .../services/service/seine/TripSeineService.java | 2 +- 7 files changed, 83 insertions(+), 6 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java index f7ee163..502a648 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpenableUIHandler.java @@ -172,6 +172,7 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU ContentOpenableUI<E> ui = getUi(); + int position = ui.getContextValue(Integer.class, POSITION_OPENABLE); ObserveTreeHelper treeHelper = getTreeHelper(ui); ObserveNode node = treeHelper.getSelectedNode(); @@ -180,6 +181,13 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU E bean = getBean(); + int oldPosition; + if (create) { + oldPosition = parentNode.getChildCount(); + } else { + oldPosition = parentNode.getIndex(node); + } + if (create) { // on passe en mode mise à jour @@ -194,15 +202,29 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU // arrêt de l'édition de l'écran courant stopEditUI(); - treeHelper.reloadNode(parentNode, true); + if (oldPosition != position) { + + // on doit repositionner le noeud + treeHelper.moveNode(parentNode, node, position); + } // on sélectionne le nouveau noeud treeHelper.selectNode(node); } else { + if (oldPosition != position) { + + // on doit repositionner le noeud + treeHelper.moveNode(parentNode, node, position); - treeHelper.reloadNode(parentNode, true); + // et le selectionner + treeHelper.selectNode(node); + } + // on repaint le noeud et ses enfants +// treeHelper.refreshNode(node, true); + treeHelper.reloadSelectedNode(false, true); +// treeHelper.refreshNode(node, false); } } @@ -246,6 +268,21 @@ public abstract class ContentOpenableUIHandler<E extends IdDto> extends ContentU treeHelper.addUnsavedNode(parentNode, getBeanType()); } + protected final void obtainChildPosition(E bean){ + + String containerId = getSelectedParentId(); + + int position = getOpenablePosition(containerId, bean); + + if (log.isDebugEnabled()) { + log.debug("Position of child : " + position); + } + + getUi().setContextValue(position, POSITION_OPENABLE); + } + + protected abstract int getOpenablePosition(String parentId, E bean); + protected final void finalizeOpenUI(ContentMode mode, boolean create) { // utilisation du mode requis diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java index d7a31b5..17a30bb 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java @@ -26,7 +26,6 @@ import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.services.dto.FormDto; -import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.longline.ActivityLonglineDto; import fr.ird.observe.services.dto.longline.ActivityLonglineDtos; import fr.ird.observe.services.dto.longline.TripLonglineDto; @@ -305,6 +304,12 @@ public class ActivityLonglineUIHandler extends ContentOpenableUIHandler<Activity return true; } + @Override + protected int getOpenablePosition(String parentId, ActivityLonglineDto bean) { + // TODO + return 0; + } + //FIXME // @Override // protected ActivityLongline onCreate(TopiaContext tx, Object parent, ActivityLongline editBean) throws TopiaException { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java index 539eaad..420e058 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longline/TripLonglineUIHandler.java @@ -27,7 +27,6 @@ import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.configuration.ObserveSwingApplicationConfig; import fr.ird.observe.services.dto.FormDto; -import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.services.dto.longline.TripLonglineDto; import fr.ird.observe.services.dto.longline.TripLonglineDtos; import fr.ird.observe.services.service.longline.TripLonglineService; @@ -39,7 +38,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.DateUtil; -import javax.swing.*; +import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.util.Date; @@ -303,6 +303,12 @@ public class TripLonglineUIHandler extends ContentOpenableUIHandler<TripLongline return true; } + @Override + protected int getOpenablePosition(String parentId, TripLonglineDto bean) { + // TODO + return 0; + } + //FIXME // @Override // protected TripLongline onCreate(TopiaContext tx, Object parent, TripLongline editBean) throws TopiaException { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java index 9fcbf16..42eb319 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/ActivitySeineUIHandler.java @@ -349,6 +349,14 @@ public class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySei return true; } + + + @Override + protected int getOpenablePosition(String parentId, ActivitySeineDto bean) { + // TODO + return 0; + } + //FIXME // @Override // protected ActivitySeine onCreate(TopiaContext tx, Object parent, ActivitySeine editBean) throws TopiaException { diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java index 808791d..1855ff6 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/RouteUIHandler.java @@ -255,6 +255,12 @@ public class RouteUIHandler extends ContentOpenableUIHandler<RouteDto> { } @Override + protected int getOpenablePosition(String parentId, RouteDto bean) { + //TODO + return 0; + } + + @Override protected void afterSave(boolean refresh) { super.afterSave(refresh); repaintTripNode(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java index 0926c22..a82f283 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/TripSeineUIHandler.java @@ -21,11 +21,14 @@ */ package fr.ird.observe.ui.content.open.impl.seine; +import com.google.common.collect.Iterables; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.configuration.ObserveSwingApplicationConfig; import fr.ird.observe.services.dto.FormDto; +import fr.ird.observe.services.dto.IdDtos; +import fr.ird.observe.services.dto.ReferenceSetDto; import fr.ird.observe.services.dto.TripMapDto; import fr.ird.observe.services.dto.seine.TripSeineDto; import fr.ird.observe.services.dto.seine.TripSeineDtos; @@ -271,9 +274,21 @@ public class TripSeineUIHandler extends ContentOpenableUIHandler<TripSeineDto> { String beanId = getTripSeineService().save(bean); bean.setId(beanId); + // recuperation de la position de la maree dans le program + obtainChildPosition(bean); + return true; } + protected int getOpenablePosition(String parentId, TripSeineDto bean) { + + ReferenceSetDto<TripSeineDto> tripSeineByProgram = getTripSeineService().getTripSeineByProgram(parentId); + + int position = Iterables.indexOf(tripSeineByProgram.getReference(), IdDtos.newIdPredicate(bean.getId())); + + return position; + } + @Override protected boolean doDelete(TripSeineDto bean) throws Exception { diff --git a/observe-services-api/src/main/java/fr/ird/observe/services/service/seine/TripSeineService.java b/observe-services-api/src/main/java/fr/ird/observe/services/service/seine/TripSeineService.java index 6a01421..8fcb7c5 100644 --- a/observe-services-api/src/main/java/fr/ird/observe/services/service/seine/TripSeineService.java +++ b/observe-services-api/src/main/java/fr/ird/observe/services/service/seine/TripSeineService.java @@ -63,4 +63,4 @@ public interface TripSeineService extends ObserveService { @DeleteRequest void delete(String tripSeineId); -} \ No newline at end of file + } \ No newline at end of file -- 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