Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
3 changed files:
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/CatchLonglineObsUIHandler.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ll/observation/CatchLonglineObsUIModel.java
- client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/FloatingObjectUIHandler.java
Changes:
| ... | ... | @@ -193,7 +193,7 @@ public class CatchLonglineObsUIHandler extends ContentTableUIHandler<SetLongline |
| 193 | 193 |
setTableModelEditable(model.isEditable());
|
| 194 | 194 |
|
| 195 | 195 |
positionHelper = new LonglinePositionHelper<>(ui.getSection(), ui.getBasket(), ui.getBranchline(), getModel().getTableEditBean());
|
| 196 |
- model.addPropertyChangeListener(CatchLonglineObsUIModel.PROPERTY_BRANCHLINE_TIME_SINCE_CONTACT, evt -> ui.getBranchlineValidator().setChanged(true));
|
|
| 196 |
+ model.addPropertyChangeListener(CatchLonglineObsUIModel.PROPERTY_TIME_SINCE_CONTACT, evt -> ui.getBranchlineValidator().setChanged(true));
|
|
| 197 | 197 |
}
|
| 198 | 198 |
|
| 199 | 199 |
@Override
|
| ... | ... | @@ -503,7 +503,7 @@ public class CatchLonglineObsUIHandler extends ContentTableUIHandler<SetLongline |
| 503 | 503 |
CatchLonglineObsUIModel model = getModel();
|
| 504 | 504 |
if (BooleanUtils.isTrue(branchline.getTimer())) {
|
| 505 | 505 |
Calendar calendar = Calendar.getInstance();
|
| 506 |
- calendar.setTime(model.getBranchlineTimeSinceContact());
|
|
| 506 |
+ calendar.setTime(model.getTimeSinceContact());
|
|
| 507 | 507 |
int minutes = calendar.get(Calendar.MINUTE);
|
| 508 | 508 |
int hours = calendar.get(Calendar.HOUR);
|
| 509 | 509 |
branchline.setTimeSinceContact(minutes + 60L * hours);
|
| ... | ... | @@ -665,7 +665,7 @@ public class CatchLonglineObsUIHandler extends ContentTableUIHandler<SetLongline |
| 665 | 665 |
if (newValue == null) {
|
| 666 | 666 |
log.info(prefix + "Remove branchline");
|
| 667 | 667 |
branchlineValidator.setBean(null);
|
| 668 |
- model.setBranchlineTimeSinceContact(null);
|
|
| 668 |
+ model.setTimeSinceContact(null);
|
|
| 669 | 669 |
|
| 670 | 670 |
} else {
|
| 671 | 671 |
log.info(prefix + "Use branchline: " + newValue);
|
| ... | ... | @@ -682,11 +682,11 @@ public class CatchLonglineObsUIHandler extends ContentTableUIHandler<SetLongline |
| 682 | 682 |
Long timeSinceContact = branchline.getTimeSinceContact();
|
| 683 | 683 |
if (timeSinceContact != null) {
|
| 684 | 684 |
Date timeSinceContactDate = DateUtil.createDate(0, (int) (timeSinceContact % 60), (int) (timeSinceContact / 60f), 0, 0, 0);
|
| 685 |
- model.setBranchlineTimeSinceContact(timeSinceContactDate);
|
|
| 685 |
+ model.setTimeSinceContact(timeSinceContactDate);
|
|
| 686 | 686 |
}
|
| 687 | 687 |
} else {
|
| 688 | 688 |
Date timeSinceContactDate = DateUtil.createDate(0, 0, 0, 0, 0, 0);
|
| 689 |
- model.setBranchlineTimeSinceContact(timeSinceContactDate);
|
|
| 689 |
+ model.setTimeSinceContact(timeSinceContactDate);
|
|
| 690 | 690 |
}
|
| 691 | 691 |
branchlineValidator.setBean(branchline);
|
| 692 | 692 |
}
|
| ... | ... | @@ -28,6 +28,9 @@ import fr.ird.observe.client.ui.content.api.data.table.ContentTableUI; |
| 28 | 28 |
import fr.ird.observe.client.ui.content.api.data.table.ContentTableUIModel;
|
| 29 | 29 |
import fr.ird.observe.dto.data.ll.observation.CatchLonglineObsDto;
|
| 30 | 30 |
import fr.ird.observe.dto.data.ll.observation.SetLonglineObsCatchDto;
|
| 31 |
+import io.ultreia.java4all.bean.JavaBean;
|
|
| 32 |
+import io.ultreia.java4all.bean.definition.JavaBeanDefinition;
|
|
| 33 |
+import io.ultreia.java4all.bean.spi.GenerateJavaBeanDefinition;
|
|
| 31 | 34 |
import org.nuiton.util.beans.Binder;
|
| 32 | 35 |
import org.nuiton.util.beans.BinderModelBuilder;
|
| 33 | 36 |
|
| ... | ... | @@ -41,9 +44,10 @@ import java.util.List; |
| 41 | 44 |
* @author Tony Chemit - dev@tchemit.fr
|
| 42 | 45 |
* @since 3.7
|
| 43 | 46 |
*/
|
| 44 |
-public class CatchLonglineObsUIModel extends ContentTableUIModel<SetLonglineObsCatchDto, CatchLonglineObsDto> {
|
|
| 47 |
+@GenerateJavaBeanDefinition
|
|
| 48 |
+public class CatchLonglineObsUIModel extends ContentTableUIModel<SetLonglineObsCatchDto, CatchLonglineObsDto> implements JavaBean {
|
|
| 45 | 49 |
|
| 46 |
- public static final String PROPERTY_BRANCHLINE_TIME_SINCE_CONTACT = "branchlineTimeSinceContact";
|
|
| 50 |
+ public static final String PROPERTY_TIME_SINCE_CONTACT = "timeSinceContact";
|
|
| 47 | 51 |
|
| 48 | 52 |
public static final String PROPERTY_SHOW_INDIVIDUAL_TABS = "showIndividualTabs";
|
| 49 | 53 |
|
| ... | ... | @@ -58,15 +62,7 @@ public class CatchLonglineObsUIModel extends ContentTableUIModel<SetLonglineObsC |
| 58 | 62 |
*/
|
| 59 | 63 |
protected boolean showIndividualTabs;
|
| 60 | 64 |
|
| 61 |
- protected boolean caracteristicsTabValid;
|
|
| 62 |
- |
|
| 63 |
- protected boolean depredatedTabValid;
|
|
| 64 |
- |
|
| 65 |
- protected boolean foodAndSexualTabValid;
|
|
| 66 |
- |
|
| 67 |
- protected boolean branchlineTabValid;
|
|
| 68 |
- |
|
| 69 |
- protected Date branchlineTimeSinceContact;
|
|
| 65 |
+ protected Date timeSinceContact;
|
|
| 70 | 66 |
|
| 71 | 67 |
public CatchLonglineObsUIModel(CatchLonglineObsUI ui) {
|
| 72 | 68 |
super(SetLonglineObsCatchDto.class,
|
| ... | ... | @@ -139,14 +135,14 @@ public class CatchLonglineObsUIModel extends ContentTableUIModel<SetLonglineObsC |
| 139 | 135 |
firePropertyChange(PROPERTY_SHOW_INDIVIDUAL_TABS, null, showIndividualTabs);
|
| 140 | 136 |
}
|
| 141 | 137 |
|
| 142 |
- public Date getBranchlineTimeSinceContact() {
|
|
| 143 |
- return branchlineTimeSinceContact;
|
|
| 138 |
+ public Date getTimeSinceContact() {
|
|
| 139 |
+ return timeSinceContact;
|
|
| 144 | 140 |
}
|
| 145 | 141 |
|
| 146 |
- public void setBranchlineTimeSinceContact(Date branchlineTimeSinceContact) {
|
|
| 142 |
+ public void setTimeSinceContact(Date timeSinceContact) {
|
|
| 147 | 143 |
// Date oldValue = getBranchlineTimeSinceContact();
|
| 148 |
- this.branchlineTimeSinceContact = branchlineTimeSinceContact;
|
|
| 149 |
- firePropertyChange(PROPERTY_BRANCHLINE_TIME_SINCE_CONTACT, null, branchlineTimeSinceContact);
|
|
| 144 |
+ this.timeSinceContact = timeSinceContact;
|
|
| 145 |
+ firePropertyChange(PROPERTY_TIME_SINCE_CONTACT, null, timeSinceContact);
|
|
| 150 | 146 |
|
| 151 | 147 |
}
|
| 152 | 148 |
|
| ... | ... | @@ -166,4 +162,15 @@ public class CatchLonglineObsUIModel extends ContentTableUIModel<SetLonglineObsC |
| 166 | 162 |
|
| 167 | 163 |
}
|
| 168 | 164 |
|
| 165 |
+ /**
|
|
| 166 |
+ * Lazy helper class that manages all java bean operations.
|
|
| 167 |
+ *
|
|
| 168 |
+ * @see #javaBeanDefinition()
|
|
| 169 |
+ */
|
|
| 170 |
+ private transient final JavaBeanDefinition javaBeanDefinition = new CatchLonglineObsUIModelJavaBeanDefinition();
|
|
| 171 |
+ |
|
| 172 |
+ @Override
|
|
| 173 |
+ public JavaBeanDefinition javaBeanDefinition() {
|
|
| 174 |
+ return javaBeanDefinition;
|
|
| 175 |
+ }
|
|
| 169 | 176 |
}
|
| ... | ... | @@ -73,7 +73,7 @@ public class FloatingObjectUIHandler extends ContentEditUIHandler<FloatingObject |
| 73 | 73 |
ObjectMaterialHierarchyDto detailedForm = getFloatingObjectService().getObjectMaterialHierarchy();
|
| 74 | 74 |
|
| 75 | 75 |
//FIXME-PROTECTED-ID
|
| 76 |
- ObjectMaterialTypeReference booleanType = getReferentialReferences(ObjectMaterialTypeReference.class).stream().filter(e -> e.getTopiaId().equals("fr.ird.referential.ps.ObjectMaterialType#0#0")).findFirst().orElseThrow(IllegalStateException::new);
|
|
| 76 |
+ ObjectMaterialTypeReference booleanType = getReferentialReferences(ObjectMaterialTypeReference.class).stream().filter(e -> e.getTopiaId().equals("fr.ird.referential.ps.observation.ObjectMaterialType#0#0")).findFirst().orElseThrow(IllegalStateException::new);
|
|
| 77 | 77 |
|
| 78 | 78 |
for (ObjectMaterialHierarchyDto objectMaterialHierarchyDto : detailedForm.getChildren()) {
|
| 79 | 79 |
if (objectMaterialHierarchyDto.isEnabled()) {
|