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
January 2013
- 4 participants
- 143 discussions
r177 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service
by kmorin@users.forge.codelutin.com 11 Jan '13
by kmorin@users.forge.codelutin.com 11 Jan '13
11 Jan '13
Author: kmorin
Date: 2013-01-11 18:42:37 +0100 (Fri, 11 Jan 2013)
New Revision: 177
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/177
Log:
add decorator
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-01-11 16:17:12 UTC (rev 176)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/DecoratorService.java 2013-01-11 17:42:37 UTC (rev 177)
@@ -39,13 +39,11 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import fr.ifremer.tutti.persistence.entities.referential.Zone;
+import java.io.Serializable;
+import static org.nuiton.i18n.I18n.n_;
import org.nuiton.util.decorator.Decorator;
import org.nuiton.util.decorator.DecoratorProvider;
-import java.io.Serializable;
-
-import static org.nuiton.i18n.I18n.n_;
-
/**
* Tutti decorator service.
*
@@ -67,6 +65,8 @@
public static final String SPECIES_BY_CODE = "byCode";
public static final String SPECIES_BY_GENUS = "byGenus";
+
+ public static final String CARACTERISTIC_WITH_UNIT = "withUnit";
public static final String BY_NAME = "byName";
@@ -110,6 +110,7 @@
registerMultiJXPathDecorator(Person.class, "${firstName}$s#${lastName}$s", SEPARATOR, " ");
registerMultiJXPathDecorator(FishingOperationLocation.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Caracteristic.class, "${name}$s", SEPARATOR, " - ");
+ registerMultiJXPathDecorator(Caracteristic.class, CARACTERISTIC_WITH_UNIT, "${name}$s (${unit}$s)", SEPARATOR, " - ");
registerMultiJXPathDecorator(CaracteristicQualitativeValue.class, "${name}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Species.class, "${codeMemo}$s#${genusSpecies}$s", SEPARATOR, " - ");
registerMultiJXPathDecorator(Species.class, SPECIES_BY_CODE, "${codeMemo}$s", SEPARATOR, " - ");
1
0
r176 - in trunk: . src/site tutti-persistence-adagio/src/main tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence tutti-persistence-adagio/src/main/resources tutti-persistence-adagio/src/main/site tutti-persistence-adagio/src/main/site/rst tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util tutti-ui-swing/src/main/resources/icons
by tchemit@users.forge.codelutin.com 11 Jan '13
by tchemit@users.forge.codelutin.com 11 Jan '13
11 Jan '13
Author: tchemit
Date: 2013-01-11 17:17:12 +0100 (Fri, 11 Jan 2013)
New Revision: 176
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/176
Log:
use last stable of eugene
refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel (doc + continue)
add missing svn properties + license header
Added:
trunk/tutti-persistence-adagio/src/main/site/
trunk/tutti-persistence-adagio/src/main/site/rst/
trunk/tutti-persistence-adagio/src/main/site/rst/referential.rst
trunk/tutti-persistence-adagio/src/main/site/site_fr.xml
Modified:
trunk/pom.xml
trunk/src/site/site_fr.xml
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java
trunk/tutti-ui-swing/src/main/resources/icons/action-table-error.png
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/pom.xml 2013-01-11 16:17:12 UTC (rev 176)
@@ -125,7 +125,7 @@
<nuitonUtilsVersion>2.7-SNAPSHOT</nuitonUtilsVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
- <eugenePluginVersion>2.6.1-SNAPSHOT</eugenePluginVersion>
+ <eugenePluginVersion>2.6.1</eugenePluginVersion>
<hibernateVersion>3.6.10.Final</hibernateVersion>
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/src/site/site_fr.xml 2013-01-11 16:17:12 UTC (rev 176)
@@ -94,7 +94,7 @@
href="${project.url}/index.html"/>
</breadcrumbs>
- <menu name="Sammoa">
+ <menu name="Tutti">
<item name="Accueil" href="index.html"/>
<item name="Configuration" href="./application-config-report.html"/>
<item name="Téléchargement"
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-11 16:17:12 UTC (rev 176)
@@ -171,13 +171,7 @@
List<Vessel> result = Lists.newArrayList();
while (list.hasNext()) {
Object[] source = list.next();
- Vessel target = new Vessel();
- target.setScientificVessel(true);
- target.setId((String) source[0]);
- target.setRegistrationCode((String) source[1]);
- target.setInternalRegistrationCode((String) source[2]);
- target.setName((String) source[3]);
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ Vessel target = loadVessel(source);
result.add(target);
}
return result;
@@ -199,16 +193,6 @@
return result;
}
- protected Vessel loadVessel(Object[] source) {
- Vessel target = new Vessel();
- target.setId((String) source[0]);
- target.setRegistrationCode((String) source[1]);
- target.setInternalRegistrationCode((String) source[2]);
- target.setName((String) source[3]);
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
- return target;
- }
-
@Override
public List<Gear> getAllScientificGear() {
@@ -218,11 +202,7 @@
List<Gear> result = Lists.newArrayList();
while (sources.hasNext()) {
Object[] source = sources.next();
- Gear target = new Gear();
- target.setId(String.valueOf(source[0]));
- target.setName(String.valueOf(source[1]));
- target.setLabel(String.valueOf(source[2]));
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ Gear target = loadGear(source);
result.add(target);
}
return result;
@@ -236,11 +216,7 @@
List<Gear> result = Lists.newArrayList();
while (sources.hasNext()) {
Object[] source = sources.next();
- Gear target = new Gear();
- target.setId(String.valueOf(source[0]));
- target.setName(String.valueOf(source[1]));
- target.setLabel(String.valueOf(source[2]));
- setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
+ Gear target = loadGear(source);
result.add(target);
}
return result;
@@ -249,7 +225,11 @@
@Override
public List<Person> getAllPerson() {
Iterator<Object[]> list = queryList(
- "allPersons");
+ "allPersons",
+ "observerProfilId", IntegerType.INSTANCE, getEnumerationIntegerCode("UserProfilId.OBSERVER"),
+ "projectMemberProfilId", IntegerType.INSTANCE, getEnumerationIntegerCode("UserProfilId.PROJECT_MEMBER"),
+ "userProfilId", IntegerType.INSTANCE, getEnumerationIntegerCode("UserProfilId.USER")
+ );
List<Person> result = Lists.newArrayList();
while (list.hasNext()) {
@@ -318,7 +298,10 @@
public List<Caracteristic> getAllSpeciesLengthStepCaracteristic() {
Iterator<Object[]> sources = queryList(
"allLengthStepCaracteristics",
- "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.BATCH"));
+ "matrixId", IntegerType.INSTANCE, getEnumerationIntegerCode("MatrixId.INDIVIDUAL"),
+ "ageParameterCode", StringType.INSTANCE, getEnumerationStringCode("ParameterCode.AGE"),
+ "weightParameterCode", StringType.INSTANCE, getEnumerationStringCode("ParameterCode.WEIGHT"),
+ "methodDeclarationId", IntegerType.INSTANCE, getEnumerationIntegerCode("MethodId.DECLARATION"));
List<Caracteristic> result = Lists.newArrayList();
while (sources.hasNext()) {
Object[] source = sources.next();
@@ -1000,4 +983,23 @@
setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], target);
return target;
}
+
+ protected Vessel loadVessel(Object[] source) {
+ Vessel target = new Vessel();
+ target.setId((String) source[0]);
+ target.setRegistrationCode((String) source[1]);
+ target.setInternalRegistrationCode((String) source[2]);
+ target.setName((String) source[3]);
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[4], target);
+ return target;
+ }
+
+ protected Gear loadGear(Object[] source) {
+ Gear result = new Gear();
+ result.setId(String.valueOf(source[0]));
+ result.setName(String.valueOf(source[1]));
+ result.setLabel(String.valueOf(source[2]));
+ setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[3], result);
+ return result;
+ }
}
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-11 16:17:12 UTC (rev 176)
@@ -233,26 +233,37 @@
<!-- Get all persons [REF-07] -->
<query cacheable="true" name="allPersons">
<![CDATA[
- SELECT DISTINCT
+ SELECT DISTINCT
p.id,
+ p.lastname,
p.firstname,
- p.lastname,
- p.department.name,
+ p.department.code,
p.status
- FROM
+ FROM
PersonImpl p
- WHERE p.status.code IN (1, 2)
+ LEFT OUTER JOIN p.profils pp
+ WHERE
+ p.status.code in (1,2)
+ AND pp.id IN (
+ :observerProfilId,
+ :projectMemberProfilId,
+ :userProfilId
+ )
+ AND p.department.code LIKE 'PDG-%'
]]>
+ <query-param name="observerProfilId" type="java.lang.Integer"/>
+ <query-param name="projectMemberProfilId" type="java.lang.Integer"/>
+ <query-param name="userProfilId" type="java.lang.Integer"/>
</query>
- <!-- Get one persons [REF-07] -->
+ <!-- Get one persons [REF-07-1] -->
<query cacheable="true" name="person">
<![CDATA[
SELECT DISTINCT
p.id,
p.firstname,
p.lastname,
- p.department,
+ p.department.code,
p.status
FROM
PersonImpl p
@@ -291,10 +302,10 @@
<query-param name="speciesId" type="java.lang.Integer"/>
</query>
- <!-- TODO Fix it! Get all length step catacteristics [REF-09] -->
+ <!-- Get all length step catacteristics [REF-09] -->
<query cacheable="true" name="allLengthStepCaracteristics">
<![CDATA[
- SELECT
+ SELECT
p.id AS pmfmId,
p.parameter.name AS parameterName,
p.matrix.name AS matrixName,
@@ -302,13 +313,24 @@
p.method.name AS methodName,
p.parameter.isAlphanumeric AS isAlphanumeric,
p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
p.unit.symbol AS symbol,
p.status AS status
- FROM PmfmImpl p
- WHERE p.status.code IN (1, 2)
- AND p.parameter.code LIKE 'LENGTH_%' AND p.matrix.id = :matrixId
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id = :matrixId
+ AND p.parameter.isQualitative=false
+ AND p.parameter.isAlphanumeric=false
+ AND p.parameter.isCalculated=false
+ AND p.parameter.code not in (:ageParameterCode, :weightParameterCode)
+ AND p.method.id <> :methodDeclarationId
]]>
<query-param name="matrixId" type="java.lang.Integer"/>
+ <query-param name="ageParameterCode" type="java.lang.String"/>
+ <query-param name="weightParameterCode" type="java.lang.String"/>
+ <query-param name="methodDeclarationId" type="java.lang.Integer"/>
</query>
<!-- Get all gear caracteristics [REF-10] (use allPmfmsByMatrixId) -->
@@ -382,7 +404,7 @@
l.status as status
FROM LocationImpl l
WHERE l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
+ AND l.locationLevel.id = :locationLevelId
]]>
<query-param name="locationLevel" type="java.lang.Integer"/>
</query>
@@ -398,22 +420,22 @@
l.status as status
FROM LocationImpl l
WHERE l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
+ AND l.locationLevel.id = :locationLevelId
]]>
</query>
- <!-- Get all fishing operation locaties [REF-15] -->
+ <!-- Get all fishing operation localites [REF-15] -->
<query cacheable="true" name="allFishingOperationLocalites">
<![CDATA[
- SELECT
+ SELECT
l.id as locationId,
l.label as locationLabel,
l.name as locationName,
l.locationLevel.id as locationLevelId,
l.status as status
- FROM LocationImpl l
- WHERE l.status.code IN (1, 2)
- AND l.locationLevel.id = :locationLevelId
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
]]>
</query>
@@ -469,7 +491,7 @@
<!-- Get a pmfm caracteristics by this id [REF-24] -->
<query cacheable="true" name="pmfmById">
<![CDATA[
- SELECT
+ SELECT
p.id AS pmfmId,
p.parameter.name AS parameterName,
p.matrix.name AS matrixName,
@@ -482,9 +504,9 @@
p.precision,
p.unit.symbol AS symbol,
p.status AS status
- FROM PmfmImpl p
- WHERE p.status.code IN (1, 2)
- AND p.id= :pmfmId
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.id= :pmfmId
]]>
<query-param name="pmfmId" type="java.lang.Integer"/>
</query>
@@ -507,7 +529,7 @@
<!-- Get all pmfms using a same matrix Id -->
<query cacheable="true" name="allPmfmsByMatrixId">
<![CDATA[
- SELECT
+ SELECT
p.id AS pmfmId,
p.parameter.name AS parameterName,
p.matrix.name AS matrixName,
@@ -520,9 +542,9 @@
p.precision,
p.unit.symbol AS symbol,
p.status AS status
- FROM PmfmImpl p
- WHERE p.status.code IN (1, 2)
- AND p.matrix.id= :matrixId
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id= :matrixId
]]>
<query-param name="matrixId" type="java.lang.Integer"/>
</query>
@@ -530,7 +552,7 @@
<!-- Get all pmfms using a same parameter group id -->
<query cacheable="true" name="allPmfmsByParameterGroudId">
<![CDATA[
- SELECT
+ SELECT
p.id AS pmfmId,
p.parameter.name AS parameterName,
p.matrix.name AS matrixName,
@@ -543,9 +565,9 @@
p.precision,
p.unit.symbol AS symbol,
p.status AS status
- FROM PmfmImpl p
- WHERE p.status.code IN (1, 2)
- AND p.parameter.parameterGroup.id= :parameterGroupId
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
]]>
<query-param name="parameterGroupId" type="java.lang.Integer"/>
</query>
Modified: trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/tutti-persistence-adagio/src/main/resources/tutti-db-enumerations.properties 2013-01-11 16:17:12 UTC (rev 176)
@@ -305,7 +305,10 @@
#TODO Mettre la bonne valeur
LocationLevelId.PROGRAM=111
+MethodId.DECLARATION=1
+
MatrixId.BATCH=1
+MatrixId.INDIVIDUAL=2
ParameterGroupId.ENVIRONEMENT_MEASUREMENT=3
#TODO Mettre la bonne valeur
Added: trunk/tutti-persistence-adagio/src/main/site/rst/referential.rst
===================================================================
--- trunk/tutti-persistence-adagio/src/main/site/rst/referential.rst (rev 0)
+++ trunk/tutti-persistence-adagio/src/main/site/rst/referential.rst 2013-01-11 16:17:12 UTC (rev 176)
@@ -0,0 +1,435 @@
+.. -
+.. * #%L
+.. * Tutti :: Persistence Adagio (impl)
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2012 - 2013 Ifremer
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU General Public License as
+.. * published by the Free Software Foundation, either version 3 of the
+.. * License, or (at your option) any later version.
+.. *
+.. * This program is distributed in the hope that it will be useful,
+.. * but WITHOUT ANY WARRANTY; without even the implied warranty of
+.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.. * GNU General Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/gpl-3.0.html>.
+.. * #L%
+.. -
+
+===================
+Tutti - Référentiel
+===================
+
+Présentation
+~~~~~~~~~~~~
+
+Ce document décrit comment sont récupérer les données du référentiel.
+
+Chaque requète a un nom du style **[REF-XXX]**.
+
+[REF-01] Liste des zones d'une série de campagne
+------------------------------------------------
+
+::
+ SELECT
+ l.id,
+ l.label,
+ l.name,
+ l.status
+ FROM LocationImpl l
+ WHERE
+ l.locationLevel.id = :locationLevelId
+ AND l.status.code IN (1, 2)
+
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.PROGRAM*
+
+*État:* À Valider et définir la valeur de la constante.
+
+[REF-02] Liste des pays
+-----------------------
+
+::
+
+ SELECT
+ l.id,
+ l.label,
+ l.name,
+ l.status
+ FROM LocationImpl l
+ WHERE
+ l.locationLevel.id = :locationLevelId
+ AND l.status.code IN (1, 2)
+
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.PAYS_ISO3*
+
+*État:* Valide.
+
+[REF-03] liste des navires (scientifique)
+-----------------------------------------
+
+::
+
+ SELECT
+ v.code AS vesselCode,
+ vrp.registrationCode AS nationalRegistrationCode,
+ vrp.internationalRegistrationCode as internationalRegistrationCode,
+ vf.name AS vesselName,
+ v.status AS status
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselRegistrationPeriods AS vrp
+ LEFT OUTER JOIN v.vesselFeatures AS vf
+ WHERE v.vesselType.id = :vesselTypeId
+ AND v.status.code IN (1, 2)
+ AND vrp.vesselRegistrationPeriodPk.startDateTime =
+ (
+ SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
+ FROM VesselRegistrationPeriodImpl vrp2 WHERE
+ vrp2.vesselRegistrationPeriodPk.vessel.code = v.code
+ AND (vrp2.vesselRegistrationPeriodPk.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vrp2.vesselRegistrationPeriodPk.vessel.code
+ )
+ AND vf.startDateTime =
+ (
+ SELECT MAX(vf2.startDateTime)
+ FROM VesselFeaturesImpl vf2 WHERE
+ vf2.vessel.code = v.code
+ AND (vf2.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vf2.vessel.code
+ )
+
+
+Paramètres :
+
+- :gearClassificiationId = *VesselTypeId.SCIENTIFIC_RESEARCH_VESSEL*
+- :refDate = date (ou null)
+
+*État:* Valide mais à optimiser.
+
+[REF-04] liste des navires (pro)
+--------------------------------
+
+::
+
+ SELECT
+ v.code AS vesselCode,
+ vrp.registrationCode AS nationalRegistrationCode,
+ vrp.internationalRegistrationCode as internationalRegistrationCode,
+ vf.name AS vesselName,
+ v.status AS status
+ FROM
+ VesselImpl v
+ INNER JOIN v.vesselRegistrationPeriods AS vrp
+ LEFT OUTER JOIN v.vesselFeatures AS vf
+ WHERE v.vesselType.id = :vesselTypeId
+ AND v.status.code IN (1, 2)
+ AND vrp.vesselRegistrationPeriodPk.startDateTime =
+ (
+ SELECT MAX(vrp2.vesselRegistrationPeriodPk.startDateTime)
+ FROM VesselRegistrationPeriodImpl vrp2 WHERE
+ vrp2.vesselRegistrationPeriodPk.vessel.code = v.code
+ AND (vrp2.vesselRegistrationPeriodPk.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vrp2.vesselRegistrationPeriodPk.vessel.code
+ )
+ AND vf.startDateTime =
+ (
+ SELECT MAX(vf2.startDateTime)
+ FROM VesselFeaturesImpl vf2 WHERE
+ vf2.vessel.code = v.code
+ AND (vf2.startDateTime <= :refDate OR :refDate IS NULL)
+ GROUP BY vf2.vessel.code
+ )
+
+
+Paramètres :
+
+- :gearClassificiationId = *VesselTypeId.FISHING_VESSEL*
+- :refDate = date (ou null)
+
+*État:* Valide mais à optimiser.
+
+[REF-05] liste des engins (scientifique)
+----------------------------------------
+
+::
+
+ SELECT
+ g.id,
+ g.label,
+ g.name,
+ g.status AS status
+ FROM GearImpl g
+ WHERE
+ g.gearClassification.id= :gearClassificiationId
+ AND g.status.code IN (1, 2)
+
+
+Paramètres :
+
+- :gearClassificiationId = *GearClassificationId.SCIENTIFIC_CRUISE*
+
+*État:* Valide.
+
+[REF-06] liste des engins (scientifique)
+----------------------------------------
+
+::
+
+ SELECT
+ g.id,
+ g.label,
+ g.name,
+ g.status AS status
+ FROM GearImpl g
+ WHERE
+ g.gearClassification.id= :gearClassificiationId
+ AND g.status.code IN (1, 2)
+
+Paramètres :
+
+- :gearClassificiationId = *GearClassificationId.FAO*
+
+*État:* Valide.
+
+
+[REF-07] Liste des utilisateurs
+-------------------------------
+
+::
+
+ SELECT DISTINCT
+ p.id,
+ p.lastname,
+ p.firstname,
+ p.department.code,
+ p.status
+ FROM
+ PersonImpl p
+ LEFT OUTER JOIN p.profils pp
+ WHERE
+ p.status.code in (1,2)
+ AND pp.id IN (
+ :observerProfilId,
+ :projectMemberProfilId,
+ :userProfilId
+ )
+ AND p.department.code LIKE 'PDG-%'
+
+Paramètres :
+
+- :observerProfilId = *UserProfilId.OBSERVER*
+- :projectMemberProfilId = *UserProfilId.PROJECT_MEMBER*
+- :userProfilId = *UserProfilId.USER*
+
+*État:* Valide.
+
+
+[REF-08] Liste des espèces
+--------------------------
+
+::
+
+ voir TaxonSpecificDao.getAllTaxonRefTax()
+
+*État:* Valide.
+
+[REF-09] liste des mesures de classes de taille
+-----------------------------------------------
+
+::
+
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id = :matrixId
+ AND p.parameter.isQualitative=false
+ AND p.parameter.isAlphanumeric=false
+ AND p.parameter.isCalculated=false
+ AND p.parameter.code not in (:ageParameterCode, :weightParameterCode)
+ AND p.method.id <> :methodDeclarationId
+
+Paramètres :
+
+- :matrixId = *MatrixId.INDIVIDUAL*
+- :ageParameterCode = *ParameterCode.AGE*
+- :weightParameterCode= *ParameterCode.WEIGHT*
+- :methodDeclarationId = *MethodId.DECLARATION*
+
+*État:* Valide.
+
+[REF-10] Liste des pmfm (mise en oeuvre de l'engin)
+---------------------------------------------------
+
+::
+
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.matrix.id= :matrixId
+
+Paramètres :
+
+- :matrixId = *MatrixId.GEAR*
+
+*État:* Valide.
+
+[REF-11] liste des pmfm (environnement)
+---------------------------------------
+
+::
+
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
+
+Paramètres :
+
+- :parameterGroupId = *ParameterGroupId.ENVIRONEMENT_MEASUREMENT*
+
+*État:* Valide.
+
+[REF-12] liste des pmfm (environnement)
+---------------------------------------
+
+::
+
+ SELECT
+ p.id AS pmfmId,
+ p.parameter.name AS parameterName,
+ p.matrix.name AS matrixName,
+ p.fraction.name AS fractionName,
+ p.method.name AS methodName,
+ p.parameter.isAlphanumeric AS isAlphanumeric,
+ p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
+ p.unit.symbol AS symbol,
+ p.status AS status
+ FROM PmfmImpl p
+ WHERE p.status.code IN (1, 2)
+ AND p.parameter.parameterGroup.id= :parameterGroupId
+
+Paramètres :
+
+- :parameterGroupId = *ParameterGroupId.HYDROLOGIC_MEASUREMENT*
+
+*État:* Données non présentes en base.
+
+[REF-13] liste des strates
+--------------------------
+
+::
+
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.STRATA*
+
+*État:* Valide.
+
+[REF-14] liste des sous-strates
+--------------------------------
+
+::
+
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.SUBSTRATA*
+
+*État:* A valider, il faut trouver comment récupérer les valeurs par rapport
+à une strate.
+
+[REF-15] liste des localités
+----------------------------
+
+::
+
+ SELECT
+ l.id as locationId,
+ l.label as locationLabel,
+ l.name as locationName,
+ l.locationLevel.id as locationLevelId,
+ l.status as status
+ FROM LocationImpl l
+ WHERE l.status.code IN (1, 2)
+ AND l.locationLevel.id = :locationLevelId
+
+Paramètres :
+
+- :locationLevelId = *LocationLevelId.LOCALITE*
+
+*État:* A valider, il faut trouver comment récupérer les valeurs par rapport
+à une strate, sous-strate.
+
+
+
+
Property changes on: trunk/tutti-persistence-adagio/src/main/site/rst/referential.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/tutti-persistence-adagio/src/main/site/site_fr.xml (from rev 168, trunk/src/site/site_fr.xml)
===================================================================
--- trunk/tutti-persistence-adagio/src/main/site/site_fr.xml (rev 0)
+++ trunk/tutti-persistence-adagio/src/main/site/site_fr.xml 2013-01-11 16:17:12 UTC (rev 176)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Tutti
+ $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%
+ -->
+
+<project name="${project.name}">
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.3.0</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>false</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>true</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>./index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <publishDate position="right"/>
+ <version position="right"/>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven"
+ img="${project.url}/images/logos/maven-feather.png"/>
+
+ <logo href="http://docutils.sourceforge.net/rst.html"
+ name="ReStructuredText"
+ img="http://maven-site.nuiton.org/public/images/logos/restructuredtext-logo.png"/>
+
+ <logo href="http://maven-site.nuiton.org/jrst" name="JRst"
+ img="http://maven-site.nuiton.org/public/images/logos/jrst-logo.png"/>
+
+ <logo href="http://maven-site.nuiton.org/jaxx" name="JAXX"
+ img="http://maven-site.nuiton.org/public/images/logos/jaxx-logo.png"/>
+
+ <logo href="http://argouml.tigris.org/" name="ArgoUML"
+ img="http://maven-site.nuiton.org/public/images/logos/argouml-logo.png"/>
+
+ </poweredBy>
+
+ <body>
+
+ <head>
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/mavenpom-site.js">
+ </script>
+
+ <link rel="stylesheet" type="text/css"
+ href="http://maven-site.nuiton.org/public/css/mavenpom-site.css"/>
+ </head>
+
+ <breadcrumbs>
+ <item name="${project.name}"
+ href="${project.url}/index.html"/>
+ </breadcrumbs>
+
+ <menu name="Tutti">
+ <item name="Accueil" href="index.html"/>
+ <item name="Réferentiel" href="./referantial.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <div id='projectMetas' locale='fr'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.developerConnection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+ </body>
+</project>
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-11 16:17:12 UTC (rev 176)
@@ -98,7 +98,7 @@
public void getAllPerson() {
List<Person> result = dbResource.getDriver().getAllPerson();
Assert.assertNotNull(result);
- Assert.assertEquals(226, result.size());
+ Assert.assertEquals(123, result.size());
}
@@ -164,7 +164,7 @@
public void getAllSpeciesLengthStepCaracteristic() {
List<Caracteristic> result = dbResource.getDriver().getAllSpeciesLengthStepCaracteristic();
Assert.assertNotNull(result);
- Assert.assertEquals(0, result.size());
+ Assert.assertEquals(24, result.size());
}
@Test
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java 2013-01-11 14:50:40 UTC (rev 175)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java 2013-01-11 16:17:12 UTC (rev 176)
@@ -1,6 +1,30 @@
package fr.ifremer.tutti.ui.swing.util;
+/*
+ * #%L
+ * Tutti :: UI
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 - 2013 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/SwingValidatorMessageWidget.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/tutti-ui-swing/src/main/resources/icons/action-table-error.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
r175 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation java/fr/ifremer/tutti/ui/swing/util resources/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by kmorin@users.forge.codelutin.com 11 Jan '13
by kmorin@users.forge.codelutin.com 11 Jan '13
11 Jan '13
Author: kmorin
Date: 2013-01-11 15:50:40 +0100 (Fri, 11 Jan 2013)
New Revision: 175
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/175
Log:
mise en page de l'onglet des traits et calcul de la dur?\195?\169e
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.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/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-01-11 14:50:40 UTC (rev 175)
@@ -357,7 +357,8 @@
}
#dureeField {
- text: {getStringValue(model.getDuree())};
+ text: {fr.ifremer.tutti.ui.swing.util.TuttiUIUtil.getDuration(
+ model.getGearShootingStartDate(), model.getGearShootingEndDate(), "tutti.duration.format")};
enabled: false;
}
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 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-01-11 14:50:40 UTC (rev 175)
@@ -82,7 +82,7 @@
<field name='stationNumber' component='stationNumberField'/>
<field name='fishingOperationNumber'
component='fishingOperationNumberField'/>
- <field name='date' component='dateField'/>
+ <field name='gearShootingStartDate' component='gearShootingStartDateField'/>
<field name='comment' component='commentField'/>
<field name='saisisseur' component='saisisseurList'/>
<field name='gearShootingStartLatitude' component='gearShootingStartLatitudeDDField'/>
@@ -135,13 +135,6 @@
<NumberEditor id='fishingOperationNumberField'
constructorParams='this'/>
</cell>
- <cell>
- <JLabel id='dateLabel'/>
- </cell>
- <cell weightx='0.3'>
- <JXDatePicker id='dateField'
- onActionPerformed='handler.setDate(event, "date")'/>
- </cell>
</row>
<!-- Strate d'association / Sous Strate / Localité -->
@@ -290,57 +283,63 @@
constructorParams='this'/>
</cell>
</row>
- </Table>
- </JPanel>
- </cell>
- </row>
- <!-- Fishing operation valid / invalid-->
- <row>
- <cell>
- <JToolBar id='fishingOperationValidPanel'
- layout='{new BorderLayout()}'>
- <JButton id='resetValidStateButton'
- constraints='BorderLayout.WEST'
- onActionPerformed="model.setFishingOperationValid(null)"/>
- <JRadioButton id='fishingOperationResetRadio'
- constraints='BorderLayout.EAST'/>
- </JToolBar>
- </cell>
- <cell>
- <HBox>
- <JRadioButton id='fishingOperationValidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
- <JRadioButton id='fishingOperationInvalidRadio'
- onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
- </HBox>
- </cell>
- <cell columns="4">
- <JPanel/>
- </cell>
- </row>
+ <!-- FishingOperation rectiligne / distance chalutee / durée -->
+ <row>
+ <cell>
+ <JLabel/>
+ </cell>
+ <cell>
+ <JCheckBox id='fishingOperationRectiligneCheckBox'
+ onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
+ </cell>
+ <cell>
+ <JPanel layout="{new BorderLayout()}">
+ <JLabel id='distanceChaluteeLabel'
+ constraints='BorderLayout.WEST'/>
+ <NumberEditor id='distanceChaluteeField'
+ constraints='BorderLayout.CENTER'
+ constructorParams='this'/>
+ </JPanel>
+ </cell>
+ <cell>
+ <JLabel/>
+ </cell>
+ <cell>
+ <JPanel layout="{new BorderLayout()}">
+ <JLabel id='dureeLabel' constraints='BorderLayout.WEST'/>
+ <JTextField id='dureeField' constraints='BorderLayout.CENTER'/>
+ </JPanel>
+ </cell>
+ </row>
- <!-- FishingOperation rectiligne / distance chalutee / durée -->
- <row>
- <cell>
- <JCheckBox id='fishingOperationRectiligneCheckBox'
- onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
- </cell>
- <cell columns="3">
- <JPanel layout="{new BorderLayout()}">
- <JLabel id='distanceChaluteeLabel'
- constraints='BorderLayout.WEST'/>
- <NumberEditor id='distanceChaluteeField'
- constraints='BorderLayout.CENTER'
- constructorParams='this'/>
+ <!-- Fishing operation valid / invalid-->
+ <row>
+ <cell>
+ <JToolBar id='fishingOperationValidPanel'
+ layout='{new BorderLayout()}'>
+ <JButton id='resetValidStateButton'
+ constraints='BorderLayout.WEST'
+ onActionPerformed="model.setFishingOperationValid(null)"/>
+ <JRadioButton id='fishingOperationResetRadio'
+ constraints='BorderLayout.EAST'/>
+ </JToolBar>
+ </cell>
+ <cell>
+ <HBox>
+ <JRadioButton id='fishingOperationValidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.TRUE)'/>
+ <JRadioButton id='fishingOperationInvalidRadio'
+ onActionPerformed='model.setFishingOperationValid(Boolean.FALSE)'/>
+ </HBox>
+ </cell>
+ <cell columns="4">
+ <JPanel/>
+ </cell>
+ </row>
+ </Table>
</JPanel>
</cell>
- <cell anchor='west'>
- <JLabel id='dureeLabel'/>
- </cell>
- <cell fill='horizontal'>
- <JTextField id='dureeField'/>
- </cell>
</row>
<!-- Actions d'import -->
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-11 14:50:40 UTC (rev 175)
@@ -91,7 +91,6 @@
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,
@@ -102,7 +101,6 @@
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_SAISISSEUR,
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 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-11 14:50:40 UTC (rev 175)
@@ -32,6 +32,7 @@
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
+import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -61,8 +62,6 @@
public static final String PROPERTY_FISHING_OPERATION_NUMBER = "fishingOperationNumber";
- public static final String PROPERTY_DATE = "date";
-
public static final String PROPERTY_STRATA = "strata";
public static final String PROPERTY_SUB_STRATA = "subStrata";
@@ -109,8 +108,6 @@
public static final String PROPERTY_DISTANCE_CHALUTEE = "distanceChalutee";
- public static final String PROPERTY_DUREE = "duree";
-
public static final String PROPERTY_FISHING_OPERATION_VALID = "fishingOperationValid";
public static final String PROPERTY_LOCATION = "location";
@@ -134,8 +131,6 @@
protected Integer fishingOperationNumber;
- protected Date date;
-
protected FishingOperationLocation strata;
protected FishingOperationLocation subStrata;
@@ -156,22 +151,16 @@
protected Date gearShootingStartDate;
- protected Integer gearShootingStartTime;
-
protected Float gearShootingEndLatitude;
protected Float gearShootingEndLongitude;
protected Date gearShootingEndDate;
- protected Integer gearShootingEndTime;
-
protected boolean fishingOperationRectiligne;
protected Float distanceChalutee;
- protected Float duree;
-
protected Boolean fishingOperationValid;
protected FishingOperationLocation location;
@@ -254,16 +243,6 @@
firePropertyChange(PROPERTY_FISHING_OPERATION_NUMBER, oldValue, fishingOperationNumber);
}
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- Object oldValue = getDate();
- this.date = date;
- firePropertyChange(PROPERTY_DATE, oldValue, date);
- }
-
public FishingOperationLocation getStrata() {
return strata;
}
@@ -401,8 +380,11 @@
public void setGearShootingStartDate(Date gearShootingStartDate) {
Object oldValue = getGearShootingStartDate();
- this.gearShootingStartDate = gearShootingStartDate;
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DATE, oldValue, gearShootingStartDate);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(gearShootingStartDate);
+ calendar.set(Calendar.SECOND, 0);
+ this.gearShootingStartDate = calendar.getTime();
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_DATE, oldValue, this.gearShootingStartDate);
}
public Float getGearShootingEndLatitude() {
@@ -511,8 +493,11 @@
public void setGearShootingEndDate(Date gearShootingEndDate) {
Object oldValue = getGearShootingEndDate();
- this.gearShootingEndDate = gearShootingEndDate;
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DATE, oldValue, gearShootingEndDate);
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(gearShootingEndDate);
+ calendar.set(Calendar.SECOND, 0);
+ this.gearShootingEndDate = calendar.getTime();
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_DATE, oldValue, this.gearShootingEndDate);
}
public boolean isFishingOperationRectiligne() {
@@ -535,16 +520,6 @@
firePropertyChange(PROPERTY_DISTANCE_CHALUTEE, oldValue, distanceChalutee);
}
- public Float getDuree() {
- return duree;
- }
-
- public void setDuree(Float duree) {
- Object oldValue = getDuree();
- this.duree = duree;
- firePropertyChange(PROPERTY_DUREE, oldValue, duree);
- }
-
public Boolean getFishingOperationValid() {
return fishingOperationValid;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/TuttiUIUtil.java 2013-01-11 14:50:40 UTC (rev 175)
@@ -26,19 +26,23 @@
import com.google.common.base.Preconditions;
import fr.ifremer.tutti.service.TuttiServiceTechnicalException;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.io.File;
+import java.text.DateFormat;
+import java.util.Date;
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.decorator.HighlightPredicate;
import org.jdesktop.swingx.decorator.Highlighter;
import org.nuiton.util.FileUtil;
-import javax.swing.JOptionPane;
-import javax.swing.UIManager;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.io.File;
+import static org.nuiton.i18n.I18n._;
/**
* Created: 14/06/12
@@ -244,4 +248,15 @@
public static Highlighter newForegroundColorHighlighter(HighlightPredicate predicate, Color color) {
return new TuttiColorHighlighter(predicate, color, true);
}
+
+ public static String getDuration(Date startDate, Date endDate, String format) {
+ String duration = "";
+ DateFormat df = DateFormat.getTimeInstance();
+ if (startDate != null && endDate != null) {
+ log.info(df.format(startDate) + " " + df.format(endDate));
+ duration = DurationFormatUtils.formatPeriod(
+ startDate.getTime(), endDate.getTime() + 60000, _(format));
+ }
+ return duration;
+ }
}
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-error-validation.xml 2013-01-11 14:50:40 UTC (rev 175)
@@ -47,7 +47,7 @@
</field>
- <field name="date">
+ <field name="gearShootingStartDate">
<field-validator type="required" short-circuit="true">
<message>tutti.validator.error.fishingOperation.date.required</message>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-01-11 14:50:40 UTC (rev 175)
@@ -47,7 +47,7 @@
</field>
- <field name="date">
+ <field name="gearShootingStartDate">
<field-validator type="required" short-circuit="true">
<message>tutti.validator.error.fishingOperation.date.required</message>
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 14:19:36 UTC (rev 174)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 14:50:40 UTC (rev 175)
@@ -55,6 +55,7 @@
tutti.config.ui.config=Chemin du fichier de configuration des interfaces graphiques
tutti.config.ui.shortcut.closePopup=Fermer une popup
tutti.config.ui.showNumberEditorButton=Afficher le pavé numérique de saisie
+tutti.duration.format=dj Hh m'm'
tutti.label.attachmentEditor.file=Fichier
tutti.label.attachmentEditor.fileComment=Commentaire
tutti.label.attachmentEditor.fileName=Nom
@@ -199,14 +200,14 @@
tutti.table.benthos.batch.header.speciesByGenusCode=Espèce
tutti.table.benthos.batch.header.toConfirm=A Confirmer
tutti.table.benthos.batch.header.weight=Poids
-tutti.table.fishing.environment.header.key=Paramètre
+tutti.table.fishing.environment.header.key=Caractéristique
tutti.table.fishing.environment.header.value=Valeur
-tutti.table.fishing.gearShooting.header.key=Paramètre
+tutti.table.fishing.gearShooting.header.key=Caractéristique
tutti.table.fishing.gearShooting.header.value=Valeur
tutti.table.fishing.hydrology.header.averageValue=Moyenne
tutti.table.fishing.hydrology.header.gearShootingEndValue=Fin de traîne
tutti.table.fishing.hydrology.header.gearShootingStartValue=Début de traîne
-tutti.table.fishing.hydrology.header.key=Paramètre
+tutti.table.fishing.hydrology.header.key=Caractéristique
tutti.table.macrowaste.batch.header.comment=Commentaire
tutti.table.macrowaste.batch.header.file=Pièces jointes
tutti.table.macrowaste.batch.header.macroWasteCategory=Catégorie
1
0
r174 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation/catches/species java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split resources/i18n
by tchemit@users.forge.codelutin.com 11 Jan '13
by tchemit@users.forge.codelutin.com 11 Jan '13
11 Jan '13
Author: tchemit
Date: 2013-01-11 15:19:36 +0100 (Fri, 11 Jan 2013)
New Revision: 174
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/174
Log:
fix build
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-11 14:13:28 UTC (rev 173)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-11 14:19:36 UTC (rev 174)
@@ -81,7 +81,7 @@
#splitSpeciesBatchMenu {
text: "tutti.action.splitSpeciesBatch";
- toolTipTexttext: "tutti.action.splitSpeciesBatch.tip";
+ toolTipText: "tutti.action.splitSpeciesBatch.tip";
mnemonic: S;
actionIcon: batch-split;
enabled: {model.isTableViewModeAll() && model.isSplitSpeciesBatchEnabled()};
@@ -97,7 +97,7 @@
#removeSpeciesSubBatchMenu {
text: "tutti.action.removeSpeciesSubBatch";
- tooltiptext: "tutti.action.removeSpeciesSubBatch.tip";
+ toolTipText: "tutti.action.removeSpeciesSubBatch.tip";
mnemonic: R;
actionIcon: batch-delete;
enabled: {model.isTableViewModeAll() && model.isRemoveSpeciesSubBatchEnabled()};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-01-11 14:13:28 UTC (rev 173)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/split/SplitSpeciesBatchUIModel.java 2013-01-11 14:19:36 UTC (rev 174)
@@ -107,7 +107,7 @@
}
public Species getSpecies() {
- return batch == null ? null : batch.getSpeciesCategoryValue();
+ return batch == null ? null : batch.getSpecies();
}
public List<SampleCategoryType> getCategory() {
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 14:13:28 UTC (rev 173)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 14:19:36 UTC (rev 174)
@@ -24,10 +24,10 @@
tutti.action.reload.ui=Recharger l'interface graphique
tutti.action.removeCaracteristic=Supprimer la caractéristique
tutti.action.removeSpecies=Supprimer l'espèce
+tutti.action.removeSpeciesBatch=Supprimer le lot
+tutti.action.removeSpeciesBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils
tutti.action.removeSpeciesSubBatch=Supprimer les lots fils
tutti.action.removeSpeciesSubBatch.tip=Supprimer tous les lots fils du lot sélectionné
-tutti.action.removeSpeciesBatch=Supprimer le lot
-tutti.action.removeSpeciesBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils
tutti.action.reset.fishingOperationValidState=Réinitialiser
tutti.action.save=Enregistrer
tutti.action.selectCampaign=Campagne
@@ -237,6 +237,7 @@
tutti.table.species.batch.header.sexCategory=Sexe
tutti.table.species.batch.header.sizeCategory=Class. Tri
tutti.table.species.batch.header.sortedUnsortedCategory=V/HV
+tutti.table.species.batch.header.species=
tutti.table.species.batch.header.speciesCategory=Espèce
tutti.table.species.batch.header.toConfirm=A Confirmer
tutti.table.species.batch.header.weight=Poids
1
0
11 Jan '13
Author: tchemit
Date: 2013-01-11 15:13:28 +0100 (Fri, 11 Jan 2013)
New Revision: 173
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/173
Log:
refs #1807: [Persistence] Adagio r?\195?\169f?\195?\169rentiel (correction de certaines requetes)
refs #1810: [PROTOCOLE] Ecran de saisie (ajout nouvelles colonnes dans le mod?\195?\168le)
Removed:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeNode.java
Modified:
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java
trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesTableModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/TuttiPersistenceAdagioImpl.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -966,16 +966,16 @@
Caracteristic target = new Caracteristic();
target.setId(String.valueOf(source[0]));
- target.setParameterName(String.valueOf(source[1]));
- target.setMatrixName(String.valueOf(source[2]));
- target.setFractionName(String.valueOf(source[3]));
- target.setMethodName(String.valueOf(source[4]));
- target.setNumberType(Boolean.valueOf(source[5].toString()));
- target.setQualitativeType(Boolean.valueOf(source[6].toString()));
- target.setSignifFiguresNumber(Integer.valueOf(source[7].toString()));
- target.setMaximumNumberDecimals(Integer.valueOf(source[8].toString()));
- target.setPrecision(Float.valueOf(source[9].toString()));
- target.setUnit(String.valueOf(source[10]));
+ target.setParameterName((String)source[1]);
+ target.setMatrixName((String)source[2]);
+ target.setFractionName((String)source[3]);
+ target.setMethodName((String)source[4]);
+ target.setNumberType((Boolean)source[5]);
+ target.setQualitativeType((Boolean)source[6]);
+ target.setSignifFiguresNumber((Integer)source[7]);
+ target.setMaximumNumberDecimals((Integer)source[8]);
+ target.setPrecision((Float)source[9]);
+ target.setUnit((String)source[10]);
setStatus((fr.ifremer.adagio.core.dao.referential.Status) source[11], target);
return target;
}
Modified: trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java
===================================================================
--- trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-persistence-adagio/src/main/java/fr/ifremer/tutti/persistence/config/TuttiPersistenceAdagioConfigOption.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -62,8 +62,8 @@
true),
DB_ENUMERATION_PATH(
"tutti.persistence.db.enumerationPath",
- "Chemin du fichier de correspondance des énumérations",
- "${tutti.data.directory}/enumerations.properties",
+ "Chemin du fichier de correspondance des constantes",
+ "${tutti.data.directory}/enumerations-v3.properties",
File.class,
true,
true),
Modified: trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml
===================================================================
--- trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-persistence-adagio/src/main/resources/queries-override.hbm.xml 2013-01-11 14:13:28 UTC (rev 173)
@@ -24,7 +24,7 @@
-->
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--<fetch-profile name="tutti">-->
@@ -90,9 +90,9 @@
sc.program.code AS programCode,
year(sc.departureDateTime) AS year,
sc.name,
- lh.locationHierarchyPk.parent.location.id AS countryId,
- lh.locationHierarchyPk.parent.location.label AS countryLabel,
- lh.locationHierarchyPk.parent.location.name AS countryName,
+ lh.locationHierarchyPk.parent.id AS countryId,
+ lh.locationHierarchyPk.parent.label AS countryLabel,
+ lh.locationHierarchyPk.parent.name AS countryName,
sc.departureDateTime,
sc.returnDateTime,
sc.vessel.code as vesselCode,
@@ -237,7 +237,7 @@
p.id,
p.firstname,
p.lastname,
- p.department,
+ p.department.name,
p.status
FROM
PersonImpl p
@@ -477,6 +477,9 @@
p.method.name AS methodName,
p.parameter.isAlphanumeric AS isAlphanumeric,
p.parameter.isQualitative AS isQualitative,
+ p.signifFiguresNumber,
+ p.maximumNumberDecimals,
+ p.precision,
p.unit.symbol AS symbol,
p.status AS status
FROM PmfmImpl p
Modified: trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java
===================================================================
--- trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-persistence-adagio/src/test/java/fr/ifremer/tutti/persistence/ReferentialTest.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -50,8 +50,6 @@
@ClassRule
public static final DatabaseResource dbResource = new DatabaseResource();
-
-
@Test
public void getAllProgramZone() {
List<Zone> result = dbResource.getDriver().getAllProgramZone();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SampleCategoryType.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -40,9 +40,6 @@
* @since 0.3
*/
public enum SampleCategoryType implements DecoratorService.LabelAware {
- species(
- n_("tutti.sampleCategoryType.species"),
- SampleCategoryEnum.species),
sortedUnsorted(
n_("tutti.sampleCategoryType.sortedUnsorted"),
SampleCategoryEnum.sortedUnsorted),
@@ -86,7 +83,6 @@
static {
enumToType = Maps.newEnumMap(SampleCategoryEnum.class);
- enumToType.put(SampleCategoryEnum.species, species);
enumToType.put(SampleCategoryEnum.sortedUnsorted, sortedUnsorted);
enumToType.put(SampleCategoryEnum.size, size);
enumToType.put(SampleCategoryEnum.sex, sex);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchRowModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -52,12 +52,8 @@
public static final String PROPERTY_SPECIES_TO_CONFIRM = "speciesToConfirm";
- public static final String PROPERTY_SPECIES_CATEGORY = "speciesCategory";
+ public static final String PROPERTY_SPECIES = "species";
- public static final String PROPERTY_SPECIES_CATEGORY_VALUE = "speciesCategoryValue";
-
- public static final String PROPERTY_SPECIES_CATEGORY_WEIGHT = "speciesCategoryWeight";
-
public static final String PROPERTY_SORTED_UNSORTED_CATEGORY = "sortedUnsortedCategory";
public static final String PROPERTY_SORTED_UNSORTED_CATEGORY_VALUE = "sortedUnsortedCategoryValue";
@@ -113,11 +109,11 @@
public static final String PROPERTY_SAMPLE_CATEGORY = "sampleCategory";
/**
- * Species category.
+ * Species.
*
- * @since 0.2
+ * @since 0.3
*/
- protected SampleCategory<Species> speciesCategory;
+ protected Species species;
/**
* Is catch is vrac or horsVrac?.
@@ -247,7 +243,6 @@
public SpeciesBatchRowModel() {
super(SpeciesBatch.class, fromBeanBinder, toBeanBinder);
frequency = Lists.newArrayList();
- speciesCategory = SampleCategory.newSample(SampleCategoryType.species);
sortedUnsortedCategory = SampleCategory.newSample(SampleCategoryType.sortedUnsorted);
sizeCategory = SampleCategory.newSample(SampleCategoryType.size);
sexCategory = SampleCategory.newSample(SampleCategoryType.sex);
@@ -281,10 +276,6 @@
public SampleCategory<?> getSampleCategory(SampleCategoryEnum sampleCategoryEnum) {
switch (sampleCategoryEnum) {
-
- case species:
- sampleCategory = getSpeciesCategory();
- break;
case sortedUnsorted:
sampleCategory = getSortedUnsortedCategory();
break;
@@ -309,34 +300,16 @@
//-- Species category --//
//------------------------------------------------------------------------//
- public SampleCategory<Species> getSpeciesCategory() {
- return speciesCategory;
+ public Species getSpecies() {
+ return species;
}
- public void setSpeciesCategory(SampleCategory<Species> speciesCategory) {
- Object oldCategory = getSpeciesCategory();
- Object oldValue = getSpeciesCategoryValue();
- Object oldWeight = getSpeciesCategoryWeight();
- this.speciesCategory = speciesCategory;
- firePropertyChange(PROPERTY_SPECIES_CATEGORY, oldCategory, speciesCategory);
- firePropertyChange(PROPERTY_SPECIES_CATEGORY_VALUE, oldValue, getSpeciesCategoryValue());
- firePropertyChange(PROPERTY_SPECIES_CATEGORY_WEIGHT, oldWeight, getSpeciesCategoryWeight());
+ public void setSpecies(Species species) {
+ Object oldCategory = getSpecies();
+ this.species = species;
+ firePropertyChange(PROPERTY_SPECIES, oldCategory, species);
}
- public Species getSpeciesCategoryValue() {
- return speciesCategory.getCategoryValue();
- }
-
- public Float getSpeciesCategoryWeight() {
- return speciesCategory.getCategoryWeight();
- }
-
- public void setSpeciesCategoryWeight(Float speciesCategoryWeight) {
- Object oldValue = getSpeciesCategoryWeight();
- speciesCategory.setCategoryWeight(speciesCategoryWeight);
- firePropertyChange(PROPERTY_SPECIES_CATEGORY_WEIGHT, oldValue, speciesCategoryWeight);
- }
-
//------------------------------------------------------------------------//
//-- SortedUnsorted category --//
//------------------------------------------------------------------------//
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTableModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -84,12 +84,10 @@
}
}
- public static final ColumnIdentifier<SpeciesBatchRowModel> SPECIES_CATEGORY = SampleColumnIdentifier.newId(
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY_WEIGHT,
- SampleCategoryType.species,
- n_("tutti.table.species.batch.header.speciesCategory"),
- n_("tutti.table.species.batch.header.speciesCategory"));
+ public static final ColumnIdentifier<SpeciesBatchRowModel> SPECIES = ColumnIdentifier.newId(
+ SpeciesBatchRowModel.PROPERTY_SPECIES,
+ n_("tutti.table.species.batch.header.species"),
+ n_("tutti.table.species.batch.header.species"));
public static final ColumnIdentifier<SpeciesBatchRowModel> SORTED_UNSORTED_CATEGORY = SampleColumnIdentifier.newId(
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
@@ -193,7 +191,6 @@
frequencyCols.add(COMPUTED_WEIGHT);
sampleCols = Sets.newHashSet();
- sampleCols.add(SPECIES_CATEGORY);
sampleCols.add(SORTED_UNSORTED_CATEGORY);
sampleCols.add(SIZE_CATEGORY);
sampleCols.add(SEX_CATEGORY);
@@ -266,7 +263,7 @@
SpeciesBatchRowModel entry = getEntry(rowIndex);
// check from protocol what is possible ?
- Species species = entry.getSpeciesCategoryValue();
+ Species species = entry.getSpecies();
if (species == null) {
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -1,293 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%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.HashMultimap;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Multimap;
-import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
-import org.apache.commons.collections.CollectionUtils;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SpeciesBatchTreeModel implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Root node (with no sampling on it.
- *
- * @since 0.2
- */
- protected final SpeciesBatchTreeNode root;
-
- /**
- * Property which are used to sub sampling.
- *
- * @since 0.2
- */
- protected String[] samplingOrder;
-
- /**
- * Mapping from row to node.
- *
- * @since 0.2
- */
- protected final Map<SpeciesBatchRowModel, SpeciesBatchTreeNode> rowToNode;
-
- /**
- * Mapping from node to row.
- *
- * @since 0.2
- */
- protected final Multimap<SpeciesBatchTreeNode, SpeciesBatchRowModel> nodeToRow;
-
- public SpeciesBatchTreeModel(String... samplingOrder) {
- this.samplingOrder = samplingOrder;
- root = new SpeciesBatchTreeNode();
- rowToNode = Maps.newHashMap();
- nodeToRow = HashMultimap.create();
- }
-
-// public void populate(List<SpeciesBatchRowModel> rows) {
-//
-// clear();
-//
-// for (SpeciesBatchRowModel row : rows) {
-//
-// SpeciesBatchTreeNode node = getSamplingNode(row);
-//
-// // check if row is valid
-// boolean rowIsValid = isValid(row, node);
-//
-// // set it in row
-// row.setValid(rowIsValid);
-// }
-// }
-
- public String[] getSamplingOrder() {
- return samplingOrder;
- }
-
- public void setSamplingOrder(String... samplingOrder) {
- this.samplingOrder = samplingOrder;
- clear();
- }
-
- protected void clear() {
- // clear tree representation
- root.removeAllChildren();
-
- // clear mappings
- rowToNode.clear();
- nodeToRow.clear();
- }
-
- public SpeciesBatchTreeNode removeNodeFromCache(SpeciesBatchRowModel row) {
- SpeciesBatchTreeNode result = rowToNode.remove(row);
- if (result != null) {
-
- nodeToRow.remove(result, row);
- }
- return result;
- }
-
- public SpeciesBatchTreeNode getSamplingNode(SpeciesBatchRowModel row) {
-
- // search frist in cache
- SpeciesBatchTreeNode result = rowToNode.get(row);
-
- if (result == null) {
-
- // not in cache must build the path
- result = getSamplingNode(root, 0, row);
-
- if (result == root) {
-
- // this means an empty row, so no node for it
- result = null;
-
- } else {
-
- // found a row with a sampling, add it in cache
- rowToNode.put(row, result);
- nodeToRow.put(result, row);
- }
- }
- return result;
- }
-
- protected SpeciesBatchTreeNode getSamplingNode(SpeciesBatchTreeNode node,
- int samplingIndex,
- SpeciesBatchRowModel row) {
-
- String samplingKey = samplingOrder[samplingIndex];
-
- Serializable samplingValue = (Serializable)
- TuttiUIUtil.getProperty(row, samplingKey);
-
- SpeciesBatchTreeNode result;
-
- if (samplingValue == null) {
-
- // was already on last sampling node
- result = node;
- } else {
-
- result = node.getChild(samplingValue);
-
- if (result == null) {
-
- // new node, creates it and add it as child of current node
- result = new SpeciesBatchTreeNode(samplingKey, samplingValue);
- node.add(result);
- }
-
- if (samplingIndex < samplingOrder.length) {
-
- // can try to find yet another sampling level
- result = getSamplingNode(result, samplingIndex + 1, row);
- }
- }
-
- return result;
- }
-
-// public SamplingContext createSamplingContext(SpeciesBatchTreeNode rootNode) {
-//
-// Set<SpeciesBatchRowModel> childRows = Sets.newHashSet();
-//
-// SpeciesBatchRowModel superSamplingRow = getNodeToRow(rootNode);
-//
-// float totalWeight = 0f;
-// for (int i = 0, nbChildren = rootNode.getChildCount(); i < nbChildren; i++) {
-// SpeciesBatchTreeNode node = rootNode.getChildAt(i);
-//
-// SpeciesBatchRowModel row = getNodeToRow(node);
-// if (row != null) {
-// CaracteristicQualitativeValue sortedUnsortedCategory =
-// row.getSortedUnsortedCategory();
-// if (sortedUnsortedCategory != null &&
-// "unsorted".equals(sortedUnsortedCategory.getName())) {
-//
-// // never take account of a such child
-//
-// } else {
-//
-// childRows.add(row);
-// Float weight = row.getWeight();
-// if (weight != null) {
-// totalWeight += weight;
-// }
-// }
-// }
-// }
-// SamplingContext result = new SamplingContext(rootNode,
-// superSamplingRow,
-// childRows,
-// totalWeight);
-// return result;
-// }
-
- public SpeciesBatchRowModel getNodeToRow(SpeciesBatchTreeNode node) {
- Collection<SpeciesBatchRowModel> rows = nodeToRow.get(node);
-
- SpeciesBatchRowModel result = null;
- if (CollectionUtils.isNotEmpty(rows)) {
- for (SpeciesBatchRowModel next : rows) {
- if (next.isValid()) {
- result = next;
- break;
- }
- }
- }
- return result;
- }
-
- public boolean isValid(SpeciesBatchRowModel row, SpeciesBatchTreeNode newNode) {
-
- // row must be on a sampling and having a weight
- boolean result = row.getWeight() != null && newNode != null;
-
- // make sure there is not already another row for this node
- if (result && CollectionUtils.size(nodeToRow.get(newNode)) > 1) {
- result = false;
- }
-
- return result;
- }
-
-// public static class SamplingContext {
-//
-// private final SpeciesBatchTreeNode rootNode;
-//
-// private final SpeciesBatchRowModel superSamplingRow;
-//
-// private final Set<SpeciesBatchRowModel> samplingRows;
-//
-// private final float totalWeight;
-//
-// public SamplingContext(SpeciesBatchTreeNode rootNode,
-// SpeciesBatchRowModel superSamplingRow,
-// Set<SpeciesBatchRowModel> samplingRows,
-// float totalWeight) {
-// this.rootNode = rootNode;
-// this.superSamplingRow = superSamplingRow;
-// this.samplingRows = samplingRows;
-// this.totalWeight = totalWeight;
-// }
-//
-// public SpeciesBatchTreeNode getRootNode() {
-// return rootNode;
-// }
-//
-// public SpeciesBatchRowModel getSuperSamplingRow() {
-// return superSamplingRow;
-// }
-//
-// public Set<SpeciesBatchRowModel> getSamplingRows() {
-// return samplingRows;
-// }
-//
-// public float getTotalWeight() {
-// return totalWeight;
-// }
-//
-// public void applyNewSampleValues(float samplingWeight,
-// Float samplingRatio) {
-//
-// for (SpeciesBatchRowModel row : samplingRows) {
-// row.setSampleWeight(samplingWeight);
-// row.setSamplingRatio(samplingRatio);
-// }
-// }
-// }
-}
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeNode.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeNode.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchTreeNode.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -1,175 +0,0 @@
-package fr.ifremer.tutti.ui.swing.content.operation.catches.species;
-
-/*
- * #%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 org.apache.commons.lang3.ObjectUtils;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-import java.io.Serializable;
-import java.util.Arrays;
-
-/**
- * Defines a node of a species catches sampling.
- * <p/>
- * A path in the tree gives a sampling path.
- * <p/>
- * UserObject is the {@code samplingValue}. It can be null only on root node.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SpeciesBatchTreeNode extends DefaultMutableTreeNode {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Property name defining the sampling.
- * <p/>
- * <strong>Note:</strong> can be null (only for root node).
- *
- * @since 0.2
- */
- protected final String samplingKey;
-
- public SpeciesBatchTreeNode() {
- this(null, null);
- }
-
- public SpeciesBatchTreeNode(String samplingKey,
- Serializable samplingValue) {
- this.samplingKey = samplingKey;
- setUserObject(samplingValue);
- }
-
- public String getSamplingPropertyKey() {
- return samplingKey;
- }
-
- public boolean matchSamplingValue(Serializable value) {
- Serializable samplingValue = getUserObject();
-
- boolean result = ObjectUtils.equals(value, samplingValue);
- return result;
- }
-
- public SpeciesBatchTreeNode getChild(Serializable samplingValue) {
- SpeciesBatchTreeNode result = null;
-
- for (int i = 0, max = getChildCount(); i < max; i++) {
- SpeciesBatchTreeNode child = getChildAt(i);
- if (child.matchSamplingValue(samplingValue)) {
-
- // found matching child
- result = child;
- break;
- }
- }
- return result;
- }
-
- @Override
- public Serializable getUserObject() {
- return (Serializable) super.getUserObject();
- }
-
- @Override
- public SpeciesBatchTreeNode getChildAt(int index) {
- return (SpeciesBatchTreeNode) super.getChildAt(index);
- }
-
- @Override
- public SpeciesBatchTreeNode getParent() {
- return (SpeciesBatchTreeNode) super.getParent();
- }
-
- @Override
- public SpeciesBatchTreeNode getRoot() {
- return (SpeciesBatchTreeNode) super.getRoot();
- }
-
- @Override
- public SpeciesBatchTreeNode getFirstChild() {
- return (SpeciesBatchTreeNode) super.getFirstChild();
- }
-
- @Override
- public SpeciesBatchTreeNode getLastChild() {
- return (SpeciesBatchTreeNode) super.getLastChild();
- }
-
- @Override
- public SpeciesBatchTreeNode getChildAfter(TreeNode aChild) {
- return (SpeciesBatchTreeNode) super.getChildAfter(aChild);
- }
-
- @Override
- public SpeciesBatchTreeNode getChildBefore(TreeNode aChild) {
- return (SpeciesBatchTreeNode) super.getChildBefore(aChild);
- }
-
- @Override
- public SpeciesBatchTreeNode getNextSibling() {
- return (SpeciesBatchTreeNode) super.getNextSibling();
- }
-
- @Override
- public SpeciesBatchTreeNode getPreviousSibling() {
- return (SpeciesBatchTreeNode) super.getPreviousSibling();
- }
-
- @Override
- public SpeciesBatchTreeNode getFirstLeaf() {
- return (SpeciesBatchTreeNode) super.getFirstLeaf();
- }
-
- @Override
- public SpeciesBatchTreeNode getLastLeaf() {
- return (SpeciesBatchTreeNode) super.getLastLeaf();
- }
-
- @Override
- public SpeciesBatchTreeNode getNextLeaf() {
- return (SpeciesBatchTreeNode) super.getNextLeaf();
- }
-
- @Override
- public SpeciesBatchTreeNode getPreviousLeaf() {
- return (SpeciesBatchTreeNode) super.getPreviousLeaf();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SpeciesBatchTreeNode)) return false;
-
- SpeciesBatchTreeNode that = (SpeciesBatchTreeNode) o;
-
- Object[] path = getUserObjectPath();
- Object[] path2 = that.getUserObjectPath();
- return Arrays.equals(path, path2);
- }
-
-}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.css 2013-01-11 14:13:28 UTC (rev 173)
@@ -81,16 +81,26 @@
#splitSpeciesBatchMenu {
text: "tutti.action.splitSpeciesBatch";
+ toolTipTexttext: "tutti.action.splitSpeciesBatch.tip";
mnemonic: S;
actionIcon: batch-split;
- enabled: {model.isSplitSpeciesBatchEnabled()};
+ enabled: {model.isTableViewModeAll() && model.isSplitSpeciesBatchEnabled()};
}
+#removeSpeciesBatchMenu {
+ text: "tutti.action.removeSpeciesBatch";
+ toolTipText: "tutti.action.removeSpeciesBatch.tip";
+ mnemonic: R;
+ actionIcon: batch-delete;
+ enabled: {model.isTableViewModeAll() && model.isRemoveSpeciesBatchEnabled()};
+}
+
#removeSpeciesSubBatchMenu {
text: "tutti.action.removeSpeciesSubBatch";
+ tooltiptext: "tutti.action.removeSpeciesSubBatch.tip";
mnemonic: R;
actionIcon: batch-delete;
- enabled: {model.isRemoveSpeciesSubBatchEnabled()};
+ enabled: {model.isTableViewModeAll() && model.isRemoveSpeciesSubBatchEnabled()};
}
#table {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-01-11 14:13:28 UTC (rev 173)
@@ -84,6 +84,8 @@
<!--onPopupMenuWillBecomeVisible='handler.updateTablePopup()'>-->
<JMenuItem id='splitSpeciesBatchMenu'
onActionPerformed='handler.splitSpeciesBatch()'/>
+ <JMenuItem id='removeSpeciesBatchMenu'
+ onActionPerformed='handler.removeSpeciesBatch()'/>
<JMenuItem id='removeSpeciesSubBatchMenu'
onActionPerformed='handler.removeSpeciesSubBatch()'/>
</JPopupMenu>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIHandler.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -85,13 +85,12 @@
public static final Set<String> SAMPLING_PROPERTIES = Sets.newHashSet(
SpeciesBatchRowModel.PROPERTY_SAMPLE_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY,
+ SpeciesBatchRowModel.PROPERTY_SPECIES,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY,
SpeciesBatchRowModel.PROPERTY_MATURITY_CATEGORY,
SpeciesBatchRowModel.PROPERTY_AGE_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY_WEIGHT,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY_WEIGHT,
SpeciesBatchRowModel.PROPERTY_SEX_CATEGORY_WEIGHT,
@@ -115,8 +114,7 @@
SpeciesBatchUI ui) {
super(parentUi,
SpeciesBatchRowModel.PROPERTY_SPECIES_TO_CONFIRM,
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY,
- SpeciesBatchRowModel.PROPERTY_SPECIES_CATEGORY_WEIGHT,
+ SpeciesBatchRowModel.PROPERTY_SPECIES,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY,
SpeciesBatchRowModel.PROPERTY_SORTED_UNSORTED_CATEGORY_WEIGHT,
SpeciesBatchRowModel.PROPERTY_SIZE_CATEGORY,
@@ -173,13 +171,13 @@
// root batch sample categroy is species
Preconditions.checkState(
- aBatch.getSampleCategoryType() == SampleCategoryEnum.species,
+ aBatch.getSampleCategoryType() == SampleCategoryEnum.sortedUnsorted,
"Root species batch must be a species sample " +
"category but was:" + aBatch.getSampleCategoryType());
SpeciesBatchRowModel rootRow =
loadSpeciesBatch(aBatch, null, rows);
- speciesUsed.add(rootRow.getSpeciesCategoryValue());
+ speciesUsed.add(rootRow.getSpecies());
}
availableSpecies.removeAll(speciesUsed);
}
@@ -209,10 +207,10 @@
// a row is valid if species category is not empty and valid
// then if any of none empty category is valid
- boolean result = !row.getSpeciesCategory().isEmpty() &&
- row.getSpeciesCategory().isValid();
+ boolean result = row.getSpecies() != null &&
+ !row.getSortedUnsortedCategory().isEmpty() &&
+ row.getSortedUnsortedCategory().isValid();
- result &= row.getSortedUnsortedCategory().isEmptyOrValid();
result &= row.getSizeCategory().isEmptyOrValid();
result &= row.getSexCategory().isEmptyOrValid();
result &= row.getMaturityCategory().isEmptyOrValid();
@@ -292,7 +290,10 @@
}
@Override
- protected void onRowValidStateChanged(int rowIndex, SpeciesBatchRowModel row, Boolean oldValue, Boolean newValue) {
+ protected void onRowValidStateChanged(int rowIndex,
+ SpeciesBatchRowModel row,
+ Boolean oldValue,
+ Boolean newValue) {
super.onRowValidStateChanged(rowIndex, row, oldValue, newValue);
// when row valid state has changed, recompute action enabled states
@@ -383,11 +384,8 @@
Species species = persistenceService.getSpecies(
protocolSpecy.getSpeciesId());
allSpecies.add(species);
- speciesSampleCategories.put(species, SampleCategoryType.species);
+ speciesSampleCategories.put(species, SampleCategoryType.sortedUnsorted);
- if (protocolSpecy.isSortedUnsortedEnabled()) {
- speciesSampleCategories.put(species, SampleCategoryType.sortedUnsorted);
- }
if (protocolSpecy.isSizeEnabled()) {
speciesSampleCategories.put(species, SampleCategoryType.size);
}
@@ -417,7 +415,6 @@
// each species can use any category
for (Species species : allSpecies) {
- speciesSampleCategories.put(species, SampleCategoryType.species);
speciesSampleCategories.put(species, SampleCategoryType.sortedUnsorted);
speciesSampleCategories.put(species, SampleCategoryType.size);
speciesSampleCategories.put(species, SampleCategoryType.sex);
@@ -446,12 +443,12 @@
Decorator<CaracteristicQualitativeValue> caracteristicDecorator =
getDecorator(CaracteristicQualitativeValue.class, null);
- { // SpeciesCategory column
+ { // Species column
- addSampleCategoryColumnToModel(columnModel,
- SpeciesBatchTableModel.SPECIES_CATEGORY,
- getDecorator(Species.class, null),
- defaultRenderer);
+ addColumnToModel(columnModel,
+ null,
+ newTableCellRender(Species.class),
+ SpeciesBatchTableModel.SPECIES);
}
{ // SortedUnsortedCategory column
@@ -597,12 +594,11 @@
SpeciesBatchTableModel tableModel = getTableModel();
SpeciesBatchRowModel newRow = tableModel.createNewRow();
- SampleCategory<Species> speciesCategory = newRow.getSpeciesCategory();
Species species = createModel.getSpecies();
- speciesCategory.setCategoryValue(species);
- speciesCategory.setCategoryWeight(createModel.getBatchWeight());
- newRow.setSampleCategory(speciesCategory);
+ newRow.setSpecies(species);
+ //TODO Add sortedUnosrtedCategory
+
recomputeRowValidState(newRow);
tableModel.addNewRow(newRow);
@@ -699,6 +695,77 @@
// table.requestFocus();
}
+ public void removeSpeciesBatch() {
+
+ JXTable table = getTable();
+
+ int rowIndex = table.getSelectedRow();
+
+ Preconditions.checkState(rowIndex != -1,
+ "Cant remove batch if no batch selected");
+
+ SpeciesBatchTableModel tableModel = getTableModel();
+ SpeciesBatchRowModel selectedBatch = tableModel.getEntry(rowIndex);
+
+ Preconditions.checkState(!TuttiEntities.isNew(selectedBatch),
+ "Can't remove batch if batch is not persisted");
+
+ if (!selectedBatch.isBatchRoot()) {
+
+ // remove all sub batches of his parent
+
+ SpeciesBatchRowModel parentBatch = selectedBatch.getBatchParent();
+
+ // get parent row index
+ int parentIndex = tableModel.getRowIndex(parentBatch);
+
+ // select it
+ table.setRowSelectionInterval(parentIndex, parentIndex);
+
+ // remove all his children
+ removeSpeciesSubBatch();
+
+ } else {
+
+ // remove selected batch and all his children
+
+ // collect of rows to remove from model
+ Set<SpeciesBatchRowModel> rowToRemove =
+ Sets.newHashSet(selectedBatch);
+
+ collectChilds(selectedBatch, rowToRemove);
+
+ // remove all rows from the model
+ getModel().getRows().removeAll(rowToRemove);
+
+ // remove childs from parent batch
+ selectedBatch.setBatchChilds(null);
+
+ // save parent batch (will destroy all his childs from db)
+ persistenceService.deleteSpeciesBatch(selectedBatch.getId());
+
+ // refresh table from parent batch row index to the end
+ tableModel.fireTableDataChanged();
+
+ if (tableModel.getRowCount() > 0) {
+
+ // select first row
+ AbstractSelectTableAction.doSelectCell(table, 0, 0);
+ } else {
+
+ table.clearSelection();
+ }
+
+ if (table.isEditing()) {
+
+ // but no edit it
+ table.getCellEditor().stopCellEditing();
+ }
+ }
+
+
+ }
+
public void removeSpeciesSubBatch() {
JXTable table = getTable();
@@ -903,6 +970,7 @@
boolean enableSplit = false;
boolean enableRemove = false;
+ boolean enableRemoveSub = false;
if (rowIndex != -1) {
@@ -920,6 +988,7 @@
enableSplit = true;
enableRemove = true;
+ enableRemoveSub = true;
}
if (enableSplit) {
@@ -931,13 +1000,20 @@
if (enableRemove) {
- // can remove sub batch if selected batch is not a leaf
+ // can remove batch if selected batch is not a leaf
enableRemove = !row.isBatchLeaf();
}
+
+ if (enableRemoveSub) {
+
+ // can remove sub batch if selected batch is not a leaf
+ enableRemoveSub = !row.isBatchLeaf();
+ }
}
getModel().setCreateSpeciesBatchEnabled(enableAdd);
getModel().setSplitSpeciesBatchEnabled(enableSplit);
- getModel().setRemoveSpeciesSubBatchEnabled(enableRemove);
+ getModel().setRemoveSpeciesBatchEnabled(enableRemove);
+ getModel().setRemoveSpeciesSubBatchEnabled(enableRemoveSub);
}
@@ -1019,9 +1095,7 @@
newRow.setSpeciesToConfirm(parentRow.getSpeciesToConfirm());
newRow.setBatchParent(parentRow);
- if (sampleCategoryEnum != SampleCategoryEnum.species) {
- newRow.setSpeciesCategory(parentRow.getSpeciesCategory());
- }
+ newRow.setSpecies(parentRow.getSpecies());
if (sampleCategoryEnum != SampleCategoryEnum.sortedUnsorted) {
newRow.setSortedUnsortedCategory(parentRow.getSortedUnsortedCategory());
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUIModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -50,6 +50,7 @@
public static final String PROPERTY_SPLIT_SPECIES_BATCH_ENABLED = "splitSpeciesBatchEnabled";
public static final String PROPERTY_REMOVE_SPECIES_SUB_BATCH_ENABLED = "removeSpeciesSubBatchEnabled";
+ public static final String PROPERTY_REMOVE_SPECIES_BATCH_ENABLED = "removeSpeciesBatchEnabled";
/**
* Sampling order (sets by protocol).
@@ -94,6 +95,13 @@
protected boolean splitSpeciesBatchEnabled;
/**
+ * Can user remove a selected species batch?
+ *
+ * @since 0.3
+ */
+ protected boolean removeSpeciesBatchEnabled;
+
+ /**
* Can user remove a selected species sub batches?
*
* @since 0.3
@@ -213,6 +221,16 @@
firePropertyChange(PROPERTY_SPLIT_SPECIES_BATCH_ENABLED, oldValue, splitSpeciesBatchEnabled);
}
+ public boolean isRemoveSpeciesBatchEnabled() {
+ return removeSpeciesBatchEnabled;
+ }
+
+ public void setRemoveSpeciesBatchEnabled(boolean removeSpeciesBatchEnabled) {
+ Object oldValue = isRemoveSpeciesBatchEnabled();
+ this.removeSpeciesBatchEnabled = removeSpeciesBatchEnabled;
+ firePropertyChange(PROPERTY_REMOVE_SPECIES_BATCH_ENABLED, oldValue, removeSpeciesBatchEnabled);
+ }
+
public boolean isRemoveSpeciesSubBatchEnabled() {
return removeSpeciesSubBatchEnabled;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesRowModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -41,8 +41,6 @@
public static final String PROPERTY_SPECIES = "species";
- public static final String PROPERTY_SORTED_UNSORTED_ENABLED = "sortedUnsortedEnabled";
-
public static final String PROPERTY_SIZE_ENABLED = "sizeEnabled";
public static final String PROPERTY_SEX_ENABLED = "sexEnabled";
@@ -55,8 +53,6 @@
protected Species species;
- protected boolean sortedUnsortedEnabled;
-
protected boolean sizeEnabled;
protected boolean sexEnabled;
@@ -93,16 +89,6 @@
firePropertyChange(PROPERTY_SPECIES, oldValue, species);
}
- public boolean isSortedUnsortedEnabled() {
- return sortedUnsortedEnabled;
- }
-
- public void setSortedUnsortedEnabled(boolean sortedUnsortedEnabled) {
- Object oldValue = isSortedUnsortedEnabled();
- this.sortedUnsortedEnabled = sortedUnsortedEnabled;
- firePropertyChange(PROPERTY_SORTED_UNSORTED_ENABLED, oldValue, sortedUnsortedEnabled);
- }
-
public boolean isSizeEnabled() {
return sizeEnabled;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesTableModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesTableModel.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolSpeciesTableModel.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -42,11 +42,6 @@
n_("tutti.table.protocol.species.header.speciesId"),
n_("tutti.table.protocol.species.header.speciesId"));
- public static final ColumnIdentifier<EditProtocolSpeciesRowModel> SORTED_UNSORTED_ENABLED = ColumnIdentifier.newId(
- EditProtocolSpeciesRowModel.PROPERTY_SORTED_UNSORTED_ENABLED,
- n_("tutti.table.protocol.species.header.sortedUnsorted"),
- n_("tutti.table.protocol.species.header.sortedUnsorted"));
-
public static final ColumnIdentifier<EditProtocolSpeciesRowModel> SIZE_ENABLED = ColumnIdentifier.newId(
EditProtocolSpeciesRowModel.PROPERTY_SIZE_ENABLED,
n_("tutti.table.protocol.species.header.size"),
@@ -87,7 +82,6 @@
result.setSizeEnabled(true);
result.setSexEnabled(true);
result.setAgeEnabled(true);
- result.setSortedUnsortedEnabled(true);
result.setValid(false);
return result;
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/protocol/EditProtocolUIHandler.java 2013-01-11 14:13:28 UTC (rev 173)
@@ -99,8 +99,7 @@
public EditProtocolUIHandler(TuttiUIContext context, EditProtocolUI ui) {
super(context);
this.ui = ui;
- columToSampleCategory = HashBiMap.create(SampleCategoryEnum.values().length);
- columToSampleCategory.put(EditProtocolSpeciesTableModel.SORTED_UNSORTED_ENABLED, SampleCategoryEnum.sortedUnsorted);
+ columToSampleCategory = HashBiMap.create(SampleCategoryEnum.values().length-1);
columToSampleCategory.put(EditProtocolSpeciesTableModel.SIZE_ENABLED, SampleCategoryEnum.size);
columToSampleCategory.put(EditProtocolSpeciesTableModel.SEX_ENABLED, SampleCategoryEnum.sex);
columToSampleCategory.put(EditProtocolSpeciesTableModel.MATURITY_ENABLED, SampleCategoryEnum.maturity);
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 13:41:36 UTC (rev 172)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-11 14:13:28 UTC (rev 173)
@@ -24,14 +24,18 @@
tutti.action.reload.ui=Recharger l'interface graphique
tutti.action.removeCaracteristic=Supprimer la caractéristique
tutti.action.removeSpecies=Supprimer l'espèce
-tutti.action.removeSpeciesSubBatch=Supprimer les lots
+tutti.action.removeSpeciesSubBatch=Supprimer les lots fils
+tutti.action.removeSpeciesSubBatch.tip=Supprimer tous les lots fils du lot sélectionné
+tutti.action.removeSpeciesBatch=Supprimer le lot
+tutti.action.removeSpeciesBatch.tip=Supprimer le lot courant (celui de la ligne sélectionnée) et tous ces fils
tutti.action.reset.fishingOperationValidState=Réinitialiser
tutti.action.save=Enregistrer
tutti.action.selectCampaign=Campagne
tutti.action.selectCampaign.tip=Sélectionner la campagne à utiliser
tutti.action.site=Site
tutti.action.site.tip=Accéder au site du projet Tutti
-tutti.action.splitSpeciesBatch=Catégoriser un lot
+tutti.action.splitSpeciesBatch=Catégoriser le lot
+tutti.action.splitSpeciesBatch.tip=Catégoriser le lot courant (celui de la ligne sélectionné)
tutti.action.validateCatches=Valider les captures
tutti.action.validateCatches.tip=Valider les captures
tutti.application.config=Configuration de l'application Tutti
1
0
11 Jan '13
Author: tchemit
Date: 2013-01-11 14:41:36 +0100 (Fri, 11 Jan 2013)
New Revision: 172
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/172
Log:
add new filed to protocol
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
Author: tchemit
Date: 2013-01-11 14:17:47 +0100 (Fri, 11 Jan 2013)
New Revision: 171
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/171
Log:
use tutti snapshot repository
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-11 11:07:18 UTC (rev 170)
+++ trunk/pom.xml 2013-01-11 13:17:47 UTC (rev 171)
@@ -105,6 +105,12 @@
<id>${platform}</id>
<url>${our.site.repository}/${projectId}</url>
</site>
+ <snapshotRepository>
+ <id>nuiton-nexus-deploy</id>
+ <url>
+ http://nexus.nuiton.org/nexus/content/repositories/tutti-snapshot
+ </url>
+ </snapshotRepository>
</distributionManagement>
<packaging>pom</packaging>
1
0
Author: tchemit
Date: 2013-01-11 12:07:18 +0100 (Fri, 11 Jan 2013)
New Revision: 170
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/170
Log:
use eugene snapshot
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-01-11 09:33:31 UTC (rev 169)
+++ trunk/pom.xml 2013-01-11 11:07:18 UTC (rev 170)
@@ -119,7 +119,7 @@
<nuitonUtilsVersion>2.7-SNAPSHOT</nuitonUtilsVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
- <eugenePluginVersion>2.6</eugenePluginVersion>
+ <eugenePluginVersion>2.6.1-SNAPSHOT</eugenePluginVersion>
<hibernateVersion>3.6.10.Final</hibernateVersion>
<h2Version>1.3.168</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
1
0
r169 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation
by kmorin@users.forge.codelutin.com 11 Jan '13
by kmorin@users.forge.codelutin.com 11 Jan '13
11 Jan '13
Author: kmorin
Date: 2013-01-11 10:33:31 +0100 (Fri, 11 Jan 2013)
New Revision: 169
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/169
Log:
debug saississeurs dans le trait
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/FishingOperationsUIModel.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 2013-01-10 16:23:59 UTC (rev 168)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-11 09:33:31 UTC (rev 169)
@@ -43,30 +43,18 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.hydrology.HydrologyTabUIModel;
import fr.ifremer.tutti.ui.swing.util.CustomTab;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
-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;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.JLabel;
-import javax.swing.JPanel;
import java.awt.BorderLayout;
-import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
-import java.beans.VetoableChangeListener;
import java.util.List;
import javax.swing.DefaultSingleSelectionModel;
-import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
import javax.swing.JTabbedPane;
-import javax.swing.SingleSelectionModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import jaxx.runtime.validator.swing.SwingValidator;
-import org.nuiton.validator.bean.simple.SimpleBeanValidatorEvent;
-import org.nuiton.validator.bean.simple.SimpleBeanValidatorListener;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
@@ -117,8 +105,8 @@
EditFishingOperationUIModel.PROPERTY_DUREE,
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_VALID,
EditFishingOperationUIModel.PROPERTY_LOCATION,
- EditFishingOperationUIModel.PROPERTY_COMMENT,
- EditFishingOperationUIModel.PROPERTY_SAISISSEUR);
+ EditFishingOperationUIModel.PROPERTY_SAISISSEUR,
+ EditFishingOperationUIModel.PROPERTY_COMMENT);
}
@Override
@@ -238,7 +226,7 @@
initBeanComboBox(ui.getSubStrataComboBox(), subStratas, subStrata);
initBeanComboBox(ui.getLocationComboBox(), locations, location);
-
+
model.setEmpty(true);
changeValidatorContext(model.getValidationContext(), ui.getValidator());
@@ -345,9 +333,6 @@
model.fromBean(bean);
- // to be sure saisisseurs are updated
-// model.setSaisisseur(Lists.newArrayList(bean.getSaisisseur()));
-
// to be sure combo list will be reloaded
model.setStrata(null);
model.setSubStrata(null);
@@ -370,10 +355,7 @@
// update saisissuer selection
List<Person> saisisseur = model.getSaisisseur();
- if (log.isInfoEnabled()) {
- log.info("Selected saisisseurs: " + (saisisseur == null ? 0 : saisisseur.size()));
- log.info(saisisseur);
- }
+ ui.getSaisisseurList().getModel().setSelected(saisisseur);
// update model empty property
model.setEmpty(empty);
@@ -441,7 +423,6 @@
getModel().setModify(false);
// persist current fishingOperation
-// persistenceService.saveFishingOperation(toSave);
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 2013-01-10 16:23:59 UTC (rev 168)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-01-11 09:33:31 UTC (rev 169)
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.TuttiEntities;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
@@ -33,6 +34,8 @@
import fr.ifremer.tutti.ui.swing.AbstractTuttiBeanUIModel;
import java.util.Date;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
@@ -44,6 +47,8 @@
*/
public class EditFishingOperationUIModel extends AbstractTuttiBeanUIModel<FishingOperation, EditFishingOperationUIModel> {
+ private static final Log log = LogFactory.getLog(EditFishingOperationUIModel.class);
+
private static final long serialVersionUID = 1L;
public static final String TITLE = "tutti.label.tab.fishingOperation.general";
@@ -173,7 +178,7 @@
protected String comment;
- protected List<Person> saisisseur;
+ protected List<Person> saisisseur = Lists.newArrayList();
protected FishingOperation fishingOperation;
@@ -575,8 +580,8 @@
}
public void setSaisisseur(List<Person> saisisseur) {
- Object oldValue = getSaisisseur();
- this.saisisseur = saisisseur;
+ Object oldValue = Lists.newArrayList(getSaisisseur());
+ this.saisisseur = Lists.newArrayList(saisisseur);
firePropertyChange(PROPERTY_SAISISSEUR, oldValue, saisisseur);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java 2013-01-10 16:23:59 UTC (rev 168)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java 2013-01-11 09:33:31 UTC (rev 169)
@@ -77,7 +77,7 @@
}
public void setSelectedFishingOperation(FishingOperation selectedFishingOperation) {
- Object oldValue = getSelectedFishingOperation();
+ Object oldValue = Lists.newArrayList(getSelectedFishingOperation());
this.selectedFishingOperation = selectedFishingOperation;
firePropertyChange(PROPERTY_SELECTED_FISHING_OPERATION, oldValue, selectedFishingOperation);
}
1
0
r168 - in trunk/tutti-ui-swing/src/main: java/fr/ifremer/tutti/ui/swing/content/operation resources/i18n
by kmorin@users.forge.codelutin.com 10 Jan '13
by kmorin@users.forge.codelutin.com 10 Jan '13
10 Jan '13
Author: kmorin
Date: 2013-01-10 17:23:59 +0100 (Thu, 10 Jan 2013)
New Revision: 168
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/168
Log:
refs #1908 [CONSOLIDATION] Mise en place des deux contextes de validation (pour les captures)
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/FishingOperationsUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-10 14:54:02 UTC (rev 167)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-01-10 16:23:59 UTC (rev 168)
@@ -52,6 +52,7 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
+import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
@@ -63,6 +64,7 @@
import javax.swing.SingleSelectionModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
+import jaxx.runtime.validator.swing.SwingValidator;
import org.nuiton.validator.bean.simple.SimpleBeanValidatorEvent;
import org.nuiton.validator.bean.simple.SimpleBeanValidatorListener;
@@ -268,10 +270,9 @@
@Override
public void setSelectedIndex(int index) {
int currentIndex = tabPanel.getSelectedIndex();
- if (currentIndex < 0) {
- super.setSelectedIndex(index);
-
- } else {
+ boolean mustSelectIndex = true;
+
+ if (currentIndex >= 0) {
CustomTab currentTab = (CustomTab) tabPanel.getTabComponentAt(currentIndex);
AbstractTuttiBeanUIModel model = currentTab.getModel();
@@ -281,8 +282,15 @@
save();
}
super.setSelectedIndex(index);
+
+ } else {
+ mustSelectIndex = false;
}
}
+
+ if (mustSelectIndex) {
+ super.setSelectedIndex(index);
+ }
}
});
@@ -293,7 +301,6 @@
}
-
@Override
public void onCloseUI() {
@@ -397,15 +404,8 @@
boolean newBean = StringUtils.isBlank(id);
if (newBean) {
-
// cancel to create a new fishingOperation
- parentUi.getHandler().selectFishingOperation(null);
-
- } else {
-
- // reselect in ui the fishingOperation
- FishingOperation selectedFishingOperation = parentUi.getModel().getSelectedFishingOperation();
- parentUi.getHandler().selectFishingOperation(selectedFishingOperation);
+ parentUi.getHandler().closeCurrentFishingOperation();
}
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-10 14:54:02 UTC (rev 167)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIHandler.java 2013-01-10 16:23:59 UTC (rev 168)
@@ -169,12 +169,14 @@
public void createNewFishingOperation() {
+ FishingOperationsUIModel model = getModel();
+
// deselect selected fishingOperation
- getModel().setSelectedFishingOperation(null);
+ model.setSelectedFishingOperation(null);
// use a new empty fishingOperation
FishingOperation newFishingOperation = new FishingOperation();
- newFishingOperation.setCruise(getModel().getCruise());
+ newFishingOperation.setCruise(model.getCruise());
// by default use the current day with no time information
Date currentDate = new Date();
@@ -184,6 +186,7 @@
newFishingOperation.setDate(currentDate);
newFishingOperation.setGearShootingStartDate(currentDate);
newFishingOperation.setGearShootingEndDate(currentDate);
+
selectFishingOperation(newFishingOperation);
}
@@ -200,56 +203,59 @@
String fishingOperationText;
- if (fishingOperation == null) {
- fishingOperationText = "";
- } else {
+ if (fishingOperation != null) {
Decorator<FishingOperation> decorator =
getDecorator(FishingOperation.class, null);
fishingOperationText =
_("tutti.label.traitReminder",
decorator.toString(fishingOperation));
- }
- // propagate fishingOperation to his tabs
- ui.getFishingOperationTabContent().getHandler().selectFishingOperation(fishingOperation);
+ // propagate fishingOperation to his tabs
+ ui.getFishingOperationTabContent().getHandler().selectFishingOperation(fishingOperation);
- ui.getCatchesTabContent().getHandler().selectFishingOperation(fishingOperation,
- fishingOperationText);
+ ui.getCatchesTabContent().getHandler().selectFishingOperation(fishingOperation,
+ fishingOperationText);
- // repaint tabs
- ui.getTabPane().repaint();
+ // repaint tabs
+ ui.getTabPane().repaint();
+ }
}
+
+ public void closeCurrentFishingOperation() {
+ ui.getFishingOperationTabContent().getHandler().selectFishingOperation(null);
+ ui.getCatchesTabContent().getHandler().selectFishingOperation(null, "");
+ }
public void saveFishingOperation(FishingOperation toSave) {
// persist the fishingOperation
boolean create = toSave.getId() == null;
+ FishingOperationsUIModel model = getModel();
+ FishingOperation savedFishingOperation;
- FishingOperation savedFishingOperation;
if (create) {
savedFishingOperation = persistenceService.createFishingOperation(toSave);
+ model.addFishingOperation(savedFishingOperation);
+
} else {
savedFishingOperation = persistenceService.saveFishingOperation(toSave);
- }
+
+ // add the saved fishingOperation to fishingOperation list
+ List<FishingOperation> data = model.getFishingOperation();
- FishingOperationsUIModel model = getModel();
+ FishingOperation existingFishingOperation =
+ TuttiEntities.findById(data, savedFishingOperation.getId());
+ if (existingFishingOperation != null) {
+ data.remove(existingFishingOperation);
+ }
+ data.add(savedFishingOperation);
- // add the saved fishingOperation to fishingOperation list
-
- List<FishingOperation> data = model.getFishingOperation();
-
- FishingOperation existingFishingOperation =
- TuttiEntities.findById(data, savedFishingOperation.getId());
- if (existingFishingOperation != null) {
- data.remove(existingFishingOperation);
+ // update model fishingOperation list
+ model.setFishingOperation(data);
}
- data.add(savedFishingOperation);
- // update model fishingOperation list
- model.setFishingOperation(data);
-
// update model selected fishingOperation
model.setSelectedFishingOperation(savedFishingOperation);
}
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java 2013-01-10 14:54:02 UTC (rev 167)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/FishingOperationsUIModel.java 2013-01-10 16:23:59 UTC (rev 168)
@@ -24,14 +24,14 @@
* #L%
*/
+import com.google.common.collect.Lists;
import fr.ifremer.tutti.persistence.entities.data.Cruise;
import fr.ifremer.tutti.persistence.entities.data.FishingOperation;
+import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.beans.AbstractSerializableBean;
-import java.util.List;
-
/**
* Model fo UI {@link FishingOperationsUI}.
*
@@ -66,6 +66,12 @@
firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, fishingOperation);
}
+ public void addFishingOperation(FishingOperation fishingOperation) {
+ Object oldValue = Lists.newArrayList(getFishingOperation());
+ this.fishingOperation.add(fishingOperation);
+ firePropertyChange(PROPERTY_FISHING_OPERATION, oldValue, this.fishingOperation);
+ }
+
public FishingOperation getSelectedFishingOperation() {
return selectedFishingOperation;
}
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-10 14:54:02 UTC (rev 167)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-01-10 16:23:59 UTC (rev 168)
@@ -145,6 +145,7 @@
tutti.label.tab.fishingOperation=Trait
tutti.label.tab.fishingOperation.environment=Environnement
tutti.label.tab.fishingOperation.gearShooting=Mise en oeuvre de l'engin
+tutti.label.tab.fishingOperation.general=Trait
tutti.label.tab.fishingOperation.hydrology=Paramètres hydrologiques
tutti.label.tab.macroDechet=Macro déchets
tutti.label.tab.observationIndividuel=Observations individuelles
1
0