Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 552697be by Tony CHEMIT at 2018-09-13T09:58:21Z migrate to log4j2 - - - - - 05e5a07d by Tony CHEMIT at 2018-09-13T09:58:39Z do not close and generate changelog while release, this should be done before. - - - - - 85f75e03 by Tony CHEMIT at 2018-09-13T11:09:25Z Report v7 (revue des raccourcis claviers) - - - - - 5632a47c by Tony CHEMIT at 2018-09-13T11:10:42Z Ajout de la donnée observe_longline.SetLogbook - See #909 - - - - - e7d28acc by Tony CHEMIT at 2018-09-13T11:11:22Z Ajout de la donnée observe_longline.CatchLogbook - See #911  - - - - - 20 changed files: - client-configuration/src/main/config/Client.ini - client/src/main/java/fr/ird/observe/client/ObserveResourceManager.java - client/src/main/java/fr/ird/observe/client/ObserveRunner.java - client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUI.jcss - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/LonglineGlobalCompositionLogbookUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/LonglineGlobalCompositionLogbookUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUI.jcss - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUIModel.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/obs/LonglineGlobalCompositionObsUI.jaxx - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/obs/LonglineGlobalCompositionObsUIHandler.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/binder/data/longline/SetLonglineLogbookEntityDtoBinder.java - persistence/src/main/java/fr/ird/observe/binder/data/longline/SetLonglineLogbookEntityReferenceBinder.java Changes: ===================================== client-configuration/src/main/config/Client.ini ===================================== @@ -142,7 +142,7 @@ final = true description = observe.config.logConfigurationFile.description key = logConfigurationFile type = file -defaultValue = ${resources.directory}/observe-log4j.properties +defaultValue = ${resources.directory}/observe-log4j2.xml transient = true [option swingSessionFile] ===================================== client/src/main/java/fr/ird/observe/client/ObserveResourceManager.java ===================================== @@ -24,8 +24,8 @@ package fr.ird.observe.client; import fr.ird.observe.client.configuration.ClientConfig; import fr.ird.observe.client.configuration.ClientConfigOption; import org.apache.commons.io.IOUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.util.SortedProperties; import org.nuiton.util.ZipUtil; @@ -60,7 +60,7 @@ public class ObserveResourceManager { private static final String OBSERVE_APPLICATION_PROPERTIES = "/observe-application.properties"; private static final String OBSERVE_REPORTS_PROPERTIES = "/observe-reports.properties"; private static final String OBSERVE_MAP_ARCHIVE = "/map.zip"; - private static final String OBSERVE_LOG_CONFIGURATION_FILE_PROPERTIES = "/observe-log4j.properties"; + private static final String OBSERVE_LOG_CONFIGURATION_FILE_PROPERTIES = "/observe-log4j2.xml"; /** Logger */ private static final Logger log = LogManager.getLogger(ObserveResourceManager.class); ===================================== client/src/main/java/fr/ird/observe/client/ObserveRunner.java ===================================== @@ -59,6 +59,7 @@ import java.util.Arrays; import java.util.Date; import java.util.Locale; import java.util.Properties; +import java.util.logging.Level; import static fr.ird.observe.client.configuration.ClientConfigOption.BACKUP_DIRECTORY; import static fr.ird.observe.client.configuration.ClientConfigOption.DATA_DIRECTORY; @@ -79,6 +80,12 @@ import static org.nuiton.i18n.I18n.t; */ public abstract class ObserveRunner extends ApplicationRunner { + static { + System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager"); + java.util.logging.LogManager.getLogManager().reset(); + java.util.logging.LogManager.getLogManager().getLogger("").setLevel(Level.SEVERE); + } + /** Logger */ private static Logger log = LogManager.getLogger(ObserveRunner.class); ===================================== client/src/main/java/fr/ird/observe/client/ui/actions/content/GoToTabUIActionSupport.java ===================================== @@ -58,4 +58,9 @@ public abstract class GoToTabUIActionSupport extends AbstractContentUIAction { } mainTabbedPane.setSelectedIndex(tabIndex); } + + @Override + protected ContentUI<?, ?> getContentUI(ContentUI<?, ?> contentUI) { + return contentUI; + } } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUI.jaxx ===================================== @@ -200,6 +200,9 @@ <cell weightx='1' anchor='east'> <BeanFilterableComboBox id='onBoardProcessing' constructorParams='this' genericType='OnBoardProcessingReference'/> </cell> + <cell> + <JLabel id='photoReferencesLabel'/> + </cell> <cell anchor='east' weightx="1" fill="both"> <JPanel layout='{new BorderLayout()}'> <JToolBar id='photoReferencesToolbar' constraints='BorderLayout.WEST'> @@ -238,7 +241,7 @@ <JLabel id='countDepredatedLabel'/> </cell> <cell weightx='1' anchor='east'> - <NumberEditor id='countDepredated' constructorParams='this' styleClass="float3"/> + <NumberEditor id='countDepredated' constructorParams='this' styleClass="int6"/> </cell> </row> <!-- depredatedProportion --> @@ -247,7 +250,7 @@ <JLabel id='depredatedProportionLabel'/> </cell> <cell weightx='1' anchor='east'> - <NumberEditor id='depredatedProportion' constructorParams='this' styleClass="float3"/> + <NumberEditor id='depredatedProportion' constructorParams='this' styleClass="int6"/> </cell> </row> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUI.jcss ===================================== @@ -163,6 +163,11 @@ numberValue:{tableEditBean.getBeatDiameter()}; } +#countDepredated { + property:{CatchLonglineLogbookDto.PROPERTY_COUNT_DEPREDATED}; + numberValue:{tableEditBean.getCountDepredated()}; +} + #depredated { horizontalTextPosition:{JCheckBox.LEFT}; _tablePropertyName:{CatchLonglineLogbookDto.PROPERTY_DEPREDATED}; ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/CatchLonglineLogbookUIHandler.java ===================================== @@ -37,6 +37,7 @@ import fr.ird.observe.client.ui.util.table.AutotSelectRowAndShowPopupActionSuppo import fr.ird.observe.dto.data.longline.ActivityLonglineLogbookDto; import fr.ird.observe.dto.data.longline.CatchLonglineLogbookDto; import fr.ird.observe.dto.data.longline.SetLonglineLogbookCatchDto; +import fr.ird.observe.dto.data.longline.SetLonglineLogbookCatchHelper; import fr.ird.observe.dto.data.longline.TripLonglineReference; import fr.ird.observe.dto.form.Form; import fr.ird.observe.dto.navigation.edit.node.ObserveLonglineLogbookSetEditNode; @@ -48,8 +49,8 @@ import fr.ird.observe.dto.referential.longline.CatchFateLonglineReference; import fr.ird.observe.dto.referential.longline.HealthnessReference; import fr.ird.observe.dto.result.SaveResultDto; import org.apache.commons.lang3.BooleanUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel; @@ -381,6 +382,8 @@ public class CatchLonglineLogbookUIHandler extends ContentTableUIHandler<SetLong loadReferentialReferenceSetsInModel(form); model.setForm(form); + + SetLonglineLogbookCatchHelper.copySetLonglineLogbookCatchDto(form.getObject(), getBean()); } @Override @@ -441,14 +444,20 @@ public class CatchLonglineLogbookUIHandler extends ContentTableUIHandler<SetLong // depredated ui.getBeatDiameter().setEnabled(true); ui.getPredator().setEnabled(true); + ui.getCountDepredated().setEnabled(true); + ui.getDepredatedProportion().setEnabled(true); } else { // not depredated ui.getBeatDiameter().setEnabled(false); ui.getPredator().setEnabled(false); + ui.getCountDepredated().setEnabled(false); + ui.getDepredatedProportion().setEnabled(false); tableEditBean.setBeatDiameter(null); tableEditBean.setPredator(null); + tableEditBean.setDepredatedProportion(null); + tableEditBean.setCountDepredated(null); } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/LonglineGlobalCompositionLogbookUI.jaxx ===================================== @@ -66,6 +66,8 @@ errorTableModel='{getErrorTableModel()}' context='update-globalComposition'> </BeanValidator> + <Boolean id="delegateContentUI" initializer="true"/> + <!-- formulaire --> <JPanel id="body" layout='{new BorderLayout()}'> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/LonglineGlobalCompositionLogbookUIHandler.java ===================================== @@ -38,11 +38,12 @@ import fr.ird.observe.dto.navigation.edit.node.ObserveLonglineLogbookSetEditNode import fr.ird.observe.dto.navigation.select.node.ObserveLonglineLogbookSetSelectNode; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.spi.DtoModelHelper; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; 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; @@ -90,6 +91,7 @@ public class LonglineGlobalCompositionLogbookUIHandler extends ContentUIHandler< FloatlinesCompositionLogbookUI compositionUI = ui.getFloatlinesCompositionUI(); ui.getFloatlinesCompositionPanel().remove(compositionUI); ui.getFloatlinesCompositionPanel().add(compositionUI.getBody()); + ui.getFloatlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -97,6 +99,7 @@ public class LonglineGlobalCompositionLogbookUIHandler extends ContentUIHandler< BranchlinesCompositionLogbookUI compositionUI = ui.getBranchlinesCompositionUI(); ui.getBranchlinesCompositionPanel().remove(compositionUI); ui.getBranchlinesCompositionPanel().add(compositionUI.getBody()); + ui.getBranchlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -104,6 +107,7 @@ public class LonglineGlobalCompositionLogbookUIHandler extends ContentUIHandler< HooksCompositionLogbookUI compositionUI = ui.getHooksCompositionUI(); ui.getHooksCompositionPanel().remove(compositionUI); ui.getHooksCompositionPanel().add(compositionUI.getBody()); + ui.getHooksCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -111,6 +115,7 @@ public class LonglineGlobalCompositionLogbookUIHandler extends ContentUIHandler< BaitsCompositionLogbookUI compositionUI = ui.getBaitsCompositionUI(); ui.getBaitsCompositionPanel().remove(compositionUI); ui.getBaitsCompositionPanel().add(compositionUI.getBody()); + ui.getBaitsCompositionPanel().putClientProperty("contentUI", compositionUI); } } @@ -204,7 +209,7 @@ public class LonglineGlobalCompositionLogbookUIHandler extends ContentUIHandler< compositionUI.open(); } - + SwingUtilities.invokeLater(() -> ui.getMainTabbedPane().setSelectedIndex(0)); } @Override ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUI.jaxx ===================================== @@ -196,7 +196,7 @@ <JLabel id='totalLineLengthLabel'/> </cell> <cell fill='both' weightx="1" columns="3"> - <NumberEditor id='totalLineLength' constructorParams='this' styleClass="long10"/> + <NumberEditor id='totalLineLength' constructorParams='this' styleClass="int6"/> </cell> </row> <!-- basket line length --> @@ -205,7 +205,7 @@ <JLabel id='basketLineLengthLabel'/> </cell> <cell fill='both' weightx="1" columns="3"> - <NumberEditor id='basketLineLength' constructorParams='this' styleClass="long10"/> + <NumberEditor id='basketLineLength' constructorParams='this' styleClass="int6"/> </cell> </row> <!-- lengthBetweenBranchlines --> @@ -214,7 +214,7 @@ <JLabel id='lengthBetweenBranchlinesLabel'/> </cell> <cell fill='both' weightx="1" columns="3"> - <NumberEditor id='lengthBetweenBranchlines' constructorParams='this' styleClass="long10"/> + <NumberEditor id='lengthBetweenBranchlines' constructorParams='this' styleClass="int6"/> </cell> </row> @@ -326,7 +326,7 @@ </Table> </tab> - <tab id='lightstickssTab' computeI18n=""> + <tab id='lightsticksTab' computeI18n=""> <JPanel layout='{new BorderLayout()}'> <Table fill='both' constraints='BorderLayout.NORTH'> <!-- lightsticksUsed --> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUI.jcss ===================================== @@ -50,6 +50,11 @@ numberValue:{bean.getNumber()}; } +#settingShape { + property:{SetLonglineLogbookDto.PROPERTY_SETTING_SHAPE}; + selectedItem:{bean.getSettingShape()}; +} + #settingStartTimeStamp { date:{bean.getSettingStartTimeStamp()}; propertyDate: {SetLonglineLogbookDto.PROPERTY_SETTING_START_TIME_STAMP}; @@ -91,6 +96,26 @@ numberValue:{bean.getSettingVesselSpeed()}; } +#timeBetweenHooks { + property:{SetLonglineLogbookDto.PROPERTY_TIME_BETWEEN_HOOKS}; + numberValue:{bean.getTimeBetweenHooks()}; +} + +#totalLineLength { + property:{SetLonglineLogbookDto.PROPERTY_TOTAL_LINE_LENGTH}; + numberValue:{bean.getTotalLineLength()}; +} + +#basketLineLength { + property:{SetLonglineLogbookDto.PROPERTY_BASKET_LINE_LENGTH}; + numberValue:{bean.getBasketLineLength()}; +} + +#lengthBetweenBranchlines { + property:{SetLonglineLogbookDto.PROPERTY_LENGTH_BETWEEN_BRANCHLINES}; + numberValue:{bean.getLengthBetweenBranchlines()}; +} + #shooterUsed { horizontalTextPosition:{JCheckBox.LEFT}; _propertyName:{SetLonglineLogbookDto.PROPERTY_SHOOTER_USED}; @@ -103,9 +128,39 @@ numberValue:{bean.getShooterSpeed()}; } -#settingShape { - property:{SetLonglineLogbookDto.PROPERTY_SETTING_SHAPE}; - selectedItem:{bean.getSettingShape()}; +#maxDepthTargeted { + property:{SetLonglineLogbookDto.PROPERTY_MAX_DEPTH_TARGETED}; + numberValue:{bean.getMaxDepthTargeted()}; +} + +#totalSectionsCount { + property:{SetLonglineLogbookDto.PROPERTY_TOTAL_SECTIONS_COUNT}; + numberValue:{bean.getTotalSectionsCount()}; +} + +#basketsPerSectionCount { + property:{SetLonglineLogbookDto.PROPERTY_BASKETS_PER_SECTION_COUNT}; + numberValue:{bean.getBasketsPerSectionCount()}; +} + +#totalBasketsCount { + property:{SetLonglineLogbookDto.PROPERTY_TOTAL_BASKETS_COUNT}; + numberValue:{bean.getTotalBasketsCount()}; +} + +#branchlinesPerBasketCount { + property:{SetLonglineLogbookDto.PROPERTY_BRANCHLINES_PER_BASKET_COUNT}; + numberValue:{bean.getBranchlinesPerBasketCount()}; +} + +#totalHooksCount { + property:{SetLonglineLogbookDto.PROPERTY_TOTAL_HOOKS_COUNT}; + numberValue:{bean.getTotalHooksCount()}; +} + +#lineType { + property:{SetLonglineLogbookDto.PROPERTY_LINE_TYPE}; + selectedItem:{bean.getLineType()}; } #weightedSwivel { @@ -132,37 +187,24 @@ numberValue:{bean.getSnapWeight()}; } -#lineType { - property:{SetLonglineLogbookDto.PROPERTY_LINE_TYPE}; - selectedItem:{bean.getLineType()}; -} - -#maxDepthTargeted { - property:{SetLonglineLogbookDto.PROPERTY_MAX_DEPTH_TARGETED}; - numberValue:{bean.getMaxDepthTargeted()}; -} - #monitored { horizontalTextPosition:{JCheckBox.LEFT}; _propertyName:{SetLonglineLogbookDto.PROPERTY_MONITORED}; selected:{BooleanUtils.isTrue(bean.getMonitored())}; } -#lightsticksType { - property:{SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_TYPE}; - selectedItem:{bean.getLightsticksType()}; - enabled:{bean.getLightsticksPerBasketCount() !=null && bean.getLightsticksPerBasketCount() > 0}; -} +/* ***************************************************************************** */ +/* LIGHTSTICKS TAB ************************************************************ */ +/* ***************************************************************************** */ -#lightsticksColor { - property:{SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_COLOR}; - selectedItem:{bean.getLightsticksColor()}; - enabled:{bean.getLightsticksPerBasketCount() !=null && bean.getLightsticksPerBasketCount() > 0}; +#lightsticksTab { + icon:{handler.getErrorIconIfFalse(model.isLightsticksTabValid())}; } -#timeBetweenHooks { - property:{SetLonglineLogbookDto.PROPERTY_TIME_BETWEEN_HOOKS}; - numberValue:{bean.getTimeBetweenHooks()}; +#lightsticksUsed { + horizontalTextPosition:{JCheckBox.LEFT}; + _propertyName:{SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_USED}; + selected:{BooleanUtils.isTrue(bean.getLightsticksUsed())}; } #lightsticksPerBasketCount { @@ -170,29 +212,14 @@ numberValue:{bean.getLightsticksPerBasketCount()}; } -#basketsPerSectionCount { - property:{SetLonglineLogbookDto.PROPERTY_BASKETS_PER_SECTION_COUNT}; - numberValue:{bean.getBasketsPerSectionCount()}; -} - -#totalBasketsCount { - property:{SetLonglineLogbookDto.PROPERTY_TOTAL_BASKETS_COUNT}; - numberValue:{bean.getTotalBasketsCount()}; -} - -#branchlinesPerBasketCount { - property:{SetLonglineLogbookDto.PROPERTY_BRANCHLINES_PER_BASKET_COUNT}; - numberValue:{bean.getBranchlinesPerBasketCount()}; -} - -#totalSectionsCount { - property:{SetLonglineLogbookDto.PROPERTY_TOTAL_SECTIONS_COUNT}; - numberValue:{bean.getTotalSectionsCount()}; +#lightsticksType { + property:{SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_TYPE}; + selectedItem:{bean.getLightsticksType()}; } -#totalHooksCount { - property:{SetLonglineLogbookDto.PROPERTY_TOTAL_HOOKS_COUNT}; - numberValue:{bean.getTotalHooksCount()}; +#lightsticksColor { + property:{SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_COLOR}; + selectedItem:{bean.getLightsticksColor()}; } /* ***************************************************************************** */ ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUIHandler.java ===================================== @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.content.data.longline.logbook; * 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>. @@ -39,8 +39,9 @@ import fr.ird.observe.dto.navigation.edit.node.ObserveLonglineLogbookSetEditNode import fr.ird.observe.dto.navigation.select.node.ObserveLonglineLogbookSetSelectNode; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.spi.DtoModelHelper; -import org.apache.logging.log4j.Logger; +import org.apache.commons.lang3.BooleanUtils; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel; @@ -69,6 +70,7 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog protected final TableModelListener computeTabValidStateListener; private final PropertyChangeListener onToogleTimeEditorSliderChangedListener; private final PropertyChangeListener onCoordinateFormatChangedListener; + private final PropertyChangeListener lightsticksUsedChanged; private boolean toggleTimeEditorSliderIsChanging; private boolean coordinateFormatChangedIsChanging; @@ -86,6 +88,8 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog CoordinateFormat newValue = (CoordinateFormat) evt.getNewValue(); onCoordinateFormatChanged(newValue); }; + + lightsticksUsedChanged = evt -> onLightsticksUsedChanged((Boolean) evt.getNewValue()); } @Override @@ -244,6 +248,8 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog @Override public void startEditUI(String... binding) { + getBean().removePropertyChangeListener(SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_USED, lightsticksUsedChanged); + ContentUIModel<SetLonglineLogbookDto> model = getModel(); boolean create = model.getMode() == ContentMode.CREATE; String contextName = getValidatorContextName(model.getMode()); @@ -303,6 +309,8 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog SetLonglineLogbookUI.BINDING_HAULING_BREAKS_NUMBER_VALUE); + getBean().addPropertyChangeListener(SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_USED, lightsticksUsedChanged); + onLightsticksUsedChanged(getBean().getLightsticksUsed()); model.setModified(create); } @@ -379,7 +387,6 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog } - protected void computeTabValidState(SwingValidatorMessageTableModel errorTableModel) { Set<String> errorProperties = new HashSet<>(); @@ -395,11 +402,13 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog boolean settingTabValid = !errorProperties.removeAll(SetLonglineLogbookUIModel.SETTING_TAB_PROPERTIES); boolean settingCaracteristicsTabValid = !errorProperties.removeAll(SetLonglineLogbookUIModel.SETTING_CARACTERISTICS_TAB_PROPERTIES); boolean haulingTabValid = !errorProperties.removeAll(SetLonglineLogbookUIModel.HAULING_TAB_PROPERTIES); + boolean lightsticksTabValid = !errorProperties.removeAll(SetLonglineLogbookUIModel.LIGHTSTICKS_TAB_PROPERTIES); SetLonglineLogbookUIModel model = (SetLonglineLogbookUIModel) getModel(); model.setSettingTabValid(settingTabValid); model.setSettingCaracteristicsTabValid(settingCaracteristicsTabValid); model.setHaulingTabValid(haulingTabValid); + model.setLightsticksTabValid(lightsticksTabValid); } private void onToogleTimeEditorSliderChanged(boolean newValue) { @@ -435,4 +444,31 @@ public class SetLonglineLogbookUIHandler extends ContentUIHandler<SetLonglineLog } } + private void onLightsticksUsedChanged(Boolean newValue) { + + SetLonglineLogbookUI ui = getUi(); + + SetLonglineLogbookDto tableEditBean = getBean(); + if (BooleanUtils.isTrue(newValue)) { + + // depredated + ui.getLightsticksPerBasketCount().setEnabled(true); + ui.getLightsticksType().setEnabled(true); + ui.getLightsticksColor().setEnabled(true); + + } else { + + // not depredated + ui.getLightsticksPerBasketCount().setEnabled(false); + ui.getLightsticksType().setEnabled(false); + ui.getLightsticksColor().setEnabled(false); + + tableEditBean.setLightsticksPerBasketCount(null); + tableEditBean.setLightsticksType(null); + tableEditBean.setLightsticksColor(null); + + } + + } + } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/logbook/SetLonglineLogbookUIModel.java ===================================== @@ -42,10 +42,13 @@ public class SetLonglineLogbookUIModel extends ContentUIModel<SetLonglineLogbook public static final String PROPERTY_HAULING_TAB_VALID = "haulingTabValid"; + public static final String PROPERTY_LIGHTSTICKS_TAB_VALID = "lightsticksTabValid"; + public static final Set<String> SETTING_TAB_PROPERTIES = ImmutableSet.<String>builder().add( SetLonglineLogbookDto.PROPERTY_HOME_ID, SetLonglineLogbookDto.PROPERTY_NUMBER, + SetLonglineLogbookDto.PROPERTY_SETTING_SHAPE, SetLonglineLogbookDto.PROPERTY_SETTING_START_TIME_STAMP, SetLonglineLogbookDto.PROPERTY_SETTING_START_LATITUDE, SetLonglineLogbookDto.PROPERTY_SETTING_START_LONGITUDE, @@ -58,28 +61,35 @@ public class SetLonglineLogbookUIModel extends ContentUIModel<SetLonglineLogbook public static final Set<String> SETTING_CARACTERISTICS_TAB_PROPERTIES = ImmutableSet.<String>builder().add( - SetLonglineLogbookDto.PROPERTY_SETTING_SHAPE, - SetLonglineLogbookDto.PROPERTY_LINE_TYPE, - SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_TYPE, - SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_COLOR, + SetLonglineLogbookDto.PROPERTY_SETTING_VESSEL_SPEED, - SetLonglineLogbookDto.PROPERTY_MAX_DEPTH_TARGETED, + SetLonglineLogbookDto.PROPERTY_TIME_BETWEEN_HOOKS, + SetLonglineLogbookDto.PROPERTY_TOTAL_LINE_LENGTH, + SetLonglineLogbookDto.PROPERTY_BASKET_LINE_LENGTH, + SetLonglineLogbookDto.PROPERTY_LENGTH_BETWEEN_BRANCHLINES, SetLonglineLogbookDto.PROPERTY_SHOOTER_USED, SetLonglineLogbookDto.PROPERTY_SHOOTER_SPEED, + SetLonglineLogbookDto.PROPERTY_MAX_DEPTH_TARGETED, + SetLonglineLogbookDto.PROPERTY_TOTAL_SECTIONS_COUNT, + SetLonglineLogbookDto.PROPERTY_BASKETS_PER_SECTION_COUNT, + SetLonglineLogbookDto.PROPERTY_TOTAL_BASKETS_COUNT, + SetLonglineLogbookDto.PROPERTY_BRANCHLINES_PER_BASKET_COUNT, + SetLonglineLogbookDto.PROPERTY_TOTAL_HOOKS_COUNT, + SetLonglineLogbookDto.PROPERTY_LINE_TYPE, SetLonglineLogbookDto.PROPERTY_WEIGHTED_SWIVEL, SetLonglineLogbookDto.PROPERTY_SWIVEL_WEIGHT, SetLonglineLogbookDto.PROPERTY_WEIGHTED_SNAP, SetLonglineLogbookDto.PROPERTY_SNAP_WEIGHT, - SetLonglineLogbookDto.PROPERTY_MONITORED, - SetLonglineLogbookDto.PROPERTY_TIME_BETWEEN_HOOKS, - SetLonglineLogbookDto.PROPERTY_BASKETS_PER_SECTION_COUNT, - SetLonglineLogbookDto.PROPERTY_BRANCHLINES_PER_BASKET_COUNT, - SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_PER_BASKET_COUNT, - SetLonglineLogbookDto.PROPERTY_TOTAL_SECTIONS_COUNT, - SetLonglineLogbookDto.PROPERTY_TOTAL_BASKETS_COUNT, - SetLonglineLogbookDto.PROPERTY_TOTAL_HOOKS_COUNT + SetLonglineLogbookDto.PROPERTY_MONITORED ).build(); + public static final Set<String> LIGHTSTICKS_TAB_PROPERTIES = + ImmutableSet.<String>builder().add( + SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_USED, + SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_PER_BASKET_COUNT, + SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_TYPE, + SetLonglineLogbookDto.PROPERTY_LIGHTSTICKS_COLOR + ).build(); public static final Set<String> HAULING_TAB_PROPERTIES = ImmutableSet.<String>builder().add( SetLonglineLogbookDto.PROPERTY_HAULING_DIRECTION_SAME_AS_SETTING, @@ -99,6 +109,7 @@ public class SetLonglineLogbookUIModel extends ContentUIModel<SetLonglineLogbook protected boolean settingCaracteristicsTabValid; protected boolean haulingTabValid; + protected boolean lightsticksTabValid; public SetLonglineLogbookUIModel() { super(SetLonglineLogbookDto.class); @@ -131,4 +142,12 @@ public class SetLonglineLogbookUIModel extends ContentUIModel<SetLonglineLogbook firePropertyChange(PROPERTY_SETTING_TAB_VALID, null, settingTabValid); } + public boolean isLightsticksTabValid() { + return lightsticksTabValid; + } + + public void setLightsticksTabValid(boolean lightsticksTabValid) { + this.lightsticksTabValid = lightsticksTabValid; + firePropertyChange(PROPERTY_LIGHTSTICKS_TAB_VALID, null, lightsticksTabValid); + } } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/obs/LonglineGlobalCompositionObsUI.jaxx ===================================== @@ -66,6 +66,8 @@ errorTableModel='{getErrorTableModel()}' context='update-globalComposition'> </BeanValidator> + <Boolean id="delegateContentUI" initializer="true"/> + <!-- formulaire --> <JPanel id="body" layout='{new BorderLayout()}'> ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/obs/LonglineGlobalCompositionObsUIHandler.java ===================================== @@ -38,8 +38,8 @@ import fr.ird.observe.dto.navigation.edit.node.ObserveLonglineObsSetEditNode; import fr.ird.observe.dto.navigation.select.node.ObserveLonglineObsSetSelectNode; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.spi.DtoModelHelper; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.validator.NuitonValidatorScope; @@ -88,6 +88,7 @@ public class LonglineGlobalCompositionObsUIHandler extends ContentUIHandler<SetL FloatlinesCompositionObsUI compositionUI = ui.getFloatlinesCompositionUI(); ui.getFloatlinesCompositionPanel().remove(compositionUI); ui.getFloatlinesCompositionPanel().add(compositionUI.getBody()); + ui.getFloatlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -95,6 +96,7 @@ public class LonglineGlobalCompositionObsUIHandler extends ContentUIHandler<SetL BranchlinesCompositionObsUI compositionUI = ui.getBranchlinesCompositionUI(); ui.getBranchlinesCompositionPanel().remove(compositionUI); ui.getBranchlinesCompositionPanel().add(compositionUI.getBody()); + ui.getBranchlinesCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -102,6 +104,7 @@ public class LonglineGlobalCompositionObsUIHandler extends ContentUIHandler<SetL HooksCompositionObsUI compositionUI = ui.getHooksCompositionUI(); ui.getHooksCompositionPanel().remove(compositionUI); ui.getHooksCompositionPanel().add(compositionUI.getBody()); + ui.getHooksCompositionPanel().putClientProperty("contentUI", compositionUI); } { @@ -109,6 +112,7 @@ public class LonglineGlobalCompositionObsUIHandler extends ContentUIHandler<SetL BaitsCompositionObsUI compositionUI = ui.getBaitsCompositionUI(); ui.getBaitsCompositionPanel().remove(compositionUI); ui.getBaitsCompositionPanel().add(compositionUI.getBody()); + ui.getBaitsCompositionPanel().putClientProperty("contentUI", compositionUI); } } ===================================== client/src/main/resources/i18n/client_en_GB.properties ===================================== @@ -1100,8 +1100,8 @@ observe.common.SetLonglineLogbookDto.action.reset.homeId.tip=Reset home id observe.common.SetLonglineLogbookDto.basketLineLength=Bakset line length (m) observe.common.SetLonglineLogbookDto.haulingTab=Hauling observe.common.SetLonglineLogbookDto.lengthBetweenBranchlines=Length between branchlines (m) +observe.common.SetLonglineLogbookDto.lightsticksTab=Lightsticks observe.common.SetLonglineLogbookDto.lightsticksUsed=Lightsticks used -observe.common.SetLonglineLogbookDto.lightstickssTab=Lightsticks observe.common.SetLonglineLogbookDto.message.creating=Creating fishing operation observe.common.SetLonglineLogbookDto.message.updating=Updating fishing operation observe.common.SetLonglineLogbookDto.monitored=Monitored ===================================== client/src/main/resources/i18n/client_es_ES.properties ===================================== @@ -1100,8 +1100,8 @@ observe.common.SetLonglineLogbookDto.action.reset.homeId.tip=Reiniciar el id de observe.common.SetLonglineLogbookDto.basketLineLength=Bakset line length (m) \#TODO observe.common.SetLonglineLogbookDto.haulingTab=Arrastre observe.common.SetLonglineLogbookDto.lengthBetweenBranchlines=Length between branchlines (m) \#TODO +observe.common.SetLonglineLogbookDto.lightsticksTab=Lightsticks \#TODO observe.common.SetLonglineLogbookDto.lightsticksUsed=Lightsticks used \#TODO -observe.common.SetLonglineLogbookDto.lightstickssTab=Lightsticks \#TODO observe.common.SetLonglineLogbookDto.message.creating=Lance en proceso de creación. observe.common.SetLonglineLogbookDto.message.updating=La operación de pesca está en proceso de modificación. observe.common.SetLonglineLogbookDto.monitored=Instrumentada ===================================== client/src/main/resources/i18n/client_fr_FR.properties ===================================== @@ -1100,14 +1100,14 @@ observe.common.SetLonglineLogbookDto.action.reset.homeId.tip=Réinitialiser l'id observe.common.SetLonglineLogbookDto.basketLineLength=Longueur de la ligne par panier (m) observe.common.SetLonglineLogbookDto.haulingTab=Virage observe.common.SetLonglineLogbookDto.lengthBetweenBranchlines=Distance entre avançons (m) -observe.common.SetLonglineLogbookDto.lightsticksUsed=Lightsticks used -observe.common.SetLonglineLogbookDto.lightstickssTab=Lightsticks +observe.common.SetLonglineLogbookDto.lightsticksTab=Cyalumnes +observe.common.SetLonglineLogbookDto.lightsticksUsed=Utilisation des cyalumnes observe.common.SetLonglineLogbookDto.message.creating=L'opération de pêche est en cours de création. observe.common.SetLonglineLogbookDto.message.updating=L'opération de pêche est en cours de modification. observe.common.SetLonglineLogbookDto.monitored=Instrumentée observe.common.SetLonglineLogbookDto.settingCaracteristicsTab=Caractéristiques observe.common.SetLonglineLogbookDto.settingTab=Filage -observe.common.SetLonglineLogbookDto.shooterUsed=Shooter used +observe.common.SetLonglineLogbookDto.shooterUsed=Utilisation du shooter observe.common.SetLonglineLogbookDto.targetCatchCompositionEstimatedByObserver=Composition estimée par l'observateur ? observe.common.SetLonglineLogbookDto.targetDiscardCatchCompositionEstimatedByObserver=Composition estimée par l'observateur ? observe.common.SetLonglineLogbookDto.totalLineLength=Longueur totale de la ligne (m) ===================================== persistence/src/main/java/fr/ird/observe/binder/data/longline/SetLonglineLogbookEntityDtoBinder.java ===================================== @@ -45,27 +45,39 @@ public class SetLonglineLogbookEntityDtoBinder extends DataEntityDtoBinderSuppor entity.setComment(dto.getComment()); entity.setHomeId(dto.getHomeId()); entity.setNumber(dto.getNumber()); - entity.setBasketsPerSectionCount(dto.getBasketsPerSectionCount()); - entity.setBranchlinesPerBasketCount(dto.getBranchlinesPerBasketCount()); - entity.setTotalSectionsCount(dto.getTotalSectionsCount()); - entity.setTotalBasketsCount(dto.getTotalBasketsCount()); - entity.setTotalHooksCount(dto.getTotalHooksCount()); - entity.setWeightedSnap(dto.getWeightedSnap()); - entity.setSnapWeight(dto.getSnapWeight()); - entity.setWeightedSwivel(dto.getWeightedSwivel()); - entity.setSwivelWeight(dto.getSwivelWeight()); - entity.setLightsticksPerBasketCount(dto.getLightsticksPerBasketCount()); - entity.setTimeBetweenHooks(dto.getTimeBetweenHooks()); - entity.setShooterUsed(dto.getShooterUsed()); - entity.setShooterSpeed(dto.getShooterSpeed()); - entity.setMaxDepthTargeted(dto.getMaxDepthTargeted()); + entity.setSettingShape(toEntity(dto.getSettingShape())); entity.setSettingStartTimeStamp(dto.getSettingStartTimeStamp()); entity.setSettingStartLatitude(dto.getSettingStartLatitude()); entity.setSettingStartLongitude(dto.getSettingStartLongitude()); entity.setSettingEndTimeStamp(dto.getSettingEndTimeStamp()); entity.setSettingEndLatitude(dto.getSettingEndLatitude()); entity.setSettingEndLongitude(dto.getSettingEndLongitude()); + entity.setSettingVesselSpeed(dto.getSettingVesselSpeed()); + entity.setTimeBetweenHooks(dto.getTimeBetweenHooks()); + entity.setTotalLineLength(dto.getTotalLineLength()); + entity.setBasketLineLength(dto.getBasketLineLength()); + entity.setLengthBetweenBranchlines(dto.getLengthBetweenBranchlines()); + entity.setShooterUsed(dto.getShooterUsed()); + entity.setShooterSpeed(dto.getShooterSpeed()); + entity.setMaxDepthTargeted(dto.getMaxDepthTargeted()); + entity.setTotalSectionsCount(dto.getTotalSectionsCount()); + entity.setBasketsPerSectionCount(dto.getBasketsPerSectionCount()); + entity.setTotalBasketsCount(dto.getTotalBasketsCount()); + entity.setBranchlinesPerBasketCount(dto.getBranchlinesPerBasketCount()); + entity.setTotalHooksCount(dto.getTotalHooksCount()); + entity.setLineType(toEntity(dto.getLineType())); + entity.setWeightedSwivel(dto.getWeightedSwivel()); + entity.setSwivelWeight(dto.getSwivelWeight()); + entity.setWeightedSnap(dto.getWeightedSnap()); + entity.setSnapWeight(dto.getSnapWeight()); + entity.setMonitored(dto.getMonitored()); + + entity.setLightsticksUsed(dto.getLightsticksUsed()); + entity.setLightsticksPerBasketCount(dto.getLightsticksPerBasketCount()); + entity.setLightsticksType(toEntity(dto.getLightsticksType())); + entity.setLightsticksColor(toEntity(dto.getLightsticksColor())); + entity.setHaulingDirectionSameAsSetting(dto.getHaulingDirectionSameAsSetting()); entity.setHaulingStartTimeStamp(dto.getHaulingStartTimeStamp()); entity.setHaulingStartLatitude(dto.getHaulingStartLatitude()); @@ -74,13 +86,6 @@ public class SetLonglineLogbookEntityDtoBinder extends DataEntityDtoBinderSuppor entity.setHaulingEndLatitude(dto.getHaulingEndLatitude()); entity.setHaulingEndLongitude(dto.getHaulingEndLongitude()); entity.setHaulingBreaks(dto.getHaulingBreaks()); - entity.setMonitored(dto.getMonitored()); - entity.setLastUpdateDate(dto.getLastUpdateDate()); - entity.setSettingShape(toEntity(dto.getSettingShape())); - entity.setLineType(toEntity(dto.getLineType())); - entity.setLightsticksType(toEntity(dto.getLightsticksType())); - entity.setLightsticksColor(toEntity(dto.getLightsticksColor())); - } @Override @@ -90,20 +95,7 @@ public class SetLonglineLogbookEntityDtoBinder extends DataEntityDtoBinderSuppor dto.setComment(entity.getComment()); dto.setHomeId(entity.getHomeId()); dto.setNumber(entity.getNumber()); - dto.setBasketsPerSectionCount(entity.getBasketsPerSectionCount()); - dto.setBranchlinesPerBasketCount(entity.getBranchlinesPerBasketCount()); - dto.setTotalSectionsCount(entity.getTotalSectionsCount()); - dto.setTotalBasketsCount(entity.getTotalBasketsCount()); - dto.setTotalHooksCount(entity.getTotalHooksCount()); - dto.setWeightedSnap(entity.getWeightedSnap()); - dto.setSnapWeight(entity.getSnapWeight()); - dto.setWeightedSwivel(entity.getWeightedSwivel()); - dto.setSwivelWeight(entity.getSwivelWeight()); - dto.setLightsticksPerBasketCount(entity.getLightsticksPerBasketCount()); - dto.setTimeBetweenHooks(entity.getTimeBetweenHooks()); - dto.setShooterUsed(entity.getShooterUsed()); - dto.setShooterSpeed(entity.getShooterSpeed()); - dto.setMaxDepthTargeted(entity.getMaxDepthTargeted()); + dto.setSettingShape(toReferentialReference(referentialLocale, entity.getSettingShape())); dto.setSettingStartTimeStamp(entity.getSettingStartTimeStamp()); dto.setSettingStartLatitude(entity.getSettingStartLatitude()); dto.setSettingStartLongitude(entity.getSettingStartLongitude()); @@ -112,7 +104,32 @@ public class SetLonglineLogbookEntityDtoBinder extends DataEntityDtoBinderSuppor dto.setSettingEndLatitude(entity.getSettingEndLatitude()); dto.setSettingEndLongitude(entity.getSettingEndLongitude()); dto.setSettingEndQuadrant(entity.getSettingEndQuadrant()); + dto.setSettingVesselSpeed(entity.getSettingVesselSpeed()); + dto.setTimeBetweenHooks(entity.getTimeBetweenHooks()); + dto.setTotalLineLength(entity.getTotalLineLength()); + dto.setBasketLineLength(entity.getBasketLineLength()); + dto.setLengthBetweenBranchlines(entity.getLengthBetweenBranchlines()); + dto.setShooterUsed(entity.getShooterUsed()); + dto.setShooterSpeed(entity.getShooterSpeed()); + dto.setMaxDepthTargeted(entity.getMaxDepthTargeted()); + dto.setTotalSectionsCount(entity.getTotalSectionsCount()); + dto.setBasketsPerSectionCount(entity.getBasketsPerSectionCount()); + dto.setTotalBasketsCount(entity.getTotalBasketsCount()); + dto.setBranchlinesPerBasketCount(entity.getBranchlinesPerBasketCount()); + dto.setTotalHooksCount(entity.getTotalHooksCount()); + dto.setLineType(toReferentialReference(referentialLocale, entity.getLineType())); + dto.setWeightedSwivel(entity.getWeightedSwivel()); + dto.setSwivelWeight(entity.getSwivelWeight()); + dto.setWeightedSnap(entity.getWeightedSnap()); + dto.setSnapWeight(entity.getSnapWeight()); + dto.setMonitored(entity.getMonitored()); + + dto.setLightsticksUsed(entity.getLightsticksUsed()); + dto.setLightsticksPerBasketCount(entity.getLightsticksPerBasketCount()); + dto.setLightsticksType(toReferentialReference(referentialLocale, entity.getLightsticksType())); + dto.setLightsticksColor(toReferentialReference(referentialLocale, entity.getLightsticksColor())); + dto.setHaulingDirectionSameAsSetting(entity.getHaulingDirectionSameAsSetting()); dto.setHaulingStartTimeStamp(entity.getHaulingStartTimeStamp()); dto.setHaulingStartLatitude(entity.getHaulingStartLatitude()); @@ -123,13 +140,6 @@ public class SetLonglineLogbookEntityDtoBinder extends DataEntityDtoBinderSuppor dto.setHaulingEndLongitude(entity.getHaulingEndLongitude()); dto.setHaulingEndQuadrant(entity.getHaulingEndQuadrant()); dto.setHaulingBreaks(entity.getHaulingBreaks()); - dto.setMonitored(entity.getMonitored()); - - dto.setSettingShape(toReferentialReference(referentialLocale, entity.getSettingShape())); - dto.setLineType(toReferentialReference(referentialLocale, entity.getLineType())); - dto.setLightsticksType(toReferentialReference(referentialLocale, entity.getLightsticksType())); - dto.setLightsticksColor(toReferentialReference(referentialLocale, entity.getLightsticksColor())); - } } ===================================== persistence/src/main/java/fr/ird/observe/binder/data/longline/SetLonglineLogbookEntityReferenceBinder.java ===================================== @@ -41,9 +41,7 @@ public class SetLonglineLogbookEntityReferenceBinder extends DataEntityReference @Override public SetLonglineLogbookReference toReference(ReferentialLocale referentialLocale, SetLonglineLogbook entity) { - return new SetLonglineLogbookReference(entity, entity.getHomeId()); - } } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/73da0c0b9c8d8b005ff8622e280... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/73da0c0b9c8d8b005ff8622e280... You're receiving this email because of your account on gitlab.com.