From kmorin@users.forge.codelutin.com Fri May  3 17:49:20 2013
From: kmorin@users.forge.codelutin.com
To: tutti-commits@list.forge.codelutin.com
Subject: [Tutti-commits] r917 - in trunk:
	tutti-persistence/src/main/java/fr/ifremer/tutti/persistence
	tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service
	tutti-persistence/src/main/resources tutti-persistence/src/main/xmi
	tutti-service/src/main/java/fr/ifremer/tutti/service
	tutti-ui-swing/src/main/filtered-resources
	tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise	
 =?utf-8?q?tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/op?=
 =?utf-8?q?eration/catches/benthos?=	tutti-ui-swing/src/main/re
Date: Fri, 03 May 2013 17:49:20 +0200
Message-ID: <20130503154920.3F14815971@nuiton.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4615641587317024220=="

--===============4615641587317024220==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Author: kmorin
Date: 2013-05-03 17:49:20 +0200 (Fri, 03 May 2013)
New Revision: 917

Url: http://forge.codelutin.com/projects/tutti/repository/revisions/917

Log:
fixes #1830 [REFERENTIEL] - Engins de pr?\195?\169l?\195?\168vement

Added:
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/EditGearCaracteristicsAction.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorRowModel.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorTableModel.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorUI.css
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorUI.jaxx
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorUIHandler.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/GearCaracteristicsEditorUIModel.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/ViewGearCaracteristicsAction.java
Modified:
   trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPe=
rsistence.java
   trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPe=
rsistenceImpl.java
   trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiPe=
rsistenceNoDbImpl.java
   trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service=
/CruisePersistenceService.java
   trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service=
/CruisePersistenceServiceImpl.java
   trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
   trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
   trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceServ=
ice.java
   trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties
   trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/EditCruiseUI.css
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/EditCruiseUI.jaxx
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruis=
e/EditCruiseUIHandler.java
   trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/opera=
tion/catches/benthos/BenthosBatchUI.jaxx
   trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properti=
es
   trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properti=
es

Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/=
TuttiPersistence.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistence.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistence.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -24,6 +24,7 @@
  * #L%
  */
=20
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
 import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
 import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -399,6 +400,11 @@
     @Transactional(readOnly =3D false)
     Cruise saveCruise(Cruise bean);
=20
+    Gear getGearWithCaracteristics(Gear gear, Cruise cruise);
+
+    @Transactional(readOnly =3D false)
+    void saveGearCaracteristics(Gear gear, Cruise cruise);
+
     //----------------------------------------------------------------------=
--//
     //-- Protocol methods                                                   =
--//
     //----------------------------------------------------------------------=
--//

Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/=
TuttiPersistenceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceImpl.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceImpl.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -26,6 +26,7 @@
=20
 import com.google.common.collect.Maps;
 import fr.ifremer.adagio.core.service.technical.CacheService;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
 import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
 import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -508,6 +509,16 @@
         return cruiseService.saveCruise(bean);
     }
=20
+    @Override
+    public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
+        return cruiseService.getGearWithCaracteristics(gear, cruise);
+    }
+
+    @Override
+    public void saveGearCaracteristics(Gear gear, Cruise cruise) {
+        cruiseService.saveGearCaracteristics(gear, cruise);
+    }
+
     //----------------------------------------------------------------------=
--//
     //-- Protocol methods                                                   =
--//
     //----------------------------------------------------------------------=
--//

Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/=
TuttiPersistenceNoDbImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceNoDbImpl.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/TuttiP=
ersistenceNoDbImpl.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -24,6 +24,7 @@
  * #L%
  */
=20
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
 import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
 import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -327,6 +328,16 @@
     }
=20
     @Override
+    public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
+        throw notImplemented();
+    }
+
+    @Override
+    public void saveGearCaracteristics(Gear gear, Cruise cruise) {
+        throw notImplemented();
+    }
+
+    @Override
     public List<String> getAllProtocolNames() {
         throw notImplemented();
     }

Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/=
service/CruisePersistenceService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/servic=
e/CruisePersistenceService.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/servic=
e/CruisePersistenceService.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -25,7 +25,9 @@
  */
=20
 import fr.ifremer.tutti.persistence.TuttiPersistenceServiceImplementor;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.data.Cruise;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
 import org.springframework.transaction.annotation.Transactional;
=20
 import java.util.List;
@@ -48,4 +50,9 @@
=20
     @Transactional(readOnly =3D false)
     Cruise saveCruise(Cruise bean);
+
+    Gear getGearWithCaracteristics(Gear gear, Cruise cruise);
+
+    @Transactional(readOnly =3D false)
+    void saveGearCaracteristics(Gear gear, Cruise cruise);
 }

Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/=
service/CruisePersistenceServiceImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/servic=
e/CruisePersistenceServiceImpl.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/servic=
e/CruisePersistenceServiceImpl.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -32,6 +32,7 @@
 import fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramImpl;
 import fr.ifremer.adagio.core.dao.administration.user.PersonDao;
 import fr.ifremer.adagio.core.dao.administration.user.PersonImpl;
+import fr.ifremer.adagio.core.dao.data.measure.GearPhysicalMeasurement;
 import fr.ifremer.adagio.core.dao.data.measure.SurveyMeasurement;
 import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.FishingTrip;
 import fr.ifremer.adagio.core.dao.data.survey.fishingTrip.ObservedFishingTri=
p;
@@ -50,20 +51,15 @@
 import fr.ifremer.adagio.core.dao.referential.location.Location;
 import fr.ifremer.adagio.core.dao.referential.location.LocationDao;
 import fr.ifremer.adagio.core.dao.referential.location.LocationImpl;
-import fr.ifremer.adagio.core.dao.referential.pmfm.Pmfm;
-import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmDao;
-import fr.ifremer.adagio.core.dao.referential.pmfm.PmfmImpl;
-import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueDao;
-import fr.ifremer.adagio.core.dao.referential.pmfm.QualitativeValueImpl;
+import fr.ifremer.adagio.core.dao.referential.pmfm.*;
 import fr.ifremer.adagio.core.dao.technical.synchronization.SynchronizationS=
tatus;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.TuttiBeanFactory;
+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.data.Program;
-import fr.ifremer.tutti.persistence.entities.referential.Gear;
-import fr.ifremer.tutti.persistence.entities.referential.Person;
-import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
-import fr.ifremer.tutti.persistence.entities.referential.Vessel;
+import fr.ifremer.tutti.persistence.entities.referential.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -74,13 +70,9 @@
 import org.springframework.stereotype.Service;
=20
 import javax.annotation.Resource;
+import java.io.Serializable;
 import java.text.MessageFormat;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
