Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: ebe44cac by Tony CHEMIT at 2018-10-14T18:52:58Z [LL] Débarquements : petits ajustements 2 - Closes #1137 - - - - - 14 changed files: - client/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java - + client/src/main/java/fr/ird/observe/client/ui/actions/content/data/longline/SelectTransshipmentLandingLogbookUIAction.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jcss - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUIModel.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 - persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java - − persistence/src/main/resources/db/migration/7.4/02_update_referential_common_harbour-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 - test/src/main/resources/fixtures/count-referential-common.properties Changes: ===================================== client/src/main/java/fr/ird/observe/client/ui/ObserveKeyStrokes.java ===================================== @@ -74,6 +74,7 @@ public abstract class ObserveKeyStrokes { public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_RIGHT = KeyStroke.getKeyStroke("ctrl pressed B"); public static final KeyStroke KEY_STROKE_CONFIGURE_SYNCHRO_FROM_BOTH = KeyStroke.getKeyStroke("ctrl pressed C"); + public static final KeyStroke KEY_STROKE_SELECT_TRANSSHIPMENT = KeyStroke.getKeyStroke("ctrl pressed T"); public static final KeyStroke KEY_STROKE_SAVE_TABLE_ENTRY = KeyStroke.getKeyStroke("ctrl pressed S"); public static final KeyStroke KEY_STROKE_PRESSED_ENTER = KeyStroke.getKeyStroke("pressed ENTER"); public static final KeyStroke KEY_STROKE_RESET = KeyStroke.getKeyStroke("ctrl pressed R"); ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/content/data/longline/SelectTransshipmentLandingLogbookUIAction.java ===================================== @@ -0,0 +1,54 @@ +package fr.ird.observe.client.ui.actions.content.data.longline; + +/*- + * #%L + * ObServe :: Client + * %% + * 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% + */ + +import fr.ird.observe.client.ui.ObserveKeyStrokes; +import fr.ird.observe.client.ui.ObserveMainUI; +import fr.ird.observe.client.ui.actions.content.api.AbstractContentUIAction; +import fr.ird.observe.client.ui.content.api.ContentUI; +import fr.ird.observe.client.ui.content.data.longline.logbook.TripLonglineLandingLogbookUI; +import fr.ird.observe.client.ui.content.data.longline.logbook.TripLonglineLandingLogbookUIModel; + +import static org.nuiton.i18n.I18n.n; + +/** + * Created by tchemit on 14/10/2018. + * + * @author Tony Chemit - dev@tchemit.fr + */ +public class SelectTransshipmentLandingLogbookUIAction extends AbstractContentUIAction { + + public static final String ACTION_NAME = SelectTransshipmentLandingLogbookUIAction.class.getName(); + + public SelectTransshipmentLandingLogbookUIAction(ObserveMainUI mainUI) { + super(mainUI, ACTION_NAME, n("observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment"), n("observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment"), "data-calcule", ObserveKeyStrokes.KEY_STROKE_SELECT_TRANSSHIPMENT); + } + + @Override + protected void actionPerformed(ContentUI contentUI) { + + TripLonglineLandingLogbookUI ui = (TripLonglineLandingLogbookUI) contentUI; + TripLonglineLandingLogbookUIModel model = ui.getModel(); + model.selectTransshipment(); + } +} ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jaxx ===================================== @@ -39,6 +39,7 @@ fr.ird.observe.client.ui.actions.content.data.longline.delete.DeleteTripLonglineLandingLogbookUIAction fr.ird.observe.client.ui.actions.content.data.longline.move.MoveSingleTripLonglineLandingLogbookUIAction fr.ird.observe.client.ui.actions.content.data.longline.save.SaveTripLonglineLandingLogbookUIAction + fr.ird.observe.client.ui.actions.content.data.longline.SelectTransshipmentLandingLogbookUIAction fr.ird.observe.client.ui.util.JComment fr.ird.observe.client.ObserveSwingApplicationContext @@ -121,7 +122,10 @@ <JLabel id='harbourLabel'/> </cell> <cell weightx='1' anchor='east'> - <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference'/> + <JPanel layout="{new BorderLayout()}"> + <BeanFilterableComboBox id='harbour' constructorParams='this' genericType='HarbourReference' constraints='BorderLayout.CENTER'/> + <JButton id='selectTransshipment' constraints='BorderLayout.EAST'/> + </JPanel> </cell> </row> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUI.jcss ===================================== @@ -99,3 +99,7 @@ #save { _observeAction:{SaveTripLonglineLandingLogbookUIAction.ACTION_NAME}; } + +#selectTransshipment { + _observeAction:{SelectTransshipmentLandingLogbookUIAction.ACTION_NAME}; +} ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/TripLonglineLandingLogbookUIModel.java ===================================== @@ -22,9 +22,12 @@ package fr.ird.observe.client.ui.content.data.longline.logbook; * #L% */ +import fr.ird.observe.client.ui.content.api.ContentUI; import fr.ird.observe.client.ui.content.api.data.open.ContentOpenableUIModel; import fr.ird.observe.dto.data.longline.LandingLogbookDto; import fr.ird.observe.dto.data.longline.LandingLogbookReference; +import fr.ird.observe.dto.referential.HarbourReference; +import fr.ird.observe.dto.referential.VesselReference; import org.nuiton.i18n.I18n; /** @@ -37,8 +40,27 @@ public class TripLonglineLandingLogbookUIModel extends ContentOpenableUIModel<La private static final long serialVersionUID = 1L; + //FIXME-PROTECTED-ID + private static final String LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_VESSEL_ID = "fr.ird.observe.entities.referentiel.Vessel#1308214144311#0.8813727202637713"; + //FIXME-PROTECTED-ID + private static final String LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_HARBOUR_ID = "fr.ird.observe.entities.referentiel.Harbour#11#0.38"; + + private HarbourReference transshipmentHarbour; + private VesselReference transshipmentVessel; + public TripLonglineLandingLogbookUIModel() { super(LandingLogbookDto.class, I18n.n("observe.common.TripLonglineLandingLogbookDto.message.not.open")); } + @Override + public void init(ContentUI ui) { + super.init(ui); + transshipmentHarbour = ui.getDataSource().getReferentialReferenceSet(HarbourReference.class).tryGetReferenceById(LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_HARBOUR_ID).orElseThrow(IllegalStateException::new); + transshipmentVessel = ui.getDataSource().getReferentialReferenceSet(VesselReference.class).tryGetReferenceById(LONGLINE_LANDING_LOGBOOK_TRANSSHIPMENT_VESSEL_ID).orElseThrow(IllegalStateException::new); + } + + public void selectTransshipment() { + getBean().setHarbour(transshipmentHarbour); + getBean().setVessel(transshipmentVessel); + } } ===================================== client/src/main/resources/i18n/client_en_GB.properties ===================================== @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Move selected land observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Reopen landing observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Reopen landing observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Reopen landing +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transshipment at sea observe.common.TripLonglineLandingLogbookDto.comment=Comment observe.common.TripLonglineLandingLogbookDto.list=List of landings observe.common.TripLonglineLandingLogbookDto.list.message.none=< No landing for current trip > ===================================== client/src/main/resources/i18n/client_es_ES.properties ===================================== @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Move selected land observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Reopen landing observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Reopen landing observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Reopen landing +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transbordo en el mar observe.common.TripLonglineLandingLogbookDto.comment=Comment observe.common.TripLonglineLandingLogbookDto.list=List of landings observe.common.TripLonglineLandingLogbookDto.list.message.none=< No landing for current trip > ===================================== client/src/main/resources/i18n/client_fr_FR.properties ===================================== @@ -1339,6 +1339,7 @@ observe.common.TripLonglineLandingLogbookDto.action.moves.tip=Déplacer les déb observe.common.TripLonglineLandingLogbookDto.action.reopen.tip=Rouvrir le débarquement observe.common.TripLonglineLandingLogbookDto.action.reopenSelected=Rouvrir le débarquement observe.common.TripLonglineLandingLogbookDto.action.reopenSelected.tip=Rouvrir le débarquement sélectionné +observe.common.TripLonglineLandingLogbookDto.action.selectTransshipment=Transbordement en mer observe.common.TripLonglineLandingLogbookDto.comment=Commentaire de le débarquement observe.common.TripLonglineLandingLogbookDto.list=Liste des débarquements observe.common.TripLonglineLandingLogbookDto.list.message.none=< Aucun débarquement pour la marée courante > ===================================== persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_4.java ===================================== @@ -42,7 +42,6 @@ public class DataSourceMigrationForVersion_7_4 extends MigrationVersionResource @Override public void generateSqlScript(MigrationVersionResourceExecutor executor) { executor.addScript("01", "update_referential_longline_conservation"); - executor.addScript("02", "update_referential_common_harbour"); executor.addScript("03", "update_referential_longline_line_type"); executor.addScript("04", "update_longline_set_logbook_field"); executor.addScript("05", "update_longline_activity_logbook_field"); ===================================== persistence/src/main/resources/db/migration/7.4/02_update_referential_common_harbour-common.sql deleted ===================================== @@ -1,23 +0,0 @@ ---- --- #%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% ---- -INSERT INTO observe_common.Harbour(topiaid, topiaversion, topiacreatedate, lastupdatedate, status, needComment, code, name) values ('fr.ird.observe.entities.referentiel.Harbour#11#0.100' , 0, CURRENT_DATE, CURRENT_TIMESTAMP, 1, false, '998', 'At sea transshipment'); -UPDATE observe_common.LASTUPDATEDATE SET lastupdatedate = CURRENT_TIMESTAMP WHERE topiaId = 'fr.ird.observe.entities.LastUpdateDate#1236861982132#0.06'; ===================================== 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. ===================================== test/src/main/resources/fixtures/count-referential-common.properties ===================================== @@ -27,7 +27,7 @@ observe_common.gear=26 observe_common.gear_gearcaracteristic=29 observe_common.gearcaracteristic=22 observe_common.gearcaracteristictype=6 -observe_common.harbour=75 +observe_common.harbour=74 observe_common.lastupdatedate=125 observe_common.lengthlengthparameter=0 observe_common.lengthmeasuremethod=4 View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/ebe44cac1a88981ba2c3d05a869a... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/ebe44cac1a88981ba2c3d05a869a... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT