Observe-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- 7199 discussions
[Git][ultreiaio/ird-observe][develop-7.x] [LL] Racourcis clavier non fonctionnents sur les onglets de définition de la…
by Tony CHEMIT 05 Jul '18
by Tony CHEMIT 05 Jul '18
05 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
0fba6fec by Tony CHEMIT at 2018-07-05T08:57:48Z
[LL] Racourcis clavier non fonctionnents sur les onglets de définition de la composition globale de la palangre - See #1016
- - - - -
5 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/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/LonglineGlobalCompositionUIHandler.java
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("mainTabbedPane") != 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/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/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);
}
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/0fba6fecc6000bba629c60d071d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/0fba6fecc6000bba629c60d071d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [LL] Opération de pêche -> validation poids émerillon et snap - Closes #1015
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
cfffb21c by Tony CHEMIT at 2018-07-04T14:10:57Z
[LL] Opération de pêche -> validation poids émerillon et snap - Closes #1015
- - - - -
2 changed files:
- validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-create-error-validation.xml
- validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-update-error-validation.xml
Changes:
=====================================
validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-create-error-validation.xml
=====================================
--- a/validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-create-error-validation.xml
+++ b/validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-create-error-validation.xml
@@ -113,9 +113,9 @@
<!-- 0.0 <= swivelWeight <= 0.2 -->
<field-validator type="fieldexpressionwithparams" short-circuit="true">
- <param name="doubleParams">min:0.0|max:0.2</param>
+ <param name="doubleParams">min:0.0|max:0.2001</param>
<param name="expression"><![CDATA[
- swivelWeight == null || (doubles.min <= swivelWeight && swivelWeight <= doubles.max)
+ swivelWeight == null || (doubles.min < swivelWeight && swivelWeight <= doubles.max)
]]>
</param>
<message>
@@ -129,9 +129,9 @@
<!-- 0.0 <= snapWeight <= 0.2 -->
<field-validator type="fieldexpressionwithparams" short-circuit="true">
- <param name="doubleParams">min:0.0|max:0.2</param>
+ <param name="doubleParams">min:0.0|max:0.2001</param>
<param name="expression"><![CDATA[
- snapWeight == null || (doubles.min <= snapWeight && snapWeight <= doubles.max)
+ snapWeight == null || (doubles.min < snapWeight && snapWeight <= doubles.max)
]]>
</param>
<message>
=====================================
validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-update-error-validation.xml
=====================================
--- a/validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-update-error-validation.xml
+++ b/validation/src/main/resources/fr/ird/observe/dto/data/longline/SetLonglineDto-update-error-validation.xml
@@ -147,9 +147,9 @@
<!-- 0.0 <= swivelWeight <= 0.2 -->
<field-validator type="fieldexpressionwithparams" short-circuit="true">
- <param name="doubleParams">min:0.0|max:0.2</param>
+ <param name="doubleParams">min:0.0|max:0.20001</param>
<param name="expression"><![CDATA[
- swivelWeight == null || (doubles.min <= swivelWeight && swivelWeight <= doubles.max)
+ swivelWeight == null || (doubles.min < swivelWeight && swivelWeight <= doubles.max)
]]>
</param>
<message>
@@ -163,9 +163,9 @@
<!-- 0.0 <= snapWeight <= 0.2 -->
<field-validator type="fieldexpressionwithparams" short-circuit="true">
- <param name="doubleParams">min:0.0|max:0.2</param>
+ <param name="doubleParams">min:0.0|max:0.200001</param>
<param name="expression"><![CDATA[
- snapWeight == null || (doubles.min <= snapWeight && snapWeight <= doubles.max)
+ snapWeight == null || (doubles.min < snapWeight && snapWeight <= doubles.max)
]]>
</param>
<message>
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/cfffb21c6aa1d5703918b8cda4e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/cfffb21c6aa1d5703918b8cda4e…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [LL] Opération de pêche -> erreur de validation non remontée sur le libellé de…
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
31fab5bf by Tony CHEMIT at 2018-07-04T14:01:05Z
[LL] Opération de pêche -> erreur de validation non remontée sur le libellé de l'onglet - Closes #1014
- - - - -
1 changed file:
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIModel.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIModel.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIModel.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIModel.java
@@ -49,9 +49,11 @@ public class SetLonglineUIModel extends ContentUIModel<SetLonglineDto> {
SetLonglineDto.PROPERTY_SETTING_START_TIME_STAMP,
SetLonglineDto.PROPERTY_SETTING_START_LATITUDE,
SetLonglineDto.PROPERTY_SETTING_START_LONGITUDE,
+ SetLonglineDto.PROPERTY_SETTING_START_QUADRANT,
SetLonglineDto.PROPERTY_SETTING_END_TIME_STAMP,
SetLonglineDto.PROPERTY_SETTING_END_LATITUDE,
- SetLonglineDto.PROPERTY_SETTING_END_LONGITUDE
+ SetLonglineDto.PROPERTY_SETTING_END_LONGITUDE,
+ SetLonglineDto.PROPERTY_SETTING_END_QUADRANT
).build();
public static final Set<String> SETTING_CARACTERISTICS_TAB_PROPERTIES =
@@ -83,9 +85,11 @@ public class SetLonglineUIModel extends ContentUIModel<SetLonglineDto> {
SetLonglineDto.PROPERTY_HAULING_DIRECTION_SAME_AS_SETTING,
SetLonglineDto.PROPERTY_HAULING_START_LATITUDE,
SetLonglineDto.PROPERTY_HAULING_START_LONGITUDE,
+ SetLonglineDto.PROPERTY_HAULING_START_QUADRANT,
SetLonglineDto.PROPERTY_HAULING_START_TIME_STAMP,
SetLonglineDto.PROPERTY_HAULING_END_LATITUDE,
SetLonglineDto.PROPERTY_HAULING_END_LONGITUDE,
+ SetLonglineDto.PROPERTY_HAULING_END_QUADRANT,
SetLonglineDto.PROPERTY_HAULING_END_TIME_STAMP,
SetLonglineDto.PROPERTY_HAULING_BREAKS
).build();
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/31fab5bf4394e05e8c27e63ae72…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/31fab5bf4394e05e8c27e63ae72…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [From MGr] FOB -> Add 1.1.1.1.3 – non-visible - Closes #1004
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
7b32a3d8 by Tony CHEMIT at 2018-07-04T13:43:32Z
[From MGr] FOB -> Add 1.1.1.1.3 – non-visible - Closes #1004
- - - - -
6 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
- + persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
- test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
- test/src/main/resources/db/7.4/dataForTestLongline.sql.gz
- test/src/main/resources/db/7.4/dataForTestSeine.sql.gz
- test/src/main/resources/db/7.4/referentiel.sql.gz
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
@@ -43,6 +43,7 @@ public class DataSourceMigrationForVersion_7_4 extends MigrationVersionResource
@Override
public void generateSqlScript(MigrationVersionResourceExecutor executor) {
executor.addScript("01", "update_object_operation");
+ executor.addScript("02", "update_object_material");
}
}
=====================================
persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
@@ -0,0 +1,38 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- 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>.
+-- #L%
+---
+
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.1';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.50';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.68';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.77';
+
+UPDATE observe_seine.objectmaterial SET childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.3';
+
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = TRUE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.6';
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = FALSE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.9';
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = FALSE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.16';
+
+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';
+
+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);
=====================================
test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
=====================================
--- a/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
+++ b/test/src/main/java/fr/ird/observe/test/ObserveFixtures.java
@@ -276,7 +276,7 @@ public class ObserveFixtures {
.put("observe_seine.nontargetcatchreleasestatus", 5L)
.put("observe_seine.nontargetcatchreleasingtime", 4L)
.put("observe_seine.objectoperation", 10L)
- .put("observe_seine.objectmaterial", 77L)
+ .put("observe_seine.objectmaterial", 78L)
.put("observe_seine.objectmaterialtype", 4L)
.put("observe_seine.observedsystem", 24L)
.put("observe_seine.reasonfordiscard", 5L)
=====================================
test/src/main/resources/db/7.4/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/7.4/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/7.4/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7b32a3d87b68c002c0984ae11d4…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/7b32a3d87b68c002c0984ae11d4…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [From MGr] FOB -> Add 1.1.1.1.3 – non-visible - Closes #1004
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
73baa2b1 by Tony CHEMIT at 2018-07-04T13:28:51Z
[From MGr] FOB -> Add 1.1.1.1.3 – non-visible - Closes #1004
- - - - -
5 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
- + persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
- test/src/main/resources/db/7.4/dataForTestLongline.sql.gz
- test/src/main/resources/db/7.4/dataForTestSeine.sql.gz
- test/src/main/resources/db/7.4/referentiel.sql.gz
Changes:
=====================================
persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
+++ b/persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
@@ -43,6 +43,7 @@ public class DataSourceMigrationForVersion_7_4 extends MigrationVersionResource
@Override
public void generateSqlScript(MigrationVersionResourceExecutor executor) {
executor.addScript("01", "update_object_operation");
+ executor.addScript("02", "update_object_material");
}
}
=====================================
persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
=====================================
--- /dev/null
+++ b/persistence/src/main/resources/db/migration/7.4/02_update_object_material-common.sql
@@ -0,0 +1,38 @@
+---
+-- #%L
+-- ObServe :: Persistence
+-- %%
+-- Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
+-- %%
+-- This program is free software: you can redistribute it and/or modify
+-- 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>.
+-- #L%
+---
+
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.1';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.50';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.68';
+UPDATE observe_seine.objectmaterial SET selectable = FALSE, childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.77';
+
+UPDATE observe_seine.objectmaterial SET childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.3';
+
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = TRUE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.6';
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = FALSE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.9';
+UPDATE observe_seine.objectmaterial SET childrenmultiselectable = FALSE , childselectionmandatory = FALSE WHERE topiaid='fr.ird.observe.entities.referentiel.seine.ObjectMaterial#0#0.16';
+
+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';
+
+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);
=====================================
test/src/main/resources/db/7.4/dataForTestLongline.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/7.4/dataForTestSeine.sql.gz
=====================================
The diff for this file was not included because it is too large.
=====================================
test/src/main/resources/db/7.4/referentiel.sql.gz
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/73baa2b1f0feb7e856f8e18f28d…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/73baa2b1f0feb7e856f8e18f28d…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [PS] Bycatch : la gomme ne réinitialise pas correctement le type de taille par défaut - Closes #997
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
669db5b4 by Tony CHEMIT at 2018-07-04T09:34:47Z
[PS] Bycatch : la gomme ne réinitialise pas correctement le type de taille par défaut - Closes #997
- - - - -
4 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/NonTargetSampleUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/TargetSampleUIHandler.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUI.jcss
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUI.jcss
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUI.jcss
@@ -86,7 +86,7 @@ JToolBar {
#defaultSizeMeasureType {
actionIcon:combobox-reset2;
toolTipText:"observe.common.Sample.action.resetDefaultSizeMeasureType.tip";
- enabled:{tableEditBean.getSpecies() != null};
+ enabled:{model.getDefaultSizeMeasureType() != null};
}
#length {
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/AbstractSampleUIHandler.java
@@ -22,14 +22,22 @@ package fr.ird.observe.client.ui.content.data.seine;
* #L%
*/
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
import fr.ird.observe.client.db.constants.DataContextType;
import fr.ird.observe.client.ui.content.table.ContentTableUI;
import fr.ird.observe.client.ui.content.table.ContentTableUIHandler;
import fr.ird.observe.dto.IdDto;
+import fr.ird.observe.dto.data.seine.NonTargetLengthDto;
import fr.ird.observe.dto.data.seine.TargetLengthDto;
+import fr.ird.observe.dto.referential.SizeMeasureTypeReference;
import fr.ird.observe.dto.referential.SpeciesReference;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.beans.PropertyChangeListener;
+import java.util.List;
+import java.util.Optional;
/**
* Created on 31/10/16.
@@ -39,6 +47,7 @@ import java.beans.PropertyChangeListener;
*/
public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto, U extends ContentTableUI<E, D, U>> extends ContentTableUIHandler<E, D, U> {
+ protected final Log log = LogFactory.getLog(getClass());
/**
* Ecoute les modifications de la propriété {@link TargetLengthDto#getWeight()},
* et repasser alors le flag {@link TargetLengthDto#isIsWeightComputed()} à
@@ -66,6 +75,8 @@ public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto,
*/
final PropertyChangeListener speciesChanged;
+ ImmutableMap<String, SizeMeasureTypeReference> sizeMeasureTypeReferenceMap;
+
AbstractSampleUIHandler() {
super(DataContextType.SetSeine);
weightChanged = evt -> onWeightChanged((Float) evt.getNewValue());
@@ -82,4 +93,22 @@ public abstract class AbstractSampleUIHandler<E extends IdDto, D extends IdDto,
protected abstract void onWeightChanged(Float newValue);
protected abstract void onLengthChanged(Float newValue);
+
+ void loadSizeMeasureTypes() {
+ List<SizeMeasureTypeReference> sizeMeasureTypeReferences = getModel().getReferentialReferences(NonTargetLengthDto.PROPERTY_SIZE_MEASURE_TYPE);
+ sizeMeasureTypeReferenceMap = Maps.uniqueIndex(sizeMeasureTypeReferences, SizeMeasureTypeReference::getTopiaId);
+ }
+
+ Optional<SizeMeasureTypeReference> getSpeciesDefaultSizeMeasureType(SpeciesReference species) {
+ SizeMeasureTypeReference result = null;
+ if (species != null && species.getSizeMeasureTypeId() != null) {
+ String sizeMeasureId = species.getSizeMeasureTypeId();
+ result = sizeMeasureTypeReferenceMap.get(sizeMeasureId);
+ log.info("Use as default size measure type: " + result);
+ } else {
+ log.info("No default size measure type defined (species is null, or no default size measure definied on it.");
+ }
+ return Optional.ofNullable(result);
+ }
+
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/NonTargetSampleUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/NonTargetSampleUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/NonTargetSampleUIHandler.java
@@ -44,7 +44,8 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.runtime.spi.UIHandler;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import java.util.Collection;
import java.util.LinkedList;
@@ -60,21 +61,14 @@ import static org.nuiton.i18n.I18n.t;
*/
public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetSampleDto, NonTargetLengthDto, NonTargetSampleUI> implements UIHandler<NonTargetSampleUI> {
- /**
- * Logger
- */
- private static final Log log = LogFactory.getLog(NonTargetSampleUIHandler.class);
-
NonTargetSampleUIHandler() {
addReferentialFilter(NonTargetLengthDto.PROPERTY_SPECIES, incomingReferences -> {
ReferentialDtoReferenceSet<SpeciesReference> sampleSpecies = getNonTargetSampleService().getSampleSpecies(getSelectedParentId());
return new LinkedList<>(sampleSpecies.toSet());
-// return ReferentialDtoReferences.filterEnabled(result);
});
addReferentialFilter(NonTargetLengthDto.PROPERTY_SPECIES_FATE, incomingReferences -> {
Collection<SpeciesFateReference> speciesFate = getModel().getForm().getObject().getSpeciesFate();
return new LinkedList<>(speciesFate);
-// return ReferentialDtoReferences.filterEnabled(result);
});
}
@@ -106,7 +100,7 @@ public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetS
// on utilise le code par defaut de l'espèce
Optional<SizeMeasureTypeReference> sizeMeasureType = getSpeciesDefaultSizeMeasureType(species);
- log.debug("Default size measure "+sizeMeasureType.orElse(null));
+ log.debug("Default size measure " + sizeMeasureType.orElse(null));
getUi().getModel().setDefaultSizeMeasureType(sizeMeasureType.orElse(null));
resetDefaultSizeMeasureType();
}
@@ -350,21 +344,11 @@ public class NonTargetSampleUIHandler extends AbstractSampleUIHandler<NonTargetS
// normalement cela est fait quand on fait le setForm (mais ici le setForm est fait trop tôt)
updateUiWithReferenceSetsFromModel();
+ loadSizeMeasureTypes();
NonTargetSampleHelper.copyNonTargetSampleDto(form.getObject(), getBean());
}
- private Optional<SizeMeasureTypeReference> getSpeciesDefaultSizeMeasureType(SpeciesReference species) {
- Optional<SizeMeasureTypeReference> result = Optional.empty();
- if (species != null) {
-
- String sizeMeasureId = species.getSizeMeasureTypeId();
- result = getUi().getSizeMeasureType().getData().stream()
- .filter(s -> s.getId().equals(sizeMeasureId)).findFirst();
- }
- return result;
- }
-
class TablePopupSupport extends AutotSelectRowAndShowPopupActionSupport {
private final NonTargetSampleUI ui;
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/TargetSampleUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/TargetSampleUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/TargetSampleUIHandler.java
@@ -8,12 +8,12 @@
* 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>.
@@ -41,11 +41,10 @@ import fr.ird.observe.dto.referential.SizeMeasureTypeReference;
import fr.ird.observe.dto.referential.SpeciesDto;
import fr.ird.observe.dto.referential.SpeciesReference;
import fr.ird.observe.dto.result.SaveResultDto;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorScope;
-import javax.swing.*;
+import javax.swing.JComponent;
+import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import java.util.List;
import java.util.Optional;
@@ -59,9 +58,6 @@ import static org.nuiton.i18n.I18n.t;
*/
public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, TargetLengthDto, U>> extends AbstractSampleUIHandler<TargetSampleDto, TargetLengthDto, U> {
- /** Logger */
- private static final Log log = LogFactory.getLog(TargetSampleUIHandler.class);
-
/**
* Pour différencier positionner l'invariant de l'écran
* {@link TargetSampleDto#getDiscarded()}.
@@ -83,6 +79,65 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar
});
}
+ /**
+ * Le mode de saisie a été mis à jour.
+ *
+ * @param newMode le nouveau de mode de saisie à utiliser
+ * @since 1.8
+ */
+ static void updateModeSaisie(TargetSampleUI ui, AcquisitionMode newMode) {
+
+ if (newMode == null) {
+
+ // mode null (cela peut arriver avec les bindings)
+ return;
+ }
+ boolean createMode = ui.getTableModel().isCreate();
+
+ TargetLengthDto editBean = ui.getTableEditBean();
+ switch (newMode) {
+
+ case byEffectif:
+
+ // le weight n'est pas modifiable
+ ui.getWeight().setEnabled(false);
+
+ // l'count est modifiable
+ ui.getCount().setEnabled(true);
+
+ if (createMode) {
+
+ // on supprime le weight (si il a été saisie)
+ editBean.setWeight(null);
+ // on supprime aussi l'count (pour forcer la saisie)
+ editBean.setCount(null);
+ }
+ break;
+
+ case byIndividu:
+
+ // le weight est pas modifiable
+ ui.getWeight().setEnabled(true);
+
+ // l'count n'est pas modifiable et est toujours de 1
+ ui.getCount().setEnabled(false);
+
+
+ if (createMode) {
+
+ // on positionne l'count à 1 (seule valeur possible)
+ editBean.setCount(1);
+ }
+ break;
+ }
+
+ if (createMode) {
+
+ // on propage le mode de saisie dans le bean
+ editBean.setAcquisitionMode(newMode.ordinal());
+ }
+ }
+
@Override
public void afterInit(U ui) {
super.afterInit(ui);
@@ -111,7 +166,6 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar
// on utilise le code par defaut de l'espèce
Optional<SizeMeasureTypeReference> sizeMeasureType = getSpeciesDefaultSizeMeasureType(species);
- log.debug("Default size measure "+sizeMeasureType.orElse(null));
((TargetSampleUI) getUi()).getModel().setDefaultSizeMeasureType(sizeMeasureType.orElse(null));
resetDefaultSizeMeasureType();
}
@@ -208,9 +262,8 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar
List<SizeMeasureTypeReference> sizeMeasureTypes = getReferentialReferences(SizeMeasureTypeReference.class);
List<SizeMeasureTypeReference> data = SizeMeasureTypeHelper.filterForSeine(sizeMeasureTypes);
- if (log.isInfoEnabled()) {
- log.info("Using " + data.size() + " size measure type(s).");
- }
+ log.info("Using " + data.size() + " size measure type(s).");
+ loadSizeMeasureTypes();
checkSizeMeasureTypes(data);
((TargetSampleUI) getUi()).getSizeMeasureType().setData(data);
}
@@ -268,78 +321,16 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar
mode = ContentMode.READ;
addMessage(getUi(),
- NuitonValidatorScope.INFO,
- getTypeI18nKey(SetSeineDto.class),
- discarded ?
- t("observe.common.SetSeineDto.message.no.targetCatch") :
- t("observe.common.SetSeineDto.message.no.targetDiscarded")
+ NuitonValidatorScope.INFO,
+ getTypeI18nKey(SetSeineDto.class),
+ discarded ?
+ t("observe.common.SetSeineDto.message.no.targetCatch") :
+ t("observe.common.SetSeineDto.message.no.targetDiscarded")
);
}
return mode;
}
- /**
- * Le mode de saisie a été mis à jour.
- *
- * @param newMode le nouveau de mode de saisie à utiliser
- * @since 1.8
- */
- static void updateModeSaisie(TargetSampleUI ui, AcquisitionMode newMode) {
-
- if (log.isDebugEnabled()) {
- log.debug("Change mode saisie to " + newMode);
- }
- if (newMode == null) {
-
- // mode null (cela peut arriver avec les bindings)
- return;
- }
- boolean createMode = ui.getTableModel().isCreate();
-
- TargetLengthDto editBean = ui.getTableEditBean();
- switch (newMode) {
-
- case byEffectif:
-
- // le weight n'est pas modifiable
- ui.getWeight().setEnabled(false);
-
- // l'count est modifiable
- ui.getCount().setEnabled(true);
-
- if (createMode) {
-
- // on supprime le weight (si il a été saisie)
- editBean.setWeight(null);
- // on supprime aussi l'count (pour forcer la saisie)
- editBean.setCount(null);
- }
- break;
-
- case byIndividu:
-
- // le weight est pas modifiable
- ui.getWeight().setEnabled(true);
-
- // l'count n'est pas modifiable et est toujours de 1
- ui.getCount().setEnabled(false);
-
-
- if (createMode) {
-
- // on positionne l'count à 1 (seule valeur possible)
- editBean.setCount(1);
- }
- break;
- }
-
- if (createMode) {
-
- // on propage le mode de saisie dans le bean
- editBean.setAcquisitionMode(newMode.ordinal());
- }
- }
-
public void resetDefaultSizeMeasureType() {
TargetSampleUI ui = (TargetSampleUI) getUi();
ui.getSizeMeasureType().setSelectedItem(null);
@@ -371,17 +362,6 @@ public class TargetSampleUIHandler<U extends ContentTableUI<TargetSampleDto, Tar
TargetSampleHelper.copyTargetSampleDto(form.getObject(), getBean());
}
- private Optional<SizeMeasureTypeReference> getSpeciesDefaultSizeMeasureType(SpeciesReference species) {
- Optional<SizeMeasureTypeReference> result = Optional.empty();
- if (species != null) {
-
- String sizeMeasureId = species.getSizeMeasureTypeId();
- result = ((TargetSampleUI) getUi()).getSizeMeasureType().getData().stream()
- .filter(s -> s.getId().equals(sizeMeasureId)).findFirst();
- }
- return result;
- }
-
class TablePopupSupport extends AutotSelectRowAndShowPopupActionSupport {
private final TargetSampleUI ui;
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/669db5b468070bb4b1442324a89…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/669db5b468070bb4b1442324a89…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] Création automatique de l'activité de fin de veille non fonctionnelle - See #996
by Tony CHEMIT 04 Jul '18
by Tony CHEMIT 04 Jul '18
04 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
8c54c4c7 by Tony CHEMIT at 2018-07-04T08:24:26Z
Création automatique de l'activité de fin de veille non fonctionnelle - See #996
- - - - -
3 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/RouteUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java
- services/src/main/java/fr/ird/observe/services/validation/validators/ActivityFinDeVeilleExistsDtoValidator.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/RouteUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/RouteUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/RouteUIHandler.java
@@ -46,6 +46,7 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JOptionPane;
import java.util.Date;
+import java.util.Objects;
import static org.nuiton.i18n.I18n.n;
import static org.nuiton.i18n.I18n.t;
@@ -361,13 +362,11 @@ class RouteUIHandler extends ContentOpenableUIHandler<RouteDto, RouteUI> impleme
NavigationTree treeHelper = getNavigationTree();
// on créee l'activity de fin de veille
- NavigationTreeNodeSupport parentNode = treeHelper.getSelectedNode();
- parentNode = treeHelper.getChild(parentNode, ObserveI18nDecoratorHelper.getTypePluralI18nKey(ActivitySeineDto.class));
- if (log.isDebugEnabled()) {
- log.debug("PARENT NODE = " + parentNode);
- }
- treeHelper.addUnsavedNode(parentNode, ActivitySeineDto.class);
-
+ NavigationTreeNodeSupport<?> parentNode = treeHelper.getSelectedNode().findChildByClass(ActivitySeineDto.class);
+ log.debug("PARENT NODE = " + parentNode);
+ treeHelper.addUnsavedNode(Objects.requireNonNull(parentNode), ActivitySeineDto.class);
+ NavigationTreeNodeSupport activityNode = treeHelper.getSelectedNode();
+ Objects.requireNonNull(activityNode);
// on recupère l'écran d'édition
ActivitySeineUI selectedUI = (ActivitySeineUI) ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI();
=====================================
client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java
@@ -98,7 +98,7 @@ public class NavigationTree extends JXTree {
setSelectionModel(new DefaultTreeSelectionModel() {
@Override
public void setSelectionPath(TreePath path) {
- boolean canChange = !Objects.equals(path, getSelectionPath()) && ObserveSwingApplicationContext.get().getContentUIManager().closeSelectedContentUI();
+ boolean canChange = adjusting || (!Objects.equals(path, getSelectionPath()) && ObserveSwingApplicationContext.get().getContentUIManager().closeSelectedContentUI());
if (!canChange) {
// cancel the change of node
return;
@@ -401,6 +401,8 @@ public class NavigationTree extends JXTree {
reloadNode(node, refreshChilds);
}
+ private boolean adjusting;
+
public NavigationTreeNodeSupport addUnsavedNode(NavigationTreeNodeSupport parentNode, Class<?> type) {
// noeud en mode creation
@@ -433,8 +435,13 @@ public class NavigationTree extends JXTree {
// Fix bug (if no child in parent node, it will not expand...)
fireTreeExpanded(new TreePath(result.getPath()));
- // Select new node
- selectNode(result);
+ adjusting=true;
+ try {
+ // Select new node
+ selectNode(result);
+ } finally {
+ adjusting=false;
+ }
return result;
}
=====================================
services/src/main/java/fr/ird/observe/services/validation/validators/ActivityFinDeVeilleExistsDtoValidator.java
=====================================
--- a/services/src/main/java/fr/ird/observe/services/validation/validators/ActivityFinDeVeilleExistsDtoValidator.java
+++ b/services/src/main/java/fr/ird/observe/services/validation/validators/ActivityFinDeVeilleExistsDtoValidator.java
@@ -131,10 +131,10 @@ public class ActivityFinDeVeilleExistsDtoValidator extends FieldValidatorSupport
// on doit vérifier qu'il n'existe pas déjà une autre activité de
// fin de veille
- RouteDto route = (RouteDto) stack.findValue("routeEntity");
+ RouteDto route = (RouteDto) stack.findValue("currentRoute");
if (route == null) {
- log.warn("COULD NOT FIND DATA CONTEXT! [routeEntity]");
+ log.warn("COULD NOT FIND DATA CONTEXT! [currentRoute]");
return;
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/8c54c4c724f32f67f701fd1226f…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/8c54c4c724f32f67f701fd1226f…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [PS] Forçage du focus lors de la création d'une nouvelle actiité - closes #998
by Tony CHEMIT 03 Jul '18
by Tony CHEMIT 03 Jul '18
03 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
9492f99e by Tony CHEMIT at 2018-07-03T17:03:14Z
[PS] Forçage du focus lors de la création d'une nouvelle actiité - closes #998
- - - - -
18 changed files:
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineDetailCompositionUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineGlobalCompositionUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/data/seine/SetSeineUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/GearUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthLengthParameterUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthWeightParameterUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/ProgramUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesGroupUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesListUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIHandler.java
Changes:
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/BranchlineUIHandler.java
@@ -43,6 +43,7 @@ import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.Calendar;
import java.util.Date;
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java
@@ -212,6 +212,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
public void resetBranchline() {
@@ -727,7 +728,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat
if (!newValue && getUi().getMainTabbedPane().getSelectedIndex() > 2) {
// go back to first tab
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java
@@ -188,9 +188,8 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
-
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
-
@Override
public void startEditUI(String... binding) {
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineDetailCompositionUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineDetailCompositionUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/LonglineDetailCompositionUIHandler.java
@@ -58,6 +58,7 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
import javax.swing.event.ChangeListener;
import javax.swing.event.TableModelListener;
import java.beans.PropertyChangeListener;
@@ -428,8 +429,6 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
}
- // Always go back to first tab
- getUi().getMainTabbedPane().setSelectedIndex(0);
} finally {
@@ -441,6 +440,7 @@ public class LonglineDetailCompositionUIHandler extends ContentUIHandler<SetLong
getUi().startEdit(null);
}
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
=====================================
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
@@ -43,6 +43,7 @@ import org.apache.commons.logging.LogFactory;
import org.nuiton.jaxx.runtime.spi.UIHandler;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import java.util.Optional;
import static org.nuiton.i18n.I18n.t;
@@ -208,7 +209,7 @@ public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<SetLong
compositionUI.open();
}
-
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java
@@ -50,6 +50,7 @@ import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditorModel;
import org.nuiton.jaxx.widgets.hidor.HidorButton;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.beans.PropertyChangeListener;
import java.util.HashSet;
@@ -250,6 +251,7 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto, SetLo
getUi().startEdit(null);
}
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java
@@ -53,6 +53,7 @@ import org.nuiton.validator.NuitonValidatorScope;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import java.beans.PropertyChangeListener;
@@ -225,6 +226,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/ActivitySeineUIHandler.java
@@ -238,6 +238,8 @@ class ActivitySeineUIHandler extends ContentOpenableUIHandler<ActivitySeineDto,
// on annule la modification engendree par ce binding
getModel().setModified(create);
+
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/FloatingObjectUIHandler.java
@@ -198,13 +198,11 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto,
getUi().startEdit(null);
}
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
@Override
protected void openedUI() {
- if (getModel().isCreatingMode()) {
- getUi().getMainTabbedPane().setSelectedIndex(0);
- }
SwingUtilities.invokeLater(this::forceGrabFocusOnForm);
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/data/seine/SetSeineUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/SetSeineUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/data/seine/SetSeineUIHandler.java
@@ -49,6 +49,7 @@ import org.nuiton.jaxx.widgets.hidor.HidorButton;
import org.nuiton.util.DateUtil;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.beans.PropertyChangeListener;
import java.util.Date;
@@ -193,8 +194,9 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto, SetSeineUI>
if (mode != ContentMode.READ) {
getUi().startEdit(null);
}
+ super.openUI();
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
-
@Override
public void startEditUI(String... binding) {
ContentUIModel<SetSeineDto> model = getModel();
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/GearUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/GearUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/GearUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -73,7 +74,7 @@ public class GearUIHandler extends ContentReferenceUIHandler<GearDto, GearRefere
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthLengthParameterUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthLengthParameterUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthLengthParameterUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -72,7 +73,7 @@ public class LengthLengthParameterUIHandler extends ContentReferenceUIHandler<Le
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthWeightParameterUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthWeightParameterUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/LengthWeightParameterUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -73,7 +74,7 @@ public class LengthWeightParameterUIHandler extends ContentReferenceUIHandler<Le
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/ProgramUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/ProgramUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/ProgramUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -72,7 +73,7 @@ public class ProgramUIHandler extends ContentReferenceUIHandler<ProgramDto, Prog
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesGroupUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesGroupUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesGroupUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -67,7 +68,7 @@ public class SpeciesGroupUIHandler extends ContentReferenceUIHandler<SpeciesGrou
public void selectBean(SpeciesGroupReference selectedReference) {
super.selectBean(selectedReference);
computeTabValidState(getUi().getErrorTableModel());
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
protected void computeTabValidState(SwingValidatorMessageTableModel errorTableModel) {
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesListUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesListUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesListUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -69,7 +70,7 @@ public class SpeciesListUIHandler extends ContentReferenceUIHandler<SpeciesListD
super.selectBean(selectedBean);
computeTabValidState(getUi().getErrorTableModel());
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/SpeciesUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -73,7 +74,7 @@ public class SpeciesUIHandler extends ContentReferenceUIHandler<SpeciesDto, Spec
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
=====================================
client/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIHandler.java
=====================================
--- a/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIHandler.java
+++ b/client/src/main/java/fr/ird/observe/client/ui/content/ref/common/VesselUIHandler.java
@@ -30,6 +30,7 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessage;
import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel;
import org.nuiton.validator.NuitonValidatorScope;
+import javax.swing.SwingUtilities;
import javax.swing.event.TableModelListener;
import java.util.HashSet;
import java.util.Set;
@@ -71,7 +72,7 @@ public class VesselUIHandler extends ContentReferenceUIHandler<VesselDto, Vessel
SwingValidatorMessageTableModel errorTableModel = getUi().getErrorTableModel();
computeTabValidState(errorTableModel);
- getUi().getMainTabbedPane().setSelectedIndex(0);
+ SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0));
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9492f99e744202f9eb563be296e…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/9492f99e744202f9eb563be296e…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] [From MGr] A l'arrivée / Au départ review - Closes #1002
by Tony CHEMIT 03 Jul '18
by Tony CHEMIT 03 Jul '18
03 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
e600b6b3 by Tony CHEMIT at 2018-07-03T16:20:14Z
[From MGr] A l'arrivée / Au départ review - Closes #1002
- - - - -
6 changed files:
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java
- + persistence/src/main/resources/db/migration/7.4/01_update_object_operation-common.sql
- pom.xml
- + test/src/main/resources/db/7.4/dataForTestLongline.sql.gz
- + test/src/main/resources/db/7.4/dataForTestSeine.sql.gz
- + test/src/main/resources/db/7.4/empty_h2.sql.gz
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/e600b6b35c7a1b2fb3afc50dd12…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/e600b6b35c7a1b2fb3afc50dd12…
You're receiving this email because of your account on gitlab.com.
1
0
[Git][ultreiaio/ird-observe][develop-7.x] Présentation de la liste des références taille-poids - Closes #994
by Tony CHEMIT 03 Jul '18
by Tony CHEMIT 03 Jul '18
03 Jul '18
Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
78d29121 by Tony CHEMIT at 2018-07-03T15:33:24Z
Présentation de la liste des références taille-poids - Closes #994
Présentation de la liste des relations taille-taille - Closes #993
- - - - -
8 changed files:
- dto/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterDtoReferenceBinder.java
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
- dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthLengthParameterDecorator.java
- dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthWeightParameterDecorator.java
- dto/src/main/models/Observe.model
- persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterEntityReferenceBinder.java
- persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterEntityReferenceBinder.java
Changes:
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterDtoReferenceBinder.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterDtoReferenceBinder.java
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterDtoReferenceBinder.java
@@ -53,7 +53,9 @@ public class LengthLengthParameterDtoReferenceBinder extends ReferentialDtoRefer
Optional.ofNullable(dto.getSex()).map(SexReference::getLabel).orElse(null),
dto.getStartDate(),
dto.getEndDate(),
+ Optional.ofNullable(dto.getInputSizeMeasureType()).map(SizeMeasureTypeReference::getCode).orElse(null),
Optional.ofNullable(dto.getInputSizeMeasureType()).map(SizeMeasureTypeReference::getLabel).orElse(null),
+ Optional.ofNullable(dto.getOutputSizeMeasureType()).map(SizeMeasureTypeReference::getCode).orElse(null),
Optional.ofNullable(dto.getOutputSizeMeasureType()).map(SizeMeasureTypeReference::getLabel).orElse(null),
dto.getInputOutputFormula(),
dto.getOutputInputFormula());
=====================================
dto/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterDtoReferenceBinder.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterDtoReferenceBinder.java
+++ b/dto/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterDtoReferenceBinder.java
@@ -53,7 +53,8 @@ public class LengthWeightParameterDtoReferenceBinder extends ReferentialDtoRefer
dto.getStartDate(),
dto.getEndDate(),
dto.getLengthWeightFormula(),
- dto.getWeightLengthFormula());
+ dto.getWeightLengthFormula(),
+ dto.getCode());
}
}
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
@@ -558,13 +558,13 @@ public class DecoratorService extends DecoratorProvider {
@Override
public void initLengthLengthParameterDto() {
registerDecorator(new LengthLengthParameterDecorator(libelle));
- registerReferentialReferenceDecorator(LengthLengthParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${inputSizeMeasureTypeLabel}$s##${outputSizeMeasureTypeLabel}$s");
+ registerReferentialReferenceDecorator(LengthLengthParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${inputSizeMeasureTypeCode}$s##${outputSizeMeasureTypeCode}$s");
}
@Override
public void initLengthWeightParameterDto() {
registerDecorator(new LengthWeightParameterDecorator(libelle));
- registerReferentialReferenceDecorator(LengthWeightParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY");
+ registerReferentialReferenceDecorator(LengthWeightParameterReference.class, "${speciesLabel}$s##${oceanLabel}$s##${sexLabel}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${sizeMeasureTypeCode}$s");
}
@Override
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthLengthParameterDecorator.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthLengthParameterDecorator.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthLengthParameterDecorator.java
@@ -37,7 +37,7 @@ public class LengthLengthParameterDecorator extends ObserveDecorator<LengthLengt
private static final long serialVersionUID = 1L;
public LengthLengthParameterDecorator(String libelle) throws IllegalArgumentException, NullPointerException {
- super(LengthLengthParameterDto.class, "${species/scientificLabel}$s##${ocean/" + libelle + "}$s##${sex/" + libelle + "}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${inputSizeMeasureType/" + libelle + "}$s##${outputSizeMeasureType/" + libelle + "}$s");
+ super(LengthLengthParameterDto.class, "${species/scientificLabel}$s##${ocean/" + libelle + "}$s##${sex/" + libelle + "}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${inputSizeMeasureType/code}$s##${outputSizeMeasureType/code}$s");
}
@SuppressWarnings({"unchecked"})
=====================================
dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthWeightParameterDecorator.java
=====================================
--- a/dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthWeightParameterDecorator.java
+++ b/dto/src/main/java/fr/ird/observe/dto/decoration/decorators/LengthWeightParameterDecorator.java
@@ -38,7 +38,7 @@ public class LengthWeightParameterDecorator extends ObserveDecorator<LengthWeigh
public LengthWeightParameterDecorator(String libelle) throws IllegalArgumentException, NullPointerException {
super(LengthWeightParameterDto.class,
- "${species/scientificLabel}$s##${ocean/" + libelle + "}$s##${sex}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY"
+ "${species/scientificLabel}$s##${ocean/" + libelle + "}$s##${sex}$s##${startDate}$td/%4$tm/%4$tY##${endDate}$td/%5$tm/%5$tY##${sizeMeasureType/code}$s"
);
}
@@ -62,15 +62,12 @@ public class LengthWeightParameterDecorator extends ObserveDecorator<LengthWeigh
if (token.startsWith(LengthWeightParameterDto.PROPERTY_OCEAN)) {
return t("observe.common.inconnu");
}
-// if (token.equals(LengthWeightParameterDto.PROPERTY_START_DATE) || token.equals(LengthWeightParameterDto.PROPERTY_END_DATE)) {
-// return null;
-// }
return super.getDefaultUndefinedValue(token);
}
@Override
protected Comparable<?> getDefaultNullValue(String token) {
- if (token.equals(LengthWeightParameterDto.PROPERTY_START_DATE) || token.equals(LengthWeightParameterDto.PROPERTY_END_DATE)) {
+ if (token.startsWith(LengthWeightParameterDto.PROPERTY_START_DATE) || token.startsWith(LengthWeightParameterDto.PROPERTY_END_DATE)) {
return null;
}
return super.getDefaultNullValue(token);
=====================================
dto/src/main/models/Observe.model
=====================================
--- a/dto/src/main/models/Observe.model
+++ b/dto/src/main/models/Observe.model
@@ -393,7 +393,7 @@ longitude + {*:1} Float
quadrant + {*:1} Integer
country {*:0..1} fr.ird.observe.dto.referential.CountryReference
-referential.LengthLengthParameter > referential.LengthFormulaSupport | references=oceanLabel,speciesLabel,sexLabel,startDate,endDate,inputSizeMeasureTypeLabel,outputSizeMeasureTypeLabel,inputOutputFormula,outputInputFormula
+referential.LengthLengthParameter > referential.LengthFormulaSupport | references=oceanLabel,speciesLabel,sexLabel,startDate,endDate,inputSizeMeasureTypeCode,inputSizeMeasureTypeLabel,outputSizeMeasureTypeCode,outputSizeMeasureTypeLabel,inputOutputFormula,outputInputFormula
inputOutputFormula + {*:1} String
inputOutputFormulaValid + {*:1} boolean
outputInputFormula + {*:1} String
@@ -401,7 +401,7 @@ outputInputFormulaValid + {*:1} boolean
inputSizeMeasureType {*:1} fr.ird.observe.dto.referential.SizeMeasureTypeReference
outputSizeMeasureType {*:1} fr.ird.observe.dto.referential.SizeMeasureTypeReference
-referential.LengthWeightParameter > referential.LengthFormulaSupport | references=oceanLabel,speciesLabel,sexLabel,startDate,endDate,lengthWeightFormula,weightLengthFormula
+referential.LengthWeightParameter > referential.LengthFormulaSupport | references=oceanLabel,speciesLabel,sexLabel,startDate,endDate,lengthWeightFormula,weightLengthFormula,sizeMeasureTypeCode
lengthWeightFormula + {*:1} String
weightLengthFormula + {*:1} String
meanLength + {*:1} Float
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterEntityReferenceBinder.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterEntityReferenceBinder.java
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthLengthParameterEntityReferenceBinder.java
@@ -10,12 +10,12 @@ package fr.ird.observe.binder.referential.common;
* 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>.
@@ -27,6 +27,9 @@ import fr.ird.observe.dto.referential.LengthLengthParameterDto;
import fr.ird.observe.dto.referential.LengthLengthParameterReference;
import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.referentiel.LengthLengthParameter;
+import fr.ird.observe.entities.referentiel.SizeMeasureType;
+
+import java.util.Optional;
/**
* Created on 24/11/15.
@@ -47,9 +50,11 @@ public class LengthLengthParameterEntityReferenceBinder extends ReferentialEntit
dto.getSex().getLabel(referentialLocale),
dto.getStartDate(),
dto.getEndDate(),
- dto.getInputSizeMeasureType().getLabel(referentialLocale),
- dto.getOutputSizeMeasureType().getLabel(referentialLocale),
- dto.getInputOutputFormula(),
- dto.getOutputInputFormula());
+ Optional.ofNullable(dto.getInputSizeMeasureType()).map(SizeMeasureType::getCode).orElse(null),
+ Optional.ofNullable(dto.getInputSizeMeasureType()).map(e -> e.getLabel(referentialLocale)).orElse(null),
+ Optional.ofNullable(dto.getOutputSizeMeasureType()).map(SizeMeasureType::getCode).orElse(null),
+ Optional.ofNullable(dto.getOutputSizeMeasureType()).map(e -> e.getLabel(referentialLocale)).orElse(null),
+ dto.getInputOutputFormula(),
+ dto.getOutputInputFormula());
}
}
=====================================
persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterEntityReferenceBinder.java
=====================================
--- a/persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterEntityReferenceBinder.java
+++ b/persistence/src/main/java/fr/ird/observe/binder/referential/common/LengthWeightParameterEntityReferenceBinder.java
@@ -10,12 +10,12 @@ package fr.ird.observe.binder.referential.common;
* 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>.
@@ -27,6 +27,9 @@ import fr.ird.observe.dto.referential.LengthWeightParameterDto;
import fr.ird.observe.dto.referential.LengthWeightParameterReference;
import fr.ird.observe.dto.referential.ReferentialLocale;
import fr.ird.observe.entities.referentiel.LengthWeightParameter;
+import fr.ird.observe.entities.referentiel.SizeMeasureType;
+
+import java.util.Optional;
/**
* Created on 24/11/15.
@@ -43,13 +46,14 @@ public class LengthWeightParameterEntityReferenceBinder extends ReferentialEntit
public LengthWeightParameterReference toReference(ReferentialLocale referentialLocale, LengthWeightParameter dto) {
return new LengthWeightParameterReference(dto,
- dto.getOcean().getLabel(referentialLocale),
- dto.getSpecies().getScientificLabel(),
- dto.getSex().getLabel(referentialLocale),
+ dto.getOcean().getLabel(referentialLocale),
+ dto.getSpecies().getScientificLabel(),
+ dto.getSex().getLabel(referentialLocale),
dto.getStartDate(),
dto.getEndDate(),
- dto.getLengthWeightFormula(),
- dto.getWeightLengthFormula());
+ dto.getLengthWeightFormula(),
+ dto.getWeightLengthFormula(),
+ Optional.ofNullable(dto.getSizeMeasureType()).map(SizeMeasureType::getCode).orElse(null));
}
}
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/78d29121fd0a2c3aa366e5f5da8…
--
View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/78d29121fd0a2c3aa366e5f5da8…
You're receiving this email because of your account on gitlab.com.
1
0