=20
 /**
  * @author tchemit <chemit@codelutin.com>
@@ -487,6 +479,126 @@
                 role);
     }
=20
+    public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
+        Preconditions.checkNotNull(cruise);
+        Preconditions.checkNotNull(cruise.getId(), "Cruise 'id' must not be =
null or empty");
+        Preconditions.checkNotNull(gear);
+        Preconditions.checkNotNull(gear.getId(), "Gear 'id' must not be null=
 or empty");
+
+        CaracteristicMap result =3D new CaracteristicMap();
+
+        Iterator<GearPhysicalMeasurement> list =3D queryListTyped(
+                "gearCaracteristics",
+                "cruiseId", IntegerType.INSTANCE, cruise.getIdAsInt(),
+                "gearId", IntegerType.INSTANCE, gear.getIdAsInt());
+
+        while (list.hasNext()) {
+            GearPhysicalMeasurement measurement =3D list.next();
+
+            Integer pmfmId =3D measurement.getPmfm().getId();
+            if (!enumeration.PMFM_ID_MULTIRIG_NUMBER.equals(pmfmId)) {
+                Caracteristic caracteristic =3D referentialService.getCaract=
eristic(pmfmId);
+
+                Serializable value =3D null;
+                switch (caracteristic.getCaracteristicType()) {
+                    case NUMBER:
+                        value =3D measurement.getNumericalValue();
+                        break;
+                    case QUALITATIVE:
+                        QualitativeValue qualitativeValue =3D measurement.ge=
tQualitativeValue();
+                        if (qualitativeValue !=3D null) {
+                            value =3D TuttiEntities.getQualitativeValue(cara=
cteristic,
+                                                                      qualit=
ativeValue.getId());
+                        }
+                        break;
+                    case TEXT:
+                        value =3D measurement.getAlphanumericalValue();
+                        break;
+                }
+                result.put(caracteristic, value);
+            }
+        }
+
+        gear.setCaracteristics(result);
+        return gear;
+    }
+
+    public void saveGearCaracteristics(Gear gear, Cruise cruise) {
+        Preconditions.checkNotNull(cruise);
+        Preconditions.checkNotNull(cruise.getId(), "Cruise 'id' must not be =
null or empty");
+        Preconditions.checkNotNull(gear);
+        Preconditions.checkNotNull(gear.getId(), "Gear 'id' must not be null=
 or empty");
+
+        ScientificCruise scientificCruise =3D scientificCruiseDao.load(cruis=
e.getIdAsInt());
+        if (scientificCruise =3D=3D null) {
+            throw new DataRetrievalFailureException("Could not retrieve crui=
se with id=3D" + cruise.getId());
+        }
+
+        // Retrieve entities : FishingTrip
+        ObservedFishingTrip fishingTrip =3D (ObservedFishingTrip) scientific=
Cruise.getFishingTrips().iterator().next();
+        Preconditions.checkNotNull(fishingTrip);
+
+        List<Integer> measurementsToRemove =3D Lists.newArrayList();
+
+        GearPhysicalFeatures gpf =3D gearPhysicalFeaturesDao.getGearPhysical=
features(fishingTrip, gear.getIdAsInt(), true);
+        if (gpf.getGearPhysicalMeasurements() !=3D null) {
+            for (GearPhysicalMeasurement measurement : gpf.getGearPhysicalMe=
asurements()) {
+                Integer pmfmId =3D measurement.getPmfm().getId();
+                if (!enumeration.PMFM_ID_MULTIRIG_NUMBER.equals(pmfmId)) {
+                    measurementsToRemove.add(pmfmId);
+                }
+            }
+        }
+
+        CaracteristicMap caracteristicMap =3D gear.getCaracteristics();
+        if (caracteristicMap !=3D null) {
+            for (Caracteristic caracteristic : caracteristicMap.keySet()) {
+
+                Float numericalValue =3D null;
+                String alphanumericalValue =3D null;
+                Integer qualitativeValue =3D null;
+                Object value =3D caracteristicMap.get(caracteristic);
+
+                switch (caracteristic.getCaracteristicType()) {
+                    case NUMBER:
+                        numericalValue =3D (Float) value;
+                        break;
+
+                    case QUALITATIVE:
+                        Integer qvId =3D null;
+                        if (value instanceof CaracteristicQualitativeValue) {
+                            qvId =3D Integer.valueOf(((CaracteristicQualitat=
iveValue) value).getId());
+                        } else if (value instanceof Integer) {
+                            qvId =3D (Integer) value;
+                        }
+                        qualitativeValue =3D qvId;
+                        break;
+
+                    case TEXT:
+                        alphanumericalValue =3D (String) value;
+                        break;
+                }
+
+                GearPhysicalMeasurement gearPhysicalMeasurement =3D
+                        gearPhysicalFeaturesDao.setGearPhysicalMeasurement(s=
cientificCruise,
+                                                                           g=
pf,
+                                                                           c=
aracteristic.getIdAsInt(),
+                                                                           n=
umericalValue,
+                                                                           a=
lphanumericalValue,
+                                                                           q=
ualitativeValue);
+
+                measurementsToRemove.remove(gearPhysicalMeasurement.getPmfm(=
).getId());
+            }
+        }
+
+        for (Integer pmfmId : measurementsToRemove) {
+            gearPhysicalFeaturesDao.removeGearPhysicalMeasurement(gpf, pmfmI=
d);
+        }
+
+        gearPhysicalFeaturesDao.update(gpf);
+
+    }
+
     // adapt to surveyMeasurement
     protected SurveyMeasurement getOrCreateSurveyMeasurement(FishingTrip fis=
hingTrip,
                                                              Integer pmfmId)=
 {

Modified: trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml	2013-=
05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-persistence/src/main/resources/queries-override.hbm.xml	2013-=
05-03 15:49:20 UTC (rev 917)
@@ -152,9 +152,9 @@
     <![CDATA[
     SELECT
       gpf.gear.id AS gearId,
-      MAX(CASE gpm.pmfm.id=20
+      MAX(CASE gpm.pmfm.id
       	      WHEN :pmfmIdTrawlNet THEN gpm.numericalValue
-      	      ELSE 0=20
+      	      ELSE 0
       	  END) as trawlNet,
       count(o.id) as operationCount
     FROM
@@ -165,7 +165,7 @@
       LEFT OUTER JOIN gpf.operations o
     WHERE
       sc.id =3D :cruiseId
-    GROUP BY=20
+    GROUP BY
   	  gpf.gear.id
     ORDER BY count(o.id) DESC
     ]]>
@@ -173,6 +173,24 @@
     <query-param name=3D"pmfmIdTrawlNet" type=3D"java.lang.Integer"/>
   </query>
=20
+  <query cacheable=3D"true" name=3D"gearCaracteristics">
+    <![CDATA[
+    SELECT
+      gpm
+    FROM
+      ScientificCruiseImpl sc
+      JOIN sc.fishingTrips ft
+      JOIN ft.gearPhysicalFeatures gpf
+      LEFT OUTER JOIN gpf.gearPhysicalMeasurements gpm
+    WHERE
+      sc.id =3D :cruiseId
+        AND
+      gpf.gear.id =3D :gearId
+    ]]>
+    <query-param name=3D"cruiseId" type=3D"java.lang.Integer"/>
+    <query-param name=3D"gearId" type=3D"java.lang.Integer"/>
+  </query>
+
   <query cacheable=3D"true" name=3D"allCruiseSecondaryVessels">
     <![CDATA[
     SELECT

Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)

Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/Persiste=
nceService.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceSer=
vice.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceSer=
vice.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -31,6 +31,7 @@
 import fr.ifremer.tutti.persistence.TuttiPersistence;
 import fr.ifremer.tutti.persistence.TuttiPersistenceNoDbImpl;
 import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
 import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch;
 import fr.ifremer.tutti.persistence.entities.data.AttachementObjectTypeEnum;
 import fr.ifremer.tutti.persistence.entities.data.Attachment;
@@ -590,6 +591,16 @@
         return driver.saveCruise(bean);
     }
=20
+    @Override
+    public Gear getGearWithCaracteristics(Gear gear, Cruise cruise) {
+        return driver.getGearWithCaracteristics(gear, cruise);
+    }
+
+    @Override
+    public void saveGearCaracteristics(Gear gear, Cruise cruise) {
+        driver.saveGearCaracteristics(gear, cruise);
+    }
+
     //----------------------------------------------------------------------=
--//
     //-- Protocol methods                                                   =
--//
     //----------------------------------------------------------------------=
--//

Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.prop=
erties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties=
	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-en.properties=
	2013-05-03 15:49:20 UTC (rev 917)
@@ -1,5 +1,5 @@
 #Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Apr 26 18:46:10 CEST 2013
+#Tue Apr 30 17:57:05 CEST 2013
 tutti.config.help=3Dconfig.html
 tutti.createAccidentalBatch.action.cancel.help=3DcreateAccidentalBatch.html\=
#actions
 tutti.createAccidentalBatch.action.save.help=3DcreateAccidentalBatch.html\#a=
ctions
@@ -105,8 +105,10 @@
 tutti.editCatchBatch.field.speciesTotalWeight.help=3DeditCatchBatch.html\#fi=
elds
 tutti.editCatchBatch.help=3DeditCatchBatch.html
 tutti.editCruise.action.close.help=3DeditCruise.html\#actions
+tutti.editCruise.action.editGearCaracteristics.help=3D
 tutti.editCruise.action.generateName.help=3DeditCruise.html\#actions
 tutti.editCruise.action.save.help=3DeditCruise.html\#actions
+tutti.editCruise.action.viewGearCaracteristics.help=3D
 tutti.editCruise.field.beginDate.help=3DeditCruise.html\#fields
 tutti.editCruise.field.comment.help=3DeditCruise.html\#fields
 tutti.editCruise.field.country.help=3DeditCruise.html\#fields

Modified: trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.prop=
erties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties=
	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/filtered-resources/tutti-help-fr.properties=
	2013-05-03 15:49:20 UTC (rev 917)
@@ -1,5 +1,5 @@
 #Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
-#Fri Apr 26 18:46:10 CEST 2013
+#Tue Apr 30 17:57:05 CEST 2013
 tutti.config.help=3Dconfig.html
 tutti.createAccidentalBatch.action.cancel.help=3DcreateAccidentalBatch.html\=
#actions
 tutti.createAccidentalBatch.action.save.help=3DcreateAccidentalBatch.html\#a=
ctions
@@ -105,8 +105,10 @@
 tutti.editCatchBatch.field.speciesTotalWeight.help=3DeditCatchBatch.html\#fi=
elds
 tutti.editCatchBatch.help=3DeditCatchBatch.html
 tutti.editCruise.action.close.help=3DeditCruise.html\#actions
+tutti.editCruise.action.editGearCaracteristics.help=3D
 tutti.editCruise.action.generateName.help=3DeditCruise.html\#actions
 tutti.editCruise.action.save.help=3DeditCruise.html\#actions
+tutti.editCruise.action.viewGearCaracteristics.help=3D
 tutti.editCruise.field.beginDate.help=3DeditCruise.html\#fields
 tutti.editCruise.field.comment.help=3DeditCruise.html\#fields
 tutti.editCruise.field.country.help=3DeditCruise.html\#fields

Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/conten=
t/cruise/EditCruiseUI.css
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUI.css	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUI.css	2013-05-03 15:49:20 UTC (rev 917)
@@ -50,8 +50,25 @@
   _selectOnFocus: {true};
 }
=20
+#editGearCaracteristicsItem {
+  actionIcon: edit;
+  text: "tutti.editCruise.action.editGearCaracteristics";
+  toolTipText: "tutti.editCruise.action.editGearCaracteristics.tip";
+  _tuttiAction: {EditGearCaracteristicsAction.class};
+  _help: {"tutti.editCruise.action.editGearCaracteristics.help"};
+}
+
+#viewGearCaracteristicsItem {
+  actionIcon: show-frequency;
+  text: "tutti.editCruise.action.viewGearCaracteristics";
+  toolTipText: "tutti.editCruise.action.viewGearCaracteristics.tip";
+  _tuttiAction: {ViewGearCaracteristicsAction.class};
+  _help: {"tutti.editCruise.action.viewGearCaracteristics.help"};
+}
+
 #editCruiseTopPanel {
   _help: {"tutti.editCruise.help"};
+  layout:{mainPanelLayout};
 }
=20
 #cruiseScrollPane {
@@ -278,4 +295,8 @@
=20
 #attachmentsButton {
   enabled: {model.getId() !=3D null};
+}
+
+#gearCaracteristicsEditorTitledPanel {
+  title: "tutti.editCruise.gearCaracteristics.title";
 }
\ No newline at end of file

Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/conten=
t/cruise/EditCruiseUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUI.jaxx	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUI.jaxx	2013-05-03 15:49:20 UTC (rev 917)
@@ -21,7 +21,7 @@
   <http://www.gnu.org/licenses/gpl-3.0.html>.
   #L%
   -->
-<JPanel id=3D'editCruiseTopPanel' layout=3D'{new BorderLayout()}' decorator=
=3D'help'
+<JPanel id=3D'editCruiseTopPanel' decorator=3D'help'
         implements=3D'fr.ifremer.tutti.ui.swing.util.TuttiUI&lt;EditCruiseUI=
Model, EditCruiseUIHandler&gt;'>
=20
   <import>
@@ -38,8 +38,10 @@
     jaxx.runtime.swing.editor.NumberEditor
     jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
     jaxx.runtime.swing.editor.bean.BeanDoubleList
+    jaxx.runtime.swing.CardLayout2Ext
=20
     org.jdesktop.swingx.JXDatePicker
+    org.jdesktop.swingx.JXTitledPanel
=20
     javax.swing.JSeparator
     javax.swing.SwingConstants
@@ -84,6 +86,9 @@
     <field name=3D'comment' component=3D'commentPane'/>
   </BeanValidator>
=20
+  <CardLayout2Ext id=3D'mainPanelLayout'
+                  constructorParams=3D'this, "editCruiseTopPanel"'/>
+
   <TuttiHelpBroker id=3D'broker'
                    constructorParams=3D'"tutti.editCruise.help"'/>
=20
@@ -92,156 +97,171 @@
                       constructorParams=3D'getHandler().getContext(), getMod=
el()'/>
   </JToolBar>
=20
-  <JScrollPane id=3D'cruiseScrollPane' constraints=3D'BorderLayout.CENTER'>
-    <Table fill=3D'both'>
+  <JPopupMenu id=3D'gearMenuPopup'>
+    <JMenuItem id=3D'editGearCaracteristicsItem'/>
+    <JMenuItem id=3D'viewGearCaracteristicsItem'/>
+  </JPopupMenu>
=20
-      <!-- cruise program / survey part -->
-      <row>
-        <cell anchor=3D'west'>
-          <JLabel id=3D'programLabel'/>
-        </cell>
-        <cell weightx=3D'0.3'>
-          <BeanFilterableComboBox id=3D'programComboBox' constructorParams=
=3D'this'
-                                  genericType=3D'Program'/>
-        </cell>
-        <cell>
-          <JLabel id=3D'surveyPartLabel'/>
-        </cell>
-        <cell weightx=3D'0.3'>
-          <JTextField id=3D'surveyPartField'
-                      onKeyReleased=3D'handler.setText(event, "surveyPart")'=
/>
-        </cell>
-      </row>
+  <JPanel layout=3D'{new BorderLayout()}'
+          constraints=3D'EditCruiseUIHandler.CRUISE_CARD'>
+    <JScrollPane id=3D'cruiseScrollPane' constraints=3D'BorderLayout.CENTER'>
+      <Table fill=3D'both'>
=20
-      <!-- departure harbour / begin date -->
-      <row>
-        <cell anchor=3D'west'>
-          <JLabel id=3D'departureLocationLabel'/>
-        </cell>
-        <cell>
-          <BeanFilterableComboBox id=3D'departureLocationComboBox'
-                                  constructorParams=3D'this'
-                                  genericType=3D'TuttiLocation'/>
-        </cell>
-        <cell>
-          <JLabel id=3D'beginDateLabel'/>
-        </cell>
-        <cell>
-          <JXDatePicker id=3D'beginDateField'
-                        onActionPerformed=3D'handler.setDate(event, "beginDa=
te")'/>
-        </cell>
-      </row>
+        <!-- cruise program / survey part -->
+        <row>
+          <cell anchor=3D'west'>
+            <JLabel id=3D'programLabel'/>
+          </cell>
+          <cell weightx=3D'0.3'>
+            <BeanFilterableComboBox id=3D'programComboBox' constructorParams=
=3D'this'
+                                    genericType=3D'Program'/>
+          </cell>
+          <cell>
+            <JLabel id=3D'surveyPartLabel'/>
+          </cell>
+          <cell weightx=3D'0.3'>
+            <JTextField id=3D'surveyPartField'
+                        onKeyReleased=3D'handler.setText(event, "surveyPart"=
)'/>
+          </cell>
+        </row>
=20
-      <!-- landing harbour / end date -->
-      <row>
-        <cell anchor=3D'west'>
-          <JLabel id=3D'returnLocationLabel'/>
-        </cell>
-        <cell>
-          <BeanFilterableComboBox id=3D'returnLocationComboBox'
-                                  constructorParams=3D'this'
-                                  genericType=3D'TuttiLocation'/>
-        </cell>
-        <cell>
-          <JLabel id=3D'endDateLabel'/>
-        </cell>
-        <cell>
-          <JXDatePicker id=3D'endDateField'
-                        onActionPerformed=3D'handler.setDate(event, "endDate=
")'/>
-        </cell>
-      </row>
+        <!-- departure harbour / begin date -->
+        <row>
+          <cell anchor=3D'west'>
+            <JLabel id=3D'departureLocationLabel'/>
+          </cell>
+          <cell>
+            <BeanFilterableComboBox id=3D'departureLocationComboBox'
+                                    constructorParams=3D'this'
+                                    genericType=3D'TuttiLocation'/>
+          </cell>
+          <cell>
+            <JLabel id=3D'beginDateLabel'/>
+          </cell>
+          <cell>
+            <JXDatePicker id=3D'beginDateField'
+                          onActionPerformed=3D'handler.setDate(event, "begin=
Date")'/>
+          </cell>
+        </row>
=20
-      <!-- cruise name / multirigNumber -->
-      <row>
-        <cell>
-          <JLabel id=3D'nameLabel'/>
-        </cell>
-        <cell>
-          <JTextField id=3D'nameField'
-                      onKeyReleased=3D'handler.setText(event, "name")'/>
-        </cell>
-        <cell columns=3D'2'>
-          <JButton id=3D'generateNameButton'
-                   onActionPerformed=3D'handler.generateCampaignName()'/>
-        </cell>
-      </row>
+        <!-- landing harbour / end date -->
+        <row>
+          <cell anchor=3D'west'>
+            <JLabel id=3D'returnLocationLabel'/>
+          </cell>
+          <cell>
+            <BeanFilterableComboBox id=3D'returnLocationComboBox'
+                                    constructorParams=3D'this'
+                                    genericType=3D'TuttiLocation'/>
+          </cell>
+          <cell>
+            <JLabel id=3D'endDateLabel'/>
+          </cell>
+          <cell>
+            <JXDatePicker id=3D'endDateField'
+                          onActionPerformed=3D'handler.setDate(event, "endDa=
te")'/>
+          </cell>
+        </row>
=20
-      <!-- cruise name / multirigNumber -->
-      <row>
-        <cell>
-          <JLabel id=3D'multirigNumberLabel'/>
-        </cell>
-        <cell>
-          <NumberEditor id=3D'multirigNumberField' constructorParams=3D'this=
'/>
-        </cell>
-        <cell columns=3D"2">
-          <JLabel/>
-        </cell>
-      </row>
+        <!-- cruise name / multirigNumber -->
+        <row>
+          <cell>
+            <JLabel id=3D'nameLabel'/>
+          </cell>
+          <cell>
+            <JTextField id=3D'nameField'
+                        onKeyReleased=3D'handler.setText(event, "name")'/>
+          </cell>
+          <cell columns=3D'2'>
+            <JButton id=3D'generateNameButton'
+                     onActionPerformed=3D'handler.generateCampaignName()'/>
+          </cell>
+        </row>
=20
-      <!-- cruise vessel / gear -->
-      <row>
-        <cell columns=3D'4'>
-          <JSeparator constructorParams=3D'SwingConstants.HORIZONTAL'/>
-        </cell>
-      </row>
-      <row>
-        <cell columns=3D'4'>
-          <JPanel id=3D'vesselFilterPane'>
-            <JLabel id=3D'filterVesselLabel'/>
-            <JRadioButton id=3D'filterVesselAllButton'
-                          onActionPerformed=3D'model.setVesselType(VesselTyp=
eEnum.ALL)'/>
-            <JRadioButton id=3D'filterVesselScientificButton'
-                          onActionPerformed=3D'model.setVesselType(VesselTyp=
eEnum.SCIENTIFIC)'/>
-            <JRadioButton id=3D'filterVesselFishingButton'
-                          onActionPerformed=3D'model.setVesselType(VesselTyp=
eEnum.FISHING)'/>
-          </JPanel>
-        </cell>
-      </row>
-      <row>
-        <cell>
-          <JLabel id=3D'vesselLabel'/>
-        </cell>
-        <cell columns=3D"3">
-          <BeanFilterableComboBox id=3D'vesselComboBox' constructorParams=3D=
'this'
-                                  genericType=3D'Vessel'/>
+        <!-- cruise name / multirigNumber -->
+        <row>
+          <cell>
+            <JLabel id=3D'multirigNumberLabel'/>
+          </cell>
+          <cell>
+            <NumberEditor id=3D'multirigNumberField' constructorParams=3D'th=
is'/>
+          </cell>
+          <cell columns=3D"2">
+            <JLabel/>
+          </cell>
+        </row>
=20
-        </cell>
-      </row>
-      <row weighty=3D'0.3'>
-        <cell columns=3D"4">
-          <BeanDoubleList id=3D'gearList' genericType=3D'Gear'/>
-        </cell>
-      </row>
+        <!-- cruise vessel / gear -->
+        <row>
+          <cell columns=3D'4'>
+            <JSeparator constructorParams=3D'SwingConstants.HORIZONTAL'/>
+          </cell>
+        </row>
+        <row>
+          <cell columns=3D'4'>
+            <JPanel id=3D'vesselFilterPane'>
+              <JLabel id=3D'filterVesselLabel'/>
+              <JRadioButton id=3D'filterVesselAllButton'
+                            onActionPerformed=3D'model.setVesselType(VesselT=
ypeEnum.ALL)'/>
+              <JRadioButton id=3D'filterVesselScientificButton'
+                            onActionPerformed=3D'model.setVesselType(VesselT=
ypeEnum.SCIENTIFIC)'/>
+              <JRadioButton id=3D'filterVesselFishingButton'
+                            onActionPerformed=3D'model.setVesselType(VesselT=
ypeEnum.FISHING)'/>
+            </JPanel>
+          </cell>
+        </row>
+        <row>
+          <cell>
+            <JLabel id=3D'vesselLabel'/>
+          </cell>
+          <cell columns=3D"3">
+            <BeanFilterableComboBox id=3D'vesselComboBox' constructorParams=
=3D'this'
+                                    genericType=3D'Vessel'/>
=20
-      <!-- cruise headOfMission / headOfSortRoom -->
-      <row weighty=3D'0.3'>
-        <cell columns=3D'4'>
-          <JPanel layout=3D'{new GridLayout(1, 0)}'>
-            <BeanDoubleList id=3D'headOfMissionList' genericType=3D'Person'/>
-            <BeanDoubleList id=3D'headOfSortRoomList' genericType=3D'Person'=
/>
-          </JPanel>
-        </cell>
-      </row>
+          </cell>
+        </row>
+        <row weighty=3D'0.3'>
+          <cell columns=3D"4">
+            <BeanDoubleList id=3D'gearList' genericType=3D'Gear'/>
+          </cell>
+        </row>
=20
-      <!-- cruise comment -->
-      <row weighty=3D'0.3'>
-        <cell columns=3D'4'>
-          <JScrollPane id=3D'commentPane'
-                       onFocusGained=3D'commentField.requestFocus()'>
-            <JTextArea id=3D'commentField'
-                       onKeyReleased=3D'handler.setText(event, "comment")'/>
-          </JScrollPane>
-        </cell>
-      </row>
+        <!-- cruise headOfMission / headOfSortRoom -->
+        <row weighty=3D'0.3'>
+          <cell columns=3D'4'>
+            <JPanel layout=3D'{new GridLayout(1, 0)}'>
+              <BeanDoubleList id=3D'headOfMissionList' genericType=3D'Person=
'/>
+              <BeanDoubleList id=3D'headOfSortRoomList' genericType=3D'Perso=
n'/>
+            </JPanel>
+          </cell>
+        </row>
=20
-    </Table>
-  </JScrollPane>
+        <!-- cruise comment -->
+        <row weighty=3D'0.3'>
+          <cell columns=3D'4'>
+            <JScrollPane id=3D'commentPane'
+                         onFocusGained=3D'commentField.requestFocus()'>
+              <JTextArea id=3D'commentField'
+                         onKeyReleased=3D'handler.setText(event, "comment")'=
/>
+            </JScrollPane>
+          </cell>
+        </row>
=20
-  <!-- Form Actions -->
-  <JPanel layout=3D'{new GridLayout(1, 0)}' constraints=3D'BorderLayout.SOUT=
H'>
-    <JButton id=3D'closeButton'/>
-    <JButton id=3D'saveButton'/>
+      </Table>
+
+    </JScrollPane>
+
+    <!-- Form Actions -->
+    <JPanel layout=3D'{new GridLayout(1, 0)}' constraints=3D'BorderLayout.SO=
UTH'>
+      <JButton id=3D'closeButton'/>
+      <JButton id=3D'saveButton'/>
+    </JPanel>
   </JPanel>
=20
+  <JXTitledPanel id=3D'gearCaracteristicsEditorTitledPanel'
+                 constraints=3D'EditCruiseUIHandler.GEAR_CARACTERISTICS_CARD=
'>
+    <GearCaracteristicsEditorUI id=3D'gearCaracteristicsEditor'
+                                constructorParams=3D'this'/>
+  </JXTitledPanel>
+
 </JPanel>
\ No newline at end of file

Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/conten=
t/cruise/EditCruiseUIHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUIHandler.java	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditCruiseUIHandler.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -42,7 +42,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
=20
-import javax.swing.JComponent;
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.List;
@@ -60,6 +63,10 @@
     /** Logger. */
     private static final Log log =3D LogFactory.getLog(EditCruiseUIHandler.c=
lass);
=20
+    public static final String CRUISE_CARD =3D "cruise";
+
+    public static final String GEAR_CARACTERISTICS_CARD =3D "gearCaracterist=
ics";
+
     public static String getTitle(boolean exist) {
=20
         String result;
@@ -211,6 +218,36 @@
                      users,
                      model.getHeadOfSortRoom());
