branch feature/7598 updated (9b06a03 -> 5dd20f8)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7598 in repository observe. See http://git.codelutin.com/observe.git from 9b06a03 affichage de la calée dans l'arbre de navigation (refs #7598) new 5dd20f8 migration de l'écran (refs #7598) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5dd20f80b2e628adb649aae1ca2eb6795a0b447c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Oct 14 14:12:29 2015 +0200 migration de l'écran (refs #7598) Summary of changes: .../ird/observe/ui/content/ContentUIManager.java | 2 +- .../ui/content/impl/seine/SetSeineUIHandler.java | 98 ++-------------------- .../ui/content/impl/seine/SetSeineUIModel.java | 3 - .../observe-application-swing_fr_FR.properties | 2 +- .../observe/services/dto/seine/SetSeineDto.java | 55 ++++++++++++ 5 files changed, 66 insertions(+), 94 deletions(-) create mode 100644 observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/SetSeineDto.java -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7598 in repository observe. See http://git.codelutin.com/observe.git commit 5dd20f80b2e628adb649aae1ca2eb6795a0b447c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Oct 14 14:12:29 2015 +0200 migration de l'écran (refs #7598) --- .../ird/observe/ui/content/ContentUIManager.java | 2 +- .../ui/content/impl/seine/SetSeineUIHandler.java | 98 ++-------------------- .../ui/content/impl/seine/SetSeineUIModel.java | 3 - .../observe-application-swing_fr_FR.properties | 2 +- .../observe/services/dto/seine/SetSeineDto.java | 55 ++++++++++++ 5 files changed, 66 insertions(+), 94 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java index d76bfe2..4d133c3 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java @@ -131,7 +131,7 @@ public class ContentUIManager { addMapping(DATA, ActivitySeineDto.class, ActivitySeineObservedSystemDto.PROPERTY_OBSERVED_SYSTEM, ActivitySeineObservedSystemUI.class); addMapping(DATA, SetSeineDto.class, SetSeineUI.class); - addMapping(DATA, SetSeineDto.class, n("observe.tree.setSeineDto.unsaved"), SetSeineUI.class); + addMapping(DATA, SetSeineDto.class, n("observe.tree.setSeine.unsaved"), SetSeineUI.class); addMapping(DATA, SetSeineDto.class, SetSeineSchoolEstimateDto.PROPERTY_SCHOOL_ESTIMATE, SchoolEstimateUI.class); addMapping(DATA, SetSeineDto.class, SetSeineTargetCatchDto.PROPERTY_TARGET_CATCH, TargetCatchUI.class); addMapping(DATA, SetSeineDto.class, SetSeineDto.PROPERTY_TARGET_DISCARDED, TargetDiscardCatchUI.class); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIHandler.java index c072e8c..37fe34e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIHandler.java @@ -21,11 +21,14 @@ */ package fr.ird.observe.ui.content.impl.seine; +import com.google.common.collect.ImmutableSet; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; import fr.ird.observe.services.dto.FormDto; import fr.ird.observe.db.ObserveSwingDataSource; +import fr.ird.observe.services.dto.ReferenceDto; +import fr.ird.observe.services.dto.ReferenceDtos; import fr.ird.observe.services.dto.constants.seine.SchoolType; import fr.ird.observe.services.dto.seine.ActivitySeineDto; import fr.ird.observe.services.dto.seine.RouteDto; @@ -122,7 +125,7 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> { return ContentMode.CREATE; } - if (dataContext.isSelectedOpen(ActivitySeineDto.class)) { + if (getOpenDataManager().isOpenActivitySeine(dataContext.getSelectedActivitySeineId())) { // l'activity est ouverte, mode édition return ContentMode.UPDATE; @@ -206,59 +209,6 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> { } } -// @Override -// protected SetSeine onPreCreate(TopiaContext tx, Object parent, SetSeine bean) throws TopiaException { -// -// ActivitySeine parentBean = (ActivitySeine) parent; -// -// // on utilise l'heure de l'activité comme début de calée -// Date date = DateUtil.getTime(parentBean.getTime(), false, false); -// -// bean.setStartTime(date); -// -// try { -// -// // pour les dates de fin on utilise la date de la route -// Route route = (Route) getDataService().loadEntity( -// getDataSource(), getDataContext().getSelectedRouteId(), false); -// -// bean.setEndSetTimeStamp(date); -// bean.setEndPursingTimeStamp(date); -// -// bean.setEndSetDate(route.getDate()); -// bean.setEndPursingDate(route.getDate()); -// -// } catch (DataSourceException e) { -// throw new TopiaException("Could not obtain route", e); -// } -// -// // recuperation du type de set a partir de l'activity -// SchoolType schoolType = parentBean.getSchoolType(); -// bean.setSchoolType(schoolType); -// return bean; -// } - -// @Override -// protected void onLoad(TopiaContext tx, SetSeine bean) throws TopiaException { -// super.onLoad(tx, bean); -// SetSeine editBean = getBean(); -// getDataContext().getOpenRouteId(); -// if (!editBean.isTargetSampleEmpty()) { -// for (TargetSample e : editBean.getTargetSample()) { -// e.isTargetLengthEmpty(); -// } -// } -// if (!editBean.isNonTargetSampleEmpty()) { -// for (NonTargetSample e : editBean.getNonTargetSample()) { -// e.isNonTargetLengthEmpty(); -// } -// } -// -// UIHelper.processDataBinding(getUi(), -// SetSeineUI.BINDING_END_SET_TIME_STAMP_DATE, -// SetSeineUI.BINDING_END_PURSING_TIME_STAMP_DATE); -// } - @Override public void startEditUI(String... binding) { ContentUIModel<SetSeineDto> model = getModel(); @@ -303,26 +253,6 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> { return true; } - //FIXME -// @Override -// protected SetSeine onCreate(TopiaContext tx, Object parent, SetSeine editBean) throws TopiaException { -// ActivitySeine parentBean = (ActivitySeine) parent; -// SetSeine beanToSave = ObserveDAOHelper.getSetSeineDAO(tx).create(); -// editBean.setTopiaId(beanToSave.getTopiaId()); -// parentBean.setSetSeine(beanToSave); -// return beanToSave; -// } - - //FIXME -// @Override -// protected SetSeine onUpdate(TopiaContext tx, Object parentBean, SetSeine beanToSave) throws TopiaException { -// -// getLoadBinder().copyExcluding(getBean(), beanToSave, -// SetSeine.PROPERTY_TARGET_SAMPLE, -// SetSeine.PROPERTY_NON_TARGET_SAMPLE); -// return beanToSave; -// } - @Override protected void afterSave(boolean refresh) { @@ -342,8 +272,11 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> { // remove old node and recreate new node ObserveNode parentNode = treeHelper.removeNode(node); - //FIXME -// node = treeHelper.addSetSeine(parentNode, bean); + + ReferenceDto<SetSeineDto> refBean = ReferenceDtos.newReferenceDto(SetSeineDto.class, ImmutableSet.of(SetSeineDto.PROPERTY_ID)); + refBean.setId(bean.getId()); + refBean.setPropertyValue(SetSeineDto.PROPERTY_ID, bean.getId()); + node = treeHelper.addSetSeine(parentNode, refBean); stopEditUI(); treeHelper.selectNode(node); @@ -365,19 +298,6 @@ public class SetSeineUIHandler extends ContentUIHandler<SetSeineDto> { return true; } - //FIXME -// @Override -// protected void onDelete(TopiaContext tx, Object parent, SetSeine beanToDelete) throws TopiaException { -// ActivitySeine parentBean = (ActivitySeine) parent; -// -// // on doit supprimer physiquement la set -// // car il n'y a pas de delete-orphan sur une telle -// // relation -// ObserveDAOHelper.getSetSeineDAO(tx).delete(parentBean.getSetSeine()); -// // supprime la reference sur l'activity -// parentBean.setSetSeine(null); -// } - protected void computeTabValidState(SwingValidatorMessageTableModel errorTableModel) { Set<String> errorProperties = new HashSet<String>(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIModel.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIModel.java index 73fe431..cef7b9b 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIModel.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSeineUIModel.java @@ -115,9 +115,6 @@ public class SetSeineUIModel extends ContentUIModel<SetSeineDto> { SetSeineDto.PROPERTY_NON_TARGET_DISCARDED, SetSeineDto.PROPERTY_SCHOOL_TYPE, SetSeineDto.PROPERTY_SONAR_USED - //FIXME -// SetSeineDto.PROPERTY_TARGET_SAMPLE, -// SetSeineDto.PROPERTY_NON_TARGET_SAMPLE ); return builder; diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties index 8e3b5c9..1803bd3 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties @@ -2305,7 +2305,7 @@ observe.tree.sensorUsed=Capteurs utilisés observe.tree.setLongline=Détails de l'opération observe.tree.setLonglineDto.unsaved=Nouvelle opération de pêche observe.tree.setSeine=Calée -observe.tree.setSeineDto.unsaved=Nouvelle calée +observe.tree.setSeine.unsaved=Nouvelle calée observe.tree.settingShape=Forme au filage observe.tree.sex=Sexe observe.tree.sizeMeasureType=Type de mesure de taille diff --git a/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/SetSeineDto.java b/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/SetSeineDto.java new file mode 100644 index 0000000..705b4af --- /dev/null +++ b/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/SetSeineDto.java @@ -0,0 +1,55 @@ +package fr.ird.observe.services.dto.seine; + +import org.nuiton.util.DateUtil; + +import java.util.Date; + +public class SetSeineDto extends AbstractSetSeineDto { + + private static final long serialVersionUID = 3546973062604141414L; + + public void setEndSetDate(Date endSetDate) { + if (endSetTimeStamp != null) { + Date dateAndTime = DateUtil.getDateAndTime(endSetDate, endSetTimeStamp, false, false); + setEndSetTimeStamp(dateAndTime); + } + } + + public void setEndSetTime(Date endSetTime) { + if (endSetTimeStamp != null) { + Date dateAndTime = DateUtil.getDateAndTime(endSetTimeStamp, endSetTime, false, false); + setEndSetTimeStamp(dateAndTime); + } + } + + public void setEndPursingDate(Date endPursingDate) { + if (endPursingTimeStamp != null) { + Date dateAndTime = DateUtil.getDateAndTime(endPursingDate, endPursingTimeStamp, false, false); + setEndPursingTimeStamp(dateAndTime); + } + } + + public void setEndPursingTime(Date endPursingTime) { + if (endPursingTimeStamp != null) { + Date dateAndTime = DateUtil.getDateAndTime(endPursingTimeStamp, endPursingTime, false, false); + setEndPursingTimeStamp(dateAndTime); + } + } + + public Date getEndSetDate() { + return endSetTimeStamp == null ? null : DateUtil.getDay(endSetTimeStamp); + } + + public Date getEndSetTime() { + return endSetTimeStamp == null ? null : DateUtil.getTime(endSetTimeStamp, false, false); + } + + public Date getEndPursingDate() { + return endPursingTimeStamp == null ? null : DateUtil.getDay(endPursingTimeStamp); + } + + public Date getEndPursingTime() { + return endPursingTimeStamp == null ? null : DateUtil.getTime(endPursingTimeStamp, false, false); + } + +} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm