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
September 2013
- 4 participants
- 100 discussions
r1238 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 22:48:15 +0200 (Thu, 26 Sep 2013)
New Revision: 1238
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1238
Log:
fixes #3327: [PROTOCOLE] tableau esp?\195?\168ces : impossible de s?\195?\169lectionner plusieurs lignes d'esp?\195?\168ces pour supprimer
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java 2013-09-26 20:27:36 UTC (rev 1237)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java 2013-09-26 20:48:15 UTC (rev 1238)
@@ -50,9 +50,9 @@
@Override
public void doAction() throws Exception {
- JTable table = handler.getSpeciesTable();
+ JTable table = handler.getBenthosTable();
- EditProtocolSpeciesTableModel tableModel = handler.getSpeciesTableModel();
+ EditProtocolSpeciesTableModel tableModel = handler.getBenthosTableModel();
int[] rowIndex = table.getSelectedRows();
1
0
r1237 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 22:27:36 +0200 (Thu, 26 Sep 2013)
New Revision: 1237
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1237
Log:
fixes #3327: [PROTOCOLE] tableau esp?\195?\168ces : impossible de s?\195?\169lectionner plusieurs lignes d'esp?\195?\168ces pour supprimer
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java 2013-09-26 20:24:48 UTC (rev 1236)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveBenthosProtocolAction.java 2013-09-26 20:27:36 UTC (rev 1237)
@@ -24,20 +24,19 @@
* #L%
*/
-import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
-import org.jdesktop.swingx.JXTable;
+import javax.swing.JTable;
import java.util.Collections;
import java.util.List;
import static org.nuiton.i18n.I18n._;
/**
- * To add a new species protocol.
+ * To remove all the selected benthos rows from protocol.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
@@ -51,15 +50,28 @@
@Override
public void doAction() throws Exception {
- JXTable table = handler.getBenthosTable();
+ JTable table = handler.getSpeciesTable();
- int rowIndex = table.getSelectedRow();
+ EditProtocolSpeciesTableModel tableModel = handler.getSpeciesTableModel();
- Preconditions.checkState(rowIndex != -1,
- "Cant remove benthos if no benthos selected");
+ int[] rowIndex = table.getSelectedRows();
- EditProtocolSpeciesTableModel tableModel = handler.getBenthosTableModel();
+ for (int i = rowIndex.length - 1; i > -1; i--) {
+ int index = rowIndex[i];
+ removeRow(tableModel, index);
+ }
+ EditProtocolUIModel model = getModel();
+
+ // reorder the list by name, otherwise,
+ // all the species without a reftax code will be at the end
+ Collections.sort(model.getAllSynonyms(), TuttiEntities.SPECIES_BY_NAME_COMPARATOR);
+
+ table.clearSelection();
+ }
+
+ protected void removeRow(EditProtocolSpeciesTableModel tableModel, int rowIndex) {
+
EditProtocolSpeciesRowModel selectedRow = tableModel.getEntry(rowIndex);
// re-add all synonym of this taxon to the species / benthos combobox
@@ -73,13 +85,8 @@
model.getAllSynonyms(String.valueOf(taxonId)));
allSynonyms.remove(species);
model.getAllSynonyms().addAll(allSynonyms);
- // reorder the list by name, otherwise,
- // all the species without a reftax code will be at the end
- Collections.sort(model.getAllSynonyms(), TuttiEntities.SPECIES_BY_NAME_COMPARATOR);
-
- table.clearSelection();
- // remove the row from the model(do it after treating the comboBox which can be long)
+ // remove the row from the model
tableModel.removeRow(rowIndex);
String speciesStr = decorate(selectedRow.getSpecies());
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java 2013-09-26 20:24:48 UTC (rev 1236)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java 2013-09-26 20:27:36 UTC (rev 1237)
@@ -36,7 +36,7 @@
import static org.nuiton.i18n.I18n._;
/**
- * To add a new species protocol.
+ * To remove all the selected species rows from protocol.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
1
0
r1236 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/protocol resources/i18n
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 22:24:48 +0200 (Thu, 26 Sep 2013)
New Revision: 1236
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1236
Log:
fixes #3327: [PROTOCOLE] tableau esp?\195?\168ces : impossible de s?\195?\169lectionner plusieurs lignes d'esp?\195?\168ces pour supprimer
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java
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/protocol/EditProtocolUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-26 19:44:44 UTC (rev 1235)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUI.css 2013-09-26 20:24:48 UTC (rev 1236)
@@ -89,7 +89,7 @@
}
#speciesTable {
- selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ /*selectionMode: {ListSelectionModel.SINGLE_SELECTION};*/
/*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
@@ -107,7 +107,7 @@
}
#benthosTable {
- selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+ /*selectionMode: {ListSelectionModel.SINGLE_SELECTION};*/
/*selectionBackground: {null};*/
selectionForeground: {Color.BLACK};
sortable: false;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-26 19:44:44 UTC (rev 1235)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-26 20:24:48 UTC (rev 1236)
@@ -332,12 +332,12 @@
@Override
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel source = (ListSelectionModel) e.getSource();
- ui.getRemoveSpeciesProtocolButton().setEnabled(
- !source.isSelectionEmpty());
+ getModel().setRemoveSpeciesEnabled(!source.isSelectionEmpty());
}
});
tableModel.setRows(speciesRows);
+ getModel().setRemoveSpeciesEnabled(false);
}
{
@@ -393,12 +393,12 @@
@Override
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel source = (ListSelectionModel) e.getSource();
- ui.getRemoveBenthosProtocolButton().setEnabled(
- !source.isSelectionEmpty());
+ getModel().setRemoveBenthosEnabled(!source.isSelectionEmpty());
}
});
tableModel.setRows(benthosRows);
+ getModel().setRemoveBenthosEnabled(false);
}
allDoubleLists = Lists.newArrayList(
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-26 19:44:44 UTC (rev 1235)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-26 20:24:48 UTC (rev 1236)
@@ -181,9 +181,8 @@
}
public void setRemoveSpeciesEnabled(boolean removeSpeciesEnabled) {
- Object oldValue = isRemoveSpeciesEnabled();
this.removeSpeciesEnabled = removeSpeciesEnabled;
- firePropertyChange(PROPERTY_REMOVE_SPECIES_ENABLED, oldValue, removeSpeciesEnabled);
+ firePropertyChange(PROPERTY_REMOVE_SPECIES_ENABLED, null, removeSpeciesEnabled);
}
public boolean isRemoveBenthosEnabled() {
@@ -191,9 +190,8 @@
}
public void setRemoveBenthosEnabled(boolean removeBenthosEnabled) {
- Object oldValue = isRemoveBenthosEnabled();
this.removeBenthosEnabled = removeBenthosEnabled;
- firePropertyChange(PROPERTY_REMOVE_BENTHOS_ENABLED, oldValue, removeBenthosEnabled);
+ firePropertyChange(PROPERTY_REMOVE_BENTHOS_ENABLED, null, removeBenthosEnabled);
}
public boolean isImported() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java 2013-09-26 19:44:44 UTC (rev 1235)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/RemoveSpeciesProtocolAction.java 2013-09-26 20:24:48 UTC (rev 1236)
@@ -24,7 +24,6 @@
* #L%
*/
-import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.referential.Species;
@@ -53,13 +52,26 @@
JTable table = handler.getSpeciesTable();
- int rowIndex = table.getSelectedRow();
+ EditProtocolSpeciesTableModel tableModel = handler.getSpeciesTableModel();
- Preconditions.checkState(rowIndex != -1,
- "Cant remove species if no species selected");
+ int[] rowIndex = table.getSelectedRows();
- EditProtocolSpeciesTableModel tableModel = handler.getSpeciesTableModel();
+ for (int i = rowIndex.length - 1; i > -1; i--) {
+ int index = rowIndex[i];
+ removeRow(tableModel, index);
+ }
+ EditProtocolUIModel model = getModel();
+
+ // reorder the list by name, otherwise,
+ // all the species without a reftax code will be at the end
+ Collections.sort(model.getAllSynonyms(), TuttiEntities.SPECIES_BY_NAME_COMPARATOR);
+
+ table.clearSelection();
+ }
+
+ protected void removeRow(EditProtocolSpeciesTableModel tableModel, int rowIndex) {
+
EditProtocolSpeciesRowModel selectedRow = tableModel.getEntry(rowIndex);
// re-add all synonym of this taxon to the species / benthos combobox
@@ -73,12 +85,8 @@
model.getAllSynonyms(String.valueOf(taxonId)));
allSynonyms.remove(species);
model.getAllSynonyms().addAll(allSynonyms);
- // reorder the list by name, otherwise,
- // all the species without a reftax code will be at the end
- Collections.sort(model.getAllSynonyms(), TuttiEntities.SPECIES_BY_NAME_COMPARATOR);
- table.clearSelection();
- // remove the row from the model(do it after treating the comboBox which can be long)
+ // remove the row from the model
tableModel.removeRow(rowIndex);
String speciesStr = decorate(selectedRow.getSpecies());
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-26 19:44:44 UTC (rev 1235)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-26 20:24:48 UTC (rev 1236)
@@ -809,12 +809,12 @@
tutti.editProtocol.action.importProtocolSpecies=Importer les espèces
tutti.editProtocol.action.importProtocolSpecies.mnemonic=é
tutti.editProtocol.action.importProtocolSpecies.tip=Importer les espèces dans le protocole
-tutti.editProtocol.action.removeBenthosProtocol=Supprimer le benthos
+tutti.editProtocol.action.removeBenthosProtocol=Supprimer les benthos
tutti.editProtocol.action.removeBenthosProtocol.mnemonic=S
-tutti.editProtocol.action.removeBenthosProtocol.tip=Supprimer le benthos
-tutti.editProtocol.action.removeSpeciesProtocol=Supprimer l'espèce
+tutti.editProtocol.action.removeBenthosProtocol.tip=Supprimer les benthos sélectionnés
+tutti.editProtocol.action.removeSpeciesProtocol=Supprimer les espèces
tutti.editProtocol.action.removeSpeciesProtocol.mnemonic=S
-tutti.editProtocol.action.removeSpeciesProtocol.tip=Supprimer l'espèce
+tutti.editProtocol.action.removeSpeciesProtocol.tip=Supprimer les espèces sélectionnées
tutti.editProtocol.action.saveProtocol=Enregistrer
tutti.editProtocol.action.saveProtocol.mnemonic=E
tutti.editProtocol.action.saveProtocol.tip=Enregistrer le protocole
1
0
r1235 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 21:44:44 +0200 (Thu, 26 Sep 2013)
New Revision: 1235
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1235
Log:
fixes #3325: [PROTOCOLE] Gestion des caract?\195?\169ristiques "Classe de taille" sur les imports de protocole
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/EditProtocolUIModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-26 18:37:15 UTC (rev 1234)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-09-26 19:44:44 UTC (rev 1235)
@@ -483,6 +483,8 @@
Map<String, Species> allReferentSpeciesByTaxonId = model.getAllReferentSpeciesByTaxonId();
Map<String, Caracteristic> allCaracteristic = model.getAllCaracteristic();
+ List<Caracteristic> lengthClassesPmfmId = Lists.newArrayList();
+
List<EditProtocolSpeciesRowModel> result = Lists.newArrayList();
if (CollectionUtils.isNotEmpty(speciesProtocols)) {
for (SpeciesProtocol speciesProtocol : speciesProtocols) {
@@ -502,7 +504,16 @@
EditProtocolSpeciesRowModel row = EditProtocolSpeciesTableModel.newRow(sampleCategoryModel);
row.setSpecies(species);
- row.setLengthStepPmfm(allCaracteristic.get(speciesProtocol.getLengthStepPmfmId()));
+ String lengthStepPmfmId = speciesProtocol.getLengthStepPmfmId();
+
+ Caracteristic lengthStepPmfm = allCaracteristic.get(lengthStepPmfmId);
+ if (lengthStepPmfmId != null && !model.containsLengthClassesPmfmId(lengthStepPmfmId)) {
+ if (log.isInfoEnabled()) {
+ log.info("Found a new lengthStep pmfm: " + lengthStepPmfmId);
+ }
+ lengthClassesPmfmId.add(lengthStepPmfm);
+ }
+ row.setLengthStepPmfm(lengthStepPmfm);
row.fromBean(speciesProtocol);
// make sure to get a clean copy of the list
@@ -510,6 +521,17 @@
result.add(row);
}
}
+
+ if (CollectionUtils.isNotEmpty(lengthClassesPmfmId)) {
+ // detect some new length step pmfp to add in protocol
+
+ // add it to model
+ model.addAllLengthClassesPmfmId(TuttiEntities.collecIds(lengthClassesPmfmId));
+
+ // add it to ui (no binding here, must do it manually)
+ BeanDoubleList<Caracteristic> lengthClassesList = ui.getLengthClassesList();
+ lengthClassesList.getModel().addToSelected(lengthClassesPmfmId);
+ }
return result;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-26 18:37:15 UTC (rev 1234)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIModel.java 2013-09-26 19:44:44 UTC (rev 1235)
@@ -137,7 +137,7 @@
}
public void setLengthClassesPmfm(List<Caracteristic> lengthClassesPmfm) {
- List<String> ids = TuttiEntities.collecIds(lengthClassesPmfm);
+ List<String> ids = Lists.newArrayList(TuttiEntities.collecIds(lengthClassesPmfm));
setLengthClassesPmfmId(ids);
}
@@ -357,174 +357,192 @@
@Override
public String getGearUseFeaturePmfmId(int index) {
- return null;
+ return editObject.getGearUseFeaturePmfmId(index);
}
@Override
public boolean isGearUseFeaturePmfmIdEmpty() {
- return false;
+ return editObject.isGearUseFeaturePmfmIdEmpty();
}
@Override
public int sizeGearUseFeaturePmfmId() {
- return 0;
+ return editObject.sizeGearUseFeaturePmfmId();
}
@Override
public void addGearUseFeaturePmfmId(String gearUseFeaturePmfmId) {
+ editObject.addGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public void addAllGearUseFeaturePmfmId(Collection<String> gearUseFeaturePmfmId) {
+ editObject.addAllGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public boolean removeGearUseFeaturePmfmId(String gearUseFeaturePmfmId) {
- return false;
+ return editObject.removeGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public boolean removeAllGearUseFeaturePmfmId(Collection<String> gearUseFeaturePmfmId) {
- return false;
+ return editObject.removeAllGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public boolean containsGearUseFeaturePmfmId(String gearUseFeaturePmfmId) {
- return false;
+ return editObject.containsGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public boolean containsAllGearUseFeaturePmfmId(Collection<String> gearUseFeaturePmfmId) {
- return false;
+ return editObject.containsAllGearUseFeaturePmfmId(gearUseFeaturePmfmId);
}
@Override
public String getVesselUseFeaturePmfmId(int index) {
- return null;
+ return editObject.getVesselUseFeaturePmfmId(index);
}
@Override
public boolean isVesselUseFeaturePmfmIdEmpty() {
- return false;
+ return editObject.isVesselUseFeaturePmfmIdEmpty();
}
@Override
public int sizeVesselUseFeaturePmfmId() {
- return 0;
+ return editObject.sizeVesselUseFeaturePmfmId();
}
@Override
public void addVesselUseFeaturePmfmId(String vesselUseFeaturePmfmId) {
+ editObject.addVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public void addAllVesselUseFeaturePmfmId(Collection<String> vesselUseFeaturePmfmId) {
+ editObject.addAllVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public boolean removeVesselUseFeaturePmfmId(String vesselUseFeaturePmfmId) {
- return false;
+ return editObject.removeVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public boolean removeAllVesselUseFeaturePmfmId(Collection<String> vesselUseFeaturePmfmId) {
- return false;
+ return editObject.removeAllVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public boolean containsVesselUseFeaturePmfmId(String vesselUseFeaturePmfmId) {
- return false;
+ return editObject.containsVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public boolean containsAllVesselUseFeaturePmfmId(Collection<String> vesselUseFeaturePmfmId) {
- return false;
+ return editObject.containsAllVesselUseFeaturePmfmId(vesselUseFeaturePmfmId);
}
@Override
public String getIndividualObservationPmfmId(int index) {
- return null;
+ return editObject.getIndividualObservationPmfmId(index);
}
@Override
public boolean isIndividualObservationPmfmIdEmpty() {
- return false;
+ return editObject.isIndividualObservationPmfmIdEmpty();
}
@Override
public int sizeIndividualObservationPmfmId() {
- return 0;
+ return editObject.sizeIndividualObservationPmfmId();
}
@Override
public void addIndividualObservationPmfmId(String individualObservationPmfmId) {
+ editObject.addIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public void addAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
+ editObject.addAllIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public boolean removeIndividualObservationPmfmId(String individualObservationPmfmId) {
- return false;
+ return editObject.removeIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public boolean removeAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
- return false;
+ return editObject.removeAllIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public boolean containsIndividualObservationPmfmId(String individualObservationPmfmId) {
- return false;
+ return editObject.containsIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public boolean containsAllIndividualObservationPmfmId(Collection<String> individualObservationPmfmId) {
- return false;
+ return editObject.containsAllIndividualObservationPmfmId(individualObservationPmfmId);
}
@Override
public String getLengthClassesPmfmId(int index) {
- return null;
+ return editObject.getLengthClassesPmfmId(index);
}
@Override
public boolean isLengthClassesPmfmIdEmpty() {
- return false;
+ return editObject.isLengthClassesPmfmIdEmpty();
}
@Override
public int sizeLengthClassesPmfmId() {
- return 0;
+ return editObject.sizeLengthClassesPmfmId();
}
@Override
public void addLengthClassesPmfmId(String lengthClassesPmfmId) {
+ editObject.addLengthClassesPmfmId(lengthClassesPmfmId);
+ // force to always propagates (need to recompte data of combobox in species table)
+ firePropertyChange(PROPERTY_LENGTH_CLASSES_PMFM_ID, null, getLengthClassesPmfmId());
}
@Override
public void addAllLengthClassesPmfmId(Collection<String> lengthClassesPmfmId) {
+ editObject.addAllLengthClassesPmfmId(lengthClassesPmfmId);
+ // force to always propagates (need to recompte data of combobox in species table)
+ firePropertyChange(PROPERTY_LENGTH_CLASSES_PMFM_ID, null, getLengthClassesPmfmId());
}
@Override
public boolean removeLengthClassesPmfmId(String lengthClassesPmfmId) {
- return false;
+ boolean result = editObject.removeLengthClassesPmfmId(lengthClassesPmfmId);
+ // force to always propagates (need to recompte data of combobox in species table)
+ firePropertyChange(PROPERTY_LENGTH_CLASSES_PMFM_ID, null, getLengthClassesPmfmId());
+ return result;
}
@Override
public boolean removeAllLengthClassesPmfmId(Collection<String> lengthClassesPmfmId) {
- return false;
+ boolean result = editObject.removeAllLengthClassesPmfmId(lengthClassesPmfmId);
+ // force to always propagates (need to recompte data of combobox in species table)
+ firePropertyChange(PROPERTY_LENGTH_CLASSES_PMFM_ID, null, getLengthClassesPmfmId());
+ return result;
}
@Override
public boolean containsLengthClassesPmfmId(String lengthClassesPmfmId) {
- return false;
+ return editObject.containsLengthClassesPmfmId(lengthClassesPmfmId);
}
@Override
public boolean containsAllLengthClassesPmfmId(Collection<String> lengthClassesPmfmId) {
- return false;
+ return editObject.containsAllLengthClassesPmfmId(lengthClassesPmfmId);
}
@Override
@@ -534,101 +552,107 @@
@Override
public boolean isSpeciesEmpty() {
- return false;
+ return editObject.isSpeciesEmpty();
}
@Override
public int sizeSpecies() {
- return 0;
+ return editObject.sizeSpecies();
}
@Override
public void addSpecies(SpeciesProtocol species) {
+ editObject.addSpecies(species);
}
@Override
public void addAllSpecies(Collection<SpeciesProtocol> species) {
+ editObject.addAllSpecies(species);
}
@Override
public boolean removeSpecies(SpeciesProtocol species) {
- return false;
+ return editObject.removeSpecies(species);
}
@Override
public boolean removeAllSpecies(Collection<SpeciesProtocol> species) {
- return false;
+ return editObject.removeAllSpecies(species);
}
@Override
public boolean containsSpecies(SpeciesProtocol species) {
- return false;
+ return editObject.containsSpecies(species);
}
@Override
public boolean containsAllSpecies(Collection<SpeciesProtocol> species) {
- return false;
+ return editObject.containsAllSpecies(species);
}
@Override
public List<SpeciesProtocol> getSpecies() {
- return null;
+ return editObject.getSpecies();
}
@Override
public void setSpecies(List<SpeciesProtocol> species) {
+ editObject.setSpecies(species);
}
@Override
public SpeciesProtocol getBenthos(int index) {
- return null;
+ return editObject.getBenthos(index);
}
@Override
public boolean isBenthosEmpty() {
- return false;
+ return editObject.isBenthosEmpty();
}
@Override
public int sizeBenthos() {
- return 0;
+ return editObject.sizeBenthos();
}
@Override
public void addBenthos(SpeciesProtocol benthos) {
+ editObject.addBenthos(benthos);
}
@Override
public void addAllBenthos(Collection<SpeciesProtocol> benthos) {
+ editObject.addAllBenthos(benthos);
}
@Override
public boolean removeBenthos(SpeciesProtocol benthos) {
- return false;
+ return editObject.removeBenthos(benthos);
}
@Override
public boolean removeAllBenthos(Collection<SpeciesProtocol> benthos) {
- return false;
+ return editObject.removeAllBenthos(benthos);
}
@Override
public boolean containsBenthos(SpeciesProtocol benthos) {
- return false;
+ return editObject.containsBenthos(benthos);
}
@Override
public boolean containsAllBenthos(Collection<SpeciesProtocol> benthos) {
- return false;
+ return editObject.containsAllBenthos(benthos);
}
@Override
public List<SpeciesProtocol> getBenthos() {
- return null;
+ return editObject.getBenthos();
}
@Override
public void setBenthos(List<SpeciesProtocol> benthos) {
+ editObject.setBenthos(benthos);
}
@Override
1
0
r1234 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service/export test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 20:37:15 +0200 (Thu, 26 Sep 2013)
New Revision: 1234
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1234
Log:
refs #3314: [EXPORT GENERIQUE] erreur ?\195?\160 l'export si pas d'engin affect?\195?\169 sur l'op?\195?\169ration (use empty cell when no gear)
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/AccidentalCatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/MarineLitterExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/AccidentalCatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/AccidentalCatchExportModel.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/AccidentalCatchExportModel.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -32,7 +32,6 @@
import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.Gear;
import fr.ifremer.tutti.persistence.entities.referential.Species;
-import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiCsvUtil;
import org.apache.commons.collections.CollectionUtils;
@@ -74,7 +73,7 @@
newColumnForExport("Annee", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.YEAR);
newColumnForExport("Serie", Cruise.PROPERTY_PROGRAM, Program.PROPERTY_NAME);
newColumnForExport("Serie_Partielle", Cruise.PROPERTY_SURVEY_PART);
- newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME, "?");
+ newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Id_Operation", FishingOperation.PROPERTY_STATION_NUMBER);
newColumnForExport("NumOrdre_Station", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -67,7 +67,7 @@
newColumnForExport("Annee", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.YEAR);
newColumnForExport("Serie", Cruise.PROPERTY_PROGRAM, Program.PROPERTY_NAME);
newColumnForExport("Serie_Partielle", Cruise.PROPERTY_SURVEY_PART);
- newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME, "?");
+ newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Id_Operation", FishingOperation.PROPERTY_STATION_NUMBER);
newColumnForExport("NumOrdre_Station", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/IndividualObservationExportModel.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -73,7 +73,7 @@
newColumnForExport("Annee", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.YEAR);
newColumnForExport("Serie", Cruise.PROPERTY_PROGRAM, Program.PROPERTY_NAME);
newColumnForExport("Serie_Partielle", Cruise.PROPERTY_SURVEY_PART);
- newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME, "?");
+ newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Id_Operation", FishingOperation.PROPERTY_STATION_NUMBER);
newColumnForExport("NumOrdre_Station", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/MarineLitterExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/MarineLitterExportModel.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/MarineLitterExportModel.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -51,7 +51,7 @@
newColumnForExport("Annee", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.YEAR);
newColumnForExport("Serie", Cruise.PROPERTY_PROGRAM, Program.PROPERTY_NAME);
newColumnForExport("Serie_Partielle", Cruise.PROPERTY_SURVEY_PART);
- newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME, "?");
+ newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Id_Operation", FishingOperation.PROPERTY_STATION_NUMBER);
newColumnForExport("NumOrdre_Station", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -65,7 +65,7 @@
newColumnForExport("Numero_Trait", FishingOperation.PROPERTY_FISHING_OPERATION_NUMBER, TuttiCsvUtil.INTEGER);
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
- newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME, "?");
+ newNullableColumnForExport("Engin", FishingOperation.PROPERTY_GEAR + "." + Gear.PROPERTY_NAME);
newColumnForExport("Navire", FishingOperation.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_VALUE_FORMATTER);
newColumnForExport("DateDeb_Op", FishingOperation.PROPERTY_GEAR_SHOOTING_START_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("LatDeb", FishingOperation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, TuttiCsvUtil.FLOAT);
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -171,7 +171,7 @@
"de\n" +
"ligne\n" +
"...\";1000.0;Y;180.0;Y;20.0;Y;800.0;N;;?;;?;200.0;Y;180.0;Y;180.0;Y;20.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;\n" +
- "2013;test elevation;1;C;3;1;?;278970;25/09/2013 00:00:00;;;25/09/2013 00:00:00;;;00;NA;NA;NA;?;N;;NA;NA;NA;;;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;");
+ "2013;test elevation;1;C;3;1;;278970;25/09/2013 00:00:00;;;25/09/2013 00:00:00;;;00;NA;NA;NA;?;N;;NA;NA;NA;;;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;");
}
@@ -222,9 +222,9 @@
"2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
"2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
"2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-horsvrac-20;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;1.0;\n" +
- "2013;test elevation;1;?;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;UNK - Indéterminé;1;30.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;30.0;0.0;\n" +
- "2013;test elevation;1;?;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Mâle;2;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;0.0;\n" +
- "2013;test elevation;1;?;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Femelle;3;;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;;1.0;");
+ "2013;test elevation;1;;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;UNK - Indéterminé;1;30.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;30.0;0.0;\n" +
+ "2013;test elevation;1;;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Mâle;2;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;0.0;\n" +
+ "2013;test elevation;1;;C;3;1;278970;11183;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Femelle;3;;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;;1.0;");
}
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-09-26 18:25:38 UTC (rev 1233)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-09-26 18:37:15 UTC (rev 1234)
@@ -81,7 +81,7 @@
public static final String OPERATION_WITH_NO_CATCH_CONTENT_AND_NO_GEAR =
"Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
- "2010;Campagne CGFS;;65;65;1;?;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;NA;NA;NA;;avarie - chalut annulé completement à poil;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;";
+ "2010;Campagne CGFS;;65;65;1;;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;NA;NA;NA;;avarie - chalut annulé completement à poil;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;";
public static final String OPERATION_CONTENT =
"Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/1021/changes>
Changes:
[Tony Chemit] fixes #3316: [ESPECES] Catégorisation des lots : on ne peut plus ajouter une catégorie une fois la catégorisation effectuée
------------------------------------------
[...truncated 471 lines...]
2013-09-26 19:41:36,589 2433 [main] INFO org.nuiton.util.converter.ConverterUtil - register converter org.nuiton.util.converter.VersionConverter@4d351f9b
2013-09-26 19:41:36,589 2433 [main] INFO org.nuiton.util.converter.ConverterUtil - register converter org.nuiton.util.converter.LocaleConverter@1567904d
2013-09-26 19:41:36,590 2434 [main] INFO org.nuiton.config.ApplicationConfig - Loading configuration file (classpath) : <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/target/test-c…>
2013-09-26 19:41:36,590 2434 [main] WARN fr.ifremer.tutti.persistence.test.DatabaseResource - Could not find db at <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/src/test/dbEx…,> test [class fr.ifremer.tutti.service.export.TuttiExportService2Test] is skipped.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0 sec - in fr.ifremer.tutti.service.export.TuttiExportService2Test
Results :
Tests run: 19, Failures: 0, Errors: 0, Skipped: 10
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ tutti-service ---
[INFO] Building jar: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/target/tutti-…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ tutti-service ---
[INFO]
[INFO] --- maven-install-plugin:2.5:install (default-install) @ tutti-service ---
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/target/tutti-…> to /var/local/maven/data/repository/fr/ifremer/tutti/tutti-service/2.6-SNAPSHOT/tutti-service-2.6-SNAPSHOT.jar
[INFO] Installing <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/maven/data/repository/fr/ifremer/tutti/tutti-service/2.6-SNAPSHOT/tutti-service-2.6-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: UI 2.6-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 10.3 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma… (2 KB at 3.7 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.… (808 B at 22.5 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-… (808 B at 4.4 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-… (18 KB at 448.7 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 48.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru… (2 KB at 7.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 50.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 9.0 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 43.8 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi… (2 KB at 8.8 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 50.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va… (2 KB at 10.2 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-ui-swing ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-ui-swing ---
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.27-SNAPSHOT:generate (default) @ tutti-ui-swing ---
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 45.3 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 8.0 KB/sec)
[INFO] use project compile scope class-path
[INFO] Detects 41 modified jaxx file(s).
[WARNING] JAXX detects 2 warnings :
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>
jaxx supports i18n, no need to add explicit call to I18n._ for attribute 'title' in component 'dialog' : [_("tutti.createSpeciesMelag.title", weightUnit.getShortLabel())]
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>
jaxx supports i18n, no need to add explicit call to I18n._ for attribute 'text' in component 'message' : [_("tutti.createSpeciesMelag.message", weightUnit.getShortLabel())]
[INFO] Generated 41 file(s) in 9.407s
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.27-SNAPSHOT:generate-help-ids (default) @ tutti-ui-swing ---
[INFO] Store detected help ids to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO] Merge help ids to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO] Use input file: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/fil…>
[INFO] No keys to add.
[INFO] Use input file: <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/fil…>
[INFO] No keys to add.
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserJava (scan-sources) @ tutti-ui-swing ---
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserValidation (scan-sources) @ tutti-ui-swing ---
[INFO] Load rules file validation.rules
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:get (get) @ tutti-ui-swing ---
[INFO] Copying tutti-ui-swing.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO] Copying tutti-ui-swing.properties to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:gen (scan-sources) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 13/1446 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 1433/1444 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:collect-i18n-artifacts (collect-i18n-artifacts) @ tutti-ui-swing ---
[INFO] collected 10 i18n artifacts for locale fr_FR stored in <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/i18n/…>
[INFO] collected 10 i18n artifacts for locale en_GB stored in <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/i18n/…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:bundle (make-bundle) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 22/1893 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 1708/1888 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- license-maven-plugin:1.5:update-project-license (attach-licenses) @ tutti-ui-swing ---
[INFO]
[INFO] --- license-maven-plugin:1.5:add-third-party (attach-licenses) @ tutti-ui-swing ---
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/andromda-c…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/andro…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/andromda-u…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/andro…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/metafacade…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/metaf…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/translatio…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/trans…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/translatio…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/trans…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
[WARNING] No license name defined for org.hibernate.javax.persistence--hibernate-jpa-2.0-api--1.0.1.Final
[INFO] Load missing file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/license/…>
[INFO] Missing file <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/license/…> is up-to-date.
[INFO] Writing third-party file to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO] Writing bundled third-party file to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/gener…>
[INFO] Will attach third party file from <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/license/…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 94 resources
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tutti-ui-swing ---
[INFO] Compiling 329 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/class…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[276,44] getSelectedValues() in javax.swing.JList has been deprecated
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>: Recompile with -Xlint:unchecked for details.
[INFO] 4 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[544,34] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[1061,30] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[1192,48] cannot find symbol
symbol: method indexOf(fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry)
location: variable sampleCategoryModel of type fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[547,34] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[1063,30] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[1194,48] cannot find symbol
symbol: method indexOf(fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry)
location: variable sampleCategoryModel of type fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [2.227s]
[INFO] Tutti :: Persistence .............................. SUCCESS [7.638s]
[INFO] Tutti :: Service .................................. SUCCESS [4.615s]
[INFO] Tutti :: UI ....................................... FAILURE [17.583s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.785s
[INFO] Finished at: Thu Sep 26 19:41:54 CEST 2013
[INFO] Final Memory: 68M/206M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-service/2.6-SNAPSHOT/tutti-service-2.6-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/target/tutti-…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-service/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-service/2.6-SNAPSHOT/tutti-service-2.6-SNAPSHOT.jar
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-ui-swing/2.6-SNAPSHOT/tutti-ui-swing-2.6-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/license/…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-ui-swing/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-ui-swing/2.6-SNAPSHOT/tutti-ui-swing-2.6-SNAPSHOT-third-party.properties
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-09-26_19-41-19/archive/fr.ifremer/tutti/2.6-SNAPSHOT/tutti-2.6-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-2.6-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-09-26_19-41-19/archive/fr.ifremer/tutti/2.6-SNAPSHOT/tutti-2.6-SNAPSHOT-site_fr.xml
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-persistence/2.6-SNAPSHOT/tutti-persistence-2.6-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/target/tu…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer.tutti$tutti-persistence/builds/2013-09-26_19-41-19/archive/fr.ifremer.tutti/tutti-persistence/2.6-SNAPSHOT/tutti-persistence-2.6-SNAPSHOT.jar
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project tutti-ui-swing: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project tutti-ui-swing: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:174)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 26 more
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
channel stopped
1
1
26 Sep '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/1021…>
Changes:
[Tony Chemit] fixes #3316: [ESPECES] Catégorisation des lots : on ne peut plus ajouter une catégorie une fois la catégorisation effectuée
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: UI 2.6-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 10.3 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma… (2 KB at 3.7 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.… (808 B at 22.5 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-… (808 B at 4.4 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.27-… (18 KB at 448.7 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 48.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru… (2 KB at 7.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 50.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 9.0 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 43.8 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi… (2 KB at 8.8 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 50.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va… (2 KB at 10.2 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-ui-swing ---
[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ tutti-ui-swing ---
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.27-SNAPSHOT:generate (default) @ tutti-ui-swing ---
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 45.3 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 8.0 KB/sec)
[INFO] use project compile scope class-path
[INFO] Detects 41 modified jaxx file(s).
[WARNING] JAXX detects 2 warnings :
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
jaxx supports i18n, no need to add explicit call to I18n._ for attribute 'title' in component 'dialog' : [_("tutti.createSpeciesMelag.title", weightUnit.getShortLabel())]
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
jaxx supports i18n, no need to add explicit call to I18n._ for attribute 'text' in component 'message' : [_("tutti.createSpeciesMelag.message", weightUnit.getShortLabel())]
[INFO] Generated 41 file(s) in 9.407s
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.27-SNAPSHOT:generate-help-ids (default) @ tutti-ui-swing ---
[INFO] Store detected help ids to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] Merge help ids to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] Use input file: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
[INFO] No keys to add.
[INFO] Use input file: <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
[INFO] No keys to add.
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserJava (scan-sources) @ tutti-ui-swing ---
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserValidation (scan-sources) @ tutti-ui-swing ---
[INFO] Load rules file validation.rules
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:get (get) @ tutti-ui-swing ---
[INFO] Copying tutti-ui-swing.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] Copying tutti-ui-swing.properties to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:gen (scan-sources) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 13/1446 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 1433/1444 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:collect-i18n-artifacts (collect-i18n-artifacts) @ tutti-ui-swing ---
[INFO] collected 10 i18n artifacts for locale fr_FR stored in <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] collected 10 i18n artifacts for locale en_GB stored in <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:bundle (make-bundle) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 22/1893 empty entries! (use -Di18n.showEmpty to see these entries)
[WARNING] bundle en_GB contains 1708/1888 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO]
[INFO] --- license-maven-plugin:1.5:update-project-license (attach-licenses) @ tutti-ui-swing ---
[INFO]
[INFO] --- license-maven-plugin:1.5:add-third-party (attach-licenses) @ tutti-ui-swing ---
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/profiles/e…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/profi…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/andromda-c…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/andro…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/andromda-u…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/andro…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/metafacade…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/metaf…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/translatio…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/trans…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/translatio…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/trans…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/andromda/cartridges…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/andromda/cartr…
[WARNING] No license name defined for org.hibernate.javax.persistence--hibernate-jpa-2.0-api--1.0.1.Final
[INFO] Load missing file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
[INFO] Missing file <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…> is up-to-date.
[INFO] Writing third-party file to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] Writing bundled third-party file to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] Will attach third party file from <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 94 resources
[INFO] Copying 4 resources
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tutti-ui-swing ---
[INFO] Compiling 329 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[276,44] getSelectedValues() in javax.swing.JList has been deprecated
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>: Recompile with -Xlint:unchecked for details.
[INFO] 4 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[544,34] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[1061,30] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[1192,48] cannot find symbol
symbol: method indexOf(fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry)
location: variable sampleCategoryModel of type fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[547,34] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[1063,30] cannot find symbol
symbol: method removeQualitativeValue(java.util.List<fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue>,java.lang.Integer)
location: class fr.ifremer.tutti.persistence.entities.TuttiEntities
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[1194,48] cannot find symbol
symbol: method indexOf(fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry)
location: variable sampleCategoryModel of type fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel
[INFO] 6 errors
[INFO] -------------------------------------------------------------
1
1
r1233 - in trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities: . data
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 20:25:38 +0200 (Thu, 26 Sep 2013)
New Revision: 1233
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1233
Log:
add useful methos
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModel.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-09-26 17:29:01 UTC (rev 1232)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/TuttiEntities.java 2013-09-26 18:25:38 UTC (rev 1233)
@@ -55,6 +55,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -313,6 +314,18 @@
return result;
}
+ public static void removeQualitativeValue(Collection<CaracteristicQualitativeValue> values,
+ int id) {
+ Iterator<CaracteristicQualitativeValue> iterator = values.iterator();
+ while (iterator.hasNext()) {
+ CaracteristicQualitativeValue next = iterator.next();
+ if (id == next.getIdAsInt()) {
+ iterator.remove();
+ break;
+ }
+ }
+ }
+
protected static class IdPredicate<B extends TuttiEntity> implements Predicate<B> {
private final String id;
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModel.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModel.java 2013-09-26 17:29:01 UTC (rev 1232)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModel.java 2013-09-26 18:25:38 UTC (rev 1233)
@@ -124,4 +124,8 @@
public boolean containsCategoryId(Integer id) {
return samplingOrder.contains(id);
}
+
+ public int indexOf(SampleCategoryModelEntry sampleCategoryDef) {
+ return category.indexOf(sampleCategoryDef);
+ }
}
1
0
26 Sep '13
Author: tchemit
Date: 2013-09-26 19:29:01 +0200 (Thu, 26 Sep 2013)
New Revision: 1232
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1232
Log:
fixes #3316: [ESPECES] Cat?\195?\169gorisation des lots : on ne peut plus ajouter une cat?\195?\169gorie une fois la cat?\195?\169gorisation effectu?\195?\169e
Modified:
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/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/SampleCategoryAble.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
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/BenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.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/split/SplitBenthosBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
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/SpeciesBatchUIModel.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/split/SplitSpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties 2013-09-26 17:29:01 UTC (rev 1232)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Sep 24 18:46:35 CEST 2013
+#Thu Sep 26 18:46:04 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -68,6 +68,7 @@
tutti.editAccidentalBatch.action.importMultiPost.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.editAccidentalBatch.action.removeBatch.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.editAccidentalBatch.help=editFishingOperation.html\#captureCapturesAccidentelles
+tutti.editBenthosBatch.action.addSampleCategory.help=
tutti.editBenthosBatch.action.changeSampleCategory.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosBatch.action.createBatch.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosBatch.action.createMelag.help=editFishingOperation.html\#captureBenthosActions
@@ -232,6 +233,7 @@
tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.help=editSampleCategory.html
+tutti.editSpeciesBatch.action.addSampleCategory.help=
tutti.editSpeciesBatch.action.changeSampleCategory.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties 2013-09-26 17:29:01 UTC (rev 1232)
@@ -1,5 +1,5 @@
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Tue Sep 24 18:46:35 CEST 2013
+#Thu Sep 26 18:46:04 CEST 2013
tutti.config.help=config.html
tutti.createAccidentalBatch.action.cancel.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.createAccidentalBatch.action.saveAndClose.help=editFishingOperation.html\#captureCapturesAccidentellesActions
@@ -67,6 +67,7 @@
tutti.editAccidentalBatch.action.importMultiPost.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.editAccidentalBatch.action.removeBatch.help=editFishingOperation.html\#captureCapturesAccidentellesActions
tutti.editAccidentalBatch.help=editFishingOperation.html\#captureCapturesAccidentelles
+tutti.editBenthosBatch.action.addSampleCategory.help=
tutti.editBenthosBatch.action.changeSampleCategory.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosBatch.action.createBatch.help=editFishingOperation.html\#captureBenthosActions
tutti.editBenthosBatch.action.createMelag.help=editFishingOperation.html\#captureBenthosActions
@@ -230,6 +231,7 @@
tutti.editSampleCategoryModel.action.removeEntry.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.action.save.help=editSampleCategory.html\#actions
tutti.editSampleCategoryModel.help=editSampleCategory.html
+tutti.editSpeciesBatch.action.addSampleCategory.help=
tutti.editSpeciesBatch.action.changeSampleCategory.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createBatch.help=editFishingOperation.html\#captureEspecesActions
tutti.editSpeciesBatch.action.createMelag.help=editFishingOperation.html\#captureEspecesActions
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-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-09-26 17:29:01 UTC (rev 1232)
@@ -325,6 +325,11 @@
<SplitSpeciesBatchUI id='speciesTabSplitBatch'
constructorParams='this'/>
</JXTitledPanel>
+ <JXTitledPanel id='speciesTabAddSampleCategoryBatchReminderLabel'
+ constraints='EditCatchesUIHandler.ADD_SAMPLE_CATEGORY_BATCH_CARD'>
+ <SplitSpeciesBatchUI id='speciesTabAddSampleCategoryBatch'
+ constructorParams='this'/>
+ </JXTitledPanel>
<JXTitledPanel id='speciesTabFrequencyEditorReminderLabel'
constraints='EditCatchesUIHandler.EDIT_FREQUENCY_CARD'>
<SpeciesFrequencyUI id='speciesTabFrequencyEditor'
@@ -348,6 +353,11 @@
<SplitBenthosBatchUI id='benthosTabSplitBatch'
constructorParams='this'/>
</JXTitledPanel>
+ <JXTitledPanel id='benthosTabAddSampleCategoryBatchReminderLabel'
+ constraints='EditCatchesUIHandler.ADD_SAMPLE_CATEGORY_BATCH_CARD'>
+ <SplitBenthosBatchUI id='benthosTabAddSampleCategoryBatch'
+ constructorParams='this'/>
+ </JXTitledPanel>
<JXTitledPanel id='benthosTabFrequencyEditorReminderLabel'
constraints='EditCatchesUIHandler.EDIT_FREQUENCY_CARD'>
<BenthosFrequencyUI id='benthosTabFrequencyEditor'
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -70,6 +70,8 @@
public static final String SPLIT_BATCH_CARD = "splitBatch";
+ public static final String ADD_SAMPLE_CATEGORY_BATCH_CARD = "addSampleCategoryBatch";
+
public static final String EDIT_FREQUENCY_CARD = "editFrequency";
public static final String EDIT_CARACTERISTICS_CARD = "caracteristicsCard";
@@ -121,6 +123,12 @@
@Override
public void afterInitUI() {
+ ui.getBenthosTabSplitBatch().getModel().setSplitMode(true);
+ ui.getBenthosTabAddSampleCategoryBatch().getModel().setSplitMode(false);
+
+ ui.getSpeciesTabSplitBatch().getModel().setSplitMode(true);
+ ui.getSpeciesTabAddSampleCategoryBatch().getModel().setSplitMode(false);
+
initUI(ui);
EditCatchesUIModel model = getModel();
@@ -323,6 +331,23 @@
ui.getSpeciesTabSplitBatchReminderLabel().setTitle(title);
}
+ public void addSampleCategorySpeciesBatch(SpeciesBatchRowModel editRow,
+ SplitSpeciesBatchUI splitBatchEditor,
+ int sampleCategoryId) {
+
+ splitBatchEditor.getHandler().editBatch(editRow, sampleCategoryId);
+
+ // open split editor
+ setSpeciesSelectedCard(EditCatchesUIHandler.ADD_SAMPLE_CATEGORY_BATCH_CARD);
+
+ // update title
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getSpeciesTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.addSampleCategorySpeciesBatch.title"));
+ ui.getSpeciesTabAddSampleCategoryBatchReminderLabel().setTitle(title);
+ }
+
public void setSpeciesSelectedCard(String card) {
JPanel panel = ui.getSpeciesTabPanel();
CardLayout2Ext layout = (CardLayout2Ext) panel.getLayout();
@@ -348,6 +373,9 @@
} else if (SPLIT_BATCH_CARD.equals(card)) {
tuttiUi = ui.getSpeciesTabSplitBatch();
+ } else if (ADD_SAMPLE_CATEGORY_BATCH_CARD.equals(card)) {
+ tuttiUi = ui.getSpeciesTabAddSampleCategoryBatch();
+
} else if (EDIT_FREQUENCY_CARD.equals(card)) {
tuttiUi = ui.getSpeciesTabFrequencyEditor();
}
@@ -397,6 +425,23 @@
ui.getBenthosTabSplitBatchReminderLabel().setTitle(title);
}
+ public void addSampleCategoryBenthosBatch(BenthosBatchRowModel editRow,
+ SplitBenthosBatchUI splitBatchEditor,
+ int sampleCategoryId) {
+
+ splitBatchEditor.getHandler().editBatch(editRow, sampleCategoryId);
+
+ // open split editor
+ setBenthosSelectedCard(EditCatchesUIHandler.ADD_SAMPLE_CATEGORY_BATCH_CARD);
+
+ // update title
+ String title = buildReminderLabelTitle(editRow.getSpecies(),
+ editRow,
+ ui.getBenthosTabFishingOperationReminderLabel().getTitle(),
+ _("tutti.addSampleCategoryBenthosBatch.title"));
+ ui.getBenthosTabAddSampleCategoryBatchReminderLabel().setTitle(title);
+ }
+
public void setBenthosSelectedCard(String card) {
JPanel panel = ui.getBenthosTabPanel();
CardLayout2Ext layout = (CardLayout2Ext) panel.getLayout();
@@ -422,6 +467,9 @@
} else if (SPLIT_BATCH_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabSplitBatch();
+ } else if (ADD_SAMPLE_CATEGORY_BATCH_CARD.equals(card)) {
+ tuttiUi = ui.getBenthosTabAddSampleCategoryBatch();
+
} else if (EDIT_FREQUENCY_CARD.equals(card)) {
tuttiUi = ui.getBenthosTabFrequencyEditor();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryAble.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryAble.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/SampleCategoryAble.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -46,6 +46,8 @@
SampleCategory getSampleCategoryById(Integer sampleCategoryId);
+ SampleCategory<?> getSampleCategoryByIndex(int sampleCategoryIndex);
+
void setSampleCategoryValue(Integer sampleCategoryId, Serializable value);
void setSampleCategoryWeight(Integer sampleCategoryId, Object value);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchRowModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -323,6 +323,11 @@
return result;
}
+ public SampleCategory<?> getSampleCategoryByIndex(int sampleCategoryIndex) {
+ SampleCategory<?> result = categories[sampleCategoryIndex];
+ return result;
+ }
+
@Override
public void setSampleCategoryValue(Integer sampleCategoryId, Serializable value) {
SampleCategory<?> sampleCategory =
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchTableModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -307,12 +307,14 @@
return result;
}
- protected void updateShell(BenthosBatchRowModel entry, int columnIndex) {
-
- Set<BenthosBatchRowModel> shell = Sets.newHashSet();
- entry.collectShell(shell);
- shell.add(entry);
-
+ /**
+ * Update all the given cells for the given column.
+ *
+ * @param shell shell to update
+ * @param columnIndex the column index to update
+ * @since 2.6
+ */
+ public void updateShell(Set<BenthosBatchRowModel> shell, int columnIndex) {
for (BenthosBatchRowModel batchRowModel : shell) {
int currentRowIndex = getRowIndex(batchRowModel);
if (log.isDebugEnabled()) {
@@ -321,4 +323,19 @@
fireTableCellUpdated(currentRowIndex, columnIndex);
}
}
+
+ /**
+ * Update all the cells of the given row shell for a given column.
+ *
+ * @param entry the first row to update
+ * @param columnIndex the column index to update
+ * @since 2.6
+ */
+ protected void updateShell(BenthosBatchRowModel entry, int columnIndex) {
+
+ Set<BenthosBatchRowModel> shell = Sets.newHashSet();
+ entry.collectShell(shell);
+ shell.add(entry);
+ updateShell(shell, columnIndex);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.css 2013-09-26 17:29:01 UTC (rev 1232)
@@ -28,7 +28,6 @@
bean: {model};
showReset: true;
useFloat: true;
- /*numberPattern: {DECIMAL3_PATTERN};*/
_selectOnFocus: {true};
}
@@ -37,8 +36,6 @@
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
showReset: true;
useFloat: true;
- /*numberPattern: {DECIMAL3_PATTERN};
- decimalNumber: 3;*/
computedDataColor: {handler.getConfig().getColorComputedWeights()};
}
@@ -195,6 +192,15 @@
_help: {"tutti.editBenthosBatch.action.changeSampleCategory.help"};
}
+#addSampleCategoryMenu {
+ actionIcon: batch-split;
+ text: "tutti.editBenthosBatch.action.addSampleCategory";
+ toolTipText: "tutti.editBenthosBatch.action.addSampleCategory.tip";
+ i18nMnemonic: "tutti.editBenthosBatch.action.addSampleCategory.mnemonic";
+ enabled: {model.isTableViewModeAll() && model.isAddSampleCategoryEnabled()};
+ _help: {"tutti.editBenthosBatch.action.addSampleCategory.help"};
+}
+
#removeBenthosBatchMenu {
actionIcon: batch-delete;
text: "tutti.editBenthosBatch.action.removeBatch";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-09-26 17:29:01 UTC (rev 1232)
@@ -79,6 +79,8 @@
onActionPerformed='handler.splitBatch()'/>
<JMenuItem id='changeSampleCategoryMenu'
onActionPerformed='handler.changeBatchCategory()'/>
+ <JMenuItem id='addSampleCategoryMenu'
+ onActionPerformed='handler.addBatchCategory()'/>
<JMenuItem id='removeBenthosBatchMenu'/>
<JMenuItem id='removeBenthosSubBatchMenu'/>
<JMenuItem id='renameBenthosBatchMenu'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -136,6 +136,13 @@
*/
protected final WeightUnit weightUnit;
+ /**
+ * id of the unsorted qualitative value to remove of V/HV universe.
+ *
+ * @since 2.6
+ */
+ protected final Integer qualitative_unsorted_id;
+
public BenthosBatchUIHandler(TuttiUI<?, ?> parentUi,
BenthosBatchUI ui) {
super(parentUi, ui,
@@ -148,6 +155,9 @@
SpeciesBatchRowModel.PROPERTY_FREQUENCY,
SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM);
+ qualitative_unsorted_id =
+ context.getPersistenceService().getEnumerationFile().QUALITATIVE_UNSORTED_ID;
+
weightUnit = getConfig().getBenthosWeightUnit();
sampleCategoryModel = getDataContext().getSampleCategoryModel();
@@ -456,6 +466,7 @@
boolean enableRename = false;
boolean enableSplit = false;
boolean enableChangeSampleCategory = false;
+ boolean enableAddSampleCategory = false;
boolean enableRemove = false;
boolean enableRemoveSub = false;
boolean enableCreateMelag = false;
@@ -485,6 +496,7 @@
enableCreateMelag = selectedRowCount > 1;
enableEditFrequencies = selectedRowCount == 1;
enableChangeSampleCategory = selectedRowCount == 1 && tableModel.isCellEditable(rowIndex, columnIndex);
+ enableAddSampleCategory = selectedRowCount == 1 && tableModel.isCellEditable(rowIndex, columnIndex);
if (enableSplit) {
@@ -500,11 +512,43 @@
|| row.getComputedNumber() == 0);
}
+ Integer sampleCategoryId =
+ tableModel.getSampleCategoryId(columnIndex);
+ boolean firstCategory = false;
+ SampleCategoryModelEntry category = null;
+
+ List<CaracteristicQualitativeValue> available = null;
+
+ if (sampleCategoryId != null) {
+
+ // get category
+ category = sampleCategoryModel.getCategoryById(sampleCategoryId);
+
+ // is first category ?
+ firstCategory = sampleCategoryModel.getFirstCategoryId().equals(sampleCategoryId);
+
+ // get the first ancestor row using this category
+ BenthosBatchRowModel firstAncestorRow = row.getFirstAncestor(sampleCategoryId);
+
+ // get all used values for this category
+ Set<Serializable> used = getSampleUsedValues(
+ firstAncestorRow, sampleCategoryId);
+
+ // get all possible values
+ available = Lists.newArrayList(category.getCaracteristic().getQualitativeValue());
+ available.removeAll(used);
+
+ if (firstCategory) {
+
+ // remove the unsorted qualitative value
+ TuttiEntities.removeQualitativeValue(available, qualitative_unsorted_id);
+ }
+ }
+
if (enableChangeSampleCategory) {
- // can change category if there is still a brother category free
- Integer sampleCategoryId =
- tableModel.getSampleCategoryId(columnIndex);
+ // can change category if on a sample column and
+ // there is still a brother category free
if (sampleCategoryId == null) {
@@ -512,35 +556,41 @@
enableChangeSampleCategory = false;
} else {
- // get category
- SampleCategoryModelEntry category =
- sampleCategoryModel.getCategoryById(sampleCategoryId);
+ if (category.getCaracteristic().isNumericType()) {
- // get the first ancestor row using this category
- BenthosBatchRowModel firstAncestorRow =
- row.getFirstAncestor(sampleCategoryId);
+ // if number then can always change it
- // get all used values for this category
- Set<Serializable> used = getSampleUsedValues(
- firstAncestorRow, sampleCategoryId);
+ } else {
+ // action possible only if there is still some available values
+ enableChangeSampleCategory = CollectionUtils.isNotEmpty(available);
+ }
+ }
+ }
+
+ if (enableAddSampleCategory) {
+
+ // can change category if on a sample column and
+ // there is still a brother category free
+ // and sample category is not the first
+
+ if (sampleCategoryId == null || firstCategory) {
+
+ // not on a sample category column
+ // or using the first sample category (V/HV)
+ enableAddSampleCategory = false;
+ } else {
+
if (category.getCaracteristic().isNumericType()) {
// if number then can always change it
} else {
- // get all possible values
-
- List<CaracteristicQualitativeValue> available =
- Lists.newArrayList(category.getCaracteristic().getQualitativeValue());
- available.removeAll(used);
-
// action possible only if there is still some available values
- enableChangeSampleCategory = !available.isEmpty();
+ enableAddSampleCategory = CollectionUtils.isNotEmpty(available);
}
}
-
}
if (enableEditFrequencies) {
@@ -587,6 +637,7 @@
BenthosBatchUIModel model = getModel();
model.setSplitBatchEnabled(enableSplit);
model.setChangeSampleCategoryEnabled(enableChangeSampleCategory);
+ model.setAddSampleCategoryEnabled(enableAddSampleCategory);
model.setRemoveBatchEnabled(enableRemove);
model.setRemoveSubBatchEnabled(enableRemoveSub);
model.setRenameBatchEnabled(enableRename);
@@ -597,6 +648,7 @@
StringBuilder builder = new StringBuilder("actions for (" + rowIndex + "," + columnIndex + "):");
builder.append("\nenableSplit: ").append(enableSplit);
builder.append("\nenableChangeSampleCategory: ").append(enableChangeSampleCategory);
+ builder.append("\nenableAddSampleCategory: ").append(enableAddSampleCategory);
builder.append("\nenableRemove: ").append(enableRemove);
builder.append("\nenableRemoveSub: ").append(enableRemoveSub);
builder.append("\nenableRename: ").append(enableRename);
@@ -885,6 +937,49 @@
}
}
+ public void addBatchCategory() {
+
+ // get table model
+ BenthosBatchTableModel tableModel = getTableModel();
+
+ // get selected row
+ int rowIndex = getTable().getSelectedRow();
+ Preconditions.checkState(rowIndex != -1,
+ "Cant split batch if no batch selected");
+
+ // get selected column
+ int columnIndex = getTable().getSelectedColumn();
+ Preconditions.checkState(columnIndex != -1,
+ "Cant split batch if no batch selected");
+
+ // get selected row
+ BenthosBatchRowModel selectedRow = tableModel.getEntry(rowIndex);
+
+ // get his sample category
+ Integer sampleCategoryId = tableModel.getSampleCategoryId(columnIndex);
+
+ // get the first ancestor row using this category
+ BenthosBatchRowModel firstAncestorRow =
+ selectedRow.getFirstAncestor(sampleCategoryId);
+
+ // get his parent (the one we will edit)
+ BenthosBatchRowModel parentBatch = firstAncestorRow.getParentBatch();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Open addChangeCategory batch ui for row [" + rowIndex + "] and category " + sampleCategoryId);
+ }
+
+ EditCatchesUI parent =
+ SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ SplitBenthosBatchUI splitBatchEditor =
+ parent.getBenthosTabAddSampleCategoryBatch();
+
+ parent.getHandler().addSampleCategoryBenthosBatch(
+ parentBatch,
+ splitBatchEditor,
+ sampleCategoryId);
+ }
+
public void changeBatchCategory() {
// get table model
@@ -956,6 +1051,16 @@
List<CaracteristicQualitativeValue> availableValues =
Lists.newArrayList(caracteristic.getQualitativeValue());
+
+ boolean firstCategory =
+ sampleCategoryModel.getFirstCategoryId().equals(sampleCategoryId);
+
+ if (firstCategory) {
+
+ // remove the unsorted qualitative value
+ TuttiEntities.removeQualitativeValue(availableValues, qualitative_unsorted_id);
+ }
+
availableValues.removeAll(usedValues);
JComboBox editor = new JComboBox();
@@ -1045,6 +1150,69 @@
model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
}
+ public void addSampleCategoryBatch(BenthosBatchRowModel parentBatch,
+ SampleCategoryModelEntry sampleCategoryDef,
+ List<SplitBenthosBatchRowModel> rows,
+ Float totalRowWeight) {
+
+ // get table model
+ BenthosBatchTableModel tableModel = getTableModel();
+
+ // get insert row index
+ int insertRow = tableModel.getRowIndex(parentBatch) + parentBatch.getChildBatch().size();
+
+ // Create rows in batch table model
+ List<BenthosBatchRowModel> newBatches = Lists.newArrayList();
+ for (SplitBenthosBatchRowModel row : rows) {
+ if (row.isEditable() && row.isValid()) {
+
+ // can keep this row
+ BenthosBatchRowModel newBatch = tableModel.createNewRow();
+
+ loadBatchRow(parentBatch,
+ newBatch,
+ sampleCategoryDef.getCategoryId(),
+ row.getCategoryValue(),
+ row.getWeight(),
+ null);
+
+ recomputeRowValidState(newBatch);
+ newBatches.add(newBatch);
+
+ tableModel.addNewRow(++insertRow, newBatch);
+ }
+ }
+
+ // add new batches to his parent
+ List<BenthosBatchRowModel> childBatch = parentBatch.getChildBatch();
+ childBatch.addAll(newBatches);
+ parentBatch.setChildBatch(childBatch);
+
+ // re compute the sub sample property for all childs
+ int categoryIndex = sampleCategoryModel.indexOf(sampleCategoryDef);
+
+ Float parentWeight = parentBatch.getSampleCategoryByIndex(categoryIndex - 1).getNotNullWeight();
+ boolean subSample = parentWeight != null && totalRowWeight != null
+ && parentWeight > totalRowWeight;
+
+ Set<BenthosBatchRowModel> shell = Sets.newHashSet();
+ parentBatch.collectShell(shell);
+
+ for (BenthosBatchRowModel rowModel : shell) {
+ rowModel.getSampleCategoryByIndex(categoryIndex).setSubSample(subSample);
+ }
+
+ // save new batches
+ saveRows(newBatches);
+
+ // update model number of leaf
+ BenthosBatchUIModel model = getModel();
+ model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
+
+ // update columns for the parent shell
+ tableModel.updateShell(shell, getTable().getSelectedColumn());
+ }
+
public void updateTotalFromFrequencies(BenthosBatchRowModel row) {
List<BenthosFrequencyRowModel> frequency = row.getFrequency();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUIModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -51,6 +51,8 @@
public static final String PROPERTY_CHANGE_SAMPLE_CATEGORY_ENABLED = "changeSampleCategoryEnabled";
+ public static final String PROPERTY_ADD_SAMPLE_CATEGORY_ENABLED = "addSampleCategoryEnabled";
+
public static final String PROPERTY_REMOVE_SUB_BATCH_ENABLED = "removeSubBatchEnabled";
public static final String PROPERTY_RENAME_BATCH_ENABLED = "renameBatchEnabled";
@@ -86,6 +88,13 @@
protected boolean changeSampleCategoryEnabled;
/**
+ * Can user add a/some missing sample category of the selected species batch ?
+ *
+ * @since 2.6
+ */
+ protected boolean addSampleCategoryEnabled;
+
+ /**
* Can user remove a selected species batch?
*
* @since 0.3
@@ -313,6 +322,15 @@
firePropertyChange(PROPERTY_CHANGE_SAMPLE_CATEGORY_ENABLED, null, changeSampleCategoryEnabled);
}
+ public boolean isAddSampleCategoryEnabled() {
+ return addSampleCategoryEnabled;
+ }
+
+ public void setAddSampleCategoryEnabled(boolean addSampleCategoryEnabled) {
+ this.addSampleCategoryEnabled = addSampleCategoryEnabled;
+ firePropertyChange(PROPERTY_ADD_SAMPLE_CATEGORY_ENABLED, null, addSampleCategoryEnabled);
+ }
+
public boolean isRemoveBatchEnabled() {
return removeBatchEnabled;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/RemoveBenthosBatchAction.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -97,6 +97,11 @@
if (selectedBatch.isBatchRoot()) {
// update speciesUsed
handler.removeFromSpeciesUsed(selectedBatch);
+ } else {
+
+ // remove from his parent
+ BenthosBatchRowModel parentBatch = selectedBatch.getParentBatch();
+ parentBatch.getChildBatch().remove(selectedBatch);
}
// collect of rows to remove from model
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -541,7 +541,8 @@
SplitBenthosBatchTableModel tableModel =
new SplitBenthosBatchTableModel(columnModel,
getModel(),
- editableCategoryValue);
+ editableCategoryValue,
+ false);
JXTable table = getTable();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchRowModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -51,6 +51,8 @@
public static final String PROPERTY_SELECTED = "selected";
+ public static final String PROPERTY_EDITABLE = "editable";
+
/**
* Delegate sample category which contains category value + weight.
*
@@ -58,8 +60,20 @@
*/
protected final SampleCategory<Serializable> category = SampleCategory.newSample(null);
+ /**
+ * Is row selected?
+ *
+ * @since 2.5
+ */
protected boolean selected;
+ /**
+ * Is row editable ? (in add mode incoming rows are all selected and not editable).
+ *
+ * @since 2.6
+ */
+ protected boolean editable;
+
protected static final Binder<SplitBenthosBatchRowModel, SplitBenthosBatchRowModel> fromBeanBinder =
BinderFactory.newBinder(SplitBenthosBatchRowModel.class,
SplitBenthosBatchRowModel.class);
@@ -122,6 +136,16 @@
firePropertyChange(PROPERTY_SELECTED, oldValue, selected);
}
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ Object oldValue = isEditable();
+ this.editable = editable;
+ firePropertyChange(PROPERTY_EDITABLE, oldValue, editable);
+ }
+
@Override
protected SplitBenthosBatchRowModel newEntity() {
return new SplitBenthosBatchRowModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchTableModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -64,11 +64,20 @@
private final SelectedCategoryAble uiModel;
+ /**
+ * Is the table is in split mode?
+ *
+ * @since 2.6
+ */
+ private final boolean splitMode;
+
public SplitBenthosBatchTableModel(TableColumnModelExt columnModel,
SelectedCategoryAble uiModel,
- boolean createEmptyRowIsEmpty) {
+ boolean createEmptyRowIsEmpty,
+ boolean splitMode) {
super(columnModel, createEmptyRowIsEmpty, createEmptyRowIsEmpty);
this.uiModel = uiModel;
+ this.splitMode = splitMode;
setNoneEditableCols(READ_ONLY_CATEGORY_VALUE);
}
@@ -77,7 +86,23 @@
SplitBenthosBatchRowModel result = new SplitBenthosBatchRowModel();
result.setCategoryType(uiModel.getSelectedCategory());
result.setValid(false);
+ result.setEditable(true);
return result;
}
+ @Override
+ protected boolean isCellEditable(int rowIndex,
+ int columnIndex,
+ ColumnIdentifier<SplitBenthosBatchRowModel> propertyName) {
+
+ boolean result = super.isCellEditable(rowIndex,
+ columnIndex,
+ propertyName);
+ if (result && !splitMode) {
+ // if editable and on edit mode, use editable property on row
+ SplitBenthosBatchRowModel entry = getEntry(rowIndex);
+ result = entry.isEditable();
+ }
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -24,8 +24,10 @@
* #L%
*/
+import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
@@ -53,7 +55,9 @@
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.Serializable;
import java.util.List;
+import java.util.Map;
/**
* Handler of {@link SplitBenthosBatchUI}.
@@ -306,6 +310,61 @@
model.setBatch(batch);
}
+ public void editBatch(BenthosBatchRowModel batch,
+ int sampleCategoryId) {
+
+ Preconditions.checkNotNull(batch);
+ Preconditions.checkNotNull(sampleCategoryId);
+
+ List<BenthosBatchRowModel> rows = batch.getChildBatch();
+ Preconditions.checkNotNull(rows);
+
+ // get possible the last used
+ List<SampleCategoryModelEntry> categories = Lists.newArrayList();
+
+ // get sample category model
+ SampleCategoryModel sampleCategoryModel =
+ getModel().getSampleCategoryModel();
+
+ // set only the given category
+ SampleCategoryModelEntry selectedCategory =
+ sampleCategoryModel.getCategoryById(sampleCategoryId);
+ categories.add(selectedCategory);
+
+ SplitBenthosBatchUIModel model = getModel();
+
+ // connect model to validator
+ ui.getValidator().setBean(model);
+
+ model.setSampleWeight(null);
+ model.setCategory(categories);
+ model.setSelectedCategory(selectedCategory);
+
+ // keep batch (will be used to push back editing entry)
+ model.setBatch(batch);
+
+ // add existing rows
+ Map<Serializable, SplitBenthosBatchRowModel> rowsByValue = Maps.uniqueIndex(model.getRows(), new Function<SplitBenthosBatchRowModel, Serializable>() {
+ @Override
+ public Serializable apply(SplitBenthosBatchRowModel input) {
+ return input.getCategoryValue();
+ }
+ });
+ for (BenthosBatchRowModel row : rows) {
+
+ SampleCategory<?> sampleCategory = row.getSampleCategoryById(sampleCategoryId);
+ Serializable categoryValue = sampleCategory.getCategoryValue();
+ SplitBenthosBatchRowModel splitRow = rowsByValue.get(categoryValue);
+ splitRow.setWeight(sampleCategory.getCategoryWeight());
+ splitRow.setSelected(true);
+ splitRow.setEditable(false);
+ }
+
+ computeSampleWeight();
+
+ getTableModel().fireTableDataChanged();
+ }
+
public void save() {
if (log.isDebugEnabled()) {
@@ -315,10 +374,18 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
SplitBenthosBatchUIModel model = getModel();
if (model.isValid()) {
- parent.getBenthosTabContent().getHandler().splitBatch(
- model.getSelectedCategory(),
- model.getRows(),
- model.getSampleWeight());
+ if (model.isSplitMode()) {
+ parent.getBenthosTabContent().getHandler().splitBatch(
+ model.getSelectedCategory(),
+ model.getRows(),
+ model.getSampleWeight());
+ } else {
+ parent.getBenthosTabContent().getHandler().addSampleCategoryBatch(
+ model.getBatch(),
+ model.getSelectedCategory(),
+ model.getRows(),
+ model.getSampleWeight());
+ }
}
// close dialog
@@ -398,7 +465,8 @@
SplitBenthosBatchTableModel tableModel =
new SplitBenthosBatchTableModel(columnModel,
getModel(),
- editableCategoryValue);
+ editableCategoryValue,
+ getModel().isSplitMode());
JXTable table = getTable();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/split/SplitBenthosBatchUIModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -52,6 +52,8 @@
public static final String PROPERTY_SAMPLE_WEIGHT = "sampleWeight";
+ private static final String PROPERTY_SPLIT_MODE = "splitMode";
+
/**
* Batch which fires the editor.
*
@@ -94,6 +96,12 @@
*/
protected final WeightUnit weightUnit;
+ /**
+ * Is ui in split mode ?
+ * @since 2.6
+ */
+ protected boolean splitMode = true;
+
public SplitBenthosBatchUIModel(WeightUnit weightUnit,
SampleCategoryModel sampleCategoryModel) {
super(BenthosBatchRowModel.class, null, null);
@@ -155,4 +163,14 @@
public SampleCategoryModel getSampleCategoryModel() {
return sampleCategoryModel;
}
+
+ public boolean isSplitMode() {
+ return splitMode;
+ }
+
+ public void setSplitMode(boolean splitMode) {
+ Object oldValue = isSplitMode();
+ this.splitMode = splitMode;
+ firePropertyChange(PROPERTY_SPLIT_MODE, oldValue,splitMode);
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/RemoveSpeciesBatchAction.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -97,6 +97,11 @@
if (selectedBatch.isBatchRoot()) {
// update speciesUsed
handler.removeFromSpeciesUsed(selectedBatch);
+ } else {
+
+ // remove from his parent
+ SpeciesBatchRowModel parentBatch = selectedBatch.getParentBatch();
+ parentBatch.getChildBatch().remove(selectedBatch);
}
// collect of rows to remove from model
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -475,6 +475,12 @@
}
@Override
+ public SampleCategory<?> getSampleCategoryByIndex(int sampleCategoryIndex) {
+ SampleCategory<?> result = categories[sampleCategoryIndex];
+ return result;
+ }
+
+ @Override
public void setSampleCategoryValue(Integer sampleCategoryId, Serializable value) {
SampleCategory<?> sampleCategory =
getSampleCategoryById(sampleCategoryId);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -306,12 +306,14 @@
return result;
}
- protected void updateShell(SpeciesBatchRowModel entry, int columnIndex) {
-
- Set<SpeciesBatchRowModel> shell = Sets.newHashSet();
- entry.collectShell(shell);
- shell.add(entry);
-
+ /**
+ * Update all the given cells for the given column.
+ *
+ * @param shell shell to update
+ * @param columnIndex the column index to update
+ * @since 2.6
+ */
+ public void updateShell(Set<SpeciesBatchRowModel> shell, int columnIndex) {
for (SpeciesBatchRowModel batchRowModel : shell) {
int currentRowIndex = getRowIndex(batchRowModel);
if (log.isDebugEnabled()) {
@@ -320,4 +322,19 @@
fireTableCellUpdated(currentRowIndex, columnIndex);
}
}
+
+ /**
+ * Update all the cells of the given row shell for a given column.
+ *
+ * @param entry the first row to update
+ * @param columnIndex the column index to update
+ * @since 2.6
+ */
+ protected void updateShell(SpeciesBatchRowModel entry, int columnIndex) {
+
+ Set<SpeciesBatchRowModel> shell = Sets.newHashSet();
+ entry.collectShell(shell);
+ shell.add(entry);
+ updateShell(shell, columnIndex);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-09-26 17:29:01 UTC (rev 1232)
@@ -28,7 +28,6 @@
bean: {model};
showReset: true;
useFloat: true;
- /*numberPattern: {DECIMAL3_PATTERN};*/
_selectOnFocus: {true};
}
@@ -37,8 +36,6 @@
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
showReset: true;
useFloat: true;
- /*numberPattern: {DECIMAL3_PATTERN};
- decimalNumber: 3;*/
computedDataColor: {handler.getConfig().getColorComputedWeights()};
}
@@ -171,6 +168,15 @@
_help: {"tutti.editSpeciesBatch.action.changeSampleCategory.help"};
}
+#addSampleCategoryMenu {
+ actionIcon: batch-split;
+ text: "tutti.editSpeciesBatch.action.addSampleCategory";
+ toolTipText: "tutti.editSpeciesBatch.action.addSampleCategory.tip";
+ i18nMnemonic: "tutti.editSpeciesBatch.action.addSampleCategory.mnemonic";
+ enabled: {model.isTableViewModeAll() && model.isAddSampleCategoryEnabled()};
+ _help: {"tutti.editSpeciesBatch.action.addSampleCategory.help"};
+}
+
#removeSpeciesBatchMenu {
actionIcon: batch-delete;
text: "tutti.editSpeciesBatch.action.removeBatch";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-09-26 17:29:01 UTC (rev 1232)
@@ -80,6 +80,8 @@
onActionPerformed='handler.splitBatch()'/>
<JMenuItem id='changeSampleCategoryMenu'
onActionPerformed='handler.changeBatchCategory()'/>
+ <JMenuItem id='addSampleCategoryMenu'
+ onActionPerformed='handler.addBatchCategory()'/>
<JMenuItem id='removeSpeciesBatchMenu'/>
<JMenuItem id='removeSpeciesSubBatchMenu'/>
<JMenuItem id='renameSpeciesBatchMenu'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -137,6 +137,13 @@
*/
protected final WeightUnit weightUnit;
+ /**
+ * id of the unsorted qualitative value to remove of V/HV universe.
+ *
+ * @since 2.6
+ */
+ protected final Integer qualitative_unsorted_id;
+
public SpeciesBatchUIHandler(EditCatchesUI parentUi,
SpeciesBatchUI ui) {
super(parentUi, ui,
@@ -149,6 +156,9 @@
SpeciesBatchRowModel.PROPERTY_FREQUENCY,
SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM);
+ qualitative_unsorted_id =
+ context.getPersistenceService().getEnumerationFile().QUALITATIVE_UNSORTED_ID;
+
weightUnit = getConfig().getSpeciesWeightUnit();
sampleCategoryModel = getDataContext().getSampleCategoryModel();
@@ -459,6 +469,7 @@
boolean enableRename = false;
boolean enableSplit = false;
boolean enableChangeSampleCategory = false;
+ boolean enableAddSampleCategory = false;
boolean enableRemove = false;
boolean enableRemoveSub = false;
boolean enableCreateMelag = false;
@@ -478,7 +489,6 @@
// can edit frequencies on a single selected leaf row
-
enableSplit = true;
// action with single selection
@@ -488,6 +498,7 @@
enableCreateMelag = selectedRowCount > 1;
enableEditFrequencies = selectedRowCount == 1;
enableChangeSampleCategory = selectedRowCount == 1 && tableModel.isCellEditable(rowIndex, columnIndex);
+ enableAddSampleCategory = selectedRowCount == 1 && tableModel.isCellEditable(rowIndex, columnIndex);
if (enableSplit) {
@@ -503,11 +514,44 @@
|| row.getComputedNumber() == 0);
}
+ boolean firstCategory = false;
+ Integer sampleCategoryId =
+ tableModel.getSampleCategoryId(columnIndex);
+
+ SampleCategoryModelEntry category = null;
+
+ List<CaracteristicQualitativeValue> available = null;
+
+ if (sampleCategoryId != null) {
+
+ // is first category ?
+ firstCategory = sampleCategoryModel.getFirstCategoryId().equals(sampleCategoryId);
+
+ // get category
+ category = sampleCategoryModel.getCategoryById(sampleCategoryId);
+
+ // get the first ancestor row using this category
+ SpeciesBatchRowModel firstAncestorRow = row.getFirstAncestor(sampleCategoryId);
+
+ // get all used values for this category
+ Set<Serializable> used = getSampleUsedValues(
+ firstAncestorRow, sampleCategoryId);
+
+ // get all possible values
+ available = Lists.newArrayList(category.getCaracteristic().getQualitativeValue());
+ available.removeAll(used);
+
+ if (firstCategory) {
+
+ // remove the unsorted qualitative value
+ TuttiEntities.removeQualitativeValue(available, qualitative_unsorted_id);
+ }
+ }
+
if (enableChangeSampleCategory) {
- // can change category if there is still a brother category free
- Integer sampleCategoryId =
- tableModel.getSampleCategoryId(columnIndex);
+ // can change category if on a sample column and
+ // there is still a brother category free
if (sampleCategoryId == null) {
@@ -515,35 +559,41 @@
enableChangeSampleCategory = false;
} else {
- // get category
- SampleCategoryModelEntry category =
- sampleCategoryModel.getCategoryById(sampleCategoryId);
+ if (category.getCaracteristic().isNumericType()) {
- // get the first ancestor row using this category
- SpeciesBatchRowModel firstAncestorRow =
- row.getFirstAncestor(sampleCategoryId);
+ // if number then can always change it
- // get all used values for this category
- Set<Serializable> used = getSampleUsedValues(
- firstAncestorRow, sampleCategoryId);
+ } else {
+ // action possible only if there is still some available values
+ enableChangeSampleCategory = CollectionUtils.isNotEmpty(available);
+ }
+ }
+ }
+
+ if (enableAddSampleCategory) {
+
+ // can change category if on a sample column and
+ // there is still a brother category free
+ // and sample category is not the first
+
+ if (sampleCategoryId == null || firstCategory) {
+
+ // not on a sample category column
+ // or using the first sample category (V/HV)
+ enableAddSampleCategory = false;
+ } else {
+
if (category.getCaracteristic().isNumericType()) {
// if number then can always change it
} else {
- // get all possible values
-
- List<CaracteristicQualitativeValue> available =
- Lists.newArrayList(category.getCaracteristic().getQualitativeValue());
- available.removeAll(used);
-
// action possible only if there is still some available values
- enableChangeSampleCategory = !available.isEmpty();
+ enableAddSampleCategory = CollectionUtils.isNotEmpty(available);
}
}
-
}
if (enableEditFrequencies) {
@@ -590,22 +640,24 @@
SpeciesBatchUIModel model = getModel();
model.setSplitBatchEnabled(enableSplit);
model.setChangeSampleCategoryEnabled(enableChangeSampleCategory);
+ model.setAddSampleCategoryEnabled(enableAddSampleCategory);
model.setRemoveBatchEnabled(enableRemove);
model.setRemoveSubBatchEnabled(enableRemoveSub);
model.setRenameBatchEnabled(enableRename);
model.setCreateMelagEnabled(enableCreateMelag);
model.setEditFrequenciesEnabled(enableEditFrequencies);
- if (log.isInfoEnabled()) {
+ if (log.isDebugEnabled()) {
StringBuilder builder = new StringBuilder("actions for (" + rowIndex + "," + columnIndex + "):");
builder.append("\nenableSplit: ").append(enableSplit);
builder.append("\nenableChangeSampleCategory: ").append(enableChangeSampleCategory);
+ builder.append("\nenableAddSampleCategory: ").append(enableAddSampleCategory);
builder.append("\nenableRemove: ").append(enableRemove);
builder.append("\nenableRemoveSub: ").append(enableRemoveSub);
builder.append("\nenableRename: ").append(enableRename);
builder.append("\nenableCreateMelag: ").append(enableCreateMelag);
builder.append("\nenableEditFrequencies: ").append(enableEditFrequencies);
- log.info(builder.toString());
+ log.debug(builder.toString());
}
}
@@ -887,6 +939,49 @@
}
}
+ public void addBatchCategory() {
+
+ // get table model
+ SpeciesBatchTableModel tableModel = getTableModel();
+
+ // get selected row
+ int rowIndex = getTable().getSelectedRow();
+ Preconditions.checkState(rowIndex != -1,
+ "Cant split batch if no batch selected");
+
+ // get selected column
+ int columnIndex = getTable().getSelectedColumn();
+ Preconditions.checkState(columnIndex != -1,
+ "Cant split batch if no batch selected");
+
+ // get selected row
+ SpeciesBatchRowModel selectedRow = tableModel.getEntry(rowIndex);
+
+ // get his sample category
+ Integer sampleCategoryId = tableModel.getSampleCategoryId(columnIndex);
+
+ // get the first ancestor row using this category
+ SpeciesBatchRowModel firstAncestorRow =
+ selectedRow.getFirstAncestor(sampleCategoryId);
+
+ // get his parent (the one we will edit)
+ SpeciesBatchRowModel parentBatch = firstAncestorRow.getParentBatch();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Open addChangeCategory batch ui for row [" + rowIndex + "] and category " + sampleCategoryId);
+ }
+
+ EditCatchesUI parent =
+ SwingUtil.getParentContainer(ui, EditCatchesUI.class);
+ SplitSpeciesBatchUI splitBatchEditor =
+ parent.getSpeciesTabAddSampleCategoryBatch();
+
+ parent.getHandler().addSampleCategorySpeciesBatch(
+ parentBatch,
+ splitBatchEditor,
+ sampleCategoryId);
+ }
+
public void changeBatchCategory() {
// get table model
@@ -958,6 +1053,16 @@
List<CaracteristicQualitativeValue> availableValues =
Lists.newArrayList(caracteristic.getQualitativeValue());
+
+ boolean firstCategory =
+ sampleCategoryModel.getFirstCategoryId().equals(sampleCategoryId);
+
+ if (firstCategory) {
+
+ // remove the unsorted qualitative value
+ TuttiEntities.removeQualitativeValue(availableValues, qualitative_unsorted_id);
+ }
+
availableValues.removeAll(usedValues);
JComboBox editor = new JComboBox();
@@ -1047,6 +1152,69 @@
model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
}
+ public void addSampleCategoryBatch(SpeciesBatchRowModel parentBatch,
+ SampleCategoryModelEntry sampleCategoryDef,
+ List<SplitSpeciesBatchRowModel> rows,
+ Float totalRowWeight) {
+
+ // get table model
+ SpeciesBatchTableModel tableModel = getTableModel();
+
+ // get insert row index
+ int insertRow = tableModel.getRowIndex(parentBatch) + parentBatch.getChildBatch().size();
+
+ // Create rows in batch table model
+ List<SpeciesBatchRowModel> newBatches = Lists.newArrayList();
+ for (SplitSpeciesBatchRowModel row : rows) {
+ if (row.isEditable() && row.isValid()) {
+
+ // can keep this row
+ SpeciesBatchRowModel newBatch = tableModel.createNewRow();
+
+ loadBatchRow(parentBatch,
+ newBatch,
+ sampleCategoryDef.getCategoryId(),
+ row.getCategoryValue(),
+ row.getWeight(),
+ null);
+
+ recomputeRowValidState(newBatch);
+ newBatches.add(newBatch);
+
+ tableModel.addNewRow(++insertRow, newBatch);
+ }
+ }
+
+ // add new batches to his parent
+ List<SpeciesBatchRowModel> childBatch = parentBatch.getChildBatch();
+ childBatch.addAll(newBatches);
+ parentBatch.setChildBatch(childBatch);
+
+ // re compute the sub sample property for all childs
+ int categoryIndex = sampleCategoryModel.indexOf(sampleCategoryDef);
+
+ Float parentWeight = parentBatch.getSampleCategoryByIndex(categoryIndex - 1).getNotNullWeight();
+ boolean subSample = parentWeight != null && totalRowWeight != null
+ && parentWeight > totalRowWeight;
+
+ Set<SpeciesBatchRowModel> shell = Sets.newHashSet();
+ parentBatch.collectShell(shell);
+
+ for (SpeciesBatchRowModel rowModel : shell) {
+ rowModel.getSampleCategoryByIndex(categoryIndex).setSubSample(subSample);
+ }
+
+ // save new batches
+ saveRows(newBatches);
+
+ // update model number of leaf
+ SpeciesBatchUIModel model = getModel();
+ model.setLeafNumber(model.getLeafNumber() + newBatches.size() - 1);
+
+ // update columns for the parent shell
+ tableModel.updateShell(shell, getTable().getSelectedColumn());
+ }
+
public void updateTotalFromFrequencies(SpeciesBatchRowModel row) {
List<SpeciesFrequencyRowModel> frequency = row.getFrequency();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -49,6 +49,8 @@
public static final String PROPERTY_CHANGE_SAMPLE_CATEGORY_ENABLED = "changeSampleCategoryEnabled";
+ public static final String PROPERTY_ADD_SAMPLE_CATEGORY_ENABLED = "addSampleCategoryEnabled";
+
public static final String PROPERTY_REMOVE_SUB_BATCH_ENABLED = "removeSubBatchEnabled";
public static final String PROPERTY_RENAME_BATCH_ENABLED = "renameBatchEnabled";
@@ -86,6 +88,13 @@
protected boolean changeSampleCategoryEnabled;
/**
+ * Can user add a/some missing sample category of the selected species batch ?
+ *
+ * @since 2.6
+ */
+ protected boolean addSampleCategoryEnabled;
+
+ /**
* Can user remove a selected species batch?
*
* @since 0.3
@@ -295,6 +304,15 @@
firePropertyChange(PROPERTY_CHANGE_SAMPLE_CATEGORY_ENABLED, null, changeSampleCategoryEnabled);
}
+ public boolean isAddSampleCategoryEnabled() {
+ return addSampleCategoryEnabled;
+ }
+
+ public void setAddSampleCategoryEnabled(boolean addSampleCategoryEnabled) {
+ this.addSampleCategoryEnabled = addSampleCategoryEnabled;
+ firePropertyChange(PROPERTY_ADD_SAMPLE_CATEGORY_ENABLED, null, addSampleCategoryEnabled);
+ }
+
public boolean isRemoveBatchEnabled() {
return removeBatchEnabled;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -549,7 +549,8 @@
SplitSpeciesBatchTableModel tableModel =
new SplitSpeciesBatchTableModel(columnModel,
getModel(),
- editableCategoryValue);
+ editableCategoryValue,
+ false);
JXTable table = getTable();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchRowModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -48,6 +48,8 @@
public static final String PROPERTY_SELECTED = "selected";
+ public static final String PROPERTY_EDITABLE = "editable";
+
/**
* Delegate sample category which contains category value + weight.
*
@@ -55,8 +57,20 @@
*/
protected final SampleCategory<Serializable> category = SampleCategory.newSample(null);
+ /**
+ * Is row selected?
+ *
+ * @since 2.5
+ */
protected boolean selected;
+ /**
+ * Is row editable ? (in add mode incoming rows are all selected and not editable).
+ *
+ * @since 2.6
+ */
+ protected boolean editable;
+
public SplitSpeciesBatchRowModel() {
super(SplitSpeciesBatchRowModel.class, null, null);
}
@@ -111,6 +125,16 @@
firePropertyChange(PROPERTY_SELECTED, oldValue, selected);
}
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ Object oldValue = isEditable();
+ this.editable = editable;
+ firePropertyChange(PROPERTY_EDITABLE, oldValue, editable);
+ }
+
@Override
protected SplitSpeciesBatchRowModel newEntity() {
return new SplitSpeciesBatchRowModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchTableModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -64,11 +64,20 @@
private final SelectedCategoryAble uiModel;
+ /**
+ * Is the table is in split mode?
+ *
+ * @since 2.6
+ */
+ private final boolean splitMode;
+
public SplitSpeciesBatchTableModel(TableColumnModelExt columnModel,
SelectedCategoryAble uiModel,
- boolean createEmptyRowIsEmpty) {
+ boolean createEmptyRowIsEmpty,
+ boolean splitMode) {
super(columnModel, createEmptyRowIsEmpty, createEmptyRowIsEmpty);
this.uiModel = uiModel;
+ this.splitMode = splitMode;
setNoneEditableCols(READ_ONLY_CATEGORY_VALUE);
}
@@ -77,7 +86,24 @@
SplitSpeciesBatchRowModel result = new SplitSpeciesBatchRowModel();
result.setCategoryType(uiModel.getSelectedCategory());
result.setValid(false);
+ result.setEditable(true);
return result;
}
+ @Override
+ protected boolean isCellEditable(int rowIndex,
+ int columnIndex,
+ ColumnIdentifier<SplitSpeciesBatchRowModel> propertyName) {
+
+ boolean result = super.isCellEditable(rowIndex,
+ columnIndex,
+ propertyName);
+ if (result && !splitMode) {
+ // if editable and on edit mode, use editable property on row
+ SplitSpeciesBatchRowModel entry = getEntry(rowIndex);
+ result = entry.isEditable();
+ }
+ return result;
+ }
+
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -24,8 +24,10 @@
* #L%
*/
+import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.data.SampleCategory;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModel;
import fr.ifremer.tutti.persistence.entities.data.SampleCategoryModelEntry;
@@ -53,7 +55,9 @@
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.Serializable;
import java.util.List;
+import java.util.Map;
/**
* Handler of {@link SplitSpeciesBatchUI}.
@@ -307,6 +311,61 @@
model.setBatch(batch);
}
+ public void editBatch(SpeciesBatchRowModel batch,
+ int sampleCategoryId) {
+
+ Preconditions.checkNotNull(batch);
+ Preconditions.checkNotNull(sampleCategoryId);
+
+ List<SpeciesBatchRowModel> rows = batch.getChildBatch();
+ Preconditions.checkNotNull(rows);
+
+ // get possible the last used
+ List<SampleCategoryModelEntry> categories = Lists.newArrayList();
+
+ // get sample category model
+ SampleCategoryModel sampleCategoryModel =
+ getModel().getSampleCategoryModel();
+
+ // set only the given category
+ SampleCategoryModelEntry selectedCategory =
+ sampleCategoryModel.getCategoryById(sampleCategoryId);
+ categories.add(selectedCategory);
+
+ SplitSpeciesBatchUIModel model = getModel();
+
+ // connect model to validator
+ ui.getValidator().setBean(model);
+
+ model.setSampleWeight(null);
+ model.setCategory(categories);
+ model.setSelectedCategory(selectedCategory);
+
+ // keep batch (will be used to push back editing entry)
+ model.setBatch(batch);
+
+ // add existing rows
+ Map<Serializable, SplitSpeciesBatchRowModel> rowsByValue = Maps.uniqueIndex(model.getRows(), new Function<SplitSpeciesBatchRowModel, Serializable>() {
+ @Override
+ public Serializable apply(SplitSpeciesBatchRowModel input) {
+ return input.getCategoryValue();
+ }
+ });
+ for (SpeciesBatchRowModel row : rows) {
+
+ SampleCategory<?> sampleCategory = row.getSampleCategoryById(sampleCategoryId);
+ Serializable categoryValue = sampleCategory.getCategoryValue();
+ SplitSpeciesBatchRowModel splitRow = rowsByValue.get(categoryValue);
+ splitRow.setWeight(sampleCategory.getCategoryWeight());
+ splitRow.setSelected(true);
+ splitRow.setEditable(false);
+ }
+
+ computeSampleWeight();
+
+ getTableModel().fireTableDataChanged();
+ }
+
public void save() {
if (log.isDebugEnabled()) {
@@ -316,10 +375,18 @@
EditCatchesUI parent = SwingUtil.getParentContainer(ui, EditCatchesUI.class);
SplitSpeciesBatchUIModel model = getModel();
if (model.isValid()) {
- parent.getSpeciesTabContent().getHandler().splitBatch(
- model.getSelectedCategory(),
- model.getRows(),
- model.getSampleWeight());
+ if (model.isSplitMode()) {
+ parent.getSpeciesTabContent().getHandler().splitBatch(
+ model.getSelectedCategory(),
+ model.getRows(),
+ model.getSampleWeight());
+ } else {
+ parent.getSpeciesTabContent().getHandler().addSampleCategoryBatch(
+ model.getBatch(),
+ model.getSelectedCategory(),
+ model.getRows(),
+ model.getSampleWeight());
+ }
}
// close dialog
@@ -401,7 +468,8 @@
SplitSpeciesBatchTableModel tableModel =
new SplitSpeciesBatchTableModel(columnModel,
getModel(),
- editableCategoryValue);
+ editableCategoryValue,
+ getModel().isSplitMode());
JXTable table = getTable();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-09-26 17:29:01 UTC (rev 1232)
@@ -52,6 +52,8 @@
public static final String PROPERTY_SAMPLE_WEIGHT = "sampleWeight";
+ public static final String PROPERTY_SPLIT_MODE = "splitMode";
+
/**
* Batch which fires the editor.
*
@@ -94,6 +96,12 @@
*/
protected final WeightUnit weightUnit;
+ /**
+ * Is ui in split mode ?
+ * @since 2.6
+ */
+ protected boolean splitMode = true;
+
public SplitSpeciesBatchUIModel(WeightUnit weightUnit,
SampleCategoryModel sampleCategoryModel) {
super(SpeciesBatchRowModel.class, null, null);
@@ -154,4 +162,14 @@
public SampleCategoryModel getSampleCategoryModel() {
return sampleCategoryModel;
}
+
+ public boolean isSplitMode() {
+ return splitMode;
+ }
+
+ public void setSplitMode(boolean splitMode) {
+ Object oldValue = isSplitMode();
+ this.splitMode = splitMode;
+ firePropertyChange(PROPERTY_SPLIT_MODE, oldValue,splitMode);
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-09-26 17:29:01 UTC (rev 1232)
@@ -14,6 +14,8 @@
tutti.about.update.content=
tutti.about.update.title=
tutti.action.create.error=
+tutti.addSampleCategoryBenthosBatch.title=
+tutti.addSampleCategorySpeciesBatch.title=
tutti.applicationUpdater.prepareFirstDB.copyDirectory.error=
tutti.applicationUpdater.prepareFirstDB.deleteDirectory.error=
tutti.applicationUpdater.startUpdate.db.installation=
@@ -362,6 +364,9 @@
tutti.editAccidentalBatch.table.header.species.tip=
tutti.editAccidentalBatch.table.header.weight=
tutti.editAccidentalBatch.table.header.weight.tip=
+tutti.editBenthosBatch.action.addSampleCategory=
+tutti.editBenthosBatch.action.addSampleCategory.mnemonic=
+tutti.editBenthosBatch.action.addSampleCategory.tip=
tutti.editBenthosBatch.action.changeSampleCategory=
tutti.editBenthosBatch.action.changeSampleCategory.mnemonic=
tutti.editBenthosBatch.action.changeSampleCategory.tip=
@@ -883,6 +888,9 @@
tutti.editSampleCategoryModel.table.header.label=
tutti.editSampleCategoryModel.table.header.label.tip=
tutti.editSampleCategoryModel.title=
+tutti.editSpeciesBatch.action.addSampleCategory=
+tutti.editSpeciesBatch.action.addSampleCategory.mnemonic=
+tutti.editSpeciesBatch.action.addSampleCategory.tip=
tutti.editSpeciesBatch.action.changeSampleCategory=
tutti.editSpeciesBatch.action.changeSampleCategory.mnemonic=
tutti.editSpeciesBatch.action.changeSampleCategory.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-09-26 11:07:00 UTC (rev 1231)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-09-26 17:29:01 UTC (rev 1232)
@@ -14,6 +14,8 @@
tutti.about.update.content=<h2>Mise à jour de Tutti</h2><p>Fichier des mises à jour \: <ul><li>Applicatif \: <a href\="%1$s">%1$s</a></li><li>Base de données \: <a href\="%2$s">%2$s</a></li></ul></p><br/><hr/><br/><table><CAPTION><EM>Mises à jour des modules</EM></CAPTION><tr><th>Module</th><th>Version installée</th><th>Dernière version</th><th></th></tr>%3$s</table>
tutti.about.update.title=Mise à jour Tutti
tutti.action.create.error=Erreur à l'instanciation de l'action %s
+tutti.addSampleCategoryBenthosBatch.title=Catégorisation du lot (ajout)
+tutti.addSampleCategorySpeciesBatch.title=Catégorisation du lot (ajout)
tutti.applicationUpdater.prepareFirstDB.copyDirectory.error=Erreur lors de la copie du contenu du dossier %1s vers %2s
tutti.applicationUpdater.prepareFirstDB.deleteDirectory.error=Erreur lors de la suppression du dossier %s
tutti.applicationUpdater.startUpdate.db.installation=Téléchargement et installation de la base (version %s)
@@ -361,6 +363,9 @@
tutti.editAccidentalBatch.table.header.species.tip=Espèce
tutti.editAccidentalBatch.table.header.weight=Poids observé
tutti.editAccidentalBatch.table.header.weight.tip=Poids observé
+tutti.editBenthosBatch.action.addSampleCategory=Ajouter une catégorie
+tutti.editBenthosBatch.action.addSampleCategory.mnemonic=A
+tutti.editBenthosBatch.action.addSampleCategory.tip=Ajouter une catégorie manquante
tutti.editBenthosBatch.action.changeSampleCategory=Modifier la catégorie
tutti.editBenthosBatch.action.changeSampleCategory.mnemonic=M
tutti.editBenthosBatch.action.changeSampleCategory.tip=Modifier la catégorie de la cellule sélectionnée
@@ -884,6 +889,9 @@
tutti.editSampleCategoryModel.table.header.label=Label
tutti.editSampleCategoryModel.table.header.label.tip=Label de la catéogire (sera utilisée dans les entêtes de tableau)
tutti.editSampleCategoryModel.title=Configurer les catégorisations
+tutti.editSpeciesBatch.action.addSampleCategory=Ajouter une catégorie
+tutti.editSpeciesBatch.action.addSampleCategory.mnemonic=A
+tutti.editSpeciesBatch.action.addSampleCategory.tip=Ajouter une catégorie manquante
tutti.editSpeciesBatch.action.changeSampleCategory=Modifier la catégorie
tutti.editSpeciesBatch.action.changeSampleCategory.mnemonic=M
tutti.editSpeciesBatch.action.changeSampleCategory.tip=Modifier la catégorie de la cellule sélectionnée
1
0
r1231 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table
by tchemit@users.forge.codelutin.com 26 Sep '13
by tchemit@users.forge.codelutin.com 26 Sep '13
26 Sep '13
Author: tchemit
Date: 2013-09-26 13:07:00 +0200 (Thu, 26 Sep 2013)
New Revision: 1231
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1231
Log:
fixes #3340: [CAPTURE] Mauvais enregistrement de la valeur "A Confirmer" dans les onglets Esp?\195?\169ces et Benthos
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-09-26 07:38:06 UTC (rev 1230)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableUIHandler.java 2013-09-26 11:07:00 UTC (rev 1231)
@@ -347,37 +347,46 @@
@Override
public void valueChanged(ListSelectionEvent e) {
- if (!e.getValueIsAdjusting()) {
- ListSelectionModel source = (ListSelectionModel) e.getSource();
+ if (log.isDebugEnabled()) {
+ log.debug("Selection changed: " + e);
+ }
+ // need this for the first modification when no selection,
+ // otherwise monitor is set after the first alter, so won't be
+ // save directly...
+ //if (!e.getValueIsAdjusting()) {
+ ListSelectionModel source = (ListSelectionModel) e.getSource();
- int oldRowIndex = selectedRowIndex;
- R oldRow = rowMonitor.getBean();
+ int oldRowIndex = selectedRowIndex;
+ int newRowIndex = source.getLeadSelectionIndex();
+ if (oldRowIndex == newRowIndex) {
+ return;
+ }
+ R oldRow = rowMonitor.getBean();
- int newRowIndex = source.getLeadSelectionIndex();
- R newRow;
+ R newRow;
- if (source.isSelectionEmpty()) {
+ if (source.isSelectionEmpty()) {
- newRow = null;
- } else {
- newRow = getTableModel().getEntry(newRowIndex);
- }
+ newRow = null;
+ } else {
+ newRow = getTableModel().getEntry(newRowIndex);
+ }
- // save selected entry if required
+ // save selected entry if required
// saveSelectedRowIfNeeded();
- if (log.isDebugEnabled()) {
- log.debug("Will monitor entry: " + newRow);
- }
- rowMonitor.setBean(newRow);
+ if (log.isDebugEnabled()) {
+ log.debug("Will monitor entry: " + newRow);
+ }
+ rowMonitor.setBean(newRow);
- selectedRowIndex = newRowIndex;
+ selectedRowIndex = newRowIndex;
- onAfterSelectedRowChanged(oldRowIndex,
- oldRow,
- selectedRowIndex,
- rowMonitor.getBean());
- }
+ onAfterSelectedRowChanged(oldRowIndex,
+ oldRow,
+ selectedRowIndex,
+ rowMonitor.getBean());
+ //}
}
};
1
0