=20
+        ui.getGearList().getSelectedList().addMouseListener(new MouseAdapter=
() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+
+                if (SwingUtilities.isRightMouseButton(e)) {
+                    JList jList =3D (JList) e.getSource();
+                    Point point =3D e.getPoint();
+                    int selectedIndex =3D jList.locationToIndex(point);
+                    Rectangle rect =3D jList.getCellBounds(selectedIndex, se=
lectedIndex);
+                    if (rect.contains(point)) {
+                        jList.setSelectedIndex(selectedIndex); //select the =
item
+                    } else {
+                        jList.clearSelection();
+                    }
+
+                    Gear gear =3D (Gear) jList.getSelectedValue();
+                    boolean editMenuEnabled =3D false;
+                    if (gear !=3D null) {
+                        editMenuEnabled =3D !getModel().isCreate() && !getMo=
del().isModify()
+                                && (!gear.isScientificGear() || persistenceS=
ervice.isTemporary(gear));
+                        ui.setContextValue(gear);
+                    }
+                    ui.getEditGearCaracteristicsItem().setEnabled(editMenuEn=
abled);
+                    ui.getGearMenuPopup().show(jList, e.getX(), e.getY()); /=
/and show the menu
+                }
+            }
+        });
+
+
+
         SwingValidator validator =3D ui.getValidator();
         listenValidatorValid(validator, model);
