Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- 7199 discussions
[Git][ultreiaio/ird-observe][develop] LL Observations / Capture / déprédation : libellé - Closes #1520
by Tony CHEMIT 27 Jun '20
by Tony CHEMIT 27 Jun '20
27 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
b00a30b3 by Tony Chemit at 2020-06-27T10:14:04+02:00
LL Observations / Capture / déprédation : libellé - Closes #1520
[LL][Logbook] opération de pêche / libellé - Closes #1526
- - - - -
3 changed files:
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
Changes:
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=New catch
observe.data.ll.logbook.Catch.action.new.tip=Create a new catch
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Reset photo references
observe.data.ll.logbook.Catch.availablePredator=Avaiable predators
-observe.data.ll.logbook.Catch.beatDiameter=Beat diameter
+observe.data.ll.logbook.Catch.beatDiameter=Beat diameter (cm)
observe.data.ll.logbook.Catch.branchlineTab=Branchline
observe.data.ll.logbook.Catch.caracteristicTab=Caracteristics
observe.data.ll.logbook.Catch.catchFate=Fate
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Comment
observe.data.ll.logbook.Catch.count=Count
observe.data.ll.logbook.Catch.countDepredated=Count depredated
observe.data.ll.logbook.Catch.depredated=Depredated
-observe.data.ll.logbook.Catch.depredatedProportion=Depredated proportion
+observe.data.ll.logbook.Catch.depredatedProportion=Depredated proportion (%)
observe.data.ll.logbook.Catch.depredatedTab=Depredation
observe.data.ll.logbook.Catch.discardHealthStatus=Discard health status
observe.data.ll.logbook.Catch.foodAndSexualTab=Food and sexual maturity
@@ -1208,9 +1208,9 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Start timestamp
observe.data.ll.logbook.Set.haulingTab=Hauling
observe.data.ll.logbook.Set.homeId=Home id
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Length between branchlines (m)
-observe.data.ll.logbook.Set.lightsticksColor=Lightsticks color
+observe.data.ll.logbook.Set.lightsticksColor=Majority lightsticks color
observe.data.ll.logbook.Set.lightsticksTab=Lightsticks
-observe.data.ll.logbook.Set.lightsticksType=Lightsticks type
+observe.data.ll.logbook.Set.lightsticksType=Majority lightsticks type
observe.data.ll.logbook.Set.lightsticksUsed=Lightsticks used
observe.data.ll.logbook.Set.lineType=Line type
observe.data.ll.logbook.Set.maxDepthTargeted=Max depth targeted (m)
@@ -1410,9 +1410,9 @@ observe.data.ll.observation.Catch.action.deleteSelectedWeightMeasure.tip=Delete
observe.data.ll.observation.Catch.action.new=New catch
observe.data.ll.observation.Catch.action.new.tip=Create a new catch
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Reset photo references
-observe.data.ll.observation.Catch.availablePredator=Avaiable predators
+observe.data.ll.observation.Catch.availablePredator=Available predators
observe.data.ll.observation.Catch.basket=Basket
-observe.data.ll.observation.Catch.beatDiameter=Beat diameter
+observe.data.ll.observation.Catch.beatDiameter=Beat diameter (cm)
observe.data.ll.observation.Catch.branchline=Branchline
observe.data.ll.observation.Catch.branchlineTab=Branchline
observe.data.ll.observation.Catch.caracteristicTab=Caracteristics
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=Nueva captura
observe.data.ll.logbook.Catch.action.new.tip=Crear una nueva captura
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Reiniciar las referencias photo
observe.data.ll.logbook.Catch.availablePredator=Deprepadaores disponibles
-observe.data.ll.logbook.Catch.beatDiameter=Diametro de la mordedura
+observe.data.ll.logbook.Catch.beatDiameter=Diametro de la mordedura (cm)
observe.data.ll.logbook.Catch.branchlineTab=Arponcillo
observe.data.ll.logbook.Catch.caracteristicTab=Características
observe.data.ll.logbook.Catch.catchFate=Devenir
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Comentario
observe.data.ll.logbook.Catch.count=Numéro
observe.data.ll.logbook.Catch.countDepredated=Count depredated \#TODO
observe.data.ll.logbook.Catch.depredated=Victima de depredación
-observe.data.ll.logbook.Catch.depredatedProportion=Depredación propertion \#TODO
+observe.data.ll.logbook.Catch.depredatedProportion=Depredación propertion (%) \#TODO
observe.data.ll.logbook.Catch.depredatedTab=Depredación
observe.data.ll.logbook.Catch.discardHealthStatus=Salud al rechazo
observe.data.ll.logbook.Catch.foodAndSexualTab=Alimentación y maturidad sexual
@@ -1208,12 +1208,12 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Timestamp del inicio
observe.data.ll.logbook.Set.haulingTab=Arrastre
observe.data.ll.logbook.Set.homeId=Id de negocio
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Length between branchlines (m) \#TODO
-observe.data.ll.logbook.Set.lightsticksColor=Color de barrita de luz
+observe.data.ll.logbook.Set.lightsticksColor=Mayoritario color de barrita de luz \#TODO
observe.data.ll.logbook.Set.lightsticksTab=Lightsticks \#TODO
-observe.data.ll.logbook.Set.lightsticksType=Tipo de barrita de luz
+observe.data.ll.logbook.Set.lightsticksType=Mayoritario tipo de barrita de luz \#TODO
observe.data.ll.logbook.Set.lightsticksUsed=Lightsticks used \#TODO
observe.data.ll.logbook.Set.lineType=Tipo de línea
-observe.data.ll.logbook.Set.maxDepthTargeted=Profundidad máxima deseada
+observe.data.ll.logbook.Set.maxDepthTargeted=Profundidad máxima deseada (m)
observe.data.ll.logbook.Set.message.creating=Lance en proceso de creación.
observe.data.ll.logbook.Set.message.updating=La operación de pesca está en proceso de modificación.
observe.data.ll.logbook.Set.monitored=Instrumentada
@@ -1412,7 +1412,7 @@ observe.data.ll.observation.Catch.action.new.tip=Crear una nueva captura
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Reiniciar las referencias photo
observe.data.ll.observation.Catch.availablePredator=Deprepadaores disponibles
observe.data.ll.observation.Catch.basket=cesta
-observe.data.ll.observation.Catch.beatDiameter=Diametro de la mordedura
+observe.data.ll.observation.Catch.beatDiameter=Diametro de la mordedura (cm)
observe.data.ll.observation.Catch.branchline=Arponcillo
observe.data.ll.observation.Catch.branchlineTab=Arponcillo
observe.data.ll.observation.Catch.caracteristicTab=Características
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=Nouvelle capture
observe.data.ll.logbook.Catch.action.new.tip=Créer une nouvelle capture
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Réinitialiser les références photo
observe.data.ll.logbook.Catch.availablePredator=Prédateurs disponibles
-observe.data.ll.logbook.Catch.beatDiameter=Diamètre de la morsure
+observe.data.ll.logbook.Catch.beatDiameter=Diamètre de la morsure (cm)
observe.data.ll.logbook.Catch.branchlineTab=Avançon
observe.data.ll.logbook.Catch.caracteristicTab=Caractéristiques
observe.data.ll.logbook.Catch.catchFate=Devenir
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Commentaire
observe.data.ll.logbook.Catch.count=Nombre
observe.data.ll.logbook.Catch.countDepredated=Nombre déprédatés
observe.data.ll.logbook.Catch.depredated=Victime de déprédation
-observe.data.ll.logbook.Catch.depredatedProportion=Proportion de deprédaté
+observe.data.ll.logbook.Catch.depredatedProportion=Proportion de deprédaté (%)
observe.data.ll.logbook.Catch.depredatedTab=Déprédation
observe.data.ll.logbook.Catch.discardHealthStatus=Santé au rejet
observe.data.ll.logbook.Catch.foodAndSexualTab=Alimentation et maturité sexuelle
@@ -1208,12 +1208,12 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Horodatage début
observe.data.ll.logbook.Set.haulingTab=Virage
observe.data.ll.logbook.Set.homeId=Id métier
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Distance entre avançons (m)
-observe.data.ll.logbook.Set.lightsticksColor=Couleur de cyalumes
+observe.data.ll.logbook.Set.lightsticksColor=Couleur de cyalumes majoritaire
observe.data.ll.logbook.Set.lightsticksTab=Cyalumes
-observe.data.ll.logbook.Set.lightsticksType=Type de cyalumes
+observe.data.ll.logbook.Set.lightsticksType=Type de cyalumes majoritaire
observe.data.ll.logbook.Set.lightsticksUsed=Utilisation des Cyalumes
observe.data.ll.logbook.Set.lineType=Type de ligne
-observe.data.ll.logbook.Set.maxDepthTargeted=Profondeur maximum ciblée
+observe.data.ll.logbook.Set.maxDepthTargeted=Profondeur maximum ciblée (m)
observe.data.ll.logbook.Set.message.creating=L'opération de pêche est en cours de création.
observe.data.ll.logbook.Set.message.updating=L'opération de pêche est en cours de modification.
observe.data.ll.logbook.Set.monitored=Instrumentée
@@ -1412,7 +1412,7 @@ observe.data.ll.observation.Catch.action.new.tip=Créer une nouvelle capture
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Réinitialiser les références photo
observe.data.ll.observation.Catch.availablePredator=Prédateurs disponibles
observe.data.ll.observation.Catch.basket=Panier
-observe.data.ll.observation.Catch.beatDiameter=Diamètre de la morsure
+observe.data.ll.observation.Catch.beatDiameter=Diamètre de la morsure (cm)
observe.data.ll.observation.Catch.branchline=Avançon
observe.data.ll.observation.Catch.branchlineTab=Avançon
observe.data.ll.observation.Catch.caracteristicTab=Caractéristiques
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b00a30b3affb296ea138c27b8…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/b00a30b3affb296ea138c27b8…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 6 commits: La modification de la sélection du composant comboBox ne fonctionne pas - Closes #1550
by Tony CHEMIT 27 Jun '20
by Tony CHEMIT 27 Jun '20
27 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
f88006ee by Tony Chemit at 2020-06-27T08:59:47+02:00
La modification de la sélection du composant comboBox ne fonctionne pas - Closes #1550
- - - - -
b96c348b by Tony Chemit at 2020-06-27T09:00:08+02:00
Update fluido skin
- - - - -
9f9fd999 by Tony Chemit at 2020-06-27T09:08:51+02:00
L'export de marées central vers local plante - Closes #1549
- - - - -
c74ca282 by Tony Chemit at 2020-06-27T09:24:42+02:00
Ajout d'une méthode de mesure de poids par défaut sur Estimations du banc - Closes #1510
- - - - -
b60b261b by Tony Chemit at 2020-06-27T09:25:36+02:00
Renommer un onglet sur form Marée LL - Closes #1521
- - - - -
dd8fe1fa by Tony Chemit at 2020-06-27T09:38:54+02:00
LL Observations / Capture / déprédation : libellé - Closes #1520
[LL][Logbook] opération de pêche / libellé - Closes #1526
- - - - -
19 changed files:
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectSchoolEstimateUIModel.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUIModel.java
- dto/pom.xml
- dto/src/main/java/fr/ird/observe/dto/ProtectedIds.java
- observe-i18n/src/main/i18n/translations/observe_en_GB.properties
- observe-i18n/src/main/i18n/translations/observe_es_ES.properties
- observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
- persistence/pom.xml
- persistence/src/main/resources/db/migration/8.0/11_add_weight_measure_method-common.sql
- pom.xml
- server-core/pom.xml
- services-client/pom.xml
- services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
- services-local/src/test/java/fr/ird/observe/services/local/service/referential/differential/DifferentialModelTest.java
- src/site/site_fr.xml
- test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
- test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
- test/src/main/resources/db/8.0/referentiel.sql.gz
- test/src/main/resources/fixtures/count-referential-common.properties
Changes:
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/ObjectSchoolEstimateUIModel.java
=====================================
@@ -22,13 +22,17 @@ package fr.ird.observe.client.datasource.editor.content.data.ps.observation;
* #L%
*/
+import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
+import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableMeta;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableModel;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableUI;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableUIModel;
+import fr.ird.observe.dto.ProtectedIds;
import fr.ird.observe.dto.data.ps.observation.FloatingObjectSchoolEstimateDto;
import fr.ird.observe.dto.data.ps.observation.ObjectSchoolEstimateDto;
import fr.ird.observe.dto.data.ps.observation.ObjectSchoolEstimateHelper;
+import fr.ird.observe.dto.referential.common.WeightMeasureMethodReference;
import java.util.Arrays;
import java.util.Collection;
@@ -41,7 +45,7 @@ import java.util.List;
* @since XXX
*/
public class ObjectSchoolEstimateUIModel extends ContentTableUIModel<FloatingObjectSchoolEstimateDto, ObjectSchoolEstimateDto> {
-
+ private final WeightMeasureMethodReference defaultWeightMeasureMethod;
public ObjectSchoolEstimateUIModel(ObjectSchoolEstimateUI ui) {
super(FloatingObjectSchoolEstimateDto.class,
@@ -51,8 +55,12 @@ public class ObjectSchoolEstimateUIModel extends ContentTableUIModel<FloatingObj
FloatingObjectSchoolEstimateDto.PROPERTY_COMMENT},
new String[]{
ObjectSchoolEstimateDto.PROPERTY_SPECIES,
- ObjectSchoolEstimateDto.PROPERTY_TOTAL_WEIGHT}
+ ObjectSchoolEstimateDto.PROPERTY_TOTAL_WEIGHT,
+ ObjectSchoolEstimateDto.PROPERTY_WEIGHT_MEASURE_METHOD
+ }
);
+ ObserveSwingDataSource dataSource = ObserveDataSourcesManagerApplicationComponent.value().getMainDataSource();
+ defaultWeightMeasureMethod = dataSource.getReferentialReferenceSet(WeightMeasureMethodReference.class).tryGetReferenceById(ProtectedIds.PS_OBSERVATION_SCHOOL_ESTIMATE_DEFAULT_WEIGHT_MEASURE_METHOD_ID).orElseThrow(IllegalStateException::new);
List<ContentTableMeta<ObjectSchoolEstimateDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(ObjectSchoolEstimateDto.class, ObjectSchoolEstimateDto.PROPERTY_SPECIES, false),
@@ -86,4 +94,15 @@ public class ObjectSchoolEstimateUIModel extends ContentTableUIModel<FloatingObj
}
};
}
+
+ @Override
+ public ObjectSchoolEstimateDto newTableEditBean() {
+ ObjectSchoolEstimateDto result = super.newTableEditBean();
+ result.setWeightMeasureMethod(getDefaultWeightMeasureMethod());
+ return result;
+ }
+
+ public WeightMeasureMethodReference getDefaultWeightMeasureMethod() {
+ return defaultWeightMeasureMethod;
+ }
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/SchoolEstimateUIModel.java
=====================================
@@ -22,13 +22,17 @@ package fr.ird.observe.client.datasource.editor.content.data.ps.observation;
* #L%
*/
+import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
+import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableMeta;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableModel;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableUI;
import fr.ird.observe.client.datasource.editor.content.data.table.ContentTableUIModel;
+import fr.ird.observe.dto.ProtectedIds;
import fr.ird.observe.dto.data.ps.observation.SchoolEstimateDto;
import fr.ird.observe.dto.data.ps.observation.SchoolEstimateHelper;
import fr.ird.observe.dto.data.ps.observation.SetSchoolEstimateDto;
+import fr.ird.observe.dto.referential.common.WeightMeasureMethodReference;
import java.util.Arrays;
import java.util.Collection;
@@ -41,6 +45,7 @@ import java.util.List;
* @since XXX
*/
public class SchoolEstimateUIModel extends ContentTableUIModel<SetSchoolEstimateDto, SchoolEstimateDto> {
+ private final WeightMeasureMethodReference defaultWeightMeasureMethod;
public SchoolEstimateUIModel(SchoolEstimateUI ui) {
@@ -52,8 +57,12 @@ public class SchoolEstimateUIModel extends ContentTableUIModel<SetSchoolEstimate
new String[]{
SchoolEstimateDto.PROPERTY_SPECIES,
SchoolEstimateDto.PROPERTY_TOTAL_WEIGHT,
- SchoolEstimateDto.PROPERTY_MEAN_WEIGHT}
+ SchoolEstimateDto.PROPERTY_MEAN_WEIGHT,
+ SchoolEstimateDto.PROPERTY_WEIGHT_MEASURE_METHOD
+ }
);
+ ObserveSwingDataSource dataSource = ObserveDataSourcesManagerApplicationComponent.value().getMainDataSource();
+ defaultWeightMeasureMethod = dataSource.getReferentialReferenceSet(WeightMeasureMethodReference.class).tryGetReferenceById(ProtectedIds.PS_OBSERVATION_SCHOOL_ESTIMATE_DEFAULT_WEIGHT_MEASURE_METHOD_ID).orElseThrow(IllegalStateException::new);
List<ContentTableMeta<SchoolEstimateDto>> metas = Arrays.asList(
ContentTableModel.newTableMeta(SchoolEstimateDto.class, SchoolEstimateDto.PROPERTY_SPECIES, false),
@@ -88,4 +97,15 @@ public class SchoolEstimateUIModel extends ContentTableUIModel<SetSchoolEstimate
}
};
}
+
+ @Override
+ public SchoolEstimateDto newTableEditBean() {
+ SchoolEstimateDto result = super.newTableEditBean();
+ result.setWeightMeasureMethod(getDefaultWeightMeasureMethod());
+ return result;
+ }
+
+ public WeightMeasureMethodReference getDefaultWeightMeasureMethod() {
+ return defaultWeightMeasureMethod;
+ }
}
=====================================
dto/pom.xml
=====================================
@@ -204,6 +204,12 @@
<artifactId>java-util</artifactId>
<version>${lib.version.java4all.java-util}</version>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.jaxx</groupId>
+ <artifactId>jaxx-runtime-spi</artifactId>
+ <version>${lib.version.java4all.jaxx}</version>
+ </dependency>
+
</dependencies>
</plugin>
<plugin>
=====================================
dto/src/main/java/fr/ird/observe/dto/ProtectedIds.java
=====================================
@@ -145,6 +145,8 @@ public class ProtectedIds {
public static final Set<String> PS_OBSERVATION_FOB_OBSERVED_SYSTEM_EXCLUDE_OPERATIONS = ImmutableSet.of("fr.ird.referential.ps.common.ObjectOperation#0#10", "fr.ird.referential.ps.common.ObjectOperation#0#1");
//FIXME-PROTECTED-ID
public static final String PS_COMMON_TRANSMITTING_BUOY_OPERATION_POSE = "fr.ird.referential.ps.common.TransmittingBuoyOperation#1239832686238#0.4755624782839416";
+ //FIXME-PROTECTED-ID
+ public static final String PS_OBSERVATION_SCHOOL_ESTIMATE_DEFAULT_WEIGHT_MEASURE_METHOD_ID = "fr.ird.referential.common.WeightMeasureMethod#666#04";
private ProtectedIds() {
// avoid instance
=====================================
observe-i18n/src/main/i18n/translations/observe_en_GB.properties
=====================================
@@ -837,7 +837,7 @@ observe.data.ll.common.Trip.departureHarbour=Departure harbour
observe.data.ll.common.Trip.endDate=End date
observe.data.ll.common.Trip.ersId=Id ERS
observe.data.ll.common.Trip.generalComment=Comment
-observe.data.ll.common.Trip.generalTab=Characteristics
+observe.data.ll.common.Trip.generalTab=Common characteristics
observe.data.ll.common.Trip.homeId=Home id
observe.data.ll.common.Trip.landingHarbour=Landing harbour
observe.data.ll.common.Trip.logbookAvailability=Logbook
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=New catch
observe.data.ll.logbook.Catch.action.new.tip=Create a new catch
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Reset photo references
observe.data.ll.logbook.Catch.availablePredator=Avaiable predators
-observe.data.ll.logbook.Catch.beatDiameter=Beat diameter
+observe.data.ll.logbook.Catch.beatDiameter=Beat diameter (cm)
observe.data.ll.logbook.Catch.branchlineTab=Branchline
observe.data.ll.logbook.Catch.caracteristicTab=Caracteristics
observe.data.ll.logbook.Catch.catchFate=Fate
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Comment
observe.data.ll.logbook.Catch.count=Count
observe.data.ll.logbook.Catch.countDepredated=Count depredated
observe.data.ll.logbook.Catch.depredated=Depredated
-observe.data.ll.logbook.Catch.depredatedProportion=Depredated proportion
+observe.data.ll.logbook.Catch.depredatedProportion=Depredated proportion (%)
observe.data.ll.logbook.Catch.depredatedTab=Depredation
observe.data.ll.logbook.Catch.discardHealthStatus=Discard health status
observe.data.ll.logbook.Catch.foodAndSexualTab=Food and sexual maturity
@@ -1208,9 +1208,9 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Start timestamp
observe.data.ll.logbook.Set.haulingTab=Hauling
observe.data.ll.logbook.Set.homeId=Home id
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Length between branchlines (m)
-observe.data.ll.logbook.Set.lightsticksColor=Lightsticks color
+observe.data.ll.logbook.Set.lightsticksColor=Majority lightsticks color
observe.data.ll.logbook.Set.lightsticksTab=Lightsticks
-observe.data.ll.logbook.Set.lightsticksType=Lightsticks type
+observe.data.ll.logbook.Set.lightsticksType=Majority lightsticks type
observe.data.ll.logbook.Set.lightsticksUsed=Lightsticks used
observe.data.ll.logbook.Set.lineType=Line type
observe.data.ll.logbook.Set.maxDepthTargeted=Max depth targeted (m)
@@ -1410,9 +1410,9 @@ observe.data.ll.observation.Catch.action.deleteSelectedWeightMeasure.tip=Delete
observe.data.ll.observation.Catch.action.new=New catch
observe.data.ll.observation.Catch.action.new.tip=Create a new catch
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Reset photo references
-observe.data.ll.observation.Catch.availablePredator=Avaiable predators
+observe.data.ll.observation.Catch.availablePredator=Available predators
observe.data.ll.observation.Catch.basket=Basket
-observe.data.ll.observation.Catch.beatDiameter=Beat diameter
+observe.data.ll.observation.Catch.beatDiameter=Beat diameter (cm)
observe.data.ll.observation.Catch.branchline=Branchline
observe.data.ll.observation.Catch.branchlineTab=Branchline
observe.data.ll.observation.Catch.caracteristicTab=Caracteristics
=====================================
observe-i18n/src/main/i18n/translations/observe_es_ES.properties
=====================================
@@ -837,7 +837,7 @@ observe.data.ll.common.Trip.departureHarbour=Puerto de embarque
observe.data.ll.common.Trip.endDate=Fecha de fin
observe.data.ll.common.Trip.ersId=Id ERS
observe.data.ll.common.Trip.generalComment=Comentarios
-observe.data.ll.common.Trip.generalTab=Características
+observe.data.ll.common.Trip.generalTab=General características
observe.data.ll.common.Trip.homeId=Id de negocio
observe.data.ll.common.Trip.landingHarbour=Puerto de desembarque
observe.data.ll.common.Trip.logbookAvailability=Logbook \#TODO
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=Nueva captura
observe.data.ll.logbook.Catch.action.new.tip=Crear una nueva captura
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Reiniciar las referencias photo
observe.data.ll.logbook.Catch.availablePredator=Deprepadaores disponibles
-observe.data.ll.logbook.Catch.beatDiameter=Diametro de la mordedura
+observe.data.ll.logbook.Catch.beatDiameter=Diametro de la mordedura (cm)
observe.data.ll.logbook.Catch.branchlineTab=Arponcillo
observe.data.ll.logbook.Catch.caracteristicTab=Características
observe.data.ll.logbook.Catch.catchFate=Devenir
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Comentario
observe.data.ll.logbook.Catch.count=Numéro
observe.data.ll.logbook.Catch.countDepredated=Count depredated \#TODO
observe.data.ll.logbook.Catch.depredated=Victima de depredación
-observe.data.ll.logbook.Catch.depredatedProportion=Depredación propertion \#TODO
+observe.data.ll.logbook.Catch.depredatedProportion=Depredación propertion (%) \#TODO
observe.data.ll.logbook.Catch.depredatedTab=Depredación
observe.data.ll.logbook.Catch.discardHealthStatus=Salud al rechazo
observe.data.ll.logbook.Catch.foodAndSexualTab=Alimentación y maturidad sexual
@@ -1208,12 +1208,12 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Timestamp del inicio
observe.data.ll.logbook.Set.haulingTab=Arrastre
observe.data.ll.logbook.Set.homeId=Id de negocio
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Length between branchlines (m) \#TODO
-observe.data.ll.logbook.Set.lightsticksColor=Color de barrita de luz
+observe.data.ll.logbook.Set.lightsticksColor=Mayoritario color de barrita de luz #TODO
observe.data.ll.logbook.Set.lightsticksTab=Lightsticks \#TODO
-observe.data.ll.logbook.Set.lightsticksType=Tipo de barrita de luz
+observe.data.ll.logbook.Set.lightsticksType=Mayoritario tipo de barrita de luz #TODO
observe.data.ll.logbook.Set.lightsticksUsed=Lightsticks used \#TODO
observe.data.ll.logbook.Set.lineType=Tipo de línea
-observe.data.ll.logbook.Set.maxDepthTargeted=Profundidad máxima deseada
+observe.data.ll.logbook.Set.maxDepthTargeted=Profundidad máxima deseada (m)
observe.data.ll.logbook.Set.message.creating=Lance en proceso de creación.
observe.data.ll.logbook.Set.message.updating=La operación de pesca está en proceso de modificación.
observe.data.ll.logbook.Set.monitored=Instrumentada
@@ -1412,7 +1412,7 @@ observe.data.ll.observation.Catch.action.new.tip=Crear una nueva captura
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Reiniciar las referencias photo
observe.data.ll.observation.Catch.availablePredator=Deprepadaores disponibles
observe.data.ll.observation.Catch.basket=cesta
-observe.data.ll.observation.Catch.beatDiameter=Diametro de la mordedura
+observe.data.ll.observation.Catch.beatDiameter=Diametro de la mordedura (cm)
observe.data.ll.observation.Catch.branchline=Arponcillo
observe.data.ll.observation.Catch.branchlineTab=Arponcillo
observe.data.ll.observation.Catch.caracteristicTab=Características
=====================================
observe-i18n/src/main/i18n/translations/observe_fr_FR.properties
=====================================
@@ -837,7 +837,7 @@ observe.data.ll.common.Trip.departureHarbour=Port de départ
observe.data.ll.common.Trip.endDate=Date fin
observe.data.ll.common.Trip.ersId=Id ERS
observe.data.ll.common.Trip.generalComment=Commentaire
-observe.data.ll.common.Trip.generalTab=Caractéristiques
+observe.data.ll.common.Trip.generalTab=Caractéristiques communes
observe.data.ll.common.Trip.homeId=Id métier
observe.data.ll.common.Trip.landingHarbour=Port d'arrivée
observe.data.ll.common.Trip.logbookAvailability=Logbook
@@ -1055,7 +1055,7 @@ observe.data.ll.logbook.Catch.action.new=Nouvelle capture
observe.data.ll.logbook.Catch.action.new.tip=Créer une nouvelle capture
observe.data.ll.logbook.Catch.action.reset.photoReferences.tip=Réinitialiser les références photo
observe.data.ll.logbook.Catch.availablePredator=Prédateurs disponibles
-observe.data.ll.logbook.Catch.beatDiameter=Diamètre de la morsure
+observe.data.ll.logbook.Catch.beatDiameter=Diamètre de la morsure (cm)
observe.data.ll.logbook.Catch.branchlineTab=Avançon
observe.data.ll.logbook.Catch.caracteristicTab=Caractéristiques
observe.data.ll.logbook.Catch.catchFate=Devenir
@@ -1064,7 +1064,7 @@ observe.data.ll.logbook.Catch.comment=Commentaire
observe.data.ll.logbook.Catch.count=Nombre
observe.data.ll.logbook.Catch.countDepredated=Nombre déprédatés
observe.data.ll.logbook.Catch.depredated=Victime de déprédation
-observe.data.ll.logbook.Catch.depredatedProportion=Proportion de deprédaté
+observe.data.ll.logbook.Catch.depredatedProportion=Proportion de deprédaté (%)
observe.data.ll.logbook.Catch.depredatedTab=Déprédation
observe.data.ll.logbook.Catch.discardHealthStatus=Santé au rejet
observe.data.ll.logbook.Catch.foodAndSexualTab=Alimentation et maturité sexuelle
@@ -1208,12 +1208,12 @@ observe.data.ll.logbook.Set.haulingStartTimeStamp=Horodatage début
observe.data.ll.logbook.Set.haulingTab=Virage
observe.data.ll.logbook.Set.homeId=Id métier
observe.data.ll.logbook.Set.lengthBetweenBranchlines=Distance entre avançons (m)
-observe.data.ll.logbook.Set.lightsticksColor=Couleur de cyalumes
+observe.data.ll.logbook.Set.lightsticksColor=Couleur de cyalumes majoritaire
observe.data.ll.logbook.Set.lightsticksTab=Cyalumes
-observe.data.ll.logbook.Set.lightsticksType=Type de cyalumes
+observe.data.ll.logbook.Set.lightsticksType=Type de cyalumes majoritaire
observe.data.ll.logbook.Set.lightsticksUsed=Utilisation des Cyalumes
observe.data.ll.logbook.Set.lineType=Type de ligne
-observe.data.ll.logbook.Set.maxDepthTargeted=Profondeur maximum ciblée
+observe.data.ll.logbook.Set.maxDepthTargeted=Profondeur maximum ciblée (m)
observe.data.ll.logbook.Set.message.creating=L'opération de pêche est en cours de création.
observe.data.ll.logbook.Set.message.updating=L'opération de pêche est en cours de modification.
observe.data.ll.logbook.Set.monitored=Instrumentée
@@ -1412,7 +1412,7 @@ observe.data.ll.observation.Catch.action.new.tip=Créer une nouvelle capture
observe.data.ll.observation.Catch.action.reset.photoReferences.tip=Réinitialiser les références photo
observe.data.ll.observation.Catch.availablePredator=Prédateurs disponibles
observe.data.ll.observation.Catch.basket=Panier
-observe.data.ll.observation.Catch.beatDiameter=Diamètre de la morsure
+observe.data.ll.observation.Catch.beatDiameter=Diamètre de la morsure (cm)
observe.data.ll.observation.Catch.branchline=Avançon
observe.data.ll.observation.Catch.branchlineTab=Avançon
observe.data.ll.observation.Catch.caracteristicTab=Caractéristiques
=====================================
persistence/pom.xml
=====================================
@@ -303,6 +303,11 @@
<artifactId>application-context</artifactId>
<version>${lib.version.java4all.application-context}</version>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.jaxx</groupId>
+ <artifactId>jaxx-runtime-spi</artifactId>
+ <version>${lib.version.java4all.jaxx}</version>
+ </dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
=====================================
persistence/src/main/resources/db/migration/8.0/11_add_weight_measure_method-common.sql
=====================================
@@ -26,6 +26,7 @@ INSERT INTO observe_common.LASTUPDATEDATE(topiaId, topiaversion, topiacreatedate
INSERT INTO observe_common.WeightMeasureMethod(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.WeightMeasureMethod#666#01' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'Peson', 'Peson', 'Peson #TODO');
INSERT INTO observe_common.WeightMeasureMethod(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.WeightMeasureMethod#666#02' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'Scale', 'Balance', 'Balance #TODO');
INSERT INTO observe_common.WeightMeasureMethod(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.WeightMeasureMethod#666#03' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'Visual estimation', 'Estimation visuelle', 'Estimation visuelle #TODO');
+INSERT INTO observe_common.WeightMeasureMethod(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, label1, label2, label3) values ('fr.ird.observe.entities.referentiel.WeightMeasureMethod#666#04' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, 'Estimate with sounder', 'Estimation au sondeur', 'Estimación con la ecosonda');
ALTER TABLE observe_seine.nontargetcatch ADD COLUMN weightMeasureMethod VARCHAR(255);
ALTER TABLE observe_seine.nontargetlength ADD COLUMN weightMeasureMethod VARCHAR(255);
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.33</version>
+ <version>2020.34</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -162,7 +162,7 @@
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
<buildDate>${maven.build.timestamp}</buildDate>
- <lib.version.toolkit>4.32</lib.version.toolkit>
+ <lib.version.toolkit>4.33</lib.version.toolkit>
<lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
<!--can't use 1.4.197 (date has changed + blob also)-->
<lib.version.h2>1.4.196</lib.version.h2>
@@ -170,7 +170,7 @@
<!-- <lib.version.java4all.topia>1.17</lib.version.java4all.topia>-->
<!--<lib.version.java4all.eugene>3.0<-alpha-22</lib.version.java4all.eugene>-->
-<!-- <lib.version.java4all.jaxx>3.0-alpha-70-SNAPSHOT</lib.version.java4all.jaxx>-->
+<!-- <lib.version.java4all.jaxx>3.0-alpha-71-SNAPSHOT</lib.version.java4all.jaxx>-->
<!--<lib.version.java4all.application-context>1.0.3-SNAPSHOT</lib.version.java4all.application-context>-->
<!--<lib.version.java4all.application-template>1.0.2-SNAPSHOT</lib.version.java4all.application-template>-->
<!--<lib.version.java4all.i18n>4.0-beta-3-SNAPSHOT</lib.version.java4all.i18n>-->
=====================================
server-core/pom.xml
=====================================
@@ -253,6 +253,12 @@
<artifactId>guava</artifactId>
<version>${lib.version.google.guava}</version>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.jaxx</groupId>
+ <artifactId>jaxx-runtime-spi</artifactId>
+ <version>${lib.version.java4all.jaxx}</version>
+ </dependency>
+
</dependencies>
</plugin>
</plugins>
=====================================
services-client/pom.xml
=====================================
@@ -170,6 +170,11 @@
<artifactId>services</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>io.ultreia.java4all.jaxx</groupId>
+ <artifactId>jaxx-runtime-spi</artifactId>
+ <version>${lib.version.java4all.jaxx}</version>
+ </dependency>
</dependencies>
</plugin>
</plugins>
=====================================
services-local/src/main/java/fr/ird/observe/services/local/service/DataSourceServiceLocal.java
=====================================
@@ -54,6 +54,7 @@ import fr.ird.observe.services.service.sql.SqlScriptProducerService;
import fr.ird.observe.spi.DbModelHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.nuiton.topia.persistence.TopiaMigrationServiceException;
import org.nuiton.topia.persistence.jdbc.JdbcHelper;
import org.nuiton.topia.persistence.jdbc.JdbcPostgresHelper;
import org.nuiton.topia.persistence.metadata.TopiaMetadataEntity;
@@ -611,10 +612,12 @@ public class DataSourceServiceLocal extends ObserveServiceLocal implements DataS
public void migrateData(ObserveDataSourceConfiguration dataSourceConfiguration) {
Path temporaryDirectory = getTemporaryDirectory(dataSourceConfiguration);
log.debug("Will use temporary directory: " + temporaryDirectory);
-
- try (ObserveTopiaApplicationContext topiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration)) {
- //FIXME: Si ca plante il faut bien nettoyer les topia context, la base semble ne pas bien etre fermee
+ ObserveTopiaApplicationContext topiaApplicationContext = ObserveTopiaApplicationContextFactory.getOrCreateTopiaApplicationContext((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration);
+ try {
topiaApplicationContext.getMigrationService().runSchemaMigration();
+ } catch (Exception e) {
+ close((ObserveDataSourceConfigurationTopiaSupport) dataSourceConfiguration, topiaApplicationContext);
+ throw e;
}
}
=====================================
services-local/src/test/java/fr/ird/observe/services/local/service/referential/differential/DifferentialModelTest.java
=====================================
@@ -87,7 +87,7 @@ public class DifferentialModelTest extends ServiceLocalTestSupport {
DifferentialList rightSideDifferentialList = result.getRightSideDifferentialList();
Assert.assertNotNull(rightSideDifferentialList);
Assert.assertNotNull(rightSideDifferentialList.getStates());
- Assert.assertEquals(3016, rightSideDifferentialList.getStates().size());
+ Assert.assertEquals(3017, rightSideDifferentialList.getStates().size());
Assert.assertTrue(rightSideDifferentialList.getStates().stream().allMatch(s -> DifferentialType.ADDED.equals(s.getDifferentialType())));
}
=====================================
src/site/site_fr.xml
=====================================
@@ -29,7 +29,7 @@
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
- <version>1.8</version>
+ <version>1.9</version>
</skin>
<custom>
=====================================
test/src/main/resources/db/8.0/dataForTestLongline.sql.gz
=====================================
Binary files a/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz and b/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz differ
=====================================
test/src/main/resources/db/8.0/dataForTestSeine.sql.gz
=====================================
Binary files a/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz and b/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz differ
=====================================
test/src/main/resources/db/8.0/referentiel.sql.gz
=====================================
Binary files a/test/src/main/resources/db/8.0/referentiel.sql.gz and b/test/src/main/resources/db/8.0/referentiel.sql.gz differ
=====================================
test/src/main/resources/fixtures/count-referential-common.properties
=====================================
@@ -48,6 +48,6 @@ common.specieslist=8
common.vessel=1172
common.vesselsizecategory=13
common.vesseltype=16
-common.weightmeasuremethod=3
+common.weightmeasuremethod=4
common.weightmeasuretype=3
common.wind=13
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/db511b177a0ed6d5fc297634…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/db511b177a0ed6d5fc297634…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Classement Calée / FOBs dans l'arbre - Closes #1506
by Tony CHEMIT 26 Jun '20
by Tony CHEMIT 26 Jun '20
26 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
db511b17 by Tony Chemit at 2020-06-26T12:57:58+02:00
Classement Calée / FOBs dans l'arbre - Closes #1506
- - - - -
9 changed files:
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/actions/SaveActionSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/list/actions/MoveMultipleDataRequestSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/DefaultMoveSingleDataRequest.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/SaveActionSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/TripUIMoveSingleActionSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ref/actions/Save.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/NavigationTree.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/NavigationTreeNodeSupport.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/data/ps/obs/ActivitySeineNavigationTreeNode.java
Changes:
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/actions/SaveActionSupport.java
=====================================
@@ -24,7 +24,6 @@ package fr.ird.observe.client.datasource.editor.content.data.edit.actions;
import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
import fr.ird.observe.client.datasource.editor.content.ContentMode;
-import fr.ird.observe.client.datasource.editor.content.ContentUI;
import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUI;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUIModel;
@@ -42,6 +41,8 @@ import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
import fr.ird.observe.navigation.tree.ReferenceNode;
import fr.ird.observe.navigation.tree.SingleReferenceContainerNode;
import fr.ird.observe.spi.DtoModelHelper;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
import javax.swing.KeyStroke;
@@ -58,6 +59,8 @@ import static io.ultreia.java4all.i18n.I18n.t;
*/
public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoReference<D, R>, U extends ContentEditUI<D, R, U>> extends ContentUIActionSupport<U> {
+ private static final Logger log = LogManager.getLogger(SaveActionSupport.class);
+
protected SaveActionSupport(Class<D> dtoType) {
this(dtoType, ObserveKeyStrokesSupport.KEY_STROKE_SAVE_DATA);
}
@@ -101,42 +104,82 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe
R beanReference = DtoModelHelper.toReference(referentialLocale, bean);
+ int oldPosition;
+ if (notPersisted) {
+ oldPosition = parent.getChildCount();
+ } else {
+ oldPosition = parent.getIndex(node);
+ }
+
if (notPersisted) {
- // on passe en mode mise à jour
+ // now model is updating
model.setMode(ContentMode.UPDATE);
+ // stop editing
ui.stopEdit();
+ // remove unsaved node (will close opened content)
tree.removeNode(node);
+ // create node
node = nodeFactory.apply(beanReference);
- tree.insertNode(parent, node, 0);
- tree.reloadNode(parent, false);
+ // compute correct position
+ int position = parent.getNewPosition(beanReference);
+
+ // insert new node
+ log.info(String.format("Insert node: %s at position: %d", node, position));
+ tree.insertNode(parent, node, position);
- // on sélectionne le nouveau noeud
+ // select back node
tree.selectSafeNode(node);
+
+ // apply extra actions from previous opened content (go back to correct tab if any, ...)
@SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
newUi.resetFromPreviousUi(ui);
+ // reload from parent to root
+ tree.refreshToRoot(parent);
+
} else {
- // on repaint le noeud et ses enfants
+ // compute correct position
+ int position = parent.getNewPosition(beanReference);
+ log.info(String.format("Existing node: %s at position: %d (previous position: %d)", node, position, oldPosition));
+ if (oldPosition != position) {
+
+ // move node to correct position
+ tree.moveNode(parent, node, position);
+
+ // select it back
+ tree.selectSafeNode(node);
+
+ // apply extra actions from previous opened content (go back to correct tab if any, ...)
+ @SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
+ newUi.resetFromPreviousUi(ui);
+
+ } else {
+
+ // do not move in tree, just restart edition
+ ui.resetEdit();
+ }
+
+ // repaint selected node and his children
tree.reloadSelectedNode(false, true);
- ui.resetEdit();
+ // reload from parent to root
+ tree.refreshToRoot(parent);
+
}
-// afterSave(ui, bean, node, notPersisted);
}
+ @SuppressWarnings({"rawtypes", "unchecked"})
protected Function<R, ReferenceNode<D, R>> getNodeFactory(NavigationTreeNodeSupport<?> parent) {
Function<R, ReferenceNode<D, R>> nodeFactory;
if (parent instanceof SingleReferenceContainerNode) {
- //noinspection unchecked,rawtypes
nodeFactory = ((SingleReferenceContainerNode) parent)::newSingleChildNode;
} else {
- //noinspection unchecked,rawtypes
nodeFactory = ((MultipleReferenceContainerNode) parent)::newChildNode;
}
return nodeFactory;
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/list/actions/MoveMultipleDataRequestSupport.java
=====================================
@@ -176,7 +176,7 @@ public abstract class MoveMultipleDataRequestSupport<ChildDto extends IdDto, Chi
MultipleReferenceContainerNode<ChildDto, Child> newChildContainerNode = MultipleReferenceContainerNode.down(getReferenceType(), newParentNode);
for (ReferenceNode<ChildDto, Child> node : nodeToMove) {
- tree.insertNode(newChildContainerNode, node);
+ tree.insertNode((NavigationTreeNodeSupport<?>) newChildContainerNode, node);
}
tree.selectSafeNode(newChildContainerNode);
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/DefaultMoveSingleDataRequest.java
=====================================
@@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.content.data.open.actions;
*/
import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
+import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationTreeNodeSupport;
import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.reference.DtoReference;
import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
@@ -70,7 +71,7 @@ public class DefaultMoveSingleDataRequest<ChildDto extends IdDto, Child extends
MultipleReferenceContainerNode<ChildDto, Child> newChildContainerNode = MultipleReferenceContainerNode.down(getReferenceType(), newParentNode);
// insert node into new child container node
- tree.insertNode(newChildContainerNode, node);
+ tree.insertNode((NavigationTreeNodeSupport<?>) newChildContainerNode, node);
// reload new child container node
tree.reloadNode(newChildContainerNode, false);
@@ -83,6 +84,8 @@ public class DefaultMoveSingleDataRequest<ChildDto extends IdDto, Child extends
// select final node
tree.selectSafeNode(node);
+
+ tree.refreshToRoot((NavigationTreeNodeSupport<?>) node.getParent());
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/SaveActionSupport.java
=====================================
@@ -38,10 +38,11 @@ import fr.ird.observe.navigation.model.edit.ObserveEditNode;
import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
import fr.ird.observe.navigation.tree.ReferenceNode;
import fr.ird.observe.spi.DtoModelHelper;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
import java.awt.event.ActionEvent;
-import java.util.Objects;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
@@ -53,6 +54,8 @@ import static io.ultreia.java4all.i18n.I18n.t;
*/
public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoReference<D, R>, U extends ContentOpenableUI<D, R, U>> extends ContentUIActionSupport<U> {
+ private static final Logger log = LogManager.getLogger(SaveActionSupport.class);
+
protected SaveActionSupport(Class<D> dtoType) {
super(n("observe.action.save"), null, "save", ObserveKeyStrokesSupport.KEY_STROKE_SAVE_DATA);
setTooltipText(t("observe.action.save.data.tip", ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType)));
@@ -93,9 +96,7 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe
MultipleReferenceContainerNode<D, R> referenceContainerNode = model.getReferenceContainerNode(tree);
- ReferenceNode<?, ?> parentReferenceNode = model.getParentReferenceNode(tree);
-
- boolean containerNodeAreNotTheSame = !Objects.equals(referenceContainerNode, parentReferenceNode);
+ NavigationTreeNodeSupport<?> parent = (NavigationTreeNodeSupport<?>) node.getParent();
ReferentialLocale referentialLocale = getDecoratorService().getReferentialLocale();
@@ -110,48 +111,70 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe
if (notPersisted) {
- // on passe en mode mise à jour
+ // now model is updating
model.setMode(ContentMode.UPDATE);
+ // stop editing
ui.stopEdit();
+ // remove unsaved node (will close opened content)
tree.removeNode(node);
+
+ // reload container node (to get correct data inside)
tree.reloadNode(referenceContainerNode, false);
+ // create node
node = referenceContainerNode.newChildNode(beanReference);
- tree.insertNode(referenceContainerNode, node);
+ // compute correct position
+ int position = ((NavigationTreeNodeSupport<?>) referenceContainerNode).getNewPosition(beanReference);
- if (containerNodeAreNotTheSame) {
-// ((NavigationTreeNodeSupport) referenceContainerNode).reload();
- tree.reloadNode(parentReferenceNode, false);
- }
+ // insert new node
+ log.info(String.format("Insert node: %s at position: %d", node, position));
+ tree.insertNode(referenceContainerNode, node, position);
- // on sélectionne le nouveau noeud
+ // select back node
tree.selectSafeNode(node);
+
+ // apply extra actions from previous opened content (go back to correct tab if any, ...)
+ @SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
+ newUi.resetFromPreviousUi(ui);
+
+ // reload from parent to root
+ tree.refreshToRoot(parent);
+
} else {
- int position = referenceContainerNode.getChildrenPosition(beanReference);
+ // compute correct position
+ int position = ((NavigationTreeNodeSupport<?>) referenceContainerNode).getNewPosition(beanReference);
+ log.info(String.format("Existing node: %s at position: %d (previous position: %d)", node, position, oldPosition));
if (oldPosition != position) {
- // on doit repositionner le noeud
+ // move node to correct position
tree.moveNode(referenceContainerNode, node, position);
- // et le selectionner
+ // select it back
tree.selectSafeNode(node);
+
+ // apply extra actions from previous opened content (go back to correct tab if any, ...)
+ @SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
+ newUi.resetFromPreviousUi(ui);
+
} else {
+
+ // do not move in tree, just restart edition
ui.resetEdit();
}
-// tree.reloadNode(referenceContainerNode, false);
-
+ // reload node data
((NavigationTreeNodeSupport<?>) node).reload();
- if (containerNodeAreNotTheSame) {
-// ((NavigationTreeNodeSupport) parentReferenceNode).reload();
- tree.reloadNode(parentReferenceNode, false);
- }
- // on repaint le noeud et ses enfants
+
+ // repaint selected node and his children
tree.reloadSelectedNode(false, true);
+
+ // reload from parent to root
+ tree.refreshToRoot(parent);
+
}
afterSave(ui, bean, node, notPersisted);
}
@@ -160,18 +183,5 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe
// Extra code
}
-// protected void repaintTripNode(U ui) {
-//
-// NavigationTree tree = getNavigationTree();
-//
-// NavigationTreeNodeSupport tripNode = tree.getSelectedNode();
-// while (!(tripNode instanceof ProgramSeineNavigationTreeNode || tripNode instanceof ProgramLonglineNavigationTreeNode)) {
-// tripNode = tripNode.getParent();
-// }
-// log.info("Refresh trip node : " + tripNode);
-// tree.reloadNode(tripNode, false);
-//
-// }
-
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/TripUIMoveSingleActionSupport.java
=====================================
@@ -24,6 +24,7 @@ package fr.ird.observe.client.datasource.editor.content.data.open.actions;
import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
import fr.ird.observe.client.datasource.editor.content.ContentUI;
import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
+import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationTreeNodeSupport;
import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.RootNavigationTreeNode;
import fr.ird.observe.dto.data.DataDto;
import fr.ird.observe.dto.reference.DataDtoReference;
@@ -62,7 +63,7 @@ public abstract class TripUIMoveSingleActionSupport<ChildDto extends DataDto, Ch
if (!parentContainerReferenceNode.getChildrenReferences().contains(newParentReference)) {
// Need to create this node
ReferenceNode<ProgramDto, ProgramReference> programNode = parentContainerReferenceNode.newChildNode(newParentReference);
- tree.insertNode(parentContainerReferenceNode, programNode);
+ tree.insertNode((NavigationTreeNodeSupport<?>)parentContainerReferenceNode, programNode);
}
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ref/actions/Save.java
=====================================
@@ -89,6 +89,7 @@ public class Save<D extends ReferentialDto, R extends ReferentialDtoReference<D,
}
}
+ @SuppressWarnings({"rawtypes", "unchecked"})
protected boolean doSave(U ui, D bean, boolean notPersisted) {
ContentReferenceUIModel<D, R> model = ui.getModel();
@@ -131,15 +132,13 @@ public class Save<D extends ReferentialDto, R extends ReferentialDtoReference<D,
.collect(Collectors.toList());
if (ProgramDto.class.equals(beanType)) {
- //noinspection unchecked
referenceList = (List) ProgramReference.filterGearType((List) referenceList, ((ProgramDto) bean).getGearType());
}
Pair<Boolean, R> result = UsageForDesactivateUIHandler.showUsages(bean, usages, referenceList);
- boolean willsave = result.getLeft();
-
+ boolean willSave = result.getLeft();
replaceReference = result.getRight();
- if (!willsave) {
+ if (!willSave) {
log.debug("User refuses to continue, skip saving...");
return false;
}
@@ -170,7 +169,8 @@ public class Save<D extends ReferentialDto, R extends ReferentialDtoReference<D,
// add the program in tree
if (tree.getModel().getConfig().isShowEmptyProgram()) {
RootNavigationTreeNode rootNode = tree.getRootNode();
- tree.insertNode(rootNode, getDecoratorService().getReferentialLocale(), (ProgramDto) bean);
+ ReferenceNode<ProgramDto, ProgramReference> newNode = rootNode.newChildNode(((ProgramDto) bean).toReference(getDecoratorService().getReferentialLocale()));
+ tree.insertNode(rootNode, newNode);
}
} else {
// update the program in tree
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/NavigationTree.java
=====================================
@@ -29,7 +29,6 @@ import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationT
import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.RootNavigationTreeNode;
import fr.ird.observe.dto.IdDto;
import fr.ird.observe.dto.reference.DtoReference;
-import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.navigation.model.DtoModelNavigationModel;
import fr.ird.observe.navigation.model.ObserveNavigationNode;
import fr.ird.observe.navigation.model.edit.ObserveEditModel;
@@ -185,16 +184,10 @@ public class NavigationTree extends JXTree {
getModel().insertNodeInto(node, parentNode, position);
}
- public <ChildDto extends IdDto, Child extends DtoReference<ChildDto, Child>> void insertNode(MultipleReferenceContainerNode<ChildDto, Child> parentNode, ReferentialLocale referentialLocale, ChildDto dto) {
- Child reference = DtoModelHelper.toReference(referentialLocale, dto);
- ReferenceNode<ChildDto, Child> referenceNode = parentNode.newChildNode(reference);
- insertNode(parentNode, referenceNode);
- }
-
- public <ChildDto extends IdDto, Child extends DtoReference<ChildDto, Child>> void insertNode(MultipleReferenceContainerNode<ChildDto, Child> parentNode, ReferenceNode<ChildDto, Child> node) {
- Child reference = node.getReference();
- int position = reference.isPersisted() ? parentNode.getNodePosition(reference) : parentNode.getChildCount();
- insertNode(parentNode, node, position);
+ public <ChildDto extends IdDto, Child extends DtoReference<ChildDto, Child>> void insertNode(NavigationTreeNodeSupport<?> parentNode, ReferenceNode<ChildDto, Child> referenceNode) {
+ Child reference = referenceNode.getReference();
+ int position = parentNode.getNewPosition(reference);
+ insertNode(parentNode, referenceNode, position);
}
/**
@@ -246,7 +239,8 @@ public class NavigationTree extends JXTree {
public <D extends IdDto, R extends DtoReference<D, R>> void addUnsavedNode(MultipleReferenceContainerNode<D, R> parentNode) {
ReferenceNode<D, R> result = parentNode.newChildNode(((NavigationTreeNodeSupport<?>) parentNode).getId());
- insertNode(parentNode, result);
+ int childCount = parentNode.getChildCount();
+ insertNode(parentNode, result, childCount);
afterAddUnsavedNode(parentNode, result);
}
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/NavigationTreeNodeSupport.java
=====================================
@@ -22,9 +22,11 @@ package fr.ird.observe.client.datasource.editor.tree.navigation.nodes;
* #L%
*/
+import fr.ird.observe.dto.reference.DtoReference;
import fr.ird.observe.navigation.model.ObserveNavigationNode;
import fr.ird.observe.navigation.model.edit.ObserveEditModelApplicationComponent;
import fr.ird.observe.navigation.model.select.ObserveSelectModelApplicationComponent;
+import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
import javax.swing.JComponent;
import java.awt.Color;
@@ -268,4 +270,24 @@ public abstract class NavigationTreeNodeSupport<O> extends ObserveTreeNodeSuppor
public int hashCode() {
return Objects.hash(getData());
}
+
+ /**
+ * Compute new node position from his given bean reference
+ *
+ * @param beanReference bean we want to insert from this parent
+ * @return position where to insert a node with the given bean reference
+ */
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ public int getNewPosition(DtoReference beanReference) {
+ if (beanReference.isNotPersisted()) {
+ // not persisted data is always on bottom
+ return getChildCount();
+ }
+ if (this instanceof MultipleReferenceContainerNode) {
+ // when multiple container, let's ask him the correction position
+ return ((MultipleReferenceContainerNode) this).getNodePosition(beanReference);
+ }
+ // in other cases, always on bottom (if not, do override this method)
+ return getChildCount();
+ }
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/nodes/data/ps/obs/ActivitySeineNavigationTreeNode.java
=====================================
@@ -32,6 +32,7 @@ import fr.ird.observe.dto.data.ps.observation.FloatingObjectReference;
import fr.ird.observe.dto.data.ps.observation.SetDto;
import fr.ird.observe.dto.data.ps.observation.SetReference;
import fr.ird.observe.dto.reference.DataDtoReferenceSet;
+import fr.ird.observe.dto.reference.DtoReference;
import fr.ird.observe.navigation.model.edit.seine.node.ObserveSeineActivityEditNode;
import fr.ird.observe.navigation.model.select.seine.node.ObserveSeineActivitySelectNode;
import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
@@ -133,5 +134,21 @@ public class ActivitySeineNavigationTreeNode extends ReferenceNavigationTreeNode
public SetSeineNavigationTreeNode newSingleChildNode(String parentId) {
return newSingleChildNode(new SetReference(new SetDto(), null));
}
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public int getNewPosition(DtoReference beanReference) {
+ if (beanReference.isNotPersisted()) {
+ // not persisted, always at bottom
+ return getChildCount();
+ }
+ if (beanReference instanceof SetReference) {
+ // when is a persisted set, then always on top
+ return 0;
+ }
+
+ return super.getNewPosition(beanReference);
+
+ }
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/db511b177a0ed6d5fc2976341…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/db511b177a0ed6d5fc2976341…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Réouverture simplifiée d'item : l'arbre de navigation est mal rafraîchit - Closes #1500
by Tony CHEMIT 26 Jun '20
by Tony CHEMIT 26 Jun '20
26 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
87d00a11 by Tony Chemit at 2020-06-26T10:57:11+02:00
Réouverture simplifiée d'item : l'arbre de navigation est mal rafraîchit - Closes #1500
- - - - -
3 changed files:
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/Close.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/Open.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/NavigationTree.java
Changes:
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/Close.java
=====================================
@@ -29,10 +29,10 @@ import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSu
import fr.ird.observe.client.datasource.editor.content.data.open.ContentOpenableUI;
import fr.ird.observe.client.datasource.editor.content.data.open.ContentOpenableUIModel;
import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
+import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationTreeNodeSupport;
import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
import fr.ird.observe.dto.data.DataDto;
import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
-import fr.ird.observe.dto.reference.DataDtoReference;
import fr.ird.observe.navigation.model.edit.CloseEditNodeRequest;
import fr.ird.observe.navigation.model.edit.CloseEditNodeVetoException;
import fr.ird.observe.navigation.model.edit.ObserveEditModelManager;
@@ -54,12 +54,12 @@ import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
/**
- * Action pour fermer l'objet sous-jacent à l'écran.
+ * To close selected node.
*
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.4
*/
-public class Close extends ContentUIActionSupport<ContentOpenableUI> {
+public class Close extends ContentUIActionSupport<ContentOpenableUI<?, ?, ?>> {
private static final Logger log = LogManager.getLogger(Close.class);
@@ -88,16 +88,17 @@ public class Close extends ContentUIActionSupport<ContentOpenableUI> {
@Override
protected void defaultInit(InputMap inputMap, ActionMap actionMap) {
- Class dtoType = getUi().getModel().getBeanType();
+ Class<?> dtoType = getUi().getModel().getBeanType();
setTooltipText(t("observe.action.close.open.tip", ObserveI18nDecoratorHelper.getTypeI18nKey(dtoType)));
super.defaultInit(inputMap, actionMap);
}
@Override
- protected void doActionPerformed(ActionEvent event, ContentOpenableUI ui) {
+ protected void doActionPerformed(ActionEvent event, ContentOpenableUI<?,?,?> ui) {
try {
- closeData(getDataSourceEditor(), ui.getModel().getEditNode());
+ ObserveEditNode<?> editNode = ui.getModel().getEditNode();
+ closeData(getDataSourceEditor(), editNode);
if (ui.getModel().isUpdatingMode()) {
ui.stopEdit();
}
@@ -110,9 +111,9 @@ public class Close extends ContentUIActionSupport<ContentOpenableUI> {
}
}
- private <D extends DataDto, R extends DataDtoReference<D, R>, U extends ContentOpenableUI<D, R, U>> void afterClose(U ui) {
+ private void afterClose(ContentOpenableUI<?, ?, ?> ui) {
- ContentOpenableUIModel<D, R> model = ui.getModel();
+ ContentOpenableUIModel<?, ?> model = ui.getModel();
DataDto bean = model.getBean();
@@ -122,8 +123,12 @@ public class Close extends ContentUIActionSupport<ContentOpenableUI> {
removeAllMessages(ui);
ContentUIHandler.addMessage(ui, NuitonValidatorScope.INFO, getTypeI18nKey(bean.getClass()), t(model.getCloseMessage()));
-// NavigationTree treeHelper = getNavigationTree();
-// treeHelper.reloadSelectedNode(bean instanceof TripDto || bean instanceof TripDto, true);
+ NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
+
+ NavigationTreeNodeSupport<?> node = tree.getSelectedNode();
+ tree.reloadSelectedNode(true, true);
+ tree.refreshToRoot(node.getParent());
+
ui.getHandler().updateActions();
ui.getHandler().grabFocusOnForm();
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/actions/Open.java
=====================================
@@ -27,6 +27,7 @@ import fr.ird.observe.client.datasource.editor.content.ContentUIHandler;
import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.data.open.ContentOpenableUI;
import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
+import fr.ird.observe.client.datasource.editor.tree.navigation.nodes.NavigationTreeNodeSupport;
import fr.ird.observe.client.util.ObserveKeyStrokesSupport;
import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
import fr.ird.observe.navigation.model.edit.CloseEditNodeVetoException;
@@ -41,13 +42,13 @@ import org.apache.logging.log4j.Logger;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import java.awt.event.ActionEvent;
+import java.util.Objects;
import static io.ultreia.java4all.i18n.I18n.n;
import static io.ultreia.java4all.i18n.I18n.t;
/**
- * Action pour sélectionner un noeud (attaché à l'éditeur) dans l'arbre de
- * navigation.
+ * To open selected node.
*
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.4
@@ -79,22 +80,23 @@ public class Open extends ContentUIActionSupport<ContentOpenableUI<?, ?, ?>> {
}
@Override
- protected void doActionPerformed(ActionEvent event, ContentOpenableUI openUI) {
+ protected void doActionPerformed(ActionEvent event, ContentOpenableUI<?, ?, ?> openUI) {
ObserveSelectNode<?> selectedNode = openUI.getModel().getSelectedNode();
ObserveEditNode<?> editNode = openUI.getModel().getEditNode();
String id = selectedNode.getId();
-
+ NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
+ NavigationTreeNodeSupport<?> previousOpenedNode = editNode.isEnabled() ? tree.getEditNode(editNode) : null;
try {
openData(editNode, selectedNode, id);
- afterOpen(openUI);
+ afterOpen(openUI, previousOpenedNode);
} catch (CloseEditNodeVetoException e1) {
log.error("Could not close data from callback", e1);
//UIHelper.handlingError(e1);
}
}
- private void afterOpen(ContentOpenableUI<?, ?, ?> ui) {
+ private void afterOpen(ContentOpenableUI<?, ?, ?> ui, NavigationTreeNodeSupport<?> previousOpenedNode) {
ui.getModel().setMode(ContentMode.UPDATE);
@@ -103,7 +105,15 @@ public class Open extends ContentUIActionSupport<ContentOpenableUI<?, ?, ?>> {
// on repaint le parent (le program devient alors ouvert)
NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
+
+ if (previousOpenedNode != null) {
+ tree.refreshToRoot(previousOpenedNode);
+ }
+ NavigationTreeNodeSupport<?> selectedNode = tree.getSelectedNode();
tree.reloadSelectedNode(true, true);
+ if (previousOpenedNode == null || !Objects.equals(previousOpenedNode.getParent(), selectedNode.getParent())) {
+ tree.refreshToRoot(selectedNode.getParent());
+ }
ContentUIHandler.removeAllMessages(ui);
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/tree/navigation/NavigationTree.java
=====================================
@@ -261,7 +261,7 @@ public class NavigationTree extends JXTree {
afterAddUnsavedNode(parentNode, result);
}
- private void afterAddUnsavedNode(MutableTreeNode parentNode, ReferenceNode<?,?> result) {
+ private void afterAddUnsavedNode(MutableTreeNode parentNode, ReferenceNode<?, ?> result) {
// refresh parent node (render of parent can have changed)
reloadNode(parentNode, true);
@@ -328,6 +328,14 @@ public class NavigationTree extends JXTree {
return ReferenceNode.downToReferenceNode(referenceType, editNode.getId(), containerNode);
}
+ public void refreshToRoot(NavigationTreeNodeSupport<?> node) {
+ if (!node.isRoot()) {
+ log.info(String.format("Refresh node: %s", node));
+ reloadNode(node, false);
+ refreshToRoot(node.getParent());
+ }
+ }
+
interface SelectNodeStrategy extends Supplier<Optional<NavigationTreeNodeSupport<?>>> {
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/87d00a119f321f6fa89a7b5d4…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/87d00a119f321f6fa89a7b5d4…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Enregistrement de FOB impossible si une balise est présente - Closes #1503
by Tony CHEMIT 26 Jun '20
by Tony CHEMIT 26 Jun '20
26 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
a232e941 by Tony Chemit at 2020-06-26T09:08:28+02:00
Enregistrement de FOB impossible si une balise est présente - Closes #1503
- - - - -
1 changed file:
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
Changes:
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
=====================================
@@ -52,7 +52,7 @@ import javax.swing.SwingUtilities;
import java.awt.Component;
import java.awt.Container;
import java.util.ArrayList;
-import java.util.Collections;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -339,7 +339,7 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject
if (transmittingBuoy == null) {
TransmittingBuoyHelper.copyTransmittingBuoyDto(new TransmittingBuoyDto(), editBean);
-
+ editBean.setCreateDate(new Date());
editBean.setTransmittingBuoyOperation(operation);
log.debug(String.format("Reuse an empty balise lue for objectOperation %s", operation.getLabel()));
@@ -360,12 +360,7 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject
}
- FloatingObjectDto bean = getModel().getBean();
-
- if (bean.getTransmittingBuoy() == null) {
- bean.setTransmittingBuoy(Collections.emptyList());
- }
- bean.getTransmittingBuoy().add(editBean);
+ getModel().getBean().getTransmittingBuoy().add(editBean);
}
private TransmittingBuoyOperationReference getObjectOperation(List<TransmittingBuoyOperationReference> operations, String codeOperation) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a232e9411e377029274a01202…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a232e9411e377029274a01202…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 3 commits: Imperfections sur création de nouveau FOB en utilisant les préconfigurations - See #1501
by Tony CHEMIT 25 Jun '20
by Tony CHEMIT 25 Jun '20
25 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
2907a002 by Tony Chemit at 2020-06-25T12:34:43+02:00
Imperfections sur création de nouveau FOB en utilisant les préconfigurations - See #1501
Correction des préconfiguration
- - - - -
d57d7761 by Tony Chemit at 2020-06-25T12:35:52+02:00
Imperfections sur création de nouveau FOB en utilisant les préconfigurations - See #1501
Pouvoir enregister un nouveau FOB à partir d'une préconfiguration (le bouton Sauvegarder est actif dès que possible)
- - - - -
8d6d355e by Tony Chemit at 2020-06-25T12:36:50+02:00
Imperfections sur création de nouveau FOB en utilisant les préconfigurations - Closes #1501
Amélioration des ui (ne pas pouvoir sélectionner une propriété si elle est nulle ou vide)
Renommage de l'action fermer en annuler
- - - - -
10 changed files:
- client-datasource-editor-ps/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml
- client-datasource-editor-ps/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml
- client-datasource-editor-ps/src/main/dcp-presets/ps/observation/01-deployment-preset.yml
- client-datasource-editor-ps/src/main/i18n/getters/java.getter
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUI.jaxx
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUI.jcss
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUIHandler.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectUIInitializer.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/FloatingObjectUIAddFloatingObjectPreset.java
Changes:
=====================================
client-datasource-editor-ps/src/main/dcp-presets/ps/logbook/01-deployment-preset.yml
=====================================
@@ -1,6 +1,6 @@
buoy1:
transmittingBuoyOperationId: fr.ird.referential.ps.common.TransmittingBuoyOperation#1239832686238#0.4755624782839416
- transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#1
+ transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#3
label1: Draft deployment (DFAD)
label2: Mise à l'eau de radeau dérivant (DFAD)
label3: Draft deployment (DFAD) #TODO
=====================================
client-datasource-editor-ps/src/main/dcp-presets/ps/logbook/04-abandonned-preset.yml
=====================================
@@ -1,6 +1,6 @@
buoy1:
transmittingBuoyOperationId: fr.ird.referential.ps.common.TransmittingBuoyOperation#1239832686238#0.4755624782839416
- transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#1
+ transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#3
label1: Buoy abandonned (DFAD)
label2: Perte/fin de transmission de balise (DFAD)
label3: Buoy abandonned (DFAD) #TODO
=====================================
client-datasource-editor-ps/src/main/dcp-presets/ps/observation/01-deployment-preset.yml
=====================================
@@ -1,6 +1,6 @@
buoy1:
transmittingBuoyOperationId: fr.ird.referential.ps.common.TransmittingBuoyOperation#1239832686238#0.4755624782839416
- transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#1
+ transmittingBuoyOwnershipId: fr.ird.referential.ps.common.TransmittingBuoyOwnership#0#3
label1: Draft deployment (DFAD)
label2: Mise à l'eau de radeau dérivant (DFAD)
label3: Draft deployment (DFAD) #TODO
=====================================
client-datasource-editor-ps/src/main/i18n/getters/java.getter
=====================================
@@ -12,8 +12,8 @@ observe.choice.cancel
observe.choice.confirm.delete
observe.choice.continue
observe.choice.dcp.default
-observe.choice.quit
observe.choice.save
+observe.common.boolean.true
observe.content.map.legend.tripBetweenTwoDays
observe.content.map.legend.tripDay
observe.data.ll.common.GearUseFeatures.action.addMeasurement
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUI.jaxx
=====================================
@@ -146,7 +146,7 @@
</row>
<row>
<cell>
- <JPanel id="buoys" layout="{new GridLayout(0,1)}">
+ <JPanel id="buoys" layout="{new GridLayout(1,0)}">
<FloatingObjectBuoyPresetUI id="buoy1"/>
<FloatingObjectBuoyPresetUI id="buoy2"/>
<JLabel id='noBaliseEditor' styleClass="skipI18n"/>
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUI.jcss
=====================================
@@ -32,10 +32,6 @@ JLabel {
border:{new TitledBorder(t("observe.data.ps.observation.FloatingObject.materialsTab"))};
}
-/*#buoys {
- border:{new TitledBorder(t("observe.data.ps.observation.FloatingObject.buoysTab"))};
-}*/
-
#keepObjectOperation {
selected:true;
enabled:false;
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectPresetUIHandler.java
=====================================
@@ -23,17 +23,21 @@ package fr.ird.observe.client.datasource.dcp.presets.observation;
*/
import com.google.common.collect.ImmutableSet;
+import fr.ird.observe.client.util.BeanCheckBox;
+import fr.ird.observe.dto.data.ps.dcp.FloatingObjectBuoyPreset;
import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPreset;
-import io.ultreia.java4all.i18n.I18n;
import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
import javax.swing.DefaultListModel;
import javax.swing.ListSelectionModel;
+import java.beans.Introspector;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import static io.ultreia.java4all.i18n.I18n.t;
+
/**
* Created on 06/07/19.
*
@@ -45,28 +49,21 @@ public class FloatingObjectPresetUIHandler extends UIHandlerSupport<FloatingObje
@Override
public void afterInit(FloatingObjectPresetUI ui) {
new FloatingObjectUIInitializer<>(ui).initUI();
- ui.getBuoy1().getValidator().setParentValidator(ui.getValidator());
- ui.getBuoy2().getValidator().setParentValidator(ui.getValidator());
+ FloatingObjectBuoyPresetUI buoy1 = ui.getBuoy1();
+ buoy1.getValidator().setParentValidator(ui.getValidator());
+ FloatingObjectBuoyPresetUI buoy2 = ui.getBuoy2();
+ buoy2.getValidator().setParentValidator(ui.getValidator());
FloatingObjectPreset floatingObjectPreset = ui.getContextValue(FloatingObjectPreset.class);
floatingObjectPreset.copy(ui.getModel().getBean());
+ disabledIfNull(ui, "keepSupplyName");
ui.getBuoys().removeAll();
SwingValidatorUtil.setValidatorBean(ui, ui.getModel().getBean());
ui.getBuoys().add(ui.getNoBaliseEditor());
- Optional.ofNullable(floatingObjectPreset.getBuoy1()).ifPresent(t -> {
- t.copy(ui.getBuoy1().getModel().getBean());
- ui.getBuoys().remove(ui.getNoBaliseEditor());
- ui.getBuoys().add(ui.getBuoy1());
- SwingValidatorUtil.setValidatorBean(ui.getBuoy1(), ui.getBuoy1().getModel().getBean());
-
- });
- Optional.ofNullable(floatingObjectPreset.getBuoy2()).ifPresent(t -> {
- t.copy(ui.getBuoy2().getModel().getBean());
- ui.getBuoys().remove(ui.getNoBaliseEditor());
- ui.getBuoys().add(ui.getBuoy2());
- SwingValidatorUtil.setValidatorBean(ui.getBuoy2(), ui.getBuoy2().getModel().getBean());
- });
+
+ Optional.ofNullable(floatingObjectPreset.getBuoy1()).ifPresent(t -> prepareBuoy(t, buoy1));
+ Optional.ofNullable(floatingObjectPreset.getBuoy2()).ifPresent(t -> prepareBuoy(t, buoy2));
DefaultListModel<String> materialsListModel = new DefaultListModel<>();
List<String> materialsList = buildMaterialsList(ui);
@@ -75,6 +72,7 @@ public class FloatingObjectPresetUIHandler extends UIHandlerSupport<FloatingObje
ui.getMaterialsList().setRequestFocusEnabled(false);
ui.getMaterialsList().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+
}
private List<String> buildMaterialsList(FloatingObjectPresetUI ui) {
@@ -87,18 +85,63 @@ public class FloatingObjectPresetUIHandler extends UIHandlerSupport<FloatingObje
String values = "";
String whenArrivingValue = whenArrivingMaterials.get(id);
if (whenArrivingValue != null) {
- values += I18n.t("observe.Id.whenArriving") + " - " + whenArrivingValue;
+ if ("true".equals(whenArrivingValue)) {
+ whenArrivingValue = t("observe.common.boolean.true");
+ }
+ values += t("observe.Id.whenArriving") + " - " + whenArrivingValue;
}
String whenLeavingValue = whenLeavingMaterials.get(id);
if (whenLeavingValue != null) {
if (!values.isEmpty()) {
values += " - ";
}
- values += I18n.t("observe.Id.whenLeaving") + " - " + whenLeavingValue;
+ if ("true".equals(whenLeavingValue)) {
+ whenLeavingValue = t("observe.common.boolean.true");
+ }
+ values += t("observe.Id.whenLeaving") + " - " + whenLeavingValue;
}
materials.add(label + " ( " + values + " )");
}
return materials;
}
+ private void prepareBuoy(FloatingObjectBuoyPreset preset, FloatingObjectBuoyPresetUI buoyUI) {
+ preset.copy(buoyUI.getModel().getBean());
+ ui.getBuoys().remove(ui.getNoBaliseEditor());
+ ui.getBuoys().add(buoyUI);
+ SwingValidatorUtil.setValidatorBean(buoyUI, buoyUI.getModel().getBean());
+ disableIfNull(buoyUI);
+ }
+
+ private void disableIfNull(FloatingObjectBuoyPresetUI ui) {
+ disabledIfNull(ui, "keepVesselId");
+ disabledIfNull(ui, "keepCountryId");
+ disabledIfNull(ui, "keepCode");
+ disabledIfNull(ui, "keepComment");
+ disabledIfNull(ui, "keepTransmittingBuoyOwnershipId");
+ disabledIfNull(ui, "keepTransmittingBuoyTypeId");
+ disabledIfNull(ui, "keepVesselId");
+ }
+
+ private void disabledIfNull(FloatingObjectBuoyPresetUI ui, String uiProperty) {
+ String beanProperty = Introspector.decapitalize(uiProperty.substring(4));
+ Object value = ui.getBean().get(beanProperty);
+ if (value == null || value.toString().trim().isEmpty()) {
+ ui.getModel().set(uiProperty, false);
+ BeanCheckBox editor = (BeanCheckBox) ui.getObjectById(uiProperty);
+ editor.setSelected(false);
+ editor.setEnabled(false);
+ }
+ }
+
+ private void disabledIfNull(FloatingObjectPresetUI ui, String uiProperty) {
+ String beanProperty = Introspector.decapitalize(uiProperty.substring(4));
+ Object value = ui.getBean().get(beanProperty);
+ if (value == null || value.toString().trim().isEmpty()) {
+ ui.getModel().set(uiProperty, false);
+ BeanCheckBox editor = (BeanCheckBox) ui.getObjectById(uiProperty);
+ editor.setSelected(false);
+ editor.setEnabled(false);
+ }
+ }
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/dcp/presets/observation/FloatingObjectUIInitializer.java
=====================================
@@ -78,11 +78,7 @@ public class FloatingObjectUIInitializer<UI extends JAXXObject & JAXXValidator>
void initUI() {
Set<String> doNotBlockComponentIds = new HashSet<>();
-// FIXME Check if this is still ok while commenting this code
-// ((JComponent) ui).getActionMap().setParent(actionMap);
-// ((JComponent) ui).setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
-
- log.info("Init widgets - first pass for: " + ui);
+ log.info(String.format("Init widgets - first pass for: %s", ui));
Set<Object> done = new LinkedHashSet<>();
for (String name : ui.get$objectMap().keySet()) {
Object o = ui.getObjectById(name);
@@ -134,7 +130,7 @@ public class FloatingObjectUIInitializer<UI extends JAXXObject & JAXXValidator>
}
}
- log.info("Init widgets - second pass for: " + ui);
+ log.info(String.format("Init widgets - second pass for: %s", ui));
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
=====================================
@@ -214,7 +214,7 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject
}
}
- model.setModified(false);
+ model.setModified(model.isCreatingMode());
}
private void recomputeComputedValues() {
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/FloatingObjectUIAddFloatingObjectPreset.java
=====================================
@@ -67,7 +67,7 @@ public class FloatingObjectUIAddFloatingObjectPreset extends ContentUIActionSupp
FloatingObjectPresetUI configPanel = FloatingObjectPresetUIModel.init(applicationContext, floatingObjectPreset);
String replaceText = t("observe.choice.save");
- Object[] options = {replaceText, t("observe.choice.quit")};
+ Object[] options = {replaceText, t("observe.choice.cancel")};
JOptionPane pane = new JOptionPane(configPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options, options[0]);
JButton saveButton = Objects.requireNonNull(findButton(pane, replaceText));
configPanel.getValidator().addPropertyChangeListener(AbstractValidator.VALID_PROPERTY, e -> onValidChanged(saveButton, (Boolean) e.getNewValue()));
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a76c291106d973d040c2406d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/a76c291106d973d040c2406d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] Enregistrement de FOB -> chagement d'onglet intempestif - Closes #1505
by Tony CHEMIT 24 Jun '20
by Tony CHEMIT 24 Jun '20
24 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
a76c2911 by Tony Chemit at 2020-06-24T19:04:50+02:00
Enregistrement de FOB -> chagement d'onglet intempestif - Closes #1505
- - - - -
5 changed files:
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/ContentEditUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/actions/SaveActionSupport.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/ContentOpenableUI.jaxx
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ref/ContentReferenceUI.jaxx
Changes:
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ContentUIHandler.java
=====================================
@@ -459,7 +459,14 @@ public abstract class ContentUIHandler<U extends ContentUI> implements ObserveSe
// dettach all validators
uninstallValidators();
}
-
+ public void resetFromPreviousUi(U ui) {
+ if (tabbedPaneValidator != null) {
+ JTabbedPane mainTabbedPane = (JTabbedPane) ui.getObjectById(JaxxObjectInitializer.MAIN_TABBED_PANE);
+ if (mainTabbedPane != null) {
+ SwingUtilities.invokeLater(() -> ((JTabbedPane) this.ui.getObjectById(JaxxObjectInitializer.MAIN_TABBED_PANE)).setSelectedIndex((mainTabbedPane).getSelectedIndex()));
+ }
+ }
+ }
final void destroyUI() {
if (ui == null) {
return;
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/ContentEditUI.jaxx
=====================================
@@ -42,6 +42,10 @@
@Override
public abstract ObserveSwingValidator<D> getValidator();
+public void resetFromPreviousUi(U previousUi) {
+ getHandler().resetFromPreviousUi(previousUi);
+}
+
]]>
</script>
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/edit/actions/SaveActionSupport.java
=====================================
@@ -24,6 +24,7 @@ package fr.ird.observe.client.datasource.editor.content.data.edit.actions;
import fr.ird.observe.client.datasource.api.ObserveDataSourcesManagerApplicationComponent;
import fr.ird.observe.client.datasource.editor.content.ContentMode;
+import fr.ird.observe.client.datasource.editor.content.ContentUI;
import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUI;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUIModel;
@@ -116,6 +117,9 @@ public abstract class SaveActionSupport<D extends DataDto, R extends DataDtoRefe
// on sélectionne le nouveau noeud
tree.selectSafeNode(node);
+ @SuppressWarnings({"RedundantExplicitVariableType", "unchecked"}) U newUi = (U) getDataSourceEditor().getContentUIManager().getSelectedContentUI();
+ newUi.resetFromPreviousUi(ui);
+
} else {
// on repaint le noeud et ses enfants
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/data/open/ContentOpenableUI.jaxx
=====================================
@@ -43,6 +43,10 @@
@Override
public abstract ObserveSwingValidator<D> getValidator();
+public void resetFromPreviousUi(U previousUi) {
+ getHandler().resetFromPreviousUi(previousUi);
+}
+
]]>
</script>
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/content/ref/ContentReferenceUI.jaxx
=====================================
@@ -77,6 +77,10 @@ public abstract NormalTextEditor getUri();
@Override
public abstract ContentReferenceUIHandler<E, R, U> getHandler();
+public void resetFromPreviousUi(U previousUi) {
+ getHandler().resetFromPreviousUi(previousUi);
+}
+
public void decorateUniqueKeyTable(JTable table,
TableCellRenderer renderer,
JScrollPane pane) {
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a76c291106d973d040c2406dd…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/a76c291106d973d040c2406dd…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] FOB enregistré non disponible immédiatement dans la popup de sélection d'objet...
by Tony CHEMIT 24 Jun '20
by Tony CHEMIT 24 Jun '20
24 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
5139d387 by Tony Chemit at 2020-06-24T18:12:45+02:00
FOB enregistré non disponible immédiatement dans la popup de sélection d'objet prédéfini - Closes #1504
- - - - -
5 changed files:
- client-configuration/src/main/java/fr/ird/observe/client/datasource/dcp/FloatingObjectPresetsManager.java
- client-core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/ActivityUIAddFloatingObject.java
- client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/FloatingObjectUIAddFloatingObjectPreset.java
Changes:
=====================================
client-configuration/src/main/java/fr/ird/observe/client/datasource/dcp/FloatingObjectPresetsManager.java
=====================================
@@ -84,11 +84,11 @@ public class FloatingObjectPresetsManager {
switch (model) {
case ps_observation:
directory = config.getDcpPsObservationPresetsDirectory().toPath();
- map = this.psObservation;
+ map = getPsObservationPresets();
break;
case ps_logbook:
directory = config.getDcpPsLogbookPresetsDirectory().toPath();
- map = this.psLogbook;
+ map = getPsLogbookPresets();
break;
default:
throw new IllegalStateException("Can't deal with model: " + model);
@@ -119,6 +119,14 @@ public class FloatingObjectPresetsManager {
}
public Set<FloatingObjectPreset> getPsObservation() {
+ return ImmutableSet.copyOf(getPsObservationPresets().values());
+ }
+
+ public Set<FloatingObjectPreset> getPsLogbook() {
+ return ImmutableSet.copyOf(getPsLogbookPresets().values());
+ }
+
+ public Map<Path, FloatingObjectPreset> getPsObservationPresets() {
if (psObservation == null) {
log.info("Loading ps observation dcp presets...");
try {
@@ -129,10 +137,10 @@ public class FloatingObjectPresetsManager {
psObservation = new TreeMap<>();
}
}
- return ImmutableSet.copyOf(psObservation.values());
+ return psObservation;
}
- public Set<FloatingObjectPreset> getPsLogbook() {
+ public Map<Path, FloatingObjectPreset> getPsLogbookPresets() {
if (psLogbook == null) {
log.info("Loading ps logbook dcp presets...");
try {
@@ -143,22 +151,16 @@ public class FloatingObjectPresetsManager {
psLogbook = new TreeMap<>();
}
}
- return ImmutableSet.copyOf(psLogbook.values());
- }
-
- public Map<Path, FloatingObjectPreset> getPsObservationL() {
- return psObservation;
- }
-
- public Map<Path, FloatingObjectPreset> getPsLogbookL() {
return psLogbook;
}
- public void setPsObservation(Map<Path, FloatingObjectPreset> psObservation) {
- this.psObservation = psObservation;
+ public void setPsObservationPresets(Map<Path, FloatingObjectPreset> psObservationPresets) {
+ this.psObservation = psObservationPresets;
+ log.info(String.format("Set %d ps observation dcp presets.", psObservationPresets.size()));
}
- public void setPsLogbook(Map<Path, FloatingObjectPreset> psLogbook) {
- this.psLogbook = psLogbook;
+ public void setPsLogbookPresets(Map<Path, FloatingObjectPreset> psLogbookPresets) {
+ this.psLogbook = psLogbookPresets;
+ log.info(String.format("Set %d ps logbook dcp presets.", psLogbookPresets.size()));
}
}
=====================================
client-core/src/main/java/fr/ird/observe/client/datasource/api/ObserveSwingDataSource.java
=====================================
@@ -643,8 +643,14 @@ public class ObserveSwingDataSource extends ObserveServicesProviderSupport imple
public void sanitize(BoundedRangeModel progressModel, FloatingObjectPresetsManager dataSource) {
int size = dataSource.size();
log.info(String.format("Will sanitize %d preset(s).", size));
- sanitize(dataSource.getPsObservationL(), progressModel);
- sanitize(dataSource.getPsLogbookL(), progressModel);
+ {
+ Map<Path, FloatingObjectPreset> sanitize = sanitize(dataSource.getPsObservationPresets(), progressModel);
+ dataSource.setPsObservationPresets(sanitize);
+ }
+ {
+ Map<Path, FloatingObjectPreset> sanitize = sanitize(dataSource.getPsLogbookPresets(), progressModel);
+ dataSource.setPsLogbookPresets(sanitize);
+ }
log.info(String.format("Found %d safe preset(s).", dataSource.size()));
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/FloatingObjectUIHandler.java
=====================================
@@ -21,7 +21,7 @@
*/
package fr.ird.observe.client.datasource.editor.content.data.ps.observation;
-import fr.ird.observe.client.datasource.dcp.FloatingObjectPresetsManagerApplicationComponent;
+import fr.ird.observe.client.datasource.dcp.WithFloatingObjectPresetsManager;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUIHandler;
import fr.ird.observe.client.datasource.editor.content.data.edit.ContentEditUILayoutFocusTraversalPolicy;
import fr.ird.observe.client.datasource.editor.content.data.ps.observation.dcp.FloatingObjectPartsTreeTableModel;
@@ -65,7 +65,7 @@ import static io.ultreia.java4all.i18n.I18n.t;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 1.0
*/
-public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObjectDto, FloatingObjectReference, FloatingObjectUI> implements UIHandler<FloatingObjectUI> {
+public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObjectDto, FloatingObjectReference, FloatingObjectUI> implements UIHandler<FloatingObjectUI>, WithFloatingObjectPresetsManager {
private static final Logger log = LogManager.getLogger(FloatingObjectUIHandler.class);
private static final Icon ICON_NOT_A_REFERENCE = SwingUtil.createImageIcon("star-empty.png");
@@ -97,18 +97,13 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject
FloatingObjectPreset newValue = (FloatingObjectPreset) e.getNewValue();
ui.getFloatingObjectReferenceActions().removeAll();
ui.getAddFloatingObjectPreset().setEnabled(newValue == null);
-// ui.getEditFloatingObjectReference().setEnabled(newValue != null);
-// ui.getRemoveFloatingObjectReference().setEnabled(newValue != null);
if (newValue == null) {
ui.getFloatingObjectReferenceLabel().setIcon(ICON_NOT_A_REFERENCE);
ui.getFloatingObjectReferenceLabel().setText(t("observe.data.ps.observation.FloatingObject.not.a.reference"));
ui.getFloatingObjectReferenceActions().add(ui.getAddFloatingObjectPreset());
-// ui.getEditFloatingObjectReference().setEnabled(false);
} else {
ui.getFloatingObjectReferenceLabel().setIcon(ICON_IS_A_REFERENCE);
ui.getFloatingObjectReferenceLabel().setText(t("observe.data.ps.observation.FloatingObject.is.a.reference", newValue.getLabel(getDecoratorService().getReferentialLocale())));
-// ui.getFloatingObjectReferenceActions().add(ui.getEditFloatingObjectReference());
-// ui.getFloatingObjectReferenceActions().add(ui.getRemoveFloatingObjectReference());
}
});
@@ -161,7 +156,7 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject
Optional<FloatingObjectPreset> floatingObjectReference;
if (dcpId == null) {
- floatingObjectReference = Optional.ofNullable(FloatingObjectPresetsManagerApplicationComponent.value().getReferenceToUse());
+ floatingObjectReference = Optional.ofNullable(getFloatingObjectPresetsManager().getReferenceToUse());
form = getPsObservationFloatingObjectService().preCreate(activityId, floatingObjectReference.orElse(null));
} else {
form = getPsObservationFloatingObjectService().loadForm(dcpId);
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/ActivityUIAddFloatingObject.java
=====================================
@@ -24,14 +24,15 @@ package fr.ird.observe.client.datasource.editor.content.data.ps.observation.acti
import fr.ird.observe.client.ClientUIContext;
import fr.ird.observe.client.datasource.dcp.FloatingObjectPresetsManager;
-import fr.ird.observe.client.datasource.dcp.FloatingObjectPresetsManagerApplicationComponent;
+import fr.ird.observe.client.datasource.dcp.WithFloatingObjectPresetsManager;
import fr.ird.observe.client.datasource.editor.DataSourceEditor;
import fr.ird.observe.client.datasource.editor.content.ObservePsKeyStrokes;
import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.data.ps.observation.ActivityUI;
import fr.ird.observe.client.datasource.editor.tree.navigation.NavigationTree;
import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPreset;
-import fr.ird.observe.dto.decoration.DecoratorServiceApplicationComponent;
+import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPresetModel;
+import fr.ird.observe.dto.decoration.WithDecoratorService;
import fr.ird.observe.navigation.tree.MultipleReferenceContainerNode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -57,7 +58,7 @@ import static io.ultreia.java4all.i18n.I18n.t;
* @author Tony Chemit - dev(a)tchemit.fr
* @since 6.0
*/
-public class ActivityUIAddFloatingObject extends ContentUIActionSupport<ActivityUI> {
+public class ActivityUIAddFloatingObject extends ContentUIActionSupport<ActivityUI> implements WithFloatingObjectPresetsManager {
private static final Logger log = LogManager.getLogger(ActivityUIAddFloatingObject.class);
@@ -65,9 +66,22 @@ public class ActivityUIAddFloatingObject extends ContentUIActionSupport<Activity
super(t("observe.data.ps.observation.Activity.action.addFloatingObject"), t("observe.data.ps.observation.Activity.action.addFloatingObject.tip"), "add", ObservePsKeyStrokes.KEY_STROKE_ADD_DCP);
}
- public static boolean choosePreset() {
- FloatingObjectPresetsManager floatingObjectPresetsManager = FloatingObjectPresetsManagerApplicationComponent.value();
- Set<FloatingObjectPreset> psObservation = floatingObjectPresetsManager.getPsObservation();
+ @Override
+ protected void doActionPerformed(ActionEvent e, ActivityUI ui) {
+
+ boolean doContinue = choosePreset();
+ if (!doContinue) {
+ return;
+ }
+
+ NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
+ MultipleReferenceContainerNode<?, ?> parentNode = (MultipleReferenceContainerNode<?, ?>) tree.getSelectedNode();
+ doCreate(getDataSourceEditor(), parentNode);
+ }
+
+ boolean choosePreset() {
+ FloatingObjectPresetsManager floatingObjectPresetsManager = getFloatingObjectPresetsManager();
+ Set<FloatingObjectPreset> psObservation = floatingObjectPresetsManager.getPresets(FloatingObjectPresetModel.ps_observation);
if (!psObservation.isEmpty()) {
JPanel userConfigs = new JPanel(new GridLayout(0, 2));
@@ -97,29 +111,16 @@ public class ActivityUIAddFloatingObject extends ContentUIActionSupport<Activity
return true;
}
- @Override
- protected void doActionPerformed(ActionEvent e, ActivityUI ui) {
-
- boolean doContinue = choosePreset();
- if (!doContinue) {
- return;
- }
-
- NavigationTree tree = getDataSourceEditor().getNavigationUI().getTree();
- MultipleReferenceContainerNode<?, ?> parentNode = (MultipleReferenceContainerNode<?, ?>) tree.getSelectedNode();
- doCreate(getDataSourceEditor(), parentNode);
- }
-
- public static void doCreate(DataSourceEditor editor, MultipleReferenceContainerNode<?, ?> parentNode) {
+ void doCreate(DataSourceEditor editor, MultipleReferenceContainerNode<?, ?> parentNode) {
try {
NavigationTree tree = editor.getNavigationUI().getTree();
tree.addUnsavedNode(parentNode);
} finally {
- FloatingObjectPresetsManagerApplicationComponent.value().setReferenceToUse(null);
+ getFloatingObjectPresetsManager().setReferenceToUse(null);
}
}
- private static class UsePresetAction extends AbstractAction {
+ private static class UsePresetAction extends AbstractAction implements WithDecoratorService {
private final FloatingObjectPreset preset;
private final KeyStroke keyStroke;
@@ -129,7 +130,7 @@ public class ActivityUIAddFloatingObject extends ContentUIActionSupport<Activity
this.preset = Objects.requireNonNull(preset);
this.keyStroke = Objects.requireNonNull(KeyStroke.getKeyStroke("F" + index));
putValue(ActivityUIAddFloatingObject.class.getName(), getClass().getName() + "_" + index);
- putValue(NAME, DecoratorServiceApplicationComponent.value().getDecoratorByType(preset.getClass()).toString(preset));
+ putValue(NAME, getDecoratorService().getDecoratorByType(preset.getClass()).toString(preset));
}
public void install(JButton parent, JOptionPane pane) {
@@ -144,7 +145,6 @@ public class ActivityUIAddFloatingObject extends ContentUIActionSupport<Activity
public void actionPerformed(ActionEvent e) {
log.info(String.format("Choose dcp preset: %s", preset.getLabel1()));
pane.setValue(preset);
-// Objects.requireNonNull(SwingUtilities.getAncestorOfClass(Dialog.class, pane)).setVisible(false);
}
}
}
=====================================
client-datasource-editor-ps/src/main/java/fr/ird/observe/client/datasource/editor/content/data/ps/observation/actions/FloatingObjectUIAddFloatingObjectPreset.java
=====================================
@@ -24,11 +24,11 @@ package fr.ird.observe.client.datasource.editor.content.data.ps.observation.acti
import fr.ird.observe.client.ClientUIContext;
import fr.ird.observe.client.datasource.dcp.FloatingObjectPresetsManager;
-import fr.ird.observe.client.datasource.dcp.FloatingObjectPresetsManagerApplicationComponent;
+import fr.ird.observe.client.datasource.dcp.WithFloatingObjectPresetsManager;
import fr.ird.observe.client.datasource.dcp.presets.observation.FloatingObjectPresetUI;
import fr.ird.observe.client.datasource.dcp.presets.observation.FloatingObjectPresetUIModel;
-import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.ObservePsKeyStrokes;
+import fr.ird.observe.client.datasource.editor.content.actions.ContentUIActionSupport;
import fr.ird.observe.client.datasource.editor.content.data.ps.observation.FloatingObjectUI;
import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPreset;
import io.ultreia.java4all.application.context.ApplicationContext;
@@ -52,7 +52,7 @@ import static io.ultreia.java4all.i18n.I18n.t;
*
* @author Tony Chemit - dev(a)tchemit.fr
*/
-public class FloatingObjectUIAddFloatingObjectPreset extends ContentUIActionSupport<FloatingObjectUI> {
+public class FloatingObjectUIAddFloatingObjectPreset extends ContentUIActionSupport<FloatingObjectUI> implements WithFloatingObjectPresetsManager {
private static final Logger log = LogManager.getLogger(FloatingObjectUIAddFloatingObjectPreset.class);
@@ -101,7 +101,7 @@ public class FloatingObjectUIAddFloatingObjectPreset extends ContentUIActionSupp
if (model.getBuoy2() != null) {
model.setBuoy2(configPanel.getBuoy2().getModel().toBean());
}
- FloatingObjectPresetsManager floatingObjectPresetsManager = FloatingObjectPresetsManagerApplicationComponent.value();
+ FloatingObjectPresetsManager floatingObjectPresetsManager = getFloatingObjectPresetsManager();
floatingObjectPresetsManager.add(model);
ui.getModel().setReference(model);
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/5139d387cad1a0510c6cd947a…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/5139d387cad1a0510c6cd947a…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: [LL][Logbook] opération de pêche / décimaux : gestion de la virgule - Closes #1527
by Tony CHEMIT 24 Jun '20
by Tony CHEMIT 24 Jun '20
24 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
6730aa38 by Tony Chemit at 2020-06-24T17:21:57+02:00
[LL][Logbook] opération de pêche / décimaux : gestion de la virgule - Closes #1527
- - - - -
0b2a9f6c by Tony Chemit at 2020-06-24T17:22:07+02:00
Impossible de changer deux fois la langue - Closes #1539
- - - - -
252cb6a0 by Tony Chemit at 2020-06-24T17:22:07+02:00
Impossible d'afficher le `À propos` - Closes #1540
- - - - -
c88625b1 by Tony Chemit at 2020-06-24T17:22:33+02:00
Disfonctionnement de raccourcis - Closes #1497
- - - - -
5 changed files:
- client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
- pom.xml
Changes:
=====================================
client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
=====================================
@@ -133,7 +133,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey(),
};
- private final SimpleDateFormat dateFormat = new SimpleDateFormat();
+ private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm z");
/**
* un drapeau pour savoir s'il faut lancer l'interface graphique. Cette
* valeur peut être programmées lors des actions.
@@ -426,7 +426,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
}
public String getApplicationName() {
- return get().getOption(ApplicationConfig.APP_NAME);
+ return get().getOption("application.name");
}
@Override
=====================================
client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jaxx
=====================================
@@ -90,12 +90,6 @@ public void destroy() {
handler.destroy();
}
-@Override
-protected void finalize() throws Throwable {
- super.finalize();
- destroy();
-}
-
]]>
</script>
=====================================
client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java
=====================================
@@ -34,10 +34,10 @@ import fr.ird.observe.client.util.busy.BusyModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.runtime.spi.UIHandler;
+import org.nuiton.jaxx.runtime.swing.action.JAXXObjectActionSupport;
import org.nuiton.jaxx.widgets.error.ErrorDialogUI;
import javax.swing.JComponent;
-import javax.swing.KeyStroke;
import java.awt.KeyboardFocusManager;
import java.util.Locale;
@@ -92,6 +92,7 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI>, WithClien
ErrorDialogUI.init(ui);
BusyModel busyModel = getClientUIContext().getBusyModel();
+ JAXXObjectActionSupport.makeActionsEnabledOnlyIfMenuItemParentIsOpened(ui.getJMenuBar());
ObserveKeyStrokesSupport.addKeyStrokeFromMnemonic(ui);
@@ -101,7 +102,6 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI>, WithClien
BusyLayerUI.create(ui, busyModel);
ui.getMenu().setEnabled(!busyModel.isBusy());
- ui.getMenuLanguage().setAccelerator(KeyStroke.getKeyStroke("pressed L"));
reload(model, getClientConfig(), busyModel);
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
=====================================
@@ -50,6 +50,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.BoundedRangeModel;
+import java.beans.PropertyChangeListener;
import java.util.Set;
import java.util.function.Supplier;
@@ -64,6 +65,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
private static final Logger log = LogManager.getLogger(DataSourceEditorBodyContent.class);
+ private final PropertyChangeListener reload;
private DataSourceEditorMenu editorMenu;
private DataSourceEditorNavigationMenu navigationMenu;
private ObserveSwingDataSource dataSource;
@@ -71,6 +73,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
public DataSourceEditorBodyContent() {
super(1, DataSourceEditor.class);
setSupplier(SingletonSupplier.of(createSupplier()));
+ this.reload = e -> reload();
}
private Supplier<DataSourceEditor> createSupplier() {
@@ -92,24 +95,15 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
editorMenu.getUiModel().init();
navigationMenu.getUiModel().init();
-
- getClientUIContext().getBusyModel().addPropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, evt -> reload());
+ mainUI.getBusyModel().addPropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, reload);
ShowDataSourcePresetsAction.init(mainUI, mainUI.getShowDataSourcePresets(), ShowDataSourcePresetsAction.class);
}
-// @Override
-// public void uninstall(ObserveMainUI mainUI) {
-// super.uninstall(mainUI);
-// if (dataSource != null && dataSource.isOpen()) {
-// log.info("Closing main data source..");
-// try {
-// dataSource.close();
-// } finally {
-// setDataSource(null);
-// getObserveDataSourcesManager().setMainDataSource(null);
-// }
-// }
-// }
+ @Override
+ public void uninstall(ObserveMainUI mainUI) {
+ super.uninstall(mainUI);
+ mainUI.getBusyModel().removePropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, reload);
+ }
@Override
public void show(ObserveMainUI mainUI) {
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.32</version>
+ <version>2020.33</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -170,7 +170,7 @@
<!-- <lib.version.java4all.topia>1.17</lib.version.java4all.topia>-->
<!--<lib.version.java4all.eugene>3.0<-alpha-22</lib.version.java4all.eugene>-->
-<!-- <lib.version.java4all.jaxx>3.0-alpha-67-SNAPSHOT</lib.version.java4all.jaxx>-->
+<!-- <lib.version.java4all.jaxx>3.0-alpha-70-SNAPSHOT</lib.version.java4all.jaxx>-->
<!--<lib.version.java4all.application-context>1.0.3-SNAPSHOT</lib.version.java4all.application-context>-->
<!--<lib.version.java4all.application-template>1.0.2-SNAPSHOT</lib.version.java4all.application-template>-->
<!--<lib.version.java4all.i18n>4.0-beta-3-SNAPSHOT</lib.version.java4all.i18n>-->
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/0ef7cc91e4a2bf49bfc655ff…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/0ef7cc91e4a2bf49bfc655ff…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop] 4 commits: [LL][Logbook] opération de pêche / décimaux : gestion de la virgule - See #1527
by Tony CHEMIT 24 Jun '20
by Tony CHEMIT 24 Jun '20
24 Jun '20
Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
c939688b by Tony Chemit at 2020-06-22T19:57:18+02:00
[LL][Logbook] opération de pêche / décimaux : gestion de la virgule - See #1527
- - - - -
22cd5e4b by Tony Chemit at 2020-06-24T16:07:52+02:00
Impossible de changer deux fois la langue - Closes #1539
- - - - -
68ed0fc8 by Tony Chemit at 2020-06-24T16:07:54+02:00
Impossible d'afficher le `À propos` - Closes #1540
- - - - -
0ef7cc91 by Tony Chemit at 2020-06-24T16:24:41+02:00
Disfonctionnement de raccourcis - Closes #1497
- - - - -
5 changed files:
- client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
- client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jaxx
- client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java
- client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
- pom.xml
Changes:
=====================================
client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java
=====================================
@@ -133,7 +133,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
ClientConfigOption.OBSTUNA_CAN_MIGRATE.getKey(),
};
- private final SimpleDateFormat dateFormat = new SimpleDateFormat();
+ private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm z");
/**
* un drapeau pour savoir s'il faut lancer l'interface graphique. Cette
* valeur peut être programmées lors des actions.
@@ -426,7 +426,7 @@ public class ClientConfig extends GeneratedClientConfig implements TemplateGener
}
public String getApplicationName() {
- return get().getOption(ApplicationConfig.APP_NAME);
+ return get().getOption("application.name");
}
@Override
=====================================
client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUI.jaxx
=====================================
@@ -90,12 +90,6 @@ public void destroy() {
handler.destroy();
}
-@Override
-protected void finalize() throws Throwable {
- super.finalize();
- destroy();
-}
-
]]>
</script>
=====================================
client-core/src/main/java/fr/ird/observe/client/main/ObserveMainUIHandler.java
=====================================
@@ -34,10 +34,10 @@ import fr.ird.observe.client.util.busy.BusyModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuiton.jaxx.runtime.spi.UIHandler;
+import org.nuiton.jaxx.runtime.swing.action.JAXXObjectActionSupport;
import org.nuiton.jaxx.widgets.error.ErrorDialogUI;
import javax.swing.JComponent;
-import javax.swing.KeyStroke;
import java.awt.KeyboardFocusManager;
import java.util.Locale;
@@ -92,6 +92,7 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI>, WithClien
ErrorDialogUI.init(ui);
BusyModel busyModel = getClientUIContext().getBusyModel();
+ JAXXObjectActionSupport.makeActionsEnabledOnlyIfMenuItemParentIsOpened(ui.getJMenuBar());
ObserveKeyStrokesSupport.addKeyStrokeFromMnemonic(ui);
@@ -101,7 +102,6 @@ public class ObserveMainUIHandler implements UIHandler<ObserveMainUI>, WithClien
BusyLayerUI.create(ui, busyModel);
ui.getMenu().setEnabled(!busyModel.isBusy());
- ui.getMenuLanguage().setAccelerator(KeyStroke.getKeyStroke("pressed L"));
reload(model, getClientConfig(), busyModel);
=====================================
client-datasource-editor-api/src/main/java/fr/ird/observe/client/datasource/editor/DataSourceEditorBodyContent.java
=====================================
@@ -50,6 +50,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.swing.BoundedRangeModel;
+import java.beans.PropertyChangeListener;
import java.util.Set;
import java.util.function.Supplier;
@@ -64,6 +65,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
private static final Logger log = LogManager.getLogger(DataSourceEditorBodyContent.class);
+ private final PropertyChangeListener reload;
private DataSourceEditorMenu editorMenu;
private DataSourceEditorNavigationMenu navigationMenu;
private ObserveSwingDataSource dataSource;
@@ -71,6 +73,7 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
public DataSourceEditorBodyContent() {
super(1, DataSourceEditor.class);
setSupplier(SingletonSupplier.of(createSupplier()));
+ this.reload = e -> reload();
}
private Supplier<DataSourceEditor> createSupplier() {
@@ -92,24 +95,15 @@ public class DataSourceEditorBodyContent extends MainUIBodyContent<DataSourceEdi
editorMenu.getUiModel().init();
navigationMenu.getUiModel().init();
-
- getClientUIContext().getBusyModel().addPropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, evt -> reload());
+ mainUI.getBusyModel().addPropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, reload);
ShowDataSourcePresetsAction.init(mainUI, mainUI.getShowDataSourcePresets(), ShowDataSourcePresetsAction.class);
}
-// @Override
-// public void uninstall(ObserveMainUI mainUI) {
-// super.uninstall(mainUI);
-// if (dataSource != null && dataSource.isOpen()) {
-// log.info("Closing main data source..");
-// try {
-// dataSource.close();
-// } finally {
-// setDataSource(null);
-// getObserveDataSourcesManager().setMainDataSource(null);
-// }
-// }
-// }
+ @Override
+ public void uninstall(ObserveMainUI mainUI) {
+ super.uninstall(mainUI);
+ mainUI.getBusyModel().removePropertyChangeListener(BusyModel.BUSY_PROPERTY_NAME, reload);
+ }
@Override
public void show(ObserveMainUI mainUI) {
=====================================
pom.xml
=====================================
@@ -24,7 +24,7 @@
<parent>
<groupId>io.ultreia.maven</groupId>
<artifactId>pom</artifactId>
- <version>2020.32</version>
+ <version>2020.33</version>
</parent>
<groupId>fr.ird.observe</groupId>
@@ -170,7 +170,7 @@
<!-- <lib.version.java4all.topia>1.17</lib.version.java4all.topia>-->
<!--<lib.version.java4all.eugene>3.0<-alpha-22</lib.version.java4all.eugene>-->
-<!-- <lib.version.java4all.jaxx>3.0-alpha-67-SNAPSHOT</lib.version.java4all.jaxx>-->
+<!-- <lib.version.java4all.jaxx>3.0-alpha-70-SNAPSHOT</lib.version.java4all.jaxx>-->
<!--<lib.version.java4all.application-context>1.0.3-SNAPSHOT</lib.version.java4all.application-context>-->
<!--<lib.version.java4all.application-template>1.0.2-SNAPSHOT</lib.version.java4all.application-template>-->
<!--<lib.version.java4all.i18n>4.0-beta-3-SNAPSHOT</lib.version.java4all.i18n>-->
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c71281ce7807243daeaa7d9e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/c71281ce7807243daeaa7d9e…
You're receiving this email because of your account on gitlab.com.
1
0