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

Commits:

1 changed file:

Changes:

  • client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/localmarket/TripBatchUIModelStates.java
    ... ... @@ -45,6 +45,7 @@ import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
    45 45
     import org.apache.logging.log4j.LogManager;
    
    46 46
     import org.apache.logging.log4j.Logger;
    
    47 47
     
    
    48
    +import javax.swing.SwingUtilities;
    
    48 49
     import java.beans.PropertyChangeEvent;
    
    49 50
     import java.util.LinkedHashSet;
    
    50 51
     import java.util.Set;
    
    ... ... @@ -75,17 +76,23 @@ public class TripBatchUIModelStates extends GeneratedTripBatchUIModelStates {
    75 76
         }
    
    76 77
     
    
    77 78
         public void resetComputedValues(PropertyChangeEvent event) {
    
    78
    -        if (event.getNewValue() == null && getTableModel().isCanConsolidate()) {
    
    79
    +        if (computing) {
    
    80
    +            return;
    
    81
    +        }
    
    82
    +        if (getTableModel().isCanConsolidate()) {
    
    79 83
                 getTableEditBean().setWeightComputedSource(null);
    
    80 84
             }
    
    81 85
         }
    
    82 86
     
    
    83 87
         public void recomputeComputedValues(PropertyChangeEvent event) {
    
    88
    +        if (computing) {
    
    89
    +            return;
    
    90
    +        }
    
    84 91
             String propertyName = event.getPropertyName();
    
    85 92
             if (!COMPUTE_PROPERTIES.contains(propertyName) || !getTableModel().isCanConsolidate()) {
    
    86 93
                 return;
    
    87 94
             }
    
    88
    -        recomputeComputedValues();
    
    95
    +        SwingUtilities.invokeLater(this::recomputeComputedValues);
    
    89 96
         }
    
    90 97
     
    
    91 98
         public void recomputeComputedValues() {