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
December 2012
- 2 participants
- 109 discussions
21 Dec '12
Author: tchemit
Date: 2012-12-21 21:27:17 +0100 (Fri, 21 Dec 2012)
New Revision: 104
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/104
Log:
refs #1804: Onglet captures (review as seen with Vincent)
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/macrowaste/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/plankton/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.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/plankton/PlanktonBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -40,8 +40,7 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListSelectionEvent;
+import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -53,9 +52,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionListener;
-import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
/**
@@ -174,24 +170,24 @@
persistenceService.getAllPerson(),
model.getSaisisseur());
final BeanDoubleListModel<Person> saisisseurModel = ui.getSaisisseurList().getModel();
- saisisseurModel.getSelectedModel().addListDataListener(new ListDataListener() {
+// saisisseurModel.getSelectedModel().addListDataListener(new ListDataListener() {
+//
+// public void intervalAdded(ListDataEvent e) {
+// log.info(">>>>>>>>>> intervalAdded " + saisisseurModel.getSelected());
+// ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+// }
+//
+// public void intervalRemoved(ListDataEvent e) {
+// log.info(">>>>>>>>>> intervalRemoved " + saisisseurModel.getSelected());
+// ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+// }
+//
+// public void contentsChanged(ListDataEvent e) {
+// log.info(">>>>>>>>>> contentsChanged " + saisisseurModel.getSelected());
+// ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+// }
+// });
- public void intervalAdded(ListDataEvent e) {
- log.info(">>>>>>>>>> intervalAdded " + saisisseurModel.getSelected());
- ui.getModel().setSaisisseur(saisisseurModel.getSelected());
- }
-
- public void intervalRemoved(ListDataEvent e) {
- log.info(">>>>>>>>>> intervalRemoved " + saisisseurModel.getSelected());
- ui.getModel().setSaisisseur(saisisseurModel.getSelected());
- }
-
- public void contentsChanged(ListDataEvent e) {
- log.info(">>>>>>>>>> contentsChanged " + saisisseurModel.getSelected());
- ui.getModel().setSaisisseur(saisisseurModel.getSelected());
- }
- });
-
String programId = context.getProgramId();
Program program = persistenceService.getProgram(programId);
@@ -301,7 +297,7 @@
}
public void selectFishingOperation(FishingOperation bean) {
-
+
if (fishingOperationMonitor.wasModified()) {
// previous fishingOperation was modified, let's save it
@@ -324,7 +320,7 @@
}
// persist current fishingOperation
- parentUi.getHandler().saveFishingOperation(toSave, false);
+ parentUi.getHandler().saveFishingOperation(toSave);
}
}
@@ -364,6 +360,9 @@
// update saisissuer selection
List<Person> saisisseur = model.getSaisisseur();
+ if (log.isInfoEnabled()) {
+ log.info("Selected saisisseurs: " + saisisseur.size());
+ }
ui.getSaisisseurList().getModel().setSelected(saisisseur);
// update model empty property
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.css 2012-12-21 20:27:17 UTC (rev 104)
@@ -41,18 +41,40 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#benthosSampleTotalWeightLabel {
- text: "tutti.label.catches.benthosSampleTotalWeight";
- labelFor: {benthosSampleTotalWeightField};
+#benthosTotalSortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalSortedWeight";
+ labelFor: {benthosTotalSortedWeightField};
}
-#benthosSampleTotalWeightField {
- property: "benthosSampleTotalWeight";
- model: {model.getBenthosSampleTotalWeight()};
+#benthosTotalSortedWeightField {
+ property: "benthosTotalSortedWeight";
+ model: {model.getBenthosTotalSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
+#benthosTotalSampleSortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalSampleSortedWeight";
+ labelFor: {benthosTotalSampleSortedWeightField};
+}
+
+#benthosTotalSampleSortedWeightField {
+ property: "benthosTotalSampleSortedWeight";
+ model: {model.getBenthosTotalSampleSortedWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#benthosTotalUnsortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalUnsortedWeight";
+ labelFor: {benthosTotalUnsortedWeightField};
+}
+
+#benthosTotalUnsortedWeightField {
+ text: {getStringValue(model.getBenthosTotalUnsortedWeight())};
+ editable: false;
+}
+
#table {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
selectionBackground: {null};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUI.jaxx 2012-12-21 20:27:17 UTC (rev 104)
@@ -43,6 +43,7 @@
java.awt.Color
static org.nuiton.i18n.I18n._
+ static jaxx.runtime.SwingUtil.getStringValue
</import>
<script><![CDATA[
@@ -68,8 +69,12 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='benthosTotalWeight' component='benthosTotalWeightField'/>
- <field name='benthosSampleTotalWeight'
- component='benthosSampleTotalWeightField'/>
+ <field name='benthosTotalSortedWeight'
+ component='benthosTotalSortedWeightField'/>
+ <field name='benthosTotalSampleSortedWeight'
+ component='benthosTotalSampleSortedWeightField'/>
+ <field name='benthosTotalUnsortedWeight'
+ component='benthosTotalUnsortedWeightField'/>
</BeanValidator>
<LongTextEditorUI id='longTextEditor'/>
@@ -78,7 +83,7 @@
<Table id='form' fill='both' constraints='BorderLayout.NORTH'>
- <!-- Poids total -->
+ <!-- Poids total / Poids total vrac -->
<row>
<cell anchor='west'>
<JLabel id='benthosTotalWeightLabel'/>
@@ -86,17 +91,30 @@
<cell weightx='1.0'>
<NumberEditor id='benthosTotalWeightField' constructorParams='this'/>
</cell>
+ <cell anchor='west'>
+ <JLabel id='benthosTotalSortedWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='benthosTotalSortedWeightField'
+ constructorParams='this'/>
+ </cell>
</row>
- <!-- Poids total échantillonné -->
+ <!-- Poids échantillonné vrac / Poids total hors vrac -->
<row>
<cell>
- <JLabel id='benthosSampleTotalWeightLabel'/>
+ <JLabel id='benthosTotalSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='benthosSampleTotalWeightField'
+ <NumberEditor id='benthosTotalSampleSortedWeightField'
constructorParams='this'/>
</cell>
+ <cell>
+ <JLabel id='benthosTotalUnsortedWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='benthosTotalUnsortedWeightField'/>
+ </cell>
</row>
</Table>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/benthos/BenthosBatchUIModel.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -38,7 +38,9 @@
public BenthosBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT);
+ EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT);
}
public Float getBenthosTotalWeight() {
@@ -49,11 +51,27 @@
catchesUIModel.setBenthosTotalWeight(benthosTotalWeight);
}
- public Float getBenthosSampleTotalWeight() {
- return catchesUIModel.getBenthosSampleTotalWeight();
+ public Float getBenthosTotalSampleSortedWeight() {
+ return catchesUIModel.getBenthosTotalSampleSortedWeight();
}
- public void setBenthosSampleTotalWeight(Float benthosSampleTotalWeight) {
- catchesUIModel.setBenthosSampleTotalWeight(benthosSampleTotalWeight);
+ public void setBenthosTotalSampleSortedWeight(Float benthosTotalSampleSortedWeight) {
+ catchesUIModel.setBenthosTotalSampleSortedWeight(benthosTotalSampleSortedWeight);
}
+
+ public Float getBenthosTotalSortedWeight() {
+ return catchesUIModel.getBenthosTotalSortedWeight();
+ }
+
+ public void setBenthosTotalSortedWeight(Float benthosTotalSortedWeight) {
+ catchesUIModel.setBenthosTotalSortedWeight(benthosTotalSortedWeight);
+ }
+
+ public Float getBenthosTotalUnsortedWeight() {
+ return catchesUIModel.getBenthosTotalUnsortedWeight();
+ }
+
+ public void setBenthosTotalUnsortedWeight(Float benthosTotalUnsortedWeight) {
+ catchesUIModel.setBenthosTotalUnsortedWeight(benthosTotalUnsortedWeight);
+ }
}
\ No newline at end of file
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 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2012-12-21 20:27:17 UTC (rev 104)
@@ -29,26 +29,72 @@
showReset: true;
}
-#speciesTable {
- border: {BorderFactory.createTitledBorder(_("tutti.legend.speciesCatches"))};
+#catchTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.total"))};
}
-#benthosTable {
- border: {BorderFactory.createTitledBorder(_("tutti.legend.benthosCatches"))};
+#catchTotalWeightLabel {
+ text: "tutti.label.catches.catchTotalWeight";
+ labelFor: {catchTotalWeightField};
}
-#planktonTable {
- border: {BorderFactory.createTitledBorder(_("tutti.legend.planktonCatches"))};
+#catchTotalWeightField {
+ property: "catchTotalWeight";
+ model: {model.getCatchTotalWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
}
-#macroWasteTable {
- border: {BorderFactory.createTitledBorder(_("tutti.legend.macroWasteCatches"))};
+#catchTotalSortedTremisWeightLabel {
+ text: "tutti.label.catches.catchTotalSortedTremisWeight";
+ labelFor: {catchTotalSortedTremisWeightField};
}
-#accidentalTable {
- border: {BorderFactory.createTitledBorder(_("tutti.legend.accidentalCatches"))};
+#catchTotalSortedTremisWeightField {
+ property: "catchTotalSortedTremisWeight";
+ model: {model.getCatchTotalSortedTremisWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
}
+#catchTotalSortedCarousselWeightLabel {
+ text: "tutti.label.catches.catchTotalSortedCarousselWeight";
+ labelFor: {catchTotalSortedCarousselWeightField};
+}
+
+#catchTotalSortedCarousselWeightField {
+ property: "catchTotalSortedCarousselWeight";
+ model: {model.getCatchTotalSortedCarousselWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#catchTotalRejectedWeightLabel {
+ text: "tutti.label.catches.catchTotalRejectedWeight";
+ labelFor: {catchTotalRejectedWeightField};
+}
+
+#catchTotalRejectedWeightField {
+ property: "catchTotalRejectedWeight";
+ model: {model.getCatchTotalRejectedWeight()};
+ useFloat: false;
+ numberPattern: {INT_6_DIGITS_PATTERN};
+}
+
+#catchTotalUnsortedWeightLabel {
+ text: "tutti.label.catches.catchTotalUnsortedWeight";
+ labelFor: {catchTotalUnsortedWeightField};
+}
+
+#catchTotalUnsortedWeightField {
+ editable: false;
+ text: {getStringValue(model.getCatchTotalUnsortedWeight())};
+}
+
+#speciesTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.species"))};
+}
+
#speciesTotalWeightLabel {
text: "tutti.label.catches.speciesTotalWeight";
labelFor: {speciesTotalWeightField};
@@ -73,14 +119,14 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesSampleSortedWeightLabel {
- text: "tutti.label.catches.speciesSampleSortedWeight";
- labelFor: {speciesSampleSortedWeightField};
+#speciesTotalSampleSortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalSampleSortedWeight";
+ labelFor: {speciesTotalSampleSortedWeightField};
}
-#speciesSampleSortedWeightField {
- property: "speciesSampleSortedWeight";
- model: {model.getSpeciesSampleSortedWeight()};
+#speciesTotalSampleSortedWeightField {
+ property: "speciesTotalSampleSortedWeight";
+ model: {model.getSpeciesTotalSampleSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
@@ -95,6 +141,10 @@
editable: false;
}
+#benthosTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.benthos"))};
+}
+
#benthosTotalWeightLabel {
text: "tutti.label.catches.benthosTotalWeight";
labelFor: {benthosTotalWeightField};
@@ -107,42 +157,49 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#benthosSampleTotalWeightLabel {
- text: "tutti.label.catches.benthosSampleTotalWeight";
- labelFor: {benthosSampleTotalWeightField};
+#benthosTotalSortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalSortedWeight";
+ labelFor: {benthosTotalSortedWeightField};
}
-#benthosSampleTotalWeightField {
- property: "benthosSampleTotalWeight";
- model: {model.getBenthosSampleTotalWeight()};
+#benthosTotalSortedWeightField {
+ property: "benthosTotalSortedWeight";
+ model: {model.getBenthosTotalSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#planktonTotalWeightLabel {
- text: "tutti.label.catches.planktonTotalWeight";
- labelFor: {planktonTotalWeightField};
+#benthosTotalSampleSortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalSampleSortedWeight";
+ labelFor: {benthosTotalSampleSortedWeightField};
}
-#planktonTotalWeightField {
- property: "planktonTotalWeight";
- model: {model.getPlanktonTotalWeight()};
+#benthosTotalSampleSortedWeightField {
+ property: "benthosTotalSampleSortedWeight";
+ model: {model.getBenthosTotalSampleSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#planktonSampleTotalWeightLabel {
- text: "tutti.label.catches.planktonSampleTotalWeight";
- labelFor: {planktonSampleTotalWeightField};
+#benthosTotalUnsortedWeightLabel {
+ text: "tutti.label.catches.benthosTotalUnsortedWeight";
+ labelFor: {benthosTotalUnsortedWeightField};
}
-#planktonSampleTotalWeightField {
- property: "planktonSampleTotalWeight";
- model: {model.getPlanktonSampleTotalWeight()};
- useFloat: false;
- numberPattern: {INT_6_DIGITS_PATTERN};
+#benthosTotalUnsortedWeightField {
+ text: {getStringValue(model.getBenthosTotalUnsortedWeight())};
+ editable: false;
}
+#otherTable {
+ border: {BorderFactory.createTitledBorder(_("tutti.legend.catch.other"))};
+}
+
+#planktonObservedCheckBox {
+ text: "tutti.label.catches.planktonObserved";
+ selected: {model.isPlanktonObserved()};
+}
+
#macroWasteTotalWeightLabel {
text: "tutti.label.catches.macroWasteTotalWeight";
labelFor: {macroWasteTotalWeightField};
@@ -155,6 +212,11 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
+#accidentalObservedCheckBox {
+ text: "tutti.label.catches.accidentalObserved";
+ selected: {model.isAccidentalObserved()};
+}
+
#importPupitriButton {
actionIcon: "pupitri-import";
text: "tutti.action.pupitri-import";
@@ -163,3 +225,5 @@
#observationIndividuelTab {
enabled: {false};
}
+
+//#catchesCaracteristicsTabScrollPane { }
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 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2012-12-21 20:27:17 UTC (rev 104)
@@ -66,22 +66,31 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
- <field name='speciesTotalWeight'
- component='speciesTotalWeightField'/>
+ <field name='catchTotalWeight' component='catchTotalWeightField'/>
+ <field name='catchTotalSortedTremisWeight'
+ component='catchTotalSortedTremisWeightField'/>
+ <field name='catchTotalSortedCarousselWeight'
+ component='catchTotalSortedCarousselWeightField'/>
+ <field name='catchTotalRejectedWeight'
+ component='catchTotalRejectedWeightField'/>
+
<field name='speciesTotalSortedWeight'
component='speciesTotalSortedWeightField'/>
- <field name='speciesSampleSortedWeight'
- component='speciesSampleSortedWeightField'/>
+ <field name='speciesTotalSampleSortedWeight'
+ component='speciesTotalSampleSortedWeightField'/>
<field name='speciesTotalUnsortedWeight'
component='speciesTotalUnsortedWeightField'/>
- <field name='benthosTotalWeight'
- component='benthosTotalWeightField'/>
- <field name='benthosSampleTotalWeight'
- component='benthosSampleTotalWeightField'/>
- <field name='planktonTotalWeight'
- component='planktonTotalWeightField'/>
- <field name='planktonSampleTotalWeight'
- component='planktonSampleTotalWeightField'/>
+
+ <field name='benthosTotalSortedWeight'
+ component='benthosTotalSortedWeightField'/>
+ <field name='benthosTotalSampleSortedWeight'
+ component='benthosTotalSampleSortedWeightField'/>
+ <field name='benthosTotalUnsortedWeight'
+ component='benthosTotalUnsortedWeightField'/>
+
+ <field name='planktonObserved' component='planktonObservedCheckBox'/>
+ <field name='accidentalObserved' component='accidentalObservedCheckBox'/>
+
<field name='macroWasteTotalWeight'
component='macroWasteTotalWeightField'/>
</BeanValidator>
@@ -89,133 +98,193 @@
<JTabbedPane id='tabPane' constraints='BorderLayout.CENTER'>
<tab id='catchesCaracteristicsTab'
title='tutti.label.tab.catchesCaracteristics'>
- <JXTitledPanel id='catchesTabsFishingOperationReminderLabel'>
- <JPanel layout='{new BorderLayout()}'>
- <Table id="catchesForm" fill='both' weightx='1'
- constraints='BorderLayout.NORTH'>
- <row>
- <cell columns="2">
- <Table id='speciesTable' fill='both'>
+ <JXTitledPanel id='catchesCaracteristicsTabPane'>
+ <JScrollPane id='catchesCaracteristicsTabScrollPane'>
+ <JPanel layout='{new BorderLayout()}'>
+ <Table id="catchesForm" fill='both' weightx='1'
+ constraints='BorderLayout.NORTH'>
+ <row>
+ <cell>
+ <Table id='catchTable' fill='both'>
- <!-- Poids total / Poids total vrac -->
- <row>
- <cell anchor='west'>
- <JLabel id='speciesTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='speciesTotalWeightField'
- constructorParams='this'/>
- </cell>
- <cell anchor='west'>
- <JLabel id='speciesTotalSortedWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='speciesTotalSortedWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total capture -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='catchTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='catchTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell columns="2">
+ </cell>
+ </row>
+ <!-- Poids total trié balance tremis / caroussel-->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='catchTotalSortedTremisWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='catchTotalSortedTremisWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='catchTotalSortedCarousselWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='catchTotalSortedCarousselWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids échantillonné vrac / Poids total hors vrac -->
- <row>
- <cell>
- <JLabel id='speciesSampleSortedWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='speciesSampleSortedWeightField'
- constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='speciesTotalUnsortedWeightLabel'/>
- </cell>
- <cell>
- <JTextField id='speciesTotalUnsortedWeightField'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell weightx="0.5">
- <Table id='benthosTable' fill='both'>
+ <!-- Poids total rejeté / Poids total hors vrac -->
+ <row>
+ <cell>
+ <JLabel id='catchTotalRejectedWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='catchTotalRejectedWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='catchTotalUnsortedWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='catchTotalUnsortedWeightField'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table id='speciesTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='benthosTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='benthosTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total capture / Poids total vrac -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='speciesTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='speciesTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell anchor='west'>
+ <JLabel id='speciesTotalSortedWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='speciesTotalSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='benthosSampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='benthosSampleTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- <cell weightx="0.5">
- <Table id='planktonTable' fill='both'>
+ <!-- Poids total échantillonné vrac / Poids total hors vrac -->
+ <row>
+ <cell>
+ <JLabel id='speciesTotalSampleSortedWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='speciesTotalSampleSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='speciesTotalUnsortedWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='speciesTotalUnsortedWeightField'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table id='benthosTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='planktonTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='planktonTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total capture / Poids total vrac -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='benthosTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='benthosTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell anchor='west'>
+ <JLabel id='benthosTotalSortedWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='benthosTotalSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='planktonSampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='planktonSampleTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell columns="2">
- <Table id='macroWasteTable' fill='both'>
+ <!-- Poids total échantillonné vrac / Poids total hors vrac -->
+ <row>
+ <cell>
+ <JLabel id='benthosTotalSampleSortedWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='benthosTotalSampleSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='benthosTotalUnsortedWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='benthosTotalUnsortedWeightField'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell>
+ <Table id='otherTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='macroWasteTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='macroWasteTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <!-- Actions d'import -->
- <row>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton id='importPupitriButton'
- onActionPerformed='handler.importPupitri()'/>
- </JPanel>
- </cell>
- </row>
- </Table>
- </JPanel>
+ <!-- Plankton observed -->
+ <row>
+ <cell columns='2'>
+ <JCheckBox id='planktonObservedCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "planktonObserved")'/>
+ </cell>
+ </row>
+ <!-- Accidental observed -->
+ <row>
+ <cell columns='2'>
+ <JCheckBox id='accidentalObservedCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "accidentalObserved")'/>
+ </cell>
+ </row>
+
+ <!-- Poids total Macro dechet -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='macroWasteTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='macroWasteTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+
+
+ </Table>
+ </cell>
+ </row>
+
+ <!-- Actions d'import -->
+ <row>
+ <cell>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='importPupitriButton'
+ onActionPerformed='handler.importPupitri()'/>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
+ </JScrollPane>
</JXTitledPanel>
</tab>
<tab id='speciesTab' title='tutti.label.tab.species'>
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 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -71,11 +71,11 @@
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
+ EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT,
+ EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT,
EditCatchesUIModel.PROPERTY_MACRO_WASTE_TOTAL_WEIGHT);
}
@@ -149,7 +149,7 @@
fishingOperationMonitor.clearModified();
- ui.getCatchesTabsFishingOperationReminderLabel().setTitle(fishingOperationText);
+ ui.getCatchesCaracteristicsTabPane().setTitle(fishingOperationText);
ui.getSpeciesTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getBenthosTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getPlanktonTabFishingOperationReminderLabel().setTitle(fishingOperationText);
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 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -37,24 +37,42 @@
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_CATCH_TOTAL_WEIGHT = "catchTotalWeight";
+
+ 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_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_SAMPLE_SORTED_WEIGHT = "speciesSampleSortedWeight";
+ 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_BENTHOS_TOTAL_WEIGHT = "benthosTotalWeight";
- public static final String PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT = "benthosSampleTotalWeight";
+ public static final String PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT = "benthosTotalSortedWeight";
+ public static final String PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT = "benthosTotalUnsortedWeight";
+
+ public static final String PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT = "benthosTotalSampleSortedWeight";
+
+ public static final String PROPERTY_PLANKTON_OBSERVED = "planktonObserved";
+
public static final String PROPERTY_PLANKTON_TOTAL_WEIGHT = "planktonTotalWeight";
- public static final String PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT = "planktonSampleTotalWeight";
+ public static final String PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT = "planktonTotalSampleWeight";
public static final String PROPERTY_MACRO_WASTE_TOTAL_WEIGHT = "macroWasteTotalWeight";
+ public static final String PROPERTY_ACCIDENTAL_OBSERVED = "accidentalObserved";
+
public static final String PROPERTY_FISHING_OPERATION = "fishingOperation";
protected static final Binder<FishingOperation, EditCatchesUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EditCatchesUIModel.class)
@@ -62,11 +80,15 @@
PROPERTY_SPECIES_TOTAL_WEIGHT,
PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
- PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT,
PROPERTY_BENTHOS_TOTAL_WEIGHT,
- PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT,
+ PROPERTY_PLANKTON_OBSERVED,
+ PROPERTY_ACCIDENTAL_OBSERVED,
PROPERTY_PLANKTON_TOTAL_WEIGHT,
- PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT,
+ PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT,
PROPERTY_MACRO_WASTE_TOTAL_WEIGHT
).toBinder();
@@ -75,11 +97,15 @@
PROPERTY_SPECIES_TOTAL_WEIGHT,
PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
- PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT,
PROPERTY_BENTHOS_TOTAL_WEIGHT,
- PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT,
+ PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT,
+ PROPERTY_PLANKTON_OBSERVED,
+ PROPERTY_ACCIDENTAL_OBSERVED,
PROPERTY_PLANKTON_TOTAL_WEIGHT,
- PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT,
+ PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT,
PROPERTY_MACRO_WASTE_TOTAL_WEIGHT
).toBinder();
@@ -87,20 +113,38 @@
protected Float speciesTotalSortedWeight;
- protected Float speciesSampleSortedWeight;
+ protected Float speciesTotalSampleSortedWeight;
protected Float speciesTotalUnsortedWeight;
protected Float benthosTotalWeight;
- protected Float benthosSampleTotalWeight;
+ protected Float benthosTotalSortedWeight;
+ protected Float benthosTotalUnsortedWeight;
+
+ protected Float benthosTotalSampleSortedWeight;
+
+ protected boolean planktonObserved;
+
protected Float planktonTotalWeight;
- protected Float planktonSampleTotalWeight;
+ protected Float planktonTotalSampleWeight;
protected Float macroWasteTotalWeight;
+ protected Float catchTotalWeight;
+
+ protected Float catchTotalSortedTremisWeight;
+
+ protected Float catchTotalSortedCarousselWeight;
+
+ protected Float catchTotalRejectedWeight;
+
+ protected Float catchTotalUnsortedWeight;
+
+ protected boolean accidentalObserved;
+
protected FishingOperation fishingOperation;
public EditCatchesUIModel() {
@@ -117,6 +161,56 @@
firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, fishingOperation);
}
+ public Float getCatchTotalWeight() {
+ return catchTotalWeight;
+ }
+
+ public void setCatchTotalWeight(Float catchTotalWeight) {
+ Object oldValue = getCatchTotalWeight();
+ this.catchTotalWeight = catchTotalWeight;
+ firePropertyChange(PROPERTY_CATCH_TOTAL_WEIGHT, oldValue, catchTotalWeight);
+ }
+
+ public Float getCatchTotalSortedTremisWeight() {
+ return catchTotalSortedTremisWeight;
+ }
+
+ public void setCatchTotalSortedTremisWeight(Float catchTotalSortedTremisWeight) {
+ Object oldValue = getCatchTotalSortedTremisWeight();
+ this.catchTotalSortedTremisWeight = catchTotalSortedTremisWeight;
+ firePropertyChange(PROPERTY_CATCH_TOTAL_SORTED_TREMIS_WEIGHT, oldValue, catchTotalSortedTremisWeight);
+ }
+
+ public Float getCatchTotalSortedCarousselWeight() {
+ return catchTotalSortedCarousselWeight;
+ }
+
+ public void setCatchTotalSortedCarousselWeight(Float catchTotalSortedCarousselWeight) {
+ Object oldValue = getCatchTotalSortedCarousselWeight();
+ this.catchTotalSortedCarousselWeight = catchTotalSortedCarousselWeight;
+ firePropertyChange(PROPERTY_CATCH_TOTAL_SORTED_CAROUSSEL_WEIGHT, oldValue, catchTotalSortedCarousselWeight);
+ }
+
+ public Float getCatchTotalRejectedWeight() {
+ return catchTotalRejectedWeight;
+ }
+
+ public void setCatchTotalRejectedWeight(Float catchTotalRejectedWeight) {
+ Object oldValue = getCatchTotalRejectedWeight();
+ this.catchTotalRejectedWeight = catchTotalRejectedWeight;
+ firePropertyChange(PROPERTY_CATCH_TOTAL_REJECTED_WEIGHT, oldValue, catchTotalRejectedWeight);
+ }
+
+ public Float getCatchTotalUnsortedWeight() {
+ return catchTotalUnsortedWeight;
+ }
+
+ public void setCatchTotalUnsortedWeight(Float catchTotalUnsortedWeight) {
+ Object oldValue = getCatchTotalUnsortedWeight();
+ this.catchTotalUnsortedWeight = catchTotalUnsortedWeight;
+ firePropertyChange(PROPERTY_CATCH_TOTAL_UNSORTED_WEIGHT, oldValue, catchTotalUnsortedWeight);
+ }
+
public Float getSpeciesTotalWeight() {
return speciesTotalWeight;
}
@@ -137,14 +231,14 @@
firePropertyChange(PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT, oldValue, speciesTotalSortedWeight);
}
- public Float getSpeciesSampleSortedWeight() {
- return speciesSampleSortedWeight;
+ public Float getSpeciesTotalSampleSortedWeight() {
+ return speciesTotalSampleSortedWeight;
}
- public void setSpeciesSampleSortedWeight(Float speciesSampleSortedWeight) {
- Object oldValue = getSpeciesSampleSortedWeight();
- this.speciesSampleSortedWeight = speciesSampleSortedWeight;
- firePropertyChange(PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT, oldValue, speciesSampleSortedWeight);
+ public void setSpeciesTotalSampleSortedWeight(Float speciesTotalSampleSortedWeight) {
+ Object oldValue = getSpeciesTotalSampleSortedWeight();
+ this.speciesTotalSampleSortedWeight = speciesTotalSampleSortedWeight;
+ firePropertyChange(PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT, oldValue, speciesTotalSampleSortedWeight);
}
public Float getSpeciesTotalUnsortedWeight() {
@@ -167,16 +261,56 @@
firePropertyChange(PROPERTY_BENTHOS_TOTAL_WEIGHT, oldValue, benthosTotalWeight);
}
- public Float getBenthosSampleTotalWeight() {
- return benthosSampleTotalWeight;
+ public Float getBenthosTotalSampleSortedWeight() {
+ return benthosTotalSampleSortedWeight;
}
- public void setBenthosSampleTotalWeight(Float benthosSampleTotalWeight) {
- Object oldValue = getBenthosSampleTotalWeight();
- this.benthosSampleTotalWeight = benthosSampleTotalWeight;
- firePropertyChange(PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT, oldValue, benthosSampleTotalWeight);
+ public void setBenthosTotalSampleSortedWeight(Float benthosTotalSampleSortedWeight) {
+ Object oldValue = getBenthosTotalSampleSortedWeight();
+ this.benthosTotalSampleSortedWeight = benthosTotalSampleSortedWeight;
+ firePropertyChange(PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_WEIGHT, oldValue, benthosTotalSampleSortedWeight);
}
+ public Float getBenthosTotalSortedWeight() {
+ return benthosTotalSortedWeight;
+ }
+
+ public void setBenthosTotalSortedWeight(Float benthosTotalSortedWeight) {
+ Object oldValue = getBenthosTotalSortedWeight();
+ this.benthosTotalSortedWeight = benthosTotalSortedWeight;
+ firePropertyChange(PROPERTY_BENTHOS_TOTAL_SORTED_WEIGHT, oldValue, benthosTotalSortedWeight);
+ }
+
+ public Float getBenthosTotalUnsortedWeight() {
+ return benthosTotalUnsortedWeight;
+ }
+
+ public void setBenthosTotalUnsortedWeight(Float benthosTotalUnsortedWeight) {
+ Object oldValue = getBenthosTotalUnsortedWeight();
+ this.benthosTotalUnsortedWeight = benthosTotalUnsortedWeight;
+ firePropertyChange(PROPERTY_BENTHOS_TOTAL_UNSORTED_WEIGHT, oldValue, benthosTotalUnsortedWeight);
+ }
+
+ public boolean isPlanktonObserved() {
+ return planktonObserved;
+ }
+
+ public void setPlanktonObserved(boolean planktonObserved) {
+ Object oldValue = isPlanktonObserved();
+ this.planktonObserved = planktonObserved;
+ firePropertyChange(PROPERTY_PLANKTON_OBSERVED, oldValue, planktonObserved);
+ }
+
+ public boolean isAccidentalObserved() {
+ return accidentalObserved;
+ }
+
+ public void setAccidentalObserved(boolean accidentalObserved) {
+ Object oldValue = isAccidentalObserved();
+ this.accidentalObserved = accidentalObserved;
+ firePropertyChange(PROPERTY_ACCIDENTAL_OBSERVED, oldValue, accidentalObserved);
+ }
+
public Float getPlanktonTotalWeight() {
return planktonTotalWeight;
}
@@ -187,14 +321,14 @@
firePropertyChange(PROPERTY_PLANKTON_TOTAL_WEIGHT, oldValue, planktonTotalWeight);
}
- public Float getPlanktonSampleTotalWeight() {
- return planktonSampleTotalWeight;
+ public Float getPlanktonTotalSampleWeight() {
+ return planktonTotalSampleWeight;
}
- public void setPlanktonSampleTotalWeight(Float planktonSampleTotalWeight) {
- Object oldValue = getPlanktonSampleTotalWeight();
- this.planktonSampleTotalWeight = planktonSampleTotalWeight;
- firePropertyChange(PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT, oldValue, planktonSampleTotalWeight);
+ public void setPlanktonTotalSampleWeight(Float planktonTotalSampleWeight) {
+ Object oldValue = getPlanktonTotalSampleWeight();
+ this.planktonTotalSampleWeight = planktonTotalSampleWeight;
+ firePropertyChange(PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT, oldValue, planktonTotalSampleWeight);
}
public Float getMacroWasteTotalWeight() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.css 2012-12-21 20:27:17 UTC (rev 104)
@@ -41,14 +41,14 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#planktonSampleTotalWeightLabel {
- text: "tutti.label.catches.planktonSampleTotalWeight";
- labelFor: {planktonSampleTotalWeightField};
+#planktonTotalSampleWeightLabel {
+ text: "tutti.label.catches.planktonTotalSampleWeight";
+ labelFor: {planktonTotalSampleWeightField};
}
-#planktonSampleTotalWeightField {
- property: "planktonSampleTotalWeight";
- model: {model.getPlanktonSampleTotalWeight()};
+#planktonTotalSampleWeightField {
+ property: "planktonTotalSampleWeight";
+ model: {model.getPlanktonTotalSampleWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUI.jaxx 2012-12-21 20:27:17 UTC (rev 104)
@@ -67,8 +67,8 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='planktonTotalWeight' component='planktonTotalWeightField'/>
- <field name='planktonSampleTotalWeight'
- component='planktonSampleTotalWeightField'/>
+ <field name='planktonTotalSampleWeight'
+ component='planktonTotalSampleWeightField'/>
</BeanValidator>
<LongTextEditorUI id='longTextEditor'/>
@@ -90,10 +90,10 @@
<!-- Poids total échantillonné -->
<row>
<cell>
- <JLabel id='planktonSampleTotalWeightLabel'/>
+ <JLabel id='planktonTotalSampleWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='planktonSampleTotalWeightField'
+ <NumberEditor id='planktonTotalSampleWeightField'
constructorParams='this'/>
</cell>
</row>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/plankton/PlanktonBatchUIModel.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -38,7 +38,7 @@
public PlanktonBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_PLANKTON_SAMPLE_TOTAL_WEIGHT);
+ EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_SAMPLE_WEIGHT);
}
public Float getPlanktonTotalWeight() {
@@ -49,11 +49,11 @@
catchesUIModel.setPlanktonTotalWeight(planktonTotalWeight);
}
- public Float getPlanktonSampleTotalWeight() {
- return catchesUIModel.getPlanktonSampleTotalWeight();
+ public Float getPlanktonTotalSampleWeight() {
+ return catchesUIModel.getPlanktonTotalSampleWeight();
}
- public void setPlanktonSampleTotalWeight(Float planktonSampleTotalWeight) {
- catchesUIModel.setPlanktonSampleTotalWeight(planktonSampleTotalWeight);
+ public void setPlanktonTotalSampleWeight(Float planktonTotalSampleWeight) {
+ catchesUIModel.setPlanktonTotalSampleWeight(planktonTotalSampleWeight);
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-21 20:27:17 UTC (rev 104)
@@ -53,14 +53,14 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesSampleSortedWeightLabel {
- text: "tutti.label.catches.speciesSampleSortedWeight";
- labelFor: {speciesSampleSortedWeightField};
+#speciesTotalSampleSortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalSampleSortedWeight";
+ labelFor: {speciesTotalSampleSortedWeightField};
}
-#speciesSampleSortedWeightField {
- property: "speciesSampleSortedWeight";
- model: {model.getSpeciesSampleSortedWeight()};
+#speciesTotalSampleSortedWeightField {
+ property: "speciesTotalSampleSortedWeight";
+ model: {model.getSpeciesTotalSampleSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-21 20:27:17 UTC (rev 104)
@@ -71,8 +71,8 @@
<field name='speciesTotalWeight' component='speciesTotalWeightField'/>
<field name='speciesTotalSortedWeight'
component='speciesTotalSortedWeightField'/>
- <field name='speciesSampleSortedWeight'
- component='speciesSampleSortedWeightField'/>
+ <field name='speciesTotalSampleSortedWeight'
+ component='speciesTotalSampleSortedWeightField'/>
<field name='speciesTotalUnsortedWeight'
component='speciesTotalUnsortedWeightField'/>
</BeanValidator>
@@ -105,10 +105,10 @@
<!-- Poids échantillonné vrac / Poids total hors vrac -->
<row>
<cell>
- <JLabel id='speciesSampleSortedWeightLabel'/>
+ <JLabel id='speciesTotalSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='speciesSampleSortedWeightField'
+ <NumberEditor id='speciesTotalSampleSortedWeightField'
constructorParams='this'/>
</cell>
<cell>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-21 20:27:17 UTC (rev 104)
@@ -56,7 +56,7 @@
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT);
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SAMPLE_SORTED_WEIGHT);
this.samplingTreeModel = new SpeciesBatchTreeModel();
}
@@ -76,12 +76,12 @@
catchesUIModel.setSpeciesTotalSortedWeight(speciesTotalSortedWeight);
}
- public Float getSpeciesSampleSortedWeight() {
- return catchesUIModel.getSpeciesSampleSortedWeight();
+ public Float getSpeciesTotalSampleSortedWeight() {
+ return catchesUIModel.getSpeciesTotalSampleSortedWeight();
}
- public void setSpeciesSampleSortedWeight(Float speciesSampleSortedWeight) {
- catchesUIModel.setSpeciesSampleSortedWeight(speciesSampleSortedWeight);
+ public void setSpeciesTotalSampleSortedWeight(Float speciesSampleSortedWeight) {
+ catchesUIModel.setSpeciesTotalSampleSortedWeight(speciesSampleSortedWeight);
}
public Float getSpeciesTotalUnsortedWeight() {
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 2012-12-21 17:33:19 UTC (rev 103)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-21 20:27:17 UTC (rev 104)
@@ -45,12 +45,21 @@
tutti.label.attachmentEditor.file=Fichier
tutti.label.attachmentEditor.fileComment=Commentaire
tutti.label.attachmentEditor.fileName=Nom
-tutti.label.catches.benthosSampleTotalWeight=Poids total échantillonné
+tutti.label.catches.accidentalObserved=Captures accidentelles observées ?
+tutti.label.catches.benthosTotalSampleSortedWeight=Poids total vrac échantillonné
+tutti.label.catches.benthosTotalSortedWeight=Poids total vrac
+tutti.label.catches.benthosTotalUnsortedWeight=Poids total hors vrac
tutti.label.catches.benthosTotalWeight=Poids total
-tutti.label.catches.macroWasteTotalWeight=Poids total
-tutti.label.catches.planktonSampleTotalWeight=Poids total échantillonné
+tutti.label.catches.catchTotalRejectedWeight=Poids total rejeté
+tutti.label.catches.catchTotalSortedCarousselWeight=Poids total vrac (Caroussel)
+tutti.label.catches.catchTotalSortedTremisWeight=Poids total vrac (Tremis)
+tutti.label.catches.catchTotalUnsortedWeight=Poids total hors vrac
+tutti.label.catches.catchTotalWeight=Poids total
+tutti.label.catches.macroWasteTotalWeight=Poids total Macro déchets
+tutti.label.catches.planktonObserved=Plancton observé ?
+tutti.label.catches.planktonTotalSampleWeight=Poids total échantillonné
tutti.label.catches.planktonTotalWeight=Poids total
-tutti.label.catches.speciesSampleSortedWeight=Poids total vrac échantillon
+tutti.label.catches.speciesTotalSampleSortedWeight=Poids total vrac échantillon
tutti.label.catches.speciesTotalSortedWeight=Poids total vrac
tutti.label.catches.speciesTotalUnsortedWeight=Poids total hors vrac
tutti.label.catches.speciesTotalWeight=Poids total
@@ -138,12 +147,12 @@
tutti.label.tab.plancton=Plancton
tutti.label.tab.species=Espèces
tutti.label.traitReminder=Trait \: %s
-tutti.legend.accidentalCatches=Captures accidentelles
-tutti.legend.benthosCatches=Captures benthos
+tutti.legend.catch.benthos=Benthos
+tutti.legend.catch.other=Autres
+tutti.legend.catch.species=Espèces
+tutti.legend.catch.total=Capture
tutti.legend.frequencyConfiguration=Configuration
-tutti.legend.macroWasteCatches=Captures macro déchets
-tutti.legend.planktonCatches=Captures plancton
-tutti.legend.speciesCatches=Captures espèces
+tutti.legend.macroWasteCatches=Macro déchets
tutti.menu.actions=Actions
tutti.menu.actions.tip=Actions
tutti.menu.file=Fichier
1
0
r103 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation content/operation/fishing/environment content/operation/fishing/gearshooting content/operation/fishing/hydrology util/table
by kmorin@users.forge.codelutin.com 21 Dec '12
by kmorin@users.forge.codelutin.com 21 Dec '12
21 Dec '12
Author: kmorin
Date: 2012-12-21 18:33:19 +0100 (Fri, 21 Dec 2012)
New Revision: 103
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/103
Log:
refs #1812
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -25,11 +25,9 @@
*/
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
-import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -42,6 +40,8 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListSelectionEvent;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -53,7 +53,9 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
-import java.util.Map;
+import javax.swing.event.ListDataListener;
+import javax.swing.event.ListSelectionListener;
+import jaxx.runtime.swing.editor.bean.BeanDoubleListModel;
/**
@@ -105,7 +107,10 @@
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_VALID,
EditFishingOperationUIModel.PROPERTY_LOCATION,
EditFishingOperationUIModel.PROPERTY_COMMENT,
- EditFishingOperationUIModel.PROPERTY_SAISISSEUR);
+ EditFishingOperationUIModel.PROPERTY_SAISISSEUR,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_CARACTERISTICS,
+ EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_CARACTERISTICS,
+ EditFishingOperationUIModel.PROPERTY_HYDROLOGY_CARACTERISTICS);
}
@Override
@@ -168,7 +173,25 @@
initBeanList(ui.getSaisisseurList(),
persistenceService.getAllPerson(),
model.getSaisisseur());
+ final BeanDoubleListModel<Person> saisisseurModel = ui.getSaisisseurList().getModel();
+ saisisseurModel.getSelectedModel().addListDataListener(new ListDataListener() {
+ public void intervalAdded(ListDataEvent e) {
+ log.info(">>>>>>>>>> intervalAdded " + saisisseurModel.getSelected());
+ ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+ }
+
+ public void intervalRemoved(ListDataEvent e) {
+ log.info(">>>>>>>>>> intervalRemoved " + saisisseurModel.getSelected());
+ ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+ }
+
+ public void contentsChanged(ListDataEvent e) {
+ log.info(">>>>>>>>>> contentsChanged " + saisisseurModel.getSelected());
+ ui.getModel().setSaisisseur(saisisseurModel.getSelected());
+ }
+ });
+
String programId = context.getProgramId();
Program program = persistenceService.getProgram(programId);
@@ -225,12 +248,11 @@
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
- model.setModify(true);
model.setGearShootingCaracteristics((CaracteristicMap) evt.getNewValue());
}
}
);
- CaracteristicMap gearShootingCaracteristics = getDefaultGearShootingCaracteristics();
+ CaracteristicMap gearShootingCaracteristics = model.getGearShootingCaracteristics();
ui.getModel().setGearShootingCaracteristics(gearShootingCaracteristics);
gearShootingModel.setGearShootingCaracteristics(gearShootingCaracteristics);
@@ -243,12 +265,11 @@
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
- model.setModify(true);
model.setEnvironmentCaracteristics((CaracteristicMap) evt.getNewValue());
}
}
);
- CaracteristicMap environmentCaracteristics = ui.getModel().getEnvironmentCaracteristics();
+ CaracteristicMap environmentCaracteristics = model.getEnvironmentCaracteristics();
ui.getModel().setEnvironmentCaracteristics(environmentCaracteristics);
environmentModel.setEnvironmentCaracteristics(environmentCaracteristics);
@@ -265,89 +286,11 @@
}
}
);
- CaracteristicMap hydrologyCaracteristics = getDefaultHydrologyCaracteristics();
+ CaracteristicMap hydrologyCaracteristics = model.getHydrologyCaracteristics();
ui.getModel().setHydrologyCaracteristics(hydrologyCaracteristics);
hydrologyModel.setHydrologyCaracteristics(hydrologyCaracteristics);
}
- protected CaracteristicMap getDefaultGearShootingCaracteristics() {
- CaracteristicMap gearShootingCaracteristics = new CaracteristicMap();
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_START_DEPTH)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_END_DEPTH)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_HORIZONTAL_APERTURE)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_VERTICAL_APERTURE)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_WARP_LENGTH)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_ARM_LENGTH)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_SYSTEME_FERMETURE_CUL)),
-// null
-// );
-// gearShootingParams.put(
-// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_MEASURED_GEOMETRY)),
-// null
-// );
-
- return gearShootingCaracteristics;
- }
-
- protected CaracteristicMap getDefaultEnvironmentCaracteristics() {
- CaracteristicMap environmentCaracteristics = new CaracteristicMap();
- List<Caracteristic> availableCaracteristics = ui.getEnvironmentTabContent().getModel().getAvailableCaracteristics();
-// environmentCaracteristics.put(availableCaracteristics.get(0), );
-// environmentCaracteristics.put(
-// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_BEAUFORT_SCALE)),
-// null
-// );
-// environmentCaracteristics.put(
-// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_WIND_DIRECTION)),
-// null
-// );
-// environmentCaracteristics.put(
-// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_SEA_STATE)),
-// null
-// );
- return environmentCaracteristics;
- }
-
- protected CaracteristicMap getDefaultHydrologyCaracteristics() {
- CaracteristicMap hydrologyCaracteristics = new CaracteristicMap();
-// hydrologyCaracteristics.put(
-// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.SURFACE)),
-// null
-// );
-// hydrologyCaracteristics.put(
-// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.BOTTOM)),
-// null
-// );
-// hydrologyCaracteristics.put(
-// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.SURFACE)),
-// null
-// );
-// hydrologyCaracteristics.put(
-// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.BOTTOM)),
-// null
-// );
- return hydrologyCaracteristics;
- }
-
@Override
public void onCloseUI() {
}
@@ -358,7 +301,7 @@
}
public void selectFishingOperation(FishingOperation bean) {
-
+
if (fishingOperationMonitor.wasModified()) {
// previous fishingOperation was modified, let's save it
@@ -380,7 +323,8 @@
" was modified, will save it.");
}
- persistenceService.saveFishingOperation(toSave);
+ // persist current fishingOperation
+ parentUi.getHandler().saveFishingOperation(toSave, false);
}
}
@@ -427,17 +371,17 @@
//reset gear shooting
GearShootingTabUI gearShootingTab = ui.getGearShootingTabContent();
- gearShootingTab.getModel().setGearShootingCaracteristics(getDefaultGearShootingCaracteristics());
+ gearShootingTab.getModel().setGearShootingCaracteristics(model.getGearShootingCaracteristics());
gearShootingTab.getHandler().reset();
//reset environment
EnvironmentTabUI environmentTab = ui.getEnvironmentTabContent();
- environmentTab.getModel().setEnvironmentCaracteristics(getDefaultEnvironmentCaracteristics());
+ environmentTab.getModel().setEnvironmentCaracteristics(model.getEnvironmentCaracteristics());
environmentTab.getHandler().reset();
//reset hydrology
HydrologyTabUI hydrologyTab = ui.getHydrologyTabContent();
- hydrologyTab.getModel().setHydrologyCaracteristics(getDefaultHydrologyCaracteristics());
+ hydrologyTab.getModel().setHydrologyCaracteristics(model.getHydrologyCaracteristics());
hydrologyTab.getHandler().reset();
fishingOperationMonitor.clearModified();
@@ -488,14 +432,6 @@
ui.getFishingOperationTabPane().setSelectedIndex(selectedIndex);
// getModel().setModify(false);
-
- for (Object key : ui.getModel().getEnvironmentCaracteristics().keySet()) {
- log.info(key + " : " + ui.getModel().getEnvironmentCaracteristics().get(key));
- }
-
- for (Object key : ui.getModel().getHydrologyCaracteristics().keySet()) {
- log.info(key + " : " + ui.getModel().getHydrologyCaracteristics().get(key));
- }
}
public void importCasino() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -55,15 +55,20 @@
protected Caracteristic key;
- protected String value;
+ protected Object value;
public EnvironmentRowModel() {
super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
public EnvironmentRowModel(Caracteristic key) {
+ this(key, null);
+ }
+
+ public EnvironmentRowModel(Caracteristic key, Object value) {
this();
this.key = key;
+ this.value = value;
}
public Caracteristic getKey() {
@@ -76,11 +81,11 @@
firePropertyChange(PROPERTY_KEY, oldValue, key);
}
- public String getValue() {
+ public Object getValue() {
return value;
}
- public void setValue(String value) {
+ public void setValue(Object value) {
Object oldValue = getValue();
this.value = value;
firePropertyChange(PROPERTY_VALUE, oldValue, value);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -35,14 +35,12 @@
import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableColumnModel;
-import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
@@ -195,15 +193,18 @@
*/
public void reset() {
CaracteristicMap environmentCaracteristics = ui.getModel().getEnvironmentCaracteristics();
+ if (environmentCaracteristics == null) {
+ environmentCaracteristics = new CaracteristicMap();
+ }
List<EnvironmentRowModel> rows = Lists.newArrayList();
Collection<Caracteristic> caracteristics = environmentCaracteristics.keySet();
for (Caracteristic key : environmentCaracteristics.keySet()) {
- rows.add(new EnvironmentRowModel(key));
+ rows.add(new EnvironmentRowModel(key, environmentCaracteristics.get(key)));
}
AbstractTuttiTableModel<EnvironmentRowModel> tableModel = getTableModel();
- tableModel.setRows(rows);
+ tableModel.setRows(rows, false);
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -44,7 +44,7 @@
*/
public class EnvironmentTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, EnvironmentRowModel, EnvironmentTabUIModel> {
- protected CaracteristicMap environmentCaracteristics;
+ protected CaracteristicMap environmentCaracteristics = new CaracteristicMap();
protected List<Caracteristic> availableCaracteristics;
@@ -63,6 +63,9 @@
}
public void setEnvironmentCaracteristics(CaracteristicMap environmentCaracteristics) {
+ if (environmentCaracteristics == null) {
+ environmentCaracteristics = new CaracteristicMap();
+ }
this.environmentCaracteristics = environmentCaracteristics;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTableModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -24,10 +24,14 @@
* #L%
*/
+import org.apache.commons.logging.Log;
+import com.google.common.base.Preconditions;
+import java.util.List;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
import javax.swing.table.TableColumnModel;
+import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n.n_;
/**
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -54,15 +54,20 @@
protected Caracteristic key;
- protected String value;
+ protected Object value;
public GearShootingRowModel() {
super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
public GearShootingRowModel(Caracteristic key) {
+ this(key, null);
+ }
+
+ public GearShootingRowModel(Caracteristic key, Object value) {
this();
this.key = key;
+ this.value = value;
}
public Caracteristic getKey() {
@@ -75,11 +80,11 @@
firePropertyChange(PROPERTY_KEY, oldValue, key);
}
- public String getValue() {
+ public Object getValue() {
return value;
}
- public void setValue(String value) {
+ public void setValue(Object value) {
Object oldValue = getValue();
this.value = value;
firePropertyChange(PROPERTY_VALUE, oldValue, value);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -79,7 +79,7 @@
{
- addColumnToModel(columnModel, GearShootingTableModel.KEY);
+ addColumnToModel(columnModel, null, newTableCellRender(Caracteristic.class), GearShootingTableModel.KEY);
}
{
@@ -179,12 +179,13 @@
*/
public void addRow() {
JComboBox keyCombo = ui.getNewRowKey();
- Caracteristic key = (Caracteristic) keyCombo.getSelectedItem();
- GearShootingRowModel row = new GearShootingRowModel(key);
+ CaracteristicRow selectedItem = (CaracteristicRow) keyCombo.getSelectedItem();
+ Caracteristic caracteristic = selectedItem.getCaracteristics()[0];
+ GearShootingRowModel row = new GearShootingRowModel(caracteristic);
getTableModel().addNewRow(getTable().getRowCount(), row);
- ui.getModel().setCaracteristic(key, null);
+ ui.getModel().setCaracteristic(caracteristic, null);
- keyCombo.removeItem(key);
+ keyCombo.removeItem(selectedItem);
}
/**
@@ -192,15 +193,18 @@
*/
public void reset() {
CaracteristicMap gearShootingCaracteristics = ui.getModel().getGearShootingCaracteristics();
+ if (gearShootingCaracteristics == null) {
+ gearShootingCaracteristics = new CaracteristicMap();
+ }
List<GearShootingRowModel> rows = Lists.newArrayList();
Collection<Caracteristic> caracteristics = gearShootingCaracteristics.keySet();
for (Caracteristic key : gearShootingCaracteristics.keySet()) {
- rows.add(new GearShootingRowModel(key));
+ rows.add(new GearShootingRowModel(key, gearShootingCaracteristics.get(key)));
}
AbstractTuttiTableModel<GearShootingRowModel> tableModel = getTableModel();
- tableModel.setRows(rows);
+ tableModel.setRows(rows, false);
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -42,7 +42,7 @@
*/
public class GearShootingTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, GearShootingRowModel, GearShootingTabUIModel> {
- protected CaracteristicMap gearShootingCaracteristics;
+ protected CaracteristicMap gearShootingCaracteristics = new CaracteristicMap();
protected List<Caracteristic> availableCaracteristics;
@@ -60,8 +60,11 @@
return gearShootingCaracteristics;
}
- public void setGearShootingCaracteristics(CaracteristicMap gearShooting) {
- this.gearShootingCaracteristics = gearShooting;
+ public void setGearShootingCaracteristics(CaracteristicMap gearShootingCaracteristics) {
+ if (gearShootingCaracteristics == null) {
+ gearShootingCaracteristics = new CaracteristicMap();
+ }
+ this.gearShootingCaracteristics = gearShootingCaracteristics;
}
public void setCaracteristic(Caracteristic caracteristic, Object value) {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -56,19 +56,27 @@
protected Caracteristic key;
- protected String gearShootingStartValue;
+ protected Object gearShootingStartValue;
- protected String gearShootingEndValue;
+ protected Object gearShootingEndValue;
- protected String averageValue;
+ protected Object averageValue;
public HydrologyRowModel() {
super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
public HydrologyRowModel(Caracteristic key) {
+ this(key, null, null, null);
+ }
+
+ public HydrologyRowModel(Caracteristic key, Object gearShootingStartValue,
+ Object gearShootingEndValue, Object averageValue) {
this();
this.key = key;
+ this.gearShootingStartValue = gearShootingStartValue;
+ this.gearShootingEndValue = gearShootingEndValue;
+ this.averageValue = averageValue;
}
public Caracteristic getKey() {
@@ -81,31 +89,31 @@
firePropertyChange(PROPERTY_KEY, oldValue, key);
}
- public String getGearShootingStartValue() {
+ public Object getGearShootingStartValue() {
return gearShootingStartValue;
}
- public void setGearShootingStartValue(String gearShootingStartValue) {
+ public void setGearShootingStartValue(Object gearShootingStartValue) {
Object oldValue = getGearShootingStartValue();
this.gearShootingStartValue = gearShootingStartValue;
firePropertyChange(PROPERTY_GEAR_SHOOTING_START_VALUE, oldValue, gearShootingStartValue);
}
- public String getGearShootingEndValue() {
+ public Object getGearShootingEndValue() {
return gearShootingEndValue;
}
- public void setGearShootingEndValue(String gearShootingEndValue) {
+ public void setGearShootingEndValue(Object gearShootingEndValue) {
Object oldValue = getGearShootingEndValue();
this.gearShootingEndValue = gearShootingEndValue;
firePropertyChange(PROPERTY_GEAR_SHOOTING_END_VALUE, oldValue, gearShootingEndValue);
}
- public String getAverageValue() {
+ public Object getAverageValue() {
return averageValue;
}
- public void setAverageValue(String averageValue) {
+ public void setAverageValue(Object averageValue) {
Object oldValue = getAverageValue();
this.averageValue = averageValue;
firePropertyChange(PROPERTY_AVERAGE_VALUE, oldValue, averageValue);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -83,7 +83,7 @@
{
- addColumnToModel(columnModel, HydrologyTableModel.KEY);
+ addColumnToModel(columnModel, null, newTableCellRender(Caracteristic.class), HydrologyTableModel.KEY);
}
{
@@ -218,7 +218,7 @@
}
AbstractTuttiTableModel<HydrologyRowModel> tableModel = getTableModel();
- tableModel.setRows(rows);
+ tableModel.setRows(rows, false);
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -42,7 +42,7 @@
*/
public class HydrologyTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, HydrologyRowModel, HydrologyTabUIModel> {
- protected CaracteristicMap hydrologyCaracteristics;
+ protected CaracteristicMap hydrologyCaracteristics = new CaracteristicMap();
protected List<Caracteristic> availableCaracteristics;
@@ -61,6 +61,9 @@
}
public void setHydrologyCaracteristics(CaracteristicMap hydrologyCaracteristics) {
+ if (hydrologyCaracteristics == null) {
+ hydrologyCaracteristics = new CaracteristicMap();
+ }
this.hydrologyCaracteristics = hydrologyCaracteristics;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java 2012-12-21 17:30:56 UTC (rev 102)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/AbstractTuttiTableModel.java 2012-12-21 17:33:19 UTC (rev 103)
@@ -97,11 +97,15 @@
}
public final void setRows(List<R> data) {
+ setRows(data, true);
+ }
+
+ public final void setRows(List<R> data, boolean checkEmpty) {
// can't accept a empty data list
Preconditions.checkNotNull(data, "Data list can not be null.");
- if (data.isEmpty()) {
+ if (checkEmpty && data.isEmpty()) {
// add a first edit line
data.add(createNewRow());
1
0
21 Dec '12
Author: kmorin
Date: 2012-12-21 18:30:56 +0100 (Fri, 21 Dec 2012)
New Revision: 102
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/102
Log:
renommage d'attributs
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
21 Dec '12
Author: kmorin
Date: 2012-12-21 11:51:41 +0100 (Fri, 21 Dec 2012)
New Revision: 101
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/101
Log:
renommage d'attributs
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0
r100 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation: . catches
by tchemit@users.forge.codelutin.com 20 Dec '12
by tchemit@users.forge.codelutin.com 20 Dec '12
20 Dec '12
Author: tchemit
Date: 2012-12-20 18:28:55 +0100 (Thu, 20 Dec 2012)
New Revision: 100
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/100
Log:
sauvegarde automatique du trait
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2012-12-20 17:05:25 UTC (rev 99)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2012-12-20 17:28:55 UTC (rev 100)
@@ -249,7 +249,7 @@
}
#createFishingOperationActions {
- visible: {model.isEmpty()};
+ visible: {!model.isPersisted()};
}
#saveButton {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 17:28:55 UTC (rev 100)
@@ -380,7 +380,7 @@
" was modified, will save it.");
}
- parentUi.getHandler().saveFishingOperation(toSave);
+ persistenceService.saveFishingOperation(toSave);
}
}
@@ -425,9 +425,6 @@
// update model empty property
model.setEmpty(empty);
- // if new fishingOperation can already cancel his creation
- model.setModify(!empty && model.isCreate());
-
//reset gear shooting
GearShootingTabUI gearShootingTab = ui.getGearShootingTabContent();
gearShootingTab.getModel().setGearShootingCaracteristics(getDefaultGearShootingCaracteristics());
@@ -481,6 +478,9 @@
// keep selected tab (to resotre it after save)
int selectedIndex = ui.getFishingOperationTabPane().getSelectedIndex();
+ // clean auto-save monitor to avoid re-entrant code
+ fishingOperationMonitor.clearModified();
+
// persist current fishingOperation
parentUi.getHandler().saveFishingOperation(toSave);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 17:05:25 UTC (rev 99)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 17:28:55 UTC (rev 100)
@@ -25,19 +25,18 @@
*/
import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ird.type.SexagecimalPosition;
-import java.util.Collection;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.util.Date;
import java.util.List;
-import java.util.Map;
/**
* Model for UI {@link EditFishingOperationUI}.
@@ -49,6 +48,8 @@
private static final long serialVersionUID = 1L;
+ public static final String PROPERTY_PERSISTED = "persisted";
+
public static final String PROPERTY_EMPTY = "empty";
public static final String PROPERTY_STATION_NUMBER = "stationNumber";
@@ -93,6 +94,11 @@
public static final String PROPERTY_HYDROLOGY_CARACTERISTICS = "hydrologyCaracteristics";
+ /**
+ * Flag when there is no fishing operation selected.
+ *
+ * @since 0.2
+ */
protected boolean empty;
protected Cruise cruise;
@@ -152,7 +158,7 @@
protected CaracteristicMap environmentCaracteristics;
protected CaracteristicMap hydrologyCaracteristics;
-
+
protected FishingOperation fishingOperation;
protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
@@ -172,8 +178,13 @@
public void setFishingOperation(FishingOperation fishingOperation) {
this.fishingOperation = fishingOperation;
+ firePropertyChange(PROPERTY_PERSISTED, null, isPersisted());
}
+ public boolean isPersisted() {
+ return fishingOperation != null && !TuttiEntities.isNew(fishingOperation);
+ }
+
public boolean isEmpty() {
return empty;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 17:28:55 UTC (rev 100)
@@ -36,8 +36,6 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.decorator.Decorator;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Date;
@@ -178,12 +176,6 @@
// back to general tab of fishingOperation tabs
ui.getFishingOperationTabContent().getFishingOperationTabPane().setSelectedIndex(0);
- ui.getTabPane().addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- }
- });
-
String fishingOperationText;
if (fishingOperation == null) {
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 2012-12-20 17:05:25 UTC (rev 99)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2012-12-20 17:28:55 UTC (rev 100)
@@ -90,136 +90,132 @@
<tab id='catchesCaracteristicsTab'
title='tutti.label.tab.catchesCaracteristics'>
<JXTitledPanel id='catchesTabsFishingOperationReminderLabel'>
- <Table id="catchesForm" fill='both' weightx='1'>
- <row>
- <cell>
- <Table id='speciesTable' fill='both'>
+ <JPanel layout='{new BorderLayout()}'>
+ <Table id="catchesForm" fill='both' weightx='1'
+ constraints='BorderLayout.NORTH'>
+ <row>
+ <cell columns="2">
+ <Table id='speciesTable' fill='both'>
- <!-- Poids total / Poids total vrac -->
- <row>
- <cell anchor='west'>
- <JLabel id='speciesTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='speciesTotalWeightField'
- constructorParams='this'/>
- </cell>
- <cell anchor='west'>
- <JLabel id='speciesTotalSortedWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='speciesTotalSortedWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total / Poids total vrac -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='speciesTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='speciesTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell anchor='west'>
+ <JLabel id='speciesTotalSortedWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='speciesTotalSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids échantillonné vrac / Poids total hors vrac -->
- <row>
- <cell>
- <JLabel id='speciesSampleSortedWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='speciesSampleSortedWeightField'
- constructorParams='this'/>
- </cell>
- <cell>
- <JLabel id='speciesTotalUnsortedWeightLabel'/>
- </cell>
- <cell>
- <JTextField id='speciesTotalUnsortedWeightField'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell>
- <Table id='benthosTable' fill='both'>
+ <!-- Poids échantillonné vrac / Poids total hors vrac -->
+ <row>
+ <cell>
+ <JLabel id='speciesSampleSortedWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='speciesSampleSortedWeightField'
+ constructorParams='this'/>
+ </cell>
+ <cell>
+ <JLabel id='speciesTotalUnsortedWeightLabel'/>
+ </cell>
+ <cell>
+ <JTextField id='speciesTotalUnsortedWeightField'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell weightx="0.5">
+ <Table id='benthosTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='benthosTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='benthosTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='benthosTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='benthosTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='benthosSampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='benthosSampleTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell>
- <Table id='planktonTable' fill='both'>
+ <!-- Poids total échantillonné -->
+ <row>
+ <cell>
+ <JLabel id='benthosSampleTotalWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='benthosSampleTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ <cell weightx="0.5">
+ <Table id='planktonTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='planktonTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='planktonTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='planktonTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='planktonTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
- <!-- Poids total échantillonné -->
- <row>
- <cell>
- <JLabel id='planktonSampleTotalWeightLabel'/>
- </cell>
- <cell>
- <NumberEditor id='planktonSampleTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell>
- <Table id='macroWasteTable' fill='both'>
+ <!-- Poids total échantillonné -->
+ <row>
+ <cell>
+ <JLabel id='planktonSampleTotalWeightLabel'/>
+ </cell>
+ <cell>
+ <NumberEditor id='planktonSampleTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell columns="2">
+ <Table id='macroWasteTable' fill='both'>
- <!-- Poids total -->
- <row>
- <cell anchor='west'>
- <JLabel id='macroWasteTotalWeightLabel'/>
- </cell>
- <cell weightx='1.0'>
- <NumberEditor id='macroWasteTotalWeightField'
- constructorParams='this'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell>
-
- </cell>
- </row>
- <!-- Actions d'import -->
- <row>
- <cell columns='6'>
- <JPanel layout='{new GridLayout(1,0)}'>
- <JButton id='importPupitriButton'
- onActionPerformed='handler.importPupitri()'/>
- </JPanel>
- </cell>
- </row>
- </Table>
+ <!-- Poids total -->
+ <row>
+ <cell anchor='west'>
+ <JLabel id='macroWasteTotalWeightLabel'/>
+ </cell>
+ <cell weightx='1.0'>
+ <NumberEditor id='macroWasteTotalWeightField'
+ constructorParams='this'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <!-- Actions d'import -->
+ <row>
+ <cell columns='6'>
+ <JPanel layout='{new GridLayout(1,0)}'>
+ <JButton id='importPupitriButton'
+ onActionPerformed='handler.importPupitri()'/>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+ </JPanel>
</JXTitledPanel>
</tab>
<tab id='speciesTab' title='tutti.label.tab.species'>
@@ -244,7 +240,7 @@
</tab>
<tab id='accidentalTab' title='tutti.label.tab.accidentel'>
<JXTitledPanel id='accidentalTabFishingOperationReminderLabel'>
- <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/>
+ <AccidentalBatchUI id='accidentalTabContent' constructorParams='this'/>
</JXTitledPanel>
</tab>
<tab id='observationIndividuelTab'
1
0
r99 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing: content/operation content/operation/fishing/environment content/operation/fishing/gearshooting content/operation/fishing/hydrology util/table
by kmorin@users.forge.codelutin.com 20 Dec '12
by kmorin@users.forge.codelutin.com 20 Dec '12
20 Dec '12
Author: kmorin
Date: 2012-12-20 18:05:25 +0100 (Thu, 20 Dec 2012)
New Revision: 99
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/99
Log:
refs #1812
Added:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicRow.java
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -26,8 +26,10 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.data.Program;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
@@ -53,7 +55,6 @@
import java.util.List;
import java.util.Map;
-import static org.nuiton.i18n.I18n._;
/**
* Handler for UI {@link EditFishingOperationUI}.
@@ -218,42 +219,45 @@
//init gear shooting
GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
+ gearShootingModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationGearCaracteristic());
gearShootingModel.addPropertyChangeListener(
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_PARAMETERS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_CARACTERISTICS,
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
model.setModify(true);
- model.setGearShootingParameters((Map<Object, Object>) evt.getNewValue());
+ model.setGearShootingCaracteristics((CaracteristicMap) evt.getNewValue());
}
}
);
- Map<Object, Object> gearShootingParams = getDefaultGearShootingParams();
- ui.getModel().setGearShootingParameters(gearShootingParams);
- gearShootingModel.setGearShootingParameters(gearShootingParams);
+ CaracteristicMap gearShootingCaracteristics = getDefaultGearShootingCaracteristics();
+ ui.getModel().setGearShootingCaracteristics(gearShootingCaracteristics);
+ gearShootingModel.setGearShootingCaracteristics(gearShootingCaracteristics);
//init environment
EnvironmentTabUIModel environmentModel =
ui.getEnvironmentTabContent().getModel();
+ environmentModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationEnvironmentCaracteristic());
environmentModel.addPropertyChangeListener(
- EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_PARAMETERS,
+ EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_CARACTERISTICS,
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
model.setModify(true);
- model.setEnvironmentParameters((Map<Object, Object>) evt.getNewValue());
+ model.setEnvironmentCaracteristics((CaracteristicMap) evt.getNewValue());
}
}
);
- Map<Object, Object> environmentParams = getDefaultEnvironmentParams();
- ui.getModel().setEnvironmentParameters(environmentParams);
- environmentModel.setEnvironmentParameters(environmentParams);
+ CaracteristicMap environmentCaracteristics = ui.getModel().getEnvironmentCaracteristics();
+ ui.getModel().setEnvironmentCaracteristics(environmentCaracteristics);
+ environmentModel.setEnvironmentCaracteristics(environmentCaracteristics);
//init hydrology
HydrologyTabUIModel hydrologyModel =
ui.getHydrologyTabContent().getModel();
+ hydrologyModel.setAvailableCaracteristics(persistenceService.getAllFishingOperationHydrologicCaracteristic());
hydrologyModel.addPropertyChangeListener(
- EditFishingOperationUIModel.PROPERTY_HYDROLOGY_PARAMETERS,
+ EditFishingOperationUIModel.PROPERTY_HYDROLOGY_CARACTERISTICS,
new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -261,85 +265,87 @@
}
}
);
- Map<Object, Object> hydrologyParams = getDefaultHydrologyParams();
- ui.getModel().setHydrologyParameters(hydrologyParams);
- hydrologyModel.setHydrologyParameters(getDefaultHydrologyParams());
+ CaracteristicMap hydrologyCaracteristics = getDefaultHydrologyCaracteristics();
+ ui.getModel().setHydrologyCaracteristics(hydrologyCaracteristics);
+ hydrologyModel.setHydrologyCaracteristics(hydrologyCaracteristics);
}
- protected Map<Object, Object> getDefaultGearShootingParams() {
- Map<Object, Object> gearShootingParams = Maps.newLinkedHashMap();
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_START_DEPTH)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_END_DEPTH)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_HORIZONTAL_APERTURE)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_VERTICAL_APERTURE)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_WARP_LENGTH)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_ARM_LENGTH)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_SYSTEME_FERMETURE_CUL)),
- null
- );
- gearShootingParams.put(
- _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_MEASURED_GEOMETRY)),
- null
- );
+ protected CaracteristicMap getDefaultGearShootingCaracteristics() {
+ CaracteristicMap gearShootingCaracteristics = new CaracteristicMap();
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_START_DEPTH)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_END_DEPTH)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_HORIZONTAL_APERTURE)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_VERTICAL_APERTURE)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_WARP_LENGTH)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_ARM_LENGTH)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_SYSTEME_FERMETURE_CUL)),
+// null
+// );
+// gearShootingParams.put(
+// _(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_MEASURED_GEOMETRY)),
+// null
+// );
- return gearShootingParams;
+ return gearShootingCaracteristics;
}
- protected Map<Object, Object> getDefaultEnvironmentParams() {
- Map<Object, Object> environmentParams = Maps.newLinkedHashMap();
- environmentParams.put(
- _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_BEAUFORT_SCALE)),
- null
- );
- environmentParams.put(
- _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_WIND_DIRECTION)),
- null
- );
- environmentParams.put(
- _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_SEA_STATE)),
- null
- );
- return environmentParams;
+ protected CaracteristicMap getDefaultEnvironmentCaracteristics() {
+ CaracteristicMap environmentCaracteristics = new CaracteristicMap();
+ List<Caracteristic> availableCaracteristics = ui.getEnvironmentTabContent().getModel().getAvailableCaracteristics();
+// environmentCaracteristics.put(availableCaracteristics.get(0), );
+// environmentCaracteristics.put(
+// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_BEAUFORT_SCALE)),
+// null
+// );
+// environmentCaracteristics.put(
+// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_WIND_DIRECTION)),
+// null
+// );
+// environmentCaracteristics.put(
+// _(new String("tutti.table.fishing.environment.keys." + EnvironmentTabUIModel.KEY_SEA_STATE)),
+// null
+// );
+ return environmentCaracteristics;
}
- protected Map<Object, Object> getDefaultHydrologyParams() {
- Map<Object, Object> hydrologyParams = Maps.newLinkedHashMap();
- hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.SURFACE)),
- null
- );
- hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.BOTTOM)),
- null
- );
- hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.SURFACE)),
- null
- );
- hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.BOTTOM)),
- null
- );
- return hydrologyParams;
+ protected CaracteristicMap getDefaultHydrologyCaracteristics() {
+ CaracteristicMap hydrologyCaracteristics = new CaracteristicMap();
+// hydrologyCaracteristics.put(
+// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.SURFACE)),
+// null
+// );
+// hydrologyCaracteristics.put(
+// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.BOTTOM)),
+// null
+// );
+// hydrologyCaracteristics.put(
+// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.SURFACE)),
+// null
+// );
+// hydrologyCaracteristics.put(
+// _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.BOTTOM)),
+// null
+// );
+ return hydrologyCaracteristics;
}
@Override
@@ -424,17 +430,17 @@
//reset gear shooting
GearShootingTabUI gearShootingTab = ui.getGearShootingTabContent();
- gearShootingTab.getModel().setGearShootingParameters(getDefaultGearShootingParams());
+ gearShootingTab.getModel().setGearShootingCaracteristics(getDefaultGearShootingCaracteristics());
gearShootingTab.getHandler().reset();
//reset environment
EnvironmentTabUI environmentTab = ui.getEnvironmentTabContent();
- environmentTab.getModel().setEnvironmentParameters(getDefaultEnvironmentParams());
+ environmentTab.getModel().setEnvironmentCaracteristics(getDefaultEnvironmentCaracteristics());
environmentTab.getHandler().reset();
//reset hydrology
HydrologyTabUI hydrologyTab = ui.getHydrologyTabContent();
- hydrologyTab.getModel().setHydrologyParameters(getDefaultHydrologyParams());
+ hydrologyTab.getModel().setHydrologyCaracteristics(getDefaultHydrologyCaracteristics());
hydrologyTab.getHandler().reset();
fishingOperationMonitor.clearModified();
@@ -483,12 +489,12 @@
// getModel().setModify(false);
- for (Object key : ui.getModel().getEnvironmentParameters().keySet()) {
- log.info(key + " : " + ui.getModel().getEnvironmentParameters().get(key));
+ for (Object key : ui.getModel().getEnvironmentCaracteristics().keySet()) {
+ log.info(key + " : " + ui.getModel().getEnvironmentCaracteristics().get(key));
}
- for (Object key : ui.getModel().getHydrologyParameters().keySet()) {
- log.info(key + " : " + ui.getModel().getHydrologyParameters().get(key));
+ for (Object key : ui.getModel().getHydrologyCaracteristics().keySet()) {
+ log.info(key + " : " + ui.getModel().getHydrologyCaracteristics().get(key));
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,12 +24,14 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.persistence.entities.referential.FishingOperationLocation;
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import fr.ird.type.SexagecimalPosition;
+import java.util.Collection;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -85,11 +87,11 @@
public static final String PROPERTY_SAISISSEUR = "saisisseur";
- public static final String PROPERTY_GEAR_SHOOTING_PARAMETERS = "gearShootingParameters";
+ public static final String PROPERTY_GEAR_SHOOTING_CARACTERISTICS = "gearShootingCaracteristics";
- public static final String PROPERTY_ENVIRONMENT_PARAMETERS = "environmentParameters";
+ public static final String PROPERTY_ENVIRONMENT_CARACTERISTICS = "environmentCaracteristics";
- public static final String PROPERTY_HYDROLOGY_PARAMETERS = "hydrologyParameters";
+ public static final String PROPERTY_HYDROLOGY_CARACTERISTICS = "hydrologyCaracteristics";
protected boolean empty;
@@ -145,14 +147,14 @@
protected List<Person> saisisseur;
- protected Map<Object, Object> gearShootingParameters;
+ protected CaracteristicMap gearShootingCaracteristics;
- protected Map<Object, Object> environmentParameters;
+ protected CaracteristicMap environmentCaracteristics;
+ protected CaracteristicMap hydrologyCaracteristics;
+
protected FishingOperation fishingOperation;
- protected Map<Object, Object> hydrologyParameters;
-
protected static Binder<EditFishingOperationUIModel, FishingOperation> toBeanBinder =
BinderFactory.newBinder(EditFishingOperationUIModel.class,
FishingOperation.class);
@@ -374,33 +376,33 @@
return fishingOperation;
}
- public Map<Object, Object> getGearShootingParameters() {
- return gearShootingParameters;
+ public CaracteristicMap getGearShootingCaracteristics() {
+ return gearShootingCaracteristics;
}
- public void setGearShootingParameters(Map<Object, Object> gearShootingParameters) {
- Object oldValue = getGearShootingParameters();
- this.gearShootingParameters = gearShootingParameters;
- firePropertyChange(PROPERTY_GEAR_SHOOTING_PARAMETERS, oldValue, gearShootingParameters);
+ public void setGearShootingCaracteristics(CaracteristicMap gearShootingParameters) {
+ Object oldValue = getGearShootingCaracteristics();
+ this.gearShootingCaracteristics = gearShootingParameters;
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_CARACTERISTICS, oldValue, gearShootingParameters);
}
- public Map<Object, Object> getEnvironmentParameters() {
- return environmentParameters;
+ public CaracteristicMap getEnvironmentCaracteristics() {
+ return environmentCaracteristics;
}
- public void setEnvironmentParameters(Map<Object, Object> environmentParameters) {
- Object oldValue = getEnvironmentParameters();
- this.environmentParameters = environmentParameters;
- firePropertyChange(PROPERTY_ENVIRONMENT_PARAMETERS, oldValue, environmentParameters);
+ public void setEnvironmentCaracteristics(CaracteristicMap environmentParameters) {
+ Object oldValue = getEnvironmentCaracteristics();
+ this.environmentCaracteristics = environmentParameters;
+ firePropertyChange(PROPERTY_ENVIRONMENT_CARACTERISTICS, oldValue, environmentParameters);
}
- public Map<Object, Object> getHydrologyParameters() {
- return hydrologyParameters;
+ public CaracteristicMap getHydrologyCaracteristics() {
+ return hydrologyCaracteristics;
}
- public void setHydrologyParameters(Map<Object, Object> hydrologyParameters) {
- Object oldValue = getHydrologyParameters();
- this.hydrologyParameters = hydrologyParameters;
- firePropertyChange(PROPERTY_HYDROLOGY_PARAMETERS, oldValue, hydrologyParameters);
+ public void setHydrologyCaracteristics(CaracteristicMap hydrologyParameters) {
+ Object oldValue = getHydrologyCaracteristics();
+ this.hydrologyCaracteristics = hydrologyParameters;
+ firePropertyChange(PROPERTY_HYDROLOGY_CARACTERISTICS, oldValue, hydrologyParameters);
}
}
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentRowModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,7 +24,10 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
+import java.util.Map.Entry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
@@ -35,39 +38,39 @@
* @author kmorin
* @since 0.3
*/
-public class EnvironmentRowModel extends AbstractTuttiBeanUIModel<Object, EnvironmentRowModel> {
+public class EnvironmentRowModel extends AbstractTuttiBeanUIModel<CaracteristicRow, EnvironmentRowModel> {
private static final Log log = LogFactory.getLog(EnvironmentRowModel.class);
public static final String PROPERTY_KEY = "key";
public static final String PROPERTY_VALUE = "value";
- protected static final Binder<Object, EnvironmentRowModel> fromBeanBinder =
- BinderFactory.newBinder(Object.class,
+ protected static final Binder<CaracteristicRow, EnvironmentRowModel> fromBeanBinder =
+ BinderFactory.newBinder(CaracteristicRow.class,
EnvironmentRowModel.class);
- protected static final Binder<EnvironmentRowModel, Object> toBeanBinder =
+ protected static final Binder<EnvironmentRowModel, CaracteristicRow> toBeanBinder =
BinderFactory.newBinder(EnvironmentRowModel.class,
- Object.class);
+ CaracteristicRow.class);
- protected String key;
+ protected Caracteristic key;
protected String value;
public EnvironmentRowModel() {
- super(Object.class, fromBeanBinder, toBeanBinder);
+ super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
- public EnvironmentRowModel(String key) {
+ public EnvironmentRowModel(Caracteristic key) {
this();
this.key = key;
}
- public String getKey() {
+ public Caracteristic getKey() {
return key;
}
- public void setKey(String key) {
+ public void setKey(Caracteristic key) {
Object oldValue = getKey();
this.key = key;
firePropertyChange(PROPERTY_KEY, oldValue, key);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -25,10 +25,13 @@
*/
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
import java.util.Collection;
import java.util.List;
@@ -39,6 +42,7 @@
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableColumnModel;
+import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
@@ -77,7 +81,7 @@
{
- addColumnToModel(columnModel, EnvironmentTableModel.KEY);
+ addColumnToModel(columnModel, null, newTableCellRender(Caracteristic.class), EnvironmentTableModel.KEY);
}
{
@@ -155,7 +159,7 @@
TuttiBeanMonitor<EnvironmentRowModel> monitor = getRowMonitor();
EnvironmentRowModel row = monitor.getBean();
if (row != null) {
- ui.getModel().setParameter(row.getKey(), row.getValue());
+ ui.getModel().setCaracteristic(row.getKey(), row.getValue());
}
}
};
@@ -177,24 +181,25 @@
*/
public void addRow() {
JComboBox keyCombo = ui.getNewRowKey();
- String key = (String) keyCombo.getSelectedItem();
- EnvironmentRowModel row = new EnvironmentRowModel(key);
+ CaracteristicRow selectedItem = (CaracteristicRow) keyCombo.getSelectedItem();
+ Caracteristic caracteristic = selectedItem.getCaracteristics()[0];
+ EnvironmentRowModel row = new EnvironmentRowModel(caracteristic);
getTableModel().addNewRow(getTable().getRowCount(), row);
- ui.getModel().setParameter(key, null);
+ ui.getModel().setCaracteristic(caracteristic, null);
- keyCombo.removeItem(key);
+ keyCombo.removeItem(selectedItem);
}
/**
* Resets the table with the data from the database
*/
public void reset() {
- Map<Object, Object> environmentParameters = ui.getModel().getEnvironmentParameters();
+ CaracteristicMap environmentCaracteristics = ui.getModel().getEnvironmentCaracteristics();
List<EnvironmentRowModel> rows = Lists.newArrayList();
- Collection<Object> params = environmentParameters.keySet();
- for (Object key : environmentParameters.keySet()) {
- rows.add(new EnvironmentRowModel(key.toString()));
+ Collection<Caracteristic> caracteristics = environmentCaracteristics.keySet();
+ for (Caracteristic key : environmentCaracteristics.keySet()) {
+ rows.add(new EnvironmentRowModel(key));
}
AbstractTuttiTableModel<EnvironmentRowModel> tableModel = getTableModel();
@@ -203,9 +208,13 @@
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
keyComboModel.removeAllElements();
- for (String param : ui.getModel().getKeys()) {
- if (!params.contains(param)) {
- keyComboModel.addElement(param);
+
+ List<Caracteristic> availableCaracteristics = ui.getModel().getAvailableCaracteristics();
+ log.info(availableCaracteristics);
+ for (Caracteristic caracteristic : availableCaracteristics) {
+ if (!caracteristics.contains(caracteristic)) {
+ CaracteristicRow row = new CaracteristicRow(caracteristic.getName(), caracteristic);
+ keyComboModel.addElement(row);
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/environment/EnvironmentTabUIModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,9 +24,12 @@
* #L%
*/
+import java.util.List;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import com.google.common.collect.Maps;
import java.util.Map;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUIModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import org.nuiton.util.beans.Binder;
@@ -41,11 +44,9 @@
*/
public class EnvironmentTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, EnvironmentRowModel, EnvironmentTabUIModel> {
- protected Map<Object, Object> environmentParameters;
+ protected CaracteristicMap environmentCaracteristics;
- public static final String KEY_BEAUFORT_SCALE = "beaufortScale";
- public static final String KEY_WIND_DIRECTION = "windDirection";
- public static final String KEY_SEA_STATE = "seaState";
+ protected List<Caracteristic> availableCaracteristics;
protected static final Binder<FishingOperation, EnvironmentTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EnvironmentTabUIModel.class)
.toBinder();
@@ -57,28 +58,27 @@
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
- public Map<Object, Object> getEnvironmentParameters() {
- return environmentParameters;
+ public CaracteristicMap getEnvironmentCaracteristics() {
+ return environmentCaracteristics;
}
- public void setEnvironmentParameters(Map<Object, Object> environmentParameters) {
- this.environmentParameters = environmentParameters;
+ public void setEnvironmentCaracteristics(CaracteristicMap environmentCaracteristics) {
+ this.environmentCaracteristics = environmentCaracteristics;
}
- public void setParameter(Object param, Object value) {
- Object oldValue = Maps.newLinkedHashMap(environmentParameters);
- environmentParameters.put(param, value);
- firePropertyChange(EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_PARAMETERS, oldValue, environmentParameters);
+ public void setCaracteristic(Caracteristic caracteristic, Object value) {
+ Object oldValue = environmentCaracteristics.clone();
+ environmentCaracteristics.put(caracteristic, value);
+ firePropertyChange(EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_CARACTERISTICS, oldValue, environmentCaracteristics);
}
- public String[] getKeys() {
- return new String[] {
- _(new String("tutti.table.fishing.environment.keys." + KEY_BEAUFORT_SCALE)),
- _(new String("tutti.table.fishing.environment.keys." + KEY_WIND_DIRECTION)),
- _(new String("tutti.table.fishing.environment.keys." + KEY_SEA_STATE)),
- _(new String("tutti.table.fishing.environment.keys." + "key3")),
- _(new String("tutti.table.fishing.environment.keys." + "key4")),
- _(new String("tutti.table.fishing.environment.keys." + "key5"))
- };
+ public List<Caracteristic> getAvailableCaracteristics() {
+ return availableCaracteristics;
}
+
+ public void setAvailableCaracteristics(List<Caracteristic> caracteristics) {
+// Object oldValue = availableCaracteristics;
+ availableCaracteristics = caracteristics;
+// firePropertyChange(EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_CARACTERISTICS, oldValue, availableCaracteristics);
+ }
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,7 +24,9 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
@@ -35,39 +37,39 @@
* @author kmorin
* @since 0.3
*/
-public class GearShootingRowModel extends AbstractTuttiBeanUIModel<Object, GearShootingRowModel> {
+public class GearShootingRowModel extends AbstractTuttiBeanUIModel<CaracteristicRow, GearShootingRowModel> {
private static final Log log = LogFactory.getLog(GearShootingRowModel.class);
public static final String PROPERTY_KEY = "key";
public static final String PROPERTY_VALUE = "value";
- protected static final Binder<Object, GearShootingRowModel> fromBeanBinder =
- BinderFactory.newBinder(Object.class,
+ protected static final Binder<CaracteristicRow, GearShootingRowModel> fromBeanBinder =
+ BinderFactory.newBinder(CaracteristicRow.class,
GearShootingRowModel.class);
- protected static final Binder<GearShootingRowModel, Object> toBeanBinder =
+ protected static final Binder<GearShootingRowModel, CaracteristicRow> toBeanBinder =
BinderFactory.newBinder(GearShootingRowModel.class,
- Object.class);
+ CaracteristicRow.class);
- protected String key;
+ protected Caracteristic key;
protected String value;
public GearShootingRowModel() {
- super(Object.class, fromBeanBinder, toBeanBinder);
+ super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
- public GearShootingRowModel(String key) {
+ public GearShootingRowModel(Caracteristic key) {
this();
this.key = key;
}
- public String getKey() {
+ public Caracteristic getKey() {
return key;
}
- public void setKey(String key) {
+ public void setKey(Caracteristic key) {
Object oldValue = getKey();
this.key = key;
firePropertyChange(PROPERTY_KEY, oldValue, key);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -25,14 +25,16 @@
*/
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.event.ListDataEvent;
@@ -155,7 +157,7 @@
TuttiBeanMonitor<GearShootingRowModel> monitor = getRowMonitor();
GearShootingRowModel row = monitor.getBean();
if (row != null) {
- ui.getModel().setParameter(row.getKey(), row.getValue());
+ ui.getModel().setCaracteristic(row.getKey(), row.getValue());
}
}
};
@@ -177,10 +179,10 @@
*/
public void addRow() {
JComboBox keyCombo = ui.getNewRowKey();
- String key = (String) keyCombo.getSelectedItem();
+ Caracteristic key = (Caracteristic) keyCombo.getSelectedItem();
GearShootingRowModel row = new GearShootingRowModel(key);
getTableModel().addNewRow(getTable().getRowCount(), row);
- ui.getModel().setParameter(key, null);
+ ui.getModel().setCaracteristic(key, null);
keyCombo.removeItem(key);
}
@@ -189,12 +191,12 @@
* Resets the table with the data from the database
*/
public void reset() {
- Map<Object, Object> gearShootingParameters = ui.getModel().getGearShootingParameters();
+ CaracteristicMap gearShootingCaracteristics = ui.getModel().getGearShootingCaracteristics();
List<GearShootingRowModel> rows = Lists.newArrayList();
- Collection<Object> params = gearShootingParameters.keySet();
- for (Object key : gearShootingParameters.keySet()) {
- rows.add(new GearShootingRowModel(key.toString()));
+ Collection<Caracteristic> caracteristics = gearShootingCaracteristics.keySet();
+ for (Caracteristic key : gearShootingCaracteristics.keySet()) {
+ rows.add(new GearShootingRowModel(key));
}
AbstractTuttiTableModel<GearShootingRowModel> tableModel = getTableModel();
@@ -203,9 +205,13 @@
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
keyComboModel.removeAllElements();
- for (String param : ui.getModel().getKeys()) {
- if (!params.contains(param)) {
- keyComboModel.addElement(param);
+
+ List<Caracteristic> availableCaracteristics = ui.getModel().getAvailableCaracteristics();
+ log.info(availableCaracteristics);
+ for (Caracteristic caracteristic : availableCaracteristics) {
+ if (!caracteristics.contains(caracteristic)) {
+ CaracteristicRow row = new CaracteristicRow(caracteristic.getName(), caracteristic);
+ keyComboModel.addElement(row);
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,16 +24,16 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import com.google.common.collect.Maps;
-import java.util.Map;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUIModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
-import java.util.HashMap;
+import java.util.List;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderModelBuilder;
-import static org.nuiton.i18n.I18n._;
/**
*
@@ -42,16 +42,9 @@
*/
public class GearShootingTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, GearShootingRowModel, GearShootingTabUIModel> {
- protected Map<Object, Object> gearShootingParameters;
+ protected CaracteristicMap gearShootingCaracteristics;
- public static final String KEY_START_DEPTH = "startDepth";
- public static final String KEY_END_DEPTH = "endDepth";
- public static final String KEY_VERTICAL_APERTURE = "verticalAperture";
- public static final String KEY_HORIZONTAL_APERTURE = "horizontalAperture";
- public static final String KEY_WARP_LENGTH = "warpLength";
- public static final String KEY_ARM_LENGTH = "armLength";
- public static final String KEY_SYSTEME_FERMETURE_CUL = "systemeFermetureCul";
- public static final String KEY_MEASURED_GEOMETRY = "measuredGeometry";
+ protected List<Caracteristic> availableCaracteristics;
protected static final Binder<FishingOperation, GearShootingTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, GearShootingTabUIModel.class)
.toBinder();
@@ -63,33 +56,26 @@
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
- public Map<Object, Object> getGearShootingParameters() {
- return gearShootingParameters;
+ public CaracteristicMap getGearShootingCaracteristics() {
+ return gearShootingCaracteristics;
}
- public void setGearShootingParameters(Map<Object, Object> gearShooting) {
- this.gearShootingParameters = gearShooting;
+ public void setGearShootingCaracteristics(CaracteristicMap gearShooting) {
+ this.gearShootingCaracteristics = gearShooting;
}
- public void setParameter(Object param, Object value) {
- Object oldValue = Maps.newLinkedHashMap(gearShootingParameters);
- gearShootingParameters.put(param, value);
- firePropertyChange(EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_PARAMETERS, oldValue, gearShootingParameters);
+ public void setCaracteristic(Caracteristic caracteristic, Object value) {
+ Object oldValue = Maps.newLinkedHashMap(gearShootingCaracteristics);
+ gearShootingCaracteristics.put(caracteristic, value);
+ firePropertyChange(EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_CARACTERISTICS, oldValue, gearShootingCaracteristics);
}
-
- public String[] getKeys() {
- return new String[] {
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_START_DEPTH)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_END_DEPTH)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_HORIZONTAL_APERTURE)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_VERTICAL_APERTURE)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_WARP_LENGTH)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_ARM_LENGTH)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_SYSTEME_FERMETURE_CUL)),
- _(new String("tutti.table.fishing.gearShooting.keys." + KEY_MEASURED_GEOMETRY)),
- _(new String("tutti.table.fishing.gearShooting.keys." + "key3")),
- _(new String("tutti.table.fishing.gearShooting.keys." + "key4")),
- _(new String("tutti.table.fishing.gearShooting.keys." + "key5"))
- };
+
+ public List<Caracteristic> getAvailableCaracteristics() {
+ return availableCaracteristics;
}
+
+ public void setAvailableCaracteristics(List<Caracteristic> availableCaracteristics) {
+ this.availableCaracteristics = availableCaracteristics;
+ }
+
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -24,7 +24,9 @@
* #L%
*/
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
@@ -35,7 +37,7 @@
* @author kmorin
* @since 0.3
*/
-public class HydrologyRowModel extends AbstractTuttiBeanUIModel<Object, HydrologyRowModel> {
+public class HydrologyRowModel extends AbstractTuttiBeanUIModel<CaracteristicRow, HydrologyRowModel> {
private static final Log log = LogFactory.getLog(HydrologyRowModel.class);
@@ -44,15 +46,15 @@
public static final String PROPERTY_GEAR_SHOOTING_END_VALUE = "gearShootingEndValue";
public static final String PROPERTY_AVERAGE_VALUE = "averageValue";
- protected static final Binder<Object, HydrologyRowModel> fromBeanBinder =
- BinderFactory.newBinder(Object.class,
+ protected static final Binder<CaracteristicRow, HydrologyRowModel> fromBeanBinder =
+ BinderFactory.newBinder(CaracteristicRow.class,
HydrologyRowModel.class);
- protected static final Binder<HydrologyRowModel, Object> toBeanBinder =
+ protected static final Binder<HydrologyRowModel, CaracteristicRow> toBeanBinder =
BinderFactory.newBinder(HydrologyRowModel.class,
- Object.class);
+ CaracteristicRow.class);
- protected String key;
+ protected Caracteristic key;
protected String gearShootingStartValue;
@@ -61,19 +63,19 @@
protected String averageValue;
public HydrologyRowModel() {
- super(Object.class, fromBeanBinder, toBeanBinder);
+ super(CaracteristicRow.class, fromBeanBinder, toBeanBinder);
}
- public HydrologyRowModel(String key) {
+ public HydrologyRowModel(Caracteristic key) {
this();
this.key = key;
}
- public String getKey() {
+ public Caracteristic getKey() {
return key;
}
- public void setKey(String key) {
+ public void setKey(Caracteristic key) {
Object oldValue = getKey();
this.key = key;
firePropertyChange(PROPERTY_KEY, oldValue, key);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -25,14 +25,16 @@
*/
import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import fr.ifremer.tutti.ui.swing.util.table.CaracteristicRow;
import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.event.ListDataEvent;
@@ -169,7 +171,7 @@
TuttiBeanMonitor<HydrologyRowModel> monitor = getRowMonitor();
HydrologyRowModel row = monitor.getBean();
if (row != null) {
- ui.getModel().setParameter(row.getKey(),
+ ui.getModel().setCaracteristic(row.getKey(),
row.getGearShootingStartValue(),
row.getGearShootingEndValue(),
row.getAverageValue()
@@ -194,25 +196,25 @@
* Adds a row with the parameter selected in the combo box
*/
public void addRow() {
- JComboBox keyCombo = ui.getNewRowKey();
- String key = (String) keyCombo.getSelectedItem();
- HydrologyRowModel row = new HydrologyRowModel(key);
- getTableModel().addNewRow(getTable().getRowCount(), row);
- ui.getModel().setParameter(key, null, null, null);
-
- keyCombo.removeItem(key);
+// JComboBox keyCombo = ui.getNewRowKey();
+// CaracteristicRow key = (CaracteristicRow) keyCombo.getSelectedItem();
+// HydrologyRowModel row = new HydrologyRowModel(key);
+// getTableModel().addNewRow(getTable().getRowCount(), row);
+// ui.getModel().setCaracteristic(row.getKey(), null, null, null);
+//
+// keyCombo.removeItem(key);
}
/**
* Resets the table with the data from the database
*/
public void reset() {
- Map<Object, Object> hydrologyParameters = ui.getModel().getHydrologyParameters();
+ CaracteristicMap hydrologyCaracteristics = ui.getModel().getHydrologyCaracteristics();
List<HydrologyRowModel> rows = Lists.newArrayList();
- Collection<Object> params = hydrologyParameters.keySet();
- for (Object key : hydrologyParameters.keySet()) {
- rows.add(new HydrologyRowModel(key.toString()));
+ Collection<Caracteristic> caracteristics = hydrologyCaracteristics.keySet();
+ for (Caracteristic key : hydrologyCaracteristics.keySet()) {
+ rows.add(new HydrologyRowModel(key));
}
AbstractTuttiTableModel<HydrologyRowModel> tableModel = getTableModel();
@@ -221,9 +223,13 @@
JComboBox keyCombo = ui.getNewRowKey();
DefaultComboBoxModel keyComboModel = (DefaultComboBoxModel) keyCombo.getModel();
keyComboModel.removeAllElements();
- for (String param : ui.getModel().getKeys()) {
- if (!params.contains(param)) {
- keyComboModel.addElement(param);
+
+ List<Caracteristic> availableCaracteristics = ui.getModel().getAvailableCaracteristics();
+ log.info(availableCaracteristics);
+ for (Caracteristic caracteristic : availableCaracteristics) {
+ if (!caracteristics.contains(caracteristic)) {
+ CaracteristicRow row = new CaracteristicRow(caracteristic.getName(), caracteristic);
+ keyComboModel.addElement(row);
}
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -25,14 +25,15 @@
*/
import com.google.common.collect.Maps;
-import java.util.Map;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUIModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
+import java.util.List;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderModelBuilder;
-import static org.nuiton.i18n.I18n._;
/**
*
@@ -41,15 +42,9 @@
*/
public class HydrologyTabUIModel extends AbstractTuttiTableUIModel<FishingOperation, HydrologyRowModel, HydrologyTabUIModel> {
- protected Map<Object, Object> hydrologyParameters;
+ protected CaracteristicMap hydrologyCaracteristics;
- public static final String GEAR_SHOOTING_START = "gearShootingStart";
- public static final String GEAR_SHOOTING_END = "gearShootingEnd";
- public static final String AVERAGE = "average";
- public static final String SURFACE = "surface";
- public static final String BOTTOM = "bottom";
- public static final String TEMPERATURE = "temperature";
- public static final String SALINITY = "salinity";
+ protected List<Caracteristic> availableCaracteristics;
protected static final Binder<FishingOperation, HydrologyTabUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, HydrologyTabUIModel.class)
.toBinder();
@@ -61,33 +56,30 @@
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
}
- public Map<Object, Object> getHydrologyParameters() {
- return hydrologyParameters;
+ public CaracteristicMap getHydrologyCaracteristics() {
+ return hydrologyCaracteristics;
}
- public void setHydrologyParameters(Map<Object, Object> environmentParameters) {
- this.hydrologyParameters = environmentParameters;
+ public void setHydrologyCaracteristics(CaracteristicMap hydrologyCaracteristics) {
+ this.hydrologyCaracteristics = hydrologyCaracteristics;
}
- public void setParameter(Object param, Object gearShootingStartValue,
+ public void setCaracteristic(Caracteristic param, Object gearShootingStartValue,
Object gearShootingEndValue, Object averageValue) {
- Object oldValue = Maps.newLinkedHashMap(hydrologyParameters);
- hydrologyParameters.put(param + "." + GEAR_SHOOTING_START, gearShootingStartValue);
- hydrologyParameters.put(param + "." + GEAR_SHOOTING_END, gearShootingEndValue);
- hydrologyParameters.put(param + "." + AVERAGE, averageValue);
- firePropertyChange(EditFishingOperationUIModel.PROPERTY_HYDROLOGY_PARAMETERS, oldValue, hydrologyParameters);
+ Object oldValue = Maps.newLinkedHashMap(hydrologyCaracteristics);
+// hydrologyCaracteristics.put(param + "." + GEAR_SHOOTING_START, gearShootingStartValue);
+// hydrologyCaracteristics.put(param + "." + GEAR_SHOOTING_END, gearShootingEndValue);
+// hydrologyCaracteristics.put(param + "." + AVERAGE, averageValue);
+ firePropertyChange(EditFishingOperationUIModel.PROPERTY_HYDROLOGY_CARACTERISTICS, oldValue, hydrologyCaracteristics);
}
-
- public String[] getKeys() {
- return new String[] {
- _(new String("tutti.table.fishing.hydrology.keys." + TEMPERATURE + "." + SURFACE)),
- _(new String("tutti.table.fishing.hydrology.keys." + TEMPERATURE + "." + BOTTOM)),
- _(new String("tutti.table.fishing.hydrology.keys." + SALINITY + "." + SURFACE)),
- _(new String("tutti.table.fishing.hydrology.keys." + SALINITY + "." + BOTTOM)),
- _(new String("tutti.table.fishing.hydrology.keys." + "key3")),
- _(new String("tutti.table.fishing.hydrology.keys." + "key4")),
- _(new String("tutti.table.fishing.hydrology.keys." + "key5"))
- };
+
+ public List<Caracteristic> getAvailableCaracteristics() {
+ return availableCaracteristics;
}
+
+ public void setAvailableCaracteristics(List<Caracteristic> availableCaracteristics) {
+ this.availableCaracteristics = availableCaracteristics;
+ }
+
}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicRow.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicRow.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/table/CaracteristicRow.java 2012-12-20 17:05:25 UTC (rev 99)
@@ -0,0 +1,42 @@
+package fr.ifremer.tutti.ui.swing.util.table;
+
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+
+/**
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.3
+ */
+public class CaracteristicRow {
+
+ protected Caracteristic[] caracteristics;
+
+ protected String name;
+
+ public CaracteristicRow(String name, Caracteristic... caracteristics) {
+ this.name = name;
+ this.caracteristics = caracteristics;
+ }
+
+ public Caracteristic[] getCaracteristics() {
+ return caracteristics;
+ }
+
+ public void setCaracteristics(Caracteristic[] caracteristics) {
+ this.caracteristics = caracteristics;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+}
1
0
20 Dec '12
Author: tchemit
Date: 2012-12-20 17:08:26 +0100 (Thu, 20 Dec 2012)
New Revision: 98
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/98
Log:
back to compilerPlugin 2.5.1 + rename sorted and unsorted field in fishingOperation
Modified:
trunk/pom.xml
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/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/fishing/gearshooting/GearShootingRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/pom.xml 2012-12-20 16:08:26 UTC (rev 98)
@@ -81,6 +81,9 @@
<platform>forge.codelutin.com</platform>
<projectId>tutti</projectId>
+ <!-- Remove this when using mavenpom 3.4.7 -->
+ <compilerPluginVersion>2.5.1</compilerPluginVersion>
+
<!-- libraries version -->
<nuitonUtilsVersion>2.6.5</nuitonUtilsVersion>
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/AbstractTuttiBatchTableUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -36,7 +36,6 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
-import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
import fr.ifremer.tutti.ui.swing.util.table.TableRowModificationListener;
import jaxx.runtime.SwingUtil;
import org.apache.commons.logging.Log;
@@ -61,9 +60,8 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.2
*/
-public abstract class AbstractTuttiBatchTableUIHandler<R extends AbstractTuttiBeanUIModel, M extends AbstractTuttiTableUIModel<?, R, M>> extends AbstractTuttiTableUIHandler<R, M> {
+public abstract class AbstractTuttiBatchTableUIHandler<R extends AbstractTuttiBeanUIModel, M extends AbstractTuttiBatchUIModel<R, M>> extends AbstractTuttiTableUIHandler<R, M> {
-
/** Logger. */
private static final Log log =
LogFactory.getLog(AbstractTuttiBatchTableUIHandler.class);
@@ -85,7 +83,7 @@
*/
protected final PersistenceService persistenceService;
- protected AbstractTuttiBatchTableUIHandler(TuttiUI<?,?> parentUi,
+ protected AbstractTuttiBatchTableUIHandler(TuttiUI<?, ?> parentUi,
String... properties) {
super(parentUi.getHandler().getContext(), properties);
this.persistenceService = context.getService(PersistenceService.class);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2012-12-20 16:08:26 UTC (rev 98)
@@ -248,23 +248,22 @@
horizontalAlignment: {JLabel.CENTER};
}
+#createFishingOperationActions {
+ visible: {model.isEmpty()};
+}
+
#saveButton {
actionIcon: "save";
text: "tutti.action.save";
- enabled: {model.isModify() && model.isValid()};
+ enabled: {model.isValid()};
}
#cancelButton {
actionIcon: "cancel";
text: "tutti.action.cancel";
- enabled: {model.isModify()};
+ /*enabled: {model.isModify()};*/
}
-#importPupitriButton {
- actionIcon: "pupitri-import";
- text: "tutti.action.pupitri-import";
-}
-
#importCasinoButton {
actionIcon: "casino-import";
text: "tutti.action.casino-import";
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2012-12-20 16:08:26 UTC (rev 98)
@@ -295,7 +295,8 @@
<tab id='traitGearShootingTab'
title='tutti.label.tab.fishingOperation.gearShooting'>
- <GearShootingTabUI id='gearShootingTabContent' constructorParams='this'/>
+ <GearShootingTabUI id='gearShootingTabContent'
+ constructorParams='this'/>
</tab>
<tab id='environmentTab'
@@ -314,7 +315,8 @@
<!-- Actions -->
<JPanel layout='{new BorderLayout()}' constraints='BorderLayout.SOUTH'>
- <JPanel layout='{new GridLayout(1,0)}' constraints='BorderLayout.CENTER'>
+ <JPanel id='createFishingOperationActions' layout='{new GridLayout(1,0)}'
+ constraints='BorderLayout.CENTER'>
<JButton id='cancelButton' onActionPerformed='handler.cancel()'/>
<JButton id='saveButton' onActionPerformed='handler.save()'/>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -24,7 +24,6 @@
* #L%
*/
-import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUI;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -36,9 +35,11 @@
import fr.ifremer.tutti.ui.swing.AbstractTuttiUIHandler;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.environment.EnvironmentTabUIModel;
+import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting.GearShootingTabUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUI;
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -72,11 +73,38 @@
private final PersistenceService persistenceService;
- public EditFishingOperationUIHandler(FishingOperationsUI parentUi, EditFishingOperationUI ui) {
+ /**
+ * To monitor changes on the incoming fishing operation.
+ *
+ * @since 0.3
+ */
+ private final TuttiBeanMonitor<EditFishingOperationUIModel> fishingOperationMonitor;
+
+ public EditFishingOperationUIHandler(FishingOperationsUI parentUi,
+ EditFishingOperationUI ui) {
super(parentUi.getHandler().getContext());
this.ui = ui;
this.parentUi = parentUi;
this.persistenceService = context.getService(PersistenceService.class);
+ this.fishingOperationMonitor = new TuttiBeanMonitor<EditFishingOperationUIModel>(
+ EditFishingOperationUIModel.PROPERTY_STATION_NUMBER,
+ EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_NUMBER,
+ EditFishingOperationUIModel.PROPERTY_DATE,
+ EditFishingOperationUIModel.PROPERTY_STRATA,
+ EditFishingOperationUIModel.PROPERTY_SUB_STRATA,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_DATE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_DATE,
+ EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_RECTILIGNE,
+ EditFishingOperationUIModel.PROPERTY_DISTANCE_CHALUTEE,
+ EditFishingOperationUIModel.PROPERTY_DUREE,
+ EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_VALID,
+ EditFishingOperationUIModel.PROPERTY_LOCATION,
+ EditFishingOperationUIModel.PROPERTY_COMMENT,
+ EditFishingOperationUIModel.PROPERTY_SAISISSEUR);
}
@Override
@@ -119,9 +147,11 @@
}
});
- listModelIsModify(model);
+// listModelIsModify(model);
ui.setContextValue(model);
+
+ fishingOperationMonitor.setBean(model);
}
@Override
@@ -184,9 +214,9 @@
model.setEmpty(true);
listenValidatorValid(ui.getValidator(), getModel());
-
+
//init gear shooting
- GearShootingTabUIModel gearShootingModel =
+ GearShootingTabUIModel gearShootingModel =
ui.getGearShootingTabContent().getModel();
gearShootingModel.addPropertyChangeListener(
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_PARAMETERS,
@@ -194,16 +224,16 @@
public void propertyChange(PropertyChangeEvent evt) {
model.setModify(true);
- model.setGearShootingParameters((Map<Object, Object>)evt.getNewValue());
+ model.setGearShootingParameters((Map<Object, Object>) evt.getNewValue());
}
}
- );
+ );
Map<Object, Object> gearShootingParams = getDefaultGearShootingParams();
ui.getModel().setGearShootingParameters(gearShootingParams);
gearShootingModel.setGearShootingParameters(gearShootingParams);
-
+
//init environment
- EnvironmentTabUIModel environmentModel =
+ EnvironmentTabUIModel environmentModel =
ui.getEnvironmentTabContent().getModel();
environmentModel.addPropertyChangeListener(
EditFishingOperationUIModel.PROPERTY_ENVIRONMENT_PARAMETERS,
@@ -211,16 +241,16 @@
public void propertyChange(PropertyChangeEvent evt) {
model.setModify(true);
- model.setEnvironmentParameters((Map<Object, Object>)evt.getNewValue());
+ model.setEnvironmentParameters((Map<Object, Object>) evt.getNewValue());
}
}
- );
+ );
Map<Object, Object> environmentParams = getDefaultEnvironmentParams();
ui.getModel().setEnvironmentParameters(environmentParams);
environmentModel.setEnvironmentParameters(environmentParams);
-
+
//init hydrology
- HydrologyTabUIModel hydrologyModel =
+ HydrologyTabUIModel hydrologyModel =
ui.getHydrologyTabContent().getModel();
hydrologyModel.addPropertyChangeListener(
EditFishingOperationUIModel.PROPERTY_HYDROLOGY_PARAMETERS,
@@ -270,10 +300,10 @@
_(new String("tutti.table.fishing.gearShooting.keys." + GearShootingTabUIModel.KEY_MEASURED_GEOMETRY)),
null
);
-
+
return gearShootingParams;
}
-
+
protected Map<Object, Object> getDefaultEnvironmentParams() {
Map<Object, Object> environmentParams = Maps.newLinkedHashMap();
environmentParams.put(
@@ -296,19 +326,19 @@
hydrologyParams.put(
_(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.SURFACE)),
null
- );
+ );
hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.BOTTOM)),
+ _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.TEMPERATURE + "." + HydrologyTabUIModel.BOTTOM)),
null
- );
+ );
hydrologyParams.put(
_(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.SURFACE)),
null
- );
+ );
hydrologyParams.put(
- _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.BOTTOM)),
+ _(new String("tutti.table.fishing.hydrology.keys." + HydrologyTabUIModel.SALINITY + "." + HydrologyTabUIModel.BOTTOM)),
null
- );
+ );
return hydrologyParams;
}
@@ -323,6 +353,31 @@
public void selectFishingOperation(FishingOperation bean) {
+ if (fishingOperationMonitor.wasModified()) {
+
+ // previous fishingOperation was modified, let's save it
+ EditFishingOperationUIModel beanToSave = fishingOperationMonitor.getBean();
+
+ if (beanToSave.isEmpty()) {
+
+ // user must use save button
+ if (log.isWarnEnabled()) {
+ log.warn("Won't save new fishing operation, use explicit save button instead...");
+ }
+ } else {
+
+ // save modified fishing operation
+ FishingOperation toSave = beanToSave.toBean();
+
+ if (log.isInfoEnabled()) {
+ log.info("FishingOperation " + toSave.getId() +
+ " was modified, will save it.");
+ }
+
+ parentUi.getHandler().saveFishingOperation(toSave);
+ }
+ }
+
boolean empty = bean == null;
EditFishingOperationUIModel model = getModel();
@@ -338,6 +393,11 @@
model.fromBean(bean);
+ // to be sure combo list will be reloaded
+ model.setStrata(null);
+ model.setSubStrata(null);
+ model.setLocation(null);
+
if (strata != null) {
ui.getStrataComboBox().setSelectedItem(strata);
}
@@ -366,16 +426,18 @@
GearShootingTabUI gearShootingTab = ui.getGearShootingTabContent();
gearShootingTab.getModel().setGearShootingParameters(getDefaultGearShootingParams());
gearShootingTab.getHandler().reset();
-
+
//reset environment
EnvironmentTabUI environmentTab = ui.getEnvironmentTabContent();
environmentTab.getModel().setEnvironmentParameters(getDefaultEnvironmentParams());
environmentTab.getHandler().reset();
-
+
//reset hydrology
HydrologyTabUI hydrologyTab = ui.getHydrologyTabContent();
hydrologyTab.getModel().setHydrologyParameters(getDefaultHydrologyParams());
hydrologyTab.getHandler().reset();
+
+ fishingOperationMonitor.clearModified();
}
public void cancel() {
@@ -419,21 +481,17 @@
// reselect current tab
ui.getFishingOperationTabPane().setSelectedIndex(selectedIndex);
- getModel().setModify(false);
-
+// getModel().setModify(false);
+
for (Object key : ui.getModel().getEnvironmentParameters().keySet()) {
log.info(key + " : " + ui.getModel().getEnvironmentParameters().get(key));
}
-
+
for (Object key : ui.getModel().getHydrologyParameters().keySet()) {
log.info(key + " : " + ui.getModel().getHydrologyParameters().get(key));
}
}
- public void importPupitri() {
- //TODO
- }
-
public void importCasino() {
//TODO
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -198,16 +198,13 @@
}
// propagate fishingOperation to his tabs
- ui.getFishingOperationTabContent().getHandler().selectFishingOperation(fishingOperation
- );
+ ui.getFishingOperationTabContent().getHandler().selectFishingOperation(fishingOperation);
ui.getCatchesTabContent().getHandler().selectFishingOperation(fishingOperation,
fishingOperationText);
-
// repaint tabs
ui.getTabPane().repaint();
-// ui.getObservationIndividuelTabContent().selectFishingOperation(selectedFishingOperation);
}
public void saveFishingOperation(FishingOperation toSave) {
@@ -229,7 +226,8 @@
List<FishingOperation> data = model.getFishingOperation();
- FishingOperation existingFishingOperation = TuttiEntities.findById(data, savedFishingOperation.getId());
+ FishingOperation existingFishingOperation =
+ TuttiEntities.findById(data, savedFishingOperation.getId());
if (existingFishingOperation != null) {
data.remove(existingFishingOperation);
}
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 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.css 2012-12-20 16:08:26 UTC (rev 98)
@@ -61,37 +61,37 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesTotalVracWeightLabel {
- text: "tutti.label.catches.speciesTotalVracWeight";
- labelFor: {speciesTotalVracWeightField};
+#speciesTotalSortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalSortedWeight";
+ labelFor: {speciesTotalSortedWeightField};
}
-#speciesTotalVracWeightField {
- property: "speciesTotalVracWeight";
- model: {model.getSpeciesTotalVracWeight()};
+#speciesTotalSortedWeightField {
+ property: "speciesTotalSortedWeight";
+ model: {model.getSpeciesTotalSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesSampleVracWeightLabel {
- text: "tutti.label.catches.speciesSampleVracWeight";
- labelFor: {speciesSampleVracWeightField};
+#speciesSampleSortedWeightLabel {
+ text: "tutti.label.catches.speciesSampleSortedWeight";
+ labelFor: {speciesSampleSortedWeightField};
}
-#speciesSampleVracWeightField {
- property: "speciesSampleVracWeight";
- model: {model.getSpeciesSampleVracWeight()};
+#speciesSampleSortedWeightField {
+ property: "speciesSampleSortedWeight";
+ model: {model.getSpeciesSampleSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesTotalHorsVracWeightLabel {
- text: "tutti.label.catches.speciesTotalHorsVracWeight";
- labelFor: {speciesTotalHorsVracWeightField};
+#speciesTotalUnsortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalUnsortedWeight";
+ labelFor: {speciesTotalUnsortedWeightField};
}
-#speciesTotalHorsVracWeightField {
- text: {getStringValue(model.getSpeciesTotalHorsVracWeight())};
+#speciesTotalUnsortedWeightField {
+ text: {getStringValue(model.getSpeciesTotalUnsortedWeight())};
editable: false;
}
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 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUI.jaxx 2012-12-20 16:08:26 UTC (rev 98)
@@ -25,8 +25,6 @@
implements='fr.ifremer.tutti.ui.swing.TuttiUI<EditCatchesUIModel, EditCatchesUIHandler>'>
<import>
- fr.ifremer.tutti.ui.swing.TuttiUIContext
-
fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI
fr.ifremer.tutti.ui.swing.content.operation.accidental.AccidentalBatchUI
fr.ifremer.tutti.ui.swing.content.operation.benthos.BenthosBatchUI
@@ -34,10 +32,7 @@
fr.ifremer.tutti.ui.swing.content.operation.plankton.PlanktonBatchUI
fr.ifremer.tutti.ui.swing.content.operation.species.SpeciesBatchUI
fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUI
- fr.ifremer.tutti.ui.swing.util.editor.LongTextEditorUI
- fr.ifremer.tutti.ui.swing.util.editor.AttachmentEditorUI
- org.jdesktop.swingx.JXTable
org.jdesktop.swingx.JXTitledPanel
jaxx.runtime.swing.editor.NumberEditor
@@ -45,10 +40,6 @@
jaxx.runtime.validator.swing.SwingValidatorUtil
jaxx.runtime.validator.swing.SwingValidatorMessageTableModel
- javax.swing.ListSelectionModel
-
- java.awt.Color
-
static org.nuiton.i18n.I18n._
static jaxx.runtime.SwingUtil.getStringValue
</import>
@@ -77,12 +68,12 @@
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='speciesTotalWeight'
component='speciesTotalWeightField'/>
- <field name='speciesTotalVracWeight'
- component='speciesTotalVracWeightField'/>
- <field name='speciesSampleVracWeight'
- component='speciesSampleVracWeightField'/>
- <field name='speciesTotalHorsVracWeight'
- component='speciesTotalHorsVracWeightField'/>
+ <field name='speciesTotalSortedWeight'
+ component='speciesTotalSortedWeightField'/>
+ <field name='speciesSampleSortedWeight'
+ component='speciesSampleSortedWeightField'/>
+ <field name='speciesTotalUnsortedWeight'
+ component='speciesTotalUnsortedWeightField'/>
<field name='benthosTotalWeight'
component='benthosTotalWeightField'/>
<field name='benthosSampleTotalWeight'
@@ -114,10 +105,10 @@
constructorParams='this'/>
</cell>
<cell anchor='west'>
- <JLabel id='speciesTotalVracWeightLabel'/>
+ <JLabel id='speciesTotalSortedWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalVracWeightField'
+ <NumberEditor id='speciesTotalSortedWeightField'
constructorParams='this'/>
</cell>
</row>
@@ -125,17 +116,17 @@
<!-- Poids échantillonné vrac / Poids total hors vrac -->
<row>
<cell>
- <JLabel id='speciesSampleVracWeightLabel'/>
+ <JLabel id='speciesSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='speciesSampleVracWeightField'
+ <NumberEditor id='speciesSampleSortedWeightField'
constructorParams='this'/>
</cell>
<cell>
- <JLabel id='speciesTotalHorsVracWeightLabel'/>
+ <JLabel id='speciesTotalUnsortedWeightLabel'/>
</cell>
<cell>
- <JTextField id='speciesTotalHorsVracWeightField'/>
+ <JTextField id='speciesTotalUnsortedWeightField'/>
</cell>
</row>
</Table>
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 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -69,9 +69,9 @@
this.persistenceService = context.getService(PersistenceService.class);
this.fishingOperationMonitor = new TuttiBeanMonitor<EditCatchesUIModel>(
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
EditCatchesUIModel.PROPERTY_BENTHOS_TOTAL_WEIGHT,
EditCatchesUIModel.PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
EditCatchesUIModel.PROPERTY_PLANKTON_TOTAL_WEIGHT,
@@ -97,6 +97,12 @@
@Override
public void onCloseUI() {
+
+ if (log.isInfoEnabled()) {
+ log.info("closing: " + ui);
+ }
+
+ // close batches tabs, then general tab
}
@Override
@@ -150,16 +156,11 @@
ui.getMacroWasteTabFishingOperationReminderLabel().setTitle(fishingOperationText);
ui.getAccidentalTabFishingOperationReminderLabel().setTitle(fishingOperationText);
- 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.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();
}
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 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -39,11 +39,11 @@
public static final String PROPERTY_SPECIES_TOTAL_WEIGHT = "speciesTotalWeight";
- public static final String PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT = "speciesTotalVracWeight";
+ public static final String PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT = "speciesTotalSortedWeight";
- public static final String PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT = "speciesSampleVracWeight";
+ public static final String PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT = "speciesSampleSortedWeight";
- public static final String PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT = "speciesTotalHorsVracWeight";
+ public static final String PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT = "speciesTotalUnsortedWeight";
public static final String PROPERTY_BENTHOS_TOTAL_WEIGHT = "benthosTotalWeight";
@@ -60,9 +60,9 @@
protected static final Binder<FishingOperation, EditCatchesUIModel> fromBeanBinder = BinderModelBuilder.newEmptyBuilder(FishingOperation.class, EditCatchesUIModel.class)
.addSimpleProperties(
PROPERTY_SPECIES_TOTAL_WEIGHT,
- PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT,
- PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT,
- PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
+ PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
PROPERTY_BENTHOS_TOTAL_WEIGHT,
PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
PROPERTY_PLANKTON_TOTAL_WEIGHT,
@@ -73,9 +73,9 @@
protected static final Binder<EditCatchesUIModel, FishingOperation> toBeanBinder = BinderModelBuilder.newEmptyBuilder(EditCatchesUIModel.class, FishingOperation.class)
.addSimpleProperties(
PROPERTY_SPECIES_TOTAL_WEIGHT,
- PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT,
- PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT,
- PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
+ PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
+ PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT,
PROPERTY_BENTHOS_TOTAL_WEIGHT,
PROPERTY_BENTHOS_SAMPLE_TOTAL_WEIGHT,
PROPERTY_PLANKTON_TOTAL_WEIGHT,
@@ -85,11 +85,11 @@
protected Float speciesTotalWeight;
- protected Float speciesTotalVracWeight;
+ protected Float speciesTotalSortedWeight;
- protected Float speciesSampleVracWeight;
+ protected Float speciesSampleSortedWeight;
- protected Float speciesTotalHorsVracWeight;
+ protected Float speciesTotalUnsortedWeight;
protected Float benthosTotalWeight;
@@ -127,34 +127,34 @@
firePropertyChange(PROPERTY_SPECIES_TOTAL_WEIGHT, oldValue, speciesTotalWeight);
}
- public Float getSpeciesTotalVracWeight() {
- return speciesTotalVracWeight;
+ public Float getSpeciesTotalSortedWeight() {
+ return speciesTotalSortedWeight;
}
- public void setSpeciesTotalVracWeight(Float speciesTotalVracWeight) {
- Object oldValue = getSpeciesTotalVracWeight();
- this.speciesTotalVracWeight = speciesTotalVracWeight;
- firePropertyChange(PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT, oldValue, speciesTotalVracWeight);
+ public void setSpeciesTotalSortedWeight(Float speciesTotalSortedWeight) {
+ Object oldValue = getSpeciesTotalSortedWeight();
+ this.speciesTotalSortedWeight = speciesTotalSortedWeight;
+ firePropertyChange(PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT, oldValue, speciesTotalSortedWeight);
}
- public Float getSpeciesSampleVracWeight() {
- return speciesSampleVracWeight;
+ public Float getSpeciesSampleSortedWeight() {
+ return speciesSampleSortedWeight;
}
- public void setSpeciesSampleVracWeight(Float speciesSampleVracWeight) {
- Object oldValue = getSpeciesSampleVracWeight();
- this.speciesSampleVracWeight = speciesSampleVracWeight;
- firePropertyChange(PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT, oldValue, speciesSampleVracWeight);
+ public void setSpeciesSampleSortedWeight(Float speciesSampleSortedWeight) {
+ Object oldValue = getSpeciesSampleSortedWeight();
+ this.speciesSampleSortedWeight = speciesSampleSortedWeight;
+ firePropertyChange(PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT, oldValue, speciesSampleSortedWeight);
}
- public Float getSpeciesTotalHorsVracWeight() {
- return speciesTotalHorsVracWeight;
+ public Float getSpeciesTotalUnsortedWeight() {
+ return speciesTotalUnsortedWeight;
}
- public void setSpeciesTotalHorsVracWeight(Float speciesTotalHorsVracWeight) {
- Object oldValue = getSpeciesTotalHorsVracWeight();
- this.speciesTotalHorsVracWeight = speciesTotalHorsVracWeight;
- firePropertyChange(PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT, oldValue, speciesTotalHorsVracWeight);
+ public void setSpeciesTotalUnsortedWeight(Float speciesTotalUnsortedWeight) {
+ Object oldValue = getSpeciesTotalUnsortedWeight();
+ this.speciesTotalUnsortedWeight = speciesTotalUnsortedWeight;
+ firePropertyChange(PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT, oldValue, speciesTotalUnsortedWeight);
}
public Float getBenthosTotalWeight() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingRowModel.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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.AbstractTuttiBeanUIModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUI.jaxx 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUI.jaxx 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<GearShootingTabUIModel, GearShootingTabUIHandler>'>
<import>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/gearshooting/GearShootingTabUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.gearshooting;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyRowModel.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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.AbstractTuttiBeanUIModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.css 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.css 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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%
+ */
#hydrologyTable {
selectionMode: {ListSelectionModel.SINGLE_SELECTION};
selectionBackground: {null};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.jaxx 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUI.jaxx 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,3 +1,26 @@
+<!--
+ #%L
+ Tutti :: UI
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
<Table implements='fr.ifremer.tutti.ui.swing.TuttiUI<HydrologyTabUIModel, HydrologyTabUIHandler>'>
<import>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Lists;
import fr.ifremer.tutti.ui.swing.content.operation.EditFishingOperationUI;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/fishing/hydrology/HydrologyTabUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -1,5 +1,29 @@
package fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.collect.Maps;
import java.util.Map;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.css 2012-12-20 16:08:26 UTC (rev 98)
@@ -41,37 +41,37 @@
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesTotalVracWeightLabel {
- text: "tutti.label.catches.speciesTotalVracWeight";
- labelFor: {speciesTotalVracWeightField};
+#speciesTotalSortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalSortedWeight";
+ labelFor: {speciesTotalSortedWeightField};
}
-#speciesTotalVracWeightField {
- property: "speciesTotalVracWeight";
- model: {model.getSpeciesTotalVracWeight()};
+#speciesTotalSortedWeightField {
+ property: "speciesTotalSortedWeight";
+ model: {model.getSpeciesTotalSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesSampleVracWeightLabel {
- text: "tutti.label.catches.speciesSampleVracWeight";
- labelFor: {speciesSampleVracWeightField};
+#speciesSampleSortedWeightLabel {
+ text: "tutti.label.catches.speciesSampleSortedWeight";
+ labelFor: {speciesSampleSortedWeightField};
}
-#speciesSampleVracWeightField {
- property: "speciesSampleVracWeight";
- model: {model.getSpeciesSampleVracWeight()};
+#speciesSampleSortedWeightField {
+ property: "speciesSampleSortedWeight";
+ model: {model.getSpeciesSampleSortedWeight()};
useFloat: false;
numberPattern: {INT_6_DIGITS_PATTERN};
}
-#speciesTotalHorsVracWeightLabel {
- text: "tutti.label.catches.speciesTotalHorsVracWeight";
- labelFor: {speciesTotalHorsVracWeightField};
+#speciesTotalUnsortedWeightLabel {
+ text: "tutti.label.catches.speciesTotalUnsortedWeight";
+ labelFor: {speciesTotalUnsortedWeightField};
}
-#speciesTotalHorsVracWeightField {
- text: {getStringValue(model.getSpeciesTotalHorsVracWeight())};
+#speciesTotalUnsortedWeightField {
+ text: {getStringValue(model.getSpeciesTotalUnsortedWeight())};
editable: false;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUI.jaxx 2012-12-20 16:08:26 UTC (rev 98)
@@ -69,12 +69,12 @@
<BeanValidator id='validator' bean='model' errorTableModel='errorTableModel'
uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'>
<field name='speciesTotalWeight' component='speciesTotalWeightField'/>
- <field name='speciesTotalVracWeight'
- component='speciesTotalVracWeightField'/>
- <field name='speciesSampleVracWeight'
- component='speciesSampleVracWeightField'/>
- <field name='speciesTotalHorsVracWeight'
- component='speciesTotalHorsVracWeightField'/>
+ <field name='speciesTotalSortedWeight'
+ component='speciesTotalSortedWeightField'/>
+ <field name='speciesSampleSortedWeight'
+ component='speciesSampleSortedWeightField'/>
+ <field name='speciesTotalUnsortedWeight'
+ component='speciesTotalUnsortedWeightField'/>
</BeanValidator>
<SpeciesFrequencyUI id='frequencyEditor'
@@ -94,10 +94,10 @@
<NumberEditor id='speciesTotalWeightField' constructorParams='this'/>
</cell>
<cell anchor='west'>
- <JLabel id='speciesTotalVracWeightLabel'/>
+ <JLabel id='speciesTotalSortedWeightLabel'/>
</cell>
<cell weightx='1.0'>
- <NumberEditor id='speciesTotalVracWeightField'
+ <NumberEditor id='speciesTotalSortedWeightField'
constructorParams='this'/>
</cell>
</row>
@@ -105,17 +105,17 @@
<!-- Poids échantillonné vrac / Poids total hors vrac -->
<row>
<cell>
- <JLabel id='speciesSampleVracWeightLabel'/>
+ <JLabel id='speciesSampleSortedWeightLabel'/>
</cell>
<cell>
- <NumberEditor id='speciesSampleVracWeightField'
+ <NumberEditor id='speciesSampleSortedWeightField'
constructorParams='this'/>
</cell>
<cell>
- <JLabel id='speciesTotalHorsVracWeightLabel'/>
+ <JLabel id='speciesTotalUnsortedWeightLabel'/>
</cell>
<cell>
- <JTextField id='speciesTotalHorsVracWeightField'/>
+ <JTextField id='speciesTotalUnsortedWeightField'/>
</cell>
</row>
</Table>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIHandler.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -528,7 +528,6 @@
}
}
}
-
model.setRows(rows);
}
@@ -652,7 +651,8 @@
Float totalVrac = 0f;
for (SpeciesBatchRowModel batch : getModel().getRows()) {
- CaracteristicQualitativeValue vracHorsVrac = batch.getSortedUnsortedCategory();
+ CaracteristicQualitativeValue vracHorsVrac =
+ batch.getSortedUnsortedCategory();
if (vracHorsVrac == null) {
@@ -676,7 +676,7 @@
log.info("New total vrac / hors vrac: " +
totalVrac + " / " + totalHorsVrac);
}
- getModel().setSpeciesTotalHorsVracWeight(totalHorsVrac);
+ getModel().setSpeciesTotalUnsortedWeight(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/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/species/SpeciesBatchUIModel.java 2012-12-20 16:08:26 UTC (rev 98)
@@ -24,7 +24,6 @@
* #L%
*/
-import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
import fr.ifremer.tutti.ui.swing.content.operation.AbstractTuttiBatchUIModel;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
@@ -55,9 +54,9 @@
public SpeciesBatchUIModel(EditCatchesUIModel catchesUIModel) {
super(catchesUIModel,
EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_VRAC_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_HORS_VRAC_WEIGHT,
- EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_VRAC_WEIGHT);
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_SORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_TOTAL_UNSORTED_WEIGHT,
+ EditCatchesUIModel.PROPERTY_SPECIES_SAMPLE_SORTED_WEIGHT);
this.samplingTreeModel = new SpeciesBatchTreeModel();
}
@@ -69,28 +68,28 @@
catchesUIModel.setSpeciesTotalWeight(speciesTotalWeight);
}
- public Float getSpeciesTotalVracWeight() {
- return catchesUIModel.getSpeciesTotalVracWeight();
+ public Float getSpeciesTotalSortedWeight() {
+ return catchesUIModel.getSpeciesTotalSortedWeight();
}
- public void setSpeciesTotalVracWeight(Float speciesTotalVracWeight) {
- catchesUIModel.setSpeciesTotalVracWeight(speciesTotalVracWeight);
+ public void setSpeciesTotalSortedWeight(Float speciesTotalSortedWeight) {
+ catchesUIModel.setSpeciesTotalSortedWeight(speciesTotalSortedWeight);
}
- public Float getSpeciesSampleVracWeight() {
- return catchesUIModel.getSpeciesSampleVracWeight();
+ public Float getSpeciesSampleSortedWeight() {
+ return catchesUIModel.getSpeciesSampleSortedWeight();
}
- public void setSpeciesSampleVracWeight(Float speciesSampleVracWeight) {
- catchesUIModel.setSpeciesSampleVracWeight(speciesSampleVracWeight);
+ public void setSpeciesSampleSortedWeight(Float speciesSampleSortedWeight) {
+ catchesUIModel.setSpeciesSampleSortedWeight(speciesSampleSortedWeight);
}
- public Float getSpeciesTotalHorsVracWeight() {
- return catchesUIModel.getSpeciesTotalHorsVracWeight();
+ public Float getSpeciesTotalUnsortedWeight() {
+ return catchesUIModel.getSpeciesTotalUnsortedWeight();
}
- public void setSpeciesTotalHorsVracWeight(Float speciesTotalHorsVracWeight) {
- catchesUIModel.setSpeciesTotalHorsVracWeight(speciesTotalHorsVracWeight);
+ public void setSpeciesTotalUnsortedWeight(Float speciesTotalUnsortedWeight) {
+ catchesUIModel.setSpeciesTotalUnsortedWeight(speciesTotalUnsortedWeight);
}
public SpeciesBatchTreeModel getSamplingTreeModel() {
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 2012-12-20 15:31:40 UTC (rev 97)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2012-12-20 16:08:26 UTC (rev 98)
@@ -50,9 +50,9 @@
tutti.label.catches.macroWasteTotalWeight=Poids total
tutti.label.catches.planktonSampleTotalWeight=Poids total échantillonné
tutti.label.catches.planktonTotalWeight=Poids total
-tutti.label.catches.speciesSampleVracWeight=Poids total vrac échantillon
-tutti.label.catches.speciesTotalHorsVracWeight=Poids total hors vrac
-tutti.label.catches.speciesTotalVracWeight=Poids total vrac
+tutti.label.catches.speciesSampleSortedWeight=Poids total vrac échantillon
+tutti.label.catches.speciesTotalSortedWeight=Poids total vrac
+tutti.label.catches.speciesTotalUnsortedWeight=Poids total hors vrac
tutti.label.catches.speciesTotalWeight=Poids total
tutti.label.comment=Commentaire
tutti.label.cruise=Campagne
@@ -123,7 +123,7 @@
tutti.label.program.name=Nom
tutti.label.program.zone=Zone
tutti.label.protocol=Protocol de saisie
-tutti.label.species.speciesTotalHorsVracWeight=
+tutti.label.species.speciesTotalUnsortedWeight=
tutti.label.tab.accidentel=Captures accidentelles
tutti.label.tab.benthos=Benthos
tutti.label.tab.catches=Captures
1
0
r97 - trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence
by kmorin@users.forge.codelutin.com 20 Dec '12
by kmorin@users.forge.codelutin.com 20 Dec '12
20 Dec '12
Author: kmorin
Date: 2012-12-20 16:31:40 +0100 (Thu, 20 Dec 2012)
New Revision: 97
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/97
Log:
debug caracteristics put twice in the cache
Modified:
trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java
Modified: trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java
===================================================================
--- trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-12-20 15:02:18 UTC (rev 96)
+++ trunk/tutti-persistence-dev/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceDevFixtures.java 2012-12-20 15:31:40 UTC (rev 97)
@@ -247,14 +247,11 @@
createCaracteristicQuantitativeValue(ca, "Coup de vent");
createCaracteristicQuantitativeValue(ca, "Fort coup de vent");
- cache.put(Caracteristic.class, ca);
-
ca = createQuantitativeCaracteristic("Sea State",
CaracteristicEnum.FishingOperationEnvironment.name());
createCaracteristicQuantitativeValue(ca, "Mer calme");
createCaracteristicQuantitativeValue(ca, "Mer agitée");
- cache.put(Caracteristic.class, ca);
createNumberCaracteristic("Wind direction",
CaracteristicEnum.FishingOperationEnvironment.name());
1
0
r96 - in trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence: . spatial
by tchemit@users.forge.codelutin.com 20 Dec '12
by tchemit@users.forge.codelutin.com 20 Dec '12
20 Dec '12
Author: tchemit
Date: 2012-12-20 16:02:18 +0100 (Thu, 20 Dec 2012)
New Revision: 96
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/96
Log:
refs #1899: Cr?\195?\169er un ?\195?\169diteur de position spatiale (help to convert from sexagecimal to decimal)
Added:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/GeoPositionHelper.java
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/GeoPositionHelper.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/GeoPositionHelper.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/GeoPositionHelper.java 2012-12-20 15:02:18 UTC (rev 96)
@@ -0,0 +1,121 @@
+package fr.ifremer.tutti.persistence.spatial;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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%
+ */
+
+/**
+ * Helper about geo position computation.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class GeoPositionHelper {
+
+ /**
+ * Calcule le quadrant à partir d'une {@code longitude} et {@code latitude}.
+ *
+ * @param longitude la longitude décimale
+ * @param latitude la latitude décimale
+ * @return la valeur du quadrant ou {@code null} si l'une des deux
+ * coordonnées est {@code null}.
+ * @since 0.3
+ */
+ public static Integer getQuadrant(Float longitude, Float latitude) {
+ if (longitude == null || latitude == null) {
+ return null;
+ }
+ int result;
+
+ if (latitude > 0) {
+ result = longitude > 0 ? 1 : 4;
+ } else {
+ result = longitude > 0 ? 2 : 3;
+ }
+ return result;
+ }
+
+ /**
+ * Calcule la valeur signée de la longitude à partir du {@code quadrant} et
+ * de la valeur absolue de la {@code longitude}.
+ *
+ * @param quadrant la valeur du quandrant (peut être null)
+ * @param longitude la longitude décimale (peut être null)
+ * @return la valeur signée de la longitude ou {@code null} si l'une des
+ * deux données d'entrée est {@code null}.
+ * @since 0.3
+ */
+ public static Float getSignedLongitude(Integer quadrant, Float longitude) {
+ if (longitude == null) {
+ return null;
+ }
+ if (quadrant == null) {
+
+ // cas special ou pas encore de quadrant positionne, on conserve
+ // juste la valeur de la longitude sans rien faire d'autre
+ return longitude;
+ }
+ int result;
+ switch (quadrant) {
+ case 1:
+ case 2:
+ result = 1;
+ break;
+ default:
+ result = -1;
+ }
+ return result * longitude;
+ }
+
+ /**
+ * Calcule la valeur signée de la latitude à partir du {@code quadrant} et
+ * de la valeur absolue de la {@code latitude}.
+ *
+ * @param quadrant la valeur du quandrant (peut être null)
+ * @param latitude la longitude décimale (peut être null)
+ * @return la valeur signée de la latitude ou {@code null} si l'une des
+ * deux données d'entrée est {@code null}.
+ * @since 0.3
+ */
+ public static Float getSignedLatitude(Integer quadrant, Float latitude) {
+ if (latitude == null) {
+ return null;
+ }
+ if (quadrant == null) {
+
+ // cas special ou pas encore de quadrant positionne, on conserve
+ // juste la valeur de la latitude sans rien faire d'autre
+ return latitude;
+ }
+ int result;
+ switch (quadrant) {
+ case 1:
+ case 4:
+ result = 1;
+ break;
+ default:
+ result = -1;
+ }
+ return result * latitude;
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/GeoPositionHelper.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java (rev 0)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java 2012-12-20 15:02:18 UTC (rev 96)
@@ -0,0 +1,235 @@
+package fr.ifremer.tutti.persistence.spatial;
+
+/*
+ * #%L
+ * Tutti :: Persistence API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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 org.apache.commons.lang3.ObjectUtils;
+
+import java.io.Serializable;
+
+/**
+ * Define a geo spatial position coordinate in degre, minute, second.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class SexagecimalPosition implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected boolean sign;
+
+ protected Integer degre;
+
+ protected Integer minute;
+
+ protected Integer seconde;
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimal la valeur au format decimal
+ * @return une nouvelle instance de position convertie
+ */
+ public static SexagecimalPosition valueOf(Float decimal) {
+ SexagecimalPosition r = new SexagecimalPosition();
+ r.update(decimal);
+ return r;
+ }
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * degre-minute-seconde.
+ *
+ * @param d la valeur des degres
+ * @param m la valeur des minutes
+ * @param s la valeur des secondes
+ * @return une nouvelle instance de position convertie
+ */
+ public static SexagecimalPosition valueOf(boolean sign, int d, int m, int s) {
+ SexagecimalPosition r = new SexagecimalPosition();
+ r.setSign(sign);
+ r.setDegre(d);
+ r.setMinute(m);
+ r.setSeconde(s);
+ return r;
+ }
+
+ /**
+ * @return {@code true} si aucune composante n'est renseigné,
+ * {@code false} autrement.
+ */
+ public boolean isNull() {
+ return degre == null && minute == null && seconde == null;
+ }
+
+ /**
+ * Mets a jour les composants de la position a partir d'une valeur decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimal la valeur decimale a convertir (qui peut etre nulle).
+ */
+ public void update(Float decimal) {
+ Integer d = null;
+ Integer m = null;
+ Integer s = null;
+ boolean si = false;
+ if (decimal != null) {
+ si = decimal < 0;
+
+ decimal = Math.abs(decimal);
+ int remain = 0;
+
+ d = (int) (Math.round(decimal + 0.5) - 1);
+ m = 0;
+ s = 0;
+ decimal = 60 * (decimal - d);
+ if (decimal > 0) {
+ m = (int) (Math.round(decimal + 0.5) - 1);
+ decimal = 60 * (decimal - m);
+ if (decimal > 0) {
+ s = (int) (Math.round(decimal + 0.5) - 1);
+ remain = (int) (10 * (decimal - s));
+ }
+ }
+ if (remain > 9) {
+ s++;
+ }
+ if (s == 60) {
+ m++;
+ s = 0;
+ }
+ if (m == 60) {
+ d++;
+ m = 0;
+ }
+ }
+ degre = d;
+ minute = m;
+ seconde = s;
+ sign = si;
+ }
+
+ public Float toDecimal() {
+ if (isNull()) {
+ return null;
+ }
+ Integer d = degre == null ? 0 : degre;
+ Integer m = minute == null ? 0 : minute;
+ Integer s = seconde == null ? 0 : seconde;
+ Float result = Float.valueOf(d);
+ if (m > 0) {
+ result += (float) m / 60;
+ if (s == 0) {
+ result += 0.5f / 3600;
+ }
+ }
+ if (s > 0) {
+ result += ((float) s + 0.5f) / 3600;
+ }
+ if (sign) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public Integer getDegre() {
+ return degre;
+ }
+
+ public Integer getMinute() {
+ return minute;
+ }
+
+ public Integer getSeconde() {
+ return seconde;
+ }
+
+ public boolean isSign() {
+ return sign;
+ }
+
+ public void setDegre(Integer degre) {
+ this.degre = degre;
+ }
+
+ public void setMinute(Integer minute) {
+ this.minute = minute;
+ }
+
+ public void setSeconde(Integer seconde) {
+ this.seconde = seconde;
+ }
+
+ public void setSign(boolean sign) {
+ this.sign = sign;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ SexagecimalPosition other = (SexagecimalPosition) obj;
+ return sign == other.sign &&
+ ObjectUtils.equals(degre, other) &&
+ ObjectUtils.equals(minute, other.minute) &&
+ ObjectUtils.equals(seconde, other.seconde);
+
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + "<" + (sign ? "-" : "") + degre + "° " + minute + "' " + seconde + "''>";
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 5 * (sign ? 1 : 0);
+ hash = 7 * hash + (degre != null ? degre.hashCode() : 0);
+ hash = 11 * hash + (minute != null ? minute.hashCode() : 0);
+ hash = 13 * hash + (seconde != null ? seconde.hashCode() : 0);
+ return hash;
+ }
+
+ protected SexagecimalPosition() {
+ // contructeur non publique, on prefere l'utilisation de la methode
+ // #valueOf()
+ }
+}
Property changes on: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
20 Dec '12
Author: tchemit
Date: 2012-12-20 15:46:40 +0100 (Thu, 20 Dec 2012)
New Revision: 95
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/95
Log:
fix fishing operation caracteristic map
Modified:
trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
===================================================================
(Binary files differ)
1
0