Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 7e076c37 by Tony Chemit at 2024-09-16T15:49:38+02:00 Fix i18n (See #2932) - - - - - e4ab5b5e by Tony Chemit at 2024-09-16T15:49:50+02:00 Fix decorator in table for location on branchline - - - - - 343c5492 by Tony Chemit at 2024-09-16T15:49:50+02:00 New design of form - - - - - 07a9323c by Tony Chemit at 2024-09-16T15:49:50+02:00 Fix focus owner to number (but should review this in Focus session) - - - - - 2eaac5ff by Tony Chemit at 2024-09-16T15:50:04+02:00 Merge branch 'feature/issue-2907' into develop [report 9.4.0] LL observations/captures : réorganisation du formulaire - Closes #2907 - - - - - 8 changed files: - client/datasource/editor/ll/src/main/i18n/getters/jaxx.getter - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jaxx - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jcss - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUIHandler.java - client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUITableModel.java - core/services/i18n/src/main/i18n/translations/services_en_GB.properties - core/services/i18n/src/main/i18n/translations/services_es_ES.properties - core/services/i18n/src/main/i18n/translations/services_fr_FR.properties Changes: ===================================== client/datasource/editor/ll/src/main/i18n/getters/jaxx.getter ===================================== @@ -94,6 +94,7 @@ observe.Common.processingCompany observe.Common.proportion observe.Common.proportionSum observe.Common.relatedObservedActivity +observe.Common.sampleReferences observe.Common.seaSurfaceTemperature observe.Common.section observe.Common.sensorBrand ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jaxx ===================================== @@ -123,17 +123,27 @@ <JTabbedPane id='mainTabbedPane'> <tab id='caracteristicTab' i18nProperty=""> <Table id='editForm' fill='both' insets='1'> - <row> - <cell columns="2"> - <!-- acquisition Mode --> + <cell columns="2" rows="2"> <JPanel id='acquisitionMode'> <JRadioButton id='acquisitionModeIndividual'/> <JRadioButton id='acquisitionModeGrouped'/> </JPanel> </cell> - <cell columns="2" rows="2"> - <!-- location on longline --> + <cell> + <JLabel id='numberLabel'/> + </cell> + <cell weightx='1' anchor='east'> + <NumberEditor id='number' styleClass="int6"/> + </cell> + </row> + <row> + <cell> + <JPanel/> + </cell> + </row> + <row> + <cell columns="2" rows="5"> <Table id="locationOnLonglinePanel"> <row> <cell anchor="west"> @@ -161,9 +171,6 @@ </row> </Table> </cell> - </row> - <!-- species --> - <row> <cell> <JLabel id='speciesLabel'/> </cell> @@ -171,16 +178,7 @@ <FilterableComboBox id='species' genericType='SpeciesReference'/> </cell> </row> - - <!-- tagNumber --> - <!-- count --> <row> - <cell anchor='west'> - <JLabel id='tagNumberLabel'/> - </cell> - <cell anchor='east' weightx="1" fill="both"> - <NormalTextEditor id='tagNumber'/> - </cell> <cell> <JLabel id='countLabel'/> </cell> @@ -188,15 +186,7 @@ <NumberEditor id='count' styleClass="int6"/> </cell> </row> - - <!-- number --> <row> - <cell> - <JLabel id='numberLabel'/> - </cell> - <cell weightx='1' anchor='east'> - <NumberEditor id='number' styleClass="int6"/> - </cell> <cell> <JLabel id='weightMeasureTypeLabel'/> </cell> @@ -204,9 +194,6 @@ <FilterableComboBox id='weightMeasureType' genericType='WeightMeasureTypeReference'/> </cell> </row> - - <!-- total weight --> - <!-- weightMeasureMethod --> <row> <cell> <JLabel id='totalWeightLabel'/> @@ -214,6 +201,8 @@ <cell weightx='1' anchor='east'> <NumberEditor id='totalWeight' styleClass="float3"/> </cell> + </row> + <row> <cell> <JLabel id='weightMeasureMethodLabel'/> </cell> @@ -221,9 +210,6 @@ <FilterableComboBox id='weightMeasureMethod' genericType='WeightMeasureMethodReference'/> </cell> </row> - - <!-- catch healthStatus --> - <!-- hook position --> <row> <cell> <JLabel id='catchHealthStatusLabel'/> @@ -231,16 +217,7 @@ <cell weightx='1' anchor='east'> <FilterableComboBox id='catchHealthStatus' genericType='HealthStatusReference'/> </cell> - <cell> - <JLabel id='hookPositionLabel'/> - </cell> - <cell weightx='1' anchor='east'> - <FilterableComboBox id='hookPosition' genericType='HookPositionReference'/> - </cell> </row> - - <!-- catch fate --> - <!-- discard healthStatus --> <row> <cell> <JLabel id='catchFateLabel'/> @@ -255,24 +232,43 @@ <FilterableComboBox id='discardHealthStatus' genericType='HealthStatusReference'/> </cell> </row> - - <!-- hookWhenDiscarded --> - <!-- photoReferences --> <row> + <cell> + <JLabel id='hookPositionLabel'/> + </cell> + <cell weightx='1' anchor='east'> + <FilterableComboBox id='hookPosition' genericType='HookPositionReference'/> + </cell> <cell anchor="west"> <JLabel id='hookWhenDiscardedLabel'/> </cell> <cell anchor='west' fill="both"> <BooleanEditor id='hookWhenDiscarded'/> </cell> + </row> + <row> <cell anchor='west'> <JLabel id='photoReferencesLabel'/> </cell> <cell anchor='east' weightx="1" fill="both"> <NormalTextEditor id='photoReferences'/> </cell> + <cell anchor='west'> + <JLabel id='sampleReferencesLabel'/> + </cell> + <cell anchor='east' weightx="1" fill="both"> + <NormalTextEditor id='sampleReferences'/> + </cell> </row> + <row> + <cell anchor='west'> + <JLabel id='tagNumberLabel'/> + </cell> + <cell anchor='east' weightx="1" fill="both"> + <NormalTextEditor id='tagNumber'/> + </cell> + </row> </Table> </tab> ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jcss ===================================== @@ -26,7 +26,7 @@ } #mainTabbedPane { - _focusComponent:{newComponentArray(acquisitionModeIndividual,depredated,beatDiameter)}; + _focusComponent:{newComponentArray(number,depredated,beatDiameter)}; } /* ***************************************************************************** */ ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUIHandler.java ===================================== @@ -43,7 +43,6 @@ import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.validator.swing.SwingValidator; import javax.swing.AbstractAction; -import javax.swing.JComponent; import javax.swing.JToolBar; import java.awt.Component; import java.awt.event.ActionEvent; @@ -74,19 +73,20 @@ public class SetCatchUIHandler extends GeneratedSetCatchUIHandler { @Override protected Component getFocusComponentOnSelectedRow(SetCatchUI ui, boolean notPersisted, boolean newRow, CatchDto tableEditBean, CatchDto previousRowBean) { - JComponent requestFocus; - if (newRow) { - requestFocus = ui.getSpecies(); - } else { - int acquisitionMode = tableEditBean.getAcquisitionMode(); - CatchAcquisitionMode acquisitionModeEnum = CatchAcquisitionMode.valueOf(acquisitionMode); - if (acquisitionModeEnum.equals(CatchAcquisitionMode.GROUPED)) { - requestFocus = ui.getCount(); - } else { - requestFocus = ui.getCatchHealthStatus(); - } - } - return requestFocus; + //FIXME Review this on Focus clean session +// JComponent requestFocus; +// if (newRow) { +// requestFocus = ui.getNumber(); +// } else { +// int acquisitionMode = tableEditBean.getAcquisitionMode(); +// CatchAcquisitionMode acquisitionModeEnum = CatchAcquisitionMode.valueOf(acquisitionMode); +// if (acquisitionModeEnum.equals(CatchAcquisitionMode.GROUPED)) { +// requestFocus = ui.getCount(); +// } else { +// requestFocus = ui.getCatchHealthStatus(); +// } +// } + return ui.getNumber(); } @Override ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUITableModel.java ===================================== @@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.ll.data.observation; */ import fr.ird.observe.client.util.table.EditableListProperty; +import fr.ird.observe.client.util.table.renderer.DecoratorTableRenderer; import fr.ird.observe.dto.data.CatchAcquisitionMode; import fr.ird.observe.dto.data.ll.observation.CatchDto; import fr.ird.observe.dto.data.ll.observation.SizeMeasureDto; @@ -30,6 +31,8 @@ import fr.ird.observe.dto.data.ll.observation.WeightMeasureDto; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import javax.swing.JTable; +import javax.swing.table.TableColumnModel; import java.util.Collection; import java.util.List; @@ -79,6 +82,15 @@ public class SetCatchUITableModel extends GeneratedSetCatchUITableModel { return weightMeasuresTableModel; } + @Override + public void initTableUISize(JTable table) { + super.initTableUISize(table); + TableColumnModel columnModel = table.getColumnModel(); + ((DecoratorTableRenderer) columnModel.getColumn(2).getCellRenderer()).getDecorator().setIndex(1); + ((DecoratorTableRenderer) columnModel.getColumn(3).getCellRenderer()).getDecorator().setIndex(1); + ((DecoratorTableRenderer) columnModel.getColumn(4).getCellRenderer()).getDecorator().setIndex(1); + } + @Override protected void onBeforeResetRow(int row) { super.onBeforeResetRow(row); ===================================== core/services/i18n/src/main/i18n/translations/services_en_GB.properties ===================================== @@ -816,7 +816,7 @@ observe.data.ll.observation.Catch.title=Catches observe.data.ll.observation.Catch.totalWeight=Total weight (kg) observe.data.ll.observation.Catch.totalWeight.short=Total weight (kg) observe.data.ll.observation.Catch.type=Catch -observe.data.ll.observation.Catch.weightMeasureType.validation.required=Total weight must be filled in group mode. +observe.data.ll.observation.Catch.weightMeasureType.validation.required=Weight measure type must be filled in group mode if total weight is. observe.data.ll.observation.Catch.weightMeasuresTab=Weights observe.data.ll.observation.Encounter.action.create=Create a new encounter observe.data.ll.observation.Encounter.action.save=Insert this encounter ===================================== core/services/i18n/src/main/i18n/translations/services_es_ES.properties ===================================== @@ -816,7 +816,7 @@ observe.data.ll.observation.Catch.title=Capturas observe.data.ll.observation.Catch.totalWeight=Peso total (kg) observe.data.ll.observation.Catch.totalWeight.short=Peso total (kg) observe.data.ll.observation.Catch.type=Captura -observe.data.ll.observation.Catch.weightMeasureType.validation.required=Total weight must be filled in group mode. \#TODO +observe.data.ll.observation.Catch.weightMeasureType.validation.required=Weight measure type must be filled in group mode if total weight is. \#TODO observe.data.ll.observation.Catch.weightMeasuresTab=Pesos (kg) observe.data.ll.observation.Encounter.action.create=Crear una nueva encuentro observe.data.ll.observation.Encounter.action.save=Insertar este encuentro ===================================== core/services/i18n/src/main/i18n/translations/services_fr_FR.properties ===================================== @@ -816,7 +816,7 @@ observe.data.ll.observation.Catch.title=Captures observe.data.ll.observation.Catch.totalWeight=Poids total (kg) observe.data.ll.observation.Catch.totalWeight.short=Poids total (kg) observe.data.ll.observation.Catch.type=Capture -observe.data.ll.observation.Catch.weightMeasureType.validation.required=Le poids total est obligatoire en mode groupé. +observe.data.ll.observation.Catch.weightMeasureType.validation.required=Le type de pesée est obligatoire en mode groupé si le poids est renseigné. observe.data.ll.observation.Catch.weightMeasuresTab=Poids (kg) observe.data.ll.observation.Encounter.action.create=Nouvelle rencontre observe.data.ll.observation.Encounter.action.save=Insérer cette rencontre View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/af3d5df33176fdf51abafc659... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/af3d5df33176fdf51abafc659... You're receiving this email because of your account on gitlab.com.