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

Commits:

4 changed files:

Changes:

  • client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jaxx
    ... ... @@ -120,17 +120,27 @@
    120 120
             <JTabbedPane id='mainTabbedPane'>
    
    121 121
               <tab id='caracteristicTab' i18nProperty="">
    
    122 122
                 <Table id='editForm' fill='both' insets='1'>
    
    123
    -
    
    124 123
                   <row>
    
    125
    -                <cell columns="2">
    
    126
    -                  <!-- acquisition Mode -->
    
    124
    +                <cell columns="2" rows="2">
    
    127 125
                       <JPanel id='acquisitionMode'>
    
    128 126
                         <JRadioButton id='acquisitionModeIndividual'/>
    
    129 127
                         <JRadioButton id='acquisitionModeGrouped'/>
    
    130 128
                       </JPanel>
    
    131 129
                     </cell>
    
    132
    -                <cell columns="2" rows="2">
    
    133
    -                  <!-- location on longline -->
    
    130
    +                <cell>
    
    131
    +                  <JLabel id='numberLabel'/>
    
    132
    +                </cell>
    
    133
    +                <cell weightx='1' anchor='east'>
    
    134
    +                  <NumberEditor id='number' styleClass="int6"/>
    
    135
    +                </cell>
    
    136
    +              </row>
    
    137
    +              <row>
    
    138
    +                <cell>
    
    139
    +                  <JPanel/>
    
    140
    +                </cell>
    
    141
    +              </row>
    
    142
    +              <row>
    
    143
    +                <cell columns="2" rows="4">
    
    134 144
                       <Table id="locationOnLonglinePanel">
    
    135 145
                         <row>
    
    136 146
                           <cell anchor="west">
    
    ... ... @@ -158,9 +168,6 @@
    158 168
                         </row>
    
    159 169
                       </Table>
    
    160 170
                     </cell>
    
    161
    -              </row>
    
    162
    -              <!-- species -->
    
    163
    -              <row>
    
    164 171
                     <cell>
    
    165 172
                       <JLabel id='speciesLabel'/>
    
    166 173
                     </cell>
    
    ... ... @@ -168,16 +175,7 @@
    168 175
                       <FilterableComboBox id='species' genericType='SpeciesReference'/>
    
    169 176
                     </cell>
    
    170 177
                   </row>
    
    171
    -
    
    172
    -              <!-- tagNumber -->
    
    173
    -              <!-- count -->
    
    174 178
                   <row>
    
    175
    -                <cell anchor='west'>
    
    176
    -                  <JLabel id='tagNumberLabel'/>
    
    177
    -                </cell>
    
    178
    -                <cell anchor='east' weightx="1" fill="both">
    
    179
    -                  <NormalTextEditor id='tagNumber'/>
    
    180
    -                </cell>
    
    181 179
                     <cell>
    
    182 180
                       <JLabel id='countLabel'/>
    
    183 181
                     </cell>
    
    ... ... @@ -185,22 +183,6 @@
    185 183
                       <NumberEditor id='count' styleClass="int6"/>
    
    186 184
                     </cell>
    
    187 185
                   </row>
    
    188
    -
    
    189
    -              <!-- number -->
    
    190
    -              <row>
    
    191
    -                <cell>
    
    192
    -                  <JLabel id='numberLabel'/>
    
    193
    -                </cell>
    
    194
    -                <cell weightx='1' anchor='east'>
    
    195
    -                  <NumberEditor id='number' styleClass="int6"/>
    
    196
    -                </cell>
    
    197
    -                <cell columns="2">
    
    198
    -                  <JPanel/>
    
    199
    -                </cell>
    
    200
    -              </row>
    
    201
    -
    
    202
    -              <!-- total weight -->
    
    203
    -              <!-- weightMeasureMethod -->
    
    204 186
                   <row>
    
    205 187
                     <cell>
    
    206 188
                       <JLabel id='totalWeightLabel'/>
    
    ... ... @@ -208,6 +190,8 @@
    208 190
                     <cell weightx='1' anchor='east'>
    
    209 191
                       <NumberEditor id='totalWeight' styleClass="float3"/>
    
    210 192
                     </cell>
    
    193
    +              </row>
    
    194
    +              <row>
    
    211 195
                     <cell>
    
    212 196
                       <JLabel id='weightMeasureMethodLabel'/>
    
    213 197
                     </cell>
    
    ... ... @@ -215,9 +199,6 @@
    215 199
                       <FilterableComboBox id='weightMeasureMethod' genericType='WeightMeasureMethodReference'/>
    
    216 200
                     </cell>
    
    217 201
                   </row>
    
    218
    -
    
    219
    -              <!-- catch healthStatus -->
    
    220
    -              <!-- hook position -->
    
    221 202
                   <row>
    
    222 203
                     <cell>
    
    223 204
                       <JLabel id='catchHealthStatusLabel'/>
    
    ... ... @@ -225,16 +206,7 @@
    225 206
                     <cell weightx='1' anchor='east'>
    
    226 207
                       <FilterableComboBox id='catchHealthStatus' genericType='HealthStatusReference'/>
    
    227 208
                     </cell>
    
    228
    -                <cell>
    
    229
    -                  <JLabel id='hookPositionLabel'/>
    
    230
    -                </cell>
    
    231
    -                <cell weightx='1' anchor='east'>
    
    232
    -                  <FilterableComboBox id='hookPosition' genericType='HookPositionReference'/>
    
    233
    -                </cell>
    
    234 209
                   </row>
    
    235
    -
    
    236
    -              <!-- catch fate -->
    
    237
    -              <!-- discard healthStatus -->
    
    238 210
                   <row>
    
    239 211
                     <cell>
    
    240 212
                       <JLabel id='catchFateLabel'/>
    
    ... ... @@ -249,24 +221,44 @@
    249 221
                       <FilterableComboBox id='discardHealthStatus' genericType='HealthStatusReference'/>
    
    250 222
                     </cell>
    
    251 223
                   </row>
    
    252
    -
    
    253
    -              <!-- hookWhenDiscarded -->
    
    254
    -              <!-- photoReferences -->
    
    255 224
                   <row>
    
    225
    +                <cell>
    
    226
    +                  <JLabel id='hookPositionLabel'/>
    
    227
    +                </cell>
    
    228
    +                <cell weightx='1' anchor='east'>
    
    229
    +                  <FilterableComboBox id='hookPosition' genericType='HookPositionReference'/>
    
    230
    +                </cell>
    
    256 231
                     <cell anchor="west">
    
    257 232
                       <JLabel id='hookWhenDiscardedLabel'/>
    
    258 233
                     </cell>
    
    259 234
                     <cell anchor='west' fill="both">
    
    260 235
                       <BooleanEditor id='hookWhenDiscarded'/>
    
    261 236
                     </cell>
    
    237
    +              </row>
    
    238
    +              <row>
    
    262 239
                     <cell anchor='west'>
    
    263 240
                       <JLabel id='photoReferencesLabel'/>
    
    264 241
                     </cell>
    
    265 242
                     <cell anchor='east' weightx="1" fill="both">
    
    266 243
                       <NormalTextEditor id='photoReferences'/>
    
    267 244
                     </cell>
    
    245
    +                <cell columns="2"/>
    
    246
    +                <!--                <cell anchor='west'>-->
    
    247
    +                <!--                  <JLabel id='sampleReferencesLabel'/>-->
    
    248
    +                <!--                </cell>-->
    
    249
    +                <!--                <cell anchor='east' weightx="1" fill="both">-->
    
    250
    +                <!--                  <NormalTextEditor id='sampleReferences'/>-->
    
    251
    +                <!--                </cell>-->
    
    268 252
                   </row>
    
    253
    +              <row>
    
    254
    +                <cell anchor='west'>
    
    255
    +                  <JLabel id='tagNumberLabel'/>
    
    256
    +                </cell>
    
    257
    +                <cell anchor='east' weightx="1" fill="both">
    
    258
    +                  <NormalTextEditor id='tagNumber'/>
    
    259
    +                </cell>
    
    269 260
     
    
    261
    +              </row>
    
    270 262
                 </Table>
    
    271 263
               </tab>
    
    272 264
     
    

  • client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/observation/SetCatchUI.jcss
    ... ... @@ -26,7 +26,7 @@
    26 26
     }
    
    27 27
     
    
    28 28
     #mainTabbedPane {
    
    29
    -  _focusComponent:{newComponentArray(acquisitionModeIndividual,depredated,beatDiameter)};
    
    29
    +  _focusComponent:{newComponentArray(number,depredated,beatDiameter)};
    
    30 30
     }
    
    31 31
     
    
    32 32
     /* ***************************************************************************** */
    

  • 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;
    43 43
     import org.nuiton.jaxx.validator.swing.SwingValidator;
    
    44 44
     
    
    45 45
     import javax.swing.AbstractAction;
    
    46
    -import javax.swing.JComponent;
    
    47 46
     import javax.swing.JToolBar;
    
    48 47
     import java.awt.Component;
    
    49 48
     import java.awt.event.ActionEvent;
    
    ... ... @@ -74,19 +73,20 @@ public class SetCatchUIHandler extends GeneratedSetCatchUIHandler {
    74 73
     
    
    75 74
         @Override
    
    76 75
         protected Component getFocusComponentOnSelectedRow(SetCatchUI ui, boolean notPersisted, boolean newRow, CatchDto tableEditBean, CatchDto previousRowBean) {
    
    77
    -        JComponent requestFocus;
    
    78
    -        if (newRow) {
    
    79
    -            requestFocus = ui.getSpecies();
    
    80
    -        } else {
    
    81
    -            int acquisitionMode = tableEditBean.getAcquisitionMode();
    
    82
    -            CatchAcquisitionMode acquisitionModeEnum = CatchAcquisitionMode.valueOf(acquisitionMode);
    
    83
    -            if (acquisitionModeEnum.equals(CatchAcquisitionMode.GROUPED)) {
    
    84
    -                requestFocus = ui.getCount();
    
    85
    -            } else {
    
    86
    -                requestFocus = ui.getCatchHealthStatus();
    
    87
    -            }
    
    88
    -        }
    
    89
    -        return requestFocus;
    
    76
    +        //FIXME Review this on Focus clean session
    
    77
    +//        JComponent requestFocus;
    
    78
    +//        if (newRow) {
    
    79
    +//            requestFocus = ui.getNumber();
    
    80
    +//        } else {
    
    81
    +//            int acquisitionMode = tableEditBean.getAcquisitionMode();
    
    82
    +//            CatchAcquisitionMode acquisitionModeEnum = CatchAcquisitionMode.valueOf(acquisitionMode);
    
    83
    +//            if (acquisitionModeEnum.equals(CatchAcquisitionMode.GROUPED)) {
    
    84
    +//                requestFocus = ui.getCount();
    
    85
    +//            } else {
    
    86
    +//                requestFocus = ui.getCatchHealthStatus();
    
    87
    +//            }
    
    88
    +//        }
    
    89
    +        return ui.getNumber();
    
    90 90
         }
    
    91 91
     
    
    92 92
         @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;
    23 23
      */
    
    24 24
     
    
    25 25
     import fr.ird.observe.client.util.table.EditableListProperty;
    
    26
    +import fr.ird.observe.client.util.table.renderer.DecoratorTableRenderer;
    
    26 27
     import fr.ird.observe.dto.data.CatchAcquisitionMode;
    
    27 28
     import fr.ird.observe.dto.data.ll.observation.CatchDto;
    
    28 29
     import fr.ird.observe.dto.data.ll.observation.SizeMeasureDto;
    
    ... ... @@ -30,6 +31,8 @@ import fr.ird.observe.dto.data.ll.observation.WeightMeasureDto;
    30 31
     import org.apache.logging.log4j.LogManager;
    
    31 32
     import org.apache.logging.log4j.Logger;
    
    32 33
     
    
    34
    +import javax.swing.JTable;
    
    35
    +import javax.swing.table.TableColumnModel;
    
    33 36
     import java.util.Collection;
    
    34 37
     import java.util.List;
    
    35 38
     
    
    ... ... @@ -79,6 +82,15 @@ public class SetCatchUITableModel extends GeneratedSetCatchUITableModel {
    79 82
             return weightMeasuresTableModel;
    
    80 83
         }
    
    81 84
     
    
    85
    +    @Override
    
    86
    +    public void initTableUISize(JTable table) {
    
    87
    +        super.initTableUISize(table);
    
    88
    +        TableColumnModel columnModel = table.getColumnModel();
    
    89
    +        ((DecoratorTableRenderer) columnModel.getColumn(2).getCellRenderer()).getDecorator().setIndex(1);
    
    90
    +        ((DecoratorTableRenderer) columnModel.getColumn(3).getCellRenderer()).getDecorator().setIndex(1);
    
    91
    +        ((DecoratorTableRenderer) columnModel.getColumn(4).getCellRenderer()).getDecorator().setIndex(1);
    
    92
    +    }
    
    93
    +
    
    82 94
         @Override
    
    83 95
         protected void onBeforeResetRow(int row) {
    
    84 96
             super.onBeforeResetRow(row);