Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
d8798942
by Tony Chemit at 2020-12-13T14:06:25+01:00
-
57fd399c
by Tony Chemit at 2020-12-13T14:18:14+01:00
-
a822e8be
by Tony Chemit at 2020-12-13T14:40:27+01:00
-
0fd7d3c0
by Tony Chemit at 2020-12-13T14:40:58+01:00
-
17e8b3e6
by Tony Chemit at 2020-12-13T14:52:28+01:00
-
41b33c60
by Tony Chemit at 2020-12-13T14:52:54+01:00
26 changed files:
- client/core/src/main/resources/fr/ird/observe/client/ui/ObserveCommon.jcss
- client/datasource/editor/api/src/main/i18n/getters/java.getter
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/ContentUIInitializer.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIHandler.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIModel.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/ContentReferentialUIModelStates.java
- client/datasource/editor/api/src/main/java/fr/ird/observe/client/datasource/editor/api/content/referential/actions/BackToListReferential.java
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/FpaZoneUI.jaxx
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/LengthLengthParameterUI.jaxx
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/LengthWeightParameterUI.jaxx
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/ProgramUI.jaxx
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/ShipOwnerUI.jaxx
- client/datasource/editor/common/src/main/java/fr/ird/observe/client/datasource/editor/common/referential/common/VesselUI.jaxx
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripUI.jaxx
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/landing/LandingUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/common/TripUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/RouteUI.jaxx
- client/datasource/editor/ps/src/main/java/fr/ird/observe/client/datasource/editor/ps/data/observation/SetKeptTargetCatchUIModel.java
- client/i18n/src/main/i18n/translations/observe_en_GB.properties
- client/i18n/src/main/i18n/translations/observe_es_ES.properties
- client/i18n/src/main/i18n/translations/observe_fr_FR.properties
- models/dto/src/main/java/fr/ird/observe/dto/ProtectedIdsPs.java
- models/persistence/src/main/java/fr/ird/observe/entities/data/ps/observation/SetImpl.java
- models/persistence/src/main/models/Observe-20-data-ps-observation.model
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivitySimpleSpeedDtoValidator.java
- services/validation-spi/src/main/java/fr/ird/observe/validation/validators/ActivitySpeedDtoValidator.java
Changes:
| ... | ... | @@ -104,6 +104,10 @@ |
| 104 | 104 |
disabledIcon:{fr.ird.observe.client.util.UIHelper.getUIManagerActionIcon("data-observe")};
|
| 105 | 105 |
}
|
| 106 | 106 |
|
| 107 |
+.showReset {
|
|
| 108 |
+ showReset:true;
|
|
| 109 |
+}
|
|
| 110 |
+ |
|
| 107 | 111 |
JToolBar {
|
| 108 | 112 |
borderPainted:false;
|
| 109 | 113 |
floatable:false;
|
| ... | ... | @@ -275,7 +275,6 @@ observe.ui.datasource.storage.server.sessionExpire.reload |
| 275 | 275 |
observe.ui.datasource.storage.server.sessionExpire.title
|
| 276 | 276 |
observe.ui.datasource.storage.serverConfiguration.presets.save
|
| 277 | 277 |
observe.ui.datasource.storage.step.label
|
| 278 |
-observe.ui.datepicker.show
|
|
| 279 | 278 |
observe.ui.menu.navigation.ll
|
| 280 | 279 |
observe.ui.menu.navigation.ps
|
| 281 | 280 |
observe.ui.message.db.closed
|
| ... | ... | @@ -24,7 +24,6 @@ package fr.ird.observe.client.datasource.editor.api.content; |
| 24 | 24 |
|
| 25 | 25 |
import fr.ird.observe.client.WithClientUIContext;
|
| 26 | 26 |
import fr.ird.observe.client.configuration.WithClientConfig;
|
| 27 |
-import fr.ird.observe.client.datasource.editor.api.ObserveKeyStrokesEditorApi;
|
|
| 28 | 27 |
import fr.ird.observe.client.datasource.editor.api.content.actions.GoToTab;
|
| 29 | 28 |
import fr.ird.observe.client.datasource.editor.api.content.data.map.ObserveMapPane;
|
| 30 | 29 |
import fr.ird.observe.client.datasource.editor.api.content.data.map.TripMapUI;
|
| ... | ... | @@ -44,7 +43,6 @@ import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator; |
| 44 | 43 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 45 | 44 |
import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
| 46 | 45 |
import io.ultreia.java4all.bean.JavaBean;
|
| 47 |
-import io.ultreia.java4all.i18n.I18n;
|
|
| 48 | 46 |
import io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox;
|
| 49 | 47 |
import io.ultreia.java4all.jaxx.widgets.choice.BooleanEditor;
|
| 50 | 48 |
import io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor;
|
| ... | ... | @@ -56,10 +54,8 @@ import org.nuiton.jaxx.runtime.swing.Table; |
| 56 | 54 |
import org.nuiton.jaxx.validator.JAXXValidator;
|
| 57 | 55 |
import org.nuiton.jaxx.validator.swing.SwingValidatorUtil;
|
| 58 | 56 |
import org.nuiton.jaxx.widgets.BeanUIUtil;
|
| 59 |
-import org.nuiton.jaxx.widgets.datetime.BeanDateEditor;
|
|
| 57 |
+import org.nuiton.jaxx.widgets.datetime.DateEditor;
|
|
| 60 | 58 |
import org.nuiton.jaxx.widgets.datetime.DateTimeEditor;
|
| 61 |
-import org.nuiton.jaxx.widgets.datetime.ExtendedBasicDatePickerUI;
|
|
| 62 |
-import org.nuiton.jaxx.widgets.datetime.JAXXDatePicker;
|
|
| 63 | 59 |
import org.nuiton.jaxx.widgets.datetime.TimeEditor;
|
| 64 | 60 |
import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
|
| 65 | 61 |
import org.nuiton.jaxx.widgets.number.NumberEditor;
|
| ... | ... | @@ -73,7 +69,6 @@ import org.nuiton.jaxx.widgets.text.NormalTextEditor; |
| 73 | 69 |
import org.nuiton.jaxx.widgets.text.UrlEditor;
|
| 74 | 70 |
|
| 75 | 71 |
import javax.swing.ActionMap;
|
| 76 |
-import javax.swing.JButton;
|
|
| 77 | 72 |
import javax.swing.JComboBox;
|
| 78 | 73 |
import javax.swing.JComponent;
|
| 79 | 74 |
import javax.swing.JLabel;
|
| ... | ... | @@ -107,14 +102,13 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 107 | 102 |
public static final Class<?>[] MANAGED_TYPES = new Class<?>[]{
|
| 108 | 103 |
JComponent.class,
|
| 109 | 104 |
JToolBar.class,
|
| 110 |
- JAXXDatePicker.class,
|
|
| 111 | 105 |
BlockingLayerUI.class,
|
| 112 | 106 |
BeanCheckBox.class,
|
| 113 | 107 |
NumberEditor.class,
|
| 114 | 108 |
JaxxComboBox.class,
|
| 115 | 109 |
BeanListHeader.class,
|
| 116 | 110 |
FilterableDoubleList.class,
|
| 117 |
- BeanDateEditor.class,
|
|
| 111 |
+ DateEditor.class,
|
|
| 118 | 112 |
TimeEditor.class,
|
| 119 | 113 |
DateTimeEditor.class,
|
| 120 | 114 |
CoordinatesEditor.class,
|
| ... | ... | @@ -192,10 +186,9 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 192 | 186 |
.onComponents(CoordinatesEditor.class, true, this::init)
|
| 193 | 187 |
.onComponents(TemperatureEditor.class, true, this::init)
|
| 194 | 188 |
.onComponents(JToolBar.class, this::init)
|
| 195 |
- .onComponents(JAXXDatePicker.class, this::init)
|
|
| 196 | 189 |
.onComponents(BeanCheckBox.class, this::init)
|
| 197 | 190 |
.onComponents(NumberEditor.class, this::init)
|
| 198 |
- .onComponents(BeanDateEditor.class, this::init)
|
|
| 191 |
+ .onComponents(DateEditor.class, this::init)
|
|
| 199 | 192 |
.onComponents(BooleanEditor.class, this::init)
|
| 200 | 193 |
.onComponents(BeanEnumEditor.class, this::init)
|
| 201 | 194 |
.onComponents(ObserveSwingValidator.class, this::init)
|
| ... | ... | @@ -410,22 +403,6 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 410 | 403 |
editor.init();
|
| 411 | 404 |
}
|
| 412 | 405 |
|
| 413 |
- protected void init(JAXXDatePicker editor) {
|
|
| 414 |
- initializerContext.checkFirstPass();
|
|
| 415 |
- editor.setFormats("dd/MM/yyyy");
|
|
| 416 |
- ExtendedBasicDatePickerUI ui = new ExtendedBasicDatePickerUI() {
|
|
| 417 |
- @Override
|
|
| 418 |
- protected JButton createPopupButton() {
|
|
| 419 |
- JButton popupButton = super.createPopupButton();
|
|
| 420 |
- if (popupButton != null) {
|
|
| 421 |
- popupButton.setToolTipText(ObserveKeyStrokesEditorApi.suffixTextWithKeyStroke(I18n.t("observe.ui.datepicker.show"), ObserveKeyStrokesEditorApi.KEY_STROKE_GO_DOWN));
|
|
| 422 |
- }
|
|
| 423 |
- return popupButton;
|
|
| 424 |
- }
|
|
| 425 |
- };
|
|
| 426 |
- editor.setUI(ui);
|
|
| 427 |
- }
|
|
| 428 |
- |
|
| 429 | 406 |
protected void init(BooleanEditor editor) {
|
| 430 | 407 |
initializerContext.checkFirstPass();
|
| 431 | 408 |
editor.init();
|
| ... | ... | @@ -441,21 +418,9 @@ public class ContentUIInitializer<UI extends ContentUI> extends UIInitializerSup |
| 441 | 418 |
editor.init(I18nEnumHelper::getLabel);
|
| 442 | 419 |
}
|
| 443 | 420 |
|
| 444 |
- protected void init(BeanDateEditor editor) {
|
|
| 421 |
+ protected void init(DateEditor editor) {
|
|
| 445 | 422 |
initializerContext.checkFirstPass();
|
| 446 | 423 |
editor.setLocale(getClientConfig().getLocale());
|
| 447 |
- ExtendedBasicDatePickerUI ui = new ExtendedBasicDatePickerUI() {
|
|
| 448 |
- @Override
|
|
| 449 |
- protected JButton createPopupButton() {
|
|
| 450 |
- JButton popupButton = super.createPopupButton();
|
|
| 451 |
- if (popupButton != null) {
|
|
| 452 |
- popupButton.setToolTipText(ObserveKeyStrokesEditorApi.suffixTextWithKeyStroke(I18n.t("observe.ui.datepicker.show"), ObserveKeyStrokesEditorApi.KEY_STROKE_GO_DOWN));
|
|
| 453 |
- }
|
|
| 454 |
- return popupButton;
|
|
| 455 |
- }
|
|
| 456 |
- };
|
|
| 457 |
- ui.setShowPopupButton(true);
|
|
| 458 |
- editor.setUI(ui);
|
|
| 459 | 424 |
editor.init();
|
| 460 | 425 |
}
|
| 461 | 426 |
|
| ... | ... | @@ -122,6 +122,12 @@ public class ContentReferentialUIHandler<D extends ReferentialDto, R extends Ref |
| 122 | 122 |
protected ContentOpen<U> createContentOpen(U ui) {
|
| 123 | 123 |
ContentReferentialUIOpenExecutor<D, R, U> executor = new ContentReferentialUIOpenExecutor<>();
|
| 124 | 124 |
return new ContentOpen<>(ui, executor, executor);
|
| 125 |
+// return new ContentOpen<U>(ui, executor, executor) {
|
|
| 126 |
+// @Override
|
|
| 127 |
+// public boolean applyBeforeSave(Close close) {
|
|
| 128 |
+// return super.applyBeforeSave(close==Close.CLOSE?Close.RESET : close);
|
|
| 129 |
+// }
|
|
| 130 |
+// };
|
|
| 125 | 131 |
}
|
| 126 | 132 |
|
| 127 | 133 |
@Override
|
| ... | ... | @@ -24,12 +24,14 @@ package fr.ird.observe.client.datasource.editor.api.content.referential; |
| 24 | 24 |
import com.google.common.collect.ImmutableSet;
|
| 25 | 25 |
import fr.ird.observe.client.configuration.ClientConfig;
|
| 26 | 26 |
import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
|
| 27 |
+import fr.ird.observe.client.datasource.editor.api.content.ContentUI;
|
|
| 27 | 28 |
import fr.ird.observe.client.datasource.editor.api.content.ContentUIModel;
|
| 28 | 29 |
import fr.ird.observe.client.datasource.editor.api.content.actions.id.ChangeIdRequest;
|
| 29 | 30 |
import fr.ird.observe.client.datasource.editor.api.content.actions.id.ShowIdRequest;
|
| 30 | 31 |
import fr.ird.observe.client.datasource.editor.api.content.actions.save.SaveRequest;
|
| 31 | 32 |
import fr.ird.observe.client.datasource.editor.api.content.referential.usage.UsageForDesactivateUIHandler;
|
| 32 | 33 |
import fr.ird.observe.client.datasource.editor.api.navigation.tree.NavigationNode;
|
| 34 |
+import fr.ird.observe.client.util.init.DefaultUIInitializerResult;
|
|
| 33 | 35 |
import fr.ird.observe.dto.form.Form;
|
| 34 | 36 |
import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
| 35 | 37 |
import fr.ird.observe.dto.referential.ReferenceStatus;
|
| ... | ... | @@ -75,6 +77,12 @@ public abstract class ContentReferentialUIModel<D extends ReferentialDto, R exte |
| 75 | 77 |
return getSource().getContext().newModelStates(getSource().getInitializer());
|
| 76 | 78 |
}
|
| 77 | 79 |
|
| 80 |
+ @Override
|
|
| 81 |
+ public void init(ContentUI ui, DefaultUIInitializerResult initializerResult) {
|
|
| 82 |
+ super.init(ui, initializerResult);
|
|
| 83 |
+ getReferenceCache().registerComponents(initializerResult);
|
|
| 84 |
+ }
|
|
| 85 |
+ |
|
| 78 | 86 |
public void openForm(Form<D> form) {
|
| 79 | 87 |
getReferenceCache().loadReferentialReferenceSetsInModel(form);
|
| 80 | 88 |
setForm(form);
|
| ... | ... | @@ -58,6 +58,24 @@ public class ContentReferentialUIModelStates<D extends ReferentialDto, R extends |
| 58 | 58 |
this.bean = Objects.requireNonNull(bean);
|
| 59 | 59 |
}
|
| 60 | 60 |
|
| 61 |
+ @Override
|
|
| 62 |
+ public boolean canQuit() {
|
|
| 63 |
+ if (!isEnabled()) {
|
|
| 64 |
+ // model disabled, no check
|
|
| 65 |
+ return true;
|
|
| 66 |
+ }
|
|
| 67 |
+ if (!isEditing()) {
|
|
| 68 |
+ // model not editing, no check
|
|
| 69 |
+ return true;
|
|
| 70 |
+ }
|
|
| 71 |
+ if (isReadingMode()) {
|
|
| 72 |
+ // model in reading mode, no check
|
|
| 73 |
+ return true;
|
|
| 74 |
+ }
|
|
| 75 |
+ // can quit only if model not modified
|
|
| 76 |
+ return !isGlobalModified();
|
|
| 77 |
+ }
|
|
| 78 |
+ |
|
| 61 | 79 |
public String[] getNaturalIds() {
|
| 62 | 80 |
return naturalIds;
|
| 63 | 81 |
}
|
| ... | ... | @@ -51,6 +51,10 @@ public final class BackToListReferential<D extends ReferentialDto, R extends Ref |
| 51 | 51 |
ContentOpen.Close close = contentOpen.tryToClose();
|
| 52 | 52 |
if (close == ContentOpen.Close.CANCEL) {
|
| 53 | 53 |
return;
|
| 54 |
+ }if (close == ContentOpen.Close.CLOSE) {
|
|
| 55 |
+ // special case, in this form we always need to stop editing (editing does not means editable...)
|
|
| 56 |
+ //FIXME Review the form to stop using the editing property for this
|
|
| 57 |
+ close = ContentOpen.Close.RESET;
|
|
| 54 | 58 |
}
|
| 55 | 59 |
boolean canQuit = contentOpen.applyBeforeSave(close);
|
| 56 | 60 |
if (!canQuit) {
|
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 |
fr.ird.observe.dto.referential.common.FpaZoneDto
|
| 28 | 28 |
fr.ird.observe.dto.referential.common.FpaZoneReference
|
| 29 | 29 |
|
| 30 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 30 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 31 | 31 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| 32 | 32 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 33 | 33 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| ... | ... | @@ -79,8 +79,8 @@ |
| 79 | 79 |
</cell>
|
| 80 | 80 |
<cell anchor='west' weightx="1" fill="both">
|
| 81 | 81 |
<JPanel layout='{new GridLayout()}'>
|
| 82 |
- <BeanDateEditor id='startDate'/>
|
|
| 83 |
- <BeanDateEditor id='endDate'/>
|
|
| 82 |
+ <DateEditor id='startDate' styleClass='showReset'/>
|
|
| 83 |
+ <DateEditor id='endDate' styleClass='showReset'/>
|
|
| 84 | 84 |
</JPanel>
|
| 85 | 85 |
</cell>
|
| 86 | 86 |
</row>
|
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| 40 | 40 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 41 | 41 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 42 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 42 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 43 | 43 |
|
| 44 | 44 |
javax.swing.JScrollPane
|
| 45 | 45 |
javax.swing.JTable
|
| ... | ... | @@ -105,8 +105,8 @@ |
| 105 | 105 |
</cell>
|
| 106 | 106 |
<cell anchor='west' weightx="1" fill="both">
|
| 107 | 107 |
<JPanel layout='{new GridLayout()}'>
|
| 108 |
- <BeanDateEditor id='startDate'/>
|
|
| 109 |
- <BeanDateEditor id='endDate'/>
|
|
| 108 |
+ <DateEditor id='startDate' styleClass='showReset'/>
|
|
| 109 |
+ <DateEditor id='endDate' styleClass='showReset'/>
|
|
| 110 | 110 |
</JPanel>
|
| 111 | 111 |
</cell>
|
| 112 | 112 |
</row>
|
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| 39 | 39 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 40 | 40 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 41 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 41 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 42 | 42 |
|
| 43 | 43 |
javax.swing.JScrollPane
|
| 44 | 44 |
javax.swing.JTable
|
| ... | ... | @@ -131,8 +131,8 @@ public void decorateUniqueKeyTable(JTable table, TableCellRenderer renderer, JSc |
| 131 | 131 |
</cell>
|
| 132 | 132 |
<cell anchor='west' weightx="1" fill="both">
|
| 133 | 133 |
<JPanel layout='{new GridLayout()}'>
|
| 134 |
- <BeanDateEditor id='startDate'/>
|
|
| 135 |
- <BeanDateEditor id='endDate'/>
|
|
| 134 |
+ <DateEditor id='startDate' styleClass='showReset'/>
|
|
| 135 |
+ <DateEditor id='endDate' styleClass='showReset'/>
|
|
| 136 | 136 |
</JPanel>
|
| 137 | 137 |
</cell>
|
| 138 | 138 |
</row>
|
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 |
|
| 35 | 35 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 36 | 36 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 37 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 37 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 38 | 38 |
|
| 39 | 39 |
org.nuiton.jaxx.widgets.text.BigTextEditor
|
| 40 | 40 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| ... | ... | @@ -117,8 +117,8 @@ |
| 117 | 117 |
</cell>
|
| 118 | 118 |
<cell anchor='west'>
|
| 119 | 119 |
<JPanel layout='{new GridLayout()}'>
|
| 120 |
- <BeanDateEditor id='startDate'/>
|
|
| 121 |
- <BeanDateEditor id='endDate'/>
|
|
| 120 |
+ <DateEditor id='startDate' styleClass='showReset'/>
|
|
| 121 |
+ <DateEditor id='endDate' styleClass='showReset'/>
|
|
| 122 | 122 |
</JPanel>
|
| 123 | 123 |
</cell>
|
| 124 | 124 |
</row>
|
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| 33 | 33 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 34 | 34 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 35 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 35 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 36 | 36 |
static fr.ird.observe.client.util.UIHelper.getStringValue
|
| 37 | 37 |
fr.ird.observe.dto.referential.ReferenceStatus
|
| 38 | 38 |
</import>
|
| ... | ... | @@ -100,8 +100,8 @@ |
| 100 | 100 |
</cell>
|
| 101 | 101 |
<cell anchor='west' weightx="1" fill="both">
|
| 102 | 102 |
<JPanel layout='{new GridLayout()}'>
|
| 103 |
- <BeanDateEditor id='startDate'/>
|
|
| 104 |
- <BeanDateEditor id='endDate'/>
|
|
| 103 |
+ <DateEditor id='startDate' styleClass='showReset'/>
|
|
| 104 |
+ <DateEditor id='endDate' styleClass='showReset'/>
|
|
| 105 | 105 |
</JPanel>
|
| 106 | 106 |
</cell>
|
| 107 | 107 |
</row>
|
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 |
org.nuiton.jaxx.widgets.text.NormalTextEditor
|
| 37 | 37 |
io.ultreia.java4all.jaxx.widgets.combobox.BeanEnumEditor
|
| 38 | 38 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 39 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 39 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 40 | 40 |
|
| 41 | 41 |
static fr.ird.observe.client.util.UIHelper.getStringValue
|
| 42 | 42 |
fr.ird.observe.dto.referential.ReferenceStatus
|
| ... | ... | @@ -209,7 +209,7 @@ |
| 209 | 209 |
<JLabel id='changeDateLabel'/>
|
| 210 | 210 |
</cell>
|
| 211 | 211 |
<cell anchor='west'>
|
| 212 |
- <BeanDateEditor id='changeDate'/>
|
|
| 212 |
+ <DateEditor id='changeDate' styleClass='showReset'/>
|
|
| 213 | 213 |
</cell>
|
| 214 | 214 |
</row>
|
| 215 | 215 |
<row>
|
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 |
fr.ird.observe.dto.referential.ll.common.ObservationMethodReference
|
| 35 | 35 |
fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates
|
| 36 | 36 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 37 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 37 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 38 | 38 |
|
| 39 | 39 |
fr.ird.observe.client.datasource.editor.api.content.data.map.TripMapUI
|
| 40 | 40 |
|
| ... | ... | @@ -131,7 +131,7 @@ |
| 131 | 131 |
<JLabel id='startDateLabel'/>
|
| 132 | 132 |
</cell>
|
| 133 | 133 |
<cell anchor='west' weightx="0.5">
|
| 134 |
- <BeanDateEditor id='startDate'/>
|
|
| 134 |
+ <DateEditor id='startDate'/>
|
|
| 135 | 135 |
</cell>
|
| 136 | 136 |
</row>
|
| 137 | 137 |
|
| ... | ... | @@ -151,7 +151,7 @@ |
| 151 | 151 |
<JLabel id='endDateLabel'/>
|
| 152 | 152 |
</cell>
|
| 153 | 153 |
<cell anchor='west' weightx="0.5">
|
| 154 |
- <BeanDateEditor id='endDate'/>
|
|
| 154 |
+ <DateEditor id='endDate'/>
|
|
| 155 | 155 |
</cell>
|
| 156 | 156 |
</row>
|
| 157 | 157 |
|
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 |
fr.ird.observe.client.ObserveSwingApplicationContext
|
| 35 | 35 |
fr.ird.observe.client.datasource.editor.api.content.data.table.ContentTableUIModelStates
|
| 36 | 36 |
fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates
|
| 37 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 37 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 38 | 38 |
|
| 39 | 39 |
org.nuiton.jaxx.widgets.text.BigTextEditor
|
| 40 | 40 |
org.nuiton.jaxx.widgets.number.NumberEditor
|
| ... | ... | @@ -141,7 +141,7 @@ |
| 141 | 141 |
<JLabel id='startDateLabel'/>
|
| 142 | 142 |
</cell>
|
| 143 | 143 |
<cell anchor='east' weightx="1">
|
| 144 |
- <BeanDateEditor id='startDate'/>
|
|
| 144 |
+ <DateEditor id='startDate'/>
|
|
| 145 | 145 |
</cell>
|
| 146 | 146 |
</row>
|
| 147 | 147 |
|
| ... | ... | @@ -151,7 +151,7 @@ |
| 151 | 151 |
<JLabel id='endDateLabel'/>
|
| 152 | 152 |
</cell>
|
| 153 | 153 |
<cell anchor='east' weightx="1">
|
| 154 |
- <BeanDateEditor id='endDate'/>
|
|
| 154 |
+ <DateEditor id='endDate'/>
|
|
| 155 | 155 |
</cell>
|
| 156 | 156 |
</row>
|
| 157 | 157 |
<row>
|
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 |
|
| 35 | 35 |
fr.ird.observe.client.datasource.editor.api.content.data.map.TripMapUI
|
| 36 | 36 |
fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates
|
| 37 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 37 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 38 | 38 |
io.ultreia.java4all.jaxx.widgets.choice.BeanCheckBox
|
| 39 | 39 |
|
| 40 | 40 |
org.nuiton.jaxx.widgets.number.NumberEditor
|
| ... | ... | @@ -177,7 +177,7 @@ |
| 177 | 177 |
<JLabel id='startDateLabel'/>
|
| 178 | 178 |
</cell>
|
| 179 | 179 |
<cell anchor='west' weightx="0.5">
|
| 180 |
- <BeanDateEditor id='startDate'/>
|
|
| 180 |
+ <DateEditor id='startDate'/>
|
|
| 181 | 181 |
</cell>
|
| 182 | 182 |
</row>
|
| 183 | 183 |
|
| ... | ... | @@ -187,7 +187,7 @@ |
| 187 | 187 |
<JLabel id='endDateLabel'/>
|
| 188 | 188 |
</cell>
|
| 189 | 189 |
<cell anchor='west' weightx="0.5">
|
| 190 |
- <BeanDateEditor id='endDate'/>
|
|
| 190 |
+ <DateEditor id='endDate'/>
|
|
| 191 | 191 |
</cell>
|
| 192 | 192 |
</row>
|
| 193 | 193 |
|
| ... | ... | @@ -24,8 +24,7 @@ |
| 24 | 24 |
<import>
|
| 25 | 25 |
fr.ird.observe.dto.data.ps.observation.RouteDto
|
| 26 | 26 |
fr.ird.observe.client.datasource.editor.api.content.data.open.ContentOpenableUIModelStates
|
| 27 |
- org.nuiton.jaxx.widgets.datetime.BeanDateEditor
|
|
| 28 |
- |
|
| 27 |
+ org.nuiton.jaxx.widgets.datetime.DateEditor
|
|
| 29 | 28 |
org.nuiton.jaxx.widgets.number.NumberEditor
|
| 30 | 29 |
org.nuiton.jaxx.widgets.text.BigTextEditor
|
| 31 | 30 |
|
| ... | ... | @@ -50,7 +49,7 @@ |
| 50 | 49 |
<JLabel id='dateLabel'/>
|
| 51 | 50 |
</cell>
|
| 52 | 51 |
<cell anchor='east' weightx="1">
|
| 53 |
- <BeanDateEditor id='date'/>
|
|
| 52 |
+ <DateEditor id='date'/>
|
|
| 54 | 53 |
</cell>
|
| 55 | 54 |
</row>
|
| 56 | 55 |
<row>
|
| ... | ... | @@ -22,12 +22,16 @@ package fr.ird.observe.client.datasource.editor.ps.data.observation; |
| 22 | 22 |
* #L%
|
| 23 | 23 |
*/
|
| 24 | 24 |
|
| 25 |
+import fr.ird.observe.client.ClientUIContextApplicationComponent;
|
|
| 25 | 26 |
import fr.ird.observe.client.configuration.ClientConfig;
|
| 27 |
+import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
|
| 26 | 28 |
import fr.ird.observe.client.datasource.api.cache.ReferencesCache;
|
| 27 | 29 |
import fr.ird.observe.client.datasource.api.cache.ReferencesFilterHelper;
|
| 28 | 30 |
import fr.ird.observe.client.datasource.editor.api.content.data.table.AskToDelete;
|
| 31 |
+import fr.ird.observe.dto.ProtectedIdsPs;
|
|
| 29 | 32 |
import fr.ird.observe.dto.data.ps.observation.KeptTargetCatchDto;
|
| 30 | 33 |
import fr.ird.observe.dto.data.ps.observation.SetKeptTargetCatchDto;
|
| 34 |
+import fr.ird.observe.dto.referential.common.WeightMeasureMethodReference;
|
|
| 31 | 35 |
import fr.ird.observe.services.ObserveServicesProvider;
|
| 32 | 36 |
import io.ultreia.java4all.i18n.I18n;
|
| 33 | 37 |
|
| ... | ... | @@ -40,9 +44,11 @@ import java.util.List; |
| 40 | 44 |
* @since XXX
|
| 41 | 45 |
*/
|
| 42 | 46 |
public class SetKeptTargetCatchUIModel extends GeneratedSetKeptTargetCatchUIModel {
|
| 43 |
- |
|
| 47 |
+ private final WeightMeasureMethodReference defaultWeightMeasureMethod;
|
|
| 44 | 48 |
public SetKeptTargetCatchUIModel(SetKeptTargetCatchUINavigationNode source) {
|
| 45 | 49 |
super(source);
|
| 50 |
+ ObserveSwingDataSource dataSource = ClientUIContextApplicationComponent.value().getDataSourcesManager().getMainDataSource();
|
|
| 51 |
+ defaultWeightMeasureMethod = dataSource.getReferentialReferenceSet(WeightMeasureMethodReference.class).tryGetReferenceById(ProtectedIdsPs.PS_OBSERVATION_KEPT_TARGET_CATCH_DEFAULT_WEIGHT_MEASURE_METHOD_ID).orElseThrow(IllegalStateException::new);
|
|
| 46 | 52 |
}
|
| 47 | 53 |
|
| 48 | 54 |
@Override
|
| ... | ... | @@ -59,4 +65,15 @@ public class SetKeptTargetCatchUIModel extends GeneratedSetKeptTargetCatchUIMode |
| 59 | 65 |
return ask.needDelete(this.getClientUIContext().getDecoratorService(), originalBean, bean);
|
| 60 | 66 |
|
| 61 | 67 |
}
|
| 68 |
+ |
|
| 69 |
+ public WeightMeasureMethodReference getDefaultWeightMeasureMethod() {
|
|
| 70 |
+ return defaultWeightMeasureMethod;
|
|
| 71 |
+ }
|
|
| 72 |
+ |
|
| 73 |
+ @Override
|
|
| 74 |
+ public KeptTargetCatchDto newTableEditBean() {
|
|
| 75 |
+ KeptTargetCatchDto result = super.newTableEditBean();
|
|
| 76 |
+ result.setWeightMeasureMethod(getDefaultWeightMeasureMethod());
|
|
| 77 |
+ return result;
|
|
| 78 |
+ }
|
|
| 62 | 79 |
}
|
| ... | ... | @@ -1591,7 +1591,6 @@ observe.ui.datasource.storage.useRemoteStorage.config=Configure remote data sour |
| 1591 | 1591 |
observe.ui.datasource.storage.useRemoteStorage.description=Please configure connexion to remote data source\nYou must validate your connexion to continue.
|
| 1592 | 1592 |
observe.ui.datasource.storage.useServerStorage.config=Configure remote server to use
|
| 1593 | 1593 |
observe.ui.datasource.storage.useServerStorage.description=Please configure connexion to remote server\nYou must validate your connexion to continue.
|
| 1594 |
-observe.ui.datepicker.show=To show date picker dialog
|
|
| 1595 | 1594 |
observe.ui.menu.actions=Actions
|
| 1596 | 1595 |
observe.ui.menu.configuration=Configuration
|
| 1597 | 1596 |
observe.ui.menu.configuration.tip=To configure application
|
| ... | ... | @@ -1591,7 +1591,6 @@ observe.ui.datasource.storage.useRemoteStorage.config=Configurar la base remota |
| 1591 | 1591 |
observe.ui.datasource.storage.useRemoteStorage.description=Configure la conexión a la base remota\nAntes de continuar, debe validar la conexión.
|
| 1592 | 1592 |
observe.ui.datasource.storage.useServerStorage.config=Configurar el servidor remoto a utilizar
|
| 1593 | 1593 |
observe.ui.datasource.storage.useServerStorage.description=Configure su conexión al servidor remoto\nAntes de que pueda continuar, tiene que validar la conexión.
|
| 1594 |
-observe.ui.datepicker.show=To show date picker dialog \#TODO
|
|
| 1595 | 1594 |
observe.ui.menu.actions=Acciones
|
| 1596 | 1595 |
observe.ui.menu.configuration=Configuración
|
| 1597 | 1596 |
observe.ui.menu.configuration.tip=Menú de configuración
|
| ... | ... | @@ -1591,7 +1591,6 @@ observe.ui.datasource.storage.useRemoteStorage.config=Configurer la base distant |
| 1591 | 1591 |
observe.ui.datasource.storage.useRemoteStorage.description=Veuillez configurer votre connexion à la base distante\nAvant de pouvoir poursuivre, vous devez valider la connexion.
|
| 1592 | 1592 |
observe.ui.datasource.storage.useServerStorage.config=Configurer le serveur distant à utiliser
|
| 1593 | 1593 |
observe.ui.datasource.storage.useServerStorage.description=Veuillez configurer votre connexion au serveur distant\nAvant de pouvoir poursuivre, vous devez valider la connexion.
|
| 1594 |
-observe.ui.datepicker.show=Pour ouvrir l'éditeur de date
|
|
| 1595 | 1594 |
observe.ui.menu.actions=Actions
|
| 1596 | 1595 |
observe.ui.menu.configuration=Configuration
|
| 1597 | 1596 |
observe.ui.menu.configuration.tip=Menu de configuration
|
| ... | ... | @@ -56,6 +56,7 @@ public interface ProtectedIdsPs { |
| 56 | 56 |
String PS_OBSERVATION_FOB_OBSERVED_SYSTEM = "fr.ird.referential.ps.observation.ObservedSystem#0#1.2";
|
| 57 | 57 |
ImmutableSet<String> PS_OBSERVATION_FOB_OBSERVED_SYSTEM_EXCLUDE_OPERATIONS = ImmutableSet.of("fr.ird.referential.ps.common.ObjectOperation#0#10", "fr.ird.referential.ps.common.ObjectOperation#0#1");
|
| 58 | 58 |
String PS_OBSERVATION_SCHOOL_ESTIMATE_DEFAULT_WEIGHT_MEASURE_METHOD_ID = "fr.ird.referential.common.WeightMeasureMethod#666#04";
|
| 59 |
+ String PS_OBSERVATION_KEPT_TARGET_CATCH_DEFAULT_WEIGHT_MEASURE_METHOD_ID = "fr.ird.referential.common.WeightMeasureMethod#666#01";
|
|
| 59 | 60 |
String PS_LOGBOOK_TRIP_DEFAULT_DATA_QUALITY_ID = "fr.ird.referential.common.DataQuality#0#5";
|
| 60 | 61 |
String PS_LOGBOOK_TRIP_DEFAULT_DEPARTURE_WELL_STATES_ID = "fr.ird.referential.ps.logbook.WellsState#666#03";
|
| 61 | 62 |
String PS_LOGBOOK_TRIP_DEFAULT_LANDING_WELL_STATES_ID = "fr.ird.referential.ps.logbook.WellsState#666#03";
|
| ... | ... | @@ -35,7 +35,6 @@ import fr.ird.observe.dto.data.ps.observation.SetDto; |
| 35 | 35 |
import fr.ird.observe.dto.data.ps.observation.SetKeptTargetCatchDto;
|
| 36 | 36 |
import fr.ird.observe.dto.data.ps.observation.SetNonTargetCatchDto;
|
| 37 | 37 |
import fr.ird.observe.dto.data.ps.observation.SetNonTargetCatchReleaseDto;
|
| 38 |
-import fr.ird.observe.dto.data.ps.observation.SetSchoolEstimateDto;
|
|
| 39 | 38 |
import fr.ird.observe.dto.reference.DtoReferenceAware;
|
| 40 | 39 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 41 | 40 |
import fr.ird.observe.dto.referential.common.SpeciesReference;
|
| ... | ... | @@ -234,9 +233,6 @@ public class SetImpl extends SetAbstract { |
| 234 | 233 |
return;
|
| 235 | 234 |
}
|
| 236 | 235 |
super.fromDto(referentialLocale, dto);
|
| 237 |
- if (dto instanceof SetSchoolEstimateDto) {
|
|
| 238 |
- getSchoolEstimate().forEach(t -> t.setSet(this));
|
|
| 239 |
- }
|
|
| 240 | 236 |
}
|
| 241 | 237 |
|
| 242 | 238 |
private void fromSetNonTargetCatchDto(ReferentialLocale referentialLocale, SetNonTargetCatchDto dto) {
|
| ... | ... | @@ -130,11 +130,10 @@ endLogValue + {*:1} Float | sqlType=numeric |
| 130 | 130 |
checkLevel + {*:1} int
|
| 131 | 131 |
activity + {*} data.ps.observation.Activity | unique orderBy=time
|
| 132 | 132 |
|
| 133 |
-data.ps.observation.SchoolEstimate > data.DataEntity | naturalIdMutable entity
|
|
| 133 |
+data.ps.observation.SchoolEstimate > data.DataEntity | entity
|
|
| 134 | 134 |
totalWeight + {*:1} Integer
|
| 135 | 135 |
meanWeight + {*:1} Integer
|
| 136 |
-set {*:1} data.ps.observation.Set | naturalId skipModelNavigation
|
|
| 137 |
-species {*:1} referential.common.Species | naturalId
|
|
| 136 |
+species {*:1} referential.common.Species
|
|
| 138 | 137 |
weightMeasureMethod {*:0..1} referential.common.WeightMeasureMethod
|
| 139 | 138 |
|
| 140 | 139 |
data.ps.observation.Set > data.DataEntity >> data.SetAware | entity constants=targetSampleCapture,endSetDate,endPursingDate,endSetTime,endPursingTime
|
| ... | ... | @@ -157,7 +156,7 @@ nonTargetCatch + {*} data.ps.observation.NonTargetCatch | ordered |
| 157 | 156 |
reasonForNullSet {*:0..1} referential.ps.observation.ReasonForNullSet
|
| 158 | 157 |
nonTargetSample + {*} data.ps.observation.NonTargetSample | unique
|
| 159 | 158 |
targetSample + {*} data.ps.observation.TargetSample | unique
|
| 160 |
-targetCatch + {*} data.ps.observation.TargetCatch | ordered
|
|
| 159 |
+targetCatch + {*} data.ps.observation.TargetCatch | ordered inverse=false
|
|
| 161 | 160 |
schoolEstimate + {*} data.ps.observation.SchoolEstimate | orderBy=topiaCreateDate
|
| 162 | 161 |
nonTargetCatchRelease + {*} data.ps.observation.NonTargetCatchRelease | ordered
|
| 163 | 162 |
hasDiscardedTargetCatch() boolean
|
| ... | ... | @@ -188,7 +187,7 @@ catchWeight + {*:1} Float | sqlType=numeric |
| 188 | 187 |
well + {*:1} String | naturalId notNull=false
|
| 189 | 188 |
broughtOnDeck + {*:1} Boolean
|
| 190 | 189 |
discarded + {*:1} boolean | naturalId
|
| 191 |
-set {*:1} data.ps.observation.Set | naturalId skipModelNavigation
|
|
| 190 |
+set {*:1} data.ps.observation.Set | naturalId inverse skipModelNavigation
|
|
| 192 | 191 |
weightCategory {*:1} referential.ps.observation.WeightCategory | naturalId
|
| 193 | 192 |
reasonForDiscard {*:0..1} referential.ps.observation.ReasonForDiscard | naturalId notNull=false
|
| 194 | 193 |
weightMeasureMethod {*:0..1} referential.common.WeightMeasureMethod
|
| ... | ... | @@ -179,6 +179,11 @@ public class ActivitySimpleSpeedDtoValidator extends FieldValidatorSupport { |
| 179 | 179 |
RouteDto route = (RouteDto) stack.findValue("currentPsObservationRoute");
|
| 180 | 180 |
|
| 181 | 181 |
Objects.requireNonNull(route, " could not find currentPsObservationRoute in valueStack");
|
| 182 |
+ if (route.getDate() == null) {
|
|
| 183 |
+ // cas limite (pas de date sur la route)
|
|
| 184 |
+ log.debug(String.format("Missing route date : %s, skip speed computation", route.getId()));
|
|
| 185 |
+ return;
|
|
| 186 |
+ }
|
|
| 182 | 187 |
|
| 183 | 188 |
ActivityStubDto previousActivity;
|
| 184 | 189 |
|
| ... | ... | @@ -77,6 +77,7 @@ public class ActivitySpeedDtoValidator extends FieldValidatorSupport { |
| 77 | 77 |
private CollectionFieldExpressionValidator delegate;
|
| 78 | 78 |
private boolean enable;
|
| 79 | 79 |
private Float speed;
|
| 80 |
+ |
|
| 80 | 81 |
public Float getSpeed() {
|
| 81 | 82 |
return speed;
|
| 82 | 83 |
}
|
| ... | ... | @@ -145,6 +146,11 @@ public class ActivitySpeedDtoValidator extends FieldValidatorSupport { |
| 145 | 146 |
return true;
|
| 146 | 147 |
}
|
| 147 | 148 |
|
| 149 |
+ if (route.getDate() == null) {
|
|
| 150 |
+ // cas limite (pas de date sur la route)
|
|
| 151 |
+ LOG.debug(String.format("Missing route date : %s, skip speed computation", route.getId()));
|
|
| 152 |
+ return true;
|
|
| 153 |
+ }
|
|
| 148 | 154 |
GPSPoint previousPoint = newPoint(route, previousActivity);
|
| 149 | 155 |
GPSPoint currentPoint = newPoint(route, currentActivity);
|
| 150 | 156 |
|
| ... | ... | @@ -178,6 +184,7 @@ public class ActivitySpeedDtoValidator extends FieldValidatorSupport { |
| 178 | 184 |
public float getComputedSpeed() {
|
| 179 | 185 |
return computedSpeed;
|
| 180 | 186 |
}
|
| 187 |
+ |
|
| 181 | 188 |
public float getSpeed() {
|
| 182 | 189 |
return ActivitySpeedDtoValidator.this.getSpeed();
|
| 183 | 190 |
}
|