Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 36e4a668 by Tony Chemit at 2024-12-11T17:56:46+01:00 Amélioration possible sur l'UI PS / Logbook / Echantillon / minus10weight et plus10weight - Closes #2954 - - - - - 93f16ff2 by Tony Chemit at 2024-12-11T18:01:50+01:00 Libellés sur l'UI consolidation - Closes #2957 - - - - - 5 changed files: - client/datasource/editor/ps/src/main/i18n/getters/java.getter - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUI.jaxx - client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIHandler.java - + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/SampleUIResetWeights.java - client/runner/src/main/i18n/translations/client-runner_fr_FR.properties Changes: ===================================== client/datasource/editor/ps/src/main/i18n/getters/java.getter ===================================== @@ -1,3 +1,4 @@ +bean.action.reset.tip boolean.true observe.Common.action.move.down.tip observe.Common.action.move.up.tip ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUI.jaxx ===================================== @@ -114,6 +114,9 @@ <cell anchor='west'> <JLabel id='smallsWeightLabel'/> </cell> + <cell> + <JPanel/> + </cell> <cell anchor='east' weightx="1" fill="both"> <NumberEditor id='smallsWeight' styleClass="float2"/> </cell> @@ -126,6 +129,11 @@ <cell anchor='west'> <JLabel id='bigsWeightLabel'/> </cell> + <cell> + <JToolBar> + <JButton id='resetWeights'/> + </JToolBar> + </cell> <cell anchor='east' weightx="1" fill="both"> <NumberEditor id='bigsWeight' styleClass="float2"/> </cell> @@ -140,6 +148,9 @@ <cell anchor='west'> <JLabel id='totalWeightLabel'/> </cell> + <cell> + <JPanel/> + </cell> <cell anchor='east' weightx="1" fill="both"> <NumberEditor id='totalWeight' styleClass="float2"/> </cell> ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/SampleUIHandler.java ===================================== @@ -58,6 +58,9 @@ public class SampleUIHandler extends GeneratedSampleUIHandler { public void onInit(SampleUI ui) { super.onInit(ui); ui.getSampleActivityTableModel().init(ui); + ui.getTotalWeight().setShowReset(false); + ui.getSmallsWeight().setShowReset(false); + ui.getBigsWeight().setShowReset(false); } @Override ===================================== client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/actions/SampleUIResetWeights.java ===================================== @@ -0,0 +1,55 @@ +package fr.ird.observe.client.datasource.editor.ps.data.logbook.actions; + +/*- + * #%L + * ObServe Client :: DataSource :: Editor :: PS + * %% + * Copyright (C) 2008 - 2024 IRD, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.client.datasource.editor.api.content.data.open.actions.ContentOpenableUIActionSupport; +import fr.ird.observe.client.datasource.editor.ps.data.logbook.SampleUI; +import fr.ird.observe.client.util.UIHelper; +import fr.ird.observe.dto.data.ps.logbook.SampleDto; + +import java.awt.event.ActionEvent; + +import static io.ultreia.java4all.i18n.I18n.n; + +/** + * To reset the three weights values on {@link SampleDto}. + * <p> + * Created at 11/12/2024. + * + * @author Tony Chemit - dev@tchemit.fr + * @since 9.4.0 + * @see <a href="https://gitlab.com/ultreiaio/ird-observe/-/issues/2957">issue 2957</a> + */ +public class SampleUIResetWeights extends ContentOpenableUIActionSupport<SampleDto, SampleUI> { + + public SampleUIResetWeights() { + super(SampleDto.class, null, n("bean.action.reset.tip"), "combobox-reset", null); + } + + @Override + protected final void doActionPerformed(ActionEvent e, SampleUI ui) { + ui.getModel().getStates().getBean().setTotalWeight(null); + ui.getModel().getStates().getBean().setSmallsWeight(null); + ui.getModel().getStates().getBean().setBigsWeight(null); + } +} ===================================== client/runner/src/main/i18n/translations/client-runner_fr_FR.properties ===================================== @@ -39,8 +39,8 @@ observe.config.client.logFiles.timeout.description=Nettoyage des fichiers de log observe.config.client.temporaryFiles.timeout.description=Nettoyage des fichiers temporaires (en heures) observe.config.consolidation.failIfLengthLengthParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-taille n'est pas trouvée, sinon consigner cela en avertissement de l'action observe.config.consolidation.failIfLengthWeightParameterNotFound=Dans l'action de consolidation, déclencher une erreur si une relation taille-poids n'est pas trouvée, sinon consigner cela en avertissement de l'action -observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight=Liste des espèces à utiliser dans l'action de consolidation du champs Poids pondéré des échantillons calée (Senne / Livre de bord) -observe.config.consolidation.speciesListForLogbookSampleWeights=Liste des espèces à utiliser dans l'action de consolidation des champs Poids des échantillons (Senne / Livre de bord) +observe.config.consolidation.speciesListForLogbookSampleActivityWeightedWeight=Liste des espèces pour le calcul des poids pondérés des échantillons calée (Senne / Livre de bord) +observe.config.consolidation.speciesListForLogbookSampleWeights=Liste des espèces pour la sommation des poids des cuves échantillonnées (Senne / Livre de bord) observe.config.coordinate.format=Format des positions (DMD, DD, DMS) observe.config.db.locale=La langue du référentiel (fr_FR, en_GB ou es_ES) observe.config.dcpPresetsDirectory.description=Répertoire des pré-configurations de DCP View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/07f534f1c21ac8f2865063ebd... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/07f534f1c21ac8f2865063ebd... You're receiving this email because of your account on gitlab.com.