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
February 2013
- 6 participants
- 236 discussions
r430 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation/catches java/fr/ifremer/tutti/ui/swing/content/operation/catches/species resources/i18n
by kmorin@users.forge.codelutin.com 15 Feb '13
by kmorin@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: kmorin
Date: 2013-02-15 20:16:17 +0100 (Fri, 15 Feb 2013)
New Revision: 430
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/430
Log:
resolves #2003
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-15 18:55:19 UTC (rev 429)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-15 19:16:17 UTC (rev 430)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Map;
@@ -54,6 +55,10 @@
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(ComputeWeightsAction.class);
+
+ protected String errorMessage;
+ protected String errorTitle;
+ protected Component errorComponent;
protected enum Weights {
UNSORTED, SAMPLE_SORTED, SORTED, TOTAL
@@ -83,21 +88,32 @@
Float rejectedWeight = model.getCatchTotalRejectedWeight();
if (rejectedWeight == null && totalWeight != null) {
- model.setCatchTotalRejectedComputedWeight(totalWeight
- - speciesWeights.get(Weights.UNSORTED)
- - speciesWeights.get(Weights.SORTED));
-
+ if (!totalWeight.equals(speciesWeights.get(Weights.UNSORTED)
+ + speciesWeights.get(Weights.SORTED))) {
+ errorMessage = _("tutti.action.computeWeights.error.incoherentTotal");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentTotal.title");
+ errorComponent = ui.getCatchTotalWeightField();
+
+ } else {
+
+ model.setCatchTotalRejectedComputedWeight(totalWeight
+ - speciesWeights.get(Weights.UNSORTED)
+ - speciesWeights.get(Weights.SORTED));
+ }
+
} else if (totalWeight == null) {
if (rejectedWeight == null) {
rejectedWeight = 0f;
}
model.setCatchTotalComputedWeight(speciesWeights.get(Weights.UNSORTED)
- + speciesWeights.get(Weights.SORTED)+ rejectedWeight);
+ + speciesWeights.get(Weights.SORTED)+ rejectedWeight);
} else if (rejectedWeight != null
&& !totalWeight.equals(speciesWeights.get(Weights.UNSORTED)
- + speciesWeights.get(Weights.SORTED)+ rejectedWeight)) {
- // TODO handle error
+ + speciesWeights.get(Weights.SORTED) + rejectedWeight)) {
+ errorMessage = _("tutti.action.computeWeights.error.incoherentTotal");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentTotal.title");
+ errorComponent = ui.getCatchTotalWeightField();
}
}
@@ -160,7 +176,10 @@
model.setSpeciesTotalSortedComputedWeight(totalSortedWeight);
} else if (speciesTotalSortedWeight < totalSortedWeight) {
- // TODO handle error
+ errorMessage = _("tutti.action.computeWeights.error.incoherentSpeciesTotalSorted");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentSpeciesTotalSorted.title");
+ errorComponent = ui.getSpeciesTotalSortedWeightField();
+
} else if (speciesTotalSortedWeight < 1.05 * totalSortedWeight) {
// TODO Si le "Poids total VRAC" est saisi est que sa valeur
// est supérieure de moins de x% (x en configuration)
@@ -217,7 +236,9 @@
}
} else if (categoryWeight < sum) {
- // handle error
+ errorMessage = _("tutti.action.computeWeights.error.incoherentParentCategoryWeight");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentParentCategoryWeight.title");
+ errorComponent = null;
} else {
boolean subSample = categoryWeight > sum;
@@ -252,7 +273,9 @@
}
if (categoryWeight == null && rowWeight != null) {
- //TODO handle error
+ errorMessage = _("tutti.action.computeWeights.error.incoherentRowWeightCategory");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentRowWeightCategory.title");
+ errorComponent = null;
} else if (categoryWeight == null && frequencyWeight != null) {
// if the category weight is null and the frequencies have a weight,
@@ -266,13 +289,17 @@
// if the weight of the frequencies is different from the category
// weight, then set the weight of the sample
if (categoryWeight != null && frequencyWeight > categoryWeight) {
- //TODO handle error
+ errorMessage = _("tutti.action.computeWeights.error.incoherentCategoryWeight");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentCategoryWeight.title");
+ errorComponent = null;
} else if (rowWeight == null) {
row.setComputedWeight(frequencyWeight);
} else if (!rowWeight.equals(frequencyWeight)) {
- //TODO handle error
+ errorMessage = _("tutti.action.computeWeights.error.incoherentRowWeightFrequency");
+ errorTitle = _("tutti.action.computeWeights.error.incoherentRowWeightFrequency.title");
+ errorComponent = null;
}
result = categoryWeight;
@@ -297,4 +324,21 @@
}
textField.setText(textValue);
}
+
+ @Override
+ protected void releaseAction(ActionEvent event) {
+ if (errorMessage != null) {
+ JOptionPane.showMessageDialog(
+ getUI(),
+ errorMessage,
+ errorTitle,
+ JOptionPane.ERROR_MESSAGE);
+ }
+ if (errorComponent != null) {
+ errorComponent.requestFocus();
+ }
+ errorMessage = null;
+ errorComponent = null;
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-02-15 18:55:19 UTC (rev 429)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-02-15 19:16:17 UTC (rev 430)
@@ -28,6 +28,8 @@
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -154,6 +156,33 @@
public EditCatchesUIModel() {
super(CatchBatch.class, fromBeanBinder, toBeanBinder);
+ speciesTotalSortedComputedOrNotWeight.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
+ evt.getOldValue(), evt.getNewValue());
+ }
+ });
+ catchTotalComputedOrNotWeight.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_CATCH_TOTAL_WEIGHT,
+ evt.getOldValue(), evt.getNewValue());
+ }
+ });
+ catchTotalRejectedComputedOrNotWeight.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_CATCH_TOTAL_COMPUTED_WEIGHT,
+ evt.getOldValue(), evt.getNewValue());
+ }
+ });
}
@Override
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-02-15 18:55:19 UTC (rev 429)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-02-15 19:16:17 UTC (rev 430)
@@ -41,7 +41,6 @@
import fr.ifremer.tutti.persistence.entities.referential.CaracteristicQualitativeValue;
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.service.DecoratorService;
-import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.TuttiUI;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchTableUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
@@ -89,10 +88,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.swing.border.LineBorder;
-import jaxx.runtime.swing.JAXXWidgetUtil;
-import jaxx.runtime.swing.editor.cell.NumberCellEditor;
-import org.apache.commons.lang.reflect.ConstructorUtils;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -293,12 +288,9 @@
@Override
protected void saveSelectedRowIfRequired(TuttiBeanMonitor<SpeciesBatchRowModel> rowMonitor,
SpeciesBatchRowModel row) {
-log.debug("saveSelectedRowIfRequired");
if (row.isValid()) {
// there is a valid bean attached to the monitor
-log.debug("isValid");
if (rowMonitor.wasModified()) {
-log.debug("wasModified");
// monitored bean was modified, save it
if (log.isInfoEnabled()) {
@@ -315,7 +307,6 @@
rowMonitor.clearModified();
}
} else {
-log.debug("wasNotModified");
//FIXME See how to delete rows ? Or moreover how to save tehem...
if (log.isWarnEnabled()) {
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-02-15 18:55:19 UTC (rev 429)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-02-15 19:16:17 UTC (rev 430)
@@ -30,6 +30,18 @@
tutti.action.closeDb=Fermer
tutti.action.closeDb.tip=Fermer la base de données en cours d'utilisation
tutti.action.computeWeights=Elever les poids
+tutti.action.computeWeights.error.incoherentCategoryWeight=Le poids total des mensurations est supérieur au poids de la catégorie
+tutti.action.computeWeights.error.incoherentCategoryWeight.title=Incohérence
+tutti.action.computeWeights.error.incoherentParentCategoryWeight=Le poids de la catégorie est différent de la somme des poids de ses sous-catégories
+tutti.action.computeWeights.error.incoherentParentCategoryWeight.title=Incohérence
+tutti.action.computeWeights.error.incoherentRowWeightCategory=Le poids de la catégorie ne peut pas être nul si le poids de sous-échantillonage est renseigné
+tutti.action.computeWeights.error.incoherentRowWeightCategory.title=Incohérence
+tutti.action.computeWeights.error.incoherentRowWeightFrequency=Le poids total des mensurations est différent du poids du sous-échantillon
+tutti.action.computeWeights.error.incoherentRowWeightFrequency.title=Incohérence
+tutti.action.computeWeights.error.incoherentSpeciesTotalSorted=Le poids total Vrac des espèces est inférieur à la somme des poids Vrac triés, inerte trié et vivant non détaillé trié
+tutti.action.computeWeights.error.incoherentSpeciesTotalSorted.title=Incohérence
+tutti.action.computeWeights.error.incoherentTotal=Le poids total de la capture ne correspond pas à la somme des poids totaux Vrac, Hors Vrac et non triés
+tutti.action.computeWeights.error.incoherentTotal.title=Incohérence
tutti.action.computeWeights.tip=Elever les poids
tutti.action.configuration=Configuration
tutti.action.configuration.tip=Configurer Tutti
@@ -106,7 +118,6 @@
tutti.action.newProgram.tip=Créer une nouvelle série de campagne
tutti.action.newProtocol=Nouveau
tutti.action.newProtocol.tip=Créer un nouveau protocole
-tutti.action.ok=Fermer
tutti.action.openDb=Ouvrir
tutti.action.openDb.tip=Ouvrir la base de données détectée par Tutti
tutti.action.reload.actions=Recharger les actions
@@ -159,7 +170,6 @@
tutti.dialog.askCancelEditBeforeLeaving.cancelEditFishingOperation=Le trait modifié n'est pas valide. Voulez-vous annuler les modifications ?
tutti.dialog.askCancelEditBeforeLeaving.title=Modifications non enregistrées mais invalides
tutti.dialog.askSaveBeforeLeaving.createFishingOperation=Le trait n'a pas été créé. Voulez-vous l'enregistrer ?
-tutti.dialog.askSaveBeforeLeaving.message=Vous avez fait des modifications que vous n'avez pas enregistrées. Voulez-vous les enregistrer ?
tutti.dialog.askSaveBeforeLeaving.saveCatchBatch=La capture a été modifiée. Voulez-vous enregistrer les modifications ?
tutti.dialog.askSaveBeforeLeaving.saveCruise=La campagne a été modifiée. Voulez-vous enregistrer les modifications ?
tutti.dialog.askSaveBeforeLeaving.saveFishingOperation=Le trait a été modifié. Voulez-vous enregistrer les modifications ?
@@ -182,8 +192,6 @@
tutti.flash.information.species.imported.in.protocol=Espèces importées dans le protocole depuis le fichier %s.
tutti.flash.information.species.remove.from.protocol=L'espèce %s a été retirée du protocole
tutti.information.db.loaded=Tutti est connecté à une base de données
-tutti.information.no.db.connected=Aucune base de données connectée à Tutti.
-tutti.information.no.db.exist=Tutti n'a pas trouvée de base à utiliser, vous pouvez l'installer.
tutti.information.no.db.loaded=Tutti a détecté une base mais elle n'est pas actuellement ouverte.
tutti.label.attachmentEditor.file=Fichier
tutti.label.attachmentEditor.fileComment=Commentaire
@@ -194,8 +202,6 @@
tutti.label.catches.benthosTotalWeight=Poids TOTAL (kg)
tutti.label.catches.catchThalassa=(*) uniquement sur Thalassa
tutti.label.catches.catchTotalRejectedWeight=Poids total NON TRIÉ (kg)
-tutti.label.catches.catchTotalSortedCarousselWeight=Caroussel Observé (*)
-tutti.label.catches.catchTotalSortedTremisWeight=Tremie (*)
tutti.label.catches.catchTotalSortedWeight=Poids total VRAC (kg)
tutti.label.catches.catchTotalUnsortedWeight=Poids total HORS VRAC (kg)
tutti.label.catches.catchTotalWeight=Poids TOTAL (kg)
@@ -327,8 +333,6 @@
tutti.menu.file.tip=Fichier
tutti.menu.help=Aide
tutti.menu.help.tip=Aide
-tutti.menu.referential=Référentiels
-tutti.menu.referential.tip=Gestion des référentiels
tutti.menu.synchronisationAllegro=Allégro
tutti.menu.synchronisationAllegro.tip=Synchronisation Allégro
tutti.menu.synchronisationExport=Export
1
0
r429 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing java/fr/ifremer/tutti/ui/swing/content/db java/fr/ifremer/tutti/ui/swing/util/action resources/i18n
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 19:55:19 +0100 (Fri, 15 Feb 2013)
New Revision: 429
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/429
Log:
improve db actions + load db after ui is visible to use action api + improve db update behaviour
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.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/MainUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/MainUIHandler.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.ui.swing.config.TuttiConfigUI;
import fr.ifremer.tutti.ui.swing.content.cruise.EditCruiseUI;
import fr.ifremer.tutti.ui.swing.content.db.DbManagerUI;
+import fr.ifremer.tutti.ui.swing.content.db.OpenDbAction;
import fr.ifremer.tutti.ui.swing.content.home.SelectCruiseUI;
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
import fr.ifremer.tutti.ui.swing.content.program.EditProgramUI;
@@ -124,17 +125,20 @@
JToolBar bar = ui.getBottomBar();
ui.getStatus().addWidget(bar, 0);
- TuttiScreen screen;
+ if (!context.isDbExist()) {
- if (context.isDbExist() && context.isDbLoaded()) {
+ // clean db context
+ context.clearDbContext();
- screen = TuttiScreen.SELECT_CRUISE;
+ // go to manage db screen (to install db)
+ context.setScreen(TuttiScreen.MANAGE_DB);
} else {
- screen = TuttiScreen.MANAGE_DB;
+ // open tutti db
+ OpenDbAction openDbAction = createAction(OpenDbAction.class);
+ openDbAction.setCheckDbContext(true);
+ openDbAction.actionPerformed(null);
}
-
- context.setScreen(screen);
}
@Override
@@ -431,60 +435,67 @@
protected String getSelectedCruiseTitle() {
- String programId = context.getProgramId();
String title;
- if (programId == null) {
+ if (context.isDbLoaded()) {
- // no program selected (so neither cruise)
+ String programId = context.getProgramId();
- title = _("tutti.title.noSelectedProgram");
+ if (programId == null) {
- } else {
+ // no program selected (so neither cruise)
- // selected program
+ title = _("tutti.title.noSelectedProgram");
- Program program = persistenceService.getProgram(programId);
+ } else {
- title = _("tutti.title.selectedProgram", program.getName()) + " / ";
+ // selected program
- String cruiseId = context.getCruiseId();
+ Program program = persistenceService.getProgram(programId);
- if (cruiseId == null) {
+ title = _("tutti.title.selectedProgram", program.getName()) + " / ";
- // no selected cruise
+ String cruiseId = context.getCruiseId();
- title += _("tutti.title.noSelectedCruise");
+ if (cruiseId == null) {
- } else {
+ // no selected cruise
- // selected cruise
- Cruise cruise;
- cruise = persistenceService.getCruise(cruiseId);
+ title += _("tutti.title.noSelectedCruise");
- title += _("tutti.title.selectedCruise", cruise.getName());
- }
+ } else {
- title += " / ";
+ // selected cruise
+ Cruise cruise;
+ cruise = persistenceService.getCruise(cruiseId);
- String protocolId = context.getProtocolId();
+ title += _("tutti.title.selectedCruise", cruise.getName());
+ }
- if (protocolId == null) {
+ title += " / ";
- // no selected protocol
+ String protocolId = context.getProtocolId();
- title += _("tutti.title.noSelectedProtocol");
+ if (protocolId == null) {
- } else {
+ // no selected protocol
- // selected protocol
- TuttiProtocol protocol = persistenceService.getProtocol(protocolId);
+ title += _("tutti.title.noSelectedProtocol");
- title += _("tutti.title.selectedProtocol", protocol.getName());
+ } else {
+
+ // selected protocol
+ TuttiProtocol protocol = persistenceService.getProtocol(protocolId);
+
+ title += _("tutti.title.selectedProtocol", protocol.getName());
+ }
+
}
+ } else {
+ title = _("tutti.title.nodb");
+ }
- }
return title;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/RunTutti.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -79,7 +79,7 @@
new UpdateApplicationAction(handler).doAction(null);
// try to update db
- new UpdateReferentialAction(handler).doAction(null);
+// new UpdateReferentialAction(handler).doAction(null);
}
// Prepare ui look&feel and load ui properties
@@ -117,7 +117,7 @@
ui.dispose();
if (exit) {
- System.exit(1);
+ System.exit(0);
}
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -67,6 +67,8 @@
protected ProgressionModel progressionModel;
+ protected boolean dbUpdated;
+
public TuttiApplicationUpdaterCallBack(TuttiUIContext context, ProgressionModel progressionModel) {
this.context = context;
this.progressionModel = progressionModel;
@@ -76,6 +78,10 @@
this.types = Lists.newArrayList(types);
}
+ public boolean isDbUpdated() {
+ return dbUpdated;
+ }
+
@Override
public Map<String, ApplicationUpdater.ApplicationInfo> updateToDo(Map<String, ApplicationUpdater.ApplicationInfo> appToUpdate) {
Map<String, ApplicationUpdater.ApplicationInfo> result = Maps.newHashMap();
@@ -97,8 +103,9 @@
ApplicationUpdater.ApplicationInfo info = getInfo(UpdateType.DB, result);
if (info == null) {
- String message = "Aucune mise à jour de base détectée.";
- context.showInformationMessage(message);
+ dbUpdated=false;
+ } else {
+ dbUpdated=true;
}
}
return result;
@@ -113,7 +120,6 @@
} else {
progressionModel.setMessage("Téléchargement et mise à jour de la base (version " + info.newVersion + ")");
}
-
}
if (UpdateType.JRE.name().toLowerCase().equals(info.name)) {
progressionModel.setMessage("Téléchargement et installation d'une nouvelle JRE (version " + info.newVersion + ")");
@@ -296,6 +302,7 @@
} catch (IOException e) {
throw new RuntimeException("Could not delete temporary directory " + target, e);
}
+
}
protected void synchronizetDatabase(ApplicationUpdater.ApplicationInfo info) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUIContext.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -455,80 +455,6 @@
setProgramId(null);
setCruiseId(null);
setDbLoaded(false);
-
- } else {
-
- setDbLoaded(true);
-
- //check if programId is sane
- PersistenceService service = getService(PersistenceService.class);
-
- if (isProtocolFilled()) {
-
- if (!service.isProtocolExist(protocolId)) {
-
- // not found in this db
-
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid protocolId: " + protocolId);
- }
-
- setProtocolId(null);
- }
- }
-
- if (isProgramFilled()) {
-
- Program program = service.getProgram(programId);
- if (program == null) {
-
- // not found in this db
-
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid programId: " + programId);
- }
-
- setProgramId(null);
- setCruiseId(null);
-
- } else {
-
- if (log.isInfoEnabled()) {
- log.info("ProgramId valid: " + programId);
- }
-
- setProgramId(programId);
-
- // test cruiseId
- if (isCruiseFilled()) {
-
- Cruise cruise = service.getCruise(cruiseId);
-
- if (cruise != null &&
- !cruise.getProgram().getId().equals(programId)) {
-
- // not matchin program, reset cruise id
- cruise = null;
- }
-
- if (cruise == null) {
-
- // not found in this db
-
- if (log.isWarnEnabled()) {
- log.warn("Remove invalid cruiseId: " + cruiseId);
- }
- setCruiseId(null);
-
- } else {
-
- if (log.isInfoEnabled()) {
- log.info("CruiseId valid: " + cruiseId);
- }
- }
- }
- }
- }
}
// save back to config
@@ -576,9 +502,6 @@
// close action ui
actionUI.getModel().setProgressionModel(null);
actionUI.getModel().setAction(null);
-
-// // hide it
-// actionUI.setVisible(false);
}
setActionUI(null);
}
@@ -624,4 +547,86 @@
public TuttiActionUI getActionUI() {
return actionUI;
}
+
+ public void clearDbContext() {
+ protocolId = null;
+ programId = null;
+ cruiseId = null;
+ saveContextToConfig();
+ }
+
+ public void checkDbContext() {
+
+ //check if programId is sane
+ PersistenceService service = getService(PersistenceService.class);
+
+ if (isProtocolFilled()) {
+
+ if (!service.isProtocolExist(protocolId)) {
+
+ // not found in this db
+
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid protocolId: " + protocolId);
+ }
+
+ setProtocolId(null);
+ }
+ }
+
+ if (isProgramFilled()) {
+
+ Program program = service.getProgram(programId);
+ if (program == null) {
+
+ // not found in this db
+
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid programId: " + programId);
+ }
+
+ setProgramId(null);
+ setCruiseId(null);
+
+ } else {
+
+ if (log.isInfoEnabled()) {
+ log.info("ProgramId valid: " + programId);
+ }
+
+ setProgramId(programId);
+
+ // test cruiseId
+ if (isCruiseFilled()) {
+
+ Cruise cruise = service.getCruise(cruiseId);
+
+ if (cruise != null &&
+ !cruise.getProgram().getId().equals(programId)) {
+
+ // not matchin program, reset cruise id
+ cruise = null;
+ }
+
+ if (cruise == null) {
+
+ // not found in this db
+
+ if (log.isWarnEnabled()) {
+ log.warn("Remove invalid cruiseId: " + cruiseId);
+ }
+ setCruiseId(null);
+
+ } else {
+
+ if (log.isInfoEnabled()) {
+ log.info("CruiseId valid: " + cruiseId);
+ }
+ }
+ }
+ }
+ }
+
+ saveContextToConfig();
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/UpdateReferentialAction.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -82,11 +82,18 @@
false,
callback);
- progressionModel.setMessage("Rechargement de la base de données");
+ if (callback.isDbUpdated()) {
- getContext().setDbLoaded(true);
- getHandler().reloadPersistenceService();
+ progressionModel.setMessage("Rechargement de la base de données");
+ getContext().setDbLoaded(true);
+ getHandler().reloadPersistenceService();
+
+
+ } else {
+ sendMessage("Aucune mise à jour de base détectée.");
+ }
+
getContext().getActionUI().getModel().setProgressionModel(null);
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.css 2013-02-15 18:55:19 UTC (rev 429)
@@ -27,28 +27,34 @@
horizontalAlignment: {JLabel.CENTER};
}
+#noDbActions {
+ visible: {!model.isDbExist()};
+}
+
#installDbButton {
- enabled: {!model.isDbExist()};
_tuttiAction: {InstallDbAction.class};
}
+#withDbActions {
+ visible: {model.isDbExist()};
+}
+
#openDbButton {
- enabled: {model.isDbExist() && !model.isDbLoaded()};
+ enabled: {!model.isDbLoaded()};
_tuttiAction: {OpenDbAction.class};
}
#upgradeDbButton {
- enabled: {model.isDbExist() && model.isDbLoaded()};
+ enabled: {model.isDbLoaded()};
_tuttiAction: {UpdateReferentialAction.class};
}
#closeDbButton {
- enabled: {model.isDbExist() && model.isDbLoaded()};
+ enabled: {model.isDbLoaded()};
_tuttiAction: {CloseDbAction.class};
}
#exportDbButton {
- enabled: false;
- /*enabled: {model.isDbExist() && model.isDbLoaded()};*/
+ enabled: {model.isDbLoaded()};
_tuttiAction: {ExportDbAction.class};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUI.jaxx 2013-02-15 18:55:19 UTC (rev 429)
@@ -53,11 +53,15 @@
<TuttiUIContext id='model'
initializer='getContextValue(TuttiUIContext.class)'/>
+ <JLabel id='informationLabel' constraints='BorderLayout.CENTER'/>
<JPanel id='centerPanel' layout='{new BorderLayout()}'
- constraints='BorderLayout.CENTER'>
- <JLabel id='informationLabel' constraints='BorderLayout.CENTER'/>
- <JPanel constraints='BorderLayout.SOUTH' layout='{new GridLayout(0, 1)}'>
+ constraints='BorderLayout.SOUTH'>
+ <JPanel id='noDbActions' constraints='BorderLayout.CENTER'
+ layout='{new GridLayout(0, 1)}'>
<JButton id='installDbButton'/>
+ </JPanel>
+ <JPanel id='withDbActions' constraints='BorderLayout.SOUTH'
+ layout='{new GridLayout(0, 1)}'>
<JButton id='openDbButton'/>
<JButton id='upgradeDbButton'/>
<JButton id='exportDbButton'/>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/DbManagerUIHandler.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -31,8 +31,6 @@
import org.apache.commons.logging.LogFactory;
import javax.swing.SwingUtilities;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import static org.nuiton.i18n.I18n._;
@@ -52,15 +50,6 @@
@Override
public void beforeInitUI() {
- context.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- String propertyName = evt.getPropertyName();
- String message;
-
-
- }
- });
}
public String updateMessage(boolean dbExist, boolean dbLoaded) {
@@ -91,16 +80,15 @@
initUI(ui);
- ui.applyDataBinding(DbManagerUI.BINDING_INSTALL_DB_BUTTON_ENABLED);
ui.applyDataBinding(DbManagerUI.BINDING_OPEN_DB_BUTTON_ENABLED);
- ui.applyDataBinding(DbManagerUI.BINDING_CLOSE_DB_BUTTON_ENABLED);
ui.applyDataBinding(DbManagerUI.BINDING_UPGRADE_DB_BUTTON_ENABLED);
+ ui.applyDataBinding(DbManagerUI.BINDING_EXPORT_DB_BUTTON_ENABLED);
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
- ui.repaint();
+ getContext().getMainUI().getBody().revalidate();
}
}
);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/OpenDbAction.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -46,9 +46,15 @@
private static final long serialVersionUID = 1L;
/** Logger. */
- private static final Log log =
- LogFactory.getLog(OpenDbAction.class);
+ private static final Log log = LogFactory.getLog(OpenDbAction.class);
+ /**
+ * Flag to sanity or not the db context (and save it in config).
+ *
+ * @since 1.0
+ */
+ protected boolean checkDbContext;
+
public OpenDbAction(MainUIHandler handler) {
super(handler,
"openDb",
@@ -61,6 +67,9 @@
@Override
protected void doAction(ActionEvent event) {
+ if (log.isDebugEnabled()) {
+ log.debug("Will open db...");
+ }
getContext().setDbLoaded(true);
getHandler().reloadPersistenceService();
@@ -68,6 +77,23 @@
sendMessage(String.format("La base de données '%s' est ouverte.", jdbcUrl));
+ if (checkDbContext) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Check db context");
+ }
+ getContext().checkDbContext();
+ }
getContext().setScreen(TuttiScreen.SELECT_CRUISE);
}
+
+ @Override
+ protected void releaseAction(ActionEvent event) {
+ checkDbContext = false;
+ super.releaseAction(event);
+ }
+
+ public void setCheckDbContext(boolean checkDbContext) {
+ this.checkDbContext = checkDbContext;
+ }
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/action/TuttiActionUIHandler.java 2013-02-15 18:55:19 UTC (rev 429)
@@ -27,6 +27,7 @@
import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
+import fr.ifremer.tutti.ui.swing.MainUI;
import fr.ifremer.tutti.ui.swing.TuttiUIContext;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.validator.swing.SwingValidator;
@@ -120,7 +121,10 @@
// starting action
if (ui.getOwner() != null) {
- SwingUtil.center(ui.getOwner(), ui);
+ MainUI mainUI = getContext().getMainUI();
+ if (mainUI != null) {
+ SwingUtil.center(mainUI, ui);
+ }
}
// new action
ui.getGlobalActionLabel().setText(_("tutti.message.action.running", action.getActionDescription()));
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-02-15 18:24:40 UTC (rev 428)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-02-15 18:55:19 UTC (rev 429)
@@ -27,7 +27,7 @@
tutti.action.cloneProtocol=Cloner
tutti.action.cloneProtocol.tip=Dupliquer le protocole sélectionné
tutti.action.close=Fermer
-tutti.action.closeDb=Fermer la base
+tutti.action.closeDb=Fermer
tutti.action.closeDb.tip=Fermer la base de données en cours d'utilisation
tutti.action.computeWeights=Elever les poids
tutti.action.computeWeights.tip=Elever les poids
@@ -57,7 +57,7 @@
tutti.action.exit.tip=Quitter l'application
tutti.action.exportAllCaracteristic=Exporter toutes les caractéristiques
tutti.action.exportAllCaracteristic.tip=Exporter toutes les caractéristiques (sans les affecter à un écran)
-tutti.action.exportDb=Exporter la base
+tutti.action.exportDb=Exporter
tutti.action.exportDb.tip=Exporter la base de données au format zip
tutti.action.exportProtocol=Exporter
tutti.action.exportProtocol.tip=Exporter le protocole sélectionné
@@ -95,7 +95,7 @@
tutti.action.importTemporarySpecies.tip=Importer un référentiel temporaire d'espèces
tutti.action.importTemporaryVessel=Importer
tutti.action.importTemporaryVessel.tip=Importer un référentiel temporaire de navires
-tutti.action.installDb=Installer la base
+tutti.action.installDb=Installer
tutti.action.installDb.tip=Télécharger puis installer la base de données
tutti.action.manageDb=Gestion base
tutti.action.manageDb.tip=Gérer la base de données utilisée par Tutti
@@ -107,7 +107,7 @@
tutti.action.newProtocol=Nouveau
tutti.action.newProtocol.tip=Créer un nouveau protocole
tutti.action.ok=Fermer
-tutti.action.openDb=Ouvrir la base
+tutti.action.openDb=Ouvrir
tutti.action.openDb.tip=Ouvrir la base de données détectée par Tutti
tutti.action.reload.actions=Recharger les actions
tutti.action.reload.application=Recharger l'application
@@ -139,9 +139,9 @@
tutti.action.site.tip=Accéder au site du projet Tutti
tutti.action.splitSpeciesBatch=Catégoriser le lot
tutti.action.splitSpeciesBatch.tip=Catégoriser le lot courant (celui de la ligne sélectionné)
-tutti.action.updateApplication=Mise à jour
-tutti.action.updateApplication.tip=Mettre à jour l'application si nécessaire
-tutti.action.updateReferential=Mise à jour
+tutti.action.updateApplication=Vérifier les mises à jour
+tutti.action.updateApplication.tip=Vérifier les mises à jour logicielles
+tutti.action.updateReferential=Vérifier les mises à jour
tutti.action.updateReferential.tip=Mettre à jour les référentiels si nécessaire
tutti.action.validate=Valider
tutti.action.validateCatches=Valider les captures
@@ -463,6 +463,7 @@
tutti.title.noSelectedCruise=Pas de campagne sélectionné
tutti.title.noSelectedProgram=Pas de série de campagne sélectionné
tutti.title.noSelectedProtocol=Pas de protocol sélectionné
+tutti.title.nodb=Pas de base chargé
tutti.title.selectSpecies=Choisissez une espèce
tutti.title.selectedCruise=Campagne %s
tutti.title.selectedProgram=Série de campagne %s
1
0
r428 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor
by kmorin@users.forge.codelutin.com 15 Feb '13
by kmorin@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: kmorin
Date: 2013-02-15 19:24:40 +0100 (Fri, 15 Feb 2013)
New Revision: 428
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/428
Log:
refs #2003 [CAPTURE] ?\195?\137l?\195?\169vation des poids
remains error cases to treat
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-15 18:24:13 UTC (rev 427)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-15 18:24:40 UTC (rev 428)
@@ -1,10 +0,0 @@
-
-package fr.ifremer.tutti.ui.swing.util.editor;
-
-/**
- *
- * @author kmorin <kmorin(a)codelutin.com>
- */
-public class TuttiComputedOrNotDataEditor {
-
-}
1
0
15 Feb '13
Author: kmorin
Date: 2013-02-15 19:24:13 +0100 (Fri, 15 Feb 2013)
New Revision: 427
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/427
Log:
refs #2003 [CAPTURE] ?\195?\137l?\195?\169vation des poids
remains error cases to treat
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditorHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataTableCell.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.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/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/frequency/FrequencyCellComponent.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css
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/util/TuttiComputedOrNotData.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/AbstractTuttiUIHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -34,6 +34,7 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.UIMessageNotifier;
import fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor;
+import java.awt.Color;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.editor.NumberEditor;
@@ -67,6 +68,7 @@
import javax.swing.text.JTextComponent;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Font;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
@@ -80,6 +82,9 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.swing.JTextField;
+import javax.swing.UIManager;
+import org.apache.commons.lang3.ArrayUtils;
import static org.nuiton.i18n.I18n._;
@@ -288,10 +293,13 @@
Object component = entry.getValue();
if (component instanceof NumberEditor) {
initNumberEditor((NumberEditor) component);
+
} else if (component instanceof JXDatePicker) {
initDatePicker((JXDatePicker) component);
+
} else if (component instanceof SimpleTimeEditor) {
initTimeEditor((SimpleTimeEditor) component);
+
} else if (component instanceof JLabel) {
JLabel jLabel = (JLabel) component;
Boolean strongStyle = (Boolean) jLabel.getClientProperty("strongStyle");
@@ -307,6 +315,18 @@
}
jLabel.setText("<html>" + text + "</html>");
}
+
+ } else if (component instanceof JTextField) {
+ JTextField jTextField = (JTextField) component;
+ Boolean computed = (Boolean) jTextField.getClientProperty("computed");
+ if (computed != null && computed) {
+ Font font = jTextField.getFont().deriveFont(Font.ITALIC);
+ jTextField.setFont(font);
+ jTextField.setEditable(!computed);
+ jTextField.setEnabled(!computed);
+ jTextField.setDisabledTextColor(Color.BLUE);
+ }
+
} else if (component instanceof AbstractButton) {
AbstractButton abstractButton = (AbstractButton) component;
Class<? extends AbstractTuttiAction> actionName = (Class<? extends AbstractTuttiAction>) abstractButton.getClientProperty("tuttiAction");
@@ -551,9 +571,7 @@
protected void listModelIsModify(AbstractTuttiBeanUIModel model) {
model.addPropertyChangeListener(new PropertyChangeListener() {
- final Set<String> excludeProperties = Sets.newHashSet(
- AbstractTuttiBeanUIModel.PROPERTY_MODIFY,
- AbstractTuttiBeanUIModel.PROPERTY_VALID);
+ final Set<String> excludeProperties = getPropertiesToIgnore();
@Override
public void propertyChange(PropertyChangeEvent evt) {
@@ -563,6 +581,12 @@
}
});
}
+
+ protected Set<String> getPropertiesToIgnore() {
+ return Sets.newHashSet(
+ AbstractTuttiBeanUIModel.PROPERTY_MODIFY,
+ AbstractTuttiBeanUIModel.PROPERTY_VALID);
+ }
public <B> void selectFirstInCombo(BeanComboBox<B> combo) {
List<B> data = combo.getData();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiApplicationUpdaterCallBack.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -104,7 +104,6 @@
return result;
}
- @Override
public void startUpdate(ApplicationUpdater.ApplicationInfo info) {
if (UpdateType.DB.name().toLowerCase().equals(info.name)) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/TuttiUI.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -24,6 +24,8 @@
* #L%
*/
+import java.awt.Font;
+import javax.swing.UIManager;
import jaxx.runtime.JAXXObject;
/**
@@ -100,7 +102,7 @@
*
* @since 0.1
*/
- public static final String DECIMAL1_PATTERN = "\\d{0,6}|\\d{1,6}.\\d{0,1}";
+ public static final String DECIMAL1_PATTERN = "\\d{0,6}|\\d{1,6}\\.\\d{0,1}";
/**
* Pattern to use for decimal numeric values with 2 decimal digits in
@@ -108,7 +110,7 @@
*
* @since 0.1
*/
- public static final String DECIMAL2_PATTERN = "\\d{0,6}|\\d{1,6}.\\d{0,2}";
+ public static final String DECIMAL2_PATTERN = "\\d{0,6}|\\d{1,6}\\.\\d{0,2}";
/**
* Pattern to use for decimal numeric values with 3 decimal digits in
@@ -116,17 +118,9 @@
*
* @since 0.1
*/
- public static final String DECIMAL3_PATTERN = "\\d{0,6}|\\d{1,6}.\\d{0,3}";
+ public static final String DECIMAL3_PATTERN = "\\d{0,6}|\\d{1,6}\\.\\d{0,3}";
/**
- * Pattern to use for decimal numeric values with 3 decimal digits in
- * editors.
- *
- * @since 0.1
- */
- public static final String DECIMALFORCE3_PATTERN = "\\d{0,6}|\\d{1,6}.\\d{3}";
-
- /**
* Pattern to use for decimal numeric values with 2 digits + 3 decimal digits in
* editors.
*
@@ -134,4 +128,7 @@
*/
public static final String DECIMAL2_3_PATTERN = "\\d{0,2}|\\d{1,2}\\.\\d{0,3}";
+ public static final Font TEXTFIELD_NORMAL_FONT = UIManager.getDefaults().getFont("TextField.font");
+
+ public static final Font TEXTFIELD_COMPUTED_FONT = UIManager.getDefaults().getFont("TextField.font").deriveFont(Font.ITALIC);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/ComputeWeightsAction.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -25,6 +25,7 @@
* #L%
*/
+import com.google.common.collect.Maps;
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.AbstractTuttiAction;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SampleCategory;
@@ -33,8 +34,13 @@
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import java.awt.event.ActionEvent;
import java.util.List;
+import java.util.Map;
import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+import jaxx.runtime.JAXXUtil;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n._;
@@ -46,6 +52,12 @@
public class ComputeWeightsAction extends AbstractTuttiAction<EditCatchesUIModel, EditCatchesUI, EditCatchesUIHandler> {
private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(ComputeWeightsAction.class);
+
+ protected enum Weights {
+ UNSORTED, SAMPLE_SORTED, SORTED, TOTAL
+ }
public ComputeWeightsAction(EditCatchesUIHandler handler) {
super(handler,
@@ -58,27 +70,61 @@
@Override
protected void doAction(ActionEvent event) throws Exception {
- computeSpeciesBatches();
+ Map<Weights, Float> speciesWeights = computeSpeciesBatches();
+
+ EditCatchesUI ui = getUI();
+ setComputedValue(ui.getCatchTotalUnsortedWeightField(),
+ speciesWeights.get(Weights.UNSORTED));
+ setComputedValue(ui.getCatchTotalSortedWeightField(),
+ speciesWeights.get(Weights.SORTED));
+
+ EditCatchesUIModel model = getModel();
+ Float totalWeight = model.getCatchTotalWeight();
+ Float rejectedWeight = model.getCatchTotalRejectedWeight();
+
+ if (rejectedWeight == null && totalWeight != null) {
+ model.setCatchTotalRejectedComputedWeight(totalWeight
+ - speciesWeights.get(Weights.UNSORTED)
+ - speciesWeights.get(Weights.SORTED));
+
+ } else if (totalWeight == null) {
+ if (rejectedWeight == null) {
+ rejectedWeight = 0f;
+ }
+ model.setCatchTotalComputedWeight(speciesWeights.get(Weights.UNSORTED)
+ + speciesWeights.get(Weights.SORTED)+ rejectedWeight);
+
+ } else if (rejectedWeight != null
+ && !totalWeight.equals(speciesWeights.get(Weights.UNSORTED)
+ + speciesWeights.get(Weights.SORTED)+ rejectedWeight)) {
+ // TODO handle error
+ }
+
}
//------------------------------------------------------------------------//
//-- Internal methods --//
//------------------------------------------------------------------------//
- protected void computeSpeciesBatches() {
+ protected Map<Weights, Float> computeSpeciesBatches() {
+ Map<Weights, Float> result = Maps.newEnumMap(Weights.class);
+
PersistenceService persistenceService =
getService(PersistenceService.class);
+ EditCatchesUIModel model = getModel();
Float totalSortedWeight = 0f;
Float totalUnsortedWeight = 0f;
- SpeciesBatchUI ui = getUI().getSpeciesTabContent();
+ SpeciesBatchUI speciesUI = getUI().getSpeciesTabContent();
+ EditCatchesUI ui = getUI();
+
List<SpeciesBatchRowModel> roots = getUI().getSpeciesTabContent().getModel().getRows();
for (SpeciesBatchRowModel row : roots) {
if (row.isBatchRoot()) {
Float weight = computeSpeciesBatch(row);
if (weight == null) {
JOptionPane.showMessageDialog(
- ui,
+ speciesUI,
_("tutti.dialog.catches.species.computeWeight.error.message"),
_("tutti.dialog.catches.species.computeWeight.error.title"),
JOptionPane.ERROR_MESSAGE);
@@ -93,43 +139,57 @@
}
}
}
- Number inertWeight = ui.getSpeciesTotalInertWeightField().getModel();
+ Number inertWeight = speciesUI.getSpeciesTotalInertWeightField().getModel();
if (inertWeight != null) {
totalSortedWeight += inertWeight.floatValue();
}
- Number livingNotItemizedWeight = ui.getSpeciesTotalLivingNotItemizedWeightField().getModel();
+ Number livingNotItemizedWeight = speciesUI.getSpeciesTotalLivingNotItemizedWeightField().getModel();
if (livingNotItemizedWeight != null) {
totalSortedWeight += livingNotItemizedWeight.floatValue();
}
- ui.getSpeciesTotalSampleSortedWeightField()
- .setText(totalSortedWeight != null ? totalSortedWeight.toString() : "");
+ setComputedValue(speciesUI.getSpeciesTotalSampleSortedWeightField(),
+ totalSortedWeight);
+ setComputedValue(ui.getSpeciesTotalSampleSortedWeightField(),
+ totalSortedWeight);
+ result.put(Weights.SAMPLE_SORTED, totalSortedWeight);
- if (ui.getSpeciesTotalSortedWeightField().getModel() == null) {
- ui.getSpeciesTotalSortedWeightField().setModel(totalSortedWeight);
+ Float speciesTotalSortedWeight = model.getSpeciesTotalSortedWeight();
+ if (speciesTotalSortedWeight == null) {
+ speciesTotalSortedWeight = totalSortedWeight;
+ model.setSpeciesTotalSortedComputedWeight(totalSortedWeight);
+
+ } else if (speciesTotalSortedWeight < totalSortedWeight) {
+ // TODO handle error
+ } else if (speciesTotalSortedWeight < 1.05 * totalSortedWeight) {
+ // TODO Si le "Poids total VRAC" est saisi est que sa valeur
+ // est supérieure de moins de x% (x en configuration)
+ // du "Poids total Vrac trié", demander confirmation que
+ // le "Poids total VRAC" est bien une valeur observée
+ // sinon la remplacer par le "Poids total Vrac trié"
}
+ result.put(Weights.SORTED, speciesTotalSortedWeight);
- ui.getSpeciesTotalUnsortedWeightField()
- .setText(totalUnsortedWeight != null ? totalUnsortedWeight.toString() : "");
+ setComputedValue(speciesUI.getSpeciesTotalUnsortedWeightField(),
+ totalUnsortedWeight);
+ setComputedValue(ui.getSpeciesTotalUnsortedWeightField(),
+ totalUnsortedWeight);
+ result.put(Weights.UNSORTED, totalUnsortedWeight);
+
+ Float totalWeight = totalUnsortedWeight + speciesTotalSortedWeight;
+ setComputedValue(speciesUI.getSpeciesTotalWeightField(),
+ totalWeight);
+ setComputedValue(ui.getSpeciesTotalWeightField(),
+ totalWeight);
+ result.put(Weights.TOTAL, speciesTotalSortedWeight);
+
+ speciesUI.getTable().repaint();
+
+ return result;
}
protected Float computeSpeciesBatch(SpeciesBatchRowModel row) {
- SampleCategory finestCategory;
- if (row.getAgeCategory().isValid()) {
- finestCategory = row.getAgeCategory();
-
- } else if (row.getMaturityCategory().isValid()) {
- finestCategory = row.getMaturityCategory();
-
- } else if (row.getSexCategory().isValid()) {
- finestCategory = row.getSexCategory();
-
- } else if (row.getSizeCategory().isValid()) {
- finestCategory = row.getSizeCategory();
-
- } else {
- finestCategory = row.getSortedUnsortedCategory();
- }
+ SampleCategory finestCategory = row.getFinestCategory();
Float result = null;
Float categoryWeight = finestCategory.getCategoryWeight();
@@ -152,15 +212,27 @@
if (sum != null) {
if (categoryWeight == null) {
finestCategory.setComputedWeight(sum);
- } else if (categoryWeight != sum) {
+ for (SpeciesBatchRowModel child : children) {
+ child.getFinestCategory().setSubSample(false);
+ }
+
+ } else if (categoryWeight < sum) {
// handle error
+
+ } else {
+ boolean subSample = categoryWeight > sum;
+ for (SpeciesBatchRowModel child : children) {
+ child.getFinestCategory().setSubSample(subSample);
+ }
}
result = sum;
}
} else {// the row is a leaf
+ row.setComputedWeight(null);
+
List<SpeciesFrequencyRowModel> frequency = row.getFrequency();
-
+
if (CollectionUtils.isNotEmpty(frequency)) {
// if there are frequencies, then compute their weight
Float frequencyWeight = 0f;
@@ -178,7 +250,7 @@
frequencyWeight += w;
}
}
-
+
if (categoryWeight == null && rowWeight != null) {
//TODO handle error
@@ -188,18 +260,22 @@
finestCategory.setComputedWeight(frequencyWeight);
result = frequencyWeight;
- } else if (frequencyWeight != null && frequencyWeight != categoryWeight) {
+ } else if (frequencyWeight != null
+ && !frequencyWeight.equals(categoryWeight)) {
+
// if the weight of the frequencies is different from the category
// weight, then set the weight of the sample
- if (rowWeight == null) {
+ if (categoryWeight != null && frequencyWeight > categoryWeight) {
+ //TODO handle error
+
+ } else if (rowWeight == null) {
row.setComputedWeight(frequencyWeight);
- } else if (rowWeight != frequencyWeight) {
+ } else if (!rowWeight.equals(frequencyWeight)) {
//TODO handle error
}
result = categoryWeight;
-
} else {
result = categoryWeight;
}
@@ -211,4 +287,14 @@
return result;
}
+
+ protected void setComputedValue(JTextField textField, Float value) {
+ String textValue;
+ if (value != null) {
+ textValue = String.format("%.3f", value);
+ } else {
+ textValue = JAXXUtil.getStringValue(value);
+ }
+ textField.setText(textValue);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2013-02-15 18:24:13 UTC (rev 427)
@@ -27,8 +27,19 @@
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
bean: {model};
showReset: true;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
}
+TuttiComputedOrNotDataEditor {
+ autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
+ showReset: true;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
+ decimalNumber: 3;
+}
+
#catchTable {
border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.total"))};
}
@@ -40,16 +51,19 @@
}
#catchTotalWeightField {
- property: catchTotalWeight;
+ bean: {model.getCatchTotalComputedOrNotWeight()};
model: {model.getCatchTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
}
#catchTotalSortedWeightLabel {
text: "tutti.label.catches.catchTotalSortedWeight";
+ labelFor: {catchTotalSortedWeightField};
}
+#catchTotalSortedWeightField {
+ _computed: true;
+}
+
#catchTotalSortedTremisWeightLabel {
text: "tutti.label.catches.catchTotalSortedTremisWeight";
labelFor: {catchTotalSortedTremisWeightField};
@@ -58,8 +72,6 @@
#catchTotalSortedTremisWeightField {
property: catchTotalSortedTremisWeight;
model: {model.getCatchTotalSortedTremisWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
}
#catchTotalSortedCarousselWeightLabel {
@@ -70,8 +82,6 @@
#catchTotalSortedCarousselWeightField {
property: catchTotalSortedCarousselWeight;
model: {model.getCatchTotalSortedCarousselWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
}
#catchTotalRejectedWeightLabel {
@@ -80,10 +90,8 @@
}
#catchTotalRejectedWeightField {
- property: catchTotalRejectedWeight;
+ bean: {model.getCatchTotalRejectedComputedOrNotWeight()};
model: {model.getCatchTotalRejectedWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
}
#catchTotalUnsortedWeightLabel {
@@ -92,9 +100,7 @@
}
#catchTotalUnsortedWeightField {
- editable: false;
- enabled: false;
- text: {getStringValue(model.getCatchTotalUnsortedWeight())};
+ _computed: true;
}
#catchThalassaLabel {
@@ -117,10 +123,7 @@
}
#speciesTotalWeightField {
- property: speciesTotalWeight;
- model: {model.getSpeciesTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#speciesTotalSortedWeightLabel {
@@ -129,10 +132,12 @@
}
#speciesTotalSortedWeightField {
- property: speciesTotalSortedWeight;
- model: {model.getSpeciesTotalSortedWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ text: {getStringValue(model.getSpeciesTotalSortedWeight() != null ?
+ String.format("%.3f", model.getSpeciesTotalSortedWeight()) :
+ model.getSpeciesTotalSortedComputedWeight() != null ?
+ String.format("%.3f", model.getSpeciesTotalSortedComputedWeight()) :
+ null)};
+ _computed: true;
}
#speciesTotalSampleSortedWeightLabel {
@@ -142,10 +147,7 @@
}
#speciesTotalSampleSortedWeightField {
- property: speciesTotalSampleSortedWeight;
- model: {model.getSpeciesTotalSampleSortedWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#speciesTotalUnsortedWeightLabel {
@@ -154,9 +156,7 @@
}
#speciesTotalUnsortedWeightField {
- text: {getStringValue(model.getSpeciesTotalUnsortedWeight())};
- editable: false;
- enabled: false;
+ _computed: true;
}
#benthosTable {
@@ -170,10 +170,7 @@
}
#benthosTotalWeightField {
- property: benthosTotalWeight;
- model: {model.getBenthosTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#benthosTotalSortedWeightLabel {
@@ -182,10 +179,7 @@
}
#benthosTotalSortedWeightField {
- property: benthosTotalSortedWeight;
- model: {model.getBenthosTotalSortedWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#benthosTotalSampleSortedWeightLabel {
@@ -195,10 +189,7 @@
}
#benthosTotalSampleSortedWeightField {
- property: benthosTotalSampleSortedWeight;
- model: {model.getBenthosTotalSampleSortedWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#benthosTotalUnsortedWeightLabel {
@@ -207,9 +198,7 @@
}
#benthosTotalUnsortedWeightField {
- text: {getStringValue(model.getBenthosTotalUnsortedWeight())};
- editable: false;
- enabled: false;
+ _computed: true;
}
#macroWasteTable {
@@ -223,10 +212,7 @@
}
#macroWasteTotalWeightField {
- property: macroWasteTotalWeight;
- model: {model.getMacroWasteTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+ _computed: true;
}
#importPupitriButton {
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2013-02-15 18:24:13 UTC (rev 427)
@@ -36,6 +36,8 @@
fr.ifremer.tutti.ui.swing.content.operation.catches.species.split.SplitSpeciesBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
+ fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataEditor
+
org.jdesktop.swingx.JXTitledPanel
jaxx.runtime.swing.CardLayout2Ext
@@ -71,19 +73,15 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='catchTotalWeight' component='catchTotalWeightField'/>
- <field name='catchTotalSortedTremisWeight'
+<!-- <field name='catchTotalSortedTremisWeight'
component='catchTotalSortedTremisWeightField'/>
<field name='catchTotalSortedCarousselWeight'
- component='catchTotalSortedCarousselWeightField'/>
+ component='catchTotalSortedCarousselWeightField'/>-->
<field name='catchTotalRejectedWeight'
component='catchTotalRejectedWeightField'/>
<field name='speciesTotalSortedWeight'
component='speciesTotalSortedWeightField'/>
- <field name='speciesTotalSampleSortedWeight'
- component='speciesTotalSampleSortedWeightField'/>
- <field name='speciesTotalUnsortedWeight'
- component='speciesTotalUnsortedWeightField'/>
<field name='benthosTotalSortedWeight'
component='benthosTotalSortedWeightField'/>
@@ -115,17 +113,20 @@
<cell anchor='west'>
<JLabel id='catchTotalWeightLabel'/>
</cell>
- <cell columns='4'>
- <NumberEditor id='catchTotalWeightField'
+ <cell columns='4' weightx='1.0'>
+ <TuttiComputedOrNotDataEditor id='catchTotalWeightField'
constructorParams='this'/>
</cell>
</row>
- <!-- Poids total trié balance tremis / caroussel-->
+ <!-- Poids total trié balance tremie / caroussel-->
<row>
<cell anchor='west'>
<JLabel id='catchTotalSortedWeightLabel'/>
</cell>
- <cell anchor='west'>
+ <cell columns='4' weightx='1.0'>
+ <JTextField id='catchTotalSortedWeightField'/>
+ </cell>
+<!-- <cell anchor='west'>
<JLabel id='catchTotalSortedCarousselWeightLabel'/>
</cell>
<cell weightx='1.0'>
@@ -138,14 +139,14 @@
<cell weightx='1.0'>
<NumberEditor id='catchTotalSortedTremisWeightField'
constructorParams='this'/>
- </cell>
+ </cell>-->
</row>
<!--Poids total hors vrac-->
<row>
<cell>
<JLabel id='catchTotalUnsortedWeightLabel'/>
</cell>
- <cell columns='4'>
+ <cell columns='4' weightx='1.0'>
<JTextField id='catchTotalUnsortedWeightField'/>
</cell>
</row>
@@ -154,8 +155,8 @@
<cell>
<JLabel id='catchTotalRejectedWeightLabel'/>
</cell>
- <cell columns='4'>
- <NumberEditor id='catchTotalRejectedWeightField'
+ <cell columns='4' weightx='1.0'>
+ <TuttiComputedOrNotDataEditor id='catchTotalRejectedWeightField'
constructorParams='this'/>
</cell>
</row>
@@ -177,8 +178,7 @@
<JLabel id='speciesTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalWeightField'
- constructorParams='this'/>
+ <JTextField id='speciesTotalWeightField'/>
</cell>
</row>
<!-- Poids total vrac -->
@@ -187,8 +187,7 @@
<JLabel id='speciesTotalSortedWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalSortedWeightField'
- constructorParams='this'/>
+ <JTextField id='speciesTotalSortedWeightField'/>
</cell>
</row>
@@ -198,8 +197,7 @@
<JLabel id='speciesTotalSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='speciesTotalSampleSortedWeightField'
- constructorParams='this'/>
+ <JTextField id='speciesTotalSampleSortedWeightField'/>
</cell>
</row>
<!-- Poids total hors vrac -->
@@ -223,8 +221,7 @@
<JLabel id='benthosTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='benthosTotalWeightField'
- constructorParams='this'/>
+ <JTextField id='benthosTotalWeightField'/>
</cell>
</row>
<!-- Poids total vrac -->
@@ -233,8 +230,7 @@
<JLabel id='benthosTotalSortedWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='benthosTotalSortedWeightField'
- constructorParams='this'/>
+ <JTextField id='benthosTotalSortedWeightField'/>
</cell>
</row>
@@ -244,8 +240,7 @@
<JLabel id='benthosTotalSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='benthosTotalSampleSortedWeightField'
- constructorParams='this'/>
+ <JTextField id='benthosTotalSampleSortedWeightField'/>
</cell>
</row>
<!-- Poids total hors vrac -->
@@ -270,8 +265,7 @@
<JLabel id='macroWasteTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='macroWasteTotalWeightField'
- constructorParams='this'/>
+ <JTextField id='macroWasteTotalWeightField'/>
</cell>
</row>
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.collect.Sets;
import fr.ifremer.tutti.ui.swing.TuttiUI;
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUIHandler;
@@ -40,6 +41,7 @@
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import java.awt.event.ActionEvent;
+import java.util.Set;
import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
@@ -82,17 +84,8 @@
public EditCatchesUIHandler(FishingOperationsUI parentUi, EditCatchesUI ui) {
super(parentUi.getHandler().getContext(), ui);
this.parentUi = parentUi;
-// this.persistenceService = context.getService(PersistenceService.class);
this.catchBatchMonitor = new TuttiBeanMonitor<EditCatchesUIModel>(
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT,
- EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT);
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT);
}
//------------------------------------------------------------------------//
@@ -141,6 +134,16 @@
return ui.getValidator();
}
+ @Override
+ protected Set<String> getPropertiesToIgnore() {
+ Set<String> result = super.getPropertiesToIgnore();
+ result.addAll(Sets.newHashSet(
+ EditCatchesUIModel.PROPERTY_CATCH_TOTAL_COMPUTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_CATCH_TOTAL_REJECTED_COMPUTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_COMPUTED_WEIGHT
+ ));
+ return result;
+ }
@Override
protected JTabbedPane getTabPanel() {
@@ -234,109 +237,6 @@
return getParentUi().getHandler();
}
- // public void selectFishingOperation(FishingOperation bean,
-// String fishingOperationText) {
-//
-// boolean empty = bean == null;
-// Preconditions.checkState(!empty, "can not edit a null fishing operation.");
-// boolean newOperation = TuttiEntities.isNew(bean);
-// boolean wasModified = fishingOperationMonitor.wasModified();
-//
-// // 1) Save any modification of the current fishingOperation
-//
-// if (wasModified) {
-// save();
-// }
-//
-// ui.getSpeciesTabContent().getHandler().clearTableSelection();
-//// ui.getBenthosTabContent().getHandler().clearTableSelection();
-//// ui.getPlanktonTabContent().getHandler().clearTableSelection();
-//// ui.getMacroWasteTabContent().getHandler().clearTableSelection();
-//// ui.getAccidentalTabContent().getHandler().clearTableSelection();
-//
-// // 2) Use new selected fishingOperation
-//
-// EditCatchesUIModel catchesUIModel = getModel();
-//
-// boolean otherOperation =
-// ObjectUtils.notEqual(bean, catchesUIModel.getFishingOperation());
-//
-// if (empty || newOperation || otherOperation || wasModified) {
-//
-// CatchBatch batch;
-//
-// if (empty || newOperation) {
-//
-// // create a new CatchBatch
-// if (log.isInfoEnabled()) {
-// log.info("Create a new CatchBatch");
-// }
-// batch = new CatchBatch();
-// batch.setFishingOperation(bean);
-//
-// } else {
-//
-// String operationId = bean.getId();
-//
-// if (log.isInfoEnabled()) {
-// log.info("Load existing CatchBatch from operation id: " +
-// operationId);
-// }
-//
-// batch = persistenceService.getCatchBatchFromFishingOperation(
-// operationId);
-//
-//// model.setCatchBatch(batch);
-//// model.setFishingOperation(bean);
-// }
-//
-// catchesUIModel.setCatchBatch(batch);
-// catchesUIModel.setFishingOperation(bean);
-//
-// catchesUIModel.fromBean(batch);
-//
-// catchesUIModel.setModify(false);
-// fishingOperationMonitor.clearModified();
-//
-// // 3) Propagate title to others tabs
-// ui.getCatchesCaracteristicsTabPane().setTitle(fishingOperationText);
-// ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-//// ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-//// ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-//// ui.getMacroWasteTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-//// ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText);
-//
-// // 4) Propagate new selected fishingoperation to others tabs
-//
-// ui.getSpeciesTabContent().getHandler().selectFishingOperation(bean);
-//// ui.getBenthosTabContent().getHandler().selectFishingOperation(bean);
-//// ui.getPlanktonTabContent().getHandler().selectFishingOperation(bean);
-//// ui.getMacroWasteTabContent().getHandler().selectFishingOperation(bean);
-//// ui.getAccidentalTabContent().getHandler().selectFishingOperation(bean);
-//
-// ui.getTabPane().repaint();
-// }
-// }
-
-// public void save() {
-//
-// // previous fishingOperation was modified, let's save it
-// EditCatchesUIModel beanToSave = catchBatchMonitor.getBean();
-//
-// CatchBatch catchBatch = beanToSave.toBean();
-//
-// if (log.isInfoEnabled()) {
-// log.info("FishingOperation " + catchBatch.getId() +
-// " was modified, will save it.");
-// }
-//
-// showInformationMessage(
-// "[ Captures - Caractéristiques générales ] " +
-// "Sauvegarde des modifications du résumé de la capture.");
-//
-// persistenceService.saveCatchBatch(catchBatch);
-// }
-
protected void registerValidators() {
registerValidators(getValidator(), ui.getSpeciesTabContent().getHandler().getValidator());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -27,6 +27,7 @@
import fr.ifremer.tutti.persistence.entities.data.CatchBatch;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -41,23 +42,21 @@
private static final long serialVersionUID = 1L;
public static final String PROPERTY_CATCH_TOTAL_WEIGHT = "catchTotalWeight";
+
+ public static final String PROPERTY_CATCH_TOTAL_COMPUTED_WEIGHT = "catchTotalComputedWeight";
public static final String PROPERTY_CATCH_TOTAL_SORTED_TREMIS_WEIGHT = "catchTotalSortedTremisWeight";
public static final String PROPERTY_CATCH_TOTAL_SORTED_CAROUSSEL_WEIGHT = "catchTotalSortedCarousselWeight";
public static final String PROPERTY_CATCH_TOTAL_REJECTED_WEIGHT = "catchTotalRejectedWeight";
+
+ public static final String PROPERTY_CATCH_TOTAL_REJECTED_COMPUTED_WEIGHT = "catchTotalRejectedComputedWeight";
- public static final String PROPERTY_CATCH_TOTAL_UNSORTED_WEIGHT = "catchTotalUnsortedWeight";
-
- public static final String PROPERTY_SPECIES_TOTAL_WEIGHT = "speciesTotalWeight";
-
public static final String PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT = "speciesTotalSortedWeight";
+
+ public static final String PROPERTY_SPECIES_TOTAL_SORTED_COMPUTED_WEIGHT = "speciesTotalSortedComputedWeight";
- public static final String PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT = "speciesTotalSampleSortedWeight";
-
- public static final String PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT = "speciesTotalUnsortedWeight";
-
public static final String PROPERTY_SPECIES_TOTAL_INERT_WEIGHT = "speciesTotalInertWeight";
public static final String PROPERTY_SPECIES_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT = "speciesTotalLivingNotItemizedWeight";
@@ -119,18 +118,12 @@
protected static final Binder<EditCatchesUIModel, CatchBatch> toBeanBinder = BinderFactory.newBinder(EditCatchesUIModel.class, CatchBatch.class);
- protected Float speciesTotalWeight;
+ protected TuttiComputedOrNotData<Float> speciesTotalSortedComputedOrNotWeight = new TuttiComputedOrNotData<Float>();
- protected Float speciesTotalSortedWeight;
+ protected Float speciesTotalInertWeight = 0f;
- protected Float speciesTotalSampleSortedWeight;
+ protected Float speciesTotalLivingNotItemizedWeight = 0f;
- protected Float speciesTotalUnsortedWeight;
-
- protected Float speciesTotalInertWeight;
-
- protected Float speciesTotalLivingNotItemizedWeight;
-
protected Float benthosTotalWeight;
protected Float benthosTotalSortedWeight;
@@ -145,16 +138,16 @@
protected Float macroWasteTotalWeight;
- protected Float catchTotalWeight;
+ protected TuttiComputedOrNotData<Float> catchTotalComputedOrNotWeight
+ = new TuttiComputedOrNotData<Float>();
protected Float catchTotalSortedTremisWeight;
protected Float catchTotalSortedCarousselWeight;
- protected Float catchTotalRejectedWeight;
+ protected TuttiComputedOrNotData<Float> catchTotalRejectedComputedOrNotWeight
+ = new TuttiComputedOrNotData<Float>();
- protected Float catchTotalUnsortedWeight;
-
protected FishingOperation fishingOperation;
protected CatchBatch catchBatch;
@@ -173,7 +166,7 @@
}
public void setCatchBatch(CatchBatch catchBatch) {
- Object oldValue = getCatchTotalWeight();
+ Object oldValue = getCatchBatch();
this.catchBatch = catchBatch;
firePropertyChange(PROPERTY_CATCH_BATCH, oldValue, catchBatch);
}
@@ -188,16 +181,30 @@
firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, fishingOperation);
}
+ public TuttiComputedOrNotData<Float> getCatchTotalComputedOrNotWeight() {
+ return catchTotalComputedOrNotWeight;
+ }
+
public Float getCatchTotalWeight() {
- return catchTotalWeight;
+ return catchTotalComputedOrNotWeight.getData();
}
public void setCatchTotalWeight(Float catchTotalWeight) {
Object oldValue = getCatchTotalWeight();
- this.catchTotalWeight = catchTotalWeight;
+ this.catchTotalComputedOrNotWeight.setData(catchTotalWeight);
firePropertyChange(PROPERTY_CATCH_TOTAL_WEIGHT, oldValue, catchTotalWeight);
}
+
+ public Float getCatchTotalComputedWeight() {
+ return catchTotalComputedOrNotWeight.getComputedData();
+ }
+ public void setCatchTotalComputedWeight(Float catchTotalComputedWeight) {
+ Object oldValue = getCatchTotalComputedWeight();
+ this.catchTotalComputedOrNotWeight.setComputedData(catchTotalComputedWeight);
+ firePropertyChange(PROPERTY_CATCH_TOTAL_COMPUTED_WEIGHT, oldValue, catchTotalComputedWeight);
+ }
+
public Float getCatchTotalSortedTremisWeight() {
return catchTotalSortedTremisWeight;
}
@@ -218,66 +225,54 @@
firePropertyChange(PROPERTY_CATCH_TOTAL_SORTED_CAROUSSEL_WEIGHT, oldValue, catchTotalSortedCarousselWeight);
}
+ public TuttiComputedOrNotData<Float> getCatchTotalRejectedComputedOrNotWeight() {
+ return catchTotalRejectedComputedOrNotWeight;
+ }
+
public Float getCatchTotalRejectedWeight() {
- return catchTotalRejectedWeight;
+ return catchTotalRejectedComputedOrNotWeight.getData();
}
public void setCatchTotalRejectedWeight(Float catchTotalRejectedWeight) {
Object oldValue = getCatchTotalRejectedWeight();
- this.catchTotalRejectedWeight = catchTotalRejectedWeight;
+ this.catchTotalRejectedComputedOrNotWeight.setData(catchTotalRejectedWeight);
firePropertyChange(PROPERTY_CATCH_TOTAL_REJECTED_WEIGHT, oldValue, catchTotalRejectedWeight);
}
- public Float getCatchTotalUnsortedWeight() {
- return catchTotalUnsortedWeight;
+ public Float getCatchTotalRejectedComputedWeight() {
+ return catchTotalRejectedComputedOrNotWeight.getComputedData();
}
- public void setCatchTotalUnsortedWeight(Float catchTotalUnsortedWeight) {
- Object oldValue = getCatchTotalUnsortedWeight();
- this.catchTotalUnsortedWeight = catchTotalUnsortedWeight;
- firePropertyChange(PROPERTY_CATCH_TOTAL_UNSORTED_WEIGHT, oldValue, catchTotalUnsortedWeight);
+ public void setCatchTotalRejectedComputedWeight(Float catchTotalRejectedComputedWeight) {
+ Object oldValue = getCatchTotalRejectedComputedWeight();
+ this.catchTotalRejectedComputedOrNotWeight.setComputedData(catchTotalRejectedComputedWeight);
+ firePropertyChange(PROPERTY_CATCH_TOTAL_REJECTED_COMPUTED_WEIGHT, oldValue, catchTotalRejectedComputedWeight);
}
-
- public Float getSpeciesTotalWeight() {
- return speciesTotalWeight;
+
+ public TuttiComputedOrNotData<Float> getSpeciesTotalSortedComputedOrNotWeight() {
+ return speciesTotalSortedComputedOrNotWeight;
}
-
- public void setSpeciesTotalWeight(Float speciesTotalWeight) {
- Object oldValue = getSpeciesTotalWeight();
- this.speciesTotalWeight = speciesTotalWeight;
- firePropertyChange(PROPERTY_SPECIES_TOTAL_WEIGHT, oldValue, speciesTotalWeight);
- }
-
+
public Float getSpeciesTotalSortedWeight() {
- return speciesTotalSortedWeight;
+ return speciesTotalSortedComputedOrNotWeight.getData();
}
public void setSpeciesTotalSortedWeight(Float speciesTotalSortedWeight) {
Object oldValue = getSpeciesTotalSortedWeight();
- this.speciesTotalSortedWeight = speciesTotalSortedWeight;
+ this.speciesTotalSortedComputedOrNotWeight.setData(speciesTotalSortedWeight);
firePropertyChange(PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT, oldValue, speciesTotalSortedWeight);
}
-
- public Float getSpeciesTotalSampleSortedWeight() {
- return speciesTotalSampleSortedWeight;
+
+ public Float getSpeciesTotalSortedComputedWeight() {
+ return speciesTotalSortedComputedOrNotWeight.getComputedData();
}
- public void setSpeciesTotalSampleSortedWeight(Float speciesTotalSampleSortedWeight) {
- Object oldValue = getSpeciesTotalSampleSortedWeight();
- this.speciesTotalSampleSortedWeight = speciesTotalSampleSortedWeight;
- firePropertyChange(PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT, oldValue, speciesTotalSampleSortedWeight);
+ public void setSpeciesTotalSortedComputedWeight(Float speciesTotalSortedComputedWeight) {
+ Object oldValue = getSpeciesTotalSortedComputedWeight();
+ this.speciesTotalSortedComputedOrNotWeight.setComputedData(speciesTotalSortedComputedWeight);
+ firePropertyChange(PROPERTY_SPECIES_TOTAL_SORTED_COMPUTED_WEIGHT, oldValue, speciesTotalSortedComputedWeight);
}
- public Float getSpeciesTotalUnsortedWeight() {
- return speciesTotalUnsortedWeight;
- }
-
- public void setSpeciesTotalUnsortedWeight(Float speciesTotalUnsortedWeight) {
- Object oldValue = getSpeciesTotalUnsortedWeight();
- this.speciesTotalUnsortedWeight = speciesTotalUnsortedWeight;
- firePropertyChange(PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT, oldValue, speciesTotalUnsortedWeight);
- }
-
public Float getSpeciesTotalInertWeight() {
return speciesTotalInertWeight;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategory.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -65,6 +65,22 @@
* @since 1.0
*/
protected Float computedWeight;
+
+ /**
+ * Is this sample a subsample ?
+ * Available only if the category is the finest category of the row
+ *
+ * @since 1.0
+ */
+ protected boolean subSample;
+
+ /**
+ * Has the row only one frequency ?
+ * Available only if the category is the finest category of the row
+ *
+ * @since 1.0
+ */
+ protected boolean onlyOneFrequency;
public static <C extends Serializable> SampleCategory<C> newSample(SampleCategoryType categoryType) {
SampleCategory<C> result = new SampleCategory<C>();
@@ -107,6 +123,22 @@
this.computedWeight = computedWeight;
}
+ public boolean isSubSample() {
+ return subSample;
+ }
+
+ public void setSubSample(boolean subSample) {
+ this.subSample = subSample;
+ }
+
+ public boolean hasOnlyOneFrequency() {
+ return onlyOneFrequency;
+ }
+
+ public void setOnlyOneFrequency(boolean onlyOneFrequency) {
+ this.onlyOneFrequency = onlyOneFrequency;
+ }
+
public boolean isValid() {
return categoryValue != null;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryComponent.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -38,6 +38,7 @@
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Component;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
@@ -208,6 +209,7 @@
boolean hasFocus,
int row,
int column) {
+
SampleCategory<C> sampleCategory = (SampleCategory<C>) value;
String text = null;
@@ -219,12 +221,25 @@
Float number = sampleCategory.getCategoryWeight();
Float computedNumber = sampleCategory.getComputedWeight();
- text = "<html>" + categoryDecorator.toString(categoryValue) + " / ";
+ text = "<html>" + categoryDecorator.toString(categoryValue) + " /";
+
+ if (sampleCategory.isSubSample()) {
+ text += "/";
+ }
+ text += " ";
if (number != null) {
- text += number;
+ text += String.format("%.3f", number);
+
} else if (computedNumber != null) {
- text += "<em style='color: blue'>" + computedNumber + "</em>";
+ if (sampleCategory.hasOnlyOneFrequency()) {
+ text += String.format("%.3f", computedNumber);
+
+ } else {
+ String blue = Integer.toHexString(Color.BLUE.getRGB()).substring(2);
+ text += "<em style='color: #" + blue + "'>" +
+ String.format("%.3f", computedNumber) + "</em>";
+ }
} else {
text += "-";
}
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -34,12 +34,15 @@
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.frequency.SpeciesFrequencyRowModel;
import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import org.apache.commons.collections.CollectionUtils;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.util.Collections;
import java.util.List;
+import org.apache.commons.logging.LogFactory;
/**
* Represents a species batch (i.e a row in the batch table).
@@ -239,6 +242,40 @@
sexCategory = SampleCategory.newSample(SampleCategoryType.sex);
maturityCategory = SampleCategory.newSample(SampleCategoryType.maturity);
ageCategory = SampleCategory.newSample(SampleCategoryType.age);
+
+ computedOrNotWeight.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_WEIGHT, evt.getOldValue(), evt.getNewValue());
+ }
+ });
+ computedOrNotWeight.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_COMPUTED_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_COMPUTED_WEIGHT, evt.getOldValue(), evt.getNewValue());
+ }
+ });
+
+ computedOrNotNumber.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_NUMBER, evt.getOldValue(), evt.getNewValue());
+ }
+ });
+ computedOrNotNumber.addPropertyChangeListener(
+ TuttiComputedOrNotData.PROPERTY_COMPUTED_DATA,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ firePropertyChange(PROPERTY_COMPUTED_NUMBER, evt.getOldValue(), evt.getNewValue());
+ }
+ });
}
public SpeciesBatchRowModel(SpeciesBatch aBatch,
@@ -287,6 +324,26 @@
return sampleCategory;
}
+ public SampleCategory getFinestCategory() {
+ SampleCategory finestCategory;
+ if (ageCategory.isValid()) {
+ finestCategory = ageCategory;
+
+ } else if (maturityCategory.isValid()) {
+ finestCategory = maturityCategory;
+
+ } else if (sexCategory.isValid()) {
+ finestCategory = sexCategory;
+
+ } else if (sizeCategory.isValid()) {
+ finestCategory = sizeCategory;
+
+ } else {
+ finestCategory = sortedUnsortedCategory;
+ }
+ return finestCategory;
+ }
+
//------------------------------------------------------------------------//
//-- Species category --//
//------------------------------------------------------------------------//
@@ -515,9 +572,7 @@
}
public void setWeight(Float weight) {
- Object oldValue = getWeight();
this.computedOrNotWeight.setData(weight);
- firePropertyChange(PROPERTY_WEIGHT, oldValue, weight);
}
public Integer getNumber() {
@@ -525,9 +580,7 @@
}
public void setNumber(Integer number) {
- Object oldValue = getNumber();
computedOrNotNumber.setData(number);
- firePropertyChange(PROPERTY_NUMBER, oldValue, number);
}
public String getComment() {
@@ -565,10 +618,7 @@
}
public void setComputedNumber(Integer computedNumber) {
- Object oldValue = getComputedNumber();
computedOrNotNumber.setComputedData(computedNumber);
- firePropertyChange(PROPERTY_COMPUTED_NUMBER, oldValue,
- computedNumber);
}
public Float getComputedWeight() {
@@ -576,10 +626,7 @@
}
public void setComputedWeight(Float computedWeight) {
- Object oldValue = getComputedWeight();
computedOrNotWeight.setComputedData(computedWeight);
- firePropertyChange(PROPERTY_COMPUTED_WEIGHT, oldValue,
- computedWeight);
}
public TuttiComputedOrNotData<Integer> getComputedOrNotNumber() {
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-02-15 18:24:13 UTC (rev 427)
@@ -27,18 +27,26 @@
showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
bean: {model};
showReset: true;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
}
+TuttiComputedOrNotDataEditor {
+ autoPopup: {handler.getConfig().isAutoPopupNumberEditor()};
+ showPopupButton: {handler.getConfig().isShowNumberEditorButton()};
+ showReset: true;
+ useFloat: true;
+ numberPattern: {DECIMAL3_PATTERN};
+ decimalNumber: 3;
+}
+
#speciesTotalWeightLabel {
text: "tutti.label.catches.speciesTotalWeight";
labelFor: {speciesTotalWeightField};
}
#speciesTotalWeightField {
- property: speciesTotalWeight;
- model: {model.getSpeciesTotalWeight()};
- numberPattern: {DECIMALFORCE3_PATTERN};
- useFloat: true;
+ _computed: true;
}
#speciesTotalSortedWeightLabel {
@@ -47,10 +55,8 @@
}
#speciesTotalSortedWeightField {
- property: speciesTotalSortedWeight;
+ bean: {model.getSpeciesTotalSortedComputedOrNotWeight()};
model: {model.getSpeciesTotalSortedWeight()};
- numberPattern: {DECIMALFORCE3_PATTERN};
- useFloat: true;
}
#speciesTotalSampleSortedWeightLabel {
@@ -59,9 +65,7 @@
}
#speciesTotalSampleSortedWeightField {
- text: {getStringValue(model.getSpeciesTotalUnsortedWeight())};
- editable: false;
- enabled: false;
+ _computed: true;
}
#speciesTotalUnsortedWeightLabel {
@@ -70,9 +74,7 @@
}
#speciesTotalUnsortedWeightField {
- text: {getStringValue(model.getSpeciesTotalUnsortedWeight())};
- editable: false;
- enabled: false;
+ _computed: true;
}
#speciesTotalInertWeightLabel {
@@ -83,8 +85,7 @@
#speciesTotalInertWeightField {
property: speciesTotalInertWeight;
model: {model.getSpeciesTotalInertWeight()};
- numberPattern: {DECIMALFORCE3_PATTERN};
- useFloat: true;
+ showReset: false;
}
#speciesTotalLivingNotItemizedWeightLabel {
@@ -95,8 +96,7 @@
#speciesTotalLivingNotItemizedWeightField {
property: speciesTotalLivingNotItemizedWeight;
model: {model.getSpeciesTotalLivingNotItemizedWeight()};
- numberPattern: {DECIMALFORCE3_PATTERN};
- useFloat: true;
+ showReset: false;
}
#tablePopup {
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-02-15 18:24:13 UTC (rev 427)
@@ -29,6 +29,7 @@
fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI
fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI
+ fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataEditor
org.jdesktop.swingx.JXTable
@@ -67,13 +68,8 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='speciesTotalWeight' component='speciesTotalWeightField'/>
<field name='speciesTotalSortedWeight'
component='speciesTotalSortedWeightField'/>
- <field name='speciesTotalSampleSortedWeight'
- component='speciesTotalSampleSortedWeightField'/>
- <field name='speciesTotalUnsortedWeight'
- component='speciesTotalUnsortedWeightField'/>
</BeanValidator>
<LongTextEditorUI id='longTextEditor'/>
@@ -96,13 +92,13 @@
<JLabel id='speciesTotalWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalWeightField' constructorParams='this'/>
+ <JTextField id='speciesTotalWeightField'/>
</cell>
<cell anchor='west'>
<JLabel id='speciesTotalSortedWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalSortedWeightField'
+ <TuttiComputedOrNotDataEditor id='speciesTotalSortedWeightField'
constructorParams='this'/>
</cell>
</row>
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -58,7 +58,7 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.editor.AttachmentCellComponent;
import fr.ifremer.tutti.ui.swing.util.editor.LongTextCellComponent;
-import fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataEditor;
+import fr.ifremer.tutti.ui.swing.util.editor.TuttiComputedOrNotDataTableCell;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.SwingUtil;
@@ -132,7 +132,6 @@
public SpeciesBatchUIHandler(TuttiUI<?, ?> parentUi,
SpeciesBatchUI ui) {
super(parentUi, ui,
- SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM,
SpeciesBatchRowModel.PROPERTY_SPECIES,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
@@ -148,7 +147,8 @@
SpeciesBatchRowModel.PROPERTY_NUMBER,
SpeciesBatchRowModel.PROPERTY_COMMENT,
SpeciesBatchRowModel.PROPERTY_ATTACHMENTS,
- SpeciesBatchRowModel.PROPERTY_FREQUENCY);
+ SpeciesBatchRowModel.PROPERTY_FREQUENCY,
+ SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM);
tableFilters = new EnumMap<TableViewMode, RowFilter<SpeciesBatchTableModel, Integer>>(TableViewMode.class);
tableFilters.put(TableViewMode.ALL, new RowFilter<SpeciesBatchTableModel, Integer>() {
@@ -277,14 +277,13 @@
Object oldValue,
Object newValue) {
- if (SAMPLING_PROPERTIES.contains(propertyName) ||
- SpeciesBatchRowModel.PROPERTY_WEIGHT.equals(propertyName)) {
+ if (SAMPLING_PROPERTIES.contains(propertyName)) {
// species has changed, recompute valid property
recomputeRowValidState(row);
// recompute the totalUnsorted weight
- recomputeTotalUnsortedWeight();
+// recomputeTotalUnsortedWeight();
}
// when row valid state has changed, recompute action enabled states
@@ -294,11 +293,12 @@
@Override
protected void saveSelectedRowIfRequired(TuttiBeanMonitor<SpeciesBatchRowModel> rowMonitor,
SpeciesBatchRowModel row) {
-
+log.debug("saveSelectedRowIfRequired");
if (row.isValid()) {
// there is a valid bean attached to the monitor
-
+log.debug("isValid");
if (rowMonitor.wasModified()) {
+log.debug("wasModified");
// monitored bean was modified, save it
if (log.isInfoEnabled()) {
@@ -315,6 +315,7 @@
rowMonitor.clearModified();
}
} else {
+log.debug("wasNotModified");
//FIXME See how to delete rows ? Or moreover how to save tehem...
if (log.isWarnEnabled()) {
@@ -592,15 +593,11 @@
{ // Weight column
- TuttiComputedOrNotDataEditor<Float> editor =
- new TuttiComputedOrNotDataEditor(Float.class, false);
- editor.getNumberEditor().setSelectAllTextOnError(true);
- editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
- editor.getNumberEditor().setNumberPattern(TuttiUI.DECIMALFORCE3_PATTERN);
-
addColumnToModel(columnModel,
- editor,
- null,
+ TuttiComputedOrNotDataTableCell.newEditor(
+ Float.class, false, true, 3),
+ TuttiComputedOrNotDataTableCell.newRender(
+ defaultRenderer, true, 3),
SpeciesBatchTableModel.WEIGHT);
}
@@ -852,6 +849,7 @@
}
}
row.setComputedNumber(totalNumber);
+ row.getFinestCategory().setOnlyOneFrequency(frequency.size() == 1);
}
}
@@ -957,7 +955,8 @@
log.info("New total vrac / hors vrac: " +
totalVrac + " / " + totalHorsVrac);
}
- getModel().setSpeciesTotalUnsortedWeight(totalHorsVrac);
+ ui.getSpeciesTotalUnsortedWeightField()
+ .setText(JAXXUtil.getStringValue(totalHorsVrac));
//TODO Should we also set the total vrac weight ?
// getModel().setTotalVracWeight(totalVrac);
}
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -30,6 +30,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
import java.util.List;
@@ -132,22 +133,15 @@
public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_INERT_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_LIVING_NOT_ITEMIZED_WEIGHT);
}
- public Float getSpeciesTotalWeight() {
- return catchesUIModel.getSpeciesTotalWeight();
+ public TuttiComputedOrNotData<Float> getSpeciesTotalSortedComputedOrNotWeight() {
+ return catchesUIModel.getSpeciesTotalSortedComputedOrNotWeight();
}
- public void setSpeciesTotalWeight(Float speciesTotalWeight) {
- catchesUIModel.setSpeciesTotalWeight(speciesTotalWeight);
- }
-
public Float getSpeciesTotalSortedWeight() {
return catchesUIModel.getSpeciesTotalSortedWeight();
}
@@ -155,23 +149,15 @@
public void setSpeciesTotalSortedWeight(Float speciesTotalSortedWeight) {
catchesUIModel.setSpeciesTotalSortedWeight(speciesTotalSortedWeight);
}
-
- public Float getSpeciesTotalSampleSortedWeight() {
- return catchesUIModel.getSpeciesTotalSampleSortedWeight();
+
+ public Float getSpeciesTotalSortedComputedWeight() {
+ return catchesUIModel.getSpeciesTotalSortedComputedWeight();
}
- public void setSpeciesTotalSampleSortedWeight(Float speciesSampleSortedWeight) {
- catchesUIModel.setSpeciesTotalSampleSortedWeight(speciesSampleSortedWeight);
+ public void setSpeciesTotalSortedComputedWeight(Float speciesTotalSortedComputedWeight) {
+ catchesUIModel.setSpeciesTotalSortedComputedWeight(speciesTotalSortedComputedWeight);
}
- public Float getSpeciesTotalUnsortedWeight() {
- return catchesUIModel.getSpeciesTotalUnsortedWeight();
- }
-
- public void setSpeciesTotalUnsortedWeight(Float speciesTotalUnsortedWeight) {
- catchesUIModel.setSpeciesTotalUnsortedWeight(speciesTotalUnsortedWeight);
- }
-
public Float getSpeciesTotalInertWeight() {
return catchesUIModel.getSpeciesTotalInertWeight();
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/FrequencyCellComponent.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.ui.swing.TuttiUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.catches.species.SpeciesBatchRowModel;
@@ -46,6 +47,7 @@
import javax.swing.table.TableCellRenderer;
import java.awt.Color;
import java.awt.Component;
+import java.awt.Font;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
@@ -72,7 +74,26 @@
setHorizontalAlignment(CENTER);
setIcon(SwingUtil.createActionIcon("show-frequency"));
}
+
+ public void setComputedOrNotText(TuttiComputedOrNotData<Integer> data) {
+ String text;
+ if (data != null && data.getData() != null) {
+ text = String.valueOf(data.getData());
+
+ } else if (data != null
+ && data.getComputedData() != null
+ && data.getComputedData() != 0) {
+
+ String blue = Integer.toHexString(Color.BLUE.getRGB()).substring(2);
+ text = "<html><em style='color: #" + blue + "'>" + data.getComputedData() + "</em></html>";
+
+ } else {
+ text = " - ";
+ }
+ setText(text);
+ }
+
public static TableCellRenderer newRender() {
return new FrequencyCellRenderer();
}
@@ -171,11 +192,7 @@
}
// push back to batch
- Integer number = null;
- if (frequency.size() == 1) {
- number = frequency.get(0).getNumber();
- }
- editRow.setNumber(number);
+ editRow.setNumber(null);
}
@@ -207,14 +224,9 @@
this.table = table;
columnIdentifier = tableModel.getPropertyName(column);
}
- String text;
- if (value == null) {
- text = " - ";
- } else {
- text = String.valueOf(value);
- }
- component.setText(text);
-
+ TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
+ component.setComputedOrNotText(data);
+
rowIndex = row;
columnIndex = column;
@@ -275,21 +287,13 @@
int row,
int column) {
+ TuttiComputedOrNotData<Integer> data = (TuttiComputedOrNotData<Integer>) value;
FrequencyCellComponent result =
(FrequencyCellComponent) component.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- if (table != null) {
- String text;
- if (value == null) {
- text = " - ";
- } else {
- text = String.valueOf(value);
- }
- boolean editable = table.isCellEditable(row, column);
- result.setEnabled(editable);
- result.setText(text);
- }
-
+ boolean editable = table.isCellEditable(row, column);
+ result.setEnabled(editable);
+ result.setComputedOrNotText(data);
return result;
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -27,6 +27,7 @@
import com.ezware.oxbow.swingbits.util.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.protocol.SpeciesProtocol;
import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
@@ -59,6 +60,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -77,6 +79,8 @@
private Map<Integer, SpeciesProtocol> speciesProtocol;
private Map<String, Caracteristic> lengthStepCaracteristics;
+
+ protected Set<SpeciesFrequencyRowModel> withWeightRows = Sets.newHashSet();
public SpeciesFrequencyUIHandler(TuttiUIContext context,
SpeciesFrequencyUI ui) {
@@ -104,7 +108,8 @@
protected boolean isRowValid(SpeciesFrequencyRowModel row) {
return row.getLengthStepCaracteristic() != null &&
row.getLengthStep() != null &&
- row.getNumber() != null;
+ row.getNumber() != null && row.getNumber() > 0 &&
+ (withWeightRows.isEmpty() || row.getWeight() != null && row.getWeight() > 0);
}
@Override
@@ -114,7 +119,28 @@
Object oldValue,
Object newValue) {
- recomputeRowValidState(row);
+ boolean recomputeAllRows;
+
+ if (row.getWeight() != null) {
+ // check if no row had a weight, then if one of them now has a weight,
+ // the other ones must have one too to be valid
+ recomputeAllRows = withWeightRows.isEmpty();
+ withWeightRows.add(row);
+
+ } else {
+ withWeightRows.remove(row);
+ // check if no row has a weight, then if none of them now has a weight,
+ // the other ones do not need to have a weight to be valid
+ recomputeAllRows = withWeightRows.isEmpty();
+ }
+ if (recomputeAllRows) {
+ List<SpeciesFrequencyRowModel> rows = getModel().getRows();
+ for (SpeciesFrequencyRowModel r : rows) {
+ recomputeRowValidState(r);
+ }
+ } else {
+ recomputeRowValidState(row);
+ }
}
@Override
@@ -237,7 +263,7 @@
addFloatColumnToModel(columnModel,
SpeciesFrequencyTableModel.WEIGHT,
- TuttiUI.DECIMALFORCE3_PATTERN);
+ TuttiUI.DECIMAL3_PATTERN);
}
// create table model
@@ -367,9 +393,10 @@
}
public void editBatch(SpeciesBatchRowModel speciesBatch, FrequencyCellEditor editor) {
-
+ withWeightRows.clear();
+
frequencyEditor = editor;
-
+
Caracteristic lengthStepCaracteristic = null;
Float lengthStep = 1f;
@@ -382,7 +409,7 @@
// try to load existing frequency
- if (frequency != null) {
+ if (!CollectionUtils.isEmpty(frequency)) {
SpeciesFrequencyTableModel tableModel = getTableModel();
@@ -394,22 +421,23 @@
newRow.setNumber(rowModel.getNumber());
newRow.setWeight(rowModel.getWeight());
editFrequency.add(newRow);
+
+ if (newRow.getWeight() != null) {
+ withWeightRows.add(newRow);
+ }
}
- if (CollectionUtils.isNotEmpty(frequency)) {
+ // use first frequency row length step caracteristics
- // use first frequency row length step caracteristics
+ SpeciesFrequencyRowModel rowModel = frequency.get(0);
+ lengthStepCaracteristic = rowModel.getLengthStepCaracteristic();
+ lengthStep = rowModel.getLengthStep();
- SpeciesFrequencyRowModel rowModel = frequency.get(0);
- lengthStepCaracteristic = rowModel.getLengthStepCaracteristic();
- lengthStep = rowModel.getLengthStep();
-
- if (log.isInfoEnabled()) {
- log.info("Use existing lengthStep " +
- "caracteristic / step " +
- decorate(lengthStepCaracteristic) + " / " +
- lengthStep);
- }
+ if (log.isInfoEnabled()) {
+ log.info("Use existing lengthStep " +
+ "caracteristic / step " +
+ decorate(lengthStepCaracteristic) + " / " +
+ lengthStep);
}
}
@@ -454,7 +482,6 @@
mode = SpeciesFrequencyUIModel.ConfigurationMode.SIMPLE_COUNTING;
}
}
-
if (speciesBatch.getNumber() != null && editFrequency.isEmpty()) {
mode = SpeciesFrequencyUIModel.ConfigurationMode.SIMPLE_COUNTING;
model.setSimpleCount(speciesBatch.getNumber());
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/CreateSpeciesBatchUI.css 2013-02-15 18:24:13 UTC (rev 427)
@@ -75,7 +75,7 @@
property: batchWeight;
model: {model.getBatchWeight()};
useFloat: true;
- numberPattern: {DECIMALFORCE3_PATTERN};
+ numberPattern: {DECIMAL3_PATTERN};
bean: {model};
}
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -382,7 +382,7 @@
addFloatColumnToModel(columnModel,
SplitSpeciesBatchTableModel.WEIGHT,
- TuttiUI.DECIMALFORCE3_PATTERN);
+ TuttiUI.DECIMAL3_PATTERN);
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiComputedOrNotData.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiComputedOrNotData.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiComputedOrNotData.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -1,6 +1,8 @@
package fr.ifremer.tutti.ui.swing.util;
+import org.jdesktop.beans.AbstractBean;
+
/*
* #%L
* Tutti :: UI
@@ -29,8 +31,12 @@
*
* @author kmorin <kmorin(a)codelutin.com>
*/
-public class TuttiComputedOrNotData<N extends Number> {
+public class TuttiComputedOrNotData<N extends Number> extends AbstractBean {
+ public static final String PROPERTY_DATA = "data";
+
+ public static final String PROPERTY_COMPUTED_DATA = "computedData";
+
protected N data;
protected N computedData;
@@ -50,7 +56,9 @@
}
public void setData(N data) {
+ Object oldValue = getData();
this.data = data;
+ firePropertyChange(PROPERTY_DATA, oldValue, data);
}
public N getComputedData() {
@@ -58,16 +66,18 @@
}
public void setComputedData(N computedData) {
+ Object oldValue = getComputedData();
this.computedData = computedData;
+ firePropertyChange(PROPERTY_COMPUTED_DATA, oldValue, computedData);
}
-
+
@Override
public String toString() {
String result = null;
if (data != null) {
result = data.toString();
} else if (computedData != null) {
- result = "<html><em style='color: blue'>" + computedData.toString() + "</em></html>";
+ result = computedData.toString();
}
return result;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -1,141 +1,10 @@
package fr.ifremer.tutti.ui.swing.util.editor;
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 - 2013 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
-import java.awt.Component;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import javax.swing.AbstractCellEditor;
-import javax.swing.JTable;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.event.AncestorEvent;
-import javax.swing.event.AncestorListener;
-import javax.swing.table.TableCellEditor;
-import jaxx.runtime.swing.editor.NumberEditor;
-
/**
- * Editor for TuttiComputedOrNotData
- *
+ *
* @author kmorin <kmorin(a)codelutin.com>
- * @since 1.0
*/
-public class TuttiComputedOrNotDataEditor<E extends Number> extends AbstractCellEditor
- implements TableCellEditor, FocusListener, AncestorListener {
+public class TuttiComputedOrNotDataEditor {
- private static final long serialVersionUID = 1L;
-
- protected final NumberEditor numberEditor;
-
- protected TuttiComputedOrNotData<E> data;
-
- /** constructor */
- public TuttiComputedOrNotDataEditor(Class<E> type, boolean useSign) {
- numberEditor = new NumberEditor();
- numberEditor.getTextField().setHorizontalAlignment(SwingConstants.RIGHT);
- numberEditor.getTextField().setBorder(null);
- numberEditor.getTextField().addFocusListener(this);
- numberEditor.getTextField().addAncestorListener(this);
-
- numberEditor.setModelType(type);
-
- numberEditor.setUseSign(useSign);
- numberEditor.init();
- }
-
- @Override
- public Component getTableCellEditorComponent(JTable table, Object value,
- boolean isSelected, int row, int column) {
-
- data = (TuttiComputedOrNotData<E>) value;
- numberEditor.setModel(data.getData());
-
- // Check nullity and set the text that will be selected with the current value
- if (data.getData() != null) {
- numberEditor.setModelText(String.valueOf(data.getData()));
- }
- return numberEditor;
- }
-
- public NumberEditor getNumberEditor() {
- return numberEditor;
- }
-
- @Override
- public TuttiComputedOrNotData<E> getCellEditorValue() {
- return data;
- }
-
- @Override
- public void focusGained(FocusEvent e) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- numberEditor.getTextField().requestFocus();
- numberEditor.getTextField().selectAll();
- }
- });
- }
-
- @Override
- public void focusLost(FocusEvent e) {
- }
-
- @Override
- public void ancestorAdded(AncestorEvent event) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- numberEditor.getTextField().requestFocus();
- numberEditor.getTextField().selectAll();
- }
- });
- }
-
- @Override
- public void ancestorRemoved(AncestorEvent event) {
- }
-
- @Override
- public void ancestorMoved(AncestorEvent event) {
- }
-
- @Override
- public boolean stopCellEditing() {
- boolean result = super.stopCellEditing();
- // Reset previous data to avoid keeping it on other cell edition
- if (result) {
- data.setData((E) numberEditor.getModel());
-
- numberEditor.setModel(null);
- // Use empty string, otherwise there is a NPE in NumberEditorHandler
- numberEditor.setModelText("");
-
- data = null;
- }
- return result;
- }
-
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.jaxx 2013-02-15 18:24:13 UTC (rev 427)
@@ -0,0 +1,23 @@
+<jaxx.runtime.swing.editor.NumberEditor>
+
+ <import>
+ fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData
+ </import>
+
+ <String id='property' javaBean='TuttiComputedOrNotData.PROPERTY_DATA'/>
+
+ <TuttiComputedOrNotData id='bean' genericType='?' javaBean='null'/>
+
+ <!-- ui handler -->
+ <TuttiComputedOrNotDataEditorHandler id='handler' constructorParams='this'/>
+
+ <Integer id='decimalNumber' javaBean='null'/>
+
+ <script><![CDATA[
+ public void setProperty(String property) {
+ // cannot change the property
+ }
+]]>
+ </script>
+
+</jaxx.runtime.swing.editor.NumberEditor>
\ No newline at end of file
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditorHandler.java (from rev 411, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditorHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditorHandler.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -0,0 +1,113 @@
+
+package fr.ifremer.tutti.ui.swing.util.editor;
+
+import fr.ifremer.tutti.ui.swing.TuttiUI;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.regex.Matcher;
+import javax.swing.JTextField;
+import javax.swing.UIManager;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.swing.editor.NumberEditorHandler;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiComputedOrNotDataEditorHandler extends NumberEditorHandler {
+
+ private static final Log log = LogFactory.getLog(TuttiComputedOrNotDataEditorHandler.class);
+
+ protected Integer decimalNumber;
+
+ public TuttiComputedOrNotDataEditorHandler(TuttiComputedOrNotDataEditor ui) {
+ super(ui);
+ }
+
+ @Override
+ public void init() {
+ final PropertyChangeListener l = new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ setComputedTextIfNullModel();
+ }
+ };
+
+ TuttiComputedOrNotData bean = (TuttiComputedOrNotData) editor.getBean();
+ if (bean != null) {
+ bean.addPropertyChangeListener(TuttiComputedOrNotData.PROPERTY_COMPUTED_DATA, l);
+ }
+ editor.addPropertyChangeListener(TuttiComputedOrNotDataEditor.PROPERTY_BEAN, new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ TuttiComputedOrNotData bean = (TuttiComputedOrNotData) evt.getOldValue();
+ if (bean != null) {
+ bean.removePropertyChangeListener(TuttiComputedOrNotData.PROPERTY_COMPUTED_DATA, l);
+ }
+
+ bean = (TuttiComputedOrNotData) evt.getNewValue();
+ if (bean != null) {
+ bean.addPropertyChangeListener(TuttiComputedOrNotData.PROPERTY_COMPUTED_DATA, l);
+ }
+ }
+ });
+
+ editor.getTextField().addFocusListener(new FocusListener() {
+
+ public void focusGained(FocusEvent e) {
+ JTextField tf = editor.getTextField();
+ tf.setFont(TuttiUI.TEXTFIELD_NORMAL_FONT);
+ tf.setForeground(Color.BLACK);
+ if (editor.getModel() == null) {
+ tf.setText("");
+ }
+ }
+
+ public void focusLost(FocusEvent e) {
+ setComputedTextIfNullModel();
+ }
+ });
+
+ editor.addPropertyChangeListener(TuttiComputedOrNotDataEditor.PROPERTY_DECIMAL_NUMBER,
+ new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ decimalNumber = (Integer) evt.getNewValue();
+ }
+ });
+ decimalNumber = ((TuttiComputedOrNotDataEditor) editor).getDecimalNumber();
+
+ super.init();
+
+ }
+
+ protected void setComputedTextIfNullModel() {
+ TuttiComputedOrNotData bean = (TuttiComputedOrNotData) editor.getBean();
+ if (bean != null && editor.getModel() == null) {
+ JTextField tf = editor.getTextField();
+ tf.setFont(TuttiUI.TEXTFIELD_COMPUTED_FONT);
+ tf.setForeground(Color.BLUE);
+
+ String modelText;
+ Number computedData = bean.getComputedData();
+ if (editor.isUseFloat()
+ && decimalNumber != null && computedData != null) {
+ modelText = String.format("%." + decimalNumber + "f", computedData);
+ } else {
+ modelText = JAXXUtil.getStringValue(computedData);
+ }
+ tf.setText(modelText);
+ }
+ }
+
+}
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataTableCell.java (from rev 411, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataEditor.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataTableCell.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/TuttiComputedOrNotDataTableCell.java 2013-02-15 18:24:13 UTC (rev 427)
@@ -0,0 +1,209 @@
+package fr.ifremer.tutti.ui.swing.util.editor;
+
+import fr.ifremer.tutti.ui.swing.TuttiUI;
+import fr.ifremer.tutti.ui.swing.util.TuttiComputedOrNotData;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import javax.swing.AbstractCellEditor;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.border.LineBorder;
+import javax.swing.event.AncestorEvent;
+import javax.swing.event.AncestorListener;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import jaxx.runtime.JAXXUtil;
+
+/**
+ * Editor for TuttiComputedOrNotData
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0
+ */
+public class TuttiComputedOrNotDataTableCell extends DefaultTableCellRenderer {
+
+ public static TableCellRenderer newRender(TableCellRenderer renderer,
+ boolean useFloat,
+ Integer decimalNumber) {
+
+ return new TuttiComputedOrNotDataTableCellRenderer(renderer,
+ useFloat,
+ decimalNumber);
+ }
+
+ public static TableCellEditor newEditor(Class type,
+ boolean useSign,
+ boolean useFloat,
+ Integer decimalNumber) {
+
+ return new TuttiComputedOrNotDataTableCellEditor(type, useSign,
+ useFloat, decimalNumber);
+ }
+
+ public static class TuttiComputedOrNotDataTableCellEditor
+ extends AbstractCellEditor
+ implements TableCellEditor, FocusListener, AncestorListener {
+
+ private static final long serialVersionUID = 1L;
+ protected final TuttiComputedOrNotDataEditor numberEditor;
+ protected TuttiComputedOrNotData data;
+
+ /**
+ * constructor
+ */
+ public TuttiComputedOrNotDataTableCellEditor(Class type,
+ boolean useSign,
+ boolean useFloat,
+ Integer decimalNumber) {
+
+ numberEditor = new TuttiComputedOrNotDataEditor();
+ numberEditor.getTextField().setHorizontalAlignment(SwingConstants.RIGHT);
+ numberEditor.getTextField().addFocusListener(this);
+ numberEditor.getTextField().addAncestorListener(this);
+ numberEditor.getTextField().setBorder(new LineBorder(Color.GRAY, 2));
+ numberEditor.setSelectAllTextOnError(true);
+ numberEditor.setNumberPattern(TuttiUI.DECIMAL3_PATTERN);
+
+ numberEditor.setModelType(type);
+ numberEditor.setUseSign(useSign);
+ numberEditor.setUseFloat(useFloat);
+ numberEditor.setDecimalNumber(decimalNumber);
+ numberEditor.init();
+ }
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value,
+ boolean isSelected, int row, int column) {
+
+ data = (TuttiComputedOrNotData) value;
+ numberEditor.setModel(data.getData());
+
+ // Check nullity and set the text that will be selected with the current value
+ if (data.getData() != null) {
+ numberEditor.setModelText(String.valueOf(data.getData()));
+ }
+ return numberEditor;
+ }
+
+ public TuttiComputedOrNotDataEditor getNumberEditor() {
+ return numberEditor;
+ }
+
+ @Override
+ public TuttiComputedOrNotData getCellEditorValue() {
+ return data;
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ numberEditor.getTextField().requestFocus();
+ numberEditor.getTextField().selectAll();
+ }
+ });
+ }
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ }
+
+ @Override
+ public void ancestorAdded(AncestorEvent event) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ numberEditor.getTextField().requestFocus();
+ numberEditor.getTextField().selectAll();
+ }
+ });
+ }
+
+ @Override
+ public void ancestorRemoved(AncestorEvent event) {
+ }
+
+ @Override
+ public void ancestorMoved(AncestorEvent event) {
+ }
+
+ @Override
+ public boolean stopCellEditing() {
+ boolean result = super.stopCellEditing();
+ // Reset previous data to avoid keeping it on other cell edition
+ if (result) {
+ data.setData(numberEditor.getModel());
+
+ numberEditor.setBean(null);
+
+ data = null;
+ }
+ return result;
+ }
+ }
+
+ public static class TuttiComputedOrNotDataTableCellRenderer<E>
+ implements TableCellRenderer {
+
+ protected final TableCellRenderer delegate;
+
+ protected Integer decimalNumber;
+
+ protected boolean useFloat;
+
+ public TuttiComputedOrNotDataTableCellRenderer(
+ TableCellRenderer delegate,
+ boolean useFloat,
+ Integer decimalNumber) {
+
+ this.delegate = delegate;
+ this.useFloat = useFloat;
+ this.decimalNumber = decimalNumber;
+ }
+
+ public Component getTableCellRendererComponent(JTable table,
+ Object value,
+ boolean isSelected,
+ boolean hasFocus,
+ int row,
+ int column) {
+
+ TuttiComputedOrNotData data = (TuttiComputedOrNotData) value;
+ Number dataValue = data.getData();
+ Font font;
+ Color foreground;
+ if (dataValue == null) {
+ dataValue = data.getComputedData();
+ font = TuttiUI.TEXTFIELD_COMPUTED_FONT;
+ foreground = Color.BLUE;
+
+ } else {
+ font = TuttiUI.TEXTFIELD_NORMAL_FONT;
+ foreground = Color.BLACK;
+ }
+ String text;
+ if (useFloat && decimalNumber != null && dataValue != null) {
+ text = JAXXUtil.getStringValue(
+ String.format("%." + decimalNumber + "f", dataValue));
+ } else {
+ text = JAXXUtil.getStringValue(dataValue);
+ }
+
+ Component component = delegate.getTableCellRendererComponent(table,
+ text,
+ isSelected,
+ hasFocus,
+ row,
+ column);
+ component.setFont(font);
+ component.setForeground(foreground);
+
+ return component;
+ }
+
+ }
+}
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-02-15 18:24:13 UTC (rev 427)
@@ -42,9 +42,11 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingStartDate == null || gearShootingEndDate == null
- || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45 ]]>
+ || (org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45
+ && org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) >= 20 )
+ ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.tooLong</message>
+ <message>tutti.validator.error.fishingOperation.dates.wrongTime</message>
</field-validator>
</field>
@@ -61,9 +63,11 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingStartDate == null || gearShootingEndDate == null
- || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45 ]]>
+ || (org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45
+ && org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) >= 20 )
+ ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.tooLong</message>
+ <message>tutti.validator.error.fishingOperation.dates.wrongTime</message>
</field-validator>
</field>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml 2013-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-warning-validation.xml 2013-02-15 18:24:13 UTC (rev 427)
@@ -35,9 +35,11 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingStartDate == null || gearShootingEndDate == null
- || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45 ]]>
+ || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45
+ && org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) >= 20 )
+ ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.tooLong</message>
+ <message>tutti.validator.error.fishingOperation.dates.wrongTime</message>
</field-validator>
</field>
@@ -47,9 +49,11 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ gearShootingStartDate == null || gearShootingEndDate == null
- || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45 ]]>
+ || org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) <= 45
+ && org.nuiton.util.DateUtil.getDifferenceInMinutes(gearShootingStartDate, gearShootingEndDate) >= 20 )
+ ]]>
</param>
- <message>tutti.validator.error.fishingOperation.dates.tooLong</message>
+ <message>tutti.validator.error.fishingOperation.dates.wrongTime</message>
</field-validator>
</field>
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-02-15 17:55:53 UTC (rev 426)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-02-15 18:24:13 UTC (rev 427)
@@ -195,7 +195,7 @@
tutti.label.catches.catchThalassa=(*) uniquement sur Thalassa
tutti.label.catches.catchTotalRejectedWeight=Poids total NON TRIÉ (kg)
tutti.label.catches.catchTotalSortedCarousselWeight=Caroussel Observé (*)
-tutti.label.catches.catchTotalSortedTremisWeight=Tremis (*)
+tutti.label.catches.catchTotalSortedTremisWeight=Tremie (*)
tutti.label.catches.catchTotalSortedWeight=Poids total VRAC (kg)
tutti.label.catches.catchTotalUnsortedWeight=Poids total HORS VRAC (kg)
tutti.label.catches.catchTotalWeight=Poids TOTAL (kg)
@@ -497,7 +497,7 @@
tutti.validator.error.fishingOperation.dates.endBeforeStart=La date de fin doit être après la date de début
tutti.validator.error.fishingOperation.dates.endOutOfCruiseDates=La date de fin est en dehors des dates de la campagne
tutti.validator.error.fishingOperation.dates.startOutOfCruiseDates=La date de début est en dehors des dates de la campagne
-tutti.validator.error.fishingOperation.dates.tooLong=La durée du trait dépasse 45 minutes, merci de vérifier les dates/heures du trait
+tutti.validator.error.fishingOperation.dates.wrongTime=La durée du trait dépasse 45 minutes ou est inférieure à 20 minutes, merci de vérifier les dates/heures du trait
tutti.validator.error.fishingOperation.existingKey=La clé code station/numéro de trait/date de début existe déjà
tutti.validator.error.fishingOperation.fishingOperationNumber.required=Le numéro de trait est obligatoire
tutti.validator.error.fishingOperation.fishingOperationValid.required=La validité du traît est obligatoire
1
0
Author: tchemit
Date: 2013-02-15 18:55:53 +0100 (Fri, 15 Feb 2013)
New Revision: 426
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/426
Log:
use last stable of jaxx
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-02-15 17:55:36 UTC (rev 425)
+++ trunk/pom.xml 2013-02-15 17:55:53 UTC (rev 426)
@@ -132,7 +132,7 @@
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
- <jaxxVersion>2.5.10-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.5.10</jaxxVersion>
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.7</xworkVersion>
1
0
r425 - in trunk/tutti-persistence/src/main: java/fr/ifremer/tutti/persistence/service resources
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 18:55:36 +0100 (Fri, 15 Feb 2013)
New Revision: 425
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/425
Log:
manual close of db
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-02-15 17:18:29 UTC (rev 424)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/TuttiPersistenceServiceLocator.java 2013-02-15 17:55:36 UTC (rev 425)
@@ -44,7 +44,7 @@
public static void initTuttiDefault() {
instance().init("tuttiBeanRefFactory.xml", "TuttiBeanRefFactory");
}
-
+
public static void initTutti(String beanFactoryReferenceLocation,
String beanRefFactoryReferenceId) {
instance().init(beanFactoryReferenceLocation, beanRefFactoryReferenceId);
@@ -87,7 +87,7 @@
public static CatchBatchPersistenceService getCatchBatchPersistenceService() {
return getPersistenceService("batchPersistenceService",
- CatchBatchPersistenceService.class);
+ CatchBatchPersistenceService.class);
}
public static SpeciesBatchPersistenceService getSpeciesBatchPersistenceService() {
Modified: trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml
===================================================================
--- trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-02-15 17:18:29 UTC (rev 424)
+++ trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-02-15 17:55:36 UTC (rev 425)
@@ -31,7 +31,7 @@
<context:component-scan base-package="fr.ifremer.tutti.persistence.service"/>
- <bean id="tuttiPersistence" init-method="init" destroy-method="close"
+ <bean id="tuttiPersistence" init-method="init"
class="fr.ifremer.tutti.persistence.TuttiPersistenceImpl"/>
<bean id="tuttiEnumerationFile" init-method="init"
1
0
See <http://ci.nuiton.org/jenkins/job/tutti/350/changes>
Changes:
[Tony Chemit] clean validator when quitting home screen
[Tony Chemit] ajout manage db
------------------------------------------
[...truncated 492 lines...]
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 42.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-va…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va… (2 KB at 50.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 42.4 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 30.5 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi… (2 KB at 28.6 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target>
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-ui-swing ---
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-ui-swing ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.jaxx:jaxx-maven-plugin:2.5.10-SNAPSHOT(default)
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.10-SNAPSHOT:generate (default) @ tutti-ui-swing ---
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.1 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 39.0 KB/sec)
[INFO] use project compile scope class-path
[INFO] Detects 26 modified jaxx file(s).
mojoSucceeded org.nuiton.jaxx:jaxx-maven-plugin:2.5.10-SNAPSHOT(default)[WARNING] JAXX detects 3 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 'text' in component 'filterSpeciesBatchRootButton' : [_("tutti.label.filterSpeciesBatchMode.mode.root", model.getRootNumber())]
<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 'gearLatitudeLabel' : [_("tutti.label.fishingOperation.gearLatitude", ((CoordinateEditorType)handler.getConfig().getCoordinateEditorType()).toString())]
<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 'gearLongitudeLabel' : [_("tutti.label.fishingOperation.gearLongitude", ((CoordinateEditorType)handler.getConfig().getCoordinateEditorType()).toString())]
[INFO] Generated 26 file(s) in 16.137s
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-ui-swing ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserValidation (scan-sources) @ tutti-ui-swing ---
[INFO] Load rules file validation.rules
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5: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…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 31/547 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(collect-i18n-artifacts)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:collect-i18n-artifacts (collect-i18n-artifacts) @ tutti-ui-swing ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(collect-i18n-artifacts)[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/…>
forkedProjectSucceeded fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(make-bundle)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:bundle (make-bundle) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 37/800 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(make-bundle)
mojoStarted org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
[INFO]
[INFO] --- license-maven-plugin:1.4:update-project-license (attach-licenses) @ tutti-ui-swing ---
mojoSucceeded org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
mojoStarted org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
[INFO]
[INFO] --- license-maven-plugin:1.4:add-third-party (attach-licenses) @ tutti-ui-swing ---
[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/…>
mojoSucceeded org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 78 resources
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)[INFO] Copying 2 resources
[INFO] Copying 4 resources
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-ui-swing ---
[INFO] Compiling 208 source files to <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/target/class…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[29,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[48,37] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[28,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[44,35] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[27,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[42,36] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[28,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[44,34] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[67,40] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[79,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[82,87] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[83,57] error: UpdateType is not public in TuttiApplicationUpdaterCallBack; cannot be accessed from outside package
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[87,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[93,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[96,25] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[96,38] error: cannot find symbol
[ERROR] symbol: method actionPerformed(ActionEvent)
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[65,4] error: method does not override or implement a method from a supertype
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[101,8] error: cannot find symbol
[ERROR] symbol: variable super
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[102,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[99,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[69,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[71,8] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[73,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[76,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[60,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[58,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[64,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[65,8] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[69,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[71,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/src/main/jav…>:[61,4] error: method does not override or implement a method from a supertype
[INFO] 31 errors
[INFO] -------------------------------------------------------------
projectFailed fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
sessionEnded
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tutti ............................................. SUCCESS [7.494s]
[INFO] Tutti :: Persistence .............................. SUCCESS [23.127s]
[INFO] Tutti :: Service .................................. SUCCESS [3.801s]
[INFO] Tutti :: UI ....................................... FAILURE [26.597s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:03.162s
[INFO] Finished at: Fri Feb 15 16:04:43 CET 2013
[INFO] Final Memory: 57M/184M
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: fr.ifremer:tutti:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-persistence:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-persistence/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-service:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-service/pom.xml,> MavenProject: fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT @ <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/tutti-ui-swing/pom.xml]>
[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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-service/1.0-SNAPSHOT/tutti-service-1.0-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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-service/1.0-SNAPSHOT/tutti-service-1.0-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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-ui-swing/1.0-SNAPSHOT/tutti-ui-swing-1.0-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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-ui-swing/1.0-SNAPSHOT/tutti-ui-swing-1.0-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-02-15_16-03-35/archive/fr.ifremer/tutti/1.0-SNAPSHOT/tutti-1.0-SNAPSHOT.pom
[JENKINS] Archiving <http://ci.nuiton.org/jenkins/job/tutti/ws/trunk/target/tutti-1.0-SNAPSHOT-s…> to /var/local/jenkins/data/jobs/tutti/modules/fr.ifremer$tutti/builds/2013-02-15_16-03-35/archive/fr.ifremer/tutti/1.0-SNAPSHOT/tutti-1.0-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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-persistence/1.0-SNAPSHOT/tutti-persistence-1.0-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-02-15_16-03-35/archive/fr.ifremer.tutti/tutti-persistence/1.0-SNAPSHOT/tutti-persistence-1.0-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:2.5.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:2.5.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:601)
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:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
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$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:729)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Maven failed with error.
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
Sending e-mails to: tutti-commits(a)list.forge.codelutin.com chemit(a)codelutin.com
channel stopped
1
2
Jenkins build became unstable: tutti » Tutti :: Service #350
by admin+hudson@codelutin.com 15 Feb '13
by admin+hudson@codelutin.com 15 Feb '13
15 Feb '13
r424 - trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/referential
by tchemit@users.forge.codelutin.com 15 Feb '13
by tchemit@users.forge.codelutin.com 15 Feb '13
15 Feb '13
Author: tchemit
Date: 2013-02-15 18:18:29 +0100 (Fri, 15 Feb 2013)
New Revision: 424
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/424
Log:
fix tests
Modified:
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/referential/TuttiReferentialImportExportServiceTest.java
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/referential/TuttiReferentialImportExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/referential/TuttiReferentialImportExportServiceTest.java 2013-02-15 16:55:21 UTC (rev 423)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/referential/TuttiReferentialImportExportServiceTest.java 2013-02-15 17:18:29 UTC (rev 424)
@@ -37,6 +37,7 @@
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiServiceContext;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
+import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -250,6 +251,8 @@
name.getMethodName(),
null, TIMESTAMP);
+ FileUtils.forceMkdir(datadirectory);
+
ApplicationConfig applicationConfig =
new ApplicationConfig("tutti-test.properties");
applicationConfig.loadDefaultOptions(
@@ -281,7 +284,38 @@
public void setServiceContext(TuttiServiceContext context) {
this.context = context;
persistenceService = new PersistenceService() {
+
@Override
+ public List<Species> getAllSpecies() {
+ return Lists.newArrayList();
+ }
+
+ @Override
+ public List<Person> getAllPerson() {
+ return Lists.newArrayList();
+ }
+
+ @Override
+ public List<Gear> getAllScientificGear() {
+ return Lists.newArrayList();
+ }
+
+ @Override
+ public List<Gear> getAllFishingGear() {
+ return Lists.newArrayList();
+ }
+
+ @Override
+ public List<Vessel> getAllScientificVessel() {
+ return Lists.newArrayList();
+ }
+
+ @Override
+ public List<Vessel> getAllFishingVessel() {
+ return Lists.newArrayList();
+ }
+
+ @Override
public List<Species> importTemporarySpecies(List<Species> species) {
Binder<Species, Species> binder = BinderFactory.newBinder(Species.class);
List<Species> result = Lists.newArrayList();
1
0
15 Feb '13
See <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/350/…>
Changes:
[Tony Chemit] clean validator when quitting home screen
[Tony Chemit] ajout manage db
------------------------------------------
projectStarted fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tutti :: UI 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma…
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 52.1 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ma… (2 KB at 31.3 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.…
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.10-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/2.… (808 B at 15.2 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/2.5.10-… (808 B at 15.5 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-valid…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/nuiton-… (2 KB at 51.9 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/nuiton-valid… (2 KB at 38.6 KB/sec)
Downloading: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru…
Downloading: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-ru… (2 KB at 39.0 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 42.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-va…
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-va… (2 KB at 50.4 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/tutti-group/org/nuiton/jaxx/ja… (2 KB at 42.4 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 30.5 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-wi… (2 KB at 28.6 KB/sec)
mojoStarted org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)[INFO] Deleting <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tutti-ui-swing ---
mojoSucceeded org.apache.maven.plugins:maven-clean-plugin:2.5(default-clean)
mojoStarted org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (check-project-files) @ tutti-ui-swing ---
mojoSucceeded org.apache.maven.plugins:maven-enforcer-plugin:1.2(check-project-files)
mojoStarted org.nuiton.jaxx:jaxx-maven-plugin:2.5.10-SNAPSHOT(default)
[INFO]
[INFO] --- jaxx-maven-plugin:2.5.10-SNAPSHOT:generate (default) @ tutti-ui-swing ---
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.1 KB/sec)
Downloaded: http://nexus.nuiton.org/nexus/content/groups/public/org/nuiton/jaxx/jaxx-co… (2 KB at 39.0 KB/sec)
[INFO] use project compile scope class-path
[INFO] Detects 26 modified jaxx file(s).
mojoSucceeded org.nuiton.jaxx:jaxx-maven-plugin:2.5.10-SNAPSHOT(default)[WARNING] JAXX detects 3 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 'text' in component 'filterSpeciesBatchRootButton' : [_("tutti.label.filterSpeciesBatchMode.mode.root", model.getRootNumber())]
<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 'gearLatitudeLabel' : [_("tutti.label.fishingOperation.gearLatitude", ((CoordinateEditorType)handler.getConfig().getCoordinateEditorType()).toString())]
<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 'gearLongitudeLabel' : [_("tutti.label.fishingOperation.gearLongitude", ((CoordinateEditorType)handler.getConfig().getCoordinateEditorType()).toString())]
[INFO] Generated 26 file(s) in 16.137s
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserJava (scan-sources) @ tutti-ui-swing ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:parserValidation (scan-sources) @ tutti-ui-swing ---
[INFO] Load rules file validation.rules
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(get)
[INFO]
[INFO] --- i18n-maven-plugin:2.5: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…>
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(get)
forkedProjectSucceeded fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:gen (scan-sources) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 31/547 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(scan-sources)
forkedProjectStarted fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(collect-i18n-artifacts)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:collect-i18n-artifacts (collect-i18n-artifacts) @ tutti-ui-swing ---
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(collect-i18n-artifacts)[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…>
forkedProjectSucceeded fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
mojoStarted org.nuiton.i18n:i18n-maven-plugin:2.5(make-bundle)
[INFO]
[INFO] --- i18n-maven-plugin:2.5:bundle (make-bundle) @ tutti-ui-swing ---
[WARNING] bundle fr_FR contains 37/800 empty entries! (use -Di18n.showEmpty to see these entries)
mojoSucceeded org.nuiton.i18n:i18n-maven-plugin:2.5(make-bundle)
mojoStarted org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
[INFO]
[INFO] --- license-maven-plugin:1.4:update-project-license (attach-licenses) @ tutti-ui-swing ---
mojoSucceeded org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
mojoStarted org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
[INFO]
[INFO] --- license-maven-plugin:1.4:add-third-party (attach-licenses) @ tutti-ui-swing ---
[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…>
mojoSucceeded org.codehaus.mojo:license-maven-plugin:1.4(attach-licenses)
mojoStarted org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tutti-ui-swing ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 78 resources
mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.6(default-resources)[INFO] Copying 2 resources
[INFO] Copying 4 resources
mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ tutti-ui-swing ---
[INFO] Compiling 208 source files to <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/t…>
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[29,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[48,37] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[44,35] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[27,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[42,36] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[28,32] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
location: package fr.ifremer.tutti.ui.swing
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[44,34] error: cannot find symbol
[ERROR] symbol: class AbstractMainUITuttiAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[67,40] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[79,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[82,87] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[83,57] error: UpdateType is not public in TuttiApplicationUpdaterCallBack; cannot be accessed from outside package
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[87,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[93,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[96,25] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[96,38] error: cannot find symbol
[ERROR] symbol: method actionPerformed(ActionEvent)
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[65,4] error: method does not override or implement a method from a supertype
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.5.1(default-compile)[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[101,8] error: cannot find symbol
[ERROR] symbol: variable super
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[102,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class InstallDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[99,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[69,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[71,8] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[73,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[76,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class CloseDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[60,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[58,4] error: method does not override or implement a method from a supertype
[ERROR] <http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[64,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[65,8] error: cannot find symbol
[ERROR] symbol: method getHandler()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[69,8] error: cannot find symbol
[ERROR] symbol: method sendMessage(String)
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[71,8] error: cannot find symbol
[ERROR] symbol: method getContext()
location: class OpenDbAction
<http://ci.nuiton.org/jenkins/job/tutti/fr.ifremer.tutti$tutti-ui-swing/ws/s…>:[61,4] error: method does not override or implement a method from a supertype
[INFO] 31 errors
[INFO] -------------------------------------------------------------
projectFailed fr.ifremer.tutti:tutti-ui-swing:1.0-SNAPSHOT
1
1