Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
0c451074
by Tony Chemit at 2024-01-24T08:37:54+01:00
-
22b32e4f
by Tony Chemit at 2024-01-24T08:50:21+01:00
9 changed files:
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/DcpUIAdapter.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/DcpUIModelStates.java
- + client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/dcp/TransmittingBuoyListener.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/FloatingObjectUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/logbook/FloatingObjectUIModelStates.java
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/FloatingObjectUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/FloatingObjectUIModelStates.java
- core/persistence/migration/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_3.java
- − core/persistence/migration/src/main/resources/db/migration/v9/9.3/02_issue-2821-common.sql
Changes:
| ... | ... | @@ -151,8 +151,8 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 151 | 151 | }
|
| 152 | 152 | });
|
| 153 | 153 | states.getBean().addPropertyChangeListener(FloatingObjectDto.PROPERTY_OBJECT_OPERATION, e -> states.updateMaterials(getTable().getTreeTableModel(), (ObjectOperationReference) e.getNewValue()));
|
| 154 | - states.setFirstBuoyOwnershipListener(new DcpUIModelStates.TransmittingBuoyOwnershipListener<>(getTransmittingBuoy1(), getVessel1(), getCountry1()));
|
|
| 155 | - states.setSecondBuoyOwnershipListener(new DcpUIModelStates.TransmittingBuoyOwnershipListener<>(getTransmittingBuoy2(), getVessel2(), getCountry2()));
|
|
| 154 | + states.setFirstBuoyListener(new TransmittingBuoyListener<>(getTransmittingBuoy1(), getVessel1(), getCountry1()));
|
|
| 155 | + states.setSecondBuoyListener(new TransmittingBuoyListener<>(getTransmittingBuoy2(), getVessel2(), getCountry2()));
|
|
| 156 | 156 | }
|
| 157 | 157 | |
| 158 | 158 | default void installExtraActions() {
|
| ... | ... | @@ -173,8 +173,8 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 173 | 173 | }
|
| 174 | 174 | getValidatorBuoy1().setBean(null);
|
| 175 | 175 | getValidatorBuoy2().setBean(null);
|
| 176 | - states.removeFirstBuoyOwnershipListener(getTransmittingBuoy1());
|
|
| 177 | - states.removeSecondBuoyOwnershipListener(getTransmittingBuoy2());
|
|
| 176 | + states.removeFirstBuoyListener();
|
|
| 177 | + states.removeSecondBuoyListener();
|
|
| 178 | 178 | }
|
| 179 | 179 | |
| 180 | 180 | default void changeTypeTransmittingBuoyOperation(ItemEvent event, DcpUIModelStates<?, ?> states) {
|
| ... | ... | @@ -188,10 +188,10 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 188 | 188 | FloatingObjectAware bean = states.getBean();
|
| 189 | 189 | if (bean.getFirstBuoy() != null) {
|
| 190 | 190 | getValidatorBuoy1().setBean(getTransmittingBuoy1());
|
| 191 | - states.addFirstBuoyOwnershipListener(getTransmittingBuoy1());
|
|
| 191 | + states.addFirstBuoyListener();
|
|
| 192 | 192 | if (bean.getSecondBuoy() != null) {
|
| 193 | 193 | getValidatorBuoy2().setBean(getTransmittingBuoy2());
|
| 194 | - states.addSecondBuoyOwnershipListener(getTransmittingBuoy2());
|
|
| 194 | + states.addSecondBuoyListener();
|
|
| 195 | 195 | }
|
| 196 | 196 | }
|
| 197 | 197 | states.setModified(states.isCreatingMode());
|
| ... | ... | @@ -225,8 +225,8 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 225 | 225 | if (states.isEditing()) {
|
| 226 | 226 | getValidatorBuoy1().setBean(null);
|
| 227 | 227 | getValidatorBuoy2().setBean(null);
|
| 228 | - states.removeFirstBuoyOwnershipListener(getTransmittingBuoy1());
|
|
| 229 | - states.removeSecondBuoyOwnershipListener(getTransmittingBuoy2());
|
|
| 228 | + states.removeFirstBuoyListener();
|
|
| 229 | + states.removeSecondBuoyListener();
|
|
| 230 | 230 | }
|
| 231 | 231 | |
| 232 | 232 | String[] transmittingBuoyOperationCodes = typeOperation.getTransmittingBuoyOperationCodes();
|
| ... | ... | @@ -247,7 +247,7 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 247 | 247 | editorPanel.add(getTransmittingBuoy1EditorPanel());
|
| 248 | 248 | if (states.isEditing()) {
|
| 249 | 249 | getValidatorBuoy1().setBean(getTransmittingBuoy1());
|
| 250 | - states.addFirstBuoyOwnershipListener(getTransmittingBuoy1());
|
|
| 250 | + states.addFirstBuoyListener();
|
|
| 251 | 251 | }
|
| 252 | 252 | focusOwner = getTransmittingBuoyType1();
|
| 253 | 253 | break;
|
| ... | ... | @@ -265,8 +265,8 @@ public interface DcpUIAdapter<T extends TransmittingBuoyAware> extends JAXXObjec |
| 265 | 265 | if (states.isEditing()) {
|
| 266 | 266 | getValidatorBuoy1().setBean(getTransmittingBuoy1());
|
| 267 | 267 | getValidatorBuoy2().setBean(getTransmittingBuoy2());
|
| 268 | - states.addFirstBuoyOwnershipListener(getTransmittingBuoy1());
|
|
| 269 | - states.addSecondBuoyOwnershipListener(getTransmittingBuoy2());
|
|
| 268 | + states.addFirstBuoyListener();
|
|
| 269 | + states.addSecondBuoyListener();
|
|
| 270 | 270 | }
|
| 271 | 271 | focusOwner = getTransmittingBuoyType1();
|
| 272 | 272 | break;
|
| ... | ... | @@ -37,8 +37,6 @@ import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPreset; |
| 37 | 37 | import fr.ird.observe.dto.data.ps.dcp.FloatingObjectPresetsManager;
|
| 38 | 38 | import fr.ird.observe.dto.data.ps.logbook.TransmittingBuoyDto;
|
| 39 | 39 | import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 40 | -import fr.ird.observe.dto.referential.common.CountryReference;
|
|
| 41 | -import fr.ird.observe.dto.referential.common.VesselReference;
|
|
| 42 | 40 | import fr.ird.observe.dto.referential.ps.common.ObjectMaterialDto;
|
| 43 | 41 | import fr.ird.observe.dto.referential.ps.common.ObjectMaterialReference;
|
| 44 | 42 | import fr.ird.observe.dto.referential.ps.common.ObjectOperationReference;
|
| ... | ... | @@ -46,12 +44,9 @@ import fr.ird.observe.dto.referential.ps.common.TransmittingBuoyOperationReferen |
| 46 | 44 | import fr.ird.observe.dto.referential.ps.common.TransmittingBuoyOwnershipReference;
|
| 47 | 45 | import io.ultreia.java4all.bean.JavaBean;
|
| 48 | 46 | import io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor;
|
| 49 | -import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
|
|
| 50 | 47 | import org.apache.logging.log4j.LogManager;
|
| 51 | 48 | import org.apache.logging.log4j.Logger;
|
| 52 | 49 | |
| 53 | -import java.beans.PropertyChangeEvent;
|
|
| 54 | -import java.beans.PropertyChangeListener;
|
|
| 55 | 50 | import java.util.Collection;
|
| 56 | 51 | import java.util.Date;
|
| 57 | 52 | import java.util.LinkedHashMap;
|
| ... | ... | @@ -101,13 +96,13 @@ public interface DcpUIModelStates<D extends DataDto & FloatingObjectAware, P ext |
| 101 | 96 | |
| 102 | 97 | Optional<ToolkitIdModifications> consolidate();
|
| 103 | 98 | |
| 104 | - TransmittingBuoyOwnershipListener<?> getFirstBuoyOwnershipListener();
|
|
| 99 | + TransmittingBuoyListener<?> getFirstBuoyListener();
|
|
| 105 | 100 | |
| 106 | - void setFirstBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> firstBuoyOwnershipListener);
|
|
| 101 | + void setFirstBuoyListener(TransmittingBuoyListener<?> firstBuoyListener);
|
|
| 107 | 102 | |
| 108 | - TransmittingBuoyOwnershipListener<?> getSecondBuoyOwnershipListener();
|
|
| 103 | + TransmittingBuoyListener<?> getSecondBuoyListener();
|
|
| 109 | 104 | |
| 110 | - void setSecondBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> secondBuoyOwnershipListener);
|
|
| 105 | + void setSecondBuoyListener(TransmittingBuoyListener<?> secondBuoyListener);
|
|
| 111 | 106 | |
| 112 | 107 | default void recomputeComputedValues() {
|
| 113 | 108 | Optional<ToolkitIdModifications> result = consolidate();
|
| ... | ... | @@ -323,11 +318,11 @@ public interface DcpUIModelStates<D extends DataDto & FloatingObjectAware, P ext |
| 323 | 318 | |
| 324 | 319 | Optional.ofNullable(bean.getFirstBuoy()).ifPresent(b -> {
|
| 325 | 320 | b.copy(ui1);
|
| 326 | - getFirstBuoyOwnershipListener().apply();
|
|
| 321 | + getFirstBuoyListener().apply();
|
|
| 327 | 322 | });
|
| 328 | 323 | Optional.ofNullable(bean.getSecondBuoy()).ifPresent(b -> {
|
| 329 | 324 | b.copy(ui2);
|
| 330 | - getSecondBuoyOwnershipListener().apply();
|
|
| 325 | + getSecondBuoyListener().apply();
|
|
| 331 | 326 | });
|
| 332 | 327 | getBean().setCanValidateMaterials(true);
|
| 333 | 328 | }
|
| ... | ... | @@ -338,78 +333,20 @@ public interface DcpUIModelStates<D extends DataDto & FloatingObjectAware, P ext |
| 338 | 333 | |
| 339 | 334 | boolean isCreatingMode();
|
| 340 | 335 | |
| 341 | - default void addFirstBuoyOwnershipListener(TransmittingBuoyAware buoy) {
|
|
| 342 | - TransmittingBuoyOwnershipListener<?> listener = getFirstBuoyOwnershipListener();
|
|
| 343 | - buoy.removePropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 344 | - buoy.addPropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 345 | - listener.apply();
|
|
| 336 | + default void addFirstBuoyListener() {
|
|
| 337 | + getFirstBuoyListener().install();
|
|
| 346 | 338 | }
|
| 347 | 339 | |
| 348 | - default void removeFirstBuoyOwnershipListener(TransmittingBuoyAware buoy) {
|
|
| 349 | - PropertyChangeListener listener = getFirstBuoyOwnershipListener();
|
|
| 350 | - buoy.removePropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 340 | + default void removeFirstBuoyListener() {
|
|
| 341 | + getFirstBuoyListener().uninstall();
|
|
| 351 | 342 | }
|
| 352 | 343 | |
| 353 | - default void addSecondBuoyOwnershipListener(TransmittingBuoyAware buoy) {
|
|
| 354 | - TransmittingBuoyOwnershipListener<?> listener = getSecondBuoyOwnershipListener();
|
|
| 355 | - buoy.removePropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 356 | - buoy.addPropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 357 | - listener.apply();
|
|
| 344 | + default void addSecondBuoyListener() {
|
|
| 345 | + getSecondBuoyListener().install();
|
|
| 358 | 346 | }
|
| 359 | 347 | |
| 360 | - default void removeSecondBuoyOwnershipListener(TransmittingBuoyAware buoy) {
|
|
| 361 | - PropertyChangeListener listener = getSecondBuoyOwnershipListener();
|
|
| 362 | - buoy.removePropertyChangeListener(TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP, listener);
|
|
| 348 | + default void removeSecondBuoyListener() {
|
|
| 349 | + getSecondBuoyListener().uninstall();
|
|
| 363 | 350 | }
|
| 364 | 351 | |
| 365 | - class TransmittingBuoyOwnershipListener<T extends TransmittingBuoyAware> implements PropertyChangeListener {
|
|
| 366 | - |
|
| 367 | - private final T buoy;
|
|
| 368 | - private final FilterableComboBox<VesselReference> vessel;
|
|
| 369 | - private final FilterableComboBox<CountryReference> country;
|
|
| 370 | - |
|
| 371 | - public TransmittingBuoyOwnershipListener(T buoy, FilterableComboBox<VesselReference> vessel, FilterableComboBox<CountryReference> country) {
|
|
| 372 | - this.buoy = buoy;
|
|
| 373 | - this.vessel = vessel;
|
|
| 374 | - this.country = country;
|
|
| 375 | - }
|
|
| 376 | - |
|
| 377 | - @Override
|
|
| 378 | - public void propertyChange(PropertyChangeEvent evt) {
|
|
| 379 | - TransmittingBuoyOwnershipReference buoyOwnership = (TransmittingBuoyOwnershipReference) evt.getNewValue();
|
|
| 380 | - apply(buoyOwnership);
|
|
| 381 | - }
|
|
| 382 | - |
|
| 383 | - public void apply() {
|
|
| 384 | - apply(buoy.getTransmittingBuoyOwnership());
|
|
| 385 | - }
|
|
| 386 | - |
|
| 387 | - private void apply(TransmittingBuoyOwnershipReference buoyOwnership) {
|
|
| 388 | - boolean enableVessel = true;
|
|
| 389 | - boolean enableCountry = true;
|
|
| 390 | - if (buoyOwnership != null) {
|
|
| 391 | - switch (buoyOwnership.getId()) {
|
|
| 392 | - case ProtectedIdsPs.PS_COMMON_TRANSMITTING_BUOY_OWNERSHIP_THIS_SHIP_ID:
|
|
| 393 | - enableVessel = false;
|
|
| 394 | - enableCountry = false;
|
|
| 395 | - break;
|
|
| 396 | - case ProtectedIdsPs.PS_COMMON_TRANSMITTING_BUOY_OWNERSHIP_UNKNOWN_ID:
|
|
| 397 | - enableVessel = false;
|
|
| 398 | - break;
|
|
| 399 | - }
|
|
| 400 | - }
|
|
| 401 | - if (enableVessel) {
|
|
| 402 | - vessel.setEnabled(true);
|
|
| 403 | - } else {
|
|
| 404 | - buoy.setVessel(null);
|
|
| 405 | - vessel.setEnabled(false);
|
|
| 406 | - }
|
|
| 407 | - if (enableCountry) {
|
|
| 408 | - country.setEnabled(true);
|
|
| 409 | - } else {
|
|
| 410 | - buoy.setCountry(null);
|
|
| 411 | - country.setEnabled(false);
|
|
| 412 | - }
|
|
| 413 | - }
|
|
| 414 | - }
|
|
| 415 | 352 | } |
| 1 | +package fr.ird.observe.client.datasource.editor.ps.data.dcp;
|
|
| 2 | + |
|
| 3 | +/*-
|
|
| 4 | + * #%L
|
|
| 5 | + * ObServe Client :: DataSource :: Editor :: PS
|
|
| 6 | + * %%
|
|
| 7 | + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 8 | + * %%
|
|
| 9 | + * This program is free software: you can redistribute it and/or modify
|
|
| 10 | + * it under the terms of the GNU General Public License as
|
|
| 11 | + * published by the Free Software Foundation, either version 3 of the
|
|
| 12 | + * License, or (at your option) any later version.
|
|
| 13 | + *
|
|
| 14 | + * This program is distributed in the hope that it will be useful,
|
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 | + * GNU General Public License for more details.
|
|
| 18 | + *
|
|
| 19 | + * You should have received a copy of the GNU General Public
|
|
| 20 | + * License along with this program. If not, see
|
|
| 21 | + * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 | + * #L%
|
|
| 23 | + */
|
|
| 24 | + |
|
| 25 | +import fr.ird.observe.dto.ProtectedIdsPs;
|
|
| 26 | +import fr.ird.observe.dto.data.ps.TransmittingBuoyAware;
|
|
| 27 | +import fr.ird.observe.dto.data.ps.logbook.TransmittingBuoyDto;
|
|
| 28 | +import fr.ird.observe.dto.referential.common.CountryReference;
|
|
| 29 | +import fr.ird.observe.dto.referential.common.VesselReference;
|
|
| 30 | +import fr.ird.observe.dto.referential.ps.common.TransmittingBuoyOwnershipReference;
|
|
| 31 | +import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
|
|
| 32 | + |
|
| 33 | +import java.beans.PropertyChangeEvent;
|
|
| 34 | +import java.beans.PropertyChangeListener;
|
|
| 35 | + |
|
| 36 | +/**
|
|
| 37 | + * Created at 24/01/2024.
|
|
| 38 | + *
|
|
| 39 | + * @author Tony Chemit - dev@tchemit.fr
|
|
| 40 | + * @since 9.3.0
|
|
| 41 | + */
|
|
| 42 | +public class TransmittingBuoyListener<T extends TransmittingBuoyAware> implements PropertyChangeListener {
|
|
| 43 | + |
|
| 44 | + private final T buoy;
|
|
| 45 | + private final FilterableComboBox<VesselReference> vessel;
|
|
| 46 | + private final FilterableComboBox<CountryReference> country;
|
|
| 47 | + |
|
| 48 | + /**
|
|
| 49 | + * Flag to avoid re-entrant code
|
|
| 50 | + */
|
|
| 51 | + private boolean adjusting;
|
|
| 52 | + |
|
| 53 | + public TransmittingBuoyListener(T buoy, FilterableComboBox<VesselReference> vessel, FilterableComboBox<CountryReference> country) {
|
|
| 54 | + this.buoy = buoy;
|
|
| 55 | + this.vessel = vessel;
|
|
| 56 | + this.country = country;
|
|
| 57 | + }
|
|
| 58 | + |
|
| 59 | + public void install() {
|
|
| 60 | + buoy.removePropertyChangeListener(this);
|
|
| 61 | + buoy.addPropertyChangeListener(this);
|
|
| 62 | + apply();
|
|
| 63 | + }
|
|
| 64 | + |
|
| 65 | + public void uninstall() {
|
|
| 66 | + buoy.removePropertyChangeListener(this);
|
|
| 67 | + }
|
|
| 68 | + |
|
| 69 | + @Override
|
|
| 70 | + public void propertyChange(PropertyChangeEvent evt) {
|
|
| 71 | + if (adjusting) {
|
|
| 72 | + return;
|
|
| 73 | + }
|
|
| 74 | + adjusting = true;
|
|
| 75 | + |
|
| 76 | + try {
|
|
| 77 | + switch (evt.getPropertyName()) {
|
|
| 78 | + case TransmittingBuoyDto.PROPERTY_TRANSMITTING_BUOY_OWNERSHIP:
|
|
| 79 | + TransmittingBuoyOwnershipReference buoyOwnership = (TransmittingBuoyOwnershipReference) evt.getNewValue();
|
|
| 80 | + apply(buoyOwnership, buoy.getVessel());
|
|
| 81 | + break;
|
|
| 82 | + case TransmittingBuoyDto.PROPERTY_VESSEL:
|
|
| 83 | + VesselReference vessel = (VesselReference) evt.getNewValue();
|
|
| 84 | + apply(buoy.getTransmittingBuoyOwnership(), vessel);
|
|
| 85 | + break;
|
|
| 86 | + |
|
| 87 | + }
|
|
| 88 | + } finally {
|
|
| 89 | + adjusting = false;
|
|
| 90 | + }
|
|
| 91 | + }
|
|
| 92 | + |
|
| 93 | + public void apply() {
|
|
| 94 | + apply(buoy.getTransmittingBuoyOwnership(), buoy.getVessel());
|
|
| 95 | + }
|
|
| 96 | + |
|
| 97 | + private void apply(TransmittingBuoyOwnershipReference buoyOwnership, VesselReference vesselReference) {
|
|
| 98 | + boolean enableVessel = true;
|
|
| 99 | + boolean enableCountry = true;
|
|
| 100 | + if (buoyOwnership != null) {
|
|
| 101 | + switch (buoyOwnership.getId()) {
|
|
| 102 | + case ProtectedIdsPs.PS_COMMON_TRANSMITTING_BUOY_OWNERSHIP_THIS_SHIP_ID:
|
|
| 103 | + enableVessel = false;
|
|
| 104 | + enableCountry = false;
|
|
| 105 | + break;
|
|
| 106 | + case ProtectedIdsPs.PS_COMMON_TRANSMITTING_BUOY_OWNERSHIP_UNKNOWN_ID:
|
|
| 107 | + enableVessel = false;
|
|
| 108 | + break;
|
|
| 109 | + }
|
|
| 110 | + }
|
|
| 111 | + if (enableVessel) {
|
|
| 112 | + vessel.setEnabled(true);
|
|
| 113 | + if (vesselReference != null) {
|
|
| 114 | + enableCountry = false;
|
|
| 115 | + }
|
|
| 116 | + } else {
|
|
| 117 | + buoy.setVessel(null);
|
|
| 118 | + vessel.setEnabled(false);
|
|
| 119 | + }
|
|
| 120 | + if (enableCountry) {
|
|
| 121 | + country.setEnabled(true);
|
|
| 122 | + } else {
|
|
| 123 | + buoy.setCountry(null);
|
|
| 124 | + country.setEnabled(false);
|
|
| 125 | + }
|
|
| 126 | + }
|
|
| 127 | +} |
| ... | ... | @@ -219,18 +219,18 @@ |
| 219 | 219 | </row>
|
| 220 | 220 | <row>
|
| 221 | 221 | <cell anchor='west'>
|
| 222 | - <JLabel id='country1Label'/>
|
|
| 222 | + <JLabel id='vessel1Label'/>
|
|
| 223 | 223 | </cell>
|
| 224 | 224 | <cell anchor='east' weightx="1" fill="both">
|
| 225 | - <FilterableComboBox id='country1' genericType='CountryReference'/>
|
|
| 225 | + <FilterableComboBox id='vessel1' genericType='VesselReference'/>
|
|
| 226 | 226 | </cell>
|
| 227 | 227 | </row>
|
| 228 | 228 | <row>
|
| 229 | 229 | <cell anchor='west'>
|
| 230 | - <JLabel id='vessel1Label'/>
|
|
| 230 | + <JLabel id='country1Label'/>
|
|
| 231 | 231 | </cell>
|
| 232 | 232 | <cell anchor='east' weightx="1" fill="both">
|
| 233 | - <FilterableComboBox id='vessel1' genericType='VesselReference'/>
|
|
| 233 | + <FilterableComboBox id='country1' genericType='CountryReference'/>
|
|
| 234 | 234 | </cell>
|
| 235 | 235 | </row>
|
| 236 | 236 | <row>
|
| ... | ... | @@ -276,18 +276,18 @@ |
| 276 | 276 | </row>
|
| 277 | 277 | <row>
|
| 278 | 278 | <cell anchor='west'>
|
| 279 | - <JLabel id='country2Label'/>
|
|
| 279 | + <JLabel id='vessel2Label'/>
|
|
| 280 | 280 | </cell>
|
| 281 | 281 | <cell anchor='east' weightx="1" fill="both">
|
| 282 | - <FilterableComboBox id='country2' genericType='CountryReference'/>
|
|
| 282 | + <FilterableComboBox id='vessel2' genericType='VesselReference'/>
|
|
| 283 | 283 | </cell>
|
| 284 | 284 | </row>
|
| 285 | 285 | <row>
|
| 286 | 286 | <cell anchor='west'>
|
| 287 | - <JLabel id='vessel2Label'/>
|
|
| 287 | + <JLabel id='country2Label'/>
|
|
| 288 | 288 | </cell>
|
| 289 | 289 | <cell anchor='east' weightx="1" fill="both">
|
| 290 | - <FilterableComboBox id='vessel2' genericType='VesselReference'/>
|
|
| 290 | + <FilterableComboBox id='country2' genericType='CountryReference'/>
|
|
| 291 | 291 | </cell>
|
| 292 | 292 | </row>
|
| 293 | 293 | <row>
|
| ... | ... | @@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.ps.data.logbook; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import fr.ird.observe.client.datasource.editor.ps.data.dcp.DcpUIModelStates;
|
| 26 | +import fr.ird.observe.client.datasource.editor.ps.data.dcp.TransmittingBuoyListener;
|
|
| 26 | 27 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
|
| 27 | 28 | import fr.ird.observe.consolidation.data.ps.logbook.FloatingObjectConsolidateEngine;
|
| 28 | 29 | import fr.ird.observe.consolidation.data.ps.logbook.FloatingObjectConsolidateRequest;
|
| ... | ... | @@ -66,8 +67,8 @@ public class FloatingObjectUIModelStates extends GeneratedFloatingObjectUIModelS |
| 66 | 67 | private boolean arriving;
|
| 67 | 68 | private boolean leaving;
|
| 68 | 69 | private FloatingObjectConsolidateEngine consolidateEngine;
|
| 69 | - private TransmittingBuoyOwnershipListener<?> firstBuoyOwnershipListener;
|
|
| 70 | - private TransmittingBuoyOwnershipListener<?> secondBuoyOwnershipListener;
|
|
| 70 | + private TransmittingBuoyListener<?> firstBuoyListener;
|
|
| 71 | + private TransmittingBuoyListener<?> secondBuoyListener;
|
|
| 71 | 72 | |
| 72 | 73 | public FloatingObjectUIModelStates(GeneratedFloatingObjectUIModel model) {
|
| 73 | 74 | super(model);
|
| ... | ... | @@ -81,23 +82,23 @@ public class FloatingObjectUIModelStates extends GeneratedFloatingObjectUIModelS |
| 81 | 82 | }
|
| 82 | 83 | |
| 83 | 84 | @Override
|
| 84 | - public TransmittingBuoyOwnershipListener<?> getFirstBuoyOwnershipListener() {
|
|
| 85 | - return firstBuoyOwnershipListener;
|
|
| 85 | + public TransmittingBuoyListener<?> getFirstBuoyListener() {
|
|
| 86 | + return firstBuoyListener;
|
|
| 86 | 87 | }
|
| 87 | 88 | |
| 88 | 89 | @Override
|
| 89 | - public void setFirstBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> firstBuoyOwnershipListener) {
|
|
| 90 | - this.firstBuoyOwnershipListener = firstBuoyOwnershipListener;
|
|
| 90 | + public void setFirstBuoyListener(TransmittingBuoyListener<?> firstBuoyListener) {
|
|
| 91 | + this.firstBuoyListener = firstBuoyListener;
|
|
| 91 | 92 | }
|
| 92 | 93 | |
| 93 | 94 | @Override
|
| 94 | - public TransmittingBuoyOwnershipListener<?> getSecondBuoyOwnershipListener() {
|
|
| 95 | - return secondBuoyOwnershipListener;
|
|
| 95 | + public TransmittingBuoyListener<?> getSecondBuoyListener() {
|
|
| 96 | + return secondBuoyListener;
|
|
| 96 | 97 | }
|
| 97 | 98 | |
| 98 | 99 | @Override
|
| 99 | - public void setSecondBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> secondBuoyOwnershipListener) {
|
|
| 100 | - this.secondBuoyOwnershipListener = secondBuoyOwnershipListener;
|
|
| 100 | + public void setSecondBuoyListener(TransmittingBuoyListener<?> secondBuoyListener) {
|
|
| 101 | + this.secondBuoyListener = secondBuoyListener;
|
|
| 101 | 102 | }
|
| 102 | 103 | |
| 103 | 104 | @Override
|
| ... | ... | @@ -220,18 +220,18 @@ |
| 220 | 220 | </row>
|
| 221 | 221 | <row>
|
| 222 | 222 | <cell anchor='west'>
|
| 223 | - <JLabel id='country1Label'/>
|
|
| 223 | + <JLabel id='vessel1Label'/>
|
|
| 224 | 224 | </cell>
|
| 225 | 225 | <cell anchor='east' weightx="1" fill="both">
|
| 226 | - <FilterableComboBox id='country1' genericType='CountryReference'/>
|
|
| 226 | + <FilterableComboBox id='vessel1' genericType='VesselReference'/>
|
|
| 227 | 227 | </cell>
|
| 228 | 228 | </row>
|
| 229 | 229 | <row>
|
| 230 | 230 | <cell anchor='west'>
|
| 231 | - <JLabel id='vessel1Label'/>
|
|
| 231 | + <JLabel id='country1Label'/>
|
|
| 232 | 232 | </cell>
|
| 233 | 233 | <cell anchor='east' weightx="1" fill="both">
|
| 234 | - <FilterableComboBox id='vessel1' genericType='VesselReference' beanScope="transmittingBuoy1"/>
|
|
| 234 | + <FilterableComboBox id='country1' genericType='CountryReference'/>
|
|
| 235 | 235 | </cell>
|
| 236 | 236 | </row>
|
| 237 | 237 | <row>
|
| ... | ... | @@ -277,18 +277,18 @@ |
| 277 | 277 | </row>
|
| 278 | 278 | <row>
|
| 279 | 279 | <cell anchor='west'>
|
| 280 | - <JLabel id='country2Label'/>
|
|
| 280 | + <JLabel id='vessel2Label'/>
|
|
| 281 | 281 | </cell>
|
| 282 | 282 | <cell anchor='east' weightx="1" fill="both">
|
| 283 | - <FilterableComboBox id='country2' genericType='CountryReference'/>
|
|
| 283 | + <FilterableComboBox id='vessel2' genericType='VesselReference'/>
|
|
| 284 | 284 | </cell>
|
| 285 | 285 | </row>
|
| 286 | 286 | <row>
|
| 287 | 287 | <cell anchor='west'>
|
| 288 | - <JLabel id='vessel2Label'/>
|
|
| 288 | + <JLabel id='country2Label'/>
|
|
| 289 | 289 | </cell>
|
| 290 | 290 | <cell anchor='east' weightx="1" fill="both">
|
| 291 | - <FilterableComboBox id='vessel2' genericType='VesselReference'/>
|
|
| 291 | + <FilterableComboBox id='country2' genericType='CountryReference'/>
|
|
| 292 | 292 | </cell>
|
| 293 | 293 | </row>
|
| 294 | 294 | <row>
|
| ... | ... | @@ -23,6 +23,7 @@ package fr.ird.observe.client.datasource.editor.ps.data.observation; |
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | 25 | import fr.ird.observe.client.datasource.editor.ps.data.dcp.DcpUIModelStates;
|
| 26 | +import fr.ird.observe.client.datasource.editor.ps.data.dcp.TransmittingBuoyListener;
|
|
| 26 | 27 | import fr.ird.observe.consolidation.data.ps.dcp.SimplifiedObjectTypeSpecializedRules;
|
| 27 | 28 | import fr.ird.observe.consolidation.data.ps.observation.FloatingObjectConsolidateEngine;
|
| 28 | 29 | import fr.ird.observe.consolidation.data.ps.observation.FloatingObjectConsolidateRequest;
|
| ... | ... | @@ -70,8 +71,8 @@ public class FloatingObjectUIModelStates extends GeneratedFloatingObjectUIModelS |
| 70 | 71 | private boolean arriving;
|
| 71 | 72 | private boolean leaving;
|
| 72 | 73 | private FloatingObjectConsolidateEngine consolidateEngine;
|
| 73 | - private TransmittingBuoyOwnershipListener<?> firstBuoyOwnershipListener;
|
|
| 74 | - private TransmittingBuoyOwnershipListener<?> secondBuoyOwnershipListener;
|
|
| 74 | + private TransmittingBuoyListener<?> firstBuoyListener;
|
|
| 75 | + private TransmittingBuoyListener<?> secondBuoyListener;
|
|
| 75 | 76 | |
| 76 | 77 | public FloatingObjectUIModelStates(GeneratedFloatingObjectUIModel model) {
|
| 77 | 78 | super(model);
|
| ... | ... | @@ -85,23 +86,23 @@ public class FloatingObjectUIModelStates extends GeneratedFloatingObjectUIModelS |
| 85 | 86 | }
|
| 86 | 87 | |
| 87 | 88 | @Override
|
| 88 | - public TransmittingBuoyOwnershipListener<?> getFirstBuoyOwnershipListener() {
|
|
| 89 | - return firstBuoyOwnershipListener;
|
|
| 89 | + public TransmittingBuoyListener<?> getFirstBuoyListener() {
|
|
| 90 | + return firstBuoyListener;
|
|
| 90 | 91 | }
|
| 91 | 92 | |
| 92 | 93 | @Override
|
| 93 | - public void setFirstBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> firstBuoyOwnershipListener) {
|
|
| 94 | - this.firstBuoyOwnershipListener = firstBuoyOwnershipListener;
|
|
| 94 | + public void setFirstBuoyListener(TransmittingBuoyListener<?> firstBuoyListener) {
|
|
| 95 | + this.firstBuoyListener = firstBuoyListener;
|
|
| 95 | 96 | }
|
| 96 | 97 | |
| 97 | 98 | @Override
|
| 98 | - public TransmittingBuoyOwnershipListener<?> getSecondBuoyOwnershipListener() {
|
|
| 99 | - return secondBuoyOwnershipListener;
|
|
| 99 | + public TransmittingBuoyListener<?> getSecondBuoyListener() {
|
|
| 100 | + return secondBuoyListener;
|
|
| 100 | 101 | }
|
| 101 | 102 | |
| 102 | 103 | @Override
|
| 103 | - public void setSecondBuoyOwnershipListener(TransmittingBuoyOwnershipListener<?> secondBuoyOwnershipListener) {
|
|
| 104 | - this.secondBuoyOwnershipListener = secondBuoyOwnershipListener;
|
|
| 104 | + public void setSecondBuoyListener(TransmittingBuoyListener<?> secondBuoyListener) {
|
|
| 105 | + this.secondBuoyListener = secondBuoyListener;
|
|
| 105 | 106 | }
|
| 106 | 107 | |
| 107 | 108 | @Override
|
| ... | ... | @@ -49,8 +49,6 @@ public class DataSourceMigrationForVersion_9_3 extends ByMajorMigrationVersionRe |
| 49 | 49 | if (withIds) {
|
| 50 | 50 | // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2044
|
| 51 | 51 | executor.addScript("01", "issue-2044");
|
| 52 | - // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2821
|
|
| 53 | - executor.addScript("02", "issue-2821");
|
|
| 54 | 52 | }
|
| 55 | 53 | }
|
| 56 | 54 |
| 1 | ----
|
|
| 2 | --- #%L
|
|
| 3 | --- ObServe Core :: Persistence :: Migration
|
|
| 4 | --- %%
|
|
| 5 | --- Copyright (C) 2008 - 2023 IRD, Ultreia.io
|
|
| 6 | --- %%
|
|
| 7 | --- This program is free software: you can redistribute it and/or modify
|
|
| 8 | --- it under the terms of the GNU General Public License as
|
|
| 9 | --- published by the Free Software Foundation, either version 3 of the
|
|
| 10 | --- License, or (at your option) any later version.
|
|
| 11 | ---
|
|
| 12 | --- This program is distributed in the hope that it will be useful,
|
|
| 13 | --- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 | --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 | --- GNU General Public License for more details.
|
|
| 16 | ---
|
|
| 17 | --- You should have received a copy of the GNU General Public
|
|
| 18 | --- License along with this program. If not, see
|
|
| 19 | --- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 | --- #L%
|
|
| 21 | ----
|
|
| 22 | -UPDATE ps_observation.TransmittingBuoy SET country = NULL WHERE vessel IS NOT NULL;
|
|
| 23 | -UPDATE ps_logbook.TransmittingBuoy SET country = NULL WHERE vessel IS NOT NULL; |
|
| \ No newline at end of file |