...
 
Commits (6)
## Sprint 90 - v3.9.8
- Pas de mise à jour de modèle
## Sprint 89 - v3.9.7 ## Sprint 89 - v3.9.7
- Pas de mise à jour de modèle - Pas de mise à jour de modèle
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId> <groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId> <artifactId>reefdb</artifactId>
<version>3.9.7</version> <version>3.9.8</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Reef DB</name> <name>Reef DB</name>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>fr.ifremer.reefdb</groupId> <groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId> <artifactId>reefdb</artifactId>
<version>3.9.7</version> <version>3.9.8</version>
</parent> </parent>
<artifactId>reefdb-core</artifactId> <artifactId>reefdb-core</artifactId>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
# Please fill the missing licenses for dependencies : # Please fill the missing licenses for dependencies :
# #
# #
#Mon Mar 23 12:33:10 CET 2020 #Mon Mar 30 15:21:02 CEST 2020
com.oracle--ojdbc7--12.1.0.2.0=OTN license com.oracle--ojdbc7--12.1.0.2.0=OTN license
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License dom4j--dom4j--1.6.1=BSD License
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>fr.ifremer.reefdb</groupId> <groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId> <artifactId>reefdb</artifactId>
<version>3.9.7</version> <version>3.9.8</version>
</parent> </parent>
<artifactId>reefdb-ui-swing</artifactId> <artifactId>reefdb-ui-swing</artifactId>
......
...@@ -30,6 +30,7 @@ import com.google.common.collect.Maps; ...@@ -30,6 +30,7 @@ import com.google.common.collect.Maps;
import fr.ifremer.quadrige3.core.dao.technical.Assert; import fr.ifremer.quadrige3.core.dao.technical.Assert;
import fr.ifremer.quadrige3.core.dao.technical.factorization.pmfm.AllowedQualitativeValuesMap; import fr.ifremer.quadrige3.core.dao.technical.factorization.pmfm.AllowedQualitativeValuesMap;
import fr.ifremer.quadrige3.ui.core.dto.DirtyAware; import fr.ifremer.quadrige3.ui.core.dto.DirtyAware;
import fr.ifremer.quadrige3.ui.swing.table.AbstractTableUIModel;
import fr.ifremer.quadrige3.ui.swing.table.SwingTable; import fr.ifremer.quadrige3.ui.swing.table.SwingTable;
import fr.ifremer.quadrige3.ui.swing.table.editor.ExtendedComboBoxCellEditor; import fr.ifremer.quadrige3.ui.swing.table.editor.ExtendedComboBoxCellEditor;
import fr.ifremer.reefdb.decorator.DecoratorService; import fr.ifremer.reefdb.decorator.DecoratorService;
...@@ -454,7 +455,8 @@ public abstract class AbstractMeasurementsGroupedTableUIHandler< ...@@ -454,7 +455,8 @@ public abstract class AbstractMeasurementsGroupedTableUIHandler<
// now calculate individual id after table is sorted // now calculate individual id after table is sorted
if (getTable().getRowSorter().getSortKeys().isEmpty()) { if (getTable().getRowSorter().getSortKeys().isEmpty()) {
calculateIndividualIds(newRow); // Also use a OneShotListener (Mantis #51586)
OneShotListener.create(getModel(), AbstractTableUIModel.PROPERTY_ROWS, propertyChangeEvent -> calculateIndividualIds(newRow));
} else { } else {
OneShotListener.create(getTable(), SwingTable.PROPERTY_SORTED, propertyChangeEvent -> calculateIndividualIds(newRow)); OneShotListener.create(getTable(), SwingTable.PROPERTY_SORTED, propertyChangeEvent -> calculateIndividualIds(newRow));
} }
......
...@@ -23,6 +23,8 @@ package fr.ifremer.reefdb.ui.swing.util; ...@@ -23,6 +23,8 @@ package fr.ifremer.reefdb.ui.swing.util;
* #L% * #L%
*/ */
import org.jdesktop.beans.AbstractBean;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.awt.Component; import java.awt.Component;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
...@@ -36,7 +38,8 @@ import java.util.function.Consumer; ...@@ -36,7 +38,8 @@ import java.util.function.Consumer;
*/ */
public class OneShotListener implements PropertyChangeListener { public class OneShotListener implements PropertyChangeListener {
private final Component parent; private final Component parentComponent;
private final AbstractBean parentBean;
private final String propertyName; private final String propertyName;
private final Consumer<PropertyChangeEvent> consumer; private final Consumer<PropertyChangeEvent> consumer;
...@@ -52,8 +55,28 @@ public class OneShotListener implements PropertyChangeListener { ...@@ -52,8 +55,28 @@ public class OneShotListener implements PropertyChangeListener {
parent.addPropertyChangeListener(propertyName, listener); parent.addPropertyChangeListener(propertyName, listener);
} }
private OneShotListener(Component parent, String propertyName, Consumer<PropertyChangeEvent> consumer) { /**
this.parent = parent; * Create and add to parent object
*
* @param parent the bean on which this listener will be added
* @param propertyName the property to listen to
* @param consumer the consumer function
*/
public static void create(@Nonnull AbstractBean parent, @Nonnull String propertyName, @Nonnull Consumer<PropertyChangeEvent> consumer) {
OneShotListener listener = new OneShotListener(parent, propertyName, consumer);
parent.addPropertyChangeListener(propertyName, listener);
}
private OneShotListener(Component parentComponent, String propertyName, Consumer<PropertyChangeEvent> consumer) {
this.parentComponent = parentComponent;
this.parentBean = null;
this.propertyName = propertyName;
this.consumer = consumer;
}
private OneShotListener(AbstractBean parentBean, String propertyName, Consumer<PropertyChangeEvent> consumer) {
this.parentComponent = null;
this.parentBean = parentBean;
this.propertyName = propertyName; this.propertyName = propertyName;
this.consumer = consumer; this.consumer = consumer;
} }
...@@ -61,6 +84,9 @@ public class OneShotListener implements PropertyChangeListener { ...@@ -61,6 +84,9 @@ public class OneShotListener implements PropertyChangeListener {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
consumer.accept(evt); consumer.accept(evt);
parent.removePropertyChangeListener(propertyName, this); if (parentComponent != null)
parentComponent.removePropertyChangeListener(propertyName, this);
if (parentBean != null)
parentBean.removePropertyChangeListener(propertyName, this);
} }
} }
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
</properties> </properties>
<body> <body>
<release version="3.9.8" date="2020-03-30" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="51586">
Regression of #51520: Postpone calculation also if no row sorting
</action>
</release>
<release version="3.9.7" date="2020-03-23" description="Stable release"> <release version="3.9.7" date="2020-03-23" description="Stable release">
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="51520"> <action dev="ludovic.pecquot@e-is.pro" type="fix" issue="51520">
Rework the calculation of individual ids on grouped measurements, now use table sorting if possible Rework the calculation of individual ids on grouped measurements, now use table sorting if possible
......