Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- 4058 discussions
r1189 - in trunk/tutti-persistence/src/main: java/fr/ifremer/tutti/persistence/service/batch resources/i18n
by tchemit@users.forge.codelutin.com 19 Sep '13
by tchemit@users.forge.codelutin.com 19 Sep '13
19 Sep '13
Author: tchemit
Date: 2013-09-19 10:52:54 +0200 (Thu, 19 Sep 2013)
New Revision: 1189
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1189
Log:
fixes #3265: [TRAIT] V?\195?\169rifier que l'ordre de saisie des captures est bien celui de la configuration de cat?\195?\169gorisation
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-09-18 16:47:50 UTC (rev 1188)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-09-19 08:52:54 UTC (rev 1189)
@@ -45,6 +45,7 @@
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -95,8 +96,8 @@
List<CatchBatchValidationError> errors = Lists.newArrayList();
- Integer[] categoryIds =
- sampleCategoryModel.getSamplingOrder().toArray(new Integer[sampleCategoryModel.getSamplingOrder().size()]);
+ Map<Integer, SampleCategoryModelEntry> categoriesById =
+ sampleCategoryModel.getCategoryMap();
for (SpeciesBatch speciesBatch : species.getChildren()) {
@@ -113,11 +114,10 @@
// check sample categories order is ok
validateSampleCategoriesOrder(
- sampleCategoryModel,
+ categoriesById,
errors,
speciesBatch,
- categoryIds,
- 0,
+ null,
n_("tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order"));
}
}
@@ -130,8 +130,8 @@
List<CatchBatchValidationError> errors = Lists.newArrayList();
- Integer[] categoryIds =
- sampleCategoryModel.getSamplingOrder().toArray(new Integer[sampleCategoryModel.getSamplingOrder().size()]);
+ Map<Integer, SampleCategoryModelEntry> categoriesById =
+ sampleCategoryModel.getCategoryMap();
for (BenthosBatch benthosBatch : benthos.getChildren()) {
@@ -147,11 +147,10 @@
// check sample categories order is ok
validateSampleCategoriesOrder(
- sampleCategoryModel,
+ categoriesById,
errors,
benthosBatch,
- categoryIds,
- 0,
+ null,
n_("tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order"));
}
}
@@ -355,46 +354,50 @@
}
}
- protected void validateSampleCategoriesOrder(SampleCategoryModel sampleCategoryModel,
+ protected void validateSampleCategoriesOrder(Map<Integer, SampleCategoryModelEntry> categoriesById,
List<CatchBatchValidationError> errors,
SpeciesAbleBatch aBatch,
- Integer[] categoryIds,
- int level,
+ SampleCategoryModelEntry lastSampleCategory,
String messageKey) {
Integer sampleCategoryId = aBatch.getSampleCategoryId();
- Integer exceptedCategoryId = categoryIds[level];
+ SampleCategoryModelEntry actualCategory =
+ categoriesById.get(sampleCategoryId);
+ if (lastSampleCategory != null) {
- if (!exceptedCategoryId.equals(sampleCategoryId)) {
+ // check the category is after the last one
- // bad sample category id
+ if (actualCategory.getOrder() < lastSampleCategory.getOrder()) {
- SampleCategoryModelEntry actualCategory = sampleCategoryModel.getCategoryById(sampleCategoryId);
- SampleCategoryModelEntry exceptedCategory = sampleCategoryModel.getCategoryById(exceptedCategoryId);
+ // bad order
- addError(errors,
- messageKey,
- aBatch.getId(),
- aBatch.getSpecies().getName(),
- actualCategory.getLabel(),
- exceptedCategory.getLabel());
+ addError(errors,
+ messageKey,
+ aBatch.getId(),
+ aBatch.getSpecies().getName(),
+ actualCategory.getLabel(),
+ lastSampleCategory.getLabel());
- // no need to continue, we got a bad order
- return;
+ // no need to continue, we got a bad order
+ return;
+ }
+
}
+ // keep the last sample category
+ lastSampleCategory = actualCategory;
+
if (!aBatch.isChildBatchsEmpty()) {
for (SpeciesAbleBatch speciesAbleBatch : aBatch.getChildBatchs()) {
validateSampleCategoriesOrder(
- sampleCategoryModel,
+ categoriesById,
errors,
speciesAbleBatch,
- categoryIds,
- level + 1,
+ lastSampleCategory,
messageKey);
}
}
Modified: trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-18 16:47:50 UTC (rev 1188)
+++ trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-19 08:52:54 UTC (rev 1189)
@@ -27,9 +27,9 @@
tutti.persistence.batch.validation.horsVracNotFound=Lot 'Hors Vrac' non trouvé ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.horsVracSpeciesNotFound=Lot 'Hors Vrac > Espèces' non trouvé ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId=Le lot benthos %s (espèce %s) utilise une catégorie (id %s) non reconnue
-tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order=Le lot benthos %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> au lieu de <strong>%s</strong>
+tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order=Le lot benthos %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> après la catégories <strong>%s</strong>
tutti.persistence.batch.validation.invalid.species.sampleCategoryId=Le lot espèce %s (espèce %s) utilise une catégorise (id %s) non reconnue
-tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order=Le lot espèce %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> au lieu de <strong>%s</strong>
+tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order=Le lot espèce %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> après la catégorie <strong>%s</strong>
tutti.persistence.batch.validation.unkonwn.taxon=Le lot (%s) utilise une espèce de code inconnu (%s).
tutti.persistence.batch.validation.unsortedNotFound=Lot 'Hors Vrac > Espèces' non trouvé ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.vracBenthosAliveItemizedNotFound=Lot 'Vrac > Benthos > Vivant Trié' non trouvé, ou configuré avec d'autres critères de classement.
1
0
18 Sep '13
Author: tchemit
Date: 2013-09-18 18:47:50 +0200 (Wed, 18 Sep 2013)
New Revision: 1188
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1188
Log:
refs #3280: [CAPTURE] ?\195?\160 la cr?\195?\169ation d'un lot, scanner le protocole et proposer la cat?\195?\169gorisation du protocole
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SelectedCategoryAble.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/protocol/TuttiProtocols.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -360,6 +360,30 @@
}
/**
+ * Retrieve the speciesProtocol corresponding to the species of the given protocol.
+ *
+ * @param protocol
+ * @param species
+ * @return
+ * @since 2.5
+ */
+ public static SpeciesProtocol getSpeciesProtocol(TuttiProtocol protocol, Species species) {
+ return getSpeciesProtocol(species, protocol.getSpecies());
+ }
+
+ /**
+ * Retrieve the benthosProtocol corresponding to the species of the given protocol.
+ *
+ * @param protocol
+ * @param species
+ * @return
+ * @since 2.5
+ */
+ public static SpeciesProtocol getBenthosProtocol(TuttiProtocol protocol, Species species) {
+ return getSpeciesProtocol(species, protocol.getBenthos());
+ }
+
+ /**
* Retrieve the speciesprotocol corresponding to the species of the batch
*
* @param species
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 16:47:50 UTC (rev 1188)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Sep 18 14:22:16 CEST 2013
+#Wed Sep 18 18:37:46 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -16,7 +16,9 @@
tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.field.batchCount.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
+tutti.createBenthosBatch.field.categoryField.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sampleCategory.help=editFishingOperation.html\#captureBenthosFields
+tutti.createBenthosBatch.field.sampleWeightField.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.species.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.help=editFishingOperation.html\#captureBenthos
@@ -40,7 +42,9 @@
tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.field.batchCount.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
+tutti.createSpeciesBatch.field.categoryField.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
+tutti.createSpeciesBatch.field.sampleWeightField.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.species.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.help=editFishingOperation.html\#captureEspecesCreeLot
@@ -211,12 +215,12 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fieldsCaracteristics
-tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.help=editSampleCategory.html
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 16:47:50 UTC (rev 1188)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Sep 18 14:22:16 CEST 2013
+#Wed Sep 18 18:37:46 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -16,7 +16,9 @@
tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.field.batchCount.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
+tutti.createBenthosBatch.field.categoryField.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sampleCategory.help=editFishingOperation.html\#captureBenthosFields
+tutti.createBenthosBatch.field.sampleWeightField.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.species.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.help=editFishingOperation.html\#captureBenthos
@@ -40,7 +42,9 @@
tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.field.batchCount.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
+tutti.createSpeciesBatch.field.categoryField.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
+tutti.createSpeciesBatch.field.sampleWeightField.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.species.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.help=editFishingOperation.html\#captureEspecesCreeLot
@@ -211,12 +215,12 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fieldsCaracteristics
-tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html#actions
-tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html\#actions
+tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.help=editSampleCategory.html
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SelectedCategoryAble.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SelectedCategoryAble.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SelectedCategoryAble.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -0,0 +1,14 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches;
+
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
+
+/**
+ * When a model offers a selected category.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.5
+ */
+public interface SelectedCategoryAble {
+
+ SampleCategoryModelEntry getSelectedCategory();
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SelectedCategoryAble.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -53,7 +53,6 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchUI;
-import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
@@ -656,6 +655,15 @@
// update speciesUsed
addToSpeciesUsed(newRow);
+
+ if (batchRootRowModel.getSelectedCategory() != null) {
+
+ // add first category
+ splitBatch(batchRootRowModel.getSelectedCategory(),
+ batchRootRowModel.getRows(),
+ batchRootRowModel.getSampleWeight()
+ );
+ }
}
recomputeBatchActionEnable();
@@ -721,63 +729,63 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
SplitBenthosBatchUI splitBatchEditor = parent.getBenthosTabSplitBatch();
-// splitBatchEditor.getHandler().editBatch(parentBatch);
-// parent.getHandler().setBenthosSelectedCard(EditCatchesUIHandler.SPLIT_BATCH_CARD);
parent.getHandler().splitBenthosBatch(parentBatch, splitBatchEditor);
}
}
- public void splitBatch(SplitBenthosBatchUIModel splitModel) {
- if (splitModel.isValid()) {
+ public void splitBatch(SampleCategoryModelEntry sampleCategoryDef,
+ List<SplitBenthosBatchRowModel> rows,
+ Float totalRowWeight) {
- JXTable table = getTable();
+ JXTable table = getTable();
- // get selected row
- int insertRow = table.getSelectedRow();
+ // get selected row
+ int insertRow = table.getSelectedRow();
- BenthosBatchTableModel tableModel = getTableModel();
- BenthosBatchRowModel parentBatch = tableModel.getEntry(insertRow);
+ BenthosBatchTableModel tableModel = getTableModel();
+ BenthosBatchRowModel parentBatch = tableModel.getEntry(insertRow);
- // create batch rows
+ // Create rows in batch table model
+ Float parentWeight = parentBatch.getFinestCategory().getNotNullWeight();
+ boolean subSample = parentWeight != null && totalRowWeight != null
+ && parentWeight > totalRowWeight;
- SampleCategoryModelEntry sampleCategoryDef = splitModel.getSelectedCategory();
+ List<BenthosBatchRowModel> newBatches = Lists.newArrayList();
+ for (SplitBenthosBatchRowModel row : rows) {
+ if (row.isValid()) {
- // Create rows in batch table model
+ // can keep this row
+ BenthosBatchRowModel newBatch = tableModel.createNewRow();
- List<BenthosBatchRowModel> newBatches = Lists.newArrayList();
- for (SplitBenthosBatchRowModel row : splitModel.getRows()) {
- if (row.isValid()) {
+ loadBatchRow(parentBatch,
+ newBatch,
+ sampleCategoryDef.getCategoryId(),
+ row.getCategoryValue(),
+ row.getWeight(),
+ null);
- // can keep this row
- BenthosBatchRowModel newBatch = tableModel.createNewRow();
+ newBatch.getFinestCategory().setSubSample(subSample);
- loadBatchRow(parentBatch,
- newBatch,
- sampleCategoryDef.getCategoryId(),
- row.getCategoryValue(),
- row.getWeight(),
- null);
+ recomputeRowValidState(newBatch);
+ newBatches.add(newBatch);
- recomputeRowValidState(newBatch);
- newBatches.add(newBatch);
-
- tableModel.addNewRow(++insertRow, newBatch);
- }
+ tableModel.addNewRow(++insertRow, newBatch);
}
+ }
- // add new batches to his parent
- parentBatch.setChildBatch(newBatches);
+ // add new batches to his parent
+ parentBatch.setChildBatch(newBatches);
- //TODO Should only save parentBatch (will persist all his childs)
- //saveRow(parentBatch);
+ //TODO Should only save parentBatch (will persist all his childs)
+ //saveRow(parentBatch);
- // save new batches
- saveRows(newBatches);
+ // save new batches
+ saveRows(newBatches);
- BenthosBatchUIModel model = getModel();
- model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
- }
+ BenthosBatchUIModel model = getModel();
+ model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
+
recomputeBatchActionEnable();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 16:47:50 UTC (rev 1188)
@@ -51,6 +51,10 @@
data: {model.getAvailableSpecies()};
}
+#categoryPanel {
+ visible: {model.getSpecies() != null};
+}
+
#sampleCategoryLabel {
text: "tutti.createBenthosBatch.field.sampleCategory";
toolTipText: "tutti.createBenthosBatch.field.sampleCategory.tip";
@@ -93,6 +97,38 @@
bean: {model};
}
+#categoryLabel {
+ text: "tutti.createBenthosBatch.field.category";
+ toolTipText: "tutti.createBenthosBatch.field.categoryField.tip";
+ labelFor: {categoryComboBox};
+ _help: {"tutti.createBenthosBatch.field.categoryField.help"};
+}
+
+#categoryComboBox {
+ selectedItem: {model.getSelectedCategory()};
+}
+
+#sampleWeightLabel {
+ text: "tutti.createBenthosBatch.field.sampleWeight";
+ toolTipText: "tutti.createBenthosBatch.field.sampleWeightField.tip";
+ labelFor: {sampleWeightField};
+ _help: {"tutti.createBenthosBatch.field.sampleWeightField.help"};
+}
+
+#sampleWeightField {
+ editable: false;
+ enabled: false;
+ text: {getStringValue(model.getSampleWeight())};
+}
+
+#table {
+ selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionBackground: {null};
+ selectionForeground: {Color.BLACK};
+ sortable: false;
+ enabled: {model.getSelectedCategory() != null}
+}
+
#addSpeciesButton {
text: "tutti.createBenthosBatch.action.addSpecies";
toolTipText: "tutti.createBenthosBatch.action.addSpecies.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 16:47:50 UTC (rev 1188)
@@ -28,6 +28,7 @@
<import>
fr.ifremer.tutti.persistence.entities.referential.Species
fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
+ fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
@@ -39,6 +40,7 @@
jaxx.runtime.swing.editor.NumberEditor
java.awt.Color
+ javax.swing.ListSelectionModel
static org.nuiton.i18n.I18n._
static jaxx.runtime.SwingUtil.getStringValue
@@ -68,12 +70,15 @@
<field name='sampleCategory'
component='sampleCategoryComboBox'/>
<field name='batchWeight' component='batchWeightField'/>
+ <field name='batchCount' component='batchCountField'/>
+ <field name='selectedCategory' component='categoryComboBox'/>
+ <field name='sampleWeight' component='sampleWeightField'/>
</BeanValidator>
<TuttiHelpBroker id='broker'
constructorParams='"tutti.createBenthosBatch.help"'/>
- <Table id='configurationPanel' constraints='BorderLayout.CENTER' fill='both'>
+ <Table id='configurationPanel' constraints='BorderLayout.NORTH' fill='both'>
<!-- Species -->
<row>
@@ -123,6 +128,44 @@
</Table>
+ <JPanel id='categoryPanel' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+ <Table id='categoryConfigurationPanel' constraints='BorderLayout.NORTH'
+ fill='both'>
+ <row>
+ <cell columns="2">
+ <JSeparator/>
+ </cell>
+ </row>
+
+ <!-- First SampleCategory choice -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='categoryLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JComboBox id='categoryComboBox'
+ onActionPerformed="model.setSelectedCategory((SampleCategoryModelEntry) categoryComboBox.getSelectedItem());"/>
+ </cell>
+ </row>
+
+ <!-- Sample Total weight -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='sampleWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='sampleWeightField'/>
+ </cell>
+ </row>
+
+ </Table>
+
+ <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
+ <JXTable id='table'/>
+ </JScrollPane>
+ </JPanel>
+
<!-- Form Actions -->
<JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -30,6 +30,9 @@
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
+import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -38,16 +41,23 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUIModel;
-import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchTableModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
@@ -60,7 +70,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-public class CreateBenthosBatchUIHandler extends AbstractTuttiUIHandler<CreateBenthosBatchUIModel, CreateBenthosBatchUI> implements Cancelable {
+public class CreateBenthosBatchUIHandler extends AbstractTuttiTableUIHandler<SplitBenthosBatchRowModel, CreateBenthosBatchUIModel, CreateBenthosBatchUI> implements Cancelable {
/** Logger. */
private static final Log log =
@@ -70,9 +80,13 @@
private final CaracteristicQualitativeValue sortedValue;
+ protected boolean categoryIsAdjusting;
+
public CreateBenthosBatchUIHandler(TuttiUI parentUi,
CreateBenthosBatchUI ui) {
- super(parentUi.getHandler().getContext(), ui);
+ super(parentUi.getHandler().getContext(), ui,
+ SplitBenthosBatchRowModel.PROPERTY_CATEGORY_VALUE,
+ SplitBenthosBatchRowModel.PROPERTY_WEIGHT);
this.persistenceService = context.getPersistenceService();
SampleCategoryModel sampleCategoryModel =
@@ -95,12 +109,66 @@
}
//------------------------------------------------------------------------//
+ //-- AbstractTuttiTableUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public SplitBenthosBatchTableModel getTableModel() {
+ return (SplitBenthosBatchTableModel) getTable().getModel();
+ }
+
+ @Override
+ public JXTable getTable() {
+ return ui.getTable();
+ }
+
+ @Override
+ protected boolean isRowValid(SplitBenthosBatchRowModel row) {
+ return row.isValid();
+ }
+
+ @Override
+ protected void saveSelectedRowIfRequired(TuttiBeanMonitor<SplitBenthosBatchRowModel> rowMonitor,
+ SplitBenthosBatchRowModel row) {
+ if (rowMonitor.wasModified()) {
+
+ if (row.isValid()) {
+ if (log.isInfoEnabled()) {
+ log.info("Change row that was modified and valid");
+ }
+ }
+
+ rowMonitor.clearModified();
+ }
+ }
+
+ @Override
+ protected void onRowModified(int rowIndex,
+ SplitBenthosBatchRowModel row,
+ String propertyName,
+ Object oldValue,
+ Object newValue) {
+
+ recomputeRowValidState(row);
+
+ if (SplitBenthosBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) {
+
+ // Need to recompute the sample weight
+ computeSampleWeight(row);
+ }
+ }
+
+ //------------------------------------------------------------------------//
//-- AbstractTuttiUIHandler methods --//
//------------------------------------------------------------------------//
@Override
public void beforeInitUI() {
- CreateBenthosBatchUIModel model = new CreateBenthosBatchUIModel();
+
+ SampleCategoryModel sampleCategoryModel =
+ getDataContext().getSampleCategoryModel();
+ CreateBenthosBatchUIModel model =
+ new CreateBenthosBatchUIModel(sampleCategoryModel);
ui.setContextValue(model);
listModelIsModify(model);
}
@@ -122,7 +190,9 @@
Lists.newArrayList(caracteristic.getQualitativeValue()),
null);
- getModel().addPropertyChangeListener(CreateBenthosBatchUIModel.PROPERTY_SPECIES, new PropertyChangeListener() {
+ CreateBenthosBatchUIModel model = getModel();
+
+ model.addPropertyChangeListener(CreateBenthosBatchUIModel.PROPERTY_SPECIES, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -136,11 +206,15 @@
if (newValue == null || source.getSpeciesUsed() == null) {
+ // reste V/HV category
source.setSampleCategory(null);
+ // reset categories
+ source.setCategory(null);
+
} else {
- // look for best value : if sorted is available then use it
+ // look for best value for V/HV category : if sorted is available then use it
List<CaracteristicQualitativeValue> qualitativeValues =
ui.getSampleCategoryComboBox().getData();
@@ -157,11 +231,134 @@
}
}
source.setSampleCategory(newCategory);
+
+ // recompute possible categories
+ List<SampleCategoryModelEntry> categories = Lists.newArrayList();
+
+ SampleCategoryModel sampleCategoryModel =
+ getModel().getSampleCategoryModel();
+
+ // add all categories
+ categories.addAll(sampleCategoryModel.getCategory());
+
+ // remove the first one (V/HV)
+ categories.remove(0);
+
+ // reset selected category
+ if (log.isInfoEnabled()) {
+ log.info("Remove selected category before changing the categories...");
+ }
+ source.setSelectedCategory(null);
+
+ categoryIsAdjusting = true;
+
+ try {
+
+ // set universe of categories
+ if (log.isInfoEnabled()) {
+ log.info("Categories to use: " + categories);
+ }
+
+ source.setCategory(categories);
+
+ // force to remove the first selected value of the combo-box
+ ui.getCategoryComboBox().setSelectedItem(null);
+ } finally {
+ categoryIsAdjusting = false;
+ }
+
+ // compute the selected sample category
+
+ SampleCategoryModelEntry selectedCategory = null;
+
+ if (getDataContext().isProtocolFilled()) {
+
+ // try to find the first category from protocol
+ TuttiProtocol protocol = getDataContext().getProtocol();
+ SpeciesProtocol speciesProtocol = TuttiProtocols.getBenthosProtocol(protocol, newValue);
+ if (speciesProtocol != null) {
+
+ // species defined in protocol
+ if (speciesProtocol.sizeMandatorySampleCategoryId() > 1) {
+
+ // use the second category (the first one is V/HV)
+ Integer categoryId = speciesProtocol.getMandatorySampleCategoryId().get(1);
+ selectedCategory = sampleCategoryModel.getCategoryById(categoryId);
+ if (log.isInfoEnabled()) {
+ log.info("Use category from protocol: " + categoryId + " :: " + selectedCategory);
+ }
+ }
+ }
+ }
+
+ if (selectedCategory == null) {
+
+ // by default use the first one
+ selectedCategory = categories.get(0);
+
+ if (log.isInfoEnabled()) {
+ log.info("Use default first category: " + selectedCategory);
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Selected category : " + selectedCategory);
+ }
+ ui.getCategoryComboBox().setSelectedItem(selectedCategory);
}
}
});
- listenValidatorValid(ui.getValidator(), getModel());
+ // when category changed, remove selected category
+ model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_CATEGORY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+// CreateSpeciesBatchUIModel source =
+// (CreateSpeciesBatchUIModel) evt.getSource();
+
+// // unselect previous selected category
+// source.setSelectedCategory(null);
+
+ // fill comboBox with new list
+ List<SampleCategoryModelEntry> data = (List<SampleCategoryModelEntry>) evt.getNewValue();
+ if (data == null) {
+
+ ui.getCategoryComboBox().setModel(new DefaultComboBoxModel());
+ } else {
+ ui.getCategoryComboBox().setModel(new DefaultComboBoxModel(data.toArray()));
+ }
+ }
+ });
+
+ // when selected category changed, regenerate the table model + add inside some default rows
+ model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SELECTED_CATEGORY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (!categoryIsAdjusting) {
+
+ // can change the selected category
+ CreateSpeciesBatchUIModel source =
+ (CreateSpeciesBatchUIModel) evt.getSource();
+
+ // when selected category change, sample total weight is reset
+ source.setSampleWeight(null);
+
+ SampleCategoryModelEntry newValue =
+ (SampleCategoryModelEntry) evt.getNewValue();
+ generateTableModel(newValue);
+ }
+ }
+ });
+
+ ui.getCategoryComboBox().setRenderer(newListCellRender(SampleCategoryModelEntry.class));
+
+ generateTableModel(null);
+
+ initTable(getTable());
+
+ listenValidatorValid(ui.getValidator(), model);
}
@Override
@@ -184,7 +381,6 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
parent.getHandler().setBenthosSelectedCard(EditCatchesUIHandler.MAIN_CARD);
-
}
@Override
@@ -280,4 +476,126 @@
return result;
}
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected void computeSampleWeight(SplitBenthosBatchRowModel row) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will recompute sample weight from row: " + row);
+ }
+
+ Float result = null;
+ List<SplitBenthosBatchRowModel> rows = getTableModel().getRows();
+ for (SplitBenthosBatchRowModel rowModel : rows) {
+ Float weight = rowModel.getWeight();
+ if (weight != null) {
+ if (result == null) {
+ result = 0f;
+ }
+ result += weight;
+ }
+ }
+ getModel().setSampleWeight(result);
+ }
+
+ protected void generateTableModel(SampleCategoryModelEntry category) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Generate table model for category " + category);
+ }
+ // when generate a new table model, then reset previous rows from model
+ getModel().setRows(null);
+
+ Caracteristic data = null;
+
+ DefaultTableColumnModelExt columnModel =
+ new DefaultTableColumnModelExt();
+
+ { // Selection
+
+ addBooleanColumnToModel(columnModel,
+ SplitBenthosBatchTableModel.SELECTED,
+ getTable());
+ }
+
+ boolean editableCategoryValue = false;
+ if (category != null) {
+
+ if (!category.getCaracteristic().isQualitativeValueEmpty()) {
+
+ // qualitative category
+ data = category.getCaracteristic();
+ } else {
+ editableCategoryValue = true;
+ addFloatColumnToModel(columnModel,
+ SplitBenthosBatchTableModel.EDITABLE_CATEGORY_VALUE,
+ TuttiUI.DECIMAL1_PATTERN);
+ }
+
+ if (data != null) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Got " + data.sizeQualitativeValue() + " qualitative data to add");
+ }
+ addColumnToModel(columnModel,
+ null,
+ newTableCellRender(CaracteristicQualitativeValue.class),
+ SplitBenthosBatchTableModel.READ_ONLY_CATEGORY_VALUE);
+ }
+ { // Weight
+
+ addFloatColumnToModel(columnModel,
+ SplitBenthosBatchTableModel.WEIGHT,
+ TuttiUI.DECIMAL3_PATTERN);
+ }
+ }
+
+ // create table model
+ SplitBenthosBatchTableModel tableModel =
+ new SplitBenthosBatchTableModel(columnModel,
+ getModel(),
+ editableCategoryValue);
+
+ JXTable table = getTable();
+
+ // remove all listener on tables we could add before
+ uninstallTableSaveOnRowChangedSelectionListener();
+ uninstallTableKeyListener();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Install new table model " + tableModel);
+ }
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+
+ // install table listeners
+ installTableSaveOnRowChangedSelectionListener();
+ installTableKeyListener(columnModel, table);
+
+ // fill datas
+
+ List<SplitBenthosBatchRowModel> rows = Lists.newArrayList();
+
+ if (data != null) {
+
+ // add a row for each qualitive value
+ for (CaracteristicQualitativeValue qualitativeValue : data.getQualitativeValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Add QV: " + qualitativeValue);
+ }
+ SplitBenthosBatchRowModel newRow = tableModel.createNewRow();
+ newRow.setCategoryValue(qualitativeValue);
+ rows.add(newRow);
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will add " + rows.size() + " rows in table model " +
+ "(can add a first empty row? " + editableCategoryValue + ").");
+ }
+
+ getModel().setRows(rows);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -26,10 +26,14 @@
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.split.SplitBenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.create.CreateSpeciesBatchUI;
-import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -41,7 +45,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-public class CreateBenthosBatchUIModel extends AbstractTuttiBeanUIModel<CreateBenthosBatchUIModel, CreateBenthosBatchUIModel> {
+public class CreateBenthosBatchUIModel extends AbstractTuttiTableUIModel<CreateBenthosBatchUIModel, SplitBenthosBatchRowModel, CreateBenthosBatchUIModel> implements SelectedCategoryAble {
private final static Log log = LogFactory.getLog(CreateBenthosBatchUIModel.class);
@@ -57,6 +61,12 @@
public static final String PROPERTY_BATCH_COUNT = "batchCount";
+ public static final String PROPERTY_CATEGORY = "category";
+
+ public static final String PROPERTY_SELECTED_CATEGORY = "selectedCategory";
+
+ public static final String PROPERTY_SAMPLE_WEIGHT = "sampleWeight";
+
/**
* All available species (sets by protocol).
*
@@ -88,21 +98,54 @@
/**
* Batch count.
*
- * @since 0.3
+ * @since 2.5
*/
protected Integer batchCount;
/**
+ * Sample categories.
+ *
+ * @since 2.5
+ */
+ protected List<SampleCategoryModelEntry> category;
+
+ /**
+ * Selected Sample category.
+ *
+ * @since 2.5
+ */
+ protected SampleCategoryModelEntry selectedCategory;
+
+ /**
+ * Sample weight of split batches.
+ *
+ * @since 2.5
+ */
+ protected Float sampleWeight;
+
+ /**
+ * Model of sample categories.
+ *
+ * @since 2.5
+ */
+ protected SampleCategoryModel sampleCategoryModel;
+
+ /**
* Already used species by sample category.
*
* @since 0.3
*/
protected final Multimap<CaracteristicQualitativeValue, Species> speciesUsed = ArrayListMultimap.create();
- public CreateBenthosBatchUIModel() {
+ public CreateBenthosBatchUIModel(SampleCategoryModel sampleCategoryModel) {
super(CreateBenthosBatchUIModel.class, null, null);
+ this.sampleCategoryModel = sampleCategoryModel;
}
+ public SampleCategoryModel getSampleCategoryModel() {
+ return sampleCategoryModel;
+ }
+
public List<Species> getAvailableSpecies() {
if (log.isDebugEnabled()) {
log.debug("getAvailableSpecies " + availableSpecies);
@@ -160,6 +203,37 @@
firePropertyChange(PROPERTY_BATCH_COUNT, oldValue, batchCount);
}
+ public List<SampleCategoryModelEntry> getCategory() {
+ return category;
+ }
+
+ public void setCategory(List<SampleCategoryModelEntry> category) {
+ Object oldValue = getCategory();
+ this.category = category;
+ firePropertyChange(PROPERTY_CATEGORY, oldValue, category);
+ }
+
+ @Override
+ public SampleCategoryModelEntry getSelectedCategory() {
+ return selectedCategory;
+ }
+
+ public void setSelectedCategory(SampleCategoryModelEntry selectedCategory) {
+ Object oldValue = getSelectedCategory();
+ this.selectedCategory = selectedCategory;
+ firePropertyChange(PROPERTY_SELECTED_CATEGORY, oldValue, selectedCategory);
+ }
+
+ public Float getSampleWeight() {
+ return sampleWeight;
+ }
+
+ public void setSampleWeight(Float sampleWeight) {
+ Object oldValue = getSampleWeight();
+ this.sampleWeight = sampleWeight;
+ firePropertyChange(PROPERTY_SAMPLE_WEIGHT, oldValue, sampleWeight);
+ }
+
public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
return speciesUsed;
}
@@ -178,6 +252,6 @@
@Override
protected CreateBenthosBatchUIModel newEntity() {
- return new CreateBenthosBatchUIModel();
+ return new CreateBenthosBatchUIModel(sampleCategoryModel);
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import org.jdesktop.swingx.table.TableColumnModelExt;
@@ -61,10 +62,10 @@
n_("tutti.splitBenthosBatch.table.header.weight"),
n_("tutti.splitBenthosBatch.table.header.weight"));
- private final SplitBenthosBatchUIModel uiModel;
+ private final SelectedCategoryAble uiModel;
public SplitBenthosBatchTableModel(TableColumnModelExt columnModel,
- SplitBenthosBatchUIModel uiModel,
+ SelectedCategoryAble uiModel,
boolean createEmptyRowIsEmpty) {
super(columnModel, createEmptyRowIsEmpty, createEmptyRowIsEmpty);
this.uiModel = uiModel;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -31,7 +31,6 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
@@ -301,7 +300,13 @@
}
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
- parent.getBenthosTabContent().getHandler().splitBatch(getModel());
+ SplitBenthosBatchUIModel model = getModel();
+ if (model.isValid()) {
+ parent.getBenthosTabContent().getHandler().splitBatch(
+ model.getSelectedCategory(),
+ model.getRows(),
+ model.getSampleWeight());
+ }
// close dialog
closeUI(ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -26,6 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
@@ -38,7 +39,7 @@
* @since 0.3
*/
public class SplitBenthosBatchUIModel
- extends AbstractTuttiTableUIModel<BenthosBatchRowModel, SplitBenthosBatchRowModel, SplitBenthosBatchUIModel> {
+ extends AbstractTuttiTableUIModel<BenthosBatchRowModel, SplitBenthosBatchRowModel, SplitBenthosBatchUIModel> implements SelectedCategoryAble {
private static final long serialVersionUID = 1L;
@@ -106,6 +107,7 @@
firePropertyChange(PROPERTY_CATEGORY, oldValue, category);
}
+ @Override
public SampleCategoryModelEntry getSelectedCategory() {
return selectedCategory;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -657,6 +657,15 @@
// update speciesUsed
addToSpeciesUsed(newRow);
+
+ if (batchRootRowModel.getSelectedCategory() != null) {
+
+ // add first category
+ splitBatch(batchRootRowModel.getSelectedCategory(),
+ batchRootRowModel.getRows(),
+ batchRootRowModel.getSampleWeight()
+ );
+ }
}
recomputeBatchActionEnable();
@@ -722,8 +731,6 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
SplitSpeciesBatchUI splitBatchEditor = parent.getSpeciesTabSplitBatch();
-// splitBatchEditor.getHandler().editBatch(parentBatch);
-// parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.SPLIT_BATCH_CARD);
parent.getHandler().splitSpeciesBatch(parentBatch, splitBatchEditor);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 16:47:50 UTC (rev 1188)
@@ -51,6 +51,10 @@
data: {model.getAvailableSpecies()};
}
+#categoryPanel {
+ visible: {model.getSpecies() != null};
+}
+
#sampleCategoryLabel {
text: "tutti.createSpeciesBatch.field.sampleCategory";
toolTipText: "tutti.createSpeciesBatch.field.sampleCategory.tip";
@@ -93,6 +97,38 @@
bean: {model};
}
+#categoryLabel {
+ text: "tutti.createSpeciesBatch.field.category";
+ toolTipText: "tutti.createSpeciesBatch.field.categoryField.tip";
+ labelFor: {categoryComboBox};
+ _help: {"tutti.createSpeciesBatch.field.categoryField.help"};
+}
+
+#categoryComboBox {
+ selectedItem: {model.getSelectedCategory()};
+}
+
+#sampleWeightLabel {
+ text: "tutti.createSpeciesBatch.field.sampleWeight";
+ toolTipText: "tutti.createSpeciesBatch.field.sampleWeightField.tip";
+ labelFor: {sampleWeightField};
+ _help: {"tutti.createSpeciesBatch.field.sampleWeightField.help"};
+}
+
+#sampleWeightField {
+ editable: false;
+ enabled: false;
+ text: {getStringValue(model.getSampleWeight())};
+}
+
+#table {
+ selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ selectionBackground: {null};
+ selectionForeground: {Color.BLACK};
+ sortable: false;
+ enabled: {model.getSelectedCategory() != null}
+}
+
#addSpeciesButton {
text: "tutti.createSpeciesBatch.action.addSpecies";
toolTipText: "tutti.createSpeciesBatch.action.addSpecies.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 16:47:50 UTC (rev 1188)
@@ -28,6 +28,7 @@
<import>
fr.ifremer.tutti.persistence.entities.referential.Species
fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
+ fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
@@ -39,6 +40,7 @@
jaxx.runtime.swing.editor.NumberEditor
java.awt.Color
+ javax.swing.ListSelectionModel
static org.nuiton.i18n.I18n._
static jaxx.runtime.SwingUtil.getStringValue
@@ -68,12 +70,15 @@
<field name='sampleCategory'
component='sampleCategoryComboBox'/>
<field name='batchWeight' component='batchWeightField'/>
+ <field name='batchCount' component='batchCountField'/>
+ <field name='selectedCategory' component='categoryComboBox'/>
+ <field name='sampleWeight' component='sampleWeightField'/>
</BeanValidator>
<TuttiHelpBroker id='broker'
constructorParams='"tutti.createSpeciesBatch.help"'/>
- <Table id='configurationPanel' constraints='BorderLayout.CENTER' fill='both'>
+ <Table id='configurationPanel' constraints='BorderLayout.NORTH' fill='both'>
<!-- Species -->
<row>
@@ -123,6 +128,44 @@
</Table>
+ <JPanel id='categoryPanel' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+ <Table id='categoryConfigurationPanel' constraints='BorderLayout.NORTH'
+ fill='both'>
+ <row>
+ <cell columns="2">
+ <JSeparator/>
+ </cell>
+ </row>
+
+ <!-- First SampleCategory choice -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='categoryLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JComboBox id='categoryComboBox'
+ onActionPerformed="model.setSelectedCategory((SampleCategoryModelEntry) categoryComboBox.getSelectedItem());"/>
+ </cell>
+ </row>
+
+ <!-- Sample Total weight -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='sampleWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <JTextField id='sampleWeightField'/>
+ </cell>
+ </row>
+
+ </Table>
+
+ <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
+ <JXTable id='table'/>
+ </JScrollPane>
+ </JPanel>
+
<!-- Form Actions -->
<JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -30,6 +30,9 @@
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
+import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
+import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocols;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -38,16 +41,22 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUIModel;
-import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchTableModel;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUI;
import fr.ifremer.tutti.ui.swing.util.species.SelectSpeciesUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
@@ -60,7 +69,8 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-public class CreateSpeciesBatchUIHandler extends AbstractTuttiUIHandler<CreateSpeciesBatchUIModel, CreateSpeciesBatchUI> implements Cancelable {
+public class CreateSpeciesBatchUIHandler extends
+ AbstractTuttiTableUIHandler<SplitSpeciesBatchRowModel, CreateSpeciesBatchUIModel, CreateSpeciesBatchUI> implements Cancelable {
/** Logger. */
private static final Log log =
@@ -70,9 +80,13 @@
private final CaracteristicQualitativeValue sortedValue;
+ protected boolean categoryIsAdjusting;
+
public CreateSpeciesBatchUIHandler(TuttiUI parentUi,
CreateSpeciesBatchUI ui) {
- super(parentUi.getHandler().getContext(), ui);
+ super(parentUi.getHandler().getContext(), ui,
+ SplitSpeciesBatchRowModel.PROPERTY_CATEGORY_VALUE,
+ SplitSpeciesBatchRowModel.PROPERTY_WEIGHT);
this.persistenceService = context.getPersistenceService();
SampleCategoryModel sampleCategoryModel =
@@ -90,17 +104,71 @@
break;
}
}
- Preconditions.checkNotNull(vracValue,"Could not found vrac qualitative value");
+ Preconditions.checkNotNull(vracValue, "Could not found vrac qualitative value");
sortedValue = vracValue;
}
//------------------------------------------------------------------------//
+ //-- AbstractTuttiTableUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public SplitSpeciesBatchTableModel getTableModel() {
+ return (SplitSpeciesBatchTableModel) getTable().getModel();
+ }
+
+ @Override
+ public JXTable getTable() {
+ return ui.getTable();
+ }
+
+ @Override
+ protected boolean isRowValid(SplitSpeciesBatchRowModel row) {
+ return row.isValid();
+ }
+
+ @Override
+ protected void saveSelectedRowIfRequired(TuttiBeanMonitor<SplitSpeciesBatchRowModel> rowMonitor,
+ SplitSpeciesBatchRowModel row) {
+ if (rowMonitor.wasModified()) {
+
+ if (row.isValid()) {
+ if (log.isInfoEnabled()) {
+ log.info("Change row that was modified and valid");
+ }
+ }
+
+ rowMonitor.clearModified();
+ }
+ }
+
+ @Override
+ protected void onRowModified(int rowIndex,
+ SplitSpeciesBatchRowModel row,
+ String propertyName,
+ Object oldValue,
+ Object newValue) {
+
+ recomputeRowValidState(row);
+
+ if (SplitSpeciesBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) {
+
+ // Need to recompute the sample weight
+ computeSampleWeight(row);
+ }
+ }
+
+ //------------------------------------------------------------------------//
//-- AbstractTuttiUIHandler methods --//
//------------------------------------------------------------------------//
@Override
public void beforeInitUI() {
- CreateSpeciesBatchUIModel model = new CreateSpeciesBatchUIModel();
+
+ SampleCategoryModel sampleCategoryModel =
+ getDataContext().getSampleCategoryModel();
+ CreateSpeciesBatchUIModel model =
+ new CreateSpeciesBatchUIModel(sampleCategoryModel);
ui.setContextValue(model);
listModelIsModify(model);
}
@@ -122,7 +190,9 @@
caracteristic.getQualitativeValue(),
null);
- getModel().addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SPECIES, new PropertyChangeListener() {
+ CreateSpeciesBatchUIModel model = getModel();
+
+ model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SPECIES, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -136,11 +206,15 @@
if (newValue == null || source.getSpeciesUsed() == null) {
+ // reste V/HV category
source.setSampleCategory(null);
+ // reset categories
+ source.setCategory(null);
+
} else {
- // look for best value : if sorted is available then use it
+ // look for best value for V/HV category : if sorted is available then use it
List<CaracteristicQualitativeValue> qualitativeValues =
ui.getSampleCategoryComboBox().getData();
@@ -157,11 +231,134 @@
}
}
source.setSampleCategory(newCategory);
+
+ // recompute possible categories
+ List<SampleCategoryModelEntry> categories = Lists.newArrayList();
+
+ SampleCategoryModel sampleCategoryModel =
+ getModel().getSampleCategoryModel();
+
+ // add all categories
+ categories.addAll(sampleCategoryModel.getCategory());
+
+ // remove the first one (V/HV)
+ categories.remove(0);
+
+ // reset selected category
+ if (log.isInfoEnabled()) {
+ log.info("Remove selected category before changing the categories...");
+ }
+ source.setSelectedCategory(null);
+
+ categoryIsAdjusting = true;
+
+ try {
+
+ // set universe of categories
+ if (log.isInfoEnabled()) {
+ log.info("Categories to use: " + categories);
+ }
+
+ source.setCategory(categories);
+
+ // force to remove the first selected value of the combo-box
+ ui.getCategoryComboBox().setSelectedItem(null);
+ } finally {
+ categoryIsAdjusting = false;
+ }
+
+ // compute the selected sample category
+
+ SampleCategoryModelEntry selectedCategory = null;
+
+ if (getDataContext().isProtocolFilled()) {
+
+ // try to find the first category from protocol
+ TuttiProtocol protocol = getDataContext().getProtocol();
+ SpeciesProtocol speciesProtocol = TuttiProtocols.getSpeciesProtocol(protocol, newValue);
+ if (speciesProtocol != null) {
+
+ // species defined in protocol
+ if (speciesProtocol.sizeMandatorySampleCategoryId() > 1) {
+
+ // use the second category (the first one is V/HV)
+ Integer categoryId = speciesProtocol.getMandatorySampleCategoryId().get(1);
+ selectedCategory = sampleCategoryModel.getCategoryById(categoryId);
+ if (log.isInfoEnabled()) {
+ log.info("Use category from protocol: " + categoryId + " :: " + selectedCategory);
+ }
+ }
+ }
+ }
+
+ if (selectedCategory == null) {
+
+ // by default use the first one
+ selectedCategory = categories.get(0);
+
+ if (log.isInfoEnabled()) {
+ log.info("Use default first category: " + selectedCategory);
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Selected category : " + selectedCategory);
+ }
+ ui.getCategoryComboBox().setSelectedItem(selectedCategory);
}
}
});
- listenValidatorValid(ui.getValidator(), getModel());
+ // when category changed, remove selected category
+ model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_CATEGORY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+// CreateSpeciesBatchUIModel source =
+// (CreateSpeciesBatchUIModel) evt.getSource();
+
+// // unselect previous selected category
+// source.setSelectedCategory(null);
+
+ // fill comboBox with new list
+ List<SampleCategoryModelEntry> data = (List<SampleCategoryModelEntry>) evt.getNewValue();
+ if (data == null) {
+
+ ui.getCategoryComboBox().setModel(new DefaultComboBoxModel());
+ } else {
+ ui.getCategoryComboBox().setModel(new DefaultComboBoxModel(data.toArray()));
+ }
+ }
+ });
+
+ // when selected category changed, regenerate the table model + add inside some default rows
+ model.addPropertyChangeListener(CreateSpeciesBatchUIModel.PROPERTY_SELECTED_CATEGORY, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (!categoryIsAdjusting) {
+
+ // can change the selected category
+ CreateSpeciesBatchUIModel source =
+ (CreateSpeciesBatchUIModel) evt.getSource();
+
+ // when selected category change, sample total weight is reset
+ source.setSampleWeight(null);
+
+ SampleCategoryModelEntry newValue =
+ (SampleCategoryModelEntry) evt.getNewValue();
+ generateTableModel(newValue);
+ }
+ }
+ });
+
+ ui.getCategoryComboBox().setRenderer(newListCellRender(SampleCategoryModelEntry.class));
+
+ generateTableModel(null);
+
+ initTable(getTable());
+
+ listenValidatorValid(ui.getValidator(), model);
}
@Override
@@ -184,7 +381,6 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.MAIN_CARD);
-
}
@Override
@@ -279,4 +475,127 @@
return result;
}
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected void computeSampleWeight(SplitSpeciesBatchRowModel row) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will recompute sample weight from row: " + row);
+ }
+
+ Float result = null;
+ List<SplitSpeciesBatchRowModel> rows = getTableModel().getRows();
+ for (SplitSpeciesBatchRowModel rowModel : rows) {
+ Float weight = rowModel.getWeight();
+ if (weight != null) {
+ if (result == null) {
+ result = 0f;
+ }
+ result += weight;
+ }
+ }
+ getModel().setSampleWeight(result);
+ }
+
+ protected void generateTableModel(SampleCategoryModelEntry category) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Generate table model for category " + category);
+ }
+ // when generate a new table model, then reset previous rows from model
+ getModel().setRows(null);
+
+ Caracteristic data = null;
+
+ DefaultTableColumnModelExt columnModel =
+ new DefaultTableColumnModelExt();
+
+ { // Selection
+
+ addBooleanColumnToModel(columnModel,
+ SplitSpeciesBatchTableModel.SELECTED,
+ getTable());
+ }
+
+ boolean editableCategoryValue = false;
+ if (category != null) {
+
+ if (!category.getCaracteristic().isQualitativeValueEmpty()) {
+
+ // qualitative category
+ data = category.getCaracteristic();
+ } else {
+ editableCategoryValue = true;
+ addFloatColumnToModel(columnModel,
+ SplitSpeciesBatchTableModel.EDITABLE_CATEGORY_VALUE,
+ TuttiUI.DECIMAL1_PATTERN);
+ }
+
+ if (data != null) {
+
+ if (log.isInfoEnabled()) {
+ log.info("Got " + data.sizeQualitativeValue() + " qualitative data to add");
+ }
+ addColumnToModel(columnModel,
+ null,
+ newTableCellRender(CaracteristicQualitativeValue.class),
+ SplitSpeciesBatchTableModel.READ_ONLY_CATEGORY_VALUE);
+ }
+ { // Weight
+
+ addFloatColumnToModel(columnModel,
+ SplitSpeciesBatchTableModel.WEIGHT,
+ TuttiUI.DECIMAL3_PATTERN);
+ }
+ }
+
+ // create table model
+ SplitSpeciesBatchTableModel tableModel =
+ new SplitSpeciesBatchTableModel(columnModel,
+ getModel(),
+ editableCategoryValue);
+
+ JXTable table = getTable();
+
+ // remove all listener on tables we could add before
+ uninstallTableSaveOnRowChangedSelectionListener();
+ uninstallTableKeyListener();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Install new table model " + tableModel);
+ }
+ table.setModel(tableModel);
+ table.setColumnModel(columnModel);
+
+ // install table listeners
+ installTableSaveOnRowChangedSelectionListener();
+ installTableKeyListener(columnModel, table);
+
+ // fill datas
+
+ List<SplitSpeciesBatchRowModel> rows = Lists.newArrayList();
+
+ if (data != null) {
+
+ // add a row for each qualitive value
+ for (CaracteristicQualitativeValue qualitativeValue : data.getQualitativeValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Add QV: " + qualitativeValue);
+ }
+ SplitSpeciesBatchRowModel newRow = tableModel.createNewRow();
+ newRow.setCategoryValue(qualitativeValue);
+ rows.add(newRow);
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will add " + rows.size() + " rows in table model " +
+ "(can add a first empty row? " + editableCategoryValue + ").");
+ }
+
+ getModel().setRows(rows);
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -26,9 +26,13 @@
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchRowModel;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -40,9 +44,10 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
*/
-public class CreateSpeciesBatchUIModel extends AbstractTuttiBeanUIModel<CreateSpeciesBatchUIModel, CreateSpeciesBatchUIModel> {
+public class CreateSpeciesBatchUIModel extends AbstractTuttiTableUIModel<CreateSpeciesBatchUIModel, SplitSpeciesBatchRowModel, CreateSpeciesBatchUIModel> implements SelectedCategoryAble {
- private final static Log log = LogFactory.getLog(CreateSpeciesBatchUIModel.class);
+ private final static Log log =
+ LogFactory.getLog(CreateSpeciesBatchUIModel.class);
private static final long serialVersionUID = 1L;
@@ -56,6 +61,12 @@
public static final String PROPERTY_BATCH_COUNT = "batchCount";
+ public static final String PROPERTY_CATEGORY = "category";
+
+ public static final String PROPERTY_SELECTED_CATEGORY = "selectedCategory";
+
+ public static final String PROPERTY_SAMPLE_WEIGHT = "sampleWeight";
+
/**
* All available species (sets by protocol).
*
@@ -87,21 +98,54 @@
/**
* Batch count.
*
- * @since 0.3
+ * @since 2.5
*/
protected Integer batchCount;
/**
+ * Sample categories.
+ *
+ * @since 2.5
+ */
+ protected List<SampleCategoryModelEntry> category;
+
+ /**
+ * Selected Sample category.
+ *
+ * @since 2.5
+ */
+ protected SampleCategoryModelEntry selectedCategory;
+
+ /**
+ * Sample weight of split batches.
+ *
+ * @since 2.5
+ */
+ protected Float sampleWeight;
+
+ /**
+ * Model of sample categories.
+ *
+ * @since 2.5
+ */
+ protected SampleCategoryModel sampleCategoryModel;
+
+ /**
* Already used species by sample category.
*
* @since 0.3
*/
protected final Multimap<CaracteristicQualitativeValue, Species> speciesUsed = ArrayListMultimap.create();
- public CreateSpeciesBatchUIModel() {
+ public CreateSpeciesBatchUIModel(SampleCategoryModel sampleCategoryModel) {
super(CreateSpeciesBatchUIModel.class, null, null);
+ this.sampleCategoryModel = sampleCategoryModel;
}
+ public SampleCategoryModel getSampleCategoryModel() {
+ return sampleCategoryModel;
+ }
+
public List<Species> getAvailableSpecies() {
if (log.isDebugEnabled()) {
log.debug("getAvailableSpecies " + availableSpecies);
@@ -159,6 +203,37 @@
firePropertyChange(PROPERTY_BATCH_COUNT, oldValue, batchCount);
}
+ public List<SampleCategoryModelEntry> getCategory() {
+ return category;
+ }
+
+ public void setCategory(List<SampleCategoryModelEntry> category) {
+ Object oldValue = getCategory();
+ this.category = category;
+ firePropertyChange(PROPERTY_CATEGORY, oldValue, category);
+ }
+
+ @Override
+ public SampleCategoryModelEntry getSelectedCategory() {
+ return selectedCategory;
+ }
+
+ public void setSelectedCategory(SampleCategoryModelEntry selectedCategory) {
+ Object oldValue = getSelectedCategory();
+ this.selectedCategory = selectedCategory;
+ firePropertyChange(PROPERTY_SELECTED_CATEGORY, oldValue, selectedCategory);
+ }
+
+ public Float getSampleWeight() {
+ return sampleWeight;
+ }
+
+ public void setSampleWeight(Float sampleWeight) {
+ Object oldValue = getSampleWeight();
+ this.sampleWeight = sampleWeight;
+ firePropertyChange(PROPERTY_SAMPLE_WEIGHT, oldValue, sampleWeight);
+ }
+
public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
return speciesUsed;
}
@@ -177,6 +252,6 @@
@Override
protected CreateSpeciesBatchUIModel newEntity() {
- return new CreateSpeciesBatchUIModel();
+ return new CreateSpeciesBatchUIModel(sampleCategoryModel);
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -24,6 +24,7 @@
* #L%
*/
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import org.jdesktop.swingx.table.TableColumnModelExt;
@@ -61,10 +62,10 @@
n_("tutti.splitSpeciesBatch.table.header.weight"),
n_("tutti.splitSpeciesBatch.table.header.weight"));
- private final SplitSpeciesBatchUIModel uiModel;
+ private final SelectedCategoryAble uiModel;
public SplitSpeciesBatchTableModel(TableColumnModelExt columnModel,
- SplitSpeciesBatchUIModel uiModel,
+ SelectedCategoryAble uiModel,
boolean createEmptyRowIsEmpty) {
super(columnModel, createEmptyRowIsEmpty, createEmptyRowIsEmpty);
this.uiModel = uiModel;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -31,7 +31,6 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
@@ -69,19 +68,11 @@
private static final Log log =
LogFactory.getLog(SplitSpeciesBatchUIHandler.class);
-// /**
-// * Parent UI.
-// *
-// * @since 0.3
-// */
-// private final SpeciesBatchUI parentUi;
-
public SplitSpeciesBatchUIHandler(EditCatchesUI parentUi,
SplitSpeciesBatchUI ui) {
super(parentUi.getHandler().getContext(), ui,
SplitSpeciesBatchRowModel.PROPERTY_CATEGORY_VALUE,
SplitSpeciesBatchRowModel.PROPERTY_WEIGHT);
-// this.parentUi = parentUi.getSpeciesTabContent();
}
//------------------------------------------------------------------------//
@@ -251,11 +242,6 @@
//-- Public methods --//
//------------------------------------------------------------------------//
- public String decorateSpecies(Species object) {
- String result = object == null ? "" : super.decorate(object);
- return result;
- }
-
public void editBatch(SpeciesBatchRowModel batch) {
// get possible the last used
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -26,7 +26,7 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.SelectedCategoryAble;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
@@ -39,14 +39,12 @@
* @since 0.3
*/
public class SplitSpeciesBatchUIModel
- extends AbstractTuttiTableUIModel<SpeciesBatchRowModel, SplitSpeciesBatchRowModel, SplitSpeciesBatchUIModel> {
+ extends AbstractTuttiTableUIModel<SpeciesBatchRowModel, SplitSpeciesBatchRowModel, SplitSpeciesBatchUIModel> implements SelectedCategoryAble {
private static final long serialVersionUID = 1L;
public static final String PROPERTY_CATEGORY = "category";
-// public static final String PROPERTY_SPECIES = "species";
-
public static final String PROPERTY_SELECTED_CATEGORY = "selectedCategory";
public static final String PROPERTY_BATCH_WEIGHT = "batchWeight";
@@ -81,6 +79,11 @@
*/
protected Float sampleWeight;
+ /**
+ * Model of sample categories.
+ *
+ * @since 2.4
+ */
protected SampleCategoryModel sampleCategoryModel;
public SplitSpeciesBatchUIModel(SampleCategoryModel sampleCategoryModel) {
@@ -93,18 +96,12 @@
}
public void setBatch(SpeciesBatchRowModel batch) {
-// Object oldSpecies = getSpecies();
Object oldWeight = getBatchWeight();
this.batch = batch;
-// firePropertyChange(PROPERTY_SPECIES, oldSpecies, getSpecies());
firePropertyChange(PROPERTY_BATCH_WEIGHT, oldWeight, getBatchWeight());
}
-// public Species getSpecies() {
-// return batch == null ? null : batch.getSpecies();
-// }
-
public List<SampleCategoryModelEntry> getCategory() {
return category;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-18 16:47:50 UTC (rev 1188)
@@ -362,6 +362,11 @@
for (SampleCategoryModelEntry sampleCategoryModelEntry : sampleCategoryModel.getCategory()) {
+ if (sampleCategoryModelEntry.getOrder() == 0) {
+ // first category is not editable
+ continue;
+ }
+
MandatorySampleCategoryColumnIdentifier identifier = MandatorySampleCategoryColumnIdentifier.newId(
EditProtocolSpeciesRowModel.PROPERTY_MANDATORY_SAMPLE_CATEGORY_ID,
sampleCategoryModelEntry.getCategoryId(),
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel-error-validation.xml 2013-09-18 16:47:50 UTC (rev 1188)
@@ -70,4 +70,24 @@
</field-validator>
</field>
+
+ <field name="sampleWeight">
+
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
+ <message>
+ tutti.validator.error.splitSpeciesBatch.sampleWeight.invalidValue
+ </message>
+ </field-validator>
+
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || batchWeight == null || sampleWeight <= batchWeight]]></param>
+ <message>
+ tutti.validator.error.splitSpeciesBatch.sampleWeight.sampleBatchGreaterThanBatchWeight
+ </message>
+ </field-validator>
+
+ </field>
</validators>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel-error-validation.xml 2013-09-18 16:47:50 UTC (rev 1188)
@@ -69,4 +69,24 @@
</field-validator>
</field>
+
+ <field name="sampleWeight">
+
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || sampleWeight > 0 ]]></param>
+ <message>
+ tutti.validator.error.splitSpeciesBatch.sampleWeight.invalidValue
+ </message>
+ </field-validator>
+
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ sampleWeight == null || batchWeight == null || sampleWeight <= batchWeight]]></param>
+ <message>
+ tutti.validator.error.splitSpeciesBatch.sampleWeight.sampleBatchGreaterThanBatchWeight
+ </message>
+ </field-validator>
+
+ </field>
</validators>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 16:47:50 UTC (rev 1188)
@@ -181,8 +181,12 @@
tutti.createBenthosBatch.field.batchCount.tip=
tutti.createBenthosBatch.field.batchWeight=
tutti.createBenthosBatch.field.batchWeight.tip=
+tutti.createBenthosBatch.field.category=
+tutti.createBenthosBatch.field.categoryField.tip=
tutti.createBenthosBatch.field.sampleCategory=
tutti.createBenthosBatch.field.sampleCategory.tip=
+tutti.createBenthosBatch.field.sampleWeight=
+tutti.createBenthosBatch.field.sampleWeightField.tip=
tutti.createBenthosBatch.field.species=
tutti.createBenthosBatch.field.species.tip=
tutti.createBenthosBatch.title=
@@ -241,8 +245,12 @@
tutti.createSpeciesBatch.field.batchCount.tip=
tutti.createSpeciesBatch.field.batchWeight=
tutti.createSpeciesBatch.field.batchWeight.tip=
+tutti.createSpeciesBatch.field.category=
+tutti.createSpeciesBatch.field.categoryField.tip=
tutti.createSpeciesBatch.field.sampleCategory=
tutti.createSpeciesBatch.field.sampleCategory.tip=
+tutti.createSpeciesBatch.field.sampleWeight=
+tutti.createSpeciesBatch.field.sampleWeightField.tip=
tutti.createSpeciesBatch.field.species=
tutti.createSpeciesBatch.field.species.tip=
tutti.createSpeciesBatch.title=
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 12:38:56 UTC (rev 1187)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 16:47:50 UTC (rev 1188)
@@ -168,8 +168,12 @@
tutti.createBenthosBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot
tutti.createBenthosBatch.field.batchWeight=Poids du lot (kg)
tutti.createBenthosBatch.field.batchWeight.tip=Poids du lot (kg)
+tutti.createBenthosBatch.field.category=Catégorie
+tutti.createBenthosBatch.field.categoryField.tip=Choisir le mode de catégorisation
tutti.createBenthosBatch.field.sampleCategory=V / HV
tutti.createBenthosBatch.field.sampleCategory.tip=Catégorie Vrac / Hors Vrac
+tutti.createBenthosBatch.field.sampleWeight=Poids total catégorisé (kg)
+tutti.createBenthosBatch.field.sampleWeightField.tip=Somme des poids saisis ci-dessous (kg)
tutti.createBenthosBatch.field.species=Espèce du lot
tutti.createBenthosBatch.field.species.tip=Espèce du lot
tutti.createBenthosBatch.title=Créer un lot
@@ -225,8 +229,12 @@
tutti.createSpeciesBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot
tutti.createSpeciesBatch.field.batchWeight=Poids du lot (kg)
tutti.createSpeciesBatch.field.batchWeight.tip=Poids du lot (non obligatoire à ce stade)
+tutti.createSpeciesBatch.field.category=Catégorie
+tutti.createSpeciesBatch.field.categoryField.tip=Choisir le mode de catégorisation
tutti.createSpeciesBatch.field.sampleCategory=V / HV
tutti.createSpeciesBatch.field.sampleCategory.tip=Catégorie Vrac / Hors Vrac
+tutti.createSpeciesBatch.field.sampleWeight=Poids total catégorisé (kg)
+tutti.createSpeciesBatch.field.sampleWeightField.tip=Somme des poids saisis ci-dessous (kg)
tutti.createSpeciesBatch.field.species=Espèce du lot
tutti.createSpeciesBatch.field.species.tip=Code campagne ou Code Rubin – Nom scientifique du lot à créer
tutti.createSpeciesBatch.title=Créer un lot
1
0
r1187 - in trunk/tutti-ui-swing/src/main: filtered-resources help/fr java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create resources/i18n
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 14:38:56 +0200 (Wed, 18 Sep 2013)
New Revision: 1187
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1187
Log:
fixes #3279: [CAPTURE] pouvoir saisir aussi le nombre d?\195?\168s la cr?\195?\169ation d'un lot + ajout doc
Added:
trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/help/fr/editCruise.html
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 12:38:56 UTC (rev 1187)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Sep 18 13:39:38 CEST 2013
+#Wed Sep 18 14:22:16 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -12,9 +12,9 @@
tutti.createAccidentalBatch.help=editFishingOperation.html\#captureCapturesAccidentelles
tutti.createBenthosBatch.action.addSpecies.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.cancel.help=editFishingOperation.html\#captureBenthosActions
-tutti.createBenthosBatch.action.save.help=
tutti.createBenthosBatch.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.field.batchCount.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sampleCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
@@ -36,11 +36,11 @@
tutti.createMarineLitterBatch.help=editFishingOperation.html\#captureMacroDechets
tutti.createSpeciesBatch.action.addSpecies.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.cancel.help=editFishingOperation.html\#captureEspecesCreeLotActions
-tutti.createSpeciesBatch.action.save.help=
tutti.createSpeciesBatch.action.saveAndClose.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.field.batchCount.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
-tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.species.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.help=editFishingOperation.html\#captureEspecesCreeLot
@@ -50,7 +50,7 @@
tutti.dbManager.action.importDb.help=dbManager.html\#actions
tutti.dbManager.action.installDb.help=dbManager.html\#actions
tutti.dbManager.action.openDb.help=dbManager.html\#actions
-tutti.dbManager.action.reinstallDb.help=
+tutti.dbManager.action.reinstallDb.help=dbManager.html\#actions
tutti.dbManager.action.upgradeDb.help=dbManager.html\#actions
tutti.dbManager.help=dbManager.html
tutti.editAccidentalBatch.action.createBatch.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -211,13 +211,13 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fieldsCaracteristics
-tutti.editSampleCategoryModel.action.cancel.help=
-tutti.editSampleCategoryModel.action.close.help=
-tutti.editSampleCategoryModel.action.moveDownEntry.help=
-tutti.editSampleCategoryModel.action.moveUpEntry.help=
-tutti.editSampleCategoryModel.action.removeEntry.help=
-tutti.editSampleCategoryModel.action.save.help=
-tutti.editSampleCategoryModel.help=
+tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.help=editSampleCategory.html
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.editFrequencies.help=editFishingOperation.html\#captureEspecesActions
@@ -261,7 +261,7 @@
tutti.main.action.changeLocaleFR.help=menu.html\#menu_aide
tutti.main.action.changeLocaleUK.help=menu.html\#menu_aide
tutti.main.action.showHelp.help=menu.html\#menu_aide
-tutti.main.help=menu.html\#menu_aide
+tutti.main.help=index.html
tutti.main.menu.action.about.help=menu.html\#menu_aide
tutti.main.menu.action.changeLocale.help=menu.html\#menu_aide
tutti.main.menu.action.changeLocaleFR.help=menu.html\#menu_aide
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 12:38:56 UTC (rev 1187)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Wed Sep 18 13:39:38 CEST 2013
+#Wed Sep 18 14:22:16 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -12,11 +12,11 @@
tutti.createAccidentalBatch.help=editFishingOperation.html\#captureCapturesAccidentelles
tutti.createBenthosBatch.action.addSpecies.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.cancel.help=editFishingOperation.html\#captureBenthosActions
-tutti.createBenthosBatch.action.save.help=editFishingOperation.html\#captureBenthosActions
-tutti.createBenthosBatch.action.saveAndClose.help=
-tutti.createBenthosBatch.action.saveAndContinue.help=
+tutti.createBenthosBatch.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.field.batchCount.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
-tutti.createBenthosBatch.field.sampleCategory.help=
+tutti.createBenthosBatch.field.sampleCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.species.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.help=editFishingOperation.html\#captureBenthos
@@ -36,9 +36,9 @@
tutti.createMarineLitterBatch.help=editFishingOperation.html\#captureMacroDechets
tutti.createSpeciesBatch.action.addSpecies.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.cancel.help=editFishingOperation.html\#captureEspecesCreeLotActions
-tutti.createSpeciesBatch.action.save.help=
tutti.createSpeciesBatch.action.saveAndClose.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.field.batchCount.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
@@ -50,7 +50,7 @@
tutti.dbManager.action.importDb.help=dbManager.html\#actions
tutti.dbManager.action.installDb.help=dbManager.html\#actions
tutti.dbManager.action.openDb.help=dbManager.html\#actions
-tutti.dbManager.action.reinstallDb.help=
+tutti.dbManager.action.reinstallDb.help=dbManager.html\#actions
tutti.dbManager.action.upgradeDb.help=dbManager.html\#actions
tutti.dbManager.help=dbManager.html
tutti.editAccidentalBatch.action.createBatch.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -211,13 +211,13 @@
tutti.editProtocol.field.vesselUseFeature.help=editProtocol.html\#fieldsCaracteristics
tutti.editProtocol.help=editProtocol.html
tutti.editProtocol.pane.caracteristic.help=editProtocol.html\#fieldsCaracteristics
-tutti.editSampleCategoryModel.action.cancel.help=
-tutti.editSampleCategoryModel.action.close.help=
-tutti.editSampleCategoryModel.action.moveDownEntry.help=
-tutti.editSampleCategoryModel.action.moveUpEntry.help=
-tutti.editSampleCategoryModel.action.removeEntry.help=
-tutti.editSampleCategoryModel.action.save.help=
-tutti.editSampleCategoryModel.help=
+tutti.editSampleCategoryModel.action.cancel.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.close.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.moveDownEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.moveUpEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html#actions
+tutti.editSampleCategoryModel.help=editSampleCategory.html
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.editFrequencies.help=editFishingOperation.html\#captureEspecesActions
Modified: trunk/tutti-ui-swing/src/main/help/fr/editCruise.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editCruise.html 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/help/fr/editCruise.html 2013-09-18 12:38:56 UTC (rev 1187)
@@ -93,6 +93,6 @@
<dt>Enregistrer</dt>
<dd>enregistre les modifications faites dans les différents champs.</dd>
</dl>
-
+</div>
</body>
</html>
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html
===================================================================
--- trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html (rev 0)
+++ trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html 2013-09-18 12:38:56 UTC (rev 1187)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="fr">
+
+<head>
+ <meta charset="utf-8"/>
+ <title>Tutti - Créer / Éditer une campagne</title>
+ <link href="../css/bootstrap.min.css" rel="stylesheet">
+ <link href="../css/style.css" rel="stylesheet">
+ <script type="text/javascript" src="../js/jquery-2.0.3.min.js"></script>
+ <script type="text/javascript" src="../js/bootstrap.min.js"></script>
+</head>
+<body>
+
+<script type="text/javascript" src="../js/navbar.js"></script>
+
+<div class="container">
+ <div class="page-header">
+ <h1>Configurer les catégories</h1>
+ </div>
+
+ <p>Sur cet écran, on peut configuer les catégories à utiliser dans l'écran Espèces / Benthos.</p>
+
+ <h2>Description des champs<a name="fields"></a></h2>
+ TODO
+
+ <h2>Description des actions<a name="actions"></a></h2>
+ <dl>
+ <dt>Fermer</dt>
+ <dd>ferme l'écran.</dd>
+ <dt>Enregistrer</dt>
+ <dd>enregistre les modifications.</dd>
+ </dl>
+</div>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/help/fr/editSampleCategory.html
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -631,19 +631,20 @@
parent.getHandler().setBenthosSelectedCard(EditCatchesUIHandler.CREATE_BATCH_CARD);
}
- public void addBatch(CreateBenthosBatchUIModel bethosBatchRootRowModel) {
- if (bethosBatchRootRowModel.isValid()) {
+ public void addBatch(CreateBenthosBatchUIModel batchRootRowModel) {
+ if (batchRootRowModel.isValid()) {
BenthosBatchTableModel tableModel = getTableModel();
BenthosBatchRowModel newRow = tableModel.createNewRow();
- Species species = bethosBatchRootRowModel.getSpecies();
+ Species species = batchRootRowModel.getSpecies();
newRow.setSpecies(species);
+ newRow.setNumber(batchRootRowModel.getBatchCount());
- CaracteristicQualitativeValue sampleCategory = bethosBatchRootRowModel.getSampleCategory();
+ CaracteristicQualitativeValue sampleCategory = batchRootRowModel.getSampleCategory();
SampleCategory category = newRow.getFirstSampleCategory();
category.setCategoryValue(sampleCategory);
- category.setCategoryWeight(bethosBatchRootRowModel.getBatchWeight());
+ category.setCategoryWeight(batchRootRowModel.getBatchWeight());
newRow.setSampleCategory(category);
recomputeRowValidState(newRow);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 12:38:56 UTC (rev 1187)
@@ -78,6 +78,21 @@
bean: {model};
}
+#batchCountLabel {
+ text: "tutti.createBenthosBatch.field.batchCount";
+ toolTipText: "tutti.createBenthosBatch.field.batchCount.tip";
+ labelFor: {batchCountField};
+ _help: {"tutti.createBenthosBatch.field.batchCount.help"};
+}
+
+#batchCountField {
+ property: batchCount;
+ model: {model.getBatchCount()};
+ useFloat: true;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+ bean: {model};
+}
+
#addSpeciesButton {
text: "tutti.createBenthosBatch.action.addSpecies";
toolTipText: "tutti.createBenthosBatch.action.addSpecies.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 12:38:56 UTC (rev 1187)
@@ -99,6 +99,16 @@
</cell>
</row>
+ <!-- Species batch count -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='batchCountLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <NumberEditor id='batchCountField' constructorParams='this'/>
+ </cell>
+ </row>
+
<!-- Sorted / Unsorted Category -->
<row>
<cell anchor='west'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -218,6 +218,7 @@
model.setSpecies(null);
model.setSampleCategory(null);
model.setBatchWeight(null);
+ model.setBatchCount(null);
List<Species> speciesToUse = Lists.newArrayList();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -55,6 +55,8 @@
public static final String PROPERTY_BATCH_WEIGHT = "batchWeight";
+ public static final String PROPERTY_BATCH_COUNT = "batchCount";
+
/**
* All available species (sets by protocol).
*
@@ -77,13 +79,20 @@
protected CaracteristicQualitativeValue sampleCategory;
/**
- * Incoming batch weight to split.
+ * Batch weight.
*
* @since 0.3
*/
protected Float batchWeight;
/**
+ * Batch count.
+ *
+ * @since 0.3
+ */
+ protected Integer batchCount;
+
+ /**
* Already used species by sample category.
*
* @since 0.3
@@ -141,6 +150,16 @@
firePropertyChange(PROPERTY_BATCH_WEIGHT, oldValue, batchWeight);
}
+ public Integer getBatchCount() {
+ return batchCount;
+ }
+
+ public void setBatchCount(Integer batchCount) {
+ Object oldValue = getBatchCount();
+ this.batchCount = batchCount;
+ firePropertyChange(PROPERTY_BATCH_COUNT, oldValue, batchCount);
+ }
+
public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
return speciesUsed;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -633,19 +633,19 @@
parent.getHandler().setSpeciesSelectedCard(EditCatchesUIHandler.CREATE_BATCH_CARD);
}
- public void addBatch(CreateSpeciesBatchUIModel speciesBatchRootRowModel) {
- if (speciesBatchRootRowModel.isValid()) {
+ public void addBatch(CreateSpeciesBatchUIModel batchRootRowModel) {
+ if (batchRootRowModel.isValid()) {
SpeciesBatchTableModel tableModel = getTableModel();
SpeciesBatchRowModel newRow = tableModel.createNewRow();
- Species species = speciesBatchRootRowModel.getSpecies();
+ Species species = batchRootRowModel.getSpecies();
newRow.setSpecies(species);
-
- CaracteristicQualitativeValue sampleCategory = speciesBatchRootRowModel.getSampleCategory();
+ newRow.setNumber(batchRootRowModel.getBatchCount());
+ CaracteristicQualitativeValue sampleCategory = batchRootRowModel.getSampleCategory();
SampleCategory category = newRow.getFirstSampleCategory();
category.setCategoryValue(sampleCategory);
- category.setCategoryWeight(speciesBatchRootRowModel.getBatchWeight());
+ category.setCategoryWeight(batchRootRowModel.getBatchWeight());
newRow.setSampleCategory(category);
recomputeRowValidState(newRow);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 12:38:56 UTC (rev 1187)
@@ -78,6 +78,21 @@
bean: {model};
}
+#batchCountLabel {
+ text: "tutti.createSpeciesBatch.field.batchCount";
+ toolTipText: "tutti.createSpeciesBatch.field.batchCount.tip";
+ labelFor: {batchCountField};
+ _help: {"tutti.createSpeciesBatch.field.batchCount.help"};
+}
+
+#batchCountField {
+ property: batchCount;
+ model: {model.getBatchCount()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+ bean: {model};
+}
+
#addSpeciesButton {
text: "tutti.createSpeciesBatch.action.addSpecies";
toolTipText: "tutti.createSpeciesBatch.action.addSpecies.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 12:38:56 UTC (rev 1187)
@@ -99,6 +99,16 @@
</cell>
</row>
+ <!-- Species batch count -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='batchCountLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <NumberEditor id='batchCountField' constructorParams='this'/>
+ </cell>
+ </row>
+
<!-- Sample Category -->
<row>
<cell anchor='west'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -218,6 +218,7 @@
model.setSpecies(null);
model.setSampleCategory(null);
model.setBatchWeight(null);
+ model.setBatchCount(null);
List<Species> speciesToUse = Lists.newArrayList();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIModel.java 2013-09-18 12:38:56 UTC (rev 1187)
@@ -54,6 +54,8 @@
public static final String PROPERTY_BATCH_WEIGHT = "batchWeight";
+ public static final String PROPERTY_BATCH_COUNT = "batchCount";
+
/**
* All available species (sets by protocol).
*
@@ -76,13 +78,20 @@
protected CaracteristicQualitativeValue sampleCategory;
/**
- * Incoming batch weight to split.
+ * Batch weight.
*
* @since 0.3
*/
protected Float batchWeight;
/**
+ * Batch count.
+ *
+ * @since 0.3
+ */
+ protected Integer batchCount;
+
+ /**
* Already used species by sample category.
*
* @since 0.3
@@ -140,6 +149,16 @@
firePropertyChange(PROPERTY_BATCH_WEIGHT, oldValue, batchWeight);
}
+ public Integer getBatchCount() {
+ return batchCount;
+ }
+
+ public void setBatchCount(Integer batchCount) {
+ Object oldValue = getBatchCount();
+ this.batchCount = batchCount;
+ firePropertyChange(PROPERTY_BATCH_COUNT, oldValue, batchCount);
+ }
+
public Multimap<CaracteristicQualitativeValue, Species> getSpeciesUsed() {
return speciesUsed;
}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 12:38:56 UTC (rev 1187)
@@ -177,6 +177,8 @@
tutti.createBenthosBatch.action.saveAndContinue=
tutti.createBenthosBatch.action.saveAndContinue.mnemonic=
tutti.createBenthosBatch.action.saveAndContinue.tip=
+tutti.createBenthosBatch.field.batchCount=
+tutti.createBenthosBatch.field.batchCount.tip=
tutti.createBenthosBatch.field.batchWeight=
tutti.createBenthosBatch.field.batchWeight.tip=
tutti.createBenthosBatch.field.sampleCategory=
@@ -232,8 +234,11 @@
tutti.createSpeciesBatch.action.saveAndClose=
tutti.createSpeciesBatch.action.saveAndClose.mnemonic=
tutti.createSpeciesBatch.action.saveAndClose.tip=
+tutti.createSpeciesBatch.action.saveAndContinue=
tutti.createSpeciesBatch.action.saveAndContinue.mnemonic=
tutti.createSpeciesBatch.action.saveAndContinue.tip=
+tutti.createSpeciesBatch.field.batchCount=
+tutti.createSpeciesBatch.field.batchCount.tip=
tutti.createSpeciesBatch.field.batchWeight=
tutti.createSpeciesBatch.field.batchWeight.tip=
tutti.createSpeciesBatch.field.sampleCategory=
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 12:11:34 UTC (rev 1186)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 12:38:56 UTC (rev 1187)
@@ -164,6 +164,8 @@
tutti.createBenthosBatch.action.saveAndContinue=Créer
tutti.createBenthosBatch.action.saveAndContinue.mnemonic=C
tutti.createBenthosBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce
+tutti.createBenthosBatch.field.batchCount=Nombre
+tutti.createBenthosBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot
tutti.createBenthosBatch.field.batchWeight=Poids du lot (kg)
tutti.createBenthosBatch.field.batchWeight.tip=Poids du lot (kg)
tutti.createBenthosBatch.field.sampleCategory=V / HV
@@ -219,6 +221,8 @@
tutti.createSpeciesBatch.action.saveAndContinue=Créer
tutti.createSpeciesBatch.action.saveAndContinue.mnemonic=C
tutti.createSpeciesBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce
+tutti.createSpeciesBatch.field.batchCount=Nombre
+tutti.createSpeciesBatch.field.batchCount.tip=Saisir le nombre d'individus dans le lot
tutti.createSpeciesBatch.field.batchWeight=Poids du lot (kg)
tutti.createSpeciesBatch.field.batchWeight.tip=Poids du lot (non obligatoire à ce stade)
tutti.createSpeciesBatch.field.sampleCategory=V / HV
1
0
r1186 - in trunk/tutti-ui-swing/src/main: filtered-resources java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create resources/i18n
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 14:11:34 +0200 (Wed, 18 Sep 2013)
New Revision: 1186
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1186
Log:
fixes #3270: [ESPECES] pouvoir saisir plusieurs lots p?\195?\168res sans refermer le formulaire
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-18 12:11:34 UTC (rev 1186)
@@ -1,28 +1,5 @@
-###
-# #%L
-# Tutti :: UI
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2012 - 2013 Ifremer
-# %%
-# This program is free software: you can redistribute it and/or modify
-# 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>.
-# #L%
-###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Aug 23 16:40:22 CEST 2013
+#Wed Sep 18 13:39:38 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -35,9 +12,11 @@
tutti.createAccidentalBatch.help=editFishingOperation.html\#captureCapturesAccidentelles
tutti.createBenthosBatch.action.addSpecies.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.cancel.help=editFishingOperation.html\#captureBenthosActions
-tutti.createBenthosBatch.action.save.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.action.save.help=
+tutti.createBenthosBatch.action.saveAndClose.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.action.saveAndContinue.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
-tutti.createBenthosBatch.field.sampleCategory.help=
+tutti.createBenthosBatch.field.sampleCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.species.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.help=editFishingOperation.html\#captureBenthos
@@ -57,9 +36,11 @@
tutti.createMarineLitterBatch.help=editFishingOperation.html\#captureMacroDechets
tutti.createSpeciesBatch.action.addSpecies.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.cancel.help=editFishingOperation.html\#captureEspecesCreeLotActions
-tutti.createSpeciesBatch.action.save.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.action.save.help=
+tutti.createSpeciesBatch.action.saveAndClose.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
-tutti.createSpeciesBatch.field.sampleCategory.help=
+tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.species.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.help=editFishingOperation.html\#captureEspecesCreeLot
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-18 12:11:34 UTC (rev 1186)
@@ -1,28 +1,5 @@
-###
-# #%L
-# Tutti :: UI
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2012 - 2013 Ifremer
-# %%
-# This program is free software: you can redistribute it and/or modify
-# 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>.
-# #L%
-###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Aug 23 16:40:22 CEST 2013
+#Wed Sep 18 13:39:38 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.save.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -36,6 +13,8 @@
tutti.createBenthosBatch.action.addSpecies.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.cancel.help=editFishingOperation.html\#captureBenthosActions
tutti.createBenthosBatch.action.save.help=editFishingOperation.html\#captureBenthosActions
+tutti.createBenthosBatch.action.saveAndClose.help=
+tutti.createBenthosBatch.action.saveAndContinue.help=
tutti.createBenthosBatch.field.batchWeight.help=editFishingOperation.html\#captureBenthosFields
tutti.createBenthosBatch.field.sampleCategory.help=
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureBenthosFields
@@ -57,9 +36,11 @@
tutti.createMarineLitterBatch.help=editFishingOperation.html\#captureMacroDechets
tutti.createSpeciesBatch.action.addSpecies.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.action.cancel.help=editFishingOperation.html\#captureEspecesCreeLotActions
-tutti.createSpeciesBatch.action.save.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.action.save.help=
+tutti.createSpeciesBatch.action.saveAndClose.help=editFishingOperation.html\#captureEspecesCreeLotActions
+tutti.createSpeciesBatch.action.saveAndContinue.help=editFishingOperation.html\#captureEspecesCreeLotActions
tutti.createSpeciesBatch.field.batchWeight.help=editFishingOperation.html\#captureEspecesCreeLotFields
-tutti.createSpeciesBatch.field.sampleCategory.help=
+tutti.createSpeciesBatch.field.sampleCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.sortedUnsortedCategory.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.field.species.help=editFishingOperation.html\#captureEspecesCreeLotFields
tutti.createSpeciesBatch.help=editFishingOperation.html\#captureEspecesCreeLot
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.css 2013-09-18 12:11:34 UTC (rev 1186)
@@ -86,15 +86,24 @@
_help: {"tutti.createBenthosBatch.action.addSpecies.help"};
}
-#saveButton {
+#saveAndContinueButton {
actionIcon: save;
- text: "tutti.createBenthosBatch.action.save";
- toolTipText: "tutti.createBenthosBatch.action.save.tip";
- i18nMnemonic: "tutti.createBenthosBatch.action.save.mnemonic";
+ text: "tutti.createBenthosBatch.action.saveAndContinue";
+ toolTipText: "tutti.createBenthosBatch.action.saveAndContinue.tip";
+ i18nMnemonic: "tutti.createBenthosBatch.action.saveAndContinue.mnemonic";
enabled: {model.isValid()};
- _help: {"tutti.createBenthosBatch.action.save.help"};
+ _help: {"tutti.createBenthosBatch.action.saveAndContinue.help"};
}
+#saveAndCloseButton {
+ actionIcon: save;
+ text: "tutti.createBenthosBatch.action.saveAndClose";
+ toolTipText: "tutti.createBenthosBatch.action.saveAndClose.tip";
+ i18nMnemonic: "tutti.createBenthosBatch.action.saveAndClose.mnemonic";
+ enabled: {model.isValid()};
+ _help: {"tutti.createBenthosBatch.action.saveAndClose.help"};
+}
+
#cancelButton {
actionIcon: cancel;
text: "tutti.createBenthosBatch.action.cancel";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUI.jaxx 2013-09-18 12:11:34 UTC (rev 1186)
@@ -116,6 +116,7 @@
<!-- Form Actions -->
<JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ <JButton id='saveAndContinueButton' onActionPerformed='handler.saveAndContinue()'/>
+ <JButton id='saveAndCloseButton' onActionPerformed='handler.saveAndClose()'/>
</JPanel>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
@@ -36,6 +36,7 @@
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
@@ -239,10 +240,10 @@
model.setAvailableSpecies(speciesToUse);
}
- public void save() {
+ public void saveAndClose() {
if (log.isDebugEnabled()) {
- log.debug("Save UI " + ui);
+ log.debug("Save and close UI " + ui);
}
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
@@ -252,6 +253,20 @@
closeUI(ui);
}
+ public void saveAndContinue() {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Save and continue UI " + ui);
+ }
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ BenthosBatchUI benthosTabContent = parent.getBenthosTabContent();
+ benthosTabContent.getHandler().addBatch(getModel());
+
+ // re-open this screen
+ openUI(benthosTabContent.getModel());
+ }
+
public Species openAddSpeciesDialog(String title, List<Species> species) {
SelectSpeciesUI dialogContent = new SelectSpeciesUI(ui);
SelectSpeciesUIModel model = dialogContent.getModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.css 2013-09-18 12:11:34 UTC (rev 1186)
@@ -86,15 +86,24 @@
_help: {"tutti.createSpeciesBatch.action.addSpecies.help"};
}
-#saveButton {
+#saveAndContinueButton {
actionIcon: save;
- text: "tutti.createSpeciesBatch.action.save";
- toolTipText: "tutti.createSpeciesBatch.action.save.tip";
- i18nMnemonic: "tutti.createSpeciesBatch.action.save.mnemonic";
+ text: "tutti.createSpeciesBatch.action.saveAndContinue";
+ toolTipText: "tutti.createSpeciesBatch.action.saveAndContinue.tip";
+ i18nMnemonic: "tutti.createSpeciesBatch.action.saveAndContinue.mnemonic";
enabled: {model.isValid()};
- _help: {"tutti.createSpeciesBatch.action.save.help"};
+ _help: {"tutti.createSpeciesBatch.action.saveAndContinue.help"};
}
+#saveAndCloseButton {
+ actionIcon: save;
+ text: "tutti.createSpeciesBatch.action.saveAndClose";
+ toolTipText: "tutti.createSpeciesBatch.action.saveAndClose.tip";
+ i18nMnemonic: "tutti.createSpeciesBatch.action.saveAndClose.mnemonic";
+ enabled: {model.isValid()};
+ _help: {"tutti.createSpeciesBatch.action.saveAndClose.help"};
+}
+
#cancelButton {
actionIcon: cancel;
text: "tutti.createSpeciesBatch.action.cancel";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUI.jaxx 2013-09-18 12:11:34 UTC (rev 1186)
@@ -116,6 +116,7 @@
<!-- Form Actions -->
<JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
- <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ <JButton id='saveAndContinueButton' onActionPerformed='handler.saveAndContinue()'/>
+ <JButton id='saveAndCloseButton' onActionPerformed='handler.saveAndClose()'/>
</JPanel>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-18 12:11:34 UTC (rev 1186)
@@ -36,6 +36,7 @@
import fr.ifremer.tutti.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
@@ -238,13 +239,27 @@
model.setAvailableSpecies(speciesToUse);
}
- public void save() {
+ public void saveAndContinue() {
if (log.isDebugEnabled()) {
log.debug("Save UI " + ui);
}
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ SpeciesBatchUI speciesTabContent = parent.getSpeciesTabContent();
+ speciesTabContent.getHandler().addBatch(getModel());
+
+ // re-open this screen
+ openUI(speciesTabContent.getModel());
+ }
+
+ public void saveAndClose() {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Save and Close UI " + ui);
+ }
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
parent.getSpeciesTabContent().getHandler().addBatch(getModel());
// close dialog
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-18 12:11:34 UTC (rev 1186)
@@ -171,6 +171,12 @@
tutti.createBenthosBatch.action.save=
tutti.createBenthosBatch.action.save.mnemonic=
tutti.createBenthosBatch.action.save.tip=
+tutti.createBenthosBatch.action.saveAndClose=
+tutti.createBenthosBatch.action.saveAndClose.mnemonic=
+tutti.createBenthosBatch.action.saveAndClose.tip=
+tutti.createBenthosBatch.action.saveAndContinue=
+tutti.createBenthosBatch.action.saveAndContinue.mnemonic=
+tutti.createBenthosBatch.action.saveAndContinue.tip=
tutti.createBenthosBatch.field.batchWeight=
tutti.createBenthosBatch.field.batchWeight.tip=
tutti.createBenthosBatch.field.sampleCategory=
@@ -223,6 +229,11 @@
tutti.createSpeciesBatch.action.save=
tutti.createSpeciesBatch.action.save.mnemonic=
tutti.createSpeciesBatch.action.save.tip=
+tutti.createSpeciesBatch.action.saveAndClose=
+tutti.createSpeciesBatch.action.saveAndClose.mnemonic=
+tutti.createSpeciesBatch.action.saveAndClose.tip=
+tutti.createSpeciesBatch.action.saveAndContinue.mnemonic=
+tutti.createSpeciesBatch.action.saveAndContinue.tip=
tutti.createSpeciesBatch.field.batchWeight=
tutti.createSpeciesBatch.field.batchWeight.tip=
tutti.createSpeciesBatch.field.sampleCategory=
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 06:10:16 UTC (rev 1185)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 12:11:34 UTC (rev 1186)
@@ -158,9 +158,12 @@
tutti.createBenthosBatch.action.cancel=Annuler
tutti.createBenthosBatch.action.cancel.mnemonic=A
tutti.createBenthosBatch.action.cancel.tip=Annuler la création du lot espèce
-tutti.createBenthosBatch.action.save=Enregistrer
-tutti.createBenthosBatch.action.save.mnemonic=E
-tutti.createBenthosBatch.action.save.tip=Enregistrer la création du lot espèce
+tutti.createBenthosBatch.action.saveAndClose=Créer et fermer
+tutti.createBenthosBatch.action.saveAndClose.mnemonic=F
+tutti.createBenthosBatch.action.saveAndClose.tip=Enregistrer la création du lot espèce et quitter l'écran
+tutti.createBenthosBatch.action.saveAndContinue=Créer
+tutti.createBenthosBatch.action.saveAndContinue.mnemonic=C
+tutti.createBenthosBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce
tutti.createBenthosBatch.field.batchWeight=Poids du lot (kg)
tutti.createBenthosBatch.field.batchWeight.tip=Poids du lot (kg)
tutti.createBenthosBatch.field.sampleCategory=V / HV
@@ -210,9 +213,12 @@
tutti.createSpeciesBatch.action.cancel=Annuler
tutti.createSpeciesBatch.action.cancel.mnemonic=A
tutti.createSpeciesBatch.action.cancel.tip=Annuler la création du lot espèce
-tutti.createSpeciesBatch.action.save=Enregistrer
-tutti.createSpeciesBatch.action.save.mnemonic=E
-tutti.createSpeciesBatch.action.save.tip=Enregistrer la création du lot espèce
+tutti.createSpeciesBatch.action.saveAndClose=Créer et Fermer
+tutti.createSpeciesBatch.action.saveAndClose.mnemonic=F
+tutti.createSpeciesBatch.action.saveAndClose.tip=Enregistrer la création du lot espèce et fermer l'écran
+tutti.createSpeciesBatch.action.saveAndContinue=Créer
+tutti.createSpeciesBatch.action.saveAndContinue.mnemonic=C
+tutti.createSpeciesBatch.action.saveAndContinue.tip=Enregistrer la création du lot espèce
tutti.createSpeciesBatch.field.batchWeight=Poids du lot (kg)
tutti.createSpeciesBatch.field.batchWeight.tip=Poids du lot (non obligatoire à ce stade)
tutti.createSpeciesBatch.field.sampleCategory=V / HV
1
0
r1185 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch tutti-persistence/src/main/resources/i18n tutti-ui-swing/src/main/resources/i18n
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 08:10:16 +0200 (Wed, 18 Sep 2013)
New Revision: 1185
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1185
Log:
fixes #3265: [TRAIT] V?\195?\169rifier que l'ordre de saisie des captures est bien celui de la configuration de cat?\195?\169gorisation
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties
trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-09-18 05:20:33 UTC (rev 1184)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/batch/ScientificCruiseCatchBatchValidator.java 2013-09-18 06:10:16 UTC (rev 1185)
@@ -33,6 +33,7 @@
import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
import fr.ifremer.tutti.persistence.entities.data.BenthosBatch;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
+import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
import fr.ifremer.tutti.persistence.entities.data.SpeciesAbleBatch;
import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService;
@@ -94,12 +95,31 @@
List<CatchBatchValidationError> errors = Lists.newArrayList();
+ Integer[] categoryIds =
+ sampleCategoryModel.getSamplingOrder().toArray(new Integer[sampleCategoryModel.getSamplingOrder().size()]);
+
for (SpeciesBatch speciesBatch : species.getChildren()) {
- validateBatch(sampleCategoryModel,
- errors,
- speciesBatch,
- n_("tutti.persistence.batch.validation.invalid.species.sampleCategoryId"));
+ // check all sample categories are accepted
+ validateSampleCategoriesUniverse(
+ sampleCategoryModel,
+ errors,
+ speciesBatch,
+ n_("tutti.persistence.batch.validation.invalid.species.sampleCategoryId"));
+
+
+ if (errors.isEmpty()) {
+
+ // check sample categories order is ok
+
+ validateSampleCategoriesOrder(
+ sampleCategoryModel,
+ errors,
+ speciesBatch,
+ categoryIds,
+ 0,
+ n_("tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order"));
+ }
}
return errors;
}
@@ -110,12 +130,30 @@
List<CatchBatchValidationError> errors = Lists.newArrayList();
+ Integer[] categoryIds =
+ sampleCategoryModel.getSamplingOrder().toArray(new Integer[sampleCategoryModel.getSamplingOrder().size()]);
+
for (BenthosBatch benthosBatch : benthos.getChildren()) {
- validateBatch(sampleCategoryModel,
- errors,
- benthosBatch,
- n_("tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId"));
+ // check all sample categories are accepted
+ validateSampleCategoriesUniverse(
+ sampleCategoryModel,
+ errors,
+ benthosBatch,
+ n_("tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId"));
+
+ if (errors.isEmpty()) {
+
+ // check sample categories order is ok
+
+ validateSampleCategoriesOrder(
+ sampleCategoryModel,
+ errors,
+ benthosBatch,
+ categoryIds,
+ 0,
+ n_("tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order"));
+ }
}
return errors;
}
@@ -287,16 +325,17 @@
}
}
- protected void validateBatch(SampleCategoryModel sampleCategoryModel,
- List<CatchBatchValidationError> errors,
- SpeciesAbleBatch aBatch,
- String messageKey) {
+ protected void validateSampleCategoriesUniverse(SampleCategoryModel sampleCategoryModel,
+ List<CatchBatchValidationError> errors,
+ SpeciesAbleBatch aBatch,
+ String messageKey) {
Integer sampleCategoryId = aBatch.getSampleCategoryId();
if (!sampleCategoryModel.containsCategoryId(sampleCategoryId)) {
// invalid sample category id
+
addError(errors,
messageKey,
aBatch.getId(),
@@ -308,14 +347,59 @@
for (SpeciesAbleBatch speciesAbleBatch : aBatch.getChildBatchs()) {
- validateBatch(sampleCategoryModel,
- errors,
- speciesAbleBatch,
- messageKey);
+ validateSampleCategoriesUniverse(sampleCategoryModel,
+ errors,
+ speciesAbleBatch,
+ messageKey);
}
}
}
+ protected void validateSampleCategoriesOrder(SampleCategoryModel sampleCategoryModel,
+ List<CatchBatchValidationError> errors,
+ SpeciesAbleBatch aBatch,
+ Integer[] categoryIds,
+ int level,
+ String messageKey) {
+
+ Integer sampleCategoryId = aBatch.getSampleCategoryId();
+
+ Integer exceptedCategoryId = categoryIds[level];
+
+
+ if (!exceptedCategoryId.equals(sampleCategoryId)) {
+
+ // bad sample category id
+
+ SampleCategoryModelEntry actualCategory = sampleCategoryModel.getCategoryById(sampleCategoryId);
+ SampleCategoryModelEntry exceptedCategory = sampleCategoryModel.getCategoryById(exceptedCategoryId);
+
+ addError(errors,
+ messageKey,
+ aBatch.getId(),
+ aBatch.getSpecies().getName(),
+ actualCategory.getLabel(),
+ exceptedCategory.getLabel());
+
+ // no need to continue, we got a bad order
+ return;
+ }
+
+ if (!aBatch.isChildBatchsEmpty()) {
+
+ for (SpeciesAbleBatch speciesAbleBatch : aBatch.getChildBatchs()) {
+
+ validateSampleCategoriesOrder(
+ sampleCategoryModel,
+ errors,
+ speciesAbleBatch,
+ categoryIds,
+ level + 1,
+ messageKey);
+ }
+ }
+ }
+
protected void addError(List<CatchBatchValidationError> errors,
String messageKey) {
CatchBatchValidationError error = new CatchBatchValidationError(
Modified: trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties 2013-09-18 05:20:33 UTC (rev 1184)
+++ trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_en_GB.properties 2013-09-18 06:10:16 UTC (rev 1185)
@@ -27,7 +27,9 @@
tutti.persistence.batch.validation.horsVracNotFound=
tutti.persistence.batch.validation.horsVracSpeciesNotFound=
tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId=
+tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order=
tutti.persistence.batch.validation.invalid.species.sampleCategoryId=
+tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order=
tutti.persistence.batch.validation.unkonwn.taxon=
tutti.persistence.batch.validation.unsortedNotFound=
tutti.persistence.batch.validation.vracBenthosAliveItemizedNotFound=
Modified: trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-18 05:20:33 UTC (rev 1184)
+++ trunk/tutti-persistence/src/main/resources/i18n/tutti-persistence_fr_FR.properties 2013-09-18 06:10:16 UTC (rev 1185)
@@ -26,8 +26,10 @@
tutti.persistence.batch.validation.horsVracMarineLitterNotFound=Lot 'Hors Vrac > Macro-déchet' non trouvé, ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.horsVracNotFound=Lot 'Hors Vrac' non trouvé ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.horsVracSpeciesNotFound=Lot 'Hors Vrac > Espèces' non trouvé ou configuré avec d'autres critères de classement.
-tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId=Le lot benthos %s (espèce %s) utilise une caractéristique (id %s) de catégorisation non reconnue
-tutti.persistence.batch.validation.invalid.species.sampleCategoryId=Le lot espèce %s (espèce %s) utilise une caractéristique (id %s) de catégorisation non reconnue
+tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId=Le lot benthos %s (espèce %s) utilise une catégorie (id %s) non reconnue
+tutti.persistence.batch.validation.invalid.benthos.sampleCategoryId.order=Le lot benthos %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> au lieu de <strong>%s</strong>
+tutti.persistence.batch.validation.invalid.species.sampleCategoryId=Le lot espèce %s (espèce %s) utilise une catégorise (id %s) non reconnue
+tutti.persistence.batch.validation.invalid.species.sampleCategoryId.order=Le lot espèce %s (espèce %s) ne respecte pas l'ordre des catégories, utilisation de la catégorie <strong>%s</strong> au lieu de <strong>%s</strong>
tutti.persistence.batch.validation.unkonwn.taxon=Le lot (%s) utilise une espèce de code inconnu (%s).
tutti.persistence.batch.validation.unsortedNotFound=Lot 'Hors Vrac > Espèces' non trouvé ou configuré avec d'autres critères de classement.
tutti.persistence.batch.validation.vracBenthosAliveItemizedNotFound=Lot 'Vrac > Benthos > Vivant Trié' non trouvé, ou configuré avec d'autres critères de classement.
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 05:20:33 UTC (rev 1184)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-18 06:10:16 UTC (rev 1185)
@@ -989,7 +989,7 @@
tutti.fishingOperations.info.no.fishingOperation.selected=< Aucun trait sélectionné >
tutti.fishingOperations.title.edit.operations=Saisie des opérations de pêches (%s)
tutti.fishingOperations.title.validate.operations=Validation des opérations de pêches (%s)
-tutti.fishingOperations.warn.catchBatch.invalidSampleCategoryModel=L'arbre d’échantillonnage n'est pas compatible (utilisation de catégories non configurées). Les captures ne seront pas visibles.
+tutti.fishingOperations.warn.catchBatch.invalidSampleCategoryModel=L'arbre d’échantillonnage n'est pas compatible (utilisation de catégories non configurées ou dans un mauvais ordre). Les captures ne seront pas visibles.
tutti.fishingOperations.warn.catchBatch.notFound=Pas d'arbre d’échantillonnage associé à l'opération de pêche.
tutti.fishingOperations.warn.invalid.batch.model=L'arbre d’échantillonnage n'est pas compatible. Les captures ne seront pas visibles.
tutti.flash.info.all.caractristic.exported=Toutes les caractéristiques exportées dans le fichier <strong>%s</strong>.
1
0
r1184 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches: . benthos benthos/split species/split
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 07:20:33 +0200 (Wed, 18 Sep 2013)
New Revision: 1184
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1184
Log:
refs #3266: [MENSURATION] Ne pas conserver les id des cat?\195?\169gories dans la barre de rappel
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-09-18 05:20:33 UTC (rev 1184)
@@ -300,19 +300,11 @@
setSpeciesSelectedCard(EditCatchesUIHandler.EDIT_FREQUENCY_CARD);
// update title
- StringBuilder title = new StringBuilder(ui.getSpeciesTabFishingOperationReminderLabel().getTitle());
-
- title.append(" - ").append(decorate(editRow.getSpecies()));
-
- for (SampleCategory<?> sampleCategory : editRow) {
- if (sampleCategory.getCategoryValue() != null) {
- title.append(" - ");
- title.append(decorate(sampleCategory.getCategoryValue()));
- }
- }
-
- title.append(" - ").append(_("tutti.editSpeciesFrequencies.title"));
- ui.getSpeciesTabFrequencyEditorReminderLabel().setTitle(title.toString());
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getSpeciesTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.editSpeciesFrequencies.title"));
+ ui.getSpeciesTabFrequencyEditorReminderLabel().setTitle(title);
}
public void splitSpeciesBatch(SpeciesBatchRowModel editRow,
@@ -324,19 +316,11 @@
setSpeciesSelectedCard(EditCatchesUIHandler.SPLIT_BATCH_CARD);
// update title
- StringBuilder title = new StringBuilder(ui.getSpeciesTabFishingOperationReminderLabel().getTitle());
-
- title.append(" - ").append(decorate(editRow.getSpecies()));
-
- for (SampleCategory<?> sampleCategory : editRow) {
- if (sampleCategory.getCategoryValue() != null) {
- title.append(" - ");
- title.append(decorate(sampleCategory.getCategoryValue()));
- }
- }
-
- title.append(" - ").append(_("tutti.splitSpeciesBatch.title"));
- ui.getSpeciesTabSplitBatchReminderLabel().setTitle(title.toString());
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getSpeciesTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.splitSpeciesBatch.title"));
+ ui.getSpeciesTabSplitBatchReminderLabel().setTitle(title);
}
public void setSpeciesSelectedCard(String card) {
@@ -389,22 +373,14 @@
setBenthosSelectedCard(EditCatchesUIHandler.EDIT_FREQUENCY_CARD);
// update title
- StringBuilder title = new StringBuilder(ui.getBenthosTabFishingOperationReminderLabel().getTitle());
-
- title.append(" - ").append(decorate(editRow.getSpecies()));
-
- for (SampleCategory<?> sampleCategory : editRow) {
- if (sampleCategory.getCategoryValue() != null) {
- title.append(" - ");
- title.append(decorate(sampleCategory.getCategoryValue()));
- }
- }
-
- title.append(" - ").append(_("tutti.editBenthosFrequencies.title"));
- ui.getBenthosTabFrequencyEditorReminderLabel().setTitle(title.toString());
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getBenthosTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.editBenthosFrequencies.title"));
+ ui.getBenthosTabFrequencyEditorReminderLabel().setTitle(title);
}
- public void splitBenthosBAtch(BenthosBatchRowModel editRow,
+ public void splitBenthosBatch(BenthosBatchRowModel editRow,
SplitBenthosBatchUI splitBatchEditor) {
@@ -414,19 +390,11 @@
setBenthosSelectedCard(EditCatchesUIHandler.SPLIT_BATCH_CARD);
// update title
- StringBuilder title = new StringBuilder(ui.getBenthosTabFishingOperationReminderLabel().getTitle());
-
- title.append(" - ").append(decorate(editRow.getSpecies()));
-
- for (SampleCategory<?> sampleCategory : editRow) {
- if (sampleCategory.getCategoryValue() != null) {
- title.append(" - ");
- title.append(decorate(sampleCategory.getCategoryValue()));
- }
- }
-
- title.append(" - ").append(_("tutti.splitBenthosBatch.title"));
- ui.getBenthosTabSplitBatchReminderLabel().setTitle(title.toString());
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getBenthosTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.splitBenthosBatch.title"));
+ ui.getBenthosTabSplitBatchReminderLabel().setTitle(title);
}
public void setBenthosSelectedCard(String card) {
@@ -456,7 +424,7 @@
} else if (EDIT_FREQUENCY_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabFrequencyEditor();
-
+
}
if (tuttiUi != null) {
@@ -585,4 +553,22 @@
}
}
+ protected String buildReminderLabelTitle(Species species,
+ Iterable<SampleCategory<?>> categories,
+ String prefix,
+ String suffix) {
+ StringBuilder title = new StringBuilder(prefix);
+
+ title.append(" - [").append(decorate(species)).append("]");
+
+ for (SampleCategory<?> sampleCategory : categories) {
+ if (sampleCategory.getCategoryValue() != null) {
+ title.append(" - ");
+ title.append(decorate(sampleCategory.getCategoryValue()));
+ }
+ }
+
+ title.append(" - ").append(suffix);
+ return title.toString();
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-18 05:20:33 UTC (rev 1184)
@@ -722,7 +722,7 @@
// splitBatchEditor.getHandler().editBatch(parentBatch);
// parent.getHandler().setBenthosSelectedCard(EditCatchesUIHandler.SPLIT_BATCH_CARD);
- parent.getHandler().splitBenthosBAtch(parentBatch, splitBatchEditor);
+ parent.getHandler().splitBenthosBatch(parentBatch, splitBatchEditor);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.css 2013-09-18 05:20:33 UTC (rev 1184)
@@ -41,19 +41,6 @@
selectedItem: {model.getSelectedCategory()};
}
-#speciesLabel {
- text: "tutti.splitBenthosBatch.field.species";
- toolTipText: "tutti.splitBenthosBatch.field.speciesField.tip";
- labelFor: {speciesField};
- _help: {"tutti.splitBenthosBatch.field.speciesField.help"};
-}
-
-#speciesField {
- editable: false;
- enabled: false;
- text: {handler.decorateSpecies(model.getSpecies())};
-}
-
#batchWeightLabel {
text: "tutti.splitBenthosBatch.field.batchWeight";
toolTipText: "tutti.splitBenthosBatch.field.batchWeightField.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.jaxx 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUI.jaxx 2013-09-18 05:20:33 UTC (rev 1184)
@@ -88,16 +88,6 @@
</cell>
</row>
- <!-- Incoming Batch Species -->
- <row>
- <cell anchor='west'>
- <JLabel id='speciesLabel'/>
- </cell>
- <cell weightx='1.0'>
- <JTextField id='speciesField'/>
- </cell>
- </row>
-
<!-- Incoming Batch Total weight -->
<row>
<cell anchor='west'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-18 05:20:33 UTC (rev 1184)
@@ -245,11 +245,6 @@
//-- Public methods --//
//------------------------------------------------------------------------//
- public String decorateSpecies(Species object) {
- String result = object == null ? "" : super.decorate(object);
- return result;
- }
-
public void editBatch(BenthosBatchRowModel batch) {
// get possible the last used
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-18 05:20:33 UTC (rev 1184)
@@ -26,7 +26,6 @@
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
@@ -45,8 +44,6 @@
public static final String PROPERTY_CATEGORY = "category";
- public static final String PROPERTY_SPECIES = "species";
-
public static final String PROPERTY_SELECTED_CATEGORY = "selectedCategory";
public static final String PROPERTY_BATCH_WEIGHT = "batchWeight";
@@ -93,17 +90,12 @@
}
public void setBatch(BenthosBatchRowModel batch) {
- Object oldSpecies = getSpecies();
+ Object oldWeight = getBatchWeight();
this.batch = batch;
- firePropertyChange(PROPERTY_SPECIES, oldSpecies, getSpecies());
- firePropertyChange(PROPERTY_BATCH_WEIGHT, null, getBatchWeight());
+ firePropertyChange(PROPERTY_BATCH_WEIGHT, oldWeight, getBatchWeight());
}
- public Species getSpecies() {
- return batch == null ? null : batch.getSpecies();
- }
-
public List<SampleCategoryModelEntry> getCategory() {
return category;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.css 2013-09-18 05:20:33 UTC (rev 1184)
@@ -41,19 +41,6 @@
selectedItem: {model.getSelectedCategory()};
}
-#speciesLabel {
- text: "tutti.splitSpeciesBatch.field.species";
- toolTipText: "tutti.splitSpeciesBatch.field.speciesField.tip";
- labelFor: {speciesField};
- _help: {"tutti.splitSpeciesBatch.field.speciesField.help"};
-}
-
-#speciesField {
- editable: false;
- enabled: false;
- text: {handler.decorateSpecies(model.getSpecies())};
-}
-
#batchWeightLabel {
text: "tutti.splitSpeciesBatch.field.batchWeight";
toolTipText: "tutti.splitSpeciesBatch.field.batchWeightField.tip";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUI.jaxx 2013-09-18 05:20:33 UTC (rev 1184)
@@ -88,16 +88,6 @@
</cell>
</row>
- <!-- Incoming Batch Species -->
- <row>
- <cell anchor='west'>
- <JLabel id='speciesLabel'/>
- </cell>
- <cell weightx='1.0'>
- <JTextField id='speciesField'/>
- </cell>
- </row>
-
<!-- Incoming Batch Total weight -->
<row>
<cell anchor='west'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-18 05:02:30 UTC (rev 1183)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-18 05:20:33 UTC (rev 1184)
@@ -45,7 +45,7 @@
public static final String PROPERTY_CATEGORY = "category";
- public static final String PROPERTY_SPECIES = "species";
+// public static final String PROPERTY_SPECIES = "species";
public static final String PROPERTY_SELECTED_CATEGORY = "selectedCategory";
@@ -93,17 +93,17 @@
}
public void setBatch(SpeciesBatchRowModel batch) {
- Object oldSpecies = getSpecies();
+// Object oldSpecies = getSpecies();
Object oldWeight = getBatchWeight();
this.batch = batch;
- firePropertyChange(PROPERTY_SPECIES, oldSpecies, getSpecies());
+// firePropertyChange(PROPERTY_SPECIES, oldSpecies, getSpecies());
firePropertyChange(PROPERTY_BATCH_WEIGHT, oldWeight, getBatchWeight());
}
- public Species getSpecies() {
- return batch == null ? null : batch.getSpecies();
- }
+// public Species getSpecies() {
+// return batch == null ? null : batch.getSpecies();
+// }
public List<SampleCategoryModelEntry> getCategory() {
return category;
1
0
r1183 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service tutti-persistence/src/main/resources tutti-service/src/main/java/fr/ifremer/tutti/service
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 07:02:30 +0200 (Wed, 18 Sep 2013)
New Revision: 1183
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1183
Log:
refs #3266: [MENSURATION] Ne pas conserver les id des cat?\195?\169gories dans la barre de rappel
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-09-18 04:27:31 UTC (rev 1182)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-09-18 05:02:30 UTC (rev 1183)
@@ -878,7 +878,8 @@
CaracteristicQualitativeValue target2 = TuttiBeanFactory.newCaracteristicQualitativeValue();
target2.setId(String.valueOf(source2[0]));
target2.setName(String.valueOf(source2[1]));
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source2[2], target2);
+ target2.setDescription(String.valueOf(source2[2]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source2[3], target2);
values.add(target2);
}
result.setQualitativeValue(Collections.unmodifiableList(values));
Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-09-18 04:27:31 UTC (rev 1182)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml 2013-09-18 05:02:30 UTC (rev 1183)
@@ -549,7 +549,8 @@
<![CDATA[
SELECT
qv.id AS id,
- case when (qv.description is null or qv.name = qv.description) then qv.name else concat(qv.name, ' - ', qv.description) end AS name,
+ qv.name,
+ case when (qv.description is null) then qv.name else qv.description end AS description,
qv.status AS status
FROM
PmfmImpl p JOIN p.qualitativeValues qv
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-09-18 04:27:31 UTC (rev 1182)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-09-18 05:02:30 UTC (rev 1183)
@@ -33,7 +33,6 @@
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
-import fr.ifremer.tutti.persistence.entities.referential.CaracteristicBean;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Person;
@@ -106,7 +105,8 @@
registerTuttiDecorator(Caracteristic.class, "${parameterName}$s#${matrixName}$s#${fractionName}$s#${methodName}$s", SEPARATOR, " - ");
registerTuttiDecorator(Caracteristic.class, CARACTERISTIC_PARAMETER_ONLY, "${parameterName}$s", SEPARATOR, " - ");
// registerMultiJXPathDecorator(Caracteristic.class, CARACTERISTIC_WITH_UNIT, "${parameterName}$s#${matrixName}$s#${fractionName}$s#${methodName}$s (${unit}$s)", SEPARATOR, " - ");
- registerTuttiDecorator(CaracteristicQualitativeValue.class, "${name}$s", SEPARATOR, " - ");
+// registerTuttiDecorator(CaracteristicQualitativeValue.class, "${name}$s", SEPARATOR, " - ");
+ registerTuttiDecorator(CaracteristicQualitativeValue.class, "${description}$s", SEPARATOR, " - ");
registerTuttiDecorator(SpeciesProtocol.class, "${speciesReferenceTaxonId}", SEPARATOR, " - ");
registerTuttiDecorator(Attachment.class, "${name}$s", SEPARATOR, " - ");
registerTuttiDecorator(LabelAware.class, "${label}$s", SEPARATOR, " - ");
1
0
Author: tchemit
Date: 2013-09-18 06:27:31 +0200 (Wed, 18 Sep 2013)
New Revision: 1182
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1182
Log:
fixes #3269: Updates mavenpom to 4.1
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-09-18 04:26:49 UTC (rev 1181)
+++ trunk/pom.xml 2013-09-18 04:27:31 UTC (rev 1182)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.0</version>
+ <version>4.1</version>
</parent>
<groupId>fr.ifremer</groupId>
1
0
r1181 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action
by tchemit@users.forge.codelutin.com 18 Sep '13
by tchemit@users.forge.codelutin.com 18 Sep '13
18 Sep '13
Author: tchemit
Date: 2013-09-18 06:26:49 +0200 (Wed, 18 Sep 2013)
New Revision: 1181
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1181
Log:
fixes #3263: [ERGO] Barre de progression trop longue
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-09-17 21:31:34 UTC (rev 1180)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-09-18 04:26:49 UTC (rev 1181)
@@ -259,13 +259,15 @@
}
protected void setSize(MainUI mainUI) {
- Container component = mainUI.getBody();
- int width = component == null ? 0 : component.getWidth();
+ // Better to let his own size to the action progress bar
+ // see http://forge.codelutin.com/issues/3263
+// Container component = mainUI.getBody();
+// int width = component == null ? 0 : component.getWidth();
ui.pack();
- if (width != 0 && ui.getWidth() < width) {
- ui.setSize(width, ui.getHeight());
- }
+// if (width != 0 && ui.getWidth() < width) {
+// ui.setSize(width, ui.getHeight());
+// }
}
}
1
0
r1180 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol
by tchemit@users.forge.codelutin.com 17 Sep '13
by tchemit@users.forge.codelutin.com 17 Sep '13
17 Sep '13
Author: tchemit
Date: 2013-09-17 23:31:34 +0200 (Tue, 17 Sep 2013)
New Revision: 1180
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1180
Log:
fixes #2881: suite Evolution #2460, oui on peut suprimer une esp?\195?\168ce dans le protocole via clic droit mais la ligne se d?\195?\169s?\195?\169lectionne donc on ne sais pas ce que l'on va supprimer
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-17 21:21:22 UTC (rev 1179)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-17 21:31:34 UTC (rev 1180)
@@ -90,7 +90,7 @@
#speciesTable {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- selectionBackground: {null};
+ /*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
_help: {"tutti.editProtocol.field.species.help"};
@@ -108,7 +108,7 @@
#benthosTable {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
- selectionBackground: {null};
+ /*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
_help: {"tutti.editProtocol.field.benthos.help"};
1
0