Tony CHEMIT pushed to branch develop-9.3.x at ultreiaio / ird-observe Commits: 85ff10fc by Tony Chemit at 2024-09-16T12:56:28+02:00 Fix decorator in table for location on branchline - - - - - 9f04456c by Tony Chemit at 2024-09-16T12:56:28+02:00 New design of form - - - - - c65391b4 by Tony Chemit at 2024-09-16T12:56:28+02:00 Fix focus owner to number (but should review this in Focus session) - - - - - fc3aa33c by Tony Chemit at 2024-09-16T14:50:25+02:00 Merge branch 'feature/issue-2907' into develop-9.3.x LL observations/captures : réorganisation du formulaire - Closes #2907 - - - - - 4 changed files: - 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 Changes: ===================================== client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jaxx ===================================== @@ -120,17 +120,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="4"> <Table id="locationOnLonglinePanel"> <row> <cell anchor="west"> @@ -158,9 +168,6 @@ </row> </Table> </cell> - </row> - <!-- species --> - <row> <cell> <JLabel id='speciesLabel'/> </cell> @@ -168,16 +175,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> @@ -185,22 +183,6 @@ <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 columns="2"> - <JPanel/> - </cell> - </row> - - <!-- total weight --> - <!-- weightMeasureMethod --> <row> <cell> <JLabel id='totalWeightLabel'/> @@ -208,6 +190,8 @@ <cell weightx='1' anchor='east'> <NumberEditor id='totalWeight' styleClass="float3"/> </cell> + </row> + <row> <cell> <JLabel id='weightMeasureMethodLabel'/> </cell> @@ -215,9 +199,6 @@ <FilterableComboBox id='weightMeasureMethod' genericType='WeightMeasureMethodReference'/> </cell> </row> - - <!-- catch healthStatus --> - <!-- hook position --> <row> <cell> <JLabel id='catchHealthStatusLabel'/> @@ -225,16 +206,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'/> @@ -249,24 +221,44 @@ <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 columns="2"/> + <!-- <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); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/220b55238ac7122e929939373... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/220b55238ac7122e929939373... You're receiving this email because of your account on gitlab.com.