=20

Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/c=
ruise/EditGearCaracteristicsAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditGearCaracteristicsAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/EditGearCaracteristicsAction.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,34 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 2.1
+ */
+public class EditGearCaracteristicsAction extends AbstractTuttiAction<EditCr=
uiseUIModel, EditCruiseUI, EditCruiseUIHandler> {
+
+    protected final PersistenceService persistenceService;
+
+    public EditGearCaracteristicsAction(EditCruiseUIHandler handler) {
+        super(handler, false);
+        persistenceService =3D getContext().getPersistenceService();
+    }
+
+    @Override
+    protected void doAction() throws Exception {
+        GearCaracteristicsEditorUI editor =3D getUI().getGearCaracteristicsE=
ditor();
+        editor.getModel().setEditable(true);
+
+        Gear gear =3D getUI().getContextValue(Gear.class);
+        gear =3D persistenceService.getGearWithCaracteristics(gear, getDataC=
ontext().getCruise());
+        editor.getModel().setGear(gear);
+
+        getUI().getMainPanelLayout().setSelected(EditCruiseUIHandler.GEAR_CA=
RACTERISTICS_CARD);
+    }
+}

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorRowModel.java (from rev 899, trunk/tutti-ui-sw=
ing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/Caracteristic=
MapEditorRowModel.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorRowModel.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorRowModel.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,35 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.ui.swing.content.operation.fishing.AbstractCaracteri=
sticRowModel;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 1.4
+ */
+public class GearCaracteristicsEditorRowModel extends AbstractCaracteristicR=
owModel<GearCaracteristicsEditorRowModel> {
+
+    private static final long serialVersionUID =3D 1L;
+
+}


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorRowModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorTableModel.java (from rev 899, trunk/tutti-ui-=
swing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/Caracterist=
icMapEditorTableModel.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorTableModel.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorTableModel.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,59 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableModel;
+import fr.ifremer.tutti.ui.swing.util.table.ColumnIdentifier;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 1.4
+ */
+public class GearCaracteristicsEditorTableModel extends AbstractTuttiTableMo=
del<GearCaracteristicsEditorRowModel> {
+
+    private static final long serialVersionUID =3D 1L;
+
+    public static final ColumnIdentifier<GearCaracteristicsEditorRowModel> K=
EY =3D ColumnIdentifier.newId(
+            GearCaracteristicsEditorRowModel.PROPERTY_KEY,
+            n_("tutti.gearCaracteristicsEditorTable.table.header.key"),
+            n_("tutti.gearCaracteristicsEditorTable.table.header.key"));
+
+    public static final ColumnIdentifier<GearCaracteristicsEditorRowModel> V=
ALUE =3D ColumnIdentifier.newId(
+            GearCaracteristicsEditorRowModel.PROPERTY_VALUE,
+            n_("tutti.gearCaracteristicsEditorTable.table.header.value"),
+            n_("tutti.gearCaracteristicsEditorTable.table.header.value"));
+
+    public GearCaracteristicsEditorTableModel(TableColumnModelExt columnMode=
l) {
+        super(columnModel, false, false);
+        setNoneEditableCols(KEY);
+    }
+
+    @Override
+    public GearCaracteristicsEditorRowModel createNewRow() {
+        GearCaracteristicsEditorRowModel result =3D new GearCaracteristicsEd=
itorRowModel();
+        return result;
+    }
+}


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorTableModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorUI.css (from rev 899, trunk/tutti-ui-swing/src=
/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEdit=
orUI.css)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUI.css	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUI.css	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,70 @@
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+BeanFilterableComboBox {
+  i18nPrefix: "tutti.property.";
+  showReset: true;
+}
+
+#newRowKey {
+  property: selectedCaracteristic;
+  enabled: {model.isEditable() && !newRowKey.isEmpty()};
+  visible: {model.isEditable()};
+}
+
+#addRow {
+  actionIcon: add;
+  enabled: {model.isEditable() && newRowKey.getSelectedItem() !=3D null};
+  visible: {model.isEditable()};
+}
+
+#gearCaracteristicsEditorTable {
+  selectionMode: {ListSelectionModel.SINGLE_SELECTION};
+  selectionBackground: {null};
+  selectionForeground: {Color.BLACK};
+  sortable: false;
+  editable: {model.isEditable()};
+}
+
+#removeCaracteristicMenu {
+  actionIcon: batch-delete;
+  text: "tutti.editIndividualObservationCaracteristics.action.removeCaracter=
istic";
+  toolTipText: "tutti.editIndividualObservationCaracteristics.action.removeC=
aracteristic.tip";
+  i18nMnemonic: "tutti.editIndividualObservationCaracteristics.action.remove=
Caracteristic.mnemonic";
+  enabled: {model.isEditable() && model.isRemoveCaracteristicEnabled()};
+}
+
+#cancelButton {
+  actionIcon: cancel;
+  text: "tutti.editIndividualObservationCaracteristics.action.cancel";
+  toolTipText: "tutti.editIndividualObservationCaracteristics.action.cancel.=
tip";
+  i18nMnemonic: "tutti.editIndividualObservationCaracteristics.action.cancel=
.mnemonic";
+  _help: {"tutti.editIndividualObservationCaracteristics.action.cancel.help"=
};
+}
+
+#saveButton {
+  actionIcon: save;
+  text: "tutti.editIndividualObservationCaracteristics.action.save";
+  toolTipText: "tutti.editIndividualObservationCaracteristics.action.save.ti=
p";
+  i18nMnemonic: "tutti.editIndividualObservationCaracteristics.action.save.m=
nemonic";
+  enabled: {model.isEditable() && model.isValid()};
+  _help: {"tutti.editIndividualObservationCaracteristics.action.save.help"};
+}
\ No newline at end of file


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorUI.css
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorUI.jaxx (from rev 899, trunk/tutti-ui-swing/sr=
c/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicMapEdi=
torUI.jaxx)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUI.jaxx	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUI.jaxx	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,89 @@
+<!--
+  #%L
+  Tutti :: UI
+  %%
+  Copyright (C) 2012 - 2013 Ifremer
+  %%
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as
+  published by the Free Software Foundation, either version 3 of the=20
+  License, or (at your option) any later version.
+ =20
+  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.
+ =20
+  You should have received a copy of the GNU General Public=20
+  License along with this program.  If not, see
+  <http://www.gnu.org/licenses/gpl-3.0.html>.
+  #L%
+  -->
+<Table
+  implements=3D'fr.ifremer.tutti.ui.swing.util.TuttiUI&lt;GearCaracteristics=
EditorUIModel, GearCaracteristicsEditorUIHandler&gt;'>
+
+  <import>
+    fr.ifremer.tutti.persistence.entities.referential.Caracteristic
+    fr.ifremer.tutti.ui.swing.util.TuttiUI
+
+    jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
+    org.jdesktop.swingx.JXTable
+    javax.swing.ListSelectionModel
+    java.awt.Color
+  </import>
+
+  <GearCaracteristicsEditorUIHandler id=3D'handler'
+                                   initializer=3D'getContextValue(GearCaract=
eristicsEditorUIHandler.class)'/>
+
+  <GearCaracteristicsEditorUIModel id=3D'model'
+                                 initializer=3D'getContextValue(GearCaracter=
isticsEditorUIModel.class)'/>
+
+  <JPopupMenu id=3D'tablePopup'>
+    <JMenuItem id=3D'removeCaracteristicMenu'
+               onActionPerformed=3D'handler.removeCaracteristic()'/>
+  </JPopupMenu>
+
+  <row fill=3D'both'>
+    <cell fill=3D'both' weightx=3D'1'>
+      <BeanFilterableComboBox id=3D'newRowKey' constructorParams=3D'this'
+                              genericType=3D'Caracteristic'/>
+    </cell>
+    <cell fill=3D'both'>
+      <JButton id=3D'addRow' onActionPerformed=3D'handler.addRow()'/>
+    </cell>
+  </row>
+  <row fill=3D'both' weighty=3D'1'>
+    <cell fill=3D'both' columns=3D'2'>
+      <JScrollPane>
+        <JXTable id=3D'gearCaracteristicsEditorTable'
+                 onMouseClicked=3D'handler.autoSelectRowInTable(event, table=
Popup)'
+                 onKeyPressed=3D'handler.openRowMenu(event, tablePopup)'/>
+      </JScrollPane>
+    </cell>
+  </row>
+
+  <!-- Form Actions -->
+  <row fill=3D'both'>
+    <cell fill=3D'both' columns=3D'2'>
+      <JPanel layout=3D'{new GridLayout(1, 0)}'>
+        <JButton id=3D'cancelButton' onActionPerformed=3D'handler.cancel()'/>
+        <JButton id=3D'saveButton' onActionPerformed=3D'handler.save()'/>
+      </JPanel>
+    </cell>
+  </row>
+  <script><![CDATA[
+
+public GearCaracteristicsEditorUI(TuttiUI parentUI) {
+    JAXXUtil.initContext(this, parentUI);
+    GearCaracteristicsEditorUIHandler handler =3D new GearCaracteristicsEdit=
orUIHandler(parentUI, this);
+    setContextValue(handler);
+    handler.beforeInitUI();
+}
+
+protected void $afterCompleteSetup() {
+    handler.afterInitUI();
+}
+
+  ]]></script>
+
+</Table>
\ No newline at end of file


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorUI.jaxx
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorUIHandler.java (from rev 899, trunk/tutti-ui-s=
wing/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/Caracteristi=
cMapEditorUIHandler.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUIHandler.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUIHandler.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,337 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.service.DecoratorService;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.util.Cancelable;
+import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
+import fr.ifremer.tutti.ui.swing.util.TuttiUI;
+import fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapColumnR=
owModel;
+import fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMapEditorU=
I;
+import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueEditor;
+import fr.ifremer.tutti.ui.swing.util.editor.CaracteristicValueRenderer;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIHandler;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.table.DefaultTableColumnModelExt;
+
+import javax.swing.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+import static fr.ifremer.tutti.ui.swing.util.caracteristics.CaracteristicMap=
CellComponent.CaracteristicMapCellEditor;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 2.1
+ */
+public class GearCaracteristicsEditorUIHandler
+        extends AbstractTuttiTableUIHandler<GearCaracteristicsEditorRowModel=
, GearCaracteristicsEditorUIModel, GearCaracteristicsEditorUI>
+        implements Cancelable {
+
+    private final static Log log =3D
+            LogFactory.getLog(GearCaracteristicsEditorUIHandler.class);
+
+    protected final PersistenceService persistenceService =3D getContext().g=
etPersistenceService();
+
+    public GearCaracteristicsEditorUIHandler(TuttiUI parentUi,
+                                             GearCaracteristicsEditorUI ui) {
+        super(parentUi.getHandler().getContext(), ui, GearCaracteristicsEdit=
orRowModel.PROPERTY_VALUE);
+    }
+
+    @Override
+    public GearCaracteristicsEditorTableModel getTableModel() {
+        return (GearCaracteristicsEditorTableModel) getTable().getModel();
+    }
+
+    @Override
+    public JXTable getTable() {
+        return ui.getGearCaracteristicsEditorTable();
+    }
+
+    @Override
+    protected boolean isRowValid(GearCaracteristicsEditorRowModel row) {
+        return row.getKey() !=3D null && row.getValue() !=3D null;
+    }
+
+    @Override
+    protected void onRowModified(int rowIndex, GearCaracteristicsEditorRowMo=
del row,
+                                 String propertyName, Object oldValue, Objec=
t newValue) {
+        recomputeRowValidState(row);
+        super.onRowModified(rowIndex, row, propertyName, oldValue, newValue);
+        saveSelectedRowIfNeeded();
+    }
+
+    @Override
+    protected void onAfterSelectedRowChanged(int oldRowIndex, GearCaracteris=
ticsEditorRowModel oldRow, int newRowIndex, GearCaracteristicsEditorRowModel =
newRow) {
+        super.onAfterSelectedRowChanged(oldRowIndex, oldRow, newRowIndex, ne=
wRow);
+        getModel().setRemoveCaracteristicEnabled(newRowIndex >=3D 0);
+    }
+
+    @Override
+    protected void saveSelectedRowIfRequired(TuttiBeanMonitor<GearCaracteris=
ticsEditorRowModel> rowMonitor,
+                                             GearCaracteristicsEditorRowMode=
l row) {
+        if (row.isValid()) {
+            // there is a valid bean attached to the monitor
+
+            if (rowMonitor.wasModified()) {
+
+                // monitored bean was modified, save it
+                if (log.isInfoEnabled()) {
+                    log.info("Row " + row + " was modified, will save it");
+                }
+
+                saveRow(row);
+
+            }
+        }
+    }
+
+    @Override
+    public void beforeInitUI() {
+        GearCaracteristicsEditorUIModel model =3D createModel();
+        getUI().setContextValue(model);
+
+        model.addPropertyChangeListener(GearCaracteristicsEditorUIModel.PROP=
ERTY_GEAR, new PropertyChangeListener() {
+            @Override
+            public void propertyChange(PropertyChangeEvent evt) {
+                editGear((Gear) evt.getNewValue());
+            }
+        });
+
+    }
+
+    @Override
+    public void afterInitUI() {
+        initUI(getUI());
+
+        initBeanFilterableComboBox(getKeyCombo(), Lists.<Caracteristic>newAr=
rayList(), null);
+        getModel().setAvailableCaracteristics(getDataContext().getCaracteris=
tics());
+
+        JXTable table =3D getTable();
+
+        // create table column model
+        DefaultTableColumnModelExt columnModel =3D
+                new DefaultTableColumnModelExt();
+
+        {
+
+            addColumnToModel(columnModel,
+                             null,
+                             newTableCellRender(Caracteristic.class, Decorat=
orService.CARACTERISTIC_WITH_UNIT),
+                             GearCaracteristicsEditorTableModel.KEY);
+        }
+
+        {
+
+            addColumnToModel(columnModel,
+                             new CaracteristicValueEditor(context),
+                             new CaracteristicValueRenderer(context),
+                             GearCaracteristicsEditorTableModel.VALUE);
+        }
+
+        // create table model
+        GearCaracteristicsEditorTableModel tableModel =3D
+                new GearCaracteristicsEditorTableModel(columnModel);
+
+        table.setModel(tableModel);
+        table.setColumnModel(columnModel);
+
+        initTable(table);
+    }
+
+    @Override
+    protected JComponent getComponentToFocus() {
+        return getUI().getNewRowKey();
+    }
+
+    @Override
+    public void onCloseUI() {
+        if (log.isDebugEnabled()) {
+            log.debug("closing: " + ui);
+        }
+
+        EditCruiseUI ui =3D getUI().getParentContainer(EditCruiseUI.class);
+        ui.getMainPanelLayout().setSelected(EditCruiseUIHandler.CRUISE_CARD);
+
+        // when canceling always invalid model (in that way)
+        getModel().setValid(false);
+        getModel().setGear(null);
+    }
+
+    @Override
+    public SwingValidator<GearCaracteristicsEditorUIModel> getValidator() {
+        return null;
+    }
+
+    @Override
+    public void cancel() {
+
+        if (log.isInfoEnabled()) {
+            log.info("Cancel UI " + ui);
+        }
+
+        // close dialog
+        closeUI(ui);
+    }
+
+    protected BeanFilterableComboBox<Caracteristic> getKeyCombo() {
+        return ui.getNewRowKey();
+    }
+
+    protected GearCaracteristicsEditorUIModel createModel() {
+        return new GearCaracteristicsEditorUIModel();
+    }
+
+    protected void saveRow(GearCaracteristicsEditorRowModel row) {
+
+        if (row.isValid()) {
+            CaracteristicMap caracteristics =3D getModel().getCaracteristicM=
ap();
+            Preconditions.checkNotNull(caracteristics);
+
+            caracteristics.put(row.getKey(), row.getValue());
+        }
+    }
+
+    //----------------------------------------------------------------------=
--//
+    //-- Public methods                                                     =
--//
+    //----------------------------------------------------------------------=
--//
+
+    /**
+     *  Adds a row with the parameter selected in the combo box
+     **/
+    public void addRow() {
+        BeanFilterableComboBox<Caracteristic> keyCombo =3D getKeyCombo();
+        Caracteristic selectedItem =3D (Caracteristic) keyCombo.getSelectedI=
tem();
+        GearCaracteristicsEditorTableModel tableModel =3D getTableModel();
+
+        GearCaracteristicsEditorRowModel row =3D tableModel.createNewRow();
+        row.setKey(selectedItem);
+//        tableModel.addNewRow(row);
+        getModel().getRows().add(row);
+
+        int rowIndex =3D tableModel.getRowCount() - 1;
+        tableModel.fireTableRowsInserted(rowIndex, rowIndex);
+
+        keyCombo.getHandler().removeItem(selectedItem);
+
+        GearCaracteristicsEditorUIModel model =3D getModel();
+        model.setModify(true);
+        recomputeRowValidState(row);
+    }
+
+    public void removeCaracteristic() {
+        int rowIndex =3D getTable().getSelectedRow();
+
+        Preconditions.checkState(
+                rowIndex !=3D -1,
+                "Cant remove caracteristic if no caracteristic selected");
+
+        GearCaracteristicsEditorRowModel row =3D getTableModel().getEntry(ro=
wIndex);
+
+        CaracteristicMap caracteristicMap =3D getModel().getCaracteristicMap=
();
+        if (caracteristicMap !=3D null) {
+            caracteristicMap.remove(row.getKey());
+        }
+
+        //add the row in the combo
+        BeanFilterableComboBox keyCombo =3D getKeyCombo();
+        keyCombo.addItem(row.getKey());
+//        selectFirstInCombo(keyCombo);
+        keyCombo.getHandler().reset();
+
+        // remove the row from the model
+        getModel().getRows().remove(rowIndex);
+
+        // refresh all the table
+        getTableModel().fireTableRowsDeleted(rowIndex, rowIndex);
+
+        getModel().removeRowInError(row);
+    }
+
+    public void save() {
+
+        if (log.isInfoEnabled()) {
+            log.info("Save UI " + ui);
+        }
+
+        Gear gear =3D getModel().getGear();
+        gear.setCaracteristics((CaracteristicMap) getModel().getCaracteristi=
cMap().clone());
+        persistenceService.saveGearCaracteristics(gear, getDataContext().get=
Cruise());
+
+        closeUI(ui);
+    }
+
+    protected void editGear(Gear gear) {
+
+        if (gear !=3D null) {
+            GearCaracteristicsEditorTableModel tableModel =3D getTableModel(=
);
+            GearCaracteristicsEditorUIModel model =3D getModel();
+
+            CaracteristicMap caracteristicMap =3D gear.getCaracteristics();
+            if (caracteristicMap =3D=3D null) {
+                caracteristicMap =3D new CaracteristicMap();
+            }
+            model.getCaracteristicMap().putAll(caracteristicMap);
+
+            List<GearCaracteristicsEditorRowModel> rows =3D Lists.newArrayLi=
st();
+            List<Caracteristic> caracteristics =3D Lists.newArrayList(caract=
eristicMap.keySet());
+
+            List<Caracteristic> availableCaracteristics =3D model.getAvailab=
leCaracteristics();
+
+            for (Caracteristic key : caracteristics) {
+                GearCaracteristicsEditorRowModel newRow =3D tableModel.creat=
eNewRow();
+                newRow.setKey(key);
+                newRow.setValue(caracteristicMap.get(key));
+                rows.add(newRow);
+            }
+
+            model.setRows(rows);
+
+            List<Caracteristic> caracteristicList =3D Lists.newArrayList();
+
+            for (Caracteristic caracteristic : availableCaracteristics) {
+                if (!caracteristics.contains(caracteristic)) {
+                    caracteristicList.add(caracteristic);
+                }
+            }
+
+            BeanFilterableComboBox<Caracteristic> keyCombo =3D getKeyCombo();
+            keyCombo.setData(caracteristicList);
+    //        selectFirstInCombo(keyCombo);
+            keyCombo.getHandler().reset();
+            model.setModify(false);
+
+        }
+    }
+}


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorUIHandler.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/=
cruise/GearCaracteristicsEditorUIModel.java (from rev 899, trunk/tutti-ui-swi=
ng/src/main/java/fr/ifremer/tutti/ui/swing/util/caracteristics/CaracteristicM=
apEditorUIModel.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUIModel.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/GearCaracteristicsEditorUIModel.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,113 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+/*
+ * #%L
+ * Tutti :: UI
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the=20
+ * License, or (at your option) any later version.
+ *=20
+ * 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.
+ *=20
+ * You should have received a copy of the GNU General Public=20
+ * License along with this program.  If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import fr.ifremer.tutti.persistence.entities.CaracteristicMap;
+import fr.ifremer.tutti.persistence.entities.referential.Caracteristic;
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.ui.swing.util.table.AbstractTuttiTableUIModel;
+
+import java.util.List;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 2.1
+ */
+public class GearCaracteristicsEditorUIModel extends AbstractTuttiTableUIMod=
el<Object, GearCaracteristicsEditorRowModel, GearCaracteristicsEditorUIModel>=
 {
+
+    public static final String PROPERTY_GEAR =3D "gear";
+
+    public static final String PROPERTY_EDITABLE =3D "editable";
+
+    public static final String PROPERTY_REMOVE_CARACTERISTIC_ENABLED =3D "re=
moveCaracteristicEnabled";
+
+    public static final String PROPERTY_AVAILABLE_CARACTERISTICS =3D "availa=
bleCaracteristics";
+
+    private static final long serialVersionUID =3D 1L;
+
+    protected List<Caracteristic> availableCaracteristics;
+
+    protected Gear gear;
+
+    protected boolean editable;
+
+    protected CaracteristicMap caracteristicMap =3D new CaracteristicMap();
+
+    /**
+     * Can user remove a selected caracteristic?
+     */
+    protected boolean removeCaracteristicEnabled;
+
+    public GearCaracteristicsEditorUIModel() {
+        super(Object.class, null, null);
+    }
+
+    public List<Caracteristic> getAvailableCaracteristics() {
+        return availableCaracteristics;
+    }
+
+    public void setAvailableCaracteristics(List<Caracteristic> availableCara=
cteristics) {
+        Object oldValue =3D getAvailableCaracteristics();
+        this.availableCaracteristics =3D availableCaracteristics;
+        firePropertyChange(PROPERTY_AVAILABLE_CARACTERISTICS, oldValue, avai=
lableCaracteristics);
+    }
+
+    public Gear getGear() {
+        return gear;
+    }
+
+    public void setGear(Gear gear) {
+        Object oldValue =3D getGear();
+        this.gear =3D gear;
+        firePropertyChange(PROPERTY_GEAR, oldValue, this.gear);
+    }
+
+    public boolean isRemoveCaracteristicEnabled() {
+        return removeCaracteristicEnabled;
+    }
+
+    public void setRemoveCaracteristicEnabled(boolean removeCaracteristicEna=
bled) {
+        Object oldValue =3D isRemoveCaracteristicEnabled();
+        this.removeCaracteristicEnabled =3D removeCaracteristicEnabled;
+        firePropertyChange(PROPERTY_REMOVE_CARACTERISTIC_ENABLED, oldValue, =
removeCaracteristicEnabled);
+    }
+
+    public CaracteristicMap getCaracteristicMap() {
+        return caracteristicMap;
+    }
+
+    public boolean isEditable() {
+        return editable;
+    }
+
+    public void setEditable(boolean editable) {
+        Object oldValue =3D isEditable();
+        this.editable =3D editable;
+        firePropertyChange(PROPERTY_EDITABLE, oldValue, editable);
+    }
+
+    @Override
+    protected Object newEntity() {
+        return null;
+    }
+}


Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/s=
wing/content/cruise/GearCaracteristicsEditorUIModel.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision HeadURL
Added: svn:eol-style
   + native

Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/c=
ruise/ViewGearCaracteristicsAction.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/ViewGearCaracteristicsAction.java	                        (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/crui=
se/ViewGearCaracteristicsAction.java	2013-05-03 15:49:20 UTC (rev 917)
@@ -0,0 +1,31 @@
+package fr.ifremer.tutti.ui.swing.content.cruise;
+
+import fr.ifremer.tutti.persistence.entities.referential.Gear;
+import fr.ifremer.tutti.service.PersistenceService;
+import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
+
+/**
+ * @author kmorin <kmorin@codelutin.com>
+ * @since 2.1
+ */
+public class ViewGearCaracteristicsAction extends AbstractTuttiAction<EditCr=
uiseUIModel, EditCruiseUI, EditCruiseUIHandler> {
+
+    protected final PersistenceService persistenceService;
+
+    public ViewGearCaracteristicsAction(EditCruiseUIHandler handler) {
+        super(handler, false);
+        persistenceService =3D getContext().getPersistenceService();
+    }
+
+    @Override
+    protected void doAction() throws Exception {
+        GearCaracteristicsEditorUI editor =3D getUI().getGearCaracteristicsE=
ditor();
+        editor.getModel().setEditable(false);
+
+        Gear gear =3D getUI().getContextValue(Gear.class);
+        gear =3D persistenceService.getGearWithCaracteristics(gear, getDataC=
ontext().getCruise());
+        editor.getModel().setGear(gear);
+
+        getUI().getMainPanelLayout().setSelected(EditCruiseUIHandler.GEAR_CA=
RACTERISTICS_CARD);
+    }
+}

Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/conten=
t/operation/catches/benthos/BenthosBatchUI.jaxx
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/oper=
ation/catches/benthos/BenthosBatchUI.jaxx	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/oper=
ation/catches/benthos/BenthosBatchUI.jaxx	2013-05-03 15:49:20 UTC (rev 917)
@@ -75,7 +75,7 @@
     <JMenuItem id=3D'removeBenthosBatchMenu'/>
     <JMenuItem id=3D'removeBenthosSubBatchMenu'/>
     <JMenuItem id=3D'renameBenthosBatchMenu'/>
-    <JMenuItem id=3D'createSpeciesMelagMenu'/>
+    <JMenuItem id=3D'createBenthosMelagMenu'/>
   </JPopupMenu>
   <Table id=3D'form' fill=3D'both' constraints=3D'BorderLayout.NORTH'>
=20

Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.p=
roperties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.propert=
ies	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.propert=
ies	2013-05-03 15:49:20 UTC (rev 917)
@@ -6,6 +6,7 @@
 swing.error.desktop.mail.not.supported=3D
 swing.error.desktop.not.supported=3D
 traits=3D
+ttutti.editCruise.action.editGearCaracteristics.mnemonic=3D
 tutti.about.bottomText=3D
 tutti.about.message=3D
 tutti.about.title=3D
@@ -277,6 +278,9 @@
 tutti.editBenthosBatch.action.createBatch=3D
 tutti.editBenthosBatch.action.createBatch.mnemonic=3D
 tutti.editBenthosBatch.action.createBatch.tip=3D
+tutti.editBenthosBatch.action.createMelag=3D
+tutti.editBenthosBatch.action.createMelag.mnemonic=3D
+tutti.editBenthosBatch.action.createMelag.tip=3D
 tutti.editBenthosBatch.action.removeBatch=3D
 tutti.editBenthosBatch.action.removeBatch.mnemonic=3D
 tutti.editBenthosBatch.action.removeBatch.tip=3D
@@ -434,6 +438,8 @@
 tutti.editCruise.action.closeEditCruise=3D
 tutti.editCruise.action.closeEditCruise.mnemonic=3D
 tutti.editCruise.action.closeEditCruise.tip=3D
+tutti.editCruise.action.editGearCaracteristics=3D
+tutti.editCruise.action.editGearCaracteristics.tip=3D
 tutti.editCruise.action.generateCampaignName=3D
 tutti.editCruise.action.generateCampaignName.mnemonic=3D
 tutti.editCruise.action.generateName.tip=3D
@@ -443,6 +449,8 @@
 tutti.editCruise.action.saveCruise=3D
 tutti.editCruise.action.saveCruise.mnemonic=3D
 tutti.editCruise.action.saveCruise.tip=3D
+tutti.editCruise.action.viewGearCaracteristics=3D
+tutti.editCruise.action.viewGearCaracteristics.tip=3D
 tutti.editCruise.askCancelEditBeforeLeaving.cancelSaveCruise=3D
 tutti.editCruise.askSaveBeforeLeaving.saveCruise=3D
 tutti.editCruise.field.beginDate=3D
@@ -481,6 +489,7 @@
 tutti.editCruise.filterVesselType.fishing.tip=3D
 tutti.editCruise.filterVesselType.scientific=3D
 tutti.editCruise.filterVesselType.scientific.tip=3D
+tutti.editCruise.gearCaracteristics.title=3D
 tutti.editCruise.title.create.cruise=3D
 tutti.editCruise.title.edit.cruise=3D
 tutti.editFishingOperation.action.attachments.tip=3D
@@ -887,6 +896,9 @@
 tutti.flash.info.species.imported.in.protocol.severalReplaced=3D
 tutti.flash.info.species.remove.from.protocol=3D
 tutti.flash.info.species.replaced=3D
+tutti.gearCaracteristicsEditorEditorTable.table.header.key=3D
+tutti.gearCaracteristicsEditorTable.table.header.key=3D
+tutti.gearCaracteristicsEditorTable.table.header.value=3D
 tutti.gearUseFeatureTable.action.removeCaracteristic=3D
 tutti.gearUseFeatureTable.action.removeCaracteristic.mnemonic=3D
 tutti.gearUseFeatureTable.action.removeCaracteristic.tip=3D

Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.p=
roperties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.propert=
ies	2013-05-02 15:33:42 UTC (rev 916)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.propert=
ies	2013-05-03 15:49:20 UTC (rev 917)
@@ -273,6 +273,9 @@
 tutti.editBenthosBatch.action.createBatch=3DCr=C3=A9er un lot pour une esp=
=C3=A8ce
 tutti.editBenthosBatch.action.createBatch.mnemonic=3DC
 tutti.editBenthosBatch.action.createBatch.tip=3DCr=C3=A9er un nouveau lot po=
ur une esp=C3=A8ce
+tutti.editBenthosBatch.action.createMelag=3DEsp=C3=A8ces d'un MELAG
+tutti.editBenthosBatch.action.createMelag.mnemonic=3DC
+tutti.editBenthosBatch.action.createMelag.tip=3DCalcul des poids des lots ap=
partenant =C3=A0 un MELAG
 tutti.editBenthosBatch.action.removeBatch=3DSupprimer le lot
 tutti.editBenthosBatch.action.removeBatch.mnemonic=3DS
 tutti.editBenthosBatch.action.removeBatch.tip=3DSupprimer le lot courant (ce=
lui de la ligne s=C3=A9lectionn=C3=A9e) et tous ces fils
@@ -421,6 +424,8 @@
 tutti.editCruise.action.closeEditCruise=3DFermer
 tutti.editCruise.action.closeEditCruise.mnemonic=3DF
 tutti.editCruise.action.closeEditCruise.tip=3DFermer l'=C3=A9cran d'=C3=A9di=
tion de campagne
+tutti.editCruise.action.editGearCaracteristics=3DEditer
+tutti.editCruise.action.editGearCaracteristics.tip=3DEditer les caract=C3=A9=
ristiques de l'engin
 tutti.editCruise.action.generateCampaignName=3DG=C3=A9n=C3=A9rer le nom
 tutti.editCruise.action.generateCampaignName.mnemonic=3DG
 tutti.editCruise.action.generateName.tip=3DG=C3=A9n=C3=A9rer le nom normalis=
=C3=A9 de la campagne
@@ -430,6 +435,8 @@
 tutti.editCruise.action.saveCruise=3DEnregistrer
 tutti.editCruise.action.saveCruise.mnemonic=3DE
 tutti.editCruise.action.saveCruise.tip=3DEnregistrer la campagne
+tutti.editCruise.action.viewGearCaracteristics=3DVoir
+tutti.editCruise.action.viewGearCaracteristics.tip=3DVoir les caract=C3=A9ri=
stiques de l'engin
 tutti.editCruise.askCancelEditBeforeLeaving.cancelSaveCruise=3DLa campagne n=
'est pas valide et ne peut pas =C3=AAtre enregistr=C3=A9e.
 tutti.editCruise.askSaveBeforeLeaving.saveCruise=3DDes modifications sur la =
campagne n'ont pas =C3=A9t=C3=A9 enregistr=C3=A9es.
 tutti.editCruise.field.beginDate=3DDate de d=C3=A9but
@@ -466,6 +473,7 @@
 tutti.editCruise.filterVesselType.fishing.tip=3DUniquement les navires profe=
ssionnels
 tutti.editCruise.filterVesselType.scientific=3DScientifiques
 tutti.editCruise.filterVesselType.scientific.tip=3DUniquement les navires sc=
ientifiques
+tutti.editCruise.gearCaracteristics.title=3DCaract=C3=A9ristiques d'un engin
 tutti.editCruise.title.create.cruise=3DCr=C3=A9er une nouvelle campagne
 tutti.editCruise.title.edit.cruise=3D=C3=89diter une campagne existante
 tutti.editFishingOperation.action.attachments.tip=3DPi=C3=A8ces-jointes de l=
'op=C3=A9ration
@@ -857,6 +865,8 @@
 tutti.flash.info.species.imported.in.protocol.severalReplaced=3DEsp=C3=A8ces=
 import=C3=A9es dans le protocole depuis le fichier <strong>%s</strong>. %s r=
emplac=C3=A9es par leur r=C3=A9f=C3=A9rent.
 tutti.flash.info.species.remove.from.protocol=3DL'esp=C3=A8ce <strong>%s</st=
rong> a =C3=A9t=C3=A9 retir=C3=A9e du protocole.
 tutti.flash.info.species.replaced=3DL'esp=C3=A8ce <strong>%s</strong> a =C3=
=A9t=C3=A9 remplac=C3=A9e par son r=C3=A9f=C3=A9rent <strong>%s</strong>.
+tutti.gearCaracteristicsEditorTable.table.header.key=3DCaract=C3=A9ristique
+tutti.gearCaracteristicsEditorTable.table.header.value=3DValeur
 tutti.gearUseFeatureTable.action.removeCaracteristic=3DSupprimer
 tutti.gearUseFeatureTable.action.removeCaracteristic.mnemonic=3DS
 tutti.gearUseFeatureTable.action.removeCaracteristic.tip=3DSupprimer la cara=
ct=C3=A9ristique


--===============4615641587317024220==--


