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

Commits:

16 changed files:

Changes:

  • client/src/main/java/fr/ird/observe/client/ui/actions/UIActionSupport.java
    ... ... @@ -37,7 +37,9 @@ import javax.swing.ActionMap;
    37 37
     import javax.swing.Icon;
    
    38 38
     import javax.swing.InputMap;
    
    39 39
     import javax.swing.JComponent;
    
    40
    +import javax.swing.JTabbedPane;
    
    40 41
     import javax.swing.KeyStroke;
    
    42
    +import java.awt.Component;
    
    41 43
     import java.awt.event.ActionEvent;
    
    42 44
     import java.awt.event.InputEvent;
    
    43 45
     
    
    ... ... @@ -183,4 +185,18 @@ public abstract class UIActionSupport extends AbstractAction {
    183 185
             return ObserveSwingDataSource.MAIN;
    
    184 186
         }
    
    185 187
     
    
    188
    +    protected ContentUI<?, ?> getContentUI(ContentUI<?, ?> contentUI) {
    
    189
    +        if (contentUI.getObjectById("delegateContentUI") != null) {
    
    190
    +            Component selectedComponent = ((JTabbedPane) contentUI.getObjectById("mainTabbedPane")).getSelectedComponent();
    
    191
    +            if (selectedComponent instanceof JComponent) {
    
    192
    +                JComponent selectedComponent1 = (JComponent) selectedComponent;
    
    193
    +                Object contentUI1 = selectedComponent1.getClientProperty("contentUI");
    
    194
    +                if (contentUI1 instanceof ContentUI) {
    
    195
    +                    return (ContentUI<?, ?>) contentUI1;
    
    196
    +                }
    
    197
    +                return null;
    
    198
    +            }
    
    199
    +        }
    
    200
    +        return contentUI;
    
    201
    +    }
    
    186 202
     }

  • client/src/main/java/fr/ird/observe/client/ui/actions/content/AbstractContentUIAction.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.actions.content;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -58,7 +58,20 @@ public abstract class AbstractContentUIAction extends UIActionSupport {
    58 58
             }
    
    59 59
             this.e = e;
    
    60 60
     
    
    61
    -        ContentUI<?, ?> contentUI = getContentUI(e);
    
    61
    +        ContentUI<?, ?> contentUI = null;
    
    62
    +        if (getEditor() != null) {
    
    63
    +            Object ui = getEditor().getClientProperty("ui");
    
    64
    +            if (ui instanceof ContentUI) {
    
    65
    +                contentUI = (ContentUI<?, ?>) ui;
    
    66
    +            }
    
    67
    +        }
    
    68
    +        if (contentUI == null) {
    
    69
    +            contentUI = getContentUI(e);
    
    70
    +            ContentUI<?, ?> contentUI1 = getContentUI(contentUI);
    
    71
    +            if (contentUI1 != null) {
    
    72
    +                contentUI = contentUI1;
    
    73
    +            }
    
    74
    +        }
    
    62 75
             actionPerformed(contentUI);
    
    63 76
         }
    
    64 77
     
    

  • client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java
    ... ... @@ -58,4 +58,9 @@ public abstract class GoToTabUIActionSupport extends AbstractContentUIAction {
    58 58
             }
    
    59 59
             mainTabbedPane.setSelectedIndex(tabIndex);
    
    60 60
         }
    
    61
    +
    
    62
    +    @Override
    
    63
    +    protected ContentUI<?, ?> getContentUI(ContentUI<?, ?> contentUI) {
    
    64
    +        return contentUI;
    
    65
    +    }
    
    61 66
     }

  • client/src/main/java/fr/ird/observe/client/ui/actions/main/global/DeleteDataGlobalUIAction.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.actions.main.global;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -66,19 +66,7 @@ public class DeleteDataGlobalUIAction extends GlobalUIActionSupport {
    66 66
                     }
    
    67 67
                 }
    
    68 68
             } else {
    
    69
    -            if (contentUI instanceof ContentTableUI) {
    
    70
    -                ContentTableUI ui = (ContentTableUI) contentUI;
    
    71
    -                button = ui.getDeleteEntry();
    
    72
    -            } else if (contentUI instanceof ContentReferenceUI) {
    
    73
    -                ContentReferenceUI ui = (ContentReferenceUI) contentUI;
    
    74
    -                if (ui.getModel().isEditing()) {
    
    75
    -                    button = ui.getDeleteFromDetail();
    
    76
    -                } else {
    
    77
    -                    button = ui.getDeleteFromList();
    
    78
    -                }
    
    79
    -            } else {
    
    80
    -                button = (JButton) contentUI.getObjectById("delete");
    
    81
    -            }
    
    69
    +            button = getActionButton(contentUI);
    
    82 70
             }
    
    83 71
             Objects.requireNonNull(button);
    
    84 72
             UIActionSupport action = (UIActionSupport) button.getAction();
    
    ... ... @@ -87,4 +75,23 @@ public class DeleteDataGlobalUIAction extends GlobalUIActionSupport {
    87 75
             return action;
    
    88 76
         }
    
    89 77
     
    
    78
    +    protected JButton getActionButton(ContentUI<?, ?> contentUI) {
    
    79
    +        ContentUI<?, ?> contentUI2 = getContentUI(contentUI);
    
    80
    +        if (!Objects.equals(contentUI, contentUI2)) {
    
    81
    +            return getActionButton(contentUI2);
    
    82
    +        }
    
    83
    +        if (contentUI instanceof ContentTableUI) {
    
    84
    +            ContentTableUI ui = (ContentTableUI) contentUI;
    
    85
    +            return ui.getDeleteEntry();
    
    86
    +        }
    
    87
    +        if (contentUI instanceof ContentReferenceUI) {
    
    88
    +            ContentReferenceUI ui = (ContentReferenceUI) contentUI;
    
    89
    +            if (ui.getModel().isEditing()) {
    
    90
    +                return ui.getDeleteFromDetail();
    
    91
    +            }
    
    92
    +            return ui.getDeleteFromList();
    
    93
    +        }
    
    94
    +        return (JButton) contentUI.getObjectById("delete");
    
    95
    +    }
    
    96
    +
    
    90 97
     }

  • client/src/main/java/fr/ird/observe/client/ui/actions/main/global/NewNextDataGlobalUIAction.java
    ... ... @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.actions.main.global;
    10 10
      * it under the terms of the GNU General Public License as
    
    11 11
      * published by the Free Software Foundation, either version 3 of the
    
    12 12
      * License, or (at your option) any later version.
    
    13
    - * 
    
    13
    + *
    
    14 14
      * This program is distributed in the hope that it will be useful,
    
    15 15
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16 16
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17 17
      * GNU General Public License for more details.
    
    18
    - * 
    
    18
    + *
    
    19 19
      * You should have received a copy of the GNU General Public
    
    20 20
      * License along with this program.  If not, see
    
    21 21
      * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    ... ... @@ -34,6 +34,10 @@ import fr.ird.observe.client.ui.content.table.ContentTableUI;
    34 34
     import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI;
    
    35 35
     
    
    36 36
     import javax.swing.JButton;
    
    37
    +import javax.swing.JComponent;
    
    38
    +import javax.swing.JTabbedPane;
    
    39
    +import java.awt.Component;
    
    40
    +import java.util.Objects;
    
    37 41
     
    
    38 42
     /**
    
    39 43
      * Created on 11/11/16.
    
    ... ... @@ -59,22 +63,32 @@ public class NewNextDataGlobalUIAction extends GlobalUIActionSupport {
    59 63
                     button = presetsUI.getCreateAction();
    
    60 64
                 }
    
    61 65
             } else {
    
    62
    -
    
    63
    -            if (contentUI instanceof ContentListUI) {
    
    64
    -                ContentListUI ui = (ContentListUI) contentUI;
    
    65
    -                button = ui.getCreate();
    
    66
    -            } else if (contentUI instanceof ContentOpenableUI) {
    
    67
    -                ContentOpenableUI ui = (ContentOpenableUI) contentUI;
    
    68
    -                button = ui.getCloseAndCreate();
    
    69
    -            } else if (contentUI instanceof ContentTableUI) {
    
    70
    -                ContentTableUI ui = (ContentTableUI) contentUI;
    
    71
    -                button = ui.getNewEntry();
    
    72
    -            } else if (contentUI instanceof ContentReferenceUI) {
    
    73
    -                ContentReferenceUI ui = (ContentReferenceUI) contentUI;
    
    74
    -                button = ui.getCreate();
    
    75
    -            }
    
    66
    +            button = getActionButton(contentUI);
    
    76 67
             }
    
    77 68
             return button == null ? null : (UIActionSupport) button.getAction();
    
    78 69
         }
    
    79 70
     
    
    71
    +
    
    72
    +
    
    73
    +    protected JButton getActionButton(ContentUI<?, ?> contentUI) {
    
    74
    +        ContentUI<?, ?> contentUI2 = getContentUI(contentUI);
    
    75
    +        if (!Objects.equals(contentUI,contentUI2)) {
    
    76
    +            return getActionButton(contentUI2);
    
    77
    +        }
    
    78
    +        if (contentUI instanceof ContentListUI) {
    
    79
    +            ContentListUI ui = (ContentListUI) contentUI;
    
    80
    +            return ui.getCreate();
    
    81
    +        } else if (contentUI instanceof ContentOpenableUI) {
    
    82
    +            ContentOpenableUI ui = (ContentOpenableUI) contentUI;
    
    83
    +            return ui.getCloseAndCreate();
    
    84
    +        } else if (contentUI instanceof ContentTableUI) {
    
    85
    +            ContentTableUI ui = (ContentTableUI) contentUI;
    
    86
    +            return ui.getNewEntry();
    
    87
    +        } else if (contentUI instanceof ContentReferenceUI) {
    
    88
    +            ContentReferenceUI ui = (ContentReferenceUI) contentUI;
    
    89
    +            return ui.getCreate();
    
    90
    +        }
    
    91
    +        return null;
    
    92
    +    }
    
    93
    +
    
    80 94
     }

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUI.jaxx
    ... ... @@ -119,17 +119,15 @@ public void edit(BranchlineDto branchline) { getHandler().edit(branchline); }
    119 119
                         <cell anchor='east'>
    
    120 120
                           <JCheckBox id='timer' styleClass="i18n"/>
    
    121 121
                         </cell>
    
    122
    -                    <cell>
    
    123
    -                      <JLabel id='timeSinceContactLabel'/>
    
    124
    -                    </cell>
    
    125
    -                    <cell>
    
    122
    +                    <cell columns="2">
    
    126 123
                           <TimeEditor id='timeSinceContact' constructorParams='this'/>
    
    127 124
                         </cell>
    
    128 125
                       </row>
    
    129 126
     
    
    130 127
                       <!-- timerTimeOnBoard -->
    
    131 128
                       <row>
    
    132
    -                    <cell columns="3">
    
    129
    +                    <cell/>
    
    130
    +                    <cell columns="2">
    
    133 131
                           <DateTimeEditor id='timerTimeOnBoard' constructorParams='this'/>
    
    134 132
                         </cell>
    
    135 133
                       </row>
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUI.jaxx
    ... ... @@ -66,6 +66,8 @@
    66 66
                      errorTableModel='{getErrorTableModel()}' context='update-globalComposition'>
    
    67 67
       </BeanValidator>
    
    68 68
     
    
    69
    +  <Boolean id="delegateContentUI" initializer="true"/>
    
    70
    +
    
    69 71
       <!-- formulaire -->
    
    70 72
       <JPanel id="body" layout='{new BorderLayout()}'>
    
    71 73
     
    

  • client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java
    ... ... @@ -95,6 +95,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
    95 95
                 FloatlinesCompositionUI compositionUI = ui.getFloatlinesCompositionUI();
    
    96 96
                 ui.getFloatlinesCompositionPanel().remove(compositionUI);
    
    97 97
                 ui.getFloatlinesCompositionPanel().add(compositionUI.getBody());
    
    98
    +            ui.getFloatlinesCompositionPanel().putClientProperty("contentUI", compositionUI);
    
    98 99
             }
    
    99 100
     
    
    100 101
             {
    
    ... ... @@ -102,6 +103,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
    102 103
                 BranchlinesCompositionUI compositionUI = ui.getBranchlinesCompositionUI();
    
    103 104
                 ui.getBranchlinesCompositionPanel().remove(compositionUI);
    
    104 105
                 ui.getBranchlinesCompositionPanel().add(compositionUI.getBody());
    
    106
    +            ui.getBranchlinesCompositionPanel().putClientProperty("contentUI", compositionUI);
    
    105 107
             }
    
    106 108
     
    
    107 109
             {
    
    ... ... @@ -109,6 +111,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
    109 111
                 HooksCompositionUI compositionUI = ui.getHooksCompositionUI();
    
    110 112
                 ui.getHooksCompositionPanel().remove(compositionUI);
    
    111 113
                 ui.getHooksCompositionPanel().add(compositionUI.getBody());
    
    114
    +            ui.getHooksCompositionPanel().putClientProperty("contentUI", compositionUI);
    
    112 115
             }
    
    113 116
     
    
    114 117
             {
    
    ... ... @@ -116,6 +119,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
    116 119
                 BaitsCompositionUI compositionUI = ui.getBaitsCompositionUI();
    
    117 120
                 ui.getBaitsCompositionPanel().remove(compositionUI);
    
    118 121
                 ui.getBaitsCompositionPanel().add(compositionUI.getBody());
    
    122
    +            ui.getBaitsCompositionPanel().putClientProperty("contentUI", compositionUI);
    
    119 123
             }
    
    120 124
         }
    
    121 125
     
    

  • client/src/main/resources/i18n/client_en_GB.properties
    ... ... @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=New catch
    447 447
     observe.common.CatchLonglineDto.action.new.tip=Create a new catch
    
    448 448
     observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Reset photo references
    
    449 449
     observe.common.CatchLonglineDto.availablePredator=Avaiable predators
    
    450
    -observe.common.CatchLonglineDto.beatDiameter=Beat diameter
    
    450
    +observe.common.CatchLonglineDto.beatDiameter=Beat diameter (cm)
    
    451 451
     observe.common.CatchLonglineDto.branchlineTab=Branchline
    
    452 452
     observe.common.CatchLonglineDto.caracteristicTab=Caracteristics
    
    453 453
     observe.common.CatchLonglineDto.depredated=Depredated
    

  • client/src/main/resources/i18n/client_es_ES.properties
    ... ... @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=Nueva captura
    447 447
     observe.common.CatchLonglineDto.action.new.tip=Crear una nueva captura
    
    448 448
     observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Reiniciar las referencias photo
    
    449 449
     observe.common.CatchLonglineDto.availablePredator=Deprepadaores disponibles
    
    450
    -observe.common.CatchLonglineDto.beatDiameter=Diametro de la mordedura
    
    450
    +observe.common.CatchLonglineDto.beatDiameter=Diametro de la mordedura (cm)
    
    451 451
     observe.common.CatchLonglineDto.branchlineTab=Arponcillo
    
    452 452
     observe.common.CatchLonglineDto.caracteristicTab=Características
    
    453 453
     observe.common.CatchLonglineDto.depredated=Victima de depredación
    

  • client/src/main/resources/i18n/client_fr_FR.properties
    ... ... @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=Nouvelle capture
    447 447
     observe.common.CatchLonglineDto.action.new.tip=Créer une nouvelle capture
    
    448 448
     observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Réinitialiser les références photo
    
    449 449
     observe.common.CatchLonglineDto.availablePredator=Prédateurs disponibles
    
    450
    -observe.common.CatchLonglineDto.beatDiameter=Diamètre de la morsure
    
    450
    +observe.common.CatchLonglineDto.beatDiameter=Diamètre de la morsure (cm)
    
    451 451
     observe.common.CatchLonglineDto.branchlineTab=Avançon
    
    452 452
     observe.common.CatchLonglineDto.caracteristicTab=Caractéristiques
    
    453 453
     observe.common.CatchLonglineDto.depredated=Victime de déprédation
    

  • dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java
    No preview for this file type
  • dto/src/main/resources/i18n/dto_en_GB.properties
    ... ... @@ -163,6 +163,7 @@ observe.common.SetLonglineDto.title=Fishing operation
    163 163
     observe.common.SetLonglineDto.type=Set
    
    164 164
     observe.common.SetLonglineDto.types=Sets
    
    165 165
     observe.common.SetLonglineGlobalCompositionDto.title=Global composition
    
    166
    +observe.common.SetLonglineGlobalCompositionDto.type=Global composition
    
    166 167
     observe.common.SetSeineDto.title=Set
    
    167 168
     observe.common.SetSeineDto.type=Set
    
    168 169
     observe.common.SetSeineDto.types=Sets
    

  • dto/src/main/resources/i18n/dto_es_ES.properties
    ... ... @@ -161,6 +161,7 @@ observe.common.SetLonglineDto.title=Operación de pesca
    161 161
     observe.common.SetLonglineDto.type=Operación de pesca
    
    162 162
     observe.common.SetLonglineDto.types=Operaciones de pesca
    
    163 163
     observe.common.SetLonglineGlobalCompositionDto.title=Composición global del palangre
    
    164
    +observe.common.SetLonglineGlobalCompositionDto.type=Composición global del palangre
    
    164 165
     observe.common.SetSeineDto.title=Lance
    
    165 166
     observe.common.SetSeineDto.type=Lance
    
    166 167
     observe.common.SetSeineDto.types=Lances
    

  • dto/src/main/resources/i18n/dto_fr_FR.properties
    ... ... @@ -163,6 +163,7 @@ observe.common.SetLonglineDto.title=Opération de pêche
    163 163
     observe.common.SetLonglineDto.type=Opération de pêche
    
    164 164
     observe.common.SetLonglineDto.types=Opérations de pêche
    
    165 165
     observe.common.SetLonglineGlobalCompositionDto.title=Composition globale de la palangre
    
    166
    +observe.common.SetLonglineGlobalCompositionDto.type=Composition globale de la palangre
    
    166 167
     observe.common.SetSeineDto.title=Calée
    
    167 168
     observe.common.SetSeineDto.type=Calée
    
    168 169
     observe.common.SetSeineDto.types=Calées
    

  • persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
    ... ... @@ -33,6 +33,6 @@ UPDATE observe_seine.objectmaterial SET childrenmultiselectable = FALSE , childs
    33 33
     
    
    34 34
     UPDATE observe_seine.objectmaterial SET objectmaterialtype ='fr.ird.observe.entities.referentiel.seine.ObjectMaterialType#0#0', selectable = TRUE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.4';
    
    35 35
     
    
    36
    -UPDATE observe_seine.objectmaterial SET selectable = TRUE , childrenmultiselectable = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.25';
    
    36
    +UPDATE observe_seine.objectmaterial SET objectmaterialtype ='fr.ird.observe.entities.referentiel.seine.ObjectMaterialType#0#0', selectable = TRUE , childrenmultiselectable = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.25';
    
    37 37
     
    
    38 38
     INSERT INTO observe_seine.objectMaterial (topiaid, topiaversion, topiacreatedate, lastupdatedate, needComment, status, legacyCode, standardCode, code, parent, label1, label2, label3, selectable, childrenMultiSelectable, childSelectionMandatory, objectMaterialType, validation, biodegradable, nonEntangling) values ('fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.87', 0, CURRENT_DATE, CURRENT_TIMESTAMP, false,  1, NULL, '', '1-1-1-1-3' , 'fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.6' , 'Not visible', 'Non visible', 'No se ve', true, false, false, 'fr.ird.observe.entities.referentiel.seine.ObjectMaterialType#0#0', NULL, false, false);