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
11 Apr '13
Author: kmorin
Date: 2013-04-11 18:29:57 +0200 (Thu, 11 Apr 2013)
New Revision: 770
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/770
Log:
refs #2272 [MACRODECHET] - l'?\195?\169l?\195?\169vation des poids ne marche pas
Added:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Added: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
11 Apr '13
Author: kmorin
Date: 2013-04-11 18:29:22 +0200 (Thu, 11 Apr 2013)
New Revision: 769
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/769
Log:
refs #2272 [MACRODECHET] - l'?\195?\169l?\195?\169vation des poids ne marche pas
Removed:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Deleted: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
11 Apr '13
Author: kmorin
Date: 2013-04-11 18:26:59 +0200 (Thu, 11 Apr 2013)
New Revision: 768
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/768
Log:
refs #2272 [MACRODECHET] - l'?\195?\169l?\195?\169vation des poids ne marche pas
Modified:
trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-04-11 16:20:35 UTC (rev 767)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-04-11 16:26:59 UTC (rev 768)
@@ -49,6 +49,7 @@
tutti.propety.vessel.nation.registrationCode=
tutti.service.catches.computeWeights.error.incoherentBenthosTotalSorted=
tutti.service.catches.computeWeights.error.incoherentCategoryWeight=
+tutti.service.catches.computeWeights.error.incoherentMarineLitterTotal=
tutti.service.catches.computeWeights.error.incoherentParentCategoryWeight=
tutti.service.catches.computeWeights.error.incoherentRowWeightCategory=
tutti.service.catches.computeWeights.error.incoherentRowWeightFrequency=
1
0
r767 - in trunk: tutti-persistence/src/main/xmi tutti-service/src/main/java/fr/ifremer/tutti/service tutti-service/src/main/java/fr/ifremer/tutti/service/catches tutti-service/src/main/resources/i18n tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter
by kmorin@users.forge.codelutin.com 11 Apr '13
by kmorin@users.forge.codelutin.com 11 Apr '13
11 Apr '13
Author: kmorin
Date: 2013-04-11 18:20:35 +0200 (Thu, 11 Apr 2013)
New Revision: 767
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/767
Log:
refs #2272 [MACRODECHET] - l'?\195?\169l?\195?\169vation des poids ne marche pas
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/ValidationService.java 2013-04-11 16:20:35 UTC (rev 767)
@@ -24,10 +24,7 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.data.Cruise;
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
-import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.*;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
import org.nuiton.validator.NuitonValidator;
import org.nuiton.validator.NuitonValidatorFactory;
@@ -70,4 +67,10 @@
NuitonValidatorResult result = validator.validate(speciesBatch);
return result;
}
+
+ public NuitonValidatorResult validateMarineLitterBatch(MarineLitterBatch marineLitterBatch) {
+ NuitonValidator<MarineLitterBatch> validator = NuitonValidatorFactory.newValidator(MarineLitterBatch.class);
+ NuitonValidatorResult result = validator.validate(marineLitterBatch);
+ return result;
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/TuttiWeightComputingService.java 2013-04-11 16:20:35 UTC (rev 767)
@@ -63,7 +63,8 @@
public void computeCatchBatchWeights(CatchBatch catchBatch,
BatchContainer<SpeciesBatch> rootSpeciesBatch,
- BatchContainer<SpeciesBatch> rootBenthosBatch) {
+ BatchContainer<SpeciesBatch> rootBenthosBatch,
+ BatchContainer<MarineLitterBatch> rootMarineLitterBatch) {
// Species
Float speciesTotalComputedSortedWeight = 0f;
@@ -173,6 +174,29 @@
Float benthosTotalWeight = benthosTotalComputedUnsortedWeight + benthosTotalSortedWeight;
catchBatch.setBenthosTotalComputedWeight(benthosTotalWeight);
+ // Marine litter
+ Float marineLitterTotalComputedWeight = 0f;
+
+ for (int i = 0; i < rootMarineLitterBatch.getChildren().size(); i++) {
+ MarineLitterBatch row = rootMarineLitterBatch.getChildren().get(i);
+ Float rowWeight = row.getWeight();
+ if (rowWeight == null) {
+ marineLitterTotalComputedWeight = null;
+ break;
+ }
+ marineLitterTotalComputedWeight += rowWeight;
+ }
+ catchBatch.setMarineLitterTotalComputedWeight(marineLitterTotalComputedWeight);
+
+ Float marineLitterTotalWeight = catchBatch.getMarineLitterTotalWeight();
+ if (marineLitterTotalWeight == null) {
+ marineLitterTotalWeight = marineLitterTotalComputedWeight;
+
+ } else if (marineLitterTotalComputedWeight != null && marineLitterTotalWeight < marineLitterTotalComputedWeight) {
+ throw new TuttiBusinessException(_("tutti.service.catches.computeWeights.error.incoherentMarineLitterTotal"));
+ }
+ //TODO kmorin 20130411 add marine litter batch to the right category (or directly to the total weight)
+
// Catch
Float totalUnsortedWeight = catchBatch.getSpeciesTotalUnsortedComputedWeight() +
catchBatch.getBenthosTotalUnsortedComputedWeight();
@@ -242,6 +266,15 @@
return rootBenthosBatch;
}
+ public BatchContainer<MarineLitterBatch> getComputedMarineLitterBatches(FishingOperation operation) {
+
+ BatchContainer<MarineLitterBatch> rootMarineLitterBatch =
+ persistenceService.getRootMarineLitterBatch(operation.getId());
+
+
+ return rootMarineLitterBatch;
+ }
+
protected Float computeSpeciesBatch(SpeciesBatch batch) {
Float result = null;
Float categoryWeight = batch.getSampleCategoryWeight();
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-04-11 16:20:35 UTC (rev 767)
@@ -45,6 +45,7 @@
tutti.propety.vessel.nation.registrationCode=%s (nat.)
tutti.service.catches.computeWeights.error.incoherentBenthosTotalSorted=
tutti.service.catches.computeWeights.error.incoherentCategoryWeight=Le poids total des mensurations est supérieur au poids de la catégorie
+tutti.service.catches.computeWeights.error.incoherentMarineLitterTotal=Le poids total des macro-déchets est inférieur à la somme des poids des macro-déchets saisis
tutti.service.catches.computeWeights.error.incoherentParentCategoryWeight=Le poids de la catégorie est différent de la somme des poids de ses sous-catégories
tutti.service.catches.computeWeights.error.incoherentRowWeightCategory=Le poids de la catégorie ne peut pas être nul si le poids de sous-échantillonage est renseigné
tutti.service.catches.computeWeights.error.incoherentRowWeightFrequency=Le poids total des mensurations est différent du poids du sous-échantillon
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-04-11 16:20:35 UTC (rev 767)
@@ -27,13 +27,11 @@
import com.google.common.collect.Lists;
import fr.ifremer.tutti.TuttiBusinessException;
-import fr.ifremer.tutti.persistence.entities.data.BatchContainer;
-import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
-import fr.ifremer.tutti.persistence.entities.data.SortedUnsortedEnum;
-import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch;
+import fr.ifremer.tutti.persistence.entities.data.*;
import fr.ifremer.tutti.service.catches.TuttiWeightComputingService;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.frequency.BenthosFrequencyRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
@@ -70,6 +68,10 @@
tuttiWeightComputingService.getComputedBenthosBatches(model.getFishingOperation());
Float totalBenthosSortedWeight = computeBenthosBatches(computedBenthosBatches);
+ BatchContainer<MarineLitterBatch> computedMarineLitterBatches =
+ tuttiWeightComputingService.getComputedMarineLitterBatches(model.getFishingOperation());
+ Float totalMarineLitterWeight = computeMarineLitterBatches(computedMarineLitterBatches);
+
Float rate = getConfig().getDifferenceRateBetweenSortedAndTotalWeights();
if (model.getSpeciesTotalSortedWeight() != null
&& model.getSpeciesTotalSortedWeight() >= totalSpeciesSortedWeight
@@ -126,7 +128,8 @@
CatchBatch catchBatch = model.toBean();
tuttiWeightComputingService.computeCatchBatchWeights(catchBatch,
computedSpeciesBatches,
- computedBenthosBatches);
+ computedBenthosBatches,
+ computedMarineLitterBatches);
model.setCatchBatch(catchBatch);
model.fromBean(catchBatch);
model.setModify(modified);
@@ -156,6 +159,7 @@
weight = row.getSortedUnsortedCategoryComputedWeight();
}
if (weight == null) {
+ getUI().getTabPane().setSelectedIndex(1);
AbstractSelectTableAction.doSelectCell(getUI().getSpeciesTabContent().getTable(), rowIndex, 1);
throw new TuttiBusinessException(_("tutti.editCatchBatch.action.computeWeights.error.noWeight"));
@@ -186,6 +190,7 @@
weight = row.getSortedUnsortedCategoryComputedWeight();
}
if (weight == null) {
+ getUI().getTabPane().setSelectedIndex(2);
AbstractSelectTableAction.doSelectCell(getUI().getBenthosTabContent().getTable(), rowIndex, 1);
throw new TuttiBusinessException(_("tutti.editCatchBatch.action.computeWeights.error.noWeight"));
@@ -202,4 +207,28 @@
return totalSortedWeight;
}
+
+ protected Float computeMarineLitterBatches(BatchContainer<MarineLitterBatch> computedMarineLitterBatches) {
+ Float totalWeight = 0f;
+
+ List<MarineLitterBatchRowModel> rows = Lists.newArrayList();
+ List<MarineLitterBatch> children = computedMarineLitterBatches.getChildren();
+ for (int i = 0 ; i < children.size() ; i++) {
+ MarineLitterBatch batch = children.get(i);
+ Float weight = batch.getWeight();
+ if (weight == null) {
+ if (getModel().getMarineLitterTotalWeight() != null) {
+ return null;
+ }
+ getUI().getTabPane().setSelectedIndex(3);
+ AbstractSelectTableAction.doSelectCell(getUI().getMarineLitterTabContent().getTable(), i, 1);
+ throw new TuttiBusinessException(_("tutti.editCatchBatch.action.computeWeights.error.noWeight"));
+
+ } else {
+ totalWeight += weight;
+ }
+ }
+
+ return totalWeight;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-04-11 16:20:35 UTC (rev 767)
@@ -296,10 +296,8 @@
}
#marineLitterTotalWeightField {
- property: marineLitterTotalWeight;
+ bean: {model.getMarineLitterTotalComputedOrNotWeight()};
model: {model.getMarineLitterTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
}
#planktonTab {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-11 16:20:35 UTC (rev 767)
@@ -296,8 +296,9 @@
<JLabel id='marineLitterTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='marineLitterTotalWeightField'
- constructorParams='this'/>
+ <TuttiComputedOrNotDataEditor
+ id='marineLitterTotalWeightField'
+ constructorParams='this'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-11 16:20:35 UTC (rev 767)
@@ -88,7 +88,7 @@
protected Float planktonTotalSampleWeight;
- protected Float marineLitterTotalWeight;
+ protected TuttiComputedOrNotData<Float> marineLitterTotalComputedOrNotWeight = new TuttiComputedOrNotData<Float>();;
protected TuttiComputedOrNotData<Float> catchTotalComputedOrNotWeight
= new TuttiComputedOrNotData<Float>();
@@ -142,6 +142,9 @@
benthosTotalLivingNotItemizedComputedOrNotWeight.addPropagateListener(
PROPERTY_BENTHOS_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT, this);
+ marineLitterTotalComputedOrNotWeight.addPropagateListener(
+ PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, this);
+
catchTotalComputedOrNotWeight.addPropagateListener(
PROPERTY_CATCH_TOTAL_WEIGHT, this);
catchTotalRejectedComputedOrNotWeight.addPropagateListener(
@@ -590,18 +593,34 @@
//-- Marine Litter --//
//------------------------------------------------------------------------//
+ public TuttiComputedOrNotData<Float> getMarineLitterTotalComputedOrNotWeight() {
+ return marineLitterTotalComputedOrNotWeight;
+ }
+
@Override
public Float getMarineLitterTotalWeight() {
- return marineLitterTotalWeight;
+ return marineLitterTotalComputedOrNotWeight.getData();
}
@Override
public void setMarineLitterTotalWeight(Float marineLitterTotalWeight) {
Object oldValue = getMarineLitterTotalWeight();
- this.marineLitterTotalWeight = marineLitterTotalWeight;
+ this.marineLitterTotalComputedOrNotWeight.setData(marineLitterTotalWeight);
firePropertyChange(PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, oldValue, marineLitterTotalWeight);
}
+ @Override
+ public Float getMarineLitterTotalComputedWeight() {
+ return marineLitterTotalComputedOrNotWeight.getComputedData();
+ }
+
+ @Override
+ public void setMarineLitterTotalComputedWeight(Float marineLitterTotalComputedWeight) {
+ Object oldValue = getMarineLitterTotalComputedWeight();
+ this.marineLitterTotalComputedOrNotWeight.setComputedData(marineLitterTotalComputedWeight);
+ firePropertyChange(PROPERTY_MARINE_LITTER_TOTAL_COMPUTED_WEIGHT, oldValue, marineLitterTotalComputedWeight);
+ }
+
//------------------------------------------------------------------------//
//-- Attachment --//
//------------------------------------------------------------------------//
@@ -658,6 +677,7 @@
setBenthosTotalSortedComputedWeight(null);
setBenthosTotalUnsortedComputedWeight(null);
setBenthosTotalComputedWeight(null);
+ setMarineLitterTotalComputedWeight(null);
setCatchTotalRejectedComputedWeight(null);
setCatchTotalSortedComputedWeight(null);
setCatchTotalUnsortedComputedWeight(null);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-04-11 16:20:35 UTC (rev 767)
@@ -22,12 +22,14 @@
* #L%
*/
-NumberEditor {
+TuttiComputedOrNotDataEditor {
autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
- bean: {model};
showReset: true;
- _selectOnFocus: {true};
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
+ decimalNumber: 3;
+ computedDataColor: {handler.getConfig().getColorComputedWeights()};
}
#editMarineLitterBatchTopPanel {
@@ -52,10 +54,8 @@
}
#marineLitterTotalWeightField {
- property: marineLitterTotalWeight;
+ bean: {model.getMarineLitterTotalComputedOrNotWeight()};
model: {model.getMarineLitterTotalWeight()};
- useFloat: false;
- numberPattern: {DECIMAL3_PATTERN};
}
#tablePopup {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-04-11 16:20:35 UTC (rev 767)
@@ -30,9 +30,8 @@
fr.ifremer.tutti.ui.swing.TuttiUIContext
fr.ifremer.tutti.ui.swing.util.TuttiUI
fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment
+ fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataEditor
- jaxx.runtime.swing.editor.NumberEditor
-
org.jdesktop.swingx.JXTable
javax.swing.ListSelectionModel
@@ -86,7 +85,7 @@
<JLabel id='marineLitterTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='marineLitterTotalWeightField'
+ <TuttiComputedOrNotDataEditor id='marineLitterTotalWeightField'
constructorParams='this'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-04-11 16:20:35 UTC (rev 767)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import fr.ifremer.tutti.ui.swing.util.TabContentModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
import org.apache.commons.collections.CollectionUtils;
@@ -65,6 +66,10 @@
EditCatchesUIModel.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT);
}
+ public TuttiComputedOrNotData<Float> getMarineLitterTotalComputedOrNotWeight() {
+ return catchesUIModel.getMarineLitterTotalComputedOrNotWeight();
+ }
+
public Float getMarineLitterTotalWeight() {
return catchesUIModel.getMarineLitterTotalWeight();
}
@@ -73,6 +78,14 @@
catchesUIModel.setMarineLitterTotalWeight(marineLitterTotalWeight);
}
+ public Float getMarineLitterTotalComputedWeight() {
+ return catchesUIModel.getMarineLitterTotalComputedWeight();
+ }
+
+ public void setMarineLitterTotalComputedWeight(Float marineLitterTotalWeight) {
+ catchesUIModel.setMarineLitterTotalComputedWeight(marineLitterTotalWeight);
+ }
+
public boolean isRemoveBatchEnabled() {
return removeBatchEnabled;
}
1
0
11 Apr '13
Author: kmorin
Date: 2013-04-11 17:00:54 +0200 (Thu, 11 Apr 2013)
New Revision: 766
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/766
Log:
refs #1866 [CAPTURE] - Captures accidentelles
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.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/EditFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
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/accidental/AccidentalBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-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/TuttiPersistence.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistence.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -218,6 +218,8 @@
Caracteristic getHorizontalOpeningDoorCaracteristic();
+ Caracteristic getDeadOrAliveCaracteristic();
+
List<Gear> getAllScientificGear();
List<Gear> getAllFishingGear();
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceImpl.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -330,6 +330,11 @@
}
@Override
+ public Caracteristic getDeadOrAliveCaracteristic() {
+ return referentialService.getDeadOrAliveCaracteristic();
+ }
+
+ @Override
public List<Gear> getAllScientificGear() {
return referentialService.getAllScientificGear();
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceNoDbImpl.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -187,6 +187,11 @@
}
@Override
+ public Caracteristic getDeadOrAliveCaracteristic() {
+ throw new RuntimeException("method not implemented");
+ }
+
+ @Override
public List<Gear> getAllScientificGear() {
throw new RuntimeException("method not implemented");
}
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceService.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -212,6 +212,8 @@
Caracteristic getHorizontalOpeningDoorCaracteristic();
+ Caracteristic getDeadOrAliveCaracteristic();
+
List<Gear> getAllScientificGear();
List<Gear> getAllFishingGear();
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/ReferentialPersistenceServiceImpl.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -569,6 +569,13 @@
}
@Override
+ public Caracteristic getDeadOrAliveCaracteristic() {
+ Integer pmfmId = enumeration.PMFM_ID_DEAD_OR_ALIVE;
+ Caracteristic result = thisService.getCaracteristic(pmfmId);
+ return result;
+ }
+
+ @Override
public Caracteristic getCaracteristic(Integer pmfmId) {
Object[] source = queryUniqueWithStatus("pmfmById",
"pmfmId", IntegerType.INSTANCE, pmfmId,
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiEnumerationFile.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -242,6 +242,9 @@
@Value("${PmfmId.HORIZONTAL_OPENING_DOOR}")
public final Integer PMFM_ID_HORIZONTAL_OPENING_DOOR= null;
+ @Value("${PmfmId.DEAD_OR_ALIVE}")
+ public final Integer PMFM_ID_DEAD_OR_ALIVE= null;
+
//FIXME-TC Remove this when no more used
@Value("${PmfmId.SURVEY_PART}")
public final Integer PMFM_ID_MEASUREMENT_FILE = null;
Modified: trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-persistence/src/main/resources/tutti-db-enumerations.properties 2013-04-11 15:00:54 UTC (rev 766)
@@ -382,6 +382,9 @@
# PSFM "Ouverture horizontale aux panneaux" (pour export operation)
PmfmId.HORIZONTAL_OPENING_DOOR=830
+#PSFM "Remis à l'eau mort ou vivant"
+PmfmId.DEAD_OR_ALIVE=1393
+
# (20=observateur volant, 95=Administrateur SIH) -> L'avantage du 20 est qu'il est inactif (=20), donc plus facilement detectable
PersonId.UNKNOWN_RECORDER_PERSON=20
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -428,6 +428,11 @@
}
@Override
+ public Caracteristic getDeadOrAliveCaracteristic() {
+ return driver.getDeadOrAliveCaracteristic();
+ }
+
+ @Override
public Vessel getVessel(String vesselCode) {
return driver.getVessel(vesselCode);
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/TuttiDataContext.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -32,11 +32,7 @@
import fr.ifremer.tutti.persistence.entities.data.Program;
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.Gear;
-import fr.ifremer.tutti.persistence.entities.referential.Person;
-import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Vessel;
+import fr.ifremer.tutti.persistence.entities.referential.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -119,6 +115,10 @@
protected List<Caracteristic> lengthStepCaracteristics;
+ protected List<CaracteristicQualitativeValue> genderValues;
+
+ protected List<CaracteristicQualitativeValue> deadOrAliveValues;
+
protected List<Person> persons;
protected List<Species> species;
@@ -370,7 +370,7 @@
if (isProtocolFilled()) {
String id = getProtocolId();
if (log.isInfoEnabled()) {
- log.info("Loading cruise: " + id);
+ log.info("Loading protocol: " + id);
}
protocol = service.getProtocol(id);
}
@@ -432,6 +432,28 @@
return lengthStepCaracteristics;
}
+ public List<CaracteristicQualitativeValue> getGenderValues() {
+ checkOpened();
+ if (genderValues == null) {
+ if (log.isInfoEnabled()) {
+ log.info("Loading genderValues");
+ }
+ genderValues = service.getSexCaracteristic().getQualitativeValue();
+ }
+ return genderValues;
+ }
+
+ public List<CaracteristicQualitativeValue> getDeadOrAliveValues() {
+ checkOpened();
+ if (deadOrAliveValues == null) {
+ if (log.isInfoEnabled()) {
+ log.info("Loading deadOrAliveValues");
+ }
+ deadOrAliveValues = service.getDeadOrAliveCaracteristic().getQualitativeValue();
+ }
+ return deadOrAliveValues;
+ }
+
public List<Species> getReferentSpeciesWithSurveyCode() {
checkOpened();
if (referentSpeciesWithSurveyCode == null) {
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,13 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Apr 09 12:35:56 CEST 2013
+#Thu Apr 11 16:29:39 CEST 2013
+tutti.createAccidentalBatch.action.cancel.help=
+tutti.createAccidentalBatch.action.save.help=
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive.help=
+tutti.createAccidentalBatch.field.accidentalGender.help=
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.help=
+tutti.createAccidentalBatch.field.accidentalSize.help=
+tutti.createAccidentalBatch.field.accidentalSpecies.help=
+tutti.createAccidentalBatch.field.accidentalWeight.help=
tutti.createBenthosBatch.action.addSpecies.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.cancel.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.save.help=createBenthosBatch.html\#actions
@@ -7,6 +15,8 @@
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=createBenthosBatch.html\#fields
tutti.createBenthosBatch.field.species.help=createBenthosBatch.html\#fields
tutti.createBenthosBatch.help=createBenthosBatch.html
+tutti.createIndividualObservationBatch.action.cancel.help=
+tutti.createIndividualObservationBatch.action.save.help=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.help=
tutti.createIndividualObservationBatch.field.individualObservationSize.help=
tutti.createIndividualObservationBatch.field.individualObservationSpecies.help=
@@ -33,6 +43,8 @@
tutti.dbManager.action.openDb.help=dbManager.html\#actions
tutti.dbManager.action.upgradeDb.help=dbManager.html\#actions
tutti.dbManager.help=dbManager.html
+tutti.editAccidentalBatch.action.createBatch.help=
+tutti.editAccidentalBatch.action.removeBatch.help=
tutti.editBenthosBatch.action.createBatch.help=editBenthosBatch.html\#fields
tutti.editBenthosBatch.action.removeBatch.help=editBenthosBatch.html\#fields
tutti.editBenthosBatch.action.renameBatch.help=editBenthosBatch.html\#fields
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,13 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Apr 09 12:35:56 CEST 2013
+#Thu Apr 11 16:29:39 CEST 2013
+tutti.createAccidentalBatch.action.cancel.help=
+tutti.createAccidentalBatch.action.save.help=
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive.help=
+tutti.createAccidentalBatch.field.accidentalGender.help=
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.help=
+tutti.createAccidentalBatch.field.accidentalSize.help=
+tutti.createAccidentalBatch.field.accidentalSpecies.help=
+tutti.createAccidentalBatch.field.accidentalWeight.help=
tutti.createBenthosBatch.action.addSpecies.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.cancel.help=createBenthosBatch.html\#actions
tutti.createBenthosBatch.action.save.help=createBenthosBatch.html\#actions
@@ -7,6 +15,8 @@
tutti.createBenthosBatch.field.sortedUnsortedCategory.help=createBenthosBatch.html\#fields
tutti.createBenthosBatch.field.species.help=createBenthosBatch.html\#fields
tutti.createBenthosBatch.help=createBenthosBatch.html
+tutti.createIndividualObservationBatch.action.cancel.help=
+tutti.createIndividualObservationBatch.action.save.help=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.help=
tutti.createIndividualObservationBatch.field.individualObservationSize.help=
tutti.createIndividualObservationBatch.field.individualObservationSpecies.help=
@@ -33,6 +43,8 @@
tutti.dbManager.action.openDb.help=dbManager.html\#actions
tutti.dbManager.action.upgradeDb.help=dbManager.html\#actions
tutti.dbManager.help=dbManager.html
+tutti.editAccidentalBatch.action.createBatch.help=
+tutti.editAccidentalBatch.action.removeBatch.help=
tutti.editBenthosBatch.action.createBatch.help=editBenthosBatch.html\#actions
tutti.editBenthosBatch.action.createMelag.help=editBenthosBatch.html\#actions
tutti.editBenthosBatch.action.removeBatch.help=editBenthosBatch.html\#actions
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -560,9 +560,9 @@
ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getMarineLitterTabFishingOperationReminderLabel().setTitle(fishingOperationText);
+ ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getIndividualObservationTabFishingOperationReminderLabel().setTitle(fishingOperationText);
// ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-// ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText);
if (loadOtherTabs) {
@@ -571,9 +571,9 @@
ui.getSpeciesTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
ui.getBenthosTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
ui.getMarineLitterTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
+ ui.getAccidentalTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
ui.getIndividualObservationTabContent().getHandler().selectFishingOperation(batch == null ? null : bean);
// ui.getPlanktonTabContent().getHandler().selectFishingOperation(bean);
-// ui.getAccidentalTabContent().getHandler().selectFishingOperation(bean);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-04-11 15:00:54 UTC (rev 766)
@@ -72,6 +72,14 @@
rightDecoration: {marineLitterTabContent.getMarineLitterBatchTabToolBar()};
}
+#accidentalTabFishingOperationReminderLabel {
+ rightDecoration: {accidentalTabContent.getAccidentalBatchTabToolBar()};
+}
+
+#individualObservationTabFishingOperationReminderLabel {
+ rightDecoration: {individualObservationTabContent.getIndividualObservationBatchTabToolBar()};
+}
+
#catchTable {
border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.total"))};
}
@@ -298,10 +306,14 @@
enabled: {false};
}
-#accidentalTab {
- enabled: {false};
+#accidentalTabPanel {
+ layout:{accidentalTabPanelLayout};
}
+#accidentalTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.editCatchBatch.legend.accidental"))};
+}
+
#individualObservationTabPanel {
layout:{individualObservationTabPanelLayout};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -29,6 +29,7 @@
fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI
fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.AccidentalBatchUI
+ fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.benthos.BenthosBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.create.CreateMarineLitterBatchUI
@@ -103,6 +104,9 @@
<CardLayout2Ext id='marineLitterTabPanelLayout'
constructorParams='this, "marineLitterTabPanel"'/>
+ <CardLayout2Ext id='accidentalTabPanelLayout'
+ constructorParams='this, "accidentalTabPanel"'/>
+
<CardLayout2Ext id='individualObservationTabPanelLayout'
constructorParams='this, "individualObservationTabPanel"'/>
@@ -374,9 +378,17 @@
</tab>
<tab id='accidentalTab' title='tutti.label.tab.accidentel'>
- <!--JXTitledPanel id='accidentalTabFishingOperationReminderLabel'>
- <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/>
- </JXTitledPanel-->
+ <JPanel id='accidentalTabPanel'>
+ <JXTitledPanel id='accidentalTabFishingOperationReminderLabel'
+ constraints='EditCatchesUIHandler.MAIN_CARD'>
+ <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/>
+ </JXTitledPanel>
+ <JXTitledPanel id='accidentalTabCreateBatchReminderLabel'
+ constraints='EditCatchesUIHandler.CREATE_BATCH_CARD'>
+ <CreateAccidentalBatchUI id='accidentalTabCreateBatch'
+ constructorParams='this'/>
+ </JXTitledPanel>
+ </JPanel>
</tab>
<tab id='individualObservationTab'
title='tutti.label.tab.individualObservation'>
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -140,7 +140,7 @@
closeUI(ui.getBenthosTabContent());
closeUI(ui.getMarineLitterTabContent());
// closeUI(ui.getPlanktonTabContent());
-// closeUI(ui.getAccidentalTabContent());
+ closeUI(ui.getAccidentalTabContent());
}
@Override
@@ -435,4 +435,37 @@
}
}
+ public void setAccidentalSelectedCard(String card) {
+ JPanel panel = ui.getAccidentalTabPanel();
+ CardLayout2Ext layout = (CardLayout2Ext) panel.getLayout();
+ if (!card.equals(layout.getSelected())) {
+ layout.setSelected(card);
+
+ JPanel actionPanel = getUI().getCreateFishingOperationActions();
+ if (MAIN_CARD.equals(card)) {
+ registerValidators();
+ actionPanel.setVisible(true);
+
+ } else {
+ actionPanel.setVisible(false);
+ TuttiUI tuttiUi = null;
+ JXTitledPanel titlePanel = null;
+ String title = "";
+
+ if (CREATE_BATCH_CARD.equals(card)) {
+ tuttiUi = ui.getAccidentalTabCreateBatch();
+ titlePanel = ui.getAccidentalTabCreateBatchReminderLabel();
+ title = n_("tutti.createAccidentalBatch.title");
+ }
+
+ if (tuttiUi != null) {
+ registerValidators(tuttiUi.getHandler().getValidator());
+ }
+ if (titlePanel != null) {
+ titlePanel.setTitle(ui.getAccidentalTabCreateBatchReminderLabel().getTitle() + " - " + _(title));
+ }
+ }
+ }
+ }
+
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchRowModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -25,11 +25,14 @@
*/
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+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.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
@@ -45,7 +48,8 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class AccidentalBatchRowModel extends AbstractTuttiBeanUIModel<AccidentalBatch, AccidentalBatchRowModel> implements AccidentalBatch, AttachmentModelAware {
+public class AccidentalBatchRowModel extends AbstractTuttiBeanUIModel<AccidentalBatch, AccidentalBatchRowModel>
+ implements AttachmentModelAware, AccidentalBatch {
private static final long serialVersionUID = 1L;
@@ -58,27 +62,29 @@
TuttiBeanFactory.newAccidentalBatch();
/**
- * Attachments.
+ * Attachments (should never be null).
*
* @since 0.2
*/
- protected List<Attachment> attachment = Lists.newArrayList();
+ protected final List<Attachment> attachment = Lists.newArrayList();
protected static final Binder<AccidentalBatch, AccidentalBatchRowModel> fromBeanBinder =
BinderFactory.newBinder(AccidentalBatch.class,
- AccidentalBatchRowModel.class);
+ AccidentalBatchRowModel.class);
protected static final Binder<AccidentalBatchRowModel, AccidentalBatch> toBeanBinder =
BinderFactory.newBinder(AccidentalBatchRowModel.class,
- AccidentalBatch.class);
+ AccidentalBatch.class);
public AccidentalBatchRowModel() {
super(AccidentalBatch.class, fromBeanBinder, toBeanBinder);
}
- public AccidentalBatchRowModel(AccidentalBatch aBatch) {
+ public AccidentalBatchRowModel(AccidentalBatch aBatch,
+ List<Attachment> attachments) {
this();
fromBean(aBatch);
+ this.attachment.addAll(attachments);
}
@Override
@@ -87,10 +93,32 @@
}
//------------------------------------------------------------------------//
- //-- AccidentalBatch --//
+ //-- MarineLitterBatch --//
//------------------------------------------------------------------------//
@Override
+ public FishingOperation getFishingOperation() {
+ return editObject.getFishingOperation();
+ }
+
+ @Override
+ public void setFishingOperation(FishingOperation fishingOperation) {
+ editObject.setFishingOperation(fishingOperation);
+ }
+
+ @Override
+ public Float getWeight() {
+ return editObject.getWeight();
+ }
+
+ @Override
+ public void setWeight(Float weight) {
+ Object oldValue = getWeight();
+ editObject.setWeight(weight);
+ firePropertyChange(PROPERTY_WEIGHT, oldValue, weight);
+ }
+
+ @Override
public Species getSpecies() {
return editObject.getSpecies();
}
@@ -103,28 +131,54 @@
}
@Override
- public FishingOperation getFishingOperation() {
- return editObject.getFishingOperation();
+ public Float getSize() {
+ return editObject.getSize();
}
@Override
- public void setFishingOperation(FishingOperation fishingOperation) {
- editObject.setFishingOperation(fishingOperation);
+ public void setSize(Float size) {
+ Object oldValue = getSize();
+ editObject.setSize(size);
+ firePropertyChange(PROPERTY_SIZE, oldValue, size);
}
@Override
- public Float getWeight() {
- return editObject.getWeight();
+ public Caracteristic getLengthStepCaracteristic() {
+ return editObject.getLengthStepCaracteristic();
}
@Override
- public void setWeight(Float weight) {
- Object oldValue = getWeight();
- editObject.setWeight(weight);
- firePropertyChange(PROPERTY_WEIGHT, oldValue, weight);
+ public void setLengthStepCaracteristic(Caracteristic lengthStepCaracteristic) {
+ Object oldValue = getLengthStepCaracteristic();
+ editObject.setLengthStepCaracteristic(lengthStepCaracteristic);
+ firePropertyChange(PROPERTY_LENGTH_STEP_CARACTERISTIC, oldValue, lengthStepCaracteristic);
}
@Override
+ public CaracteristicQualitativeValue getGender() {
+ return editObject.getGender();
+ }
+
+ @Override
+ public void setGender(CaracteristicQualitativeValue gender) {
+ Object oldValue = getLengthStepCaracteristic();
+ editObject.setGender(gender);
+ firePropertyChange(PROPERTY_GENDER, oldValue, gender);
+ }
+
+ @Override
+ public CaracteristicQualitativeValue getDeadOrAlive() {
+ return editObject.getDeadOrAlive();
+ }
+
+ @Override
+ public void setDeadOrAlive(CaracteristicQualitativeValue deadOrAlive) {
+ Object oldValue = getLengthStepCaracteristic();
+ editObject.setDeadOrAlive(deadOrAlive);
+ firePropertyChange(PROPERTY_DEAD_OR_ALIVE, oldValue, deadOrAlive);
+ }
+
+ @Override
public String getComment() {
return editObject.getComment();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchTableModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchTableModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -39,23 +39,38 @@
private static final long serialVersionUID = 1L;
- public static final ColumnIdentifier<AccidentalBatchRowModel> SPECIES_BY_CODE = ColumnIdentifier.newId(
- BenthosBatchRowModel.PROPERTY_SPECIES,
- n_("tutti.editAccidentalBatch.table.header.speciesByCode"),
- n_("tutti.editAccidentalBatch.table.header.speciesByCode.tip"));
+ public static final ColumnIdentifier<BenthosBatchRowModel> SPECIES = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_SPECIES,
+ n_("tutti.editAccidentalBatch.table.header.species"),
+ n_("tutti.editAccidentalBatch.table.header.species.tip"));
- public static final ColumnIdentifier<AccidentalBatchRowModel> SPECIES_BY_GENUS_CODE = ColumnIdentifier.newId(
- BenthosBatchRowModel.PROPERTY_SPECIES,
- n_("tutti.editAccidentalBatch.table.header.speciesByGenusCode"),
- n_("tutti.editAccidentalBatch.table.header.speciesByGenusCode.tip"));
+ public static final ColumnIdentifier<BenthosBatchRowModel> GENDER = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_GENDER,
+ n_("tutti.editAccidentalBatch.table.header.gender"),
+ n_("tutti.editAccidentalBatch.table.header.gender.tip"));
- public static final ColumnIdentifier<AccidentalBatchRowModel> WEIGHT = ColumnIdentifier.newId(
- BenthosBatchRowModel.PROPERTY_WEIGHT,
+ public static final ColumnIdentifier<BenthosBatchRowModel> WEIGHT = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_WEIGHT,
n_("tutti.editAccidentalBatch.table.header.weight"),
n_("tutti.editAccidentalBatch.table.header.weight.tip"));
+ public static final ColumnIdentifier<BenthosBatchRowModel> SIZE = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_SIZE,
+ n_("tutti.editAccidentalBatch.table.header.size"),
+ n_("tutti.editAccidentalBatch.table.header.size.tip"));
+
+ public static final ColumnIdentifier<BenthosBatchRowModel> LENGTH_STEP_CARACTERISTIC = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_LENGTH_STEP_CARACTERISTIC,
+ n_("tutti.editAccidentalBatch.table.header.lengthStepCaracteristic"),
+ n_("tutti.editAccidentalBatch.table.header.lengthStepCaracteristic.tip"));
+
+ public static final ColumnIdentifier<BenthosBatchRowModel> DEAD_OR_ALIVE = ColumnIdentifier.newId(
+ AccidentalBatchRowModel.PROPERTY_DEAD_OR_ALIVE,
+ n_("tutti.editAccidentalBatch.table.header.deadOrAlive"),
+ n_("tutti.editAccidentalBatch.table.header.deadOrAlive.tip"));
+
public static final ColumnIdentifier<AccidentalBatchRowModel> COMMENT = ColumnIdentifier.newId(
- BenthosBatchRowModel.PROPERTY_COMMENT,
+ AccidentalBatchRowModel.PROPERTY_COMMENT,
n_("tutti.editAccidentalBatch.table.header.comment"),
n_("tutti.editAccidentalBatch.table.header.comment.tip"));
@@ -66,7 +81,7 @@
public AccidentalBatchTableModel(TableColumnModelExt columnModel) {
- super(columnModel, true, true);
+ super(columnModel, false, false);
setNoneEditableCols();
}
@@ -79,36 +94,4 @@
result.setValid(false);
return result;
}
-
- @Override
- public void setValueAt(Object aValue,
- int rowIndex,
- int columnIndex,
- ColumnIdentifier<AccidentalBatchRowModel> propertyName,
- AccidentalBatchRowModel entry) {
- super.setValueAt(aValue, rowIndex, columnIndex, propertyName, entry);
-
- if (propertyName == SPECIES_BY_CODE) {
-
- // update also other columns
- fireTableCellUpdated(rowIndex, SPECIES_BY_GENUS_CODE);
-
- } else if (propertyName == SPECIES_BY_GENUS_CODE) {
-
- // update also other columns
- fireTableCellUpdated(rowIndex, SPECIES_BY_CODE);
- }
- }
-
- @Override
- protected boolean isCellEditable(int rowIndex,
- int columnIndex,
- ColumnIdentifier<AccidentalBatchRowModel> propertyName) {
-
- boolean result = super.isCellEditable(rowIndex,
- columnIndex,
- propertyName);
-
- return result;
- }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.css 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.css 2013-04-11 15:00:54 UTC (rev 766)
@@ -33,9 +33,41 @@
_help: {"tuttihelp.editAccidentalBatch.help"};
}
+#accidentalBatchTabToolBar {
+ floatable: false;
+ opaque: false;
+ borderPainted: false;
+}
+
+#accidentalBatchAttachmentsButton {
+ enabled: {model.getObjectId() != null};
+}
+
+#tablePopup {
+ label: "tutti.editAccidentalBatch.title.batchActions";
+}
+
#table {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
selectionBackground: {null};
selectionForeground: {Color.BLACK};
sortable: false;
}
+
+#createAccidentalBatchButton {
+ actionIcon: batch-create;
+ text: "tutti.editAccidentalBatch.action.createBatch";
+ toolTipText: "tutti.editAccidentalBatch.action.createBatch.tip";
+ i18nMnemonic: "tutti.editAccidentalBatch.action.createBatch.mnemonic";
+ _help: {"tutti.editAccidentalBatch.action.createBatch.help"};
+}
+
+#removeAccidentalBatchMenu {
+ actionIcon: batch-delete;
+ text: "tutti.editAccidentalBatch.action.removeBatch";
+ toolTipText: "tutti.editAccidentalBatch.action.removeBatch.tip";
+ i18nMnemonic: "tutti.editAccidentalBatch.action.removeBatch.mnemonic";
+ _tuttiAction: {RemoveAccidentalBatchAction.class};
+ enabled: {model.isRemoveBatchEnabled()};
+ _help: {"tutti.editAccidentalBatch.action.removeBatch.help"};
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -29,6 +29,7 @@
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
fr.ifremer.tutti.ui.swing.TuttiUIContext
fr.ifremer.tutti.ui.swing.util.TuttiUI
+ fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment
jaxx.runtime.swing.editor.NumberEditor
@@ -59,11 +60,42 @@
<AccidentalBatchUIModel id='model'
initializer='getContextValue(AccidentalBatchUIModel.class)'/>
+
+ <BeanValidator id='validator' bean='model'
+ uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
+ </BeanValidator>
+
<TuttiHelpBroker id='broker'
constructorParams='"tuttihelp.editAccidentalBatch.help"'/>
+ <JToolBar id='accidentalBatchTabToolBar'>
+ <ButtonAttachment id='accidentalBatchAttachmentsButton'
+ constructorParams='getHandler().getContext(), getModel()'/>
+ </JToolBar>
+
+ <JPopupMenu id='tablePopup'>
+ <JMenuItem id='removeAccidentalBatchMenu'/>
+ </JPopupMenu>
+
+ <Table id='form' fill='both' constraints='BorderLayout.NORTH'>
+
+ <!-- Toolbar / Filter -->
+ <row>
+ <cell columns="2">
+ <JPanel id='tableToolbar' layout='{new BorderLayout()}'>
+ <JPanel layout='{new GridLayout(1,0)}'
+ constraints='BorderLayout.WEST'>
+ <JButton id='createAccidentalBatchButton'
+ onActionPerformed='handler.createBatch()'/>
+ </JPanel>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+
<JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table'/>
+ <JXTable id='table'
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'/>
</JScrollPane>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -25,27 +25,46 @@
*/
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.PropagatePropertyChangeListener;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
-import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
-import fr.ifremer.tutti.persistence.entities.data.Attachment;
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.data.*;
+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.service.DecoratorService;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
+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.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUI;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create.CreateAccidentalBatchUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchRowModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchTableModel;
+import fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.IndividualObservationBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
+import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellEditor;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentCellRenderer;
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellEditor;
import fr.ifremer.tutti.ui.swing.util.comment.CommentCellRenderer;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
+import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
import javax.swing.*;
+import java.awt.*;
+import java.util.Collection;
import java.util.List;
/**
@@ -62,8 +81,13 @@
AccidentalBatchUI ui) {
super(parentUi, ui,
AccidentalBatchRowModel.PROPERTY_SPECIES,
+ AccidentalBatchRowModel.PROPERTY_GENDER,
AccidentalBatchRowModel.PROPERTY_WEIGHT,
- AccidentalBatchRowModel.PROPERTY_COMMENT);
+ AccidentalBatchRowModel.PROPERTY_SIZE,
+ AccidentalBatchRowModel.PROPERTY_LENGTH_STEP_CARACTERISTIC,
+ AccidentalBatchRowModel.PROPERTY_DEAD_OR_ALIVE,
+ AccidentalBatchRowModel.PROPERTY_COMMENT,
+ AccidentalBatchRowModel.PROPERTY_ATTACHMENT);
}
//------------------------------------------------------------------------//
@@ -89,19 +113,24 @@
}
rows = Lists.newArrayList();
- if (!TuttiEntities.isNew(bean)) {
- List<AccidentalBatch> catches =
- persistenceService.getAllAccidentalBatch(bean.getId());
- for (AccidentalBatch aBatch : catches) {
- AccidentalBatchRowModel entry =
- new AccidentalBatchRowModel(aBatch);
- rows.add(entry);
- }
- }
}
model.setRows(rows);
+ recomputeBatchActionEnable();
}
+ protected AccidentalBatchRowModel loadBatch(AccidentalBatchRowModel aBatch) {
+
+ Integer id = aBatch.getIdAsInt();
+
+ List<Attachment> attachments =
+ persistenceService.getAllAttachments(id);
+
+ AccidentalBatchRowModel newRow =
+ new AccidentalBatchRowModel(aBatch, attachments);
+
+ return newRow;
+ }
+
//------------------------------------------------------------------------//
//-- AbstractTuttiTableUIHandler methods --//
//------------------------------------------------------------------------//
@@ -118,7 +147,7 @@
@Override
protected boolean isRowValid(AccidentalBatchRowModel row) {
- boolean result = row.getSpecies() != null && row.getWeight() != null;
+ boolean result = row.getSpecies() != null;
return result;
}
@@ -130,41 +159,88 @@
Object newValue) {
recomputeRowValidState(row);
saveSelectedRowIfNeeded();
+
+ // when row valid state has changed, recompute action enabled states
+ recomputeBatchActionEnable();
}
@Override
protected void saveSelectedRowIfRequired(TuttiBeanMonitor<AccidentalBatchRowModel> rowMonitor,
AccidentalBatchRowModel row) {
- if (row.isValid()) {
- // there is a valid bean attached to the monitor
+ if (row != null && row.isValid() && rowMonitor.wasModified()) {
- if (rowMonitor.wasModified()) {
+ // monitored bean was modified, save it
+ if (log.isInfoEnabled()) {
+ log.info("Row " + row + " was modified, will save it");
+ }
- // monitored bean was modified, save it
- if (log.isInfoEnabled()) {
- log.info("Row " + row + " was modified, will save it");
- }
+ rowMonitor.setBean(null);
+ saveRow(row);
+ rowMonitor.setBean(row);
- rowMonitor.setBean(null);
- saveRow(row);
- rowMonitor.setBean(row);
+ // clear modified flag on the monitor
+ rowMonitor.clearModified();
+ }
+ }
- // clear modified flag on the monitor
- rowMonitor.clearModified();
- }
- } else {
+ @Override
+ protected void onRowValidStateChanged(int rowIndex,
+ AccidentalBatchRowModel row,
+ Boolean oldValue,
+ Boolean newValue) {
+ super.onRowValidStateChanged(rowIndex, row, oldValue, newValue);
- // row is not valid can not save it
+ // when row valid state has changed, recompute action enabled states
+ recomputeBatchActionEnable();
+ }
- AccidentalBatch catchBean = row.toBean();
+ @Override
+ protected void onAfterSelectedRowChanged(int oldRowIndex,
+ AccidentalBatchRowModel oldRow,
+ int newRowIndex,
+ AccidentalBatchRowModel newRow) {
+ super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, newRow);
- if (!TuttiEntities.isNew(catchBean)) {
+ // when selected row has changed, recompute action enabled states
+ recomputeBatchActionEnable();
+ }
- // remove this
- persistenceService.deleteAccidentalBatch(catchBean.getId());
- }
- }
+ @Override
+ protected void addHighlighters(JXTable table) {
+ super.addHighlighters(table);
+
+ // paint in a special color for comment cell (with not null value)
+ Color cellWithValueColor = getConfig().getColorCellWithValue();
+
+ Highlighter commentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
+ new HighlightPredicate.AndHighlightPredicate(
+ new HighlightPredicate.IdentifierHighlightPredicate(IndividualObservationBatchTableModel.COMMENT),
+ // for not null value
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ String value = (String) adapter.getValue();
+ return StringUtils.isNotBlank(value);
+ }
+ }), cellWithValueColor);
+ table.addHighlighter(commentHighlighter);
+
+ // paint in a special color for attachment cell (when some attachments)
+
+ Highlighter attachmentHighlighter = TuttiUIUtil.newBackgroundColorHighlighter(
+ new HighlightPredicate.AndHighlightPredicate(
+ new HighlightPredicate.IdentifierHighlightPredicate(IndividualObservationBatchTableModel.ATTACHMENT),
+ // for not null value
+ new HighlightPredicate() {
+ @Override
+ public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
+ Collection attachments = (Collection) adapter.getValue();
+ return CollectionUtils.isNotEmpty(attachments);
+ }
+ }
+ ), cellWithValueColor);
+ table.addHighlighter(attachmentHighlighter);
}
//------------------------------------------------------------------------//
@@ -205,31 +281,31 @@
DefaultTableColumnModelExt columnModel =
new DefaultTableColumnModelExt();
- List<Species> allSpecies = getDataContext().getSpecies();
+ Decorator<CaracteristicQualitativeValue> caracteristicQualitativeValueDecorator =
+ getDecorator(CaracteristicQualitativeValue.class, null);
{
- // Species (by code) column
+ // Species column
- Decorator<Species> decorator = getDecorator(
- Species.class, null);
+ Decorator<Species> speciesDecorator = getDecorator(
+ Species.class, DecoratorService.FROM_PROTOCOL);
+ addComboDataColumnToModel(columnModel,
+ AccidentalBatchTableModel.SPECIES,
+ speciesDecorator,
+ getDataContext().getReferentSpecies());
- addComboDataColumnToModel(columnModel,
- AccidentalBatchTableModel.SPECIES_BY_CODE,
- decorator, allSpecies);
}
- {
- // Species (by genusCode) column
+ { // Gender caracteristic column
- Decorator<Species> decorator = getDecorator(
- Species.class, null);
-
addComboDataColumnToModel(columnModel,
- AccidentalBatchTableModel.SPECIES_BY_GENUS_CODE,
- decorator, allSpecies);
+ AccidentalBatchTableModel.GENDER,
+ caracteristicQualitativeValueDecorator,
+ getDataContext().getGenderValues());
}
+
{ // Weight column
addFloatColumnToModel(columnModel,
@@ -237,6 +313,32 @@
TuttiUI.DECIMAL3_PATTERN);
}
+ { // Size column
+
+ addFloatColumnToModel(columnModel,
+ AccidentalBatchTableModel.SIZE,
+ TuttiUI.DECIMAL3_PATTERN);
+ }
+
+ { // Length step caracteristic column
+ Decorator<Caracteristic> caracteristicDecorator =
+ getDecorator(Caracteristic.class, null);
+ addComboDataColumnToModel(columnModel,
+ AccidentalBatchTableModel.LENGTH_STEP_CARACTERISTIC,
+ caracteristicDecorator,
+ getDataContext().getLengthStepCaracteristics());
+
+ }
+
+ { // Dead or alive caracteristic column
+
+ addComboDataColumnToModel(columnModel,
+ AccidentalBatchTableModel.DEAD_OR_ALIVE,
+ caracteristicQualitativeValueDecorator,
+ getDataContext().getDeadOrAliveValues());
+
+ }
+
{ // Comment column
addColumnToModel(columnModel,
@@ -262,6 +364,7 @@
table.setColumnModel(columnModel);
initBatchTable(table, columnModel, tableModel);
+ recomputeBatchActionEnable();
}
@Override
@@ -274,32 +377,78 @@
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
}
+ ui.getAccidentalBatchAttachmentsButton().onCloseUI();
}
//------------------------------------------------------------------------//
//-- Public methods --//
//------------------------------------------------------------------------//
+ public void createBatch() {
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ CreateAccidentalBatchUI createBatchEditor = parent.getAccidentalTabCreateBatch();
+
+ createBatchEditor.getHandler().openUI();
+ parent.getHandler().setAccidentalSelectedCard(EditCatchesUIHandler.CREATE_BATCH_CARD);
+ }
+
+ public void addBatch(CreateAccidentalBatchUIModel model) {
+ if (model.isValid()) {
+
+ AccidentalBatchTableModel tableModel = getTableModel();
+
+ AccidentalBatchRowModel newRow = tableModel.createNewRow();
+ newRow.setSpecies(model.getSpecies());
+ newRow.setWeight(model.getWeight());
+ newRow.setSize(model.getSize());
+ newRow.setLengthStepCaracteristic(model.getLengthStepCaracteristic());
+
+ recomputeRowValidState(newRow);
+
+ saveRow(newRow);
+
+ tableModel.addNewRow(newRow);
+ AbstractSelectTableAction.doSelectCell(getTable(), tableModel.getRowCount() - 1, 0);
+ }
+
+ recomputeBatchActionEnable();
+ }
+
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
- protected void saveRow(AccidentalBatchRowModel row) {
+ protected void recomputeBatchActionEnable() {
- AccidentalBatch catchBean = row.toBean();
+ int rowIndex = getTable().getSelectedRow();
- FishingOperation fishingOperation = getModel().getFishingOperation();
- catchBean.setFishingOperation(fishingOperation);
- if (log.isInfoEnabled()) {
- log.info("Selected fishingOperation: " + fishingOperation.getId());
- }
+ boolean enableRemove = false;
- if (TuttiEntities.isNew(catchBean)) {
+ if (rowIndex != -1) {
- catchBean = persistenceService.createAccidentalBatch(catchBean);
- row.setId(catchBean.getId());
- } else {
- persistenceService.saveAccidentalBatch(catchBean);
+ // there is a selected row
+ enableRemove = true;
}
+ AccidentalBatchUIModel model = getModel();
+ model.setRemoveBatchEnabled(enableRemove);
}
+
+ protected void saveRow(AccidentalBatchRowModel row) {
+
+// AccidentalBatch catchBean = row.toBean();
+//
+// FishingOperation fishingOperation = getModel().getFishingOperation();
+// catchBean.setFishingOperation(fishingOperation);
+// if (log.isInfoEnabled()) {
+// log.info("Selected fishingOperation: " + fishingOperation.getId());
+// }
+//
+// if (TuttiEntities.isNew(catchBean)) {
+//
+// catchBean = persistenceService.createAccidentalBatch(catchBean);
+// row.setId(catchBean.getId());
+// } else {
+// persistenceService.saveAccidentalBatch(catchBean);
+// }
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -24,19 +24,135 @@
* #L%
*/
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
+import fr.ifremer.tutti.persistence.entities.data.Attachment;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.util.TabContentModel;
+import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
+import org.apache.commons.collections.CollectionUtils;
+import java.util.Collection;
+import java.util.List;
+
/**
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public class AccidentalBatchUIModel extends AbstractTuttiBatchUIModel<AccidentalBatchRowModel, AccidentalBatchUIModel> {
+public class AccidentalBatchUIModel extends AbstractTuttiBatchUIModel<AccidentalBatchRowModel, AccidentalBatchUIModel>
+ implements AttachmentModelAware, TabContentModel {
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_REMOVE_BATCH_ENABLED = "removeBatchEnabled";
+
+ protected final List<Attachment> attachment = Lists.newArrayList();
+
+ /**
+ * Can user remove a selected batch?
+ */
+ protected boolean removeBatchEnabled;
+
+ private String rootBatchId;
+
public AccidentalBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel);
}
+ public boolean isRemoveBatchEnabled() {
+ return removeBatchEnabled;
+ }
+
+ public void setRemoveBatchEnabled(boolean removeBatchEnabled) {
+ Object oldValue = isRemoveBatchEnabled();
+ this.removeBatchEnabled = removeBatchEnabled;
+ firePropertyChange(PROPERTY_REMOVE_BATCH_ENABLED, oldValue, removeBatchEnabled);
+ }
+
+ public void setRootBatchId(String rootBatchId) {
+ String oldValue = getObjectId();
+ this.rootBatchId = rootBatchId;
+ firePropertyChange(PROPERTY_OBJECT_ID, oldValue, getObjectId());
+ }
+
+ public String getRootBatchId() {
+ return rootBatchId;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AttachmentModelAware --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public AttachementObjectTypeEnum getObjectType() {
+ return AttachementObjectTypeEnum.CATCH_BATCH;
+ }
+
+ @Override
+ public String getObjectId() {
+ return rootBatchId;
+ }
+
+ @Override
+ public List<Attachment> getAttachment() {
+ return attachment;
+ }
+
+ @Override
+ public void addAllAttachment(Collection<Attachment> attachments) {
+ this.attachment.addAll(attachments);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void addAttachment(Attachment attachment) {
+ this.attachment.add(attachment);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void removeAllAttachment(Collection<Attachment> attachments) {
+ this.attachment.removeAll(attachments);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ @Override
+ public void removeAttachment(Attachment attachment) {
+ this.attachment.remove(attachment);
+ firePropertyChange(PROPERTY_ATTACHMENT, null, getAttachment());
+ }
+
+ //------------------------------------------------------------------------//
+ //-- TabContentModel --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public boolean isEmpty() {
+ boolean result = CollectionUtils.isEmpty(getAttachment());
+ if (result && CollectionUtils.isNotEmpty(getRows())) {
+
+ // check if every line is not valid
+ for (AccidentalBatchRowModel row : rows) {
+ if (row.isValid()) {
+
+ // found a valid row so not empty
+ result = false;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public String getTitle() {
+ return "tutti.label.tab.accidental";
+ }
+
+ @Override
+ public String getIcon() {
+ return null;
+ }
+
}
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/RemoveAccidentalBatchAction.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -0,0 +1,103 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.accidental;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.tutti.persistence.TuttiPersistence;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractSelectTableAction;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
+ */
+public class RemoveAccidentalBatchAction extends AbstractTuttiAction<AccidentalBatchUIModel, AccidentalBatchUI, AccidentalBatchUIHandler> {
+
+ private static final Log log =
+ LogFactory.getLog(RemoveAccidentalBatchAction.class);
+
+ public RemoveAccidentalBatchAction(AccidentalBatchUIHandler handler) {
+ super(handler, false);
+ }
+
+ int rowIndex;
+
+ @Override
+ protected void doAction() throws Exception {
+
+ JXTable table = handler.getTable();
+
+ rowIndex = table.getSelectedRow();
+
+ Preconditions.checkState(rowIndex != -1,
+ "Cant remove batch if none is selected");
+
+ AccidentalBatchTableModel tableModel = handler.getTableModel();
+ AccidentalBatchRowModel selectedBatch = tableModel.getEntry(rowIndex);
+
+ boolean persisted = !TuttiEntities.isNew(selectedBatch);
+
+ if (persisted) {
+
+ // remove it from db
+
+ String id = selectedBatch.getId();
+
+ if (log.isInfoEnabled()) {
+ log.info("Remove marineLitter with id: " + id);
+ }
+
+ TuttiPersistence persistenceService =
+ getContext().getPersistenceService();
+
+// persistenceService.deleteMarineLitterBatch(id);
+ }
+ }
+
+ @Override
+ public void postSuccessAction() {
+ super.postSuccessAction();
+
+ JXTable table = handler.getTable();
+
+ AccidentalBatchTableModel tableModel = handler.getTableModel();
+
+ tableModel.removeRow(rowIndex);
+
+ if (!tableModel.getRows().isEmpty()) {
+
+ // select first row
+ AbstractSelectTableAction.doSelectCell(table, 0, 0);
+ }
+
+ if (table.isEditing()) {
+
+ // but no edit it
+ table.getCellEditor().stopCellEditing();
+ }
+ }
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.css 2013-04-11 15:00:54 UTC (rev 766)
@@ -0,0 +1,129 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+BeanFilterableComboBox {
+ showReset: true;
+ i18nPrefix: "tutti.property.";
+ bean: {model};
+}
+
+NumberEditor {
+ autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
+ showReset: true;
+}
+
+#createAccidentalBatchTopPanel {
+ _help: {"tutti.createIndividualObservationBatch.help"};
+}
+
+#accidentalSpeciesLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalSpecies";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalSpecies.tip";
+ labelFor: {accidentalSpeciesComboBox};
+ _help: {"tutti.createAccidentalBatch.field.accidentalSpecies.help"};
+}
+
+#accidentalSpeciesComboBox {
+ property: species;
+ selectedItem: {model.getSpecies()};
+}
+
+#accidentalGenderLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalGender";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalGender.tip";
+ labelFor: {accidentalGenderComboBox};
+ _help: {"tutti.createAccidentalBatch.field.accidentalGender.help"};
+}
+
+#accidentalGenderComboBox {
+ property: gender;
+ selectedItem: {model.getGender()};
+}
+
+#accidentalWeightLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalWeight";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalWeight.tip";
+ labelFor: {accidentalWeightField};
+ _help: {"tutti.createAccidentalBatch.field.accidentalWeight.help"};
+}
+
+#accidentalWeightField {
+ property: weight;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
+ bean: {model};
+}
+
+#accidentalSizeLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalSize";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalSize.tip";
+ labelFor: {accidentalSizeField};
+ _help: {"tutti.createAccidentalBatch.field.accidentalSize.help"};
+}
+
+#accidentalSizeField {
+ property: size;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
+ bean: {model};
+}
+
+#accidentalLengthStepCaracteristicLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.tip";
+ labelFor: {accidentalLengthStepCaracteristicComboBox};
+ _help: {"tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.help"};
+}
+
+#accidentalLengthStepCaracteristicComboBox {
+ property: lengthStepCaracteristic;
+ selectedItem: {model.getLengthStepCaracteristic()};
+}
+
+#accidentalDeadOrAliveLabel {
+ text: "tutti.createAccidentalBatch.field.accidentalDeadOrAlive";
+ toolTipText: "tutti.createAccidentalBatch.field.accidentalDeadOrAlive.tip";
+ labelFor: {accidentalDeadOrAliveComboBox};
+ _help: {"tutti.createAccidentalBatch.field.accidentalDeadOrAlive.help"};
+}
+
+#accidentalDeadOrAliveComboBox {
+ property: deadOrAlive;
+ selectedItem: {model.getDeadOrAlive()};
+}
+
+#saveButton {
+ actionIcon: save;
+ text: "tutti.createAccidentalBatch.action.save";
+ toolTipText: "tutti.createAccidentalBatch.action.save.tip";
+ i18nMnemonic: "tutti.createAccidentalBatch.action.save.mnemonic";
+ enabled: {model.isValid()};
+ _help: {"tutti.createAccidentalBatch.action.save.help"};
+}
+
+#cancelButton {
+ actionIcon: cancel;
+ text: "tutti.createAccidentalBatch.action.cancel";
+ toolTipText: "tutti.createAccidentalBatch.action.cancel.tip";
+ i18nMnemonic: "tutti.createAccidentalBatch.action.cancel.mnemonic";
+ _help: {"tutti.createAccidentalBatch.action.cancel.help"};
+}
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -0,0 +1,155 @@
+<!--
+ #%L
+ Tutti :: UI
+ %%
+ 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%
+ -->
+<JPanel id='createAccidentalBatchTopPanel' layout='{new BorderLayout()}'
+ decorator='help'
+ implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CreateAccidentalBatchUIModel, CreateAccidentalBatchUIHandler>'>
+ <import>
+
+ fr.ifremer.tutti.persistence.entities.referential.Species
+ fr.ifremer.tutti.persistence.entities.referential.Caracteristic
+ fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue
+
+ fr.ifremer.tutti.ui.swing.TuttiHelpBroker
+ fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
+ fr.ifremer.tutti.ui.swing.util.TuttiUI
+
+ jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
+ jaxx.runtime.swing.editor.NumberEditor
+
+ static org.nuiton.i18n.I18n._
+ </import>
+
+ <script><![CDATA[
+
+public CreateAccidentalBatchUI(EditCatchesUI parentUI) {
+ JAXXUtil.initContext(this, parentUI);
+ CreateAccidentalBatchUIHandler handler = new CreateAccidentalBatchUIHandler(parentUI, this);
+ setContextValue(handler);
+ handler.beforeInitUI();
+}
+
+protected void $afterCompleteSetup() { handler.afterInitUI(); }
+ ]]></script>
+
+ <CreateAccidentalBatchUIHandler id='handler'
+ initializer='getContextValue(CreateAccidentalBatchUIHandler.class)'/>
+
+ <CreateAccidentalBatchUIModel id='model'
+ initializer='getContextValue(CreateAccidentalBatchUIModel.class)'/>
+
+ <BeanValidator id='validator' bean='model'
+ uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
+ <field name='species'
+ component='accidentalSpeciesComboBox'/>
+ <field name='gender'
+ component='accidentalGenderComboBox'/>
+ <field name='weight'
+ component='accidentalWeightField'/>
+ <field name='size'
+ component='accidentalSizeField'/>
+ <field name='lengthStepCaracteristic'
+ component='accidentalLengthStepCaracteristicComboBox'/>
+ <field name='deadOrAlive'
+ component='accidentalDeadOrAliveComboBox'/>
+ </BeanValidator>
+
+ <TuttiHelpBroker id='broker'
+ constructorParams='"tutti.createAccidentalBatch.help"'/>
+
+ <Table id='configurationPanel' constraints='BorderLayout.CENTER' fill='both'>
+
+ <!-- accidental species -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalSpeciesLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <BeanFilterableComboBox id='accidentalSpeciesComboBox'
+ constructorParams='this'
+ genericType='Species'/>
+ </cell>
+ </row>
+
+ <!-- accidental gender -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalGenderLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <BeanFilterableComboBox id='accidentalGenderComboBox'
+ constructorParams='this'
+ genericType='CaracteristicQualitativeValue'/>
+ </cell>
+ </row>
+
+ <!-- accidental weight -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <NumberEditor id='accidentalWeightField' constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- accidental size -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalSizeLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <NumberEditor id='accidentalSizeField' constructorParams='this'/>
+ </cell>
+ </row>
+
+ <!-- accidental LengthStepCaracteristic -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalLengthStepCaracteristicLabel'/>
+ </cell>
+ <cell weightx='1.0' columns='2'>
+ <BeanFilterableComboBox id='accidentalLengthStepCaracteristicComboBox'
+ constructorParams='this'
+ genericType='Caracteristic'/>
+ </cell>
+ </row>
+
+ <!-- accidental deadOrAlive -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='accidentalDeadOrAliveLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <BeanFilterableComboBox id='accidentalDeadOrAliveComboBox'
+ constructorParams='this'
+ genericType='CaracteristicQualitativeValue'/>
+ </cell>
+ </row>
+
+ </Table>
+
+ <!-- Form Actions -->
+ <JPanel layout='{new GridLayout(1, 0)}' constraints='BorderLayout.SOUTH'>
+ <JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
+ <JButton id='saveButton' onActionPerformed='handler.save()'/>
+ </JPanel>
+</JPanel>
\ No newline at end of file
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -0,0 +1,173 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
+import fr.ifremer.tutti.persistence.TuttiPersistence;
+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.util.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.util.Cancelable;
+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 jaxx.runtime.SwingUtil;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ */
+public class CreateAccidentalBatchUIHandler extends AbstractTuttiUIHandler<CreateAccidentalBatchUIModel, CreateAccidentalBatchUI>
+ implements Cancelable {
+
+ private static final Log log =
+ LogFactory.getLog(CreateAccidentalBatchUIHandler.class);
+
+ private final TuttiPersistence persistenceService;
+
+ public CreateAccidentalBatchUIHandler(TuttiUI parentUi,
+ CreateAccidentalBatchUI ui) {
+ super(parentUi.getHandler().getContext(), ui);
+ this.persistenceService = context.getPersistenceService();
+ }
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void beforeInitUI() {
+ CreateAccidentalBatchUIModel model = new CreateAccidentalBatchUIModel();
+ ui.setContextValue(model);
+ listModelIsModify(model);
+ }
+
+ @Override
+ public void afterInitUI() {
+
+ initUI(ui);
+
+ initBeanFilterableComboBox(ui.getAccidentalSpeciesComboBox(),
+ getDataContext().getReferentSpecies(),
+ null);
+
+ initBeanFilterableComboBox(ui.getAccidentalGenderComboBox(),
+ getDataContext().getGenderValues(),
+ null);
+
+ initBeanFilterableComboBox(ui.getAccidentalLengthStepCaracteristicComboBox(),
+ getDataContext().getLengthStepCaracteristics(),
+ null);
+
+ initBeanFilterableComboBox(ui.getAccidentalDeadOrAliveComboBox(),
+ getDataContext().getDeadOrAliveValues(),
+ null);
+
+ listenValidatorValid(ui.getValidator(), getModel());
+ }
+
+ @Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getAccidentalSpeciesComboBox();
+ }
+
+ @Override
+ public void onCloseUI() {
+
+ if (log.isDebugEnabled()) {
+ log.debug("closing: " + ui);
+ }
+
+ // evict model from validator
+ ui.getValidator().setBean(null);
+
+ // when canceling always invalid model
+ getModel().setValid(false);
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ parent.getHandler().setAccidentalSelectedCard(EditCatchesUIHandler.MAIN_CARD);
+ }
+
+ @Override
+ public SwingValidator<CreateAccidentalBatchUIModel> getValidator() {
+ return ui.getValidator();
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Cancelable methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void cancel() {
+ if (log.isInfoEnabled()) {
+ log.info("Cancel UI " + ui);
+ }
+ closeUI(ui);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Public methods --//
+ //------------------------------------------------------------------------//
+
+ public void openUI() {
+
+ CreateAccidentalBatchUIModel model = getModel();
+
+ // connect model to validator
+ ui.getValidator().setBean(model);
+
+ model.reset();
+
+ }
+
+ public void save() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Save UI " + ui);
+ }
+
+ EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ parent.getAccidentalTabContent().getHandler().addBatch(getModel());
+
+ // close dialog
+ closeUI(ui);
+ }
+
+ public Species openAddSpeciesDialog(String title, List<Species> species) {
+ SelectSpeciesUI dialogContent = new SelectSpeciesUI(ui);
+ SelectSpeciesUIModel model = dialogContent.getModel();
+ model.setSelectedSpecies(null);
+ model.setSpecies(species);
+
+ openDialog(dialogContent, title, new Dimension(400, 130));
+
+ Species result = model.getSelectedSpecies();
+ return result;
+ }
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/create/CreateAccidentalBatchUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -0,0 +1,127 @@
+package fr.ifremer.tutti.ui.swing.content.operation.catches.accidental.create;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
+import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
+import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
+import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
+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.util.AbstractTuttiBeanUIModel;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.4
+ */
+public class CreateAccidentalBatchUIModel extends AbstractTuttiBeanUIModel<CreateAccidentalBatchUIModel, CreateAccidentalBatchUIModel> {
+
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Delegate edit object.
+ *
+ * @since 1.3
+ */
+ protected final AccidentalBatch editObject =
+ TuttiBeanFactory.newAccidentalBatch();
+
+ public CreateAccidentalBatchUIModel() {
+ super(CreateAccidentalBatchUIModel.class, null, null);
+ }
+
+ public Species getSpecies() {
+ return editObject.getSpecies();
+ }
+
+ public void setSpecies(Species accidentalSpecies) {
+ Object oldValue = getSpecies();
+ editObject.setSpecies(accidentalSpecies);
+ firePropertyChange(AccidentalBatch.PROPERTY_SPECIES, oldValue, accidentalSpecies);
+ }
+
+ public CaracteristicQualitativeValue getGender() {
+ return editObject.getGender();
+ }
+
+ public void setGender(CaracteristicQualitativeValue accidentalGender) {
+ Object oldValue = getGender();
+ editObject.setGender(accidentalGender);
+ firePropertyChange(AccidentalBatch.PROPERTY_GENDER, oldValue, accidentalGender);
+ }
+
+ public Float getWeight() {
+ return editObject.getWeight();
+ }
+
+ public void setWeight(Float individualObservationWeight) {
+ Object oldValue = getWeight();
+ editObject.setWeight(individualObservationWeight);
+ firePropertyChange(AccidentalBatch.PROPERTY_WEIGHT, oldValue, individualObservationWeight);
+ }
+
+ public Float getSize() {
+ return editObject.getSize();
+ }
+
+ public void setSize(Float individualObservationSize) {
+ Object oldValue = getSize();
+ editObject.setSize(individualObservationSize);
+ firePropertyChange(AccidentalBatch.PROPERTY_SIZE, oldValue, individualObservationSize);
+ }
+
+ public Caracteristic getLengthStepCaracteristic() {
+ return editObject.getLengthStepCaracteristic();
+ }
+
+ public void setLengthStepCaracteristic(Caracteristic individualObservationLengthStepCaracteristic) {
+ Object oldValue = getLengthStepCaracteristic();
+ editObject.setLengthStepCaracteristic(individualObservationLengthStepCaracteristic);
+ firePropertyChange(AccidentalBatch.PROPERTY_LENGTH_STEP_CARACTERISTIC, oldValue, individualObservationLengthStepCaracteristic);
+ }
+
+ public CaracteristicQualitativeValue getDeadOrAlive() {
+ return editObject.getDeadOrAlive();
+ }
+
+ public void setDeadOrAlive(CaracteristicQualitativeValue accidentalDeadOrAlive) {
+ Object oldValue = getDeadOrAlive();
+ editObject.setDeadOrAlive(accidentalDeadOrAlive);
+ firePropertyChange(AccidentalBatch.PROPERTY_DEAD_OR_ALIVE, oldValue, accidentalDeadOrAlive);
+ }
+
+ @Override
+ protected CreateAccidentalBatchUIModel newEntity() {
+ return new CreateAccidentalBatchUIModel();
+ }
+
+ public void reset() {
+ setSpecies(null);
+ setGender(null);
+ setWeight(null);
+ setSize(null);
+ setLengthStepCaracteristic(null);
+ setDeadOrAlive(null);
+ }
+}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchRowModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchTableModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import fr.ifremer.tutti.ui.swing.content.operation.catches.marinelitter.MarineLitterBatchRowModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ Tutti :: UI
+ %%
+ 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%
+ -->
<JPanel id='editIndividualObservationBatchTopPanel' layout='{new BorderLayout()}'
decorator='help'
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.PropagatePropertyChangeListener;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/RemoveIndividualObservationBatchAction.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
@@ -18,10 +40,8 @@
extends AbstractTuttiAction<IndividualObservationBatchUIModel, IndividualObservationBatchUI, IndividualObservationBatchUIHandler> {
private static final Log log =
- LogFactory.getLog(RemoveMarineLitterBatchAction.class);
+ LogFactory.getLog(RemoveIndividualObservationBatchAction.class);
- protected RemoveSpeciesSubBatchAction removeSpeciesSubBatchAction;
-
public RemoveIndividualObservationBatchAction(IndividualObservationBatchUIHandler handler) {
super(handler, false);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapCellComponent.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorRowModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import fr.ifremer.tutti.ui.swing.content.operation.fishing.AbstractCaracteristicRowModel;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorTableModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import org.jdesktop.swingx.table.TableColumnModelExt;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.css 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.css 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
BeanFilterableComboBox {
i18nPrefix: "tutti.property.";
showReset: true;
@@ -22,17 +43,17 @@
#cancelButton {
actionIcon: cancel;
- text: "tutti.editSpeciesFrequencies.action.cancel";
- toolTipText: "tutti.editSpeciesFrequencies.action.cancel.tip";
- i18nMnemonic: "tutti.editSpeciesFrequencies.action.cancel.mnemonic";
- _help: {"tutti.editSpeciesFrequencies.action.cancel.help"};
+ text: "tutti.editIndividualObservationCaracteristics.action.cancel";
+ toolTipText: "tutti.editIndividualObservationCaracteristics.action.cancel.tip";
+ i18nMnemonic: "tutti.editIndividualObservationCaracteristics.action.cancel.mnemonic";
+ _help: {"tutti.editIndividualObservationCaracteristics.action.cancel.help"};
}
#saveButton {
actionIcon: save;
- text: "tutti.editSpeciesFrequencies.action.save";
- toolTipText: "tutti.editSpeciesFrequencies.action.save.tip";
- i18nMnemonic: "tutti.editSpeciesFrequencies.action.save.mnemonic";
+ text: "tutti.editIndividualObservationCaracteristics.action.save";
+ toolTipText: "tutti.editIndividualObservationCaracteristics.action.save.tip";
+ i18nMnemonic: "tutti.editIndividualObservationCaracteristics.action.save.mnemonic";
enabled: {model.isValid()};
- _help: {"tutti.editSpeciesFrequencies.action.save.help"};
+ _help: {"tutti.editIndividualObservationCaracteristics.action.save.help"};
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ Tutti :: UI
+ %%
+ 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%
+ -->
<Table implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CaracteristicMapEditorUIModel, CaracteristicMapEditorUIHandler>'>
<import>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.css 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,3 +1,24 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
BeanFilterableComboBox {
showReset: true;
i18nPrefix: "tutti.property.";
@@ -68,17 +89,17 @@
#saveButton {
actionIcon: save;
- text: "tutti.createMarineLitterBatch.action.save";
- toolTipText: "tutti.createMarineLitterBatch.action.save.tip";
- i18nMnemonic: "tutti.createMarineLitterBatch.action.save.mnemonic";
+ text: "tutti.createIndividualObservationBatch.action.save";
+ toolTipText: "tutti.createIndividualObservationBatch.action.save.tip";
+ i18nMnemonic: "tutti.createIndividualObservationBatch.action.save.mnemonic";
enabled: {model.isValid()};
- _help: {"tutti.createMarineLitterBatch.action.save.help"};
+ _help: {"tutti.createIndividualObservationBatch.action.save.help"};
}
#cancelButton {
actionIcon: cancel;
- text: "tutti.createMarineLitterBatch.action.cancel";
- toolTipText: "tutti.createMarineLitterBatch.action.cancel.tip";
- i18nMnemonic: "tutti.createMarineLitterBatch.action.cancel.mnemonic";
- _help: {"tutti.createMarineLitterBatch.action.cancel.help"};
+ text: "tutti.createIndividualObservationBatch.action.cancel";
+ toolTipText: "tutti.createIndividualObservationBatch.action.cancel.tip";
+ i18nMnemonic: "tutti.createIndividualObservationBatch.action.cancel.mnemonic";
+ _help: {"tutti.createIndividualObservationBatch.action.cancel.help"};
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUI.jaxx 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,3 +1,24 @@
+<!--
+ #%L
+ Tutti :: UI
+ %%
+ 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%
+ -->
<JPanel id='createIndividualObservationBatchTopPanel' layout='{new BorderLayout()}'
decorator='help'
implements='fr.ifremer.tutti.ui.swing.util.TuttiUI<CreateIndividualObservationBatchUIModel, CreateIndividualObservationBatchUIHandler>'>
@@ -47,7 +68,7 @@
</BeanValidator>
<TuttiHelpBroker id='broker'
- constructorParams='"tutti.createMarineLitterBatch.help"'/>
+ constructorParams='"tutti.createIndividualObservationBatch.help"'/>
<Table id='configurationPanel' constraints='BorderLayout.CENTER' fill='both'>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.create;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Species;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel.java 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,5 +1,27 @@
package fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.create;
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * 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%
+ */
+
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch;
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml 2013-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIModel-error-validation.xml 2013-04-11 15:00:54 UTC (rev 766)
@@ -1,4 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti :: UI
+ %%
+ 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%
+ -->
+
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-04-11 15:00:54 UTC (rev 766)
@@ -103,6 +103,25 @@
tutti.config.option.weights.rate.difference.totalAndSorted.description=
tutti.config.sampleOrder.title=
tutti.config.title=
+tutti.createAccidentalBatch.action.cancel=
+tutti.createAccidentalBatch.action.cancel.mnemonic=
+tutti.createAccidentalBatch.action.cancel.tip=
+tutti.createAccidentalBatch.action.save=
+tutti.createAccidentalBatch.action.save.mnemonic=
+tutti.createAccidentalBatch.action.save.tip=
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive=
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive.tip=
+tutti.createAccidentalBatch.field.accidentalGender=
+tutti.createAccidentalBatch.field.accidentalGender.tip=
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic=
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.tip=
+tutti.createAccidentalBatch.field.accidentalSize=
+tutti.createAccidentalBatch.field.accidentalSize.tip=
+tutti.createAccidentalBatch.field.accidentalSpecies=
+tutti.createAccidentalBatch.field.accidentalSpecies.tip=
+tutti.createAccidentalBatch.field.accidentalWeight=
+tutti.createAccidentalBatch.field.accidentalWeight.tip=
+tutti.createAccidentalBatch.title=
tutti.createBenthosBatch.action.addSpecies=
tutti.createBenthosBatch.action.addSpecies.mnemonic=
tutti.createBenthosBatch.action.addSpecies.tip=
@@ -121,6 +140,12 @@
tutti.createBenthosBatch.title=
tutti.createBenthosMelag.error.message=
tutti.createBenthosMelag.error.title=
+tutti.createIndividualObservationBatch.action.cancel=
+tutti.createIndividualObservationBatch.action.cancel.mnemonic=
+tutti.createIndividualObservationBatch.action.cancel.tip=
+tutti.createIndividualObservationBatch.action.save=
+tutti.createIndividualObservationBatch.action.save.mnemonic=
+tutti.createIndividualObservationBatch.action.save.tip=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic=
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.tip=
tutti.createIndividualObservationBatch.field.individualObservationSize=
@@ -198,10 +223,26 @@
tutti.dbManager.info.no.db.loaded=
tutti.dbManager.title.choose.dbExportFile=
tutti.dbManager.title.choose.dbImportFile=
+tutti.editAccidentalBatch.action.createBatch=
+tutti.editAccidentalBatch.action.createBatch.mnemonic=
+tutti.editAccidentalBatch.action.createBatch.tip=
+tutti.editAccidentalBatch.action.removeBatch=
+tutti.editAccidentalBatch.action.removeBatch.mnemonic=
+tutti.editAccidentalBatch.action.removeBatch.tip=
tutti.editAccidentalBatch.table.header.comment=
tutti.editAccidentalBatch.table.header.comment.tip=
+tutti.editAccidentalBatch.table.header.deadOrAlive=
+tutti.editAccidentalBatch.table.header.deadOrAlive.tip=
tutti.editAccidentalBatch.table.header.file=
tutti.editAccidentalBatch.table.header.file.tip=
+tutti.editAccidentalBatch.table.header.gender=
+tutti.editAccidentalBatch.table.header.gender.tip=
+tutti.editAccidentalBatch.table.header.lengthStepCaracteristic=
+tutti.editAccidentalBatch.table.header.lengthStepCaracteristic.tip=
+tutti.editAccidentalBatch.table.header.size=
+tutti.editAccidentalBatch.table.header.size.tip=
+tutti.editAccidentalBatch.table.header.species=
+tutti.editAccidentalBatch.table.header.species.tip=
tutti.editAccidentalBatch.table.header.speciesByCode=
tutti.editAccidentalBatch.table.header.speciesByCode.tip=
tutti.editAccidentalBatch.table.header.speciesByGenusCode=
@@ -530,6 +571,12 @@
tutti.editIndividualObservationBatch.table.header.species.tip=
tutti.editIndividualObservationBatch.table.header.weight=
tutti.editIndividualObservationBatch.table.header.weight.tip=
+tutti.editIndividualObservationCaracteristics.action.cancel=
+tutti.editIndividualObservationCaracteristics.action.cancel.mnemonic=
+tutti.editIndividualObservationCaracteristics.action.cancel.tip=
+tutti.editIndividualObservationCaracteristics.action.save=
+tutti.editIndividualObservationCaracteristics.action.save.mnemonic=
+tutti.editIndividualObservationCaracteristics.action.save.tip=
tutti.editMarineLitterBatch.action.createBatch=
tutti.editMarineLitterBatch.action.createBatch.mnemonic=
tutti.editMarineLitterBatch.action.createBatch.tip=
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-04-11 11:12:42 UTC (rev 765)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-04-11 15:00:54 UTC (rev 766)
@@ -96,15 +96,34 @@
tutti.config.option.weights.rate.difference.totalAndSorted.description=Pourcentage de différence entre les Poids totaux VRAC triés et les poids totaux VRAC en dessous duquel on demande confirmation sur la saisie.
tutti.config.sampleOrder.title=Catégorie d'échantillonnage
tutti.config.title=Configuration
+tutti.createAccidentalBatch.action.cancel=Annuler
+tutti.createAccidentalBatch.action.cancel.mnemonic=A
+tutti.createAccidentalBatch.action.cancel.tip=Annuler la création de la capture accidentelle
+tutti.createAccidentalBatch.action.save=Enregistrer
+tutti.createAccidentalBatch.action.save.mnemonic=E
+tutti.createAccidentalBatch.action.save.tip=Enregister la capture accidentelle
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive=Mort ou vivant
+tutti.createAccidentalBatch.field.accidentalDeadOrAlive.tip=L'animal a-t-il été remis à l'eau mort ou vivant ?
+tutti.createAccidentalBatch.field.accidentalGender=Sexe
+tutti.createAccidentalBatch.field.accidentalGender.tip=Sexe
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic=Classe de taille
+tutti.createAccidentalBatch.field.accidentalLengthStepCaracteristic.tip=Classe de taille
+tutti.createAccidentalBatch.field.accidentalSize=Taille
+tutti.createAccidentalBatch.field.accidentalSize.tip=Taille
+tutti.createAccidentalBatch.field.accidentalSpecies=Espèce
+tutti.createAccidentalBatch.field.accidentalSpecies.tip=Espèce
+tutti.createAccidentalBatch.field.accidentalWeight=Poids (kg)
+tutti.createAccidentalBatch.field.accidentalWeight.tip=Poids (kg)
+tutti.createAccidentalBatch.title=Créer une capture accidentelle
tutti.createBenthosBatch.action.addSpecies=...
tutti.createBenthosBatch.action.addSpecies.mnemonic=.
tutti.createBenthosBatch.action.addSpecies.tip=Sélectionner une autre espèce
tutti.createBenthosBatch.action.cancel=Annuler
tutti.createBenthosBatch.action.cancel.mnemonic=A
-tutti.createBenthosBatch.action.cancel.tip=Annuler la création du lôt espèce
+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=Enregister la création du lôt espèce
+tutti.createBenthosBatch.action.save.tip=Enregister la création du lot espèce
tutti.createBenthosBatch.field.batchWeight=Poids du lot (kg)
tutti.createBenthosBatch.field.batchWeight.tip=
tutti.createBenthosBatch.field.sortedUnsortedCategory=V / HV
@@ -122,37 +141,43 @@
tutti.createBenthosMelag.error.title=Erreur
tutti.createBenthosMelag.message=Combien pesait le MELAG (kg) ?
tutti.createBenthosMelag.title=Poids du MELAG (kg)
+tutti.createIndividualObservationBatch.action.cancel=Annuler
+tutti.createIndividualObservationBatch.action.cancel.mnemonic=A
+tutti.createIndividualObservationBatch.action.cancel.tip=Annuler la création de l'observation individuelle
+tutti.createIndividualObservationBatch.action.save=Enregistrer
+tutti.createIndividualObservationBatch.action.save.mnemonic=E
+tutti.createIndividualObservationBatch.action.save.tip=Enregistrer l'observation individuelle
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic=Classe de taille
tutti.createIndividualObservationBatch.field.individualObservationLengthStepCaracteristic.tip=Classe de taille
tutti.createIndividualObservationBatch.field.individualObservationSize=Taille
tutti.createIndividualObservationBatch.field.individualObservationSize.tip=Taille
tutti.createIndividualObservationBatch.field.individualObservationSpecies=Espèce
tutti.createIndividualObservationBatch.field.individualObservationSpecies.tip=Espèce
-tutti.createIndividualObservationBatch.field.individualObservationWeight=Poids
+tutti.createIndividualObservationBatch.field.individualObservationWeight=Poids (g)
tutti.createIndividualObservationBatch.field.individualObservationWeight.tip=Poids
tutti.createIndividualObservationBatch.title=Créer une observation
tutti.createMarineLitterBatch.action.cancel=Annuler
tutti.createMarineLitterBatch.action.cancel.mnemonic=A
-tutti.createMarineLitterBatch.action.cancel.tip=Annuler la création du lôt macro-déchet
+tutti.createMarineLitterBatch.action.cancel.tip=Annuler la création du lot macro-déchet
tutti.createMarineLitterBatch.action.save=Enregistrer
tutti.createMarineLitterBatch.action.save.mnemonic=E
-tutti.createMarineLitterBatch.action.save.tip=Enregistrer la création du lôt macro-déchet
+tutti.createMarineLitterBatch.action.save.tip=Enregistrer la création du lot macro-déchet
tutti.createMarineLitterBatch.field.marineLitterCategory=Catégorie de déchets
tutti.createMarineLitterBatch.field.marineLitterCategory.tip=
tutti.createMarineLitterBatch.field.marineLitterSizeCategory=Catégorie de taille
tutti.createMarineLitterBatch.field.marineLitterSizeCategory.tip=
tutti.createMarineLitterBatch.field.number=Nombre
tutti.createMarineLitterBatch.field.number.tip=
-tutti.createMarineLitterBatch.title=Créer un lôt
+tutti.createMarineLitterBatch.title=Créer un lot
tutti.createSpeciesBatch.action.addSpecies=...
tutti.createSpeciesBatch.action.addSpecies.mnemonic=.
tutti.createSpeciesBatch.action.addSpecies.tip=Sélectionner une autre espèce
tutti.createSpeciesBatch.action.cancel=Annuler
tutti.createSpeciesBatch.action.cancel.mnemonic=A
-tutti.createSpeciesBatch.action.cancel.tip=Annuler la création du lôt espèce
+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=Enregister la création du lôt espèce
+tutti.createSpeciesBatch.action.save.tip=Enregister la création du lot espèce
tutti.createSpeciesBatch.field.batchWeight=Poids du lot (kg)
tutti.createSpeciesBatch.field.batchWeight.tip=
tutti.createSpeciesBatch.field.sortedUnsortedCategory=V / HV
@@ -199,16 +224,28 @@
tutti.dbManager.info.no.db.loaded=Tutti possède une base mais elle n'est pas actuellement ouverte.
tutti.dbManager.title.choose.dbExportFile=Exporter la base de données
tutti.dbManager.title.choose.dbImportFile=Importer la base de données
+tutti.editAccidentalBatch.action.createBatch=Créer une capture accidentelle
+tutti.editAccidentalBatch.action.createBatch.mnemonic=C
+tutti.editAccidentalBatch.action.createBatch.tip=Créer une capture accidentelle
+tutti.editAccidentalBatch.action.removeBatch=Supprimer la capture courante
+tutti.editAccidentalBatch.action.removeBatch.mnemonic=S
+tutti.editAccidentalBatch.action.removeBatch.tip=Supprimer la capture courante (celle de la ligne sélectionnée)
tutti.editAccidentalBatch.table.header.comment=Commentaire
-tutti.editAccidentalBatch.table.header.comment.tip=
+tutti.editAccidentalBatch.table.header.comment.tip=Commentaire
+tutti.editAccidentalBatch.table.header.deadOrAlive=Mort ou vivant
+tutti.editAccidentalBatch.table.header.deadOrAlive.tip=L'animal a-t-il été remis à l'eau mort ou vivant ?
tutti.editAccidentalBatch.table.header.file=Pièces-jointes
-tutti.editAccidentalBatch.table.header.file.tip=
-tutti.editAccidentalBatch.table.header.speciesByCode=Espèce
-tutti.editAccidentalBatch.table.header.speciesByCode.tip=
-tutti.editAccidentalBatch.table.header.speciesByGenusCode=Espèce
-tutti.editAccidentalBatch.table.header.speciesByGenusCode.tip=
-tutti.editAccidentalBatch.table.header.weight=Poids observé
-tutti.editAccidentalBatch.table.header.weight.tip=
+tutti.editAccidentalBatch.table.header.file.tip=Pièces-jointes
+tutti.editAccidentalBatch.table.header.gender=Sexe
+tutti.editAccidentalBatch.table.header.gender.tip=Sexe (Male, femelle, autre...)
+tutti.editAccidentalBatch.table.header.lengthStepCaracteristic=Classe de taille
+tutti.editAccidentalBatch.table.header.lengthStepCaracteristic.tip=Classe de taille
+tutti.editAccidentalBatch.table.header.size=Taille
+tutti.editAccidentalBatch.table.header.size.tip=Taille (l'unité dépend de la classe de taille)
+tutti.editAccidentalBatch.table.header.species=Espèce
+tutti.editAccidentalBatch.table.header.species.tip=Espèce
+tutti.editAccidentalBatch.table.header.weight=Poids observé (kg)
+tutti.editAccidentalBatch.table.header.weight.tip=Poids observé
tutti.editBenthosBatch.action.createBatch=Créer un lot pour une espèce
tutti.editBenthosBatch.action.createBatch.mnemonic=C
tutti.editBenthosBatch.action.createBatch.tip=Créer un nouveau lot pour une espèce
@@ -534,8 +571,14 @@
tutti.editIndividualObservationBatch.table.header.size.tip=Taille
tutti.editIndividualObservationBatch.table.header.species=Espèce
tutti.editIndividualObservationBatch.table.header.species.tip=Espèce
-tutti.editIndividualObservationBatch.table.header.weight=Poids
-tutti.editIndividualObservationBatch.table.header.weight.tip=Poids (Kg)
+tutti.editIndividualObservationBatch.table.header.weight=Poids (g)
+tutti.editIndividualObservationBatch.table.header.weight.tip=Poids (g)
+tutti.editIndividualObservationCaracteristics.action.cancel=Annuler
+tutti.editIndividualObservationCaracteristics.action.cancel.mnemonic=A
+tutti.editIndividualObservationCaracteristics.action.cancel.tip=Annuler l'édition des caractéristiques de l'observation
+tutti.editIndividualObservationCaracteristics.action.save=Enregistrer
+tutti.editIndividualObservationCaracteristics.action.save.mnemonic=E
+tutti.editIndividualObservationCaracteristics.action.save.tip=Enregistrer les caractéristiques de l'observation
tutti.editMarineLitterBatch.action.createBatch=Créer un lot de déchet
tutti.editMarineLitterBatch.action.createBatch.mnemonic=C
tutti.editMarineLitterBatch.action.createBatch.tip=Créer un nouveau lot de déchet
1
0
r765 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content java/fr/ifremer/tutti/ui/swing/content/operation/catches java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create resources/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create resources/i18n
by kmorin@users.forge.codelutin.com 11 Apr '13
by kmorin@users.forge.codelutin.com 11 Apr '13
11 Apr '13
Author: kmorin
Date: 2013-04-11 13:12:42 +0200 (Thu, 11 Apr 2013)
New Revision: 765
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/765
Log:
fixes #2259 [MACRODECHET] - Je ne peux cr?\195?\169er deux lignes "A2: Plastic, Feuille" avec des cat?\195?\169gories de taille diff?\195?\169rentes
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -522,6 +522,8 @@
// selected protocol
TuttiProtocol protocol = getDataContext().getProtocol();
+ log.fatal(protocol.getId() + " " + protocol.getName());
+
title += _("tutti.main.title.selectedProtocol", protocol.getName());
} else {
@@ -543,7 +545,6 @@
title = _("tutti.main.title.nodb");
}
-
return title;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -118,6 +118,14 @@
protected final Multimap<CaracteristicQualitativeValue, Species>
speciesUsed = ArrayListMultimap.create();
+ /**
+ * Categories already used in some batches.
+ *
+ * @since 1.4
+ */
+ protected final Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue>
+ marineLitterCategoriesUsed = ArrayListMultimap.create();
+
public EditCatchesUIModel() {
super(CatchBatch.class, fromBeanBinder, toBeanBinder);
speciesTotalSortedComputedOrNotWeight.addPropagateListener(
@@ -190,6 +198,10 @@
return speciesUsed;
}
+ public Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue> getMarineLitterCategoriesUsed() {
+ return marineLitterCategoriesUsed;
+ }
+
//------------------------------------------------------------------------//
//-- Total --//
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.PropagatePropertyChangeListener;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
@@ -203,6 +204,16 @@
}
@Override
+ protected void onModelRowsChanged(List<MarineLitterBatchRowModel> rows) {
+ super.onModelRowsChanged(rows);
+
+ for (MarineLitterBatchRowModel row : rows) {
+ // update categoriesUsed
+ addToMarineLitterCategoriesUsed(row);
+ }
+ }
+
+ @Override
protected void onRowValidStateChanged(int rowIndex,
MarineLitterBatchRowModel row,
Boolean oldValue,
@@ -391,7 +402,7 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
CreateMarineLitterBatchUI createBatchEditor = parent.getMarineLitterTabCreateBatch();
- createBatchEditor.getHandler().openUI();
+ createBatchEditor.getHandler().openUI(getModel());
parent.getHandler().setMarineLitterSelectedCard(EditCatchesUIHandler.CREATE_BATCH_CARD);
}
@@ -411,6 +422,9 @@
tableModel.addNewRow(newRow);
AbstractSelectTableAction.doSelectCell(getTable(), tableModel.getRowCount() - 1, 0);
+
+ //update categories used
+ addToMarineLitterCategoriesUsed(newRow);
}
recomputeBatchActionEnable();
@@ -453,4 +467,34 @@
persistenceService.saveMarineLitterBatch(catchBean);
}
}
+
+ public void removeFromMarineLitterCategoriesUsed(MarineLitterBatchRowModel row) {
+ Preconditions.checkNotNull(row);
+ Preconditions.checkNotNull(row.getMarineLitterCategory());
+ Preconditions.checkNotNull(row.getMarineLitterSizeCategory());
+ if (log.isInfoEnabled()) {
+ log.info("Remove from speciesUsed: " +
+ decorate(row.getMarineLitterSizeCategory()) +
+ " - " + decorate(row.getMarineLitterCategory()));
+ }
+ MarineLitterBatchUIModel model = getModel();
+ model.getMarineLitterCategoriesUsed().remove(row.getMarineLitterSizeCategory(),
+ row.getMarineLitterCategory());
+
+ }
+
+ protected void addToMarineLitterCategoriesUsed(MarineLitterBatchRowModel row) {
+ Preconditions.checkNotNull(row);
+ Preconditions.checkNotNull(row.getMarineLitterCategory());
+ Preconditions.checkNotNull(row.getMarineLitterSizeCategory());
+ if (log.isDebugEnabled()) {
+ log.debug("Add to marineLitterCategoriesUsed: " +
+ decorate(row.getMarineLitterSizeCategory()) +
+ " - " + decorate(row.getMarineLitterCategory()));
+ }
+ MarineLitterBatchUIModel model = getModel();
+ model.getMarineLitterCategoriesUsed().put(row.getMarineLitterSizeCategory(),
+ row.getMarineLitterCategory());
+
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -25,8 +25,10 @@
*/
import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
import fr.ifremer.tutti.persistence.entities.data.Attachment;
+import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import fr.ifremer.tutti.ui.swing.util.TabContentModel;
@@ -91,6 +93,10 @@
return rootBatchId;
}
+ public Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue> getMarineLitterCategoriesUsed() {
+ return catchesUIModel.getMarineLitterCategoriesUsed();
+ }
+
//------------------------------------------------------------------------//
//-- AttachmentModelAware --//
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/RemoveMarineLitterBatchAction.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -84,6 +84,9 @@
persistenceService.deleteMarineLitterBatch(id);
}
+
+ // update speciesUsed
+ handler.removeFromMarineLitterCategoriesUsed(selectedBatch);
}
@Override
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -24,14 +24,15 @@
* #L%
*/
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.TuttiPersistence;
-import fr.ifremer.tutti.persistence.entities.data.SortedUnsortedEnum;
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.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.marinelitter.MarineLitterBatchUIModel;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.util.Cancelable;
import fr.ifremer.tutti.ui.swing.util.TuttiUI;
@@ -139,7 +140,7 @@
//-- Public methods --//
//------------------------------------------------------------------------//
- public void openUI() {
+ public void openUI(MarineLitterBatchUIModel batchModel) {
CreateMarineLitterBatchUIModel model = getModel();
@@ -147,6 +148,15 @@
ui.getValidator().setBean(model);
model.reset();
+
+ Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue> categoryUsed =
+ model.getMarineLitterCategoryUsed();
+ categoryUsed.clear();
+
+ if (batchModel != null) {
+ categoryUsed.putAll(batchModel.getMarineLitterCategoriesUsed());
+ }
+
}
public void save() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel.java 2013-04-11 11:12:42 UTC (rev 765)
@@ -24,6 +24,8 @@
* #L%
*/
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.Multimap;
import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch;
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
@@ -47,6 +49,14 @@
protected final MarineLitterBatch editObject =
TuttiBeanFactory.newMarineLitterBatch();
+ /**
+ * Already used categories by size category.
+ *
+ * @since 1.4
+ */
+ protected final Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue> marineLitterCategoryUsed =
+ ArrayListMultimap.create();
+
public CreateMarineLitterBatchUIModel() {
super(CreateMarineLitterBatchUIModel.class, null, null);
}
@@ -81,6 +91,25 @@
firePropertyChange(MarineLitterBatch.PROPERTY_NUMBER, oldValue, number);
}
+ public Multimap<CaracteristicQualitativeValue, CaracteristicQualitativeValue> getMarineLitterCategoryUsed() {
+ return marineLitterCategoryUsed;
+ }
+
+ public boolean isCategoryAndSizeCategoryAvailable() {
+ CaracteristicQualitativeValue category = getMarineLitterCategory();
+ CaracteristicQualitativeValue sizeCategory = getMarineLitterSizeCategory();
+
+ boolean result = category != null && sizeCategory != null &&
+ isCategoryAndSizeCategoryAvailable(category, sizeCategory);
+ return result;
+ }
+
+ public boolean isCategoryAndSizeCategoryAvailable(CaracteristicQualitativeValue category,
+ CaracteristicQualitativeValue sizeCategory) {
+ boolean result = !marineLitterCategoryUsed.containsEntry(sizeCategory, category);
+ return result;
+ }
+
@Override
protected CreateMarineLitterBatchUIModel newEntity() {
return new CreateMarineLitterBatchUIModel();
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel-error-validation.xml 2013-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIModel-error-validation.xml 2013-04-11 11:12:42 UTC (rev 765)
@@ -33,6 +33,14 @@
tutti.validator.error.createMarineLitterBatch.marineLitterCategory.required
</message>
</field-validator>
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ marineLitterCategory == null || categoryAndSizeCategoryAvailable ]]>
+ </param>
+ <message>
+ tutti.validator.error.createMarineLitterBatch.categoryAndSizeCategory.notAvailable
+ </message>
+ </field-validator>
</field>
<field name="marineLitterSizeCategory">
@@ -41,6 +49,14 @@
tutti.validator.error.createMarineLitterBatch.marineLitterSizeCategory.required
</message>
</field-validator>
+ <field-validator type="fieldexpression" short-circuit="true">
+ <param name="expression">
+ <![CDATA[ marineLitterSizeCategory == null || categoryAndSizeCategoryAvailable ]]>
+ </param>
+ <message>
+ tutti.validator.error.createMarineLitterBatch.categoryAndSizeCategory.notAvailable
+ </message>
+ </field-validator>
</field>
<field name="number">
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-04-11 08:46:30 UTC (rev 764)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-04-11 11:12:42 UTC (rev 765)
@@ -1069,11 +1069,12 @@
tutti.update.jre=Java
tutti.update.tutti=Tutti
tutti.validator.error.comment.too.long=Taille de commentaire trop longue (limitée à %s caractères)
-tutti.validator.error.createIndividualObservationBatch.individualObservationSpecies.required=
-tutti.validator.error.createMarineLitterBatch.marineLitterCategory.required=
-tutti.validator.error.createMarineLitterBatch.marineLitterSizeCategory.required=
-tutti.validator.error.createMarineLitterBatch.number.invalidValue=
-tutti.validator.error.createMarineLitterBatch.number.required=
+tutti.validator.error.createIndividualObservationBatch.individualObservationSpecies.required=L'espèce est obligatoire
+tutti.validator.error.createMarineLitterBatch.categoryAndSizeCategory.notAvailable=Couple (catégorie de déchet - catégorie de taille) déjà utilisée
+tutti.validator.error.createMarineLitterBatch.marineLitterCategory.required=La catégorie de déchet est obligatoire
+tutti.validator.error.createMarineLitterBatch.marineLitterSizeCategory.required=La catégorie de taille est obligatoire
+tutti.validator.error.createMarineLitterBatch.number.invalidValue=Le nombre doit être strictement positif
+tutti.validator.error.createMarineLitterBatch.number.required=Le nombre est obligatoire
tutti.validator.error.createSpeciesBatch.batchWeight.invalidValue=Le poids du lot doit être strictement positif
tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required=La catégorie Vrac / Hors Vrac est obligatoire
tutti.validator.error.createSpeciesBatch.species.required=L'espèce est obligatoire
1
0
r764 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter
by kmorin@users.forge.codelutin.com 11 Apr '13
by kmorin@users.forge.codelutin.com 11 Apr '13
11 Apr '13
Author: kmorin
Date: 2013-04-11 10:46:30 +0200 (Thu, 11 Apr 2013)
New Revision: 764
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/764
Log:
fixes #2257 [MACRODECHET] - Impossible de saisir un poids total avec d?\195?\169cimales
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-04-11 08:40:56 UTC (rev 763)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.css 2013-04-11 08:46:30 UTC (rev 764)
@@ -55,7 +55,7 @@
property: marineLitterTotalWeight;
model: {model.getMarineLitterTotalWeight()};
useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ numberPattern: {DECIMAL3_PATTERN};
}
#tablePopup {
1
0
r763 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config
by kmorin@users.forge.codelutin.com 11 Apr '13
by kmorin@users.forge.codelutin.com 11 Apr '13
11 Apr '13
Author: kmorin
Date: 2013-04-11 10:40:56 +0200 (Thu, 11 Apr 2013)
New Revision: 763
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/763
Log:
fixes #2157 [ERGO] - Couleur d'erreur - Trouver une couleur moins agressive
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java 2013-04-10 16:53:38 UTC (rev 762)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java 2013-04-11 08:40:56 UTC (rev 763)
@@ -156,7 +156,7 @@
COLOR_ROW_INVALID(
"tutti.ui.color.rowInvalid",
n_("tutti.config.option.ui.color.rowInvalid.description"),
- new Color(255, 128, 128).toString(),
+ new Color(255, 204, 153).toString(),
Color.class
),
1
0
10 Apr '13
Author: kmorin
Date: 2013-04-10 18:53:38 +0200 (Wed, 10 Apr 2013)
New Revision: 762
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/762
Log:
fixes #2275 [PROTOCOLE] quand on clone un protocole, le focus doit etre mis sur le nouveau nom du protocole car c'est bien la premi?\195?\168re chose ?\195?\160 faire
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
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/accidental/AccidentalBatchUIHandler.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/create/CreateBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.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/individualobservation/IndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.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/CreateSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.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/fishing/AbstractCaracteristicTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
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/referential/ManageTemporaryReferentialUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java
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/attachment/AttachmentEditorUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/MainUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -213,6 +213,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return currentBody;
+ }
+
+ @Override
public void onCloseUI() {
// remove any screen
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/config/TuttiConfigUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -43,6 +43,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import javax.swing.table.TableCellEditor;
import java.awt.BorderLayout;
@@ -196,6 +197,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -42,6 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
@@ -221,6 +222,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getProgramComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -30,7 +30,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.SwingUtilities;
+import javax.swing.*;
import static org.nuiton.i18n.I18n._;
@@ -99,6 +99,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getUpgradeDbButton();
+ }
+
+ @Override
public void onCloseUI() {
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/home/SelectCruiseUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -38,9 +38,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.AbstractButton;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
+import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
@@ -229,6 +227,11 @@
ui.applyDataBinding(SelectCruiseUI.BINDING_VALIDATE_CATCHES_BUTTON_ENABLED);
}
+ @Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getEditCatchesButton();
+ }
+
protected boolean resetEditProtolAction;
public void resetEditProtolAction() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -54,9 +54,7 @@
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXDatePicker;
-import javax.swing.JButton;
-import javax.swing.JOptionPane;
-import javax.swing.JTabbedPane;
+import javax.swing.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
@@ -345,6 +343,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getStationNumberField();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -39,7 +39,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.swing.JTabbedPane;
+import javax.swing.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
@@ -185,6 +185,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
public void onCloseUI() {
// ui will be saved so we do not want to keep selected tab indexes
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -124,6 +124,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getCatchTotalWeightField();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
@@ -284,29 +289,27 @@
if (MAIN_CARD.equals(card)) {
registerValidators();
actionPanel.setVisible(true);
+
} else {
actionPanel.setVisible(false);
TuttiUI tuttiUi = null;
JXTitledPanel titlePanel = null;
- Component component2focus = null;
String title = "";
+
if (CREATE_BATCH_CARD.equals(card)) {
tuttiUi = ui.getSpeciesTabCreateBatch();
titlePanel = ui.getSpeciesTabCreateBatchReminderLabel();
title = n_("tutti.createSpeciesBatch.title");
- component2focus = ui.getSpeciesTabCreateBatch().getSpeciesComboBox();
} else if (SPLIT_BATCH_CARD.equals(card)) {
tuttiUi = ui.getSpeciesTabSplitBatch();
titlePanel = ui.getSpeciesTabSplitBatchReminderLabel();
title = n_("tutti.splitSpeciesBatch.title");
- component2focus = ui.getSpeciesTabSplitBatch().getCategoryComboBox();
} else if (EDIT_FREQUENCY_CARD.equals(card)) {
tuttiUi = ui.getSpeciesTabFrequencyEditor();
titlePanel = ui.getSpeciesTabFrequencyEditorReminderLabel();
title = n_("tutti.editSpeciesFrequencies.title");
- component2focus = ui.getSpeciesTabFrequencyEditor().getLengthStepCaracteristicComboBox();
}
if (tuttiUi != null) {
@@ -315,9 +318,6 @@
if (titlePanel != null) {
titlePanel.setTitle(ui.getSpeciesTabFishingOperationReminderLabel().getTitle() + " - " + _(title));
}
- if (component2focus != null) {
- component2focus.requestFocus();
- }
}
}
}
@@ -332,29 +332,27 @@
if (MAIN_CARD.equals(card)) {
registerValidators();
actionPanel.setVisible(true);
+
} else {
actionPanel.setVisible(false);
TuttiUI tuttiUi = null;
JXTitledPanel titlePanel = null;
- Component component2focus = null;
String title = "";
+
if (CREATE_BATCH_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabCreateBatch();
titlePanel = ui.getBenthosTabCreateBatchReminderLabel();
title = n_("tutti.createBenthosBatch.title");
- component2focus = ui.getBenthosTabCreateBatch().getSpeciesComboBox();
} else if (SPLIT_BATCH_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabSplitBatch();
titlePanel = ui.getBenthosTabSplitBatchReminderLabel();
title = n_("tutti.splitBenthosBatch.title");
- component2focus = ui.getBenthosTabSplitBatch().getCategoryComboBox();
} else if (EDIT_FREQUENCY_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabFrequencyEditor();
titlePanel = ui.getBenthosTabFrequencyEditorReminderLabel();
title = n_("tutti.editBenthosFrequencies.title");
- component2focus = ui.getBenthosTabFrequencyEditor().getLengthStepCaracteristicComboBox();
}
if (tuttiUi != null) {
@@ -363,9 +361,6 @@
if (titlePanel != null) {
titlePanel.setTitle(ui.getBenthosTabFishingOperationReminderLabel().getTitle() + " - " + _(title));
}
- if (component2focus != null) {
- component2focus.requestFocus();
- }
}
}
}
@@ -380,17 +375,17 @@
if (MAIN_CARD.equals(card)) {
registerValidators();
actionPanel.setVisible(true);
+
} else {
actionPanel.setVisible(false);
TuttiUI tuttiUi = null;
JXTitledPanel titlePanel = null;
- Component component2focus = null;
String title = "";
+
if (CREATE_BATCH_CARD.equals(card)) {
tuttiUi = ui.getMarineLitterTabCreateBatch();
titlePanel = ui.getMarineLitterTabCreateBatchReminderLabel();
title = n_("tutti.createMarineLitterBatch.title");
- component2focus = ui.getMarineLitterTabCreateBatch().getMarineLitterCategoryComboBox();
}
if (tuttiUi != null) {
@@ -399,9 +394,6 @@
if (titlePanel != null) {
titlePanel.setTitle(ui.getMarineLitterTabCreateBatchReminderLabel().getTitle() + " - " + _(title));
}
- if (component2focus != null) {
- component2focus.requestFocus();
- }
}
}
}
@@ -416,22 +408,21 @@
if (MAIN_CARD.equals(card)) {
registerValidators();
actionPanel.setVisible(true);
+
} else {
actionPanel.setVisible(false);
TuttiUI tuttiUi = null;
JXTitledPanel titlePanel = null;
- Component component2focus = null;
String title = "";
+
if (CREATE_BATCH_CARD.equals(card)) {
tuttiUi = ui.getIndividualObservationTabCreateBatch();
titlePanel = ui.getIndividualObservationTabCreateBatchReminderLabel();
title = n_("tutti.createIndividualObservationBatch.title");
- component2focus = ui.getIndividualObservationTabCreateBatch().getIndividualObservationSpeciesComboBox();
} else if (EDIT_CARACTERISTICS_CARD.equals(card)) {
titlePanel = ui.getIndividualObservationTabFishingOperationReminderLabel();
title = n_("tutti.editCaracteristics.title");
- component2focus = ui.getCaracteristicMapEditor().getNewRowKey();
}
if (tuttiUi != null) {
@@ -440,9 +431,6 @@
if (titlePanel != null) {
titlePanel.setTitle(ui.getIndividualObservationTabCreateBatchReminderLabel().getTitle() + " - " + _(title));
}
- if (component2focus != null) {
- component2focus.requestFocus();
- }
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -45,6 +45,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
+import javax.swing.*;
import java.util.List;
/**
@@ -264,6 +265,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -76,9 +76,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.JOptionPane;
-import javax.swing.RowFilter;
-import javax.swing.UIManager;
+import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel;
import java.awt.Color;
@@ -631,6 +629,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("Closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -45,6 +45,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -147,6 +148,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getSpeciesComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -49,7 +49,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.JTextField;
+import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
@@ -296,6 +296,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getLengthStepCaracteristicComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -46,8 +46,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
+import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -206,6 +205,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getCategoryComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -38,6 +38,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
+import javax.swing.*;
import java.awt.*;
import java.util.Collection;
import java.util.List;
@@ -356,6 +357,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/caracteristics/CaracteristicMapEditorUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -25,6 +25,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+import javax.swing.*;
import java.util.List;
import static fr.ifremer.tutti.ui.swing.content.operation.catches.individualobservation.caracteristics.CaracteristicMapCellComponent.CaracteristicMapCellEditor;
@@ -135,6 +136,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getNewRowKey();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/create/CreateIndividualObservationBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -17,6 +17,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.awt.*;
import java.util.List;
@@ -65,6 +66,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getIndividualObservationSpeciesComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -59,6 +59,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
+import javax.swing.*;
import java.awt.Color;
import java.awt.Component;
import java.util.Collection;
@@ -369,6 +370,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/create/CreateMarineLitterBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -42,6 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.awt.Dimension;
import java.util.List;
@@ -96,6 +97,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getMarineLitterCategoryComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/PlanktonBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -45,6 +45,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
+import javax.swing.*;
import java.util.List;
/**
@@ -270,6 +271,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -650,6 +650,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getTable();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("Closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -45,6 +45,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -147,6 +148,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getSpeciesComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -50,7 +50,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.JTextField;
+import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
@@ -297,6 +297,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getLengthStepCaracteristicComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -46,8 +46,7 @@
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
+import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
@@ -206,6 +205,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getCategoryComboBox();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/AbstractCaracteristicTabUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -42,6 +42,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.util.List;
/**
@@ -133,6 +134,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getKeyCombo();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + getUI());
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/program/EditProgramUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -33,6 +33,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
+
import static org.nuiton.i18n.I18n._;
/**
@@ -119,6 +121,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getNameField();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.jaxx 2013-04-10 16:53:38 UTC (rev 762)
@@ -82,7 +82,8 @@
<JMenuItem id='removeBenthosProtocolButton'/>
</JPopupMenu>
- <JTabbedPane constraints='BorderLayout.CENTER'>
+ <JTabbedPane id='tabPanel'
+ constraints='BorderLayout.CENTER'>
<tab title='tutti.editProtocol.tab.info'>
<Table id='protocolInfoForm' fill='both'>
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -60,9 +60,7 @@
import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.JComboBox;
-import javax.swing.JTabbedPane;
-import javax.swing.ListSelectionModel;
+import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
@@ -72,6 +70,9 @@
import javax.swing.table.TableColumnModel;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.event.ComponentEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collection;
@@ -476,6 +477,11 @@
dialog = new SelectSpeciesUI(ui);
}
+ @Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getNameField();
+ }
+
public List<EditProtocolSpeciesRowModel> toRows(List<SpeciesProtocol> speciesProtocols) {
BeanFilterableComboBox<Species> speciesComboBox = ui.getSpeciesComboBox();
Preconditions.checkNotNull(speciesComboBox.getData());
@@ -520,6 +526,7 @@
log.debug("closing: " + ui);
}
clearValidators();
+ ui.getTabPanel().setSelectedIndex(0);
}
@Override
@@ -650,9 +657,9 @@
ComboBoxCellEditor editor = new ComboBoxCellEditor(comboBox);
addColumnToModel(model,
- editor,
- newTableCellRender(decorator),
- EditProtocolSpeciesTableModel.LENGTH_STEP_PMFM_ID);
+ editor,
+ newTableCellRender(decorator),
+ EditProtocolSpeciesTableModel.LENGTH_STEP_PMFM_ID);
}
protected void initTable(JXTable table) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/referential/ManageTemporaryReferentialUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/referential/ManageTemporaryReferentialUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/referential/ManageTemporaryReferentialUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -68,6 +68,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -102,14 +102,7 @@
import java.awt.Font;
import java.awt.Frame;
import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
+import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
@@ -415,8 +408,22 @@
initScrollPane((JScrollPane) component);
}
}
+
+ ((Component)ui).addHierarchyListener(new HierarchyListener() {
+ @Override
+ public void hierarchyChanged(HierarchyEvent e) {
+ JComponent component = getComponentToFocus();
+ if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0
+ && e.getChanged() .isShowing()
+ && component != null) {
+ component.requestFocus();
+ }
+ }
+ });
}
+ protected abstract JComponent getComponentToFocus();
+
protected void initTextField(JTextField jTextField) {
Boolean computed = (Boolean) jTextField.getClientProperty("computed");
if (computed != null && computed) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/AbstractTuttiAction.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -162,47 +162,4 @@
return getDecorator(object.getClass(), context).toString(object);
}
- //FIXME-TC Is this working ?
- protected void test(final Runnable r) throws InterruptedException {
- SwingUtilities.invokeLater(new Runnable() {
-
- public void run() {
- System.out.println("run");
-// getContext().getActionUI().pause();
- r.run();
-// getContext().getActionUI().resume();
-
- System.out.println("Deblock ?");
- log.info("Deblock ?");
- unblock();
- }
- });
-
- log.info("Block ?");
- System.out.println("Block ?");
- block();
-
- System.out.println("Block !");
- log.info("Block !");
- }
-
- protected void block() {
- try {
- synchronized (this) {
- lock.wait();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected void unblock() {
- try {
- synchronized (this) {
- lock.notifyAll();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
}
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-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -33,6 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.awt.Container;
import java.awt.Cursor;
import java.beans.PropertyChangeEvent;
@@ -181,6 +182,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
public void onCloseUI() {
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/attachment/AttachmentEditorUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -157,6 +157,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getFile();
+ }
+
+ @Override
public void onCloseUI() {
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java 2013-04-10 15:17:14 UTC (rev 761)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/species/SelectSpeciesUIHandler.java 2013-04-10 16:53:38 UTC (rev 762)
@@ -33,6 +33,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import javax.swing.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -74,6 +75,11 @@
}
@Override
+ protected JComponent getComponentToFocus() {
+ return getUI().getSpeciesCombo();
+ }
+
+ @Override
public void onCloseUI() {
if (log.isDebugEnabled()) {
log.debug("closing: " + ui);
1
0
10 Apr '13
Author: kmorin
Date: 2013-04-10 17:17:14 +0200 (Wed, 10 Apr 2013)
New Revision: 761
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/761
Log:
fixes #2271 [ERGO] - Benthos et Esp?\195?\168ce : raccourci ?\195?\169l?\195?\169vation des poids Alt + E (avec accent)
Modified:
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
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-04-10 15:07:59 UTC (rev 760)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-04-10 15:17:14 UTC (rev 761)
@@ -320,7 +320,7 @@
tutti.editCatchBatch.action.computeWeights.error.incoherentSpeciesTotalSorted=Le poids total Vrac des espèces est inférieur à la somme des poids Vrac triés, inerte trié et vivant non détaillé trié
tutti.editCatchBatch.action.computeWeights.error.incoherentTotal=Le poids total de la capture ne correspond pas à la somme des poids totaux Vrac, Hors Vrac et non triés
tutti.editCatchBatch.action.computeWeights.error.noWeight=Un lot n'a pas de poids
-tutti.editCatchBatch.action.computeWeights.mnemonic=É
+tutti.editCatchBatch.action.computeWeights.mnemonic=p
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.help=Est-ce bien une valeur observée ?<ul><li><strong>Non</strong> pour remplacer la valeur saisie par le poids calculé</li><li><strong>Oui</strong> pour garder la valeur saisie</li></ul>.
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.message=Le Poids total VRAC saisi est supérieur de moins de %s%% au Poids total Vrac trié.
tutti.editCatchBatch.action.computeWeights.replaceTotalSortedWeight.title=Poids total VRAC peu différent du Poids total Vrac trié
1
0