Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: 142bd673 by Tony CHEMIT at 2018-07-05T10:22:21Z [LL] Racourcis clavier non fonctionnents sur les onglets de définition de la composition globale de la palangre - Closes #1016 - - - - - d8c1cbdc by Tony CHEMIT at 2018-07-05T10:22:23Z [LL] Schéma de palangre -> libellé missing - Closes #1017 - - - - - a9eb27ec by Tony CHEMIT at 2018-07-05T10:22:23Z [LL] Schéma de palangre -> libellé doublonné - Closes #1018 - - - - - 58da702e by Tony CHEMIT at 2018-07-05T10:22:23Z [LL] Capture -> Déprédation -> rajout de l'unité du diamètre morsure - Closes #1019 - - - - - b944e488 by Tony CHEMIT at 2018-07-05T10:25:05Z fix a selectable object material without a boolean type... (See #948) - - - - - 16 changed files: - client/src/main/java/fr/ird/observe/client/ui/actions/UIActionSupport.java - client/src/main/java/fr/ird/observe/client/ui/actions/content/AbstractContentUIAction.java - client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java - client/src/main/java/fr/ird/observe/client/ui/actions/main/global/DeleteDataGlobalUIAction.java - client/src/main/java/fr/ird/observe/client/ui/actions/main/global/NewNextDataGlobalUIAction.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java - client/src/main/resources/i18n/client_en_GB.properties - client/src/main/resources/i18n/client_es_ES.properties - client/src/main/resources/i18n/client_fr_FR.properties - dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java - dto/src/main/resources/i18n/dto_en_GB.properties - dto/src/main/resources/i18n/dto_es_ES.properties - dto/src/main/resources/i18n/dto_fr_FR.properties - persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql Changes: ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/UIActionSupport.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/actions/UIActionSupport.java +++ b/client/src/main/java/fr/ird/observe/client/ui/actions/UIActionSupport.java @@ -37,7 +37,9 @@ import javax.swing.ActionMap; import javax.swing.Icon; import javax.swing.InputMap; import javax.swing.JComponent; +import javax.swing.JTabbedPane; import javax.swing.KeyStroke; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; @@ -183,4 +185,18 @@ public abstract class UIActionSupport extends AbstractAction { return ObserveSwingDataSource.MAIN; } + protected ContentUI<?, ?> getContentUI(ContentUI<?, ?> contentUI) { + if (contentUI.getObjectById("delegateContentUI") != null) { + Component selectedComponent = ((JTabbedPane) contentUI.getObjectById("mainTabbedPane")).getSelectedComponent(); + if (selectedComponent instanceof JComponent) { + JComponent selectedComponent1 = (JComponent) selectedComponent; + Object contentUI1 = selectedComponent1.getClientProperty("contentUI"); + if (contentUI1 instanceof ContentUI) { + return (ContentUI<?, ?>) contentUI1; + } + return null; + } + } + return contentUI; + } } ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/content/AbstractContentUIAction.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/actions/content/AbstractContentUIAction.java +++ b/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; * 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>. @@ -58,7 +58,20 @@ public abstract class AbstractContentUIAction extends UIActionSupport { } this.e = e; - ContentUI<?, ?> contentUI = getContentUI(e); + ContentUI<?, ?> contentUI = null; + if (getEditor() != null) { + Object ui = getEditor().getClientProperty("ui"); + if (ui instanceof ContentUI) { + contentUI = (ContentUI<?, ?>) ui; + } + } + if (contentUI == null) { + contentUI = getContentUI(e); + ContentUI<?, ?> contentUI1 = getContentUI(contentUI); + if (contentUI1 != null) { + contentUI = contentUI1; + } + } actionPerformed(contentUI); } ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java +++ b/client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java @@ -58,4 +58,9 @@ public abstract class GoToTabUIActionSupport extends AbstractContentUIAction { } mainTabbedPane.setSelectedIndex(tabIndex); } + + @Override + protected ContentUI<?, ?> getContentUI(ContentUI<?, ?> contentUI) { + return contentUI; + } } ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/main/global/DeleteDataGlobalUIAction.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/actions/main/global/DeleteDataGlobalUIAction.java +++ b/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; * 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>. @@ -66,19 +66,7 @@ public class DeleteDataGlobalUIAction extends GlobalUIActionSupport { } } } else { - if (contentUI instanceof ContentTableUI) { - ContentTableUI ui = (ContentTableUI) contentUI; - button = ui.getDeleteEntry(); - } else if (contentUI instanceof ContentReferenceUI) { - ContentReferenceUI ui = (ContentReferenceUI) contentUI; - if (ui.getModel().isEditing()) { - button = ui.getDeleteFromDetail(); - } else { - button = ui.getDeleteFromList(); - } - } else { - button = (JButton) contentUI.getObjectById("delete"); - } + button = getActionButton(contentUI); } Objects.requireNonNull(button); UIActionSupport action = (UIActionSupport) button.getAction(); @@ -87,4 +75,23 @@ public class DeleteDataGlobalUIAction extends GlobalUIActionSupport { return action; } + protected JButton getActionButton(ContentUI<?, ?> contentUI) { + ContentUI<?, ?> contentUI2 = getContentUI(contentUI); + if (!Objects.equals(contentUI, contentUI2)) { + return getActionButton(contentUI2); + } + if (contentUI instanceof ContentTableUI) { + ContentTableUI ui = (ContentTableUI) contentUI; + return ui.getDeleteEntry(); + } + if (contentUI instanceof ContentReferenceUI) { + ContentReferenceUI ui = (ContentReferenceUI) contentUI; + if (ui.getModel().isEditing()) { + return ui.getDeleteFromDetail(); + } + return ui.getDeleteFromList(); + } + return (JButton) contentUI.getObjectById("delete"); + } + } ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/main/global/NewNextDataGlobalUIAction.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/actions/main/global/NewNextDataGlobalUIAction.java +++ b/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; * 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>. @@ -34,6 +34,10 @@ import fr.ird.observe.client.ui.content.table.ContentTableUI; import fr.ird.observe.client.ui.storage.presets.RemotePresetsUI; import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JTabbedPane; +import java.awt.Component; +import java.util.Objects; /** * Created on 11/11/16. @@ -59,22 +63,32 @@ public class NewNextDataGlobalUIAction extends GlobalUIActionSupport { button = presetsUI.getCreateAction(); } } else { - - if (contentUI instanceof ContentListUI) { - ContentListUI ui = (ContentListUI) contentUI; - button = ui.getCreate(); - } else if (contentUI instanceof ContentOpenableUI) { - ContentOpenableUI ui = (ContentOpenableUI) contentUI; - button = ui.getCloseAndCreate(); - } else if (contentUI instanceof ContentTableUI) { - ContentTableUI ui = (ContentTableUI) contentUI; - button = ui.getNewEntry(); - } else if (contentUI instanceof ContentReferenceUI) { - ContentReferenceUI ui = (ContentReferenceUI) contentUI; - button = ui.getCreate(); - } + button = getActionButton(contentUI); } return button == null ? null : (UIActionSupport) button.getAction(); } + + + protected JButton getActionButton(ContentUI<?, ?> contentUI) { + ContentUI<?, ?> contentUI2 = getContentUI(contentUI); + if (!Objects.equals(contentUI,contentUI2)) { + return getActionButton(contentUI2); + } + if (contentUI instanceof ContentListUI) { + ContentListUI ui = (ContentListUI) contentUI; + return ui.getCreate(); + } else if (contentUI instanceof ContentOpenableUI) { + ContentOpenableUI ui = (ContentOpenableUI) contentUI; + return ui.getCloseAndCreate(); + } else if (contentUI instanceof ContentTableUI) { + ContentTableUI ui = (ContentTableUI) contentUI; + return ui.getNewEntry(); + } else if (contentUI instanceof ContentReferenceUI) { + ContentReferenceUI ui = (ContentReferenceUI) contentUI; + return ui.getCreate(); + } + return null; + } + } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUI.jaxx ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUI.jaxx +++ b/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); } <cell anchor='east'> <JCheckBox id='timer' styleClass="i18n"/> </cell> - <cell> - <JLabel id='timeSinceContactLabel'/> - </cell> - <cell> + <cell columns="2"> <TimeEditor id='timeSinceContact' constructorParams='this'/> </cell> </row> <!-- timerTimeOnBoard --> <row> - <cell columns="3"> + <cell/> + <cell columns="2"> <DateTimeEditor id='timerTimeOnBoard' constructorParams='this'/> </cell> </row> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUI.jaxx ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUI.jaxx +++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUI.jaxx @@ -66,6 +66,8 @@ errorTableModel='{getErrorTableModel()}' context='update-globalComposition'> </BeanValidator> + <Boolean id="delegateContentUI" initializer="true"/> + <!-- formulaire --> <JPanel id="body" layout='{new BorderLayout()}'> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java ===================================== --- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java +++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java @@ -95,6 +95,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong FloatlinesCompositionUI compositionUI = ui.getFloatlinesCompositionUI(); ui.getFloatlinesCompositionPanel().remove(compositionUI); ui.getFloatlinesCompositionPanel().add(compositionUI.getBody()); + ui.getFloatlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -102,6 +103,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong BranchlinesCompositionUI compositionUI = ui.getBranchlinesCompositionUI(); ui.getBranchlinesCompositionPanel().remove(compositionUI); ui.getBranchlinesCompositionPanel().add(compositionUI.getBody()); + ui.getBranchlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -109,6 +111,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong HooksCompositionUI compositionUI = ui.getHooksCompositionUI(); ui.getHooksCompositionPanel().remove(compositionUI); ui.getHooksCompositionPanel().add(compositionUI.getBody()); + ui.getHooksCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -116,6 +119,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong BaitsCompositionUI compositionUI = ui.getBaitsCompositionUI(); ui.getBaitsCompositionPanel().remove(compositionUI); ui.getBaitsCompositionPanel().add(compositionUI.getBody()); + ui.getBaitsCompositionPanel().putClientProperty("contentUI", compositionUI); } } ===================================== client/src/main/resources/i18n/client_en_GB.properties ===================================== --- a/client/src/main/resources/i18n/client_en_GB.properties +++ b/client/src/main/resources/i18n/client_en_GB.properties @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=New catch observe.common.CatchLonglineDto.action.new.tip=Create a new catch observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Reset photo references observe.common.CatchLonglineDto.availablePredator=Avaiable predators -observe.common.CatchLonglineDto.beatDiameter=Beat diameter +observe.common.CatchLonglineDto.beatDiameter=Beat diameter (cm) observe.common.CatchLonglineDto.branchlineTab=Branchline observe.common.CatchLonglineDto.caracteristicTab=Caracteristics observe.common.CatchLonglineDto.depredated=Depredated ===================================== client/src/main/resources/i18n/client_es_ES.properties ===================================== --- a/client/src/main/resources/i18n/client_es_ES.properties +++ b/client/src/main/resources/i18n/client_es_ES.properties @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=Nueva captura observe.common.CatchLonglineDto.action.new.tip=Crear una nueva captura observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Reiniciar las referencias photo observe.common.CatchLonglineDto.availablePredator=Deprepadaores disponibles -observe.common.CatchLonglineDto.beatDiameter=Diametro de la mordedura +observe.common.CatchLonglineDto.beatDiameter=Diametro de la mordedura (cm) observe.common.CatchLonglineDto.branchlineTab=Arponcillo observe.common.CatchLonglineDto.caracteristicTab=Características observe.common.CatchLonglineDto.depredated=Victima de depredación ===================================== client/src/main/resources/i18n/client_fr_FR.properties ===================================== --- a/client/src/main/resources/i18n/client_fr_FR.properties +++ b/client/src/main/resources/i18n/client_fr_FR.properties @@ -447,7 +447,7 @@ observe.common.CatchLonglineDto.action.new=Nouvelle capture observe.common.CatchLonglineDto.action.new.tip=Créer une nouvelle capture observe.common.CatchLonglineDto.action.reset.photoReferences.tip=Réinitialiser les références photo observe.common.CatchLonglineDto.availablePredator=Prédateurs disponibles -observe.common.CatchLonglineDto.beatDiameter=Diamètre de la morsure +observe.common.CatchLonglineDto.beatDiameter=Diamètre de la morsure (cm) observe.common.CatchLonglineDto.branchlineTab=Avançon observe.common.CatchLonglineDto.caracteristicTab=Caractéristiques observe.common.CatchLonglineDto.depredated=Victime de déprédation ===================================== dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java ===================================== --- a/dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java +++ b/dto/src/main/java/fr/ird/observe/dto/decoration/ObserveI18nLabelsBuilder.java @@ -46,6 +46,7 @@ public class ObserveI18nLabelsBuilder extends I18nLabelsBuilder { static { n("observe.common.I18nReferentialDto.label"); + n("observe.common.SetLonglineGlobalCompositionDto.type"); } private static final ObserveI18nLabelsBuilder INSTANCE = new ObserveI18nLabelsBuilder(null); ===================================== dto/src/main/resources/i18n/dto_en_GB.properties ===================================== --- a/dto/src/main/resources/i18n/dto_en_GB.properties +++ b/dto/src/main/resources/i18n/dto_en_GB.properties @@ -163,6 +163,7 @@ observe.common.SetLonglineDto.title=Fishing operation observe.common.SetLonglineDto.type=Set observe.common.SetLonglineDto.types=Sets observe.common.SetLonglineGlobalCompositionDto.title=Global composition +observe.common.SetLonglineGlobalCompositionDto.type=Global composition observe.common.SetSeineDto.title=Set observe.common.SetSeineDto.type=Set observe.common.SetSeineDto.types=Sets ===================================== dto/src/main/resources/i18n/dto_es_ES.properties ===================================== --- a/dto/src/main/resources/i18n/dto_es_ES.properties +++ b/dto/src/main/resources/i18n/dto_es_ES.properties @@ -161,6 +161,7 @@ observe.common.SetLonglineDto.title=Operación de pesca observe.common.SetLonglineDto.type=Operación de pesca observe.common.SetLonglineDto.types=Operaciones de pesca observe.common.SetLonglineGlobalCompositionDto.title=Composición global del palangre +observe.common.SetLonglineGlobalCompositionDto.type=Composición global del palangre observe.common.SetSeineDto.title=Lance observe.common.SetSeineDto.type=Lance observe.common.SetSeineDto.types=Lances ===================================== dto/src/main/resources/i18n/dto_fr_FR.properties ===================================== --- a/dto/src/main/resources/i18n/dto_fr_FR.properties +++ b/dto/src/main/resources/i18n/dto_fr_FR.properties @@ -163,6 +163,7 @@ observe.common.SetLonglineDto.title=Opération de pêche observe.common.SetLonglineDto.type=Opération de pêche observe.common.SetLonglineDto.types=Opérations de pêche observe.common.SetLonglineGlobalCompositionDto.title=Composition globale de la palangre +observe.common.SetLonglineGlobalCompositionDto.type=Composition globale de la palangre observe.common.SetSeineDto.title=Calée observe.common.SetSeineDto.type=Calée observe.common.SetSeineDto.types=Calées ===================================== persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql ===================================== --- a/persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql +++ b/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 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'; -UPDATE observe_seine.objectmaterial SET selectable = TRUE , childrenmultiselectable = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.25'; +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'; 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); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/571944a5a0de4e9a97ef024bc12... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/571944a5a0de4e9a97ef024bc12... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT