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
October 2013
- 5 participants
- 76 discussions
r1324 - in trunk/src/conception/specifications: . Concepts-metiers Fonctionnalites-metiers Fonctionnalites-transversales Presentation
by lkaufmann@users.forge.codelutin.com 31 Oct '13
by lkaufmann@users.forge.codelutin.com 31 Oct '13
31 Oct '13
Author: lkaufmann
Date: 2013-10-31 11:58:38 +0100 (Thu, 31 Oct 2013)
New Revision: 1324
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1324
Log:
Specifications : Ajout des concepts et fonctionnalit?\195?\169s m?\195?\169tiers (Work in progress)
Added:
trunk/src/conception/specifications/AllegroCampagne-Specifications.odt
trunk/src/conception/specifications/AllegroCampagne-Specifications.pdf
trunk/src/conception/specifications/Concepts-metiers/Engin.txt
trunk/src/conception/specifications/Concepts-metiers/OperationPecheTrait.txt
Removed:
trunk/src/conception/specifications/Concepts-metiers/OperationPeche.txt
trunk/src/conception/specifications/Concepts-metiers/Trait.txt
Modified:
trunk/src/conception/specifications/Concepts-metiers/Campagne.txt
trunk/src/conception/specifications/Concepts-metiers/Capture.txt
trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt
trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt
trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/ControleSaisie.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/GestionnaireBase.txt
trunk/src/conception/specifications/Presentation/PresentationGenerale.txt
/opt/redmine-tools/commit-email.pl: `/usr/bin/svnlook diff /var/lib/svn/svn-forge.codelutin.com/tutti -r 1324' failed with this output:
Added: trunk/src/conception/specifications/AllegroCampagne-Specifications.odt
===================================================================
(Binary files differ)
Property changes on: trunk/src/conception/specifications/AllegroCampagne-Specifications.odt
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/conception/specifications/AllegroCampagne-Specifications.pdf
===================================================================
(Binary files differ)
Property changes on: trunk/src/conception/specifications/AllegroCampagne-Specifications.pdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/src/conception/specifications/Concepts-metiers/Campagne.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/Campagne.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Concepts-metiers/Campagne.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,3 +1,17 @@
-Les campagnes scientifiques à vocation halieutique ont pour objectif de produire des indices biologiques pour connaître l'état et l'évolution des espèces exploitées : abondance et distribution des espèces commerciales, stades clés du cycle de vie des espèces, description des populations. Elles ont aussi pour but d'élaborer des indicateurs sur les écosystèmes exploités.
+Les campagnes de pêche scientifique standardisées ont deux principaux objectifs : Observer les ressources halieutiques et produire des indices biologiques pour connaître l'état et l'évolution des espèces exploitées.
-Les campagnes de pêche scientifique standardisées ont pour objectif d'observer les ressources halieutiques, en suivant toujours les mêmes méthodes d'échantillonnage. Elles sont toujours réalisées dans la même zone, à la même saison, avec des engins de pêche standardisés, afin que les données soient comparables d'année en année. Elles servent à décrire les espèces, qu'elles soient commerciales ou non, d'une zone et à observer les changements s'il y en a. Les poissons, les mollusques et les crustacés sont dénombrés, mesurés et pesés. Certains d'entre eux font l'objet de prélèvements biologiques. Chaque campagne fournit ainsi une représentation quantitative de l'ensemble des espèces de la zone à une période donnée.
+* Observations et méthodes
+Les campagnes suivent toujours les mêmes méthodes d'échantillonnage. Elles sont toujours réalisées dans la même zone, à la même saison, avec des engins de pêche standardisés, afin que les données soient comparables d'année en année.
+
+Chaque campagne est généralement accomplie une fois par an. Mais certains cas spécifiques imposent sa réalisation plusieurs fois par an, on parle alors de série partielle.
+
+Chaque zone étudiée est découpée en strates en fonction de la profondeur, de la latitude ou d'autres critères. L'échantillonnage prévoit un nombre de traits de chalut ou de mouillages de casiers par strate.
+
+Dans une campagne de chalutage scientifique, les positions des traits de chalut sont choisies selon un plan d'échantillonnage statistique. L'objectif n'est pas d'obtenir les meilleures captures possibles comme le recherchent les pêcheurs, mais de récolter des données comparables d'une année sur l'autre afin de relever des évolutions.
+
+Les observations servent à décrire les espèces, qu'elles soient commerciales ou non, d'une zone et à observer les changements s'il y en a. Les poissons, les mollusques et les crustacés sont dénombrés, mesurés et pesés. Certains d'entre eux font l'objet de prélèvements biologiques. Chaque campagne fournit ainsi une représentation quantitative de l'ensemble des espèces de la zone à une période donnée.
+
+D'autres informations sont également relevées (température, salinité, macrofaune, observation des mammifères marins, oiseaux, macro déchets etc.).
+
+* Analyses et indices d'évolution
+Les campagnes scientifiques à vocation halieutique ont pour objectif de produire des indices biologiques pour connaître l'état et l'évolution des espèces exploitées : abondance et distribution des espèces commerciales, stades clés du cycle de vie des espèces, description des populations. Elles ont aussi pour but d'élaborer des indicateurs sur les écosystèmes exploités.
\ No newline at end of file
Modified: trunk/src/conception/specifications/Concepts-metiers/Capture.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/Capture.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Concepts-metiers/Capture.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,12 +1,18 @@
+Les captures peuvent aussi bien être réalisés dans un cadre scientifique que lors d'une pêche professionnelle classique.
+Toutes les prises réalisées lors des captures, de tout type, sont catégorisées. Les constations et les mesures à effectuer varient en fonction de la sorte des éléments capturés.
-Espèces
+* Espèces
-Benthos
+* Benthos
Le benthos regroupe l'ensemble des organismes vivant en relation étroite avec les fonds subaquatiques.
Macro déchets
+Observations individuelles
+
+Captures accidentelles
+
Added: trunk/src/conception/specifications/Concepts-metiers/Engin.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/Engin.txt (rev 0)
+++ trunk/src/conception/specifications/Concepts-metiers/Engin.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -0,0 +1,8 @@
+Différents engins d'échantillonnage sont utilisés :
+- Un chalut de fond à grande ouverture verticale pour l'observation des ressources démersales, sur les plateaux continentaux et le haut des pentes continentales (accores) en mer du Nord, Manche orientale, mer Celtique, golfe de Gascogne, golfe du Lion et Est de la Corse,
+- Un chalut à perche pour les zones très côtières et les estuaires lors des campagnes visant les juvéniles de poissons plats : baies de Somme et de Vilaine,
+- Un échantillonnage au casier pour les campagnes d'évaluation des grands crustacés, en particulier le homard, aux abords du cap de Flamanville.
+
+- Chalut de fond à grande ouverture verticale pour l'observation des ressources démersales,
+- Chalut à perche pour les zones très côtières et les estuaires lors des campagnes visant les juvéniles de poissons plats
+- Echantillonnage au casier pour les campagnes d'évaluation des grands crustacés.
Deleted: trunk/src/conception/specifications/Concepts-metiers/OperationPeche.txt
===================================================================
Copied: trunk/src/conception/specifications/Concepts-metiers/OperationPecheTrait.txt (from rev 1322, trunk/src/conception/specifications/Concepts-metiers/OperationPeche.txt)
===================================================================
Modified: trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -0,0 +1 @@
+Chaque observations d'une campagne doit être réalisée selon un plan d'échantillonnage prédéfini et standardisé. Les protocoles de saisies permettent d'établir les observations à effectuer, ainsi que les informations à relevées et les règles à respecter pour ces observations.
Modified: trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,3 +1,6 @@
-Chaque série de campagnes est conduite selon une stratégie d'échantillonnage spécifique. Sauf cas particuliers, les analyses et interprétations doivent être conduites par série, en prenant en compte les stratégies d'échantillonnage propres à chacune de ces séries. Sur le site, les données sont présentées par série.
+Une série de campagne peut regrouper plusieurs campagnes halieutiques différentes ayant une même zone géographique d'étude.
-Chaque série de campagne est définie par zone.
+Il y a 3 grandes séries de campagnes :
+- les séries de campagnes démersales (IBTS en Mer du Nord, EVHOE en Mer Celtique et Golfe de Gascogne, CGFS en Manche Est, RESGASC dans le Golfe de Gascogne, MEDITS dans le Golfe du Lion et Est Corse) ;
+- les séries de campagnes pélagiques (PELMED en Méditerranée Nord-Occidentale, PELGAS dans le Golfe de Gascogne) ;
+- les campagnes côtières pour les "bivalves"
Deleted: trunk/src/conception/specifications/Concepts-metiers/Trait.txt
===================================================================
Modified: trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt
===================================================================
--- trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,9 +1,12 @@
-Les notions de Vrac et Hors vrac sont liées à l'échantillonnage des
+Le plus souvent se sont des individus rares et/ou de grande taille qui sont extraits directement de la capture pour être observés. Dans le cas où seul un échantillon de la capture est trié, ceci permet de ne pas appliquer le coefficient d'élévation à ces individus et/ou de bien les observer.
+* Vrac
+Tout est trié car quantité supportable à trier
+* Hors Vrac
+Échantillonnage de la capture car trop grande quantité à trier. Pour ne pas passer à côté des individus importants ils sont conservés en Hors Vrac. Puis observations sur l’échantillon gardés (Vrac). Si vrac échantillonné, on multiplie la quantité pour estimer le total.
-HORS VRAC
-catégorie associée à un lot ou un individu qui a été prélevé directement sur la capture sans passer par le pesage automatique ni le tri.
+Catégorie associée à un lot ou un individu qui a été prélevé directement sur la capture sans passer par le pesage automatique ni le tri.
Cas 1
Cette notion est utile dans les cas de capture abondante où seule une fraction de la capture va être observée. Dans cette configuration, les lots (catégorisés à VRAC) observés dans l'échantillon seront élevés (facteur d'élévation) pour obtenir les poids et nombre totaux dans la capture.
Cas 2
Modified: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt
===================================================================
--- trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,17 +1,48 @@
-a. Création d'une série de campagne
+a. Données caractéristiques
-Pour identifier une série de campagne, un nom et un description sont à saisir lors de la création d'une série de campagne.
+Une campagne est caractérisée par les données suivantes :
+Une série de campagne est caractérisée par les données suivantes :
b. Création d'une campagne
+L'écran de création d'une campagne est accessible depuis la page d'accueil de l'application, en cliquant sur Nouveau. Lorsqu'une campagne est sélectionnée, elle peut être éditée à partir de ce menu.
+b. Création d'une série de campagne
+
+
c. Export de campagnes
-Export d'une campagne
+* Export d'une campagne
-Export Sumatra d'une campagne
+La fonctionnalité d'export d'une série de campagne est accessible directement depuis la page d'accueil de l'application.
+L'utilisateur est invité à choisir l'emplacement de l'archive d'export. Cette archive est au format .zip et respecte l'architecture suivante:
+Nom de l'archive/
+accidentalCatch.csv
+catch.csv
+gearCaracteristics.csv
+individualObservation.csv
+marineLitter.csv
+operation.csv
+parameter.csv
+species.csv
+survey.csv
-Export d'une série de campagne
+* Export Sumatra d'une campagne
+* Export d'une série de campagne
+
+La fonctionnalité d'export d'une série de campagne est accessible directement depuis la page d'accueil de l'application.
+L'utilisateur est invité à choisir l'emplacement de l'archive d'export. Cette archive est au format .zip et respecte l'architecture suivante:
+Nom de l'archive/
+accidentalCatch.csv
+catch.csv
+gearCaracteristics.csv
+individualObservation.csv
+marineLitter.csv
+operation.csv
+parameter.csv
+species.csv
+survey.csv
+
d. Envoi d'une campagne
Modified: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt
===================================================================
--- trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt 2013-10-31 10:58:38 UTC (rev 1324)
@@ -1,9 +1,17 @@
-a. Création
+a. Données caractéristiques
-b. Suppression
+Un protocole de saisie est caractérisé par :
+- Informations générales
+- Caractéristiques
+- Espèces
+- Benthos
-c. Import
+b. Création d'un protocole de saisie
-d. Configuration
+c. Suppression d'un protocole de saisie
-e. Clonage
\ No newline at end of file
+d. Import d'un protocole de saisie
+
+e. Configuration d'un protocole de saisie
+
+f. Clonage d'un protocole de saisie
\ No newline at end of file
Modified: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt
===================================================================
svnlook: Can't convert string from 'UTF-8' to native encoding:
svnlook: --- trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt 2013-10-31 10:56:39 UTC (rev 1323)
+++ trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt 2013-10-31 10:58:38 UTC (rev 1324)
1
0
r1323 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data tutti-service/src/main/java/fr/ifremer/tutti/service/export tutti-service/src/test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 31 Oct '13
by tchemit@users.forge.codelutin.com 31 Oct '13
31 Oct '13
Author: tchemit
Date: 2013-10-31 11:56:39 +0100 (Thu, 31 Oct 2013)
New Revision: 1323
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1323
Log:
fixes #3656: [EXPORT] Normalisation des noms de colonnes
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModelEntry.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModelEntry.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModelEntry.java 2013-10-30 14:47:32 UTC (rev 1322)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/entities/data/SampleCategoryModelEntry.java 2013-10-31 10:56:39 UTC (rev 1323)
@@ -46,6 +46,8 @@
protected String label;
+ protected String canonicalLabel;
+
protected Integer categoryId;
protected int order;
@@ -64,8 +66,27 @@
public void setLabel(String label) {
this.label = label;
+ this.canonicalLabel = null;
}
+ public String getCanonicalLabel() {
+ if (canonicalLabel == null) {
+
+ canonicalLabel = "";
+
+ if (StringUtils.isNotEmpty(label)) {
+ for (int i = 0; i < label.length(); i++) {
+ char a = label.charAt(i);
+ if (!Character.isLetterOrDigit(a)) {
+ a = '_';
+ }
+ canonicalLabel += a;
+ }
+ }
+ }
+ return canonicalLabel;
+ }
+
public Caracteristic getCaracteristic() {
return caracteristic;
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-10-30 14:47:32 UTC (rev 1322)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-10-31 10:56:39 UTC (rev 1323)
@@ -77,7 +77,7 @@
newColumnForExport("Commentaire", SpeciesBatch.PROPERTY_COMMENT);
for (SampleCategoryModelEntry entry : sampleCategoryModel.getCategory()) {
- addSampleCategory(entry.getLabel(), entry.getOrder());
+ addSampleCategory(entry.getCanonicalLabel(), entry.getOrder());
}
// mensuration
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-10-30 14:47:32 UTC (rev 1322)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-10-31 10:56:39 UTC (rev 1323)
@@ -157,7 +157,7 @@
URL url = new URL(urlPrefix + "operation.csv");
ServiceDbResource.assertFileContent("operation export:\n",
url,
- "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireSecondaire;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2013;test elevation;1;B;2;1;OTB 20/28.10;278970;01/07/2013 00:00:00;;;01/07/2013 00:00:00;;;00;NA;NA;NA;?;N;;NA;NA;NA;;;\"Commentaire sur le trait B-2-1\n" +
"\n" +
"avec\n" +
@@ -201,7 +201,7 @@
URL url = new URL("jar:" + exportFile.toURI().toURL() + "!/exportCruise-" + CRUISE_ID + "/catch.csv");
ServiceDbResource.assertFileContent("Catch export:\n",
url,
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V/HV;Num_Ordre_V/HV_H2;Tot_V/HV;Ech_V/HV;Type_Volume_Poids_V/HV;Unite_Volume_Poids_V/HV;Class Tri.;Num_Ordre_Class Tri._H2;Tot_Class Tri.;Ech_Class Tri.;Type_Volume_Poids_Class Tri.;Unite_Volume_Poids_Class Tri.;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;3.5;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;5.8333335;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;40.0;8.75;\n" +
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-10-30 14:47:32 UTC (rev 1322)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-10-31 10:56:39 UTC (rev 1323)
@@ -76,15 +76,15 @@
"2013;Campagne CGFS;;ScientificGear;287;Volet dépresseur (drague) - engin - totale - Déclaration d'un professionnel;Oui;";
public static final String OPERATION_WITH_NO_CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireSecondaire;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2010;Campagne CGFS;;65;65;1;GOV 19.7/25.9;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;NA;NA;NA;;;avarie - chalut annulé completement à poil;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;";
public static final String OPERATION_WITH_NO_CATCH_CONTENT_AND_NO_GEAR =
- "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireSecondaire;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2010;Campagne CGFS;;65;65;1;;278970;13/10/2010 13:35:00;50.22833;0.31833;13/10/2010 14:05:00;50.22167;0.28333;30;Strate 4J;NA;Localité 4J2;N;Y;2512.0;NA;NA;NA;;;avarie - chalut annulé completement à poil;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;;?;";
public static final String OPERATION_CONTENT =
- "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireSecondaire;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
+ "Annee;Serie;Serie_Partielle;Code_Station;Numero_Trait;Poche;Engin;Navire;DateDeb_Op;LatDeb;LongDeb;DateFin_Op;LatFin;LongFin;Duree;Strate;Sous-Strate;Localite;Validite_OP;Rectiligne;Distance;Ouv_Verticale;Ouv_Horizontale_Ailes;Ouv_Horizontale_Panneaux;Saisisseur;NavireAssocie;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule;Poids_Total_Carroussel;Poids_Total_Carroussel_Calcule;Poids_Total_Espece;Poids_Total_Espece_Calcule;Poids_Total_Espece_Vrac;Poids_Total_Espece_Vrac_Calcule;Poids_Total_Espece_Vrac_Trie;Poids_Total_Espece_Vrac_Trie_Calcule;Poids_Total_Espece_HorsVrac;Poids_Total_Espece_HorsVrac_Calcule;Poids_Total_Espece_Inerte_Trie;Poids_Total_Espece_Inerte_Trie_Calcule;Poids_Total_Espece_Vivant_non_detaille_trie;Poids_Total_Espece_Vivant_non_detaille_trie_Calcule;Poids_Total_Benthos;Poids_Total_Benthos_Calcule;Poids_Total_Benthos_Vrac;Poids_Total_Benthos_Vrac_Calcule;Poids_Total_Benthos_Vrac_Trie;Poids_Total_Benthos_Vrac_Trie_Calcule;Poids_Total_Benthos_HorsVrac;Poids_Total_Benthos_HorsVrac_Calcule;Poids_Total_Benthos_Inerte_Trie;Poids_Total_Benthos_Inerte_Trie_Calcule;Poids_Total_Benthos_Vivant_non_detaille_trie;Poids_Total_Benthos_Vivant_non_detaille_trie_Calcule;Poids_Total_Macro_Dechet;Poids_Total_Macro_Dechet_Calcule\n" +
"2013;Campagne CGFS;;A;1;1;GOV 19.7/25.9;278970;01/05/2013 00:00:00;;;01/05/2013 00:23:00;;;23;Strate 1D;NA;Localité 1D2;?;N;;NA;NA;NA;Vincent AURECHE;;op1;120.0;Y;100.0;Y;20.0;Y;0.0;Y;;?;;?;120.0;Y;100.0;Y;100.0;Y;20.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;6.0;Y;\n" +
"2013;Campagne CGFS;;A;2;1;GOV 19.7/25.9;278970;11/05/2013 08:00:00;;;11/05/2013 08:23:00;;;23;Strate 1D;NA;Localité 1D2;?;N;;NA;NA;NA;Robert BELLAIL|Herve BARONE;;OP2;0.0;Y;0.0;Y;0.0;Y;0.0;Y;;?;;?;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;";
@@ -99,7 +99,7 @@
"2013;Campagne CGFS;;A;2;1;308;Nombre d'engin - engin - totale - Déclaration d'un professionnel;2.0;";
public static final String CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V/HV;Num_Ordre_V/HV_H2;Tot_V/HV;Ech_V/HV;Type_Volume_Poids_V/HV;Unite_Volume_Poids_V/HV;Class Tri.;Num_Ordre_Class Tri._H2;Tot_Class Tri.;Ech_Class Tri.;Type_Volume_Poids_Class Tri.;Unite_Volume_Poids_Class Tri.;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;\n" +
@@ -111,7 +111,7 @@
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;2;20.0;1.0;";
public static final String CATCH_CONTENT_2 =
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V/HV;Num_Ordre_V/HV_H2;Tot_V/HV;Ech_V/HV;Type_Volume_Poids_V/HV;Unite_Volume_Poids_V/HV;Class Tri.;Num_Ordre_Class Tri._H2;Tot_Class Tri.;Ech_Class Tri.;Type_Volume_Poids_Class Tri.;Unite_Volume_Poids_Class Tri.;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri_;Num_Ordre_Class_Tri__H2;Tot_Class_Tri_;Ech_Class_Tri_;Type_Volume_Poids_Class_Tri_;Unite_Volume_Poids_Class_Tri_;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturité;Num_Ordre_Maturité_H2;Tot_Maturité;Ech_Maturité;Type_Volume_Poids_Maturité;Unite_Volume_Poids_Maturité;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Elev_Espece_Capture\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;365;Aequipecten opercularis;taxon;Vrac;1;0.005;0.005;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.005;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;491;Alloteuthis;taxon;Vrac;2;0.004;0.004;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.004;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;300;Buccinum undatum;taxon;Vrac;3;0.015;0.015;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.015;1.0;\n" +
1
0
r1322 - in trunk: tutti-persistence/src/main/java/fr/ifremer/tutti tutti-service/src/main/java/fr/ifremer/tutti/service tutti-service/src/main/resources/i18n tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db
by tchemit@users.forge.codelutin.com 30 Oct '13
by tchemit@users.forge.codelutin.com 30 Oct '13
30 Oct '13
Author: tchemit
Date: 2013-10-30 15:47:32 +0100 (Wed, 30 Oct 2013)
New Revision: 1322
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1322
Log:
fixes #3623: [TECH] Import de base : Structure autoris?\195?\169e pour le zip contenant la base ?\195?\160 importer
Modified:
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiIOUtil.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ImportDbAction.java
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiIOUtil.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiIOUtil.java 2013-10-30 10:49:27 UTC (rev 1321)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/TuttiIOUtil.java 2013-10-30 14:47:32 UTC (rev 1322)
@@ -31,6 +31,7 @@
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSelector;
import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.VFS;
import org.nuiton.util.ZipUtil;
@@ -109,6 +110,15 @@
}
}
+
+ public static FileType getType(FileObject objectFile, String errorMessage) {
+ try {
+ return objectFile.getType();
+ } catch (IOException e) {
+ throw new TuttiTechnicalException(errorMessage, e);
+ }
+ }
+
public static void explode(FileObject archiveFile,
File target,
FileSelector fileSelector, String errorMessage) {
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-30 10:49:27 UTC (rev 1321)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/PersistenceService.java 2013-10-30 14:47:32 UTC (rev 1322)
@@ -72,7 +72,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.AllFileSelector;
+import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileType;
import org.nuiton.util.TimeLog;
import org.nuiton.util.Version;
@@ -269,8 +271,12 @@
}
}
+ public static enum ImportStructureType {
+ NORMAL, // normal structure with a db directory + optional meas_file directory
+ INLINE
+ }
- public void checkImportStructure(File file) {
+ public ImportStructureType checkImportStructure(File file) {
if (!file.exists()) {
throw new TuttiBusinessException(_("tutti.service.persistence.checkImportstructure.fileNotExist", file));
@@ -286,9 +292,48 @@
if (children.length != 1) {
throw new TuttiBusinessException(_("tutti.service.persistence.checkImportstructure.tooManyChildren", file));
}
+
+ ImportStructureType result;
+
fileObject = children[0];
- checkArchiveDb(file, fileObject, "db", true);
- checkArchiveDb(file, fileObject, "meas_files", false);
+ children = TuttiIOUtil.getChildren(fileObject, _("tutti.service.persistence.openArchive.error", file));
+
+ // try to detect a db directory
+ boolean dbDirectoyDetected = false;
+ for (FileObject child : children) {
+ FileName name = child.getName();
+ if (name.getBaseName().equals("db")) {
+ dbDirectoyDetected = true;
+ break;
+ }
+ }
+
+ if (dbDirectoyDetected) {
+
+ // NORMAL type (two directories)
+ result = ImportStructureType.NORMAL;
+
+ checkArchiveDb(file, fileObject, "db", true);
+ checkArchiveDb(file, fileObject, "meas_files", false);
+ } else {
+
+ // INLINE type
+ result = ImportStructureType.INLINE;
+
+ // should have no directory
+ for (FileObject child : children) {
+ FileType type = TuttiIOUtil.getType(child, "Could not get type of " + child);
+ if (FileType.FOLDER.equals(type)) {
+ throw new TuttiBusinessException(_("tutti.service.persistence.checkImportstructure.inlineForbidDirectory"));
+ }
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Database import type: " + result);
+ }
+
+ return result;
}
protected void checkArchiveDb(File file,
@@ -312,10 +357,11 @@
/**
* Import a db from a zip archive (including the attachments and protocols).
*
- * @param file archive file where to store
+ * @param importStructureType type of structure of import
+ * @param file archive file where to store
* @since 1.0.2
*/
- public void importDb(File file) {
+ public void importDb(ImportStructureType importStructureType, File file) {
// can not do this operation on a opened db
Preconditions.checkState(!isDbLoaded());
@@ -330,13 +376,32 @@
if (log.isInfoEnabled()) {
log.info("Import db to " + target);
}
- FileObject fileObject = TuttiIOUtil.resolveFile("zip:" + file.getAbsolutePath(),
- _("tutti.service.persistence.getArchive.error", file));
+ FileObject fileObject = TuttiIOUtil.resolveFile(
+ "zip:" + file.getAbsolutePath(),
+ _("tutti.service.persistence.getArchive.error", file));
- FileObject[] children = TuttiIOUtil.getChildren(fileObject, _("tutti.service.persistence.openArchive.error", file));
+ FileObject[] children = TuttiIOUtil.getChildren(
+ fileObject,
+ _("tutti.service.persistence.openArchive.error", file));
fileObject = children[0];
+ switch (importStructureType) {
+
+ case NORMAL:
+ // nothing special to do
+ break;
+
+ case INLINE:
+ target = new File(target, "db");
+ TuttiIOUtil.forceMkdir(
+ target,
+ _("tutti.service.persistence.createDbDirectory.error", file));
+
+
+ break;
+ }
+
TuttiIOUtil.explode(fileObject,
target,
new AllFileSelector(),
@@ -572,8 +637,8 @@
// driver.getImplementationName() + "* opened.");
// }
- TIME_LOG.log(t0,"Persistence driver *" +
- driver.getImplementationName() + "* opened.");
+ TIME_LOG.log(t0, "Persistence driver *" +
+ driver.getImplementationName() + "* opened.");
}
@Override
@@ -592,8 +657,8 @@
// driver.getImplementationName() + "* closed.");
// }
- TIME_LOG.log(t0,"Persistence driver *" +
- driver.getImplementationName() + "* closed.");
+ TIME_LOG.log(t0, "Persistence driver *" +
+ driver.getImplementationName() + "* closed.");
}
//------------------------------------------------------------------------//
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-10-30 10:49:27 UTC (rev 1321)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_en_GB.properties 2013-10-30 14:47:32 UTC (rev 1322)
@@ -140,9 +140,11 @@
tutti.service.operations.exportCatchesReport.specialRows.inertAndLivinngNotItemized.name=
tutti.service.persistence.checkArchiveDb.error=
tutti.service.persistence.checkImportstructure.fileNotExist=
+tutti.service.persistence.checkImportstructure.inlineForbidDirectory=
tutti.service.persistence.checkImportstructure.tooManyChildren=
tutti.service.persistence.copyDirectory.attachment.error=
tutti.service.persistence.copyDirectory.db.error=
+tutti.service.persistence.createDbDirectory.error=
tutti.service.persistence.exportDb.deleteTempDir.error=
tutti.service.persistence.exportDb.zip.error=
tutti.service.persistence.extractArchive.error=
Modified: trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties
===================================================================
--- trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-10-30 10:49:27 UTC (rev 1321)
+++ trunk/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties 2013-10-30 14:47:32 UTC (rev 1322)
@@ -140,9 +140,11 @@
tutti.service.operations.exportCatchesReport.specialRows.inertAndLivinngNotItemized.name=Inerte et végétal
tutti.service.persistence.checkArchiveDb.error=L'archive de base de données %1s ne contient pas le dossier %2s
tutti.service.persistence.checkImportstructure.fileNotExist=L'archive de base de données %s n'existe pas
+tutti.service.persistence.checkImportstructure.inlineForbidDirectory=La structure d'un import simplifié interdit deux niveaux de répertoire
tutti.service.persistence.checkImportstructure.tooManyChildren=L'archive de base de données %s ne doit avoir qu'un sous-dossier
tutti.service.persistence.copyDirectory.attachment.error=Erreur lors de la copie du dossier des pièces jointes
tutti.service.persistence.copyDirectory.db.error=Erreur lors de la copie du dossier de base de données
+tutti.service.persistence.createDbDirectory.error=Impossible de créer le répertoire de base %s
tutti.service.persistence.exportDb.deleteTempDir.error=Erreur lors de la suppression du dossier temporaire
tutti.service.persistence.exportDb.zip.error=Erreur lors de la création de l'archive %s
tutti.service.persistence.extractArchive.error=Erreur lors de l'extraction de l'archive %s
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ImportDbAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ImportDbAction.java 2013-10-30 10:49:27 UTC (rev 1321)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/db/ImportDbAction.java 2013-10-30 14:47:32 UTC (rev 1322)
@@ -29,6 +29,7 @@
import fr.ifremer.tutti.persistence.ProgressionModel;
import fr.ifremer.tutti.persistence.TuttiPersistence;
import fr.ifremer.tutti.persistence.config.TuttiPersistenceConfig;
+import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.ui.swing.content.AbstractMainUITuttiAction;
import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiUIHandler;
@@ -65,6 +66,8 @@
protected Version applicationVersion;
+ protected PersistenceService.ImportStructureType importStructureType;
+
public ImportDbAction(MainUIHandler handler) {
super(handler, true);
setActionDescription(_("tutti.dbManager.action.importDb.tip"));
@@ -77,6 +80,7 @@
@Override
public boolean prepareAction() throws Exception {
+ importStructureType = null;
jdbcUrl = null;
dbVersion = applicationVersion = null;
closeDb = updateSchema = false;
@@ -113,7 +117,8 @@
progressionModel.setTotal(3);
setProgressionModel(progressionModel);
- getContext().getPersistenceService().checkImportStructure(importFile);
+ importStructureType =
+ getContext().getPersistenceService().checkImportStructure(importFile);
}
}
return doAction;
@@ -141,7 +146,7 @@
progressionModel.increments(_("tutti.importDb.step.unzipArchive"));
- getContext().getPersistenceService().importDb(importFile);
+ getContext().getPersistenceService().importDb(importStructureType, importFile);
// ------------------------------------------------------------------ //
// --- open db //
1
0
r1321 - trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 30 Oct '13
by tchemit@users.forge.codelutin.com 30 Oct '13
30 Oct '13
Author: tchemit
Date: 2013-10-30 11:49:27 +0100 (Wed, 30 Oct 2013)
New Revision: 1321
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1321
Log:
fixes #3627: [EXPORT GENERIQUE] Int?\195?\169grer le fait d'avoir les navires associ?\195?\169s sur chaque trait : nom de la colonne
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-10-25 19:22:49 UTC (rev 1320)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/OperationExportModel.java 2013-10-30 10:49:27 UTC (rev 1321)
@@ -87,7 +87,7 @@
newColumnForExport("Ouv_Horizontale_Ailes", OperationExportRow.PROPERTY_HORIZONTAL_OPENING_WING_GEAR_USE_FEATURE, TuttiCsvUtil.CARACTERISTIC_VALUE_FORMATTER);
newColumnForExport("Ouv_Horizontale_Panneaux", OperationExportRow.PROPERTY_HORIZONTAL_OPENING_DOOR_GEAR_USE_FEATURE, TuttiCsvUtil.CARACTERISTIC_VALUE_FORMATTER);
newColumnForExport("Saisisseur", FishingOperation.PROPERTY_RECORDER_PERSON, TuttiCsvUtil.LIST_PERSON_FORMATTER);
- newColumnForExport("NavireSecondaire", FishingOperation.PROPERTY_SECONDARY_VESSEL, TuttiCsvUtil.newListVesselFormatter(vesselDecorator));
+ newColumnForExport("NavireAssocie", FishingOperation.PROPERTY_SECONDARY_VESSEL, TuttiCsvUtil.newListVesselFormatter(vesselDecorator));
newColumnForExport("Commentaire", FishingOperation.PROPERTY_COMMENT);
newNullableColumnForExport("Poids_Total", OperationExportRow.PROPERTY_CATCH_TOTAL_WEIGHT, TuttiCsvUtil.FLOAT);
1
0
The Tutti team is pleased to announce the tutti-2.8 release!
Outil de saisie de données d'opérations et de captures au
cours des campagnes halieutiques.
Documentation of the project can be found here:
http://forge.codelutin.com/projects/tutti
Changes
-------
Changes in this version include:
New features:
o [DONNEES INDIVIDUELLES] recopie d'une espèce vers les données individelles si le lot espèce possède plusieurs individus il ne faut pas pouvoir saisir de poids et de taille Issue: 3503. Thanks to Vincent BADTS. Resolved by tchemit.
o [DONNEES INDIVIDUELLES] Ajouter un warning si pas de mensuration à recopier dans les observations individuelles Issue: 3506. Thanks to Tony Chemit. Resolved by tchemit.
o [DONNEES INDIVIDUELLES] Ajouter une confirmation lors de la création de données individuelles sur une espèce déjà renseignée Issue: 3510. Thanks to Tony Chemit. Resolved by tchemit.
o [ERGO] améliorer saisie lat et long Issue: 3337. Thanks to Tony Chemit. Resolved by tchemit.
o [ERGO] Tri du tableau des espèces Issue: 3620. Thanks to Tony Chemit. Resolved by tchemit.
o [ERGO] Tri du tableau des espèces Issue: 3328. Thanks to Tony Chemit. Resolved by tchemit.
o [ERGO] améliorer saisie lat et long Issue: 3622. Thanks to Tony Chemit. Resolved by tchemit.
o [EXPORT GENERIQUE] Intégrer le fait d'avoir les navires associés sur chaque trait Issue: 3456. Thanks to Tony Chemit. Resolved by tchemit.
o [CONFIGURATION] Améliorer la description de la configuration Issue: 3458. Thanks to Tony Chemit. Resolved by tchemit.
Fixed Bugs:
o Row index out of range Issue: 3502. Thanks to Vincent BADTS. Resolved by tchemit.
o Une erreur s'est produite: Column index out of range Issue: 3098. Thanks to Vincent BADTS. Resolved by tchemit.
o [DONNEES INDIVIDUELLES] pouvoir copier les mensurations depuis la page ESPECES Issue: 3444. Thanks to Tony Chemit. Resolved by tchemit.
o [CAMPAGNE] Ne pas modifier la camapgne lors que changement de type de navire Issue: 3452. Thanks to Tony Chemit. Resolved by tchemit.
o [CAPTURES] Supprimer les info bulles vides sur les cellules de catégorisation non renseignées Issue: 3457. Thanks to Tony Chemit. Resolved by tchemit.
o [CAPTURE] test des imports exports mutipostes quel est la clef ? Issue: 3460. Thanks to Vincent BADTS. Resolved by tchemit.
o [TRAIT] le tri de la liste des traits ne marche pas Issue: 3462. Thanks to Vincent BADTS. Resolved by tchemit.
o [CAPTURE] test des imports exports mutipostes, problème sur import capture accidentelle Issue: 3464. Thanks to Vincent BADTS. Resolved by tchemit.
o [CAPTURE] test des imports exports mutipostes, problème sur import observations individuelles Issue: 3463. Thanks to Vincent BADTS. Resolved by tchemit.
Changes:
o [TECH] Updates jaxx to 2.5.29 Issue: 3461. Thanks to Tony Chemit. Resolved by tchemit.
o [TECH] Updates jre to 1.7u45 Issue: 3544. Thanks to Tony Chemit. Resolved by tchemit.
Downloads
---------
No release file deployed. (all files are deployed in the maven repository)
Maven artifacts
---------------
Artifacts are deployed in nuiton maven repository
http://maven.nuiton.org/other-releases/
Have fun!
-Tutti team
1
0
r1320 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 25 Oct '13
by maven-release@users.forge.codelutin.com 25 Oct '13
25 Oct '13
Author: maven-release
Date: 2013-10-25 21:22:49 +0200 (Fri, 25 Oct 2013)
New Revision: 1320
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1320
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-10-25 19:22:39 UTC (rev 1319)
+++ trunk/pom.xml 2013-10-25 19:22:49 UTC (rev 1320)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8</version>
+ <version>2.9-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -86,12 +86,12 @@
</modules>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-10-25 19:22:39 UTC (rev 1319)
+++ trunk/tutti-persistence/pom.xml 2013-10-25 19:22:49 UTC (rev 1320)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8</version>
+ <version>2.9-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-10-25 19:22:39 UTC (rev 1319)
+++ trunk/tutti-service/pom.xml 2013-10-25 19:22:49 UTC (rev 1320)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8</version>
+ <version>2.9-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-10-25 19:22:39 UTC (rev 1319)
+++ trunk/tutti-ui-swing/pom.xml 2013-10-25 19:22:49 UTC (rev 1320)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8</version>
+ <version>2.9-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: maven-release
Date: 2013-10-25 21:22:39 +0200 (Fri, 25 Oct 2013)
New Revision: 1319
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1319
Log:
[maven-release-plugin] copy for tag tutti-2.8
Added:
tags/tutti-2.8/
1
0
r1318 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 25 Oct '13
by maven-release@users.forge.codelutin.com 25 Oct '13
25 Oct '13
Author: maven-release
Date: 2013-10-25 21:22:26 +0200 (Fri, 25 Oct 2013)
New Revision: 1318
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1318
Log:
[maven-release-plugin] prepare release tutti-2.8
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-10-25 19:00:54 UTC (rev 1317)
+++ trunk/pom.xml 2013-10-25 19:22:26 UTC (rev 1318)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8-SNAPSHOT</version>
+ <version>2.8</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -86,12 +86,12 @@
</modules>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.8
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-10-25 19:00:54 UTC (rev 1317)
+++ trunk/tutti-persistence/pom.xml 2013-10-25 19:22:26 UTC (rev 1318)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8-SNAPSHOT</version>
+ <version>2.8</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-10-25 19:00:54 UTC (rev 1317)
+++ trunk/tutti-service/pom.xml 2013-10-25 19:22:26 UTC (rev 1318)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8-SNAPSHOT</version>
+ <version>2.8</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-10-25 19:00:54 UTC (rev 1317)
+++ trunk/tutti-ui-swing/pom.xml 2013-10-25 19:22:26 UTC (rev 1318)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.8-SNAPSHOT</version>
+ <version>2.8</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
r1317 - in trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches: accidental benthos individualobservation marinelitter species
by tchemit@users.forge.codelutin.com 25 Oct '13
by tchemit@users.forge.codelutin.com 25 Oct '13
25 Oct '13
Author: tchemit
Date: 2013-10-25 21:00:54 +0200 (Fri, 25 Oct 2013)
New Revision: 1317
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1317
Log:
remove test to add blank line at the end of table
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-10-25 19:00:54 UTC (rev 1317)
@@ -93,8 +93,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <JPanel constraints='BorderLayout.SOUTH'
+ <!--JPanel constraints='BorderLayout.SOUTH'
minimumSize="{new Dimension(10,30)}"
maximumSize="{new Dimension(10,30)}"
- preferredSize="{new Dimension(10,30)}"/>
+ preferredSize="{new Dimension(10,30)}"/-->
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-10-25 19:00:54 UTC (rev 1317)
@@ -173,8 +173,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <JPanel constraints='BorderLayout.SOUTH'
+ <!--JPanel constraints='BorderLayout.SOUTH'
minimumSize="{new Dimension(10,30)}"
maximumSize="{new Dimension(10,30)}"
- preferredSize="{new Dimension(10,30)}"/>
+ preferredSize="{new Dimension(10,30)}"/-->
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-10-25 19:00:54 UTC (rev 1317)
@@ -93,8 +93,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <JPanel constraints='BorderLayout.SOUTH'
+ <!--JPanel constraints='BorderLayout.SOUTH'
minimumSize="{new Dimension(10,30)}"
maximumSize="{new Dimension(10,30)}"
- preferredSize="{new Dimension(10,30)}"/>
+ preferredSize="{new Dimension(10,30)}"/-->
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-10-25 19:00:54 UTC (rev 1317)
@@ -110,9 +110,9 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
- <JPanel constraints='BorderLayout.SOUTH'
+ <!--JPanel constraints='BorderLayout.SOUTH'
minimumSize="{new Dimension(10,30)}"
maximumSize="{new Dimension(10,30)}"
- preferredSize="{new Dimension(10,30)}"/>
+ preferredSize="{new Dimension(10,30)}"/-->
</JPanel>
\ No newline at end of file
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-10-25 16:43:35 UTC (rev 1316)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-10-25 19:00:54 UTC (rev 1317)
@@ -169,7 +169,13 @@
</Table>
- <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER' columnHeaderView="{table.getTableHeader()}">
+ <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
+ <JXTable id='table'
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
+ </JScrollPane>
+
+ <!--JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER' columnHeaderView="{table.getTableHeader()}">
<JPanel layout='{new BorderLayout()}'>
<JXTable id='table' constraints='BorderLayout.CENTER'
onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
@@ -178,7 +184,7 @@
preferredSize="{new Dimension(10,100)}"/>
</JPanel>
- </JScrollPane>
+ </JScrollPane-->
<!--background="{Color.WHITE}"/>-->
1
0
25 Oct '13
Author: tchemit
Date: 2013-10-25 18:43:35 +0200 (Fri, 25 Oct 2013)
New Revision: 1316
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1316
Log:
fixes #3337: [ERGO] am?\195?\169liorer saisie lat et long
Added:
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/
trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPositionTest.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/CoordinateEditorType.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinate.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinate.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorModel.java
trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/
trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorTest.java
trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateTest.java
trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorTest.java
Removed:
trunk/src/main/
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java
Modified:
trunk/src/conception/specifications/Concepts-metiers/Campagne.txt
trunk/src/conception/specifications/Concepts-metiers/Capture.txt
trunk/src/conception/specifications/Concepts-metiers/OperationPeche.txt
trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt
trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt
trunk/src/conception/specifications/Concepts-metiers/Trait.txt
trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCaptures.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt
trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/ConfigurationApplication.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/ConfigurationCategorisation.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/ContexteSaisie.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/ControleSaisie.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/GestionMisesAJour.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/GestionnaireBase.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/OrigineDonneesAffichees.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/RaccourcisClavier.txt
trunk/src/conception/specifications/Fonctionnalites-transversales/SaisieMultiOrdinateurs.txt
trunk/src/conception/specifications/Presentation/PresentationGenerale.txt
trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java
trunk/tutti-service/src/main/resources/validators.xml
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfig.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ValidateCruiseUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SaveFishingOperationAction.java
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
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/util/AbstractTuttiUIHandler.java
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
Property changes on: trunk/src/conception/specifications/Concepts-metiers/Campagne.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/Capture.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/OperationPeche.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/ProtocoleSaisie.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/SerieCampagne.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/Trait.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Concepts-metiers/VracHorsVrac.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCampagnes.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionCaptures.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionProtocoles.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-metiers/GestionRef?\195?\169rentielsTemporaires.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/ConfigurationApplication.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/ConfigurationCategorisation.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/ContexteSaisie.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/ControleSaisie.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/GestionMisesAJour.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/GestionnaireBase.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/OrigineDonneesAffichees.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/RaccourcisClavier.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Fonctionnalites-transversales/SaisieMultiOrdinateurs.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/conception/specifications/Presentation/PresentationGenerale.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java
===================================================================
--- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPosition.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -193,6 +193,17 @@
return result;
}
+ public Integer getSignedDegre() {
+ Integer result = null;
+ if (degre!=null) {
+ result =degre;
+ if (isSign()) {
+ result *=-1;
+ }
+ }
+ return result;
+ }
+
public Integer getDegre() {
return degre;
}
@@ -255,7 +266,7 @@
@Override
public String toString() {
- return super.toString() + "<" + (sign ? "-" : "") + degre + "° " + minute + "' " + seconde + "''>";
+ return getClass().getSimpleName()+"@"+System.identityHashCode(this) + "<" + (sign ? "-" : "") + degre + "° " + minute + "' " + seconde + "''>";
}
@Override
Added: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPositionTest.java
===================================================================
--- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPositionTest.java (rev 0)
+++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPositionTest.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,85 @@
+package fr.ifremer.tutti.persistence.spatial;
+
+/*
+ * #%L
+ * Tutti :: Persistence
+ * $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 org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Created on 10/25/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class SexagecimalPositionTest {
+
+ @Test
+ public void testValueOf() throws Exception {
+
+ {
+ SexagecimalPosition position =
+ SexagecimalPosition.valueOf(false, 42, 0f);
+ Float actual = position.toDecimal();
+ Float expected = 42.0f;
+ Assert.assertEquals(expected, actual, 0.01);
+ }
+
+ {
+ SexagecimalPosition position =
+ SexagecimalPosition.valueOf(false, 42, 42.42f);
+ Float actual = position.toDecimal();
+ Float expected = 42.70f;
+ Assert.assertEquals(expected, actual, 0.01);
+ }
+ }
+
+ @Test
+ public void testToDecimal() throws Exception {
+
+ {
+ SexagecimalPosition actual = SexagecimalPosition.valueOf(42f);
+ Float expectedDegree = 42.0f;
+ Float expectedMinute= null;
+ Assert.assertEquals(expectedDegree, actual.getDegre(), 0.01);
+ Assert.assertEquals(expectedMinute, actual.getMinuteDecimale());
+ }
+
+ {
+ SexagecimalPosition actual = SexagecimalPosition.valueOf(42.7f);
+ Float expectedDegree = 42.f;
+ Float expectedMinute= 42f;
+ Assert.assertEquals(expectedDegree, actual.getDegre(), 0.01);
+ Assert.assertEquals(expectedMinute, actual.getMinuteDecimale(), 0.001);
+ }
+
+ {
+ SexagecimalPosition actual = SexagecimalPosition.valueOf(null);
+ actual.setDegre(12);
+ actual.setMinuteDecimale(12f);
+
+ Assert.assertEquals(12.20f, actual.toDecimal(), 0.001);
+ }
+ }
+}
Property changes on: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/spatial/SexagecimalPositionTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-service/src/main/resources/validators.xml
===================================================================
--- trunk/tutti-service/src/main/resources/validators.xml 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-service/src/main/resources/validators.xml 2013-10-25 16:43:35 UTC (rev 1316)
@@ -45,5 +45,6 @@
<!-- les validateurs fournis par nuiton-validator -->
<validator name="collectionUniqueKey" class="org.nuiton.validator.xwork2.field.CollectionUniqueKeyValidator"/>
<validator name="fieldexpressionwithparams" class="org.nuiton.validator.xwork2.field.FieldExpressionWithParamsValidator"/>
+ <validator name="skipablefieldexpression" class="org.nuiton.validator.xwork2.field.NuitonFieldExpressionValidator"/>
</validators>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfig.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfig.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfig.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -29,7 +29,7 @@
import fr.ifremer.tutti.service.WeightUnit;
import fr.ifremer.tutti.service.config.TuttiServiceConfig;
import fr.ifremer.tutti.service.config.TuttiServiceConfigOption;
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
+import fr.ifremer.tutti.ui.swing.spatial.CoordinateEditorType;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/config/TuttiApplicationConfigOption.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -24,7 +24,7 @@
* #L%
*/
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
+import fr.ifremer.tutti.ui.swing.spatial.CoordinateEditorType;
import org.nuiton.config.ConfigOptionDef;
import javax.swing.KeyStroke;
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseFishingOperationAction.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseFishingOperationAction.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -32,7 +32,6 @@
import fr.ifremer.tutti.ui.swing.content.operation.FishingOperationsUI;
import fr.ifremer.tutti.ui.swing.content.operation.catches.EditCatchesUIModel;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.validator.NuitonValidatorResult;
@@ -83,9 +82,7 @@
&& model.getFishingOperation() != null
&& !propertiesToIgnore.contains(evt.getPropertyName())) {
- if (model.getCoordinateEditorType() != CoordinateEditorType.DD) {
- model.convertGearShootingCoordinatesDMSToDD();
- }
+ model.convertGearShootingCoordinatesToDD();
FishingOperation operation = model.toBean();
NuitonValidatorResult validationResult = validationService.validateCruiseOperation(operation);
@@ -93,7 +90,7 @@
ValidateCruiseUIModel uiModel = getModel();
uiModel.getValidator().put(uiModel.getSelectedFishingOperation(), validationResult);
- getHandler().updateCurrentOperatonNode(validationResult);
+ getHandler().updateCurrentOperationNode(validationResult);
}
}
@@ -136,7 +133,7 @@
ValidateCruiseUIModel uiModel = getModel();
uiModel.getValidator().put(uiModel.getSelectedFishingOperation(), validationResult);
- getHandler().updateCurrentOperatonNode(validationResult);
+ getHandler().updateCurrentOperationNode(validationResult);
}
}
};
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ValidateCruiseUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ValidateCruiseUIHandler.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/cruise/ValidateCruiseUIHandler.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -214,7 +214,7 @@
}
}
- protected void updateCurrentOperatonNode(NuitonValidatorResult validationResult) {
+ protected void updateCurrentOperationNode(NuitonValidatorResult validationResult) {
JTree navigation = ui.getNavigation();
TreePath selectionPath = navigation.getSelectionPath();
Preconditions.checkArgument(selectionPath.getPathCount() > 1);
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationAction.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -135,30 +135,47 @@
*/
protected boolean internalAction;
+ /**
+ * To recompute distance when coordinate change.
+ *
+ * @since 2.4
+ */
private final PropertyChangeListener coordinatePropertiesListener = new PropertyChangeListener() {
private List<String> properties = Lists.newArrayList(
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_RECTILIGNE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE
);
@Override
@@ -472,8 +489,9 @@
editFishingOperationUIModel.setStrata(null);
editFishingOperationUIModel.setSubStrata(null);
editFishingOperationUIModel.setLocation(null);
- editFishingOperationUIModel.convertGearShootingCoordinatesDDToDMS();
+ editFishingOperationUIModel.convertGearShootingCoordinatesFromDD();
+
if (strata != null) {
ui.getStrataComboBox().setSelectedItem(strata);
}
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.css 2013-10-25 16:43:35 UTC (rev 1316)
@@ -49,6 +49,16 @@
_selectOnFocus: {true};
}
+DmsCoordinateEditor {
+ bean: {model};
+ showReset: true;
+}
+
+DmdCoordinateEditor {
+ bean: {model};
+ showReset: true;
+}
+
SimpleTimeEditor {
bean: {model};
_selectOnFocus: {true};
@@ -58,6 +68,31 @@
_selectOnFocus: {true};
}
+#quadrant4 {
+ text:"observe.common.quadrant4";
+ buttonGroup:"quadrantBG";
+ selected:{handler.isQuadrantSelected(model.getQuadrant(), 4)};
+}
+
+#quadrant1 {
+ text:"observe.common.quadrant1";
+ buttonGroup:"quadrantBG";
+ selected:{handler.isQuadrantSelected(model.getQuadrant(), 1)};
+}
+
+#quadrant3 {
+ text:"observe.common.quadrant3";
+ buttonGroup:"quadrantBG";
+ selected:{handler.isQuadrantSelected(model.getQuadrant(), 3)};
+}
+
+#quadrant2 {
+ text:"observe.common.quadrant2";
+ buttonGroup:"quadrantBG";
+ selected:{handler.isQuadrantSelected(model.getQuadrant(), 2)};
+}
+
+
#editFishingOperationTopPanel {
_help: {"tutti.editFishingOperation.help"};
}
@@ -312,42 +347,53 @@
numberPattern: {INT_2_DIGITS_PATTERN};
}
-#gearShootingStartLongitudePanel {
- layout:{gearShootingStartLongitudeLayout};
- toolTipText: "tutti.editFishingOperation.field.gearShootingStartLongitude.tip";
- _help: {"tutti.editFishingOperation.field.gearShootingStartLongitude.help"};
-}
+/******************************************************************************
+ * Start Latitude
+ *****************************************************************************/
-#gearShootingStartLongitudeDMSDegreeField {
- property: gearShootingStartLongitudeDegree;
- model: {model.getGearShootingStartLongitudeDegree()};
- numberPattern: {SIGNED_INT_3_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitudeDegree")};
+#gearShootingStartLatitudePanel {
+ layout:{gearShootingStartLatitudeLayout};
+ toolTipText: "tutti.editFishingOperation.field.gearShootingStartLatitude.tip";
+ _help: {"tutti.editFishingOperation.field.gearShootingStartLatitude.help"};
}
-#gearShootingStartLongitudeDMSMinuteField {
- property: gearShootingStartLongitudeMinute;
- model: {model.getGearShootingStartLongitudeMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitudeMinute")};
+#gearShootingStartLatitudeDDField {
+ property: gearShootingStartLatitude;
+ model: {model.getGearShootingStartLatitude()};
+ showReset: false;
+ useFloat: true;
+ useSign: true;
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitude")};
}
-#gearShootingStartLongitudeDMSSecondField {
- property: gearShootingStartLongitudeSecond;
- model: {model.getGearShootingStartLongitudeSecond()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitudeSecond")};
+#gearShootingStartLatitudeDMSField {
+ propertySign: gearShootingStartLatitudeDmsSign;
+ propertyDegree: gearShootingStartLatitudeDmsDegree;
+ propertyMinute: gearShootingStartLatitudeDmsMinute;
+ propertySecond: gearShootingStartLatitudeDmsSecond;
+ value: {model.getGearShootingStartLatitudeDms()};
+ showResetTip: "tutti.coordinate.action.reset.latitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitude")};
}
-#gearShootingStartLongitudeDMDDegreeField {
- property: gearShootingStartLongitudeDegree;
- model: {model.getGearShootingStartLongitudeDegree()};
- numberPattern: {SIGNED_INT_3_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitudeDegree")};
+#gearShootingStartLatitudeDMDField {
+ propertySign: gearShootingStartLatitudeDmdSign;
+ propertyDegree: gearShootingStartLatitudeDmdDegree;
+ propertyMinute: gearShootingStartLatitudeDmdMinute;
+ propertyDecimal : gearShootingStartLatitudeDmdDecimal;
+ value: {model.getGearShootingStartLatitudeDmd()};
+ showResetTip: "tutti.coordinate.action.reset.latitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitude")};
}
-#gearShootingStartLongitudeDMDMinuteField {
- property: gearShootingStartLongitudeDecimalMinute;
- model: {model.getGearShootingStartLongitudeDecimalMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitudeMinute")};
+/******************************************************************************
+ * Start Longitude
+ *****************************************************************************/
+
+#gearShootingStartLongitudePanel {
+ layout:{gearShootingStartLongitudeLayout};
+ toolTipText: "tutti.editFishingOperation.field.gearShootingStartLongitude.tip";
+ _help: {"tutti.editFishingOperation.field.gearShootingStartLongitude.help"};
}
#gearShootingStartLongitudeDDField {
@@ -359,101 +405,77 @@
_validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitude")};
}
-#gearShootingStartLatitudePanel {
- layout:{gearShootingStartLatitudeLayout};
- toolTipText: "tutti.editFishingOperation.field.gearShootingStartLatitude.tip";
- _help: {"tutti.editFishingOperation.field.gearShootingStartLatitude.help"};
+#gearShootingStartLongitudeDMSField {
+ propertySign: gearShootingStartLongitudeDmsSign;
+ propertyDegree: gearShootingStartLongitudeDmsDegree;
+ propertyMinute: gearShootingStartLongitudeDmsMinute;
+ propertySecond: gearShootingStartLongitudeDmsSecond;
+ longitudeEditor: true;
+ value: {model.getGearShootingStartLongitudeDms()};
+ showResetTip: "tutti.coordinate.action.reset.longitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitude")};
}
-#gearShootingStartLatitudeDMSDegreeField {
- property: gearShootingStartLatitudeDegree;
- model: {model.getGearShootingStartLatitudeDegree()};
- numberPattern: {SIGNED_INT_2_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitudeDegree")};
+#gearShootingStartLongitudeDMDField {
+ propertySign: gearShootingStartLongitudeDmdSign;
+ propertyDegree: gearShootingStartLongitudeDmdDegree;
+ propertyMinute: gearShootingStartLongitudeDmdMinute;
+ propertyDecimal: gearShootingStartLongitudeDmdDecimal;
+ longitudeEditor: true;
+ value: {model.getGearShootingStartLongitudeDmd()};
+ showResetTip: "tutti.coordinate.action.reset.longitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLongitude")};
}
-#gearShootingStartLatitudeDMSMinuteField {
- property: gearShootingStartLatitudeMinute;
- model: {model.getGearShootingStartLatitudeMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitudeMinute")};
-}
+/******************************************************************************
+ * End Latitude
+ *****************************************************************************/
-#gearShootingStartLatitudeDMSSecondField {
- property: gearShootingStartLatitudeSecond;
- model: {model.getGearShootingStartLatitudeSecond()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitudeSecond")};
+#gearShootingEndLatitudePanel {
+ layout:{gearShootingEndLatitudeLayout};
+ toolTipText: "tutti.editFishingOperation.field.gearShootingEndLatitude.tip";
+ _help: {"tutti.editFishingOperation.field.gearShootingEndLatitude.help"};
}
-#gearShootingStartLatitudeDMDDegreeField {
- property: gearShootingStartLatitudeDegree;
- model: {model.getGearShootingStartLatitudeDegree()};
- numberPattern: {SIGNED_INT_2_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitudeDegree")};
-}
-
-#gearShootingStartLatitudeDMDMinuteField {
- property: gearShootingStartLatitudeDecimalMinute;
- model: {model.getGearShootingStartLatitudeDecimalMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitudeMinute")};
-}
-
-#gearShootingStartLatitudeDDField {
- property: gearShootingStartLatitude;
- model: {model.getGearShootingStartLatitude()};
+#gearShootingEndLatitudeDDField {
+ property: gearShootingEndLatitude;
+ model: {model.getGearShootingEndLatitude()};
showReset: false;
useFloat: true;
useSign: true;
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartLatitude")};
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitude")};
}
-#gearShootingStartDateField {
- date: {model.getGearShootingStartDate()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartDate")};
+#gearShootingEndLatitudeDMSField {
+ propertySign: gearShootingEndLatitudeDmsSign;
+ propertyDegree: gearShootingEndLatitudeDmsDegree;
+ propertyMinute: gearShootingEndLatitudeDmsMinute;
+ propertySecond: gearShootingEndLatitudeDmsSecond;
+ value: {model.getGearShootingEndLatitudeDms()};
+ showResetTip: "tutti.coordinate.action.reset.latitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitude")};
}
-#gearShootingStartTimeField {
- property: gearShootingStartTime;
- date: {model.getGearShootingStartDate()};
+#gearShootingEndLatitudeDMDField {
+ propertySign: gearShootingEndLatitudeDmdSign;
+ propertyDegree: gearShootingEndLatitudeDmdDegree;
+ propertyMinute: gearShootingEndLatitudeDmdMinute;
+ propertyDecimal: gearShootingEndLatitudeDmdDecimal;
+ value: {model.getGearShootingEndLatitudeDmd()};
+ showResetTip: "tutti.coordinate.action.reset.latitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitude")};
}
+/******************************************************************************
+ * End Longitude
+ *****************************************************************************/
+
#gearShootingEndLongitudePanel {
layout:{gearShootingEndLongitudeLayout};
toolTipText: "tutti.editFishingOperation.field.gearShootingEndLongitude.tip";
_help: {"tutti.editFishingOperation.field.gearShootingEndLongitude.help"};
}
-#gearShootingEndLongitudeDMSDegreeField {
- property: gearShootingEndLongitudeDegree;
- model: {model.getGearShootingEndLongitudeDegree()};
- numberPattern: {SIGNED_INT_3_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitudeDegree")};
-}
-
-#gearShootingEndLongitudeDMSMinuteField {
- property: gearShootingEndLongitudeMinute;
- model: {model.getGearShootingEndLongitudeMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitudeMinute")};
-}
-
-#gearShootingEndLongitudeDMSSecondField {
- property: gearShootingEndLongitudeSecond;
- model: {model.getGearShootingEndLongitudeSecond()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitudeSecond")};
-}
-
-#gearShootingEndLongitudeDMDDegreeField {
- property: gearShootingEndLongitudeDegree;
- model: {model.getGearShootingEndLongitudeDegree()};
- numberPattern: {SIGNED_INT_3_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitudeDegree")};
-}
-
-#gearShootingEndLongitudeDMDMinuteField {
- property: gearShootingEndLongitudeDecimalMinute;
- model: {model.getGearShootingEndLongitudeDecimalMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitudeMinute")};
-}
-
#gearShootingEndLongitudeDDField {
property: gearShootingEndLongitude;
model: {model.getGearShootingEndLongitude()};
@@ -463,53 +485,42 @@
_validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitude")};
}
-#gearShootingEndLatitudePanel {
- layout:{gearShootingEndLatitudeLayout};
- toolTipText: "tutti.editFishingOperation.field.gearShootingEndLatitude.tip";
- _help: {"tutti.editFishingOperation.field.gearShootingEndLatitude.help"};
+#gearShootingEndLongitudeDMSField {
+ propertySign: gearShootingEndLongitudeDmsSign;
+ propertyDegree: gearShootingEndLongitudeDmsDegree;
+ propertyMinute: gearShootingEndLongitudeDmsMinute;
+ propertySecond: gearShootingEndLongitudeDmsSecond;
+ longitudeEditor: true;
+ value: {model.getGearShootingEndLongitudeDms()};
+ showResetTip: "tutti.coordinate.action.reset.longitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitude")};
}
-#gearShootingEndLatitudeDMSDegreeField {
- property: gearShootingEndLatitudeDegree;
- model: {model.getGearShootingEndLatitudeDegree()};
- numberPattern: {SIGNED_INT_2_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitudeDegree")};
+#gearShootingEndLongitudeDMDField {
+ propertySign: gearShootingEndLongitudeDmdSign;
+ propertyDegree: gearShootingEndLongitudeDmdDegree;
+ propertyMinute: gearShootingEndLongitudeDmdMinute;
+ propertyDecimal: gearShootingEndLongitudeDmdDecimal;
+ longitudeEditor: true;
+ value: {model.getGearShootingEndLongitudeDmd()};
+ showResetTip: "tutti.coordinate.action.reset.longitude.tip";
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLongitude")};
}
-#gearShootingEndLatitudeDMSMinuteField {
- property: gearShootingEndLatitudeMinute;
- model: {model.getGearShootingEndLatitudeMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitudeMinute")};
-}
+/******************************************************************************
+ * Start - End date
+ *****************************************************************************/
-#gearShootingEndLatitudeDMSSecondField {
- property: gearShootingEndLatitudeSecond;
- model: {model.getGearShootingEndLatitudeSecond()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitudeSecond")};
+#gearShootingStartDateField {
+ date: {model.getGearShootingStartDate()};
+ _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingStartDate")};
}
-#gearShootingEndLatitudeDMDDegreeField {
- property: gearShootingEndLatitudeDegree;
- model: {model.getGearShootingEndLatitudeDegree()};
- numberPattern: {SIGNED_INT_2_DIGITS_PATTERN};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitudeDegree")};
+#gearShootingStartTimeField {
+ property: gearShootingStartTime;
+ date: {model.getGearShootingStartDate()};
}
-#gearShootingEndLatitudeDMDMinuteField {
- property: gearShootingEndLatitudeDecimalMinute;
- model: {model.getGearShootingEndLatitudeDecimalMinute()};
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitudeMinute")};
-}
-
-#gearShootingEndLatitudeDDField {
- property: gearShootingEndLatitude;
- model: {model.getGearShootingEndLatitude()};
- showReset: false;
- useFloat: true;
- useSign: true;
- _validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndLatitude")};
-}
-
#gearShootingEndDateField {
date: {model.getGearShootingEndDate()};
_validatorLabel: {_("tutti.editFishingOperation.field.gearShootingEndDate")};
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -34,8 +34,10 @@
fr.ifremer.tutti.ui.swing.content.operation.fishing.GearUseFeatureTabUI
fr.ifremer.tutti.ui.swing.TuttiHelpBroker
+ fr.ifremer.tutti.ui.swing.spatial.CoordinateEditorType
+ fr.ifremer.tutti.ui.swing.spatial.DmsCoordinateEditor
+ fr.ifremer.tutti.ui.swing.spatial.DmdCoordinateEditor
fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment
- fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType
fr.ifremer.tutti.ui.swing.util.editor.SimpleTimeEditor
jaxx.runtime.swing.editor.bean.BeanFilterableComboBox
@@ -47,6 +49,7 @@
org.jdesktop.swingx.JXTitledPanel
static org.nuiton.i18n.I18n._
+ java.awt.Color
</import>
<script><![CDATA[
@@ -79,54 +82,67 @@
<field name='trawlDistance' component='trawlDistanceField'/>
<field name='gear' component='gearComboBox'/>
<field name='multirigAggregation' component='multirigAggregationField'/>
+
<field name='gearShootingStartLatitude'
component='gearShootingStartLatitudeDDField'/>
- <field name='gearShootingStartLatitudeDegree'
- component='gearShootingStartLatitudeDMSDegreeField'/>
- <field name='gearShootingStartLatitudeMinute'
- component='gearShootingStartLatitudeDMSMinuteField'/>
- <field name='gearShootingStartLatitudeSecond'
- component='gearShootingStartLatitudeDMSSecondField'/>
- <field name='gearShootingStartLatitudeDecimalDegree'
- component='gearShootingStartLatitudeDMDDegreeField'/>
- <field name='gearShootingStartLatitudeDecimalMinute'
- component='gearShootingStartLatitudeDMDMinuteField'/>
+ <field name='gearShootingStartLatitudeDmsDegree'
+ component='gearShootingStartLatitudeDMSField'/>
+ <field name='gearShootingStartLatitudeDmsMinute'
+ component='gearShootingStartLatitudeDMSField'/>
+ <field name='gearShootingStartLatitudeDmsSecond'
+ component='gearShootingStartLatitudeDMSField'/>
+ <field name='gearShootingStartLatitudeDmdDegree'
+ component='gearShootingStartLatitudeDMDField'/>
+ <field name='gearShootingStartLatitudeDmdMinute'
+ component='gearShootingStartLatitudeDMDField'/>
+ <field name='gearShootingStartLatitudeDmdDecimal'
+ component='gearShootingStartLatitudeDMDField'/>
+
<field name='gearShootingStartLongitude'
component='gearShootingStartLongitudeDDField'/>
- <field name='gearShootingStartLongitudeDegree'
- component='gearShootingStartLongitudeDMSDegreeField'/>
- <field name='gearShootingStartLongitudeMinute'
- component='gearShootingStartLongitudeDMSMinuteField'/>
- <field name='gearShootingStartLongitudeSecond'
- component='gearShootingStartLongitudeDMSSecondField'/>
- <field name='gearShootingStartLongitudeDecimalDegree'
- component='gearShootingStartLongitudeDMDDegreeField'/>
- <field name='gearShootingStartLongitudeDecimalMinute'
- component='gearShootingStartLongitudeDMDMinuteField'/>
+ <field name='gearShootingStartLongitudeDmsDegree'
+ component='gearShootingStartLongitudeDMSField'/>
+ <field name='gearShootingStartLongitudeDmsMinute'
+ component='gearShootingStartLongitudeDMSField'/>
+ <field name='gearShootingStartLongitudeDmsSecond'
+ component='gearShootingStartLongitudeDMSField'/>
+ <field name='gearShootingStartLongitudeDmdDegree'
+ component='gearShootingStartLongitudeDMDField'/>
+ <field name='gearShootingStartLongitudeDmdMinute'
+ component='gearShootingStartLongitudeDMDField'/>
+ <field name='gearShootingStartLongitudeDmdDecimal'
+ component='gearShootingStartLongitudeDMDField'/>
+
<field name='gearShootingEndLatitude'
component='gearShootingEndLatitudeDDField'/>
- <field name='gearShootingEndLatitudeDegree'
- component='gearShootingEndLatitudeDMSDegreeField'/>
- <field name='gearShootingEndLatitudeMinute'
- component='gearShootingEndLatitudeDMSMinuteField'/>
- <field name='gearShootingEndLatitudeSecond'
- component='gearShootingEndLatitudeDMSSecondField'/>
- <field name='gearShootingEndLatitudeDecimalDegree'
- component='gearShootingEndLatitudeDMDDegreeField'/>
- <field name='gearShootingEndLatitudeDecimalMinute'
- component='gearShootingEndLatitudeDMDMinuteField'/>
+ <field name='gearShootingEndLatitudeDmsDegree'
+ component='gearShootingEndLatitudeDMSField'/>
+ <field name='gearShootingEndLatitudeDmsMinute'
+ component='gearShootingEndLatitudeDMSField'/>
+ <field name='gearShootingEndLatitudeDmsSecond'
+ component='gearShootingEndLatitudeDMSField'/>
+ <field name='gearShootingEndLatitudeDmdDegree'
+ component='gearShootingEndLatitudeDMDField'/>
+ <field name='gearShootingEndLatitudeDmdMinute'
+ component='gearShootingEndLatitudeDMDField'/>
+ <field name='gearShootingEndLatitudeDmdDecimal'
+ component='gearShootingEndLatitudeDMDField'/>
+
<field name='gearShootingEndLongitude'
component='gearShootingEndLongitudeDDField'/>
- <field name='gearShootingEndLongitudeDegree'
- component='gearShootingEndLongitudeDMSDegreeField'/>
- <field name='gearShootingEndLongitudeMinute'
- component='gearShootingEndLongitudeDMSMinuteField'/>
- <field name='gearShootingEndLongitudeSecond'
- component='gearShootingEndLongitudeDMSSecondField'/>
- <field name='gearShootingEndLongitudeDecimalDegree'
- component='gearShootingEndLongitudeDMDDegreeField'/>
- <field name='gearShootingEndLongitudeDecimalMinute'
- component='gearShootingEndLongitudeDMDMinuteField'/>
+ <field name='gearShootingEndLongitudeDmsDegree'
+ component='gearShootingEndLongitudeDMSField'/>
+ <field name='gearShootingEndLongitudeDmsMinute'
+ component='gearShootingEndLongitudeDMSField'/>
+ <field name='gearShootingEndLongitudeDmsSecond'
+ component='gearShootingEndLongitudeDMSField'/>
+ <field name='gearShootingEndLongitudeDmdDegree'
+ component='gearShootingEndLongitudeDMDField'/>
+ <field name='gearShootingEndLongitudeDmdMinute'
+ component='gearShootingEndLongitudeDMDField'/>
+ <field name='gearShootingEndLongitudeDmdDecimal'
+ component='gearShootingEndLongitudeDMDField'/>
+
<field name='fishingOperationValid'
component='fishingOperationValidPanel'/>
<field name='strata' component='strataComboBox'/>
@@ -224,6 +240,9 @@
<cell>
<JPanel/>
</cell>
+ <!--cell>
+ <JPanel/>
+ </cell-->
<cell>
<JLabel id='gearLatitudeLabel'/>
</cell>
@@ -242,36 +261,30 @@
<cell>
<JLabel id='gearShootingStartLabel'/>
</cell>
+ <!--cell rows="2" fill="both">
+
+ <JPanel id='quadrant'
+ layout="{new GridLayout(2,2,0,0)}"
+ background='{Color.GREEN}'>
+ <JToggleButton id='quadrant4'
+ onActionPerformed='handler.setQuadrantValue(4)'/>
+ <JToggleButton id='quadrant1'
+ onActionPerformed='handler.setQuadrantValue(1)'/>
+ <JToggleButton id='quadrant3'
+ onActionPerformed='handler.setQuadrantValue(3)'/>
+ <JToggleButton id='quadrant2'
+ onActionPerformed='handler.setQuadrantValue(2)'/>
+ </JPanel>
+ </cell-->
<cell weightx='1'>
<JPanel id='gearShootingStartLatitudePanel'>
<NumberEditor id='gearShootingStartLatitudeDDField'
constraints='"DD"'
constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingStartLatitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingStartLatitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
-
- <NumberEditor
- id='gearShootingStartLatitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingStartLatitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingStartLatitudeDMDMinuteField'
- constructorParams='this'
- styleClass='decimalMinute'/>
- </JPanel>
+ <DmsCoordinateEditor constraints='"DMS"'
+ id='gearShootingStartLatitudeDMSField'/>
+ <DmdCoordinateEditor constraints='"DMD"'
+ id='gearShootingStartLatitudeDMDField'/>
</JPanel>
</cell>
<cell weightx='1'>
@@ -279,31 +292,10 @@
<NumberEditor id='gearShootingStartLongitudeDDField'
constraints='"DD"'
constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingStartLongitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingStartLongitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
-
- <NumberEditor
- id='gearShootingStartLongitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingStartLongitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingStartLongitudeDMDMinuteField'
- constructorParams='this'
- styleClass='decimalMinute'/>
- </JPanel>
+ <DmsCoordinateEditor constraints='"DMS"'
+ id='gearShootingStartLongitudeDMSField'/>
+ <DmdCoordinateEditor constraints='"DMD"'
+ id='gearShootingStartLongitudeDMDField'/>
</JPanel>
</cell>
<cell>
@@ -319,36 +311,18 @@
<cell>
<JLabel id='gearShootingEndLabel'/>
</cell>
+ <!--cell>
+ <JPanel/>
+ </cell-->
<cell weightx='1'>
<JPanel id='gearShootingEndLatitudePanel'>
<NumberEditor id='gearShootingEndLatitudeDDField'
constraints='"DD"'
constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingEndLatitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingEndLatitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
-
- <NumberEditor
- id='gearShootingEndLatitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingEndLatitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingEndLatitudeDMDMinuteField'
- constructorParams='this'
- styleClass='decimalMinute'/>
- </JPanel>
+ <DmsCoordinateEditor constraints='"DMS"'
+ id='gearShootingEndLatitudeDMSField'/>
+ <DmdCoordinateEditor constraints='"DMD"'
+ id='gearShootingEndLatitudeDMDField'/>
</JPanel>
</cell>
<cell weightx='1'>
@@ -356,31 +330,10 @@
<NumberEditor id='gearShootingEndLongitudeDDField'
constraints='"DD"'
constructorParams='this'/>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMS"'>
- <NumberEditor
- id='gearShootingEndLongitudeDMSDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingEndLongitudeDMSMinuteField'
- constructorParams='this' styleClass='minute'/>
-
- <NumberEditor
- id='gearShootingEndLongitudeDMSSecondField'
- constructorParams='this' styleClass='second'/>
- </JPanel>
- <JPanel layout="{new GridLayout(1,0)}"
- constraints='"DMD"'>
- <NumberEditor
- id='gearShootingEndLongitudeDMDDegreeField'
- constructorParams='this' styleClass='degree'/>
-
- <NumberEditor
- id='gearShootingEndLongitudeDMDMinuteField'
- constructorParams='this'
- styleClass='decimalMinute'/>
- </JPanel>
+ <DmsCoordinateEditor constraints='"DMS"'
+ id='gearShootingEndLongitudeDMSField'/>
+ <DmdCoordinateEditor constraints='"DMD"'
+ id='gearShootingEndLongitudeDMDField'/>
</JPanel>
</cell>
<cell>
@@ -398,6 +351,9 @@
<cell>
<JLabel/>
</cell>
+ <!--cell>
+ <JPanel/>
+ </cell-->
<cell>
<JCheckBox id='fishingOperationRectiligneCheckBox'
onItemStateChanged='handler.setBoolean(event, "fishingOperationRectiligne")'/>
@@ -484,12 +440,15 @@
<JLabel id='filterSecondaryVesselLabel'/>
<JRadioButton id='filterSecondaryVesselAllButton'
onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.ALL)'/>
- <JRadioButton id='filterSecondaryVesselScientificButton'
- onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.SCIENTIFIC)'/>
- <JRadioButton id='filterSecondaryVesselFishingButton'
- onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.FISHING)'/>
- <JRadioButton id='filterSecondaryVesselOnlyCruiseButton'
- onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.ONLY_CRUISE)'/>
+ <JRadioButton
+ id='filterSecondaryVesselScientificButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.SCIENTIFIC)'/>
+ <JRadioButton
+ id='filterSecondaryVesselFishingButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.FISHING)'/>
+ <JRadioButton
+ id='filterSecondaryVesselOnlyCruiseButton'
+ onActionPerformed='model.setSecondaryVesselType(SecondaryVesselTypeEnum.ONLY_CRUISE)'/>
</JPanel>
</cell>
</row>
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIHandler.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -47,7 +47,7 @@
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionHelper;
import fr.ifremer.tutti.ui.swing.util.caracteristics.GearCaracteristicListCellRenderer;
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
+import fr.ifremer.tutti.ui.swing.spatial.CoordinateEditorType;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils;
@@ -116,25 +116,49 @@
private List<String> properties = Lists.newArrayList(
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_RECTILIGNE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DECIMAL,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DECIMAL,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DECIMAL,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DECIMAL_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DECIMAL
);
@Override
@@ -144,10 +168,23 @@
if (source.isFishingOperationRectiligne()) {
source.computeDistance();
}
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Property %s changed to %s", evt.getPropertyName(), evt.getNewValue()));
+ }
}
}
};
+ public void setQuadrantValue(int value) {
+ if (log.isInfoEnabled()) {
+ log.info("New quadrant value: "+value);
+ }
+ }
+
+ public boolean isQuadrantSelected(Integer value, int requiredValue) {
+ return value != null && value == requiredValue;
+ }
/**
* To monitor changes on the incoming fishing operation.
*
@@ -165,11 +202,49 @@
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_NUMBER,
EditFishingOperationUIModel.PROPERTY_STRATA,
EditFishingOperationUIModel.PROPERTY_SUB_STRATA,
+
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE,
+ EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE,
+
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_START_DATE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LATITUDE,
- EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_LONGITUDE,
EditFishingOperationUIModel.PROPERTY_GEAR_SHOOTING_END_DATE,
EditFishingOperationUIModel.PROPERTY_FISHING_OPERATION_RECTILIGNE,
EditFishingOperationUIModel.PROPERTY_TRAWL_DISTANCE,
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -36,12 +36,13 @@
import fr.ifremer.tutti.persistence.entities.referential.Person;
import fr.ifremer.tutti.persistence.entities.referential.TuttiLocation;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
-import fr.ifremer.tutti.persistence.spatial.SexagecimalPosition;
+import fr.ifremer.tutti.ui.swing.spatial.CoordinateEditorType;
+import fr.ifremer.tutti.ui.swing.spatial.DmdCoordinate;
+import fr.ifremer.tutti.ui.swing.spatial.DmsCoordinate;
import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
import fr.ifremer.tutti.ui.swing.util.TabContentModel;
import fr.ifremer.tutti.ui.swing.util.TuttiUIUtil;
import fr.ifremer.tutti.ui.swing.util.attachment.AttachmentModelAware;
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.util.DateUtil;
@@ -70,38 +71,86 @@
public static final String PROPERTY_PERSISTED = "persisted";
- public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE = "gearShootingStartLatitudeDegree";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS = "gearShootingStartLatitudeDms";
- public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE = "gearShootingStartLatitudeMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN = "gearShootingStartLatitudeDmsSign";
- public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DECIMAL_MINUTE = "gearShootingStartLatitudeDecimalMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE = "gearShootingStartLatitudeDmsDegree";
- public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND = "gearShootingStartLatitudeSecond";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE = "gearShootingStartLatitudeDmsMinute";
- public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE = "gearShootingStartLongitudeDegree";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND = "gearShootingStartLatitudeDmsSecond";
- public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE = "gearShootingStartLongitudeMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD = "gearShootingStartLatitudeDmd";
- public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DECIMAL_MINUTE = "gearShootingStartLongitudeDecimalMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN = "gearShootingStartLatitudeDmdSign";
- public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND = "gearShootingStartLongitudeSecond";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE = "gearShootingStartLatitudeDmdDegree";
- public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE = "gearShootingEndLatitudeDegree";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE = "gearShootingStartLatitudeDmdMinute";
- public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE = "gearShootingEndLatitudeMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DECIMAL = "gearShootingStartLatitudeDmdDecimal";
- public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DECIMAL_MINUTE = "gearShootingEndLatitudeDecimalMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS = "gearShootingStartLongitudeDms";
- public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND = "gearShootingEndLatitudeSecond";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN = "gearShootingStartLongitudeDmsSign";
- public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE = "gearShootingEndLongitudeDegree";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE = "gearShootingStartLongitudeDmsDegree";
- public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE = "gearShootingEndLongitudeMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE = "gearShootingStartLongitudeDmsMinute";
- public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DECIMAL_MINUTE = "gearShootingEndLongitudeDecimalMinute";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND = "gearShootingStartLongitudeDmsSecond";
- public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND = "gearShootingEndLongitudeSecond";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD = "gearShootingStartLongitudeDmd";
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN = "gearShootingStartLongitudeDmdSign";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE = "gearShootingStartLongitudeDmdDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE = "gearShootingStartLongitudeDmdMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DECIMAL = "gearShootingStartLongitudeDmdDecimal";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS = "gearShootingEndLatitudeDms";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN = "gearShootingEndLatitudeDmsSign";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE = "gearShootingEndLatitudeDmsDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE = "gearShootingEndLatitudeDmsMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND = "gearShootingEndLatitudeDmsSecond";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD = "gearShootingEndLatitudeDmd";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN = "gearShootingEndLatitudeDmdSign";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE = "gearShootingEndLatitudeDmdDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE = "gearShootingEndLatitudeDmdMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DECIMAL = "gearShootingEndLatitudeDmdDecimal";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS = "gearShootingEndLongitudeDms";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN = "gearShootingEndLongitudeDmsSign";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE = "gearShootingEndLongitudeDmsDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE = "gearShootingEndLongitudeDmsMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND = "gearShootingEndLongitudeDmsSecond";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD = "gearShootingEndLongitudeDmd";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN = "gearShootingEndLongitudeDmdSign";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE = "gearShootingEndLongitudeDmdDegree";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE = "gearShootingEndLongitudeDmdMinute";
+
+ public static final String PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DECIMAL = "gearShootingEndLongitudeDmdDecimal";
+
public static final String PROPERTY_VALIDATION_CONTEXT = "validationContext";
public static final String PROPERTY_SECONDARY_VESSEL_TYPE = "secondaryVesselType";
@@ -121,14 +170,82 @@
*/
protected final FishingOperation editObject = FishingOperations.newFishingOperation();
- protected SexagecimalPosition gearShootingStartLatitudeAsSexagecimal;
+ /**
+ * To edit gearShootingStartLatitude as dms format.
+ *
+ * @since 2.8
+ */
+ protected final DmsCoordinate gearShootingStartLatitudeDms =
+ DmsCoordinate.empty();
- protected SexagecimalPosition gearShootingStartLongitudeAsSexagecimal;
+ /**
+ * To edit gearShootingStartLongitude as dms format.
+ *
+ * @since 2.8
+ */
+ protected final DmsCoordinate gearShootingStartLongitudeDms =
+ DmsCoordinate.empty();
- protected SexagecimalPosition gearShootingEndLatitudeAsSexagecimal;
+ /**
+ * To edit gearShootingEndLatitude as dms format.
+ *
+ * @since 2.8
+ */
+ protected final DmsCoordinate gearShootingEndLatitudeDms =
+ DmsCoordinate.empty();
- protected SexagecimalPosition gearShootingEndLongitudeAsSexagecimal;
+ /**
+ * To edit gearShootingEndLongitude as dms format.
+ *
+ * @since 2.8
+ */
+ protected final DmsCoordinate gearShootingEndLongitudeDms =
+ DmsCoordinate.empty();
+ /**
+ * To edit gearShootingStartLatitude as dmd format.
+ *
+ * @since 2.8
+ */
+ protected final DmdCoordinate gearShootingStartLatitudeDmd =
+ DmdCoordinate.empty();
+
+ /**
+ * To edit gearShootingStartLongitude as dmd format.
+ *
+ * @since 2.8
+ */
+ protected final DmdCoordinate gearShootingStartLongitudeDmd =
+ DmdCoordinate.empty();
+
+ /**
+ * To edit gearShootingEndLatitude as dmd format.
+ *
+ * @since 2.8
+ */
+ protected final DmdCoordinate gearShootingEndLatitudeDmd =
+ DmdCoordinate.empty();
+
+ /**
+ * To edit gearShootingEndLongitude as dmd format.
+ *
+ * @since 2.8
+ */
+ protected final DmdCoordinate gearShootingEndLongitudeDmd =
+ DmdCoordinate.empty();
+
+ protected int quadrant;
+
+ public int getQuadrant() {
+ return quadrant;
+ }
+
+ public void setQuadrant(int quadrant) {
+ Object oldValue = getQuadrant();
+ this.quadrant = quadrant;
+ firePropertyChange("quadrant", oldValue, quadrant);
+ }
+
protected final List<Attachment> attachment = Lists.newArrayList();
protected FishingOperation fishingOperation;
@@ -150,10 +267,6 @@
public EditFishingOperationUIModel() {
super(FishingOperation.class, fromBeanBinder, toBeanBinder);
- gearShootingStartLatitudeAsSexagecimal = SexagecimalPosition.valueOf(getGearShootingStartLatitude());
- gearShootingStartLongitudeAsSexagecimal = SexagecimalPosition.valueOf(getGearShootingStartLongitude());
- gearShootingEndLatitudeAsSexagecimal = SexagecimalPosition.valueOf(getGearShootingEndLatitude());
- gearShootingEndLongitudeAsSexagecimal = SexagecimalPosition.valueOf(getGearShootingEndLongitude());
}
public boolean isLoadingData() {
@@ -176,16 +289,37 @@
@Override
public boolean isEmpty() {
- return StringUtils.isEmpty(getStationNumber())
+ boolean result;
+
+ switch (coordinateEditorType) {
+
+ case DMS:
+ result = gearShootingStartLatitudeDms.isNull()
+ && gearShootingStartLongitudeDms.isNull()
+ && gearShootingEndLatitudeDms.isNull()
+ && gearShootingEndLongitudeDms.isNull();
+ break;
+ case DMD:
+ result = gearShootingStartLatitudeDmd.isNull()
+ && gearShootingStartLongitudeDmd.isNull()
+ && gearShootingEndLatitudeDmd.isNull()
+ && gearShootingEndLongitudeDmd.isNull();
+ break;
+ default:
+ result = getGearShootingStartLatitude() == null
+ && getGearShootingStartLongitude() == null
+ && getGearShootingEndLatitude() == null
+ && getGearShootingEndLongitude() == null;
+ break;
+ }
+
+ return result &&
+ StringUtils.isEmpty(getStationNumber())
&& getFishingOperationNumber() == null
&& getStrata() == null
&& getSubStrata() == null
&& getLocation() == null
- && gearShootingStartLatitudeAsSexagecimal.isNull()
- && gearShootingStartLongitudeAsSexagecimal.isNull()
&& getGearShootingStartDate() == null
- && gearShootingEndLatitudeAsSexagecimal.isNull()
- && gearShootingEndLongitudeAsSexagecimal.isNull()
&& getGearShootingEndDate() == null
&& !isFishingOperationRectiligne()
&& getTrawlDistance() == null
@@ -214,245 +348,481 @@
return fishingOperation != null && !TuttiEntities.isNew(fishingOperation);
}
- public Integer getGearShootingStartLatitudeDegree() {
- Integer result = gearShootingStartLatitudeAsSexagecimal.getDegre();
- if (gearShootingStartLatitudeAsSexagecimal.isSign()) {
- result *= -1;
- }
- return result;
+ //------------------------------------------------------------------------//
+ //-- Start Latitude ------------------------------------------------------//
+ //------------------------------------------------------------------------//
+
+ public DmsCoordinate getGearShootingStartLatitudeDms() {
+ return gearShootingStartLatitudeDms;
}
- public Integer getGearShootingStartLatitudeDecimalDegree() {
- return getGearShootingStartLatitudeDegree();
+ public void setGearShootingStartLatitudeDms(Float decimal) {
+ DmsCoordinate position =
+ DmsCoordinate.valueOf(decimal);
+ setGearShootingStartLatitudeDmsSign(position.isSign());
+ setGearShootingStartLatitudeDmsDegree(position.getDegree());
+ setGearShootingStartLatitudeDmsMinute(position.getMinute());
+ setGearShootingStartLatitudeDmsSecond(position.getSecond());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS, null, getGearShootingStartLatitudeDms());
}
- public void setGearShootingStartLatitudeDegree(Integer degree) {
- Object oldValue = getGearShootingStartLatitudeDegree();
- boolean sign = degree != null && degree < 0;
+ public boolean isGearShootingStartLatitudeDmsSign() {
+ return gearShootingStartLatitudeDms.isSign();
+ }
+
+ public void setGearShootingStartLatitudeDmsSign(boolean sign) {
+ Object oldValue = isGearShootingStartLatitudeDmsSign();
+ gearShootingStartLatitudeDms.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SIGN, oldValue, sign);
+ }
+
+ public Integer getGearShootingStartLatitudeDmsDegree() {
+ return gearShootingStartLatitudeDms.getDegree();
+ }
+
+ public void setGearShootingStartLatitudeDmsDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLatitudeDmsDegree();
if (degree != null) {
degree = Math.abs(degree);
}
- gearShootingStartLatitudeAsSexagecimal.setSign(sign);
- gearShootingStartLatitudeAsSexagecimal.setDegre(degree);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DEGREE, oldValue, degree);
+ gearShootingStartLatitudeDms.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_DEGREE, oldValue, degree);
}
- public void setGearShootingStartLatitudeDecimalDegree(Integer degree) {
- setGearShootingStartLatitudeDegree(degree);
+ public Integer getGearShootingStartLatitudeDmsMinute() {
+ return gearShootingStartLatitudeDms.getMinute();
}
- public Integer getGearShootingStartLatitudeMinute() {
- return gearShootingStartLatitudeAsSexagecimal.getMinute();
+ public void setGearShootingStartLatitudeDmsMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLatitudeDmsMinute();
+ gearShootingStartLatitudeDms.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_MINUTE, oldValue, minute);
}
- public void setGearShootingStartLatitudeMinute(Integer minute) {
- Object oldValue = getGearShootingStartLatitudeMinute();
- gearShootingStartLatitudeAsSexagecimal.setMinute(minute);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_MINUTE, oldValue, minute);
+ public Integer getGearShootingStartLatitudeDmsSecond() {
+ return gearShootingStartLatitudeDms.getSecond();
}
- public Float getGearShootingStartLatitudeDecimalMinute() {
- return gearShootingStartLatitudeAsSexagecimal.getMinuteDecimale();
+ public void setGearShootingStartLatitudeDmsSecond(Integer second) {
+ Object oldValue = getGearShootingStartLatitudeDmsSecond();
+ gearShootingStartLatitudeDms.setSecond(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMS_SECOND, oldValue, second);
}
- public void setGearShootingStartLatitudeDecimalMinute(Float decimalMinute) {
- gearShootingStartLatitudeAsSexagecimal.setMinuteDecimale(decimalMinute);
- // 2013-01-22 kmorin: pass null as previous value,
- // otherwise the filed is not filled with the value (I cannot explain why... :()
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DECIMAL_MINUTE, null, decimalMinute);
+ public DmdCoordinate getGearShootingStartLatitudeDmd() {
+ return gearShootingStartLatitudeDmd;
}
- public Integer getGearShootingStartLatitudeSecond() {
- return gearShootingStartLatitudeAsSexagecimal.getSeconde();
+ public void setGearShootingStartLatitudeDmd(Float decimal) {
+ DmdCoordinate position =
+ DmdCoordinate.valueOf(decimal);
+ setGearShootingStartLatitudeDmdSign(position.isSign());
+ setGearShootingStartLatitudeDmdDegree(position.getDegree());
+ setGearShootingStartLatitudeDmdMinute(position.getMinute());
+ setGearShootingStartLatitudeDmdDecimal(position.getDecimal());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD, null, getGearShootingStartLatitudeDmd());
}
- public void setGearShootingStartLatitudeSecond(Integer second) {
- Object oldValue = getGearShootingStartLatitudeSecond();
- gearShootingStartLatitudeAsSexagecimal.setSeconde(second);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_SECOND, oldValue, second);
+ public boolean isGearShootingStartLatitudeDmdSign() {
+ return gearShootingStartLatitudeDmd.isSign();
}
- public Integer getGearShootingStartLongitudeDegree() {
- Integer result = gearShootingStartLongitudeAsSexagecimal.getDegre();
- if (gearShootingStartLongitudeAsSexagecimal.isSign()) {
- result *= -1;
- }
- return result;
+ public void setGearShootingStartLatitudeDmdSign(boolean sign) {
+ Object oldValue = isGearShootingStartLatitudeDmdSign();
+ gearShootingStartLatitudeDmd.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_SIGN, oldValue, sign);
}
- public Integer getGearShootingStartLongitudeDecimalDegree() {
- return getGearShootingStartLongitudeDegree();
+ public Integer getGearShootingStartLatitudeDmdDegree() {
+ return gearShootingStartLatitudeDmd.getDegree();
}
- public void setGearShootingStartLongitudeDegree(Integer degree) {
- Object oldValue = getGearShootingStartLongitudeDegree();
- boolean sign = degree != null && degree < 0;
+ public void setGearShootingStartLatitudeDmdDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLatitudeDmdDegree();
+ gearShootingStartLatitudeDmd.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingStartLatitudeDmdMinute() {
+ return gearShootingStartLatitudeDmd.getMinute();
+ }
+
+ public void setGearShootingStartLatitudeDmdMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLatitudeDmdMinute();
+ gearShootingStartLatitudeDmd.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_MINUTE, oldValue, minute);
+ }
+
+ public Integer getGearShootingStartLatitudeDmdDecimal() {
+ return gearShootingStartLatitudeDmd.getDecimal();
+ }
+
+ public void setGearShootingStartLatitudeDmdDecimal(Integer decimal) {
+ Object oldValue = getGearShootingStartLatitudeDmdDecimal();
+ gearShootingStartLatitudeDmd.setDecimal(decimal);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LATITUDE_DMD_DECIMAL, oldValue, decimal);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Start Longitude -----------------------------------------------------//
+ //------------------------------------------------------------------------//
+
+ public DmsCoordinate getGearShootingStartLongitudeDms() {
+ return gearShootingStartLongitudeDms;
+ }
+
+ public void setGearShootingStartLongitudeDms(Float decimal) {
+ DmsCoordinate position =
+ DmsCoordinate.valueOf(decimal);
+ setGearShootingStartLongitudeDmsSign(position.isSign());
+ setGearShootingStartLongitudeDmsDegree(position.getDegree());
+ setGearShootingStartLongitudeDmsMinute(position.getMinute());
+ setGearShootingStartLongitudeDmsSecond(position.getSecond());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS, null, getGearShootingStartLongitudeDms());
+ }
+
+ public boolean isGearShootingStartLongitudeDmsSign() {
+ return gearShootingStartLongitudeDms.isSign();
+ }
+
+ public void setGearShootingStartLongitudeDmsSign(boolean sign) {
+ Object oldValue = isGearShootingStartLongitudeDmsSign();
+ gearShootingStartLongitudeDms.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SIGN, oldValue, sign);
+ }
+
+ public Integer getGearShootingStartLongitudeDmsDegree() {
+ return gearShootingStartLongitudeDms.getDegree();
+ }
+
+ public void setGearShootingStartLongitudeDmsDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLongitudeDmsDegree();
if (degree != null) {
degree = Math.abs(degree);
}
- gearShootingStartLongitudeAsSexagecimal.setSign(sign);
- gearShootingStartLongitudeAsSexagecimal.setDegre(degree);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DEGREE, oldValue, degree);
+ gearShootingStartLongitudeDms.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_DEGREE, oldValue, degree);
}
- public void setGearShootingStartLongitudeDecimalDegree(Integer degree) {
- setGearShootingStartLongitudeDegree(degree);
+ public Integer getGearShootingStartLongitudeDmsMinute() {
+ return gearShootingStartLongitudeDms.getMinute();
}
- public Integer getGearShootingStartLongitudeMinute() {
- return gearShootingStartLongitudeAsSexagecimal.getMinute();
+ public void setGearShootingStartLongitudeDmsMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLongitudeDmsMinute();
+ gearShootingStartLongitudeDms.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_MINUTE, oldValue, minute);
}
- public void setGearShootingStartLongitudeMinute(Integer minute) {
- Object oldValue = getGearShootingStartLongitudeMinute();
- gearShootingStartLongitudeAsSexagecimal.setMinute(minute);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_MINUTE, oldValue, minute);
+ public Integer getGearShootingStartLongitudeDmsSecond() {
+ return gearShootingStartLongitudeDms.getSecond();
}
- public Float getGearShootingStartLongitudeDecimalMinute() {
- return gearShootingStartLongitudeAsSexagecimal.getMinuteDecimale();
+ public void setGearShootingStartLongitudeDmsSecond(Integer second) {
+ Object oldValue = getGearShootingStartLongitudeDmsSecond();
+ gearShootingStartLongitudeDms.setSecond(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMS_SECOND, oldValue, second);
}
- public void setGearShootingStartLongitudeDecimalMinute(Float decimalMinute) {
- gearShootingStartLongitudeAsSexagecimal.setMinuteDecimale(decimalMinute);
- // 2013-01-22 kmorin: pass null as previous value,
- // otherwise the filed is not filled with the value (I cannot explain why... :()
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DECIMAL_MINUTE, null, decimalMinute);
+ public DmdCoordinate getGearShootingStartLongitudeDmd() {
+ return gearShootingStartLongitudeDmd;
}
- public Integer getGearShootingStartLongitudeSecond() {
- return gearShootingStartLongitudeAsSexagecimal.getSeconde();
+ public void setGearShootingStartLongitudeDmd(Float decimal) {
+ DmdCoordinate position =
+ DmdCoordinate.valueOf(decimal);
+ setGearShootingStartLongitudeDmdSign(position.isSign());
+ setGearShootingStartLongitudeDmdDegree(position.getDegree());
+ setGearShootingStartLongitudeDmdMinute(position.getMinute());
+ setGearShootingStartLongitudeDmdDecimal(position.getDecimal());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD, null, getGearShootingStartLongitudeDmd());
}
- public void setGearShootingStartLongitudeSecond(Integer second) {
- Object oldValue = getGearShootingStartLongitudeSecond();
- gearShootingStartLongitudeAsSexagecimal.setSeconde(second);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_SECOND, oldValue, second);
+ public boolean isGearShootingStartLongitudeDmdSign() {
+ return gearShootingStartLongitudeDmd.isSign();
}
- public void setGearShootingStartTime(Date gearShootingStartDate) {
- Object oldValue = getGearShootingStartDate();
- if (oldValue != null) {
- setGearShootingStartDate(gearShootingStartDate);
- }
+ public void setGearShootingStartLongitudeDmdSign(boolean sign) {
+ Object oldValue = isGearShootingStartLongitudeDmdSign();
+ gearShootingStartLongitudeDmd.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_SIGN, oldValue, sign);
}
- public Integer getGearShootingEndLatitudeDegree() {
- Integer result = gearShootingEndLatitudeAsSexagecimal.getDegre();
- if (gearShootingEndLatitudeAsSexagecimal.isSign()) {
- result *= -1;
+ public Integer getGearShootingStartLongitudeDmdDegree() {
+ return gearShootingStartLongitudeDmd.getDegree();
+ }
+
+ public void setGearShootingStartLongitudeDmdDegree(Integer degree) {
+ Object oldValue = getGearShootingStartLongitudeDmdDegree();
+ if (degree != null) {
+ degree = Math.abs(degree);
}
- return result;
+ gearShootingStartLongitudeDmd.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DEGREE, oldValue, degree);
}
- public Integer getGearShootingEndLatitudeDecimalDegree() {
- return getGearShootingEndLatitudeDegree();
+ public Integer getGearShootingStartLongitudeDmdMinute() {
+ return gearShootingStartLongitudeDmd.getMinute();
}
- public void setGearShootingEndLatitudeDegree(Integer degree) {
- Object oldValue = getGearShootingEndLatitudeDegree();
- boolean sign = degree != null && degree < 0;
+ public void setGearShootingStartLongitudeDmdMinute(Integer minute) {
+ Object oldValue = getGearShootingStartLongitudeDmdMinute();
+ gearShootingStartLongitudeDmd.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_MINUTE, oldValue, minute);
+ }
+
+ public Integer getGearShootingStartLongitudeDmdDecimal() {
+ return gearShootingStartLongitudeDmd.getDecimal();
+ }
+
+ public void setGearShootingStartLongitudeDmdDecimal(Integer minute) {
+ Object oldValue = getGearShootingStartLongitudeDmdDecimal();
+ gearShootingStartLongitudeDmd.setDecimal(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_START_LONGITUDE_DMD_DECIMAL, oldValue, minute);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- End Latitude --------------------------------------------------------//
+ //------------------------------------------------------------------------//
+
+ public DmsCoordinate getGearShootingEndLatitudeDms() {
+ return gearShootingEndLatitudeDms;
+ }
+
+ public void setGearShootingEndLatitudeDms(Float decimal) {
+ DmsCoordinate position =
+ DmsCoordinate.valueOf(decimal);
+ setGearShootingEndLatitudeDmsSign(position.isSign());
+ setGearShootingEndLatitudeDmdDegree(position.getDegree());
+ setGearShootingEndLatitudeDmsMinute(position.getMinute());
+ setGearShootingEndLatitudeDmsSecond(position.getSecond());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS, null, getGearShootingEndLatitudeDms());
+ }
+
+ public boolean isGearShootingEndLatitudeDmsSign() {
+ return gearShootingEndLatitudeDms.isSign();
+ }
+
+ public void setGearShootingEndLatitudeDmsSign(boolean sign) {
+ Object oldValue = isGearShootingEndLatitudeDmsSign();
+ gearShootingEndLatitudeDms.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SIGN, oldValue, sign);
+ }
+
+ public Integer getGearShootingEndLatitudeDmsDegree() {
+ return gearShootingEndLatitudeDms.getDegree();
+ }
+
+ public void setGearShootingEndLatitudeDmsDegree(Integer degree) {
+ Object oldValue = getGearShootingEndLatitudeDmsDegree();
if (degree != null) {
degree = Math.abs(degree);
}
- gearShootingEndLatitudeAsSexagecimal.setSign(sign);
- gearShootingEndLatitudeAsSexagecimal.setDegre(degree);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DEGREE, oldValue, degree);
+ gearShootingEndLatitudeDms.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_DEGREE, oldValue, degree);
}
- public void setGearShootingEndLatitudeDecimalDegree(Integer degree) {
- setGearShootingEndLatitudeDegree(degree);
+ public Integer getGearShootingEndLatitudeDmsMinute() {
+ return gearShootingEndLatitudeDms.getMinute();
}
- public Integer getGearShootingEndLatitudeMinute() {
- return gearShootingEndLatitudeAsSexagecimal.getMinute();
+ public void setGearShootingEndLatitudeDmsMinute(Integer minute) {
+ Object oldValue = getGearShootingEndLatitudeDmsMinute();
+ gearShootingEndLatitudeDms.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_MINUTE, oldValue, minute);
}
- public void setGearShootingEndLatitudeMinute(Integer minute) {
- Object oldValue = getGearShootingEndLatitudeMinute();
- gearShootingEndLatitudeAsSexagecimal.setMinute(minute);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_MINUTE, oldValue, minute);
+ public Integer getGearShootingEndLatitudeDmsSecond() {
+ return gearShootingEndLatitudeDms.getSecond();
}
- public Float getGearShootingEndLatitudeDecimalMinute() {
- return gearShootingEndLatitudeAsSexagecimal.getMinuteDecimale();
+ public void setGearShootingEndLatitudeDmsSecond(Integer second) {
+ Object oldValue = getGearShootingEndLatitudeDmsSecond();
+ gearShootingEndLatitudeDms.setSecond(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMS_SECOND, oldValue, second);
}
- public void setGearShootingEndLatitudeDecimalMinute(Float decimalMinute) {
- gearShootingEndLatitudeAsSexagecimal.setMinuteDecimale(decimalMinute);
- // 2013-01-22 kmorin: pass null as previous value,
- // otherwise the filed is not filled with the value (I cannot explain why... :()
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DECIMAL_MINUTE, null, decimalMinute);
+ public DmdCoordinate getGearShootingEndLatitudeDmd() {
+ return gearShootingEndLatitudeDmd;
}
- public Integer getGearShootingEndLatitudeSecond() {
- return gearShootingEndLatitudeAsSexagecimal.getSeconde();
+ public void setGearShootingEndLatitudeDmd(Float decimal) {
+ DmdCoordinate position =
+ DmdCoordinate.valueOf(decimal);
+ setGearShootingEndLatitudeDmdSign(position.isSign());
+ setGearShootingEndLatitudeDmdDegree(position.getDegree());
+ setGearShootingEndLatitudeDmdMinute(position.getMinute());
+ setGearShootingEndLatitudeDmdDecimal(position.getDecimal());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD, null, getGearShootingEndLatitudeDmd());
}
- public void setGearShootingEndLatitudeSecond(Integer second) {
- Object oldValue = getGearShootingEndLatitudeSecond();
- gearShootingEndLatitudeAsSexagecimal.setSeconde(second);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_SECOND, oldValue, second);
+ public boolean isGearShootingEndLatitudeDmdSign() {
+ return gearShootingEndLatitudeDmd.isSign();
}
- public Integer getGearShootingEndLongitudeDegree() {
- Integer result = gearShootingEndLongitudeAsSexagecimal.getDegre();
- if (gearShootingEndLongitudeAsSexagecimal.isSign()) {
- result *= -1;
- }
- return result;
+ public void setGearShootingEndLatitudeDmdSign(boolean sign) {
+ Object oldValue = isGearShootingEndLatitudeDmdSign();
+ gearShootingEndLatitudeDmd.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_SIGN, oldValue, sign);
}
- public Integer getGearShootingEndLongitudeDecimalDegree() {
- return getGearShootingEndLongitudeDegree();
+ public Integer getGearShootingEndLatitudeDmdDegree() {
+ return gearShootingEndLatitudeDmd.getDegree();
}
- public void setGearShootingEndLongitudeDegree(Integer degree) {
- Object oldValue = getGearShootingEndLongitudeDegree();
- boolean sign = degree != null && degree < 0;
+ public void setGearShootingEndLatitudeDmdDegree(Integer degree) {
+ Object oldValue = getGearShootingEndLatitudeDmdDegree();
+ gearShootingEndLatitudeDmd.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingEndLatitudeDmdMinute() {
+ return gearShootingEndLatitudeDmd.getMinute();
+ }
+
+ public void setGearShootingEndLatitudeDmdMinute(Integer minute) {
+ Object oldValue = getGearShootingEndLatitudeDmdMinute();
+ gearShootingEndLatitudeDmd.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_MINUTE, oldValue, minute);
+ }
+
+ public Integer getGearShootingEndLatitudeDmdDecimal() {
+ return gearShootingEndLatitudeDmd.getDecimal();
+ }
+
+ public void setGearShootingEndLatitudeDmdDecimal(Integer minute) {
+ Object oldValue = getGearShootingEndLatitudeDmdDecimal();
+ gearShootingEndLatitudeDmd.setDecimal(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LATITUDE_DMD_DECIMAL, oldValue, minute);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- End Longitude -------------------------------------------------------//
+ //------------------------------------------------------------------------//
+
+ public DmsCoordinate getGearShootingEndLongitudeDms() {
+ return gearShootingEndLongitudeDms;
+ }
+
+ public void setGearShootingEndLongitudeDms(Float decimal) {
+ DmsCoordinate position =
+ DmsCoordinate.valueOf(decimal);
+ setGearShootingEndLongitudeDmsSign(position.isSign());
+ setGearShootingEndLongitudeDmsDegree(position.getDegree());
+ setGearShootingEndLongitudeDmsMinute(position.getMinute());
+ setGearShootingEndLongitudeDmsSecond(position.getSecond());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS, null, getGearShootingEndLongitudeDms());
+ }
+
+ public boolean isGearShootingEndLongitudeDmsSign() {
+ return gearShootingEndLongitudeDms.isSign();
+ }
+
+ public void setGearShootingEndLongitudeDmsSign(boolean sign) {
+ Object oldValue = isGearShootingEndLongitudeDmsSign();
+ gearShootingEndLongitudeDms.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SIGN, oldValue, sign);
+ }
+
+ public Integer getGearShootingEndLongitudeDmsDegree() {
+ Integer result = gearShootingEndLongitudeDms.getDegree();
+ return result;
+ }
+
+ public void setGearShootingEndLongitudeDmsDegree(Integer degree) {
+ Object oldValue = getGearShootingEndLongitudeDmsDegree();
if (degree != null) {
degree = Math.abs(degree);
}
- gearShootingEndLongitudeAsSexagecimal.setSign(sign);
- gearShootingEndLongitudeAsSexagecimal.setDegre(degree);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DEGREE, oldValue, degree);
+ gearShootingEndLongitudeDms.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_DEGREE, oldValue, degree);
}
- public void setGearShootingEndLongitudeDecimalDegree(Integer degree) {
- setGearShootingEndLongitudeDegree(degree);
+ public Integer getGearShootingEndLongitudeDmsMinute() {
+ return gearShootingEndLongitudeDms.getMinute();
}
- public Integer getGearShootingEndLongitudeMinute() {
- return gearShootingEndLongitudeAsSexagecimal.getMinute();
+ public void setGearShootingEndLongitudeDmsMinute(Integer minute) {
+ Object oldValue = getGearShootingEndLongitudeDmsMinute();
+ gearShootingEndLongitudeDms.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_MINUTE, oldValue, minute);
}
- public void setGearShootingEndLongitudeMinute(Integer minute) {
- Object oldValue = getGearShootingEndLongitudeMinute();
- gearShootingEndLongitudeAsSexagecimal.setMinute(minute);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_MINUTE, oldValue, minute);
+ public Integer getGearShootingEndLongitudeDmsSecond() {
+ return gearShootingEndLongitudeDms.getSecond();
}
- public Float getGearShootingEndLongitudeDecimalMinute() {
- return gearShootingEndLongitudeAsSexagecimal.getMinuteDecimale();
+ public void setGearShootingEndLongitudeDmsSecond(Integer second) {
+ Object oldValue = getGearShootingEndLongitudeDmsSecond();
+ gearShootingEndLongitudeDms.setSecond(second);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMS_SECOND, oldValue, second);
}
- public void setGearShootingEndLongitudeDecimalMinute(Float decimalMinute) {
- gearShootingEndLongitudeAsSexagecimal.setMinuteDecimale(decimalMinute);
- // 2013-01-22 kmorin: pass null as previous value,
- // otherwise the filed is not filled with the value (I cannot explain why... :()
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DECIMAL_MINUTE, null, decimalMinute);
+ public DmdCoordinate getGearShootingEndLongitudeDmd() {
+ return gearShootingEndLongitudeDmd;
}
- public Integer getGearShootingEndLongitudeSecond() {
- return gearShootingEndLongitudeAsSexagecimal.getSeconde();
+ public void setGearShootingEndLongitudeDmd(Float decimal) {
+ DmdCoordinate position =
+ DmdCoordinate.valueOf(decimal);
+ setGearShootingEndLongitudeDmdSign(position.isSign());
+ setGearShootingEndLongitudeDmdDegree(position.getDegree());
+ setGearShootingEndLongitudeDmdMinute(position.getMinute());
+ setGearShootingEndLongitudeDmdDecimal(position.getDecimal());
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD, null, getGearShootingEndLongitudeDmd());
}
- public void setGearShootingEndLongitudeSecond(Integer second) {
- Object oldValue = getGearShootingEndLongitudeSecond();
- gearShootingEndLongitudeAsSexagecimal.setSeconde(second);
- firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_SECOND, oldValue, second);
+ public boolean isGearShootingEndLongitudeDmdSign() {
+ return gearShootingEndLongitudeDmd.isSign();
}
+ public void setGearShootingEndLongitudeDmdSign(boolean sign) {
+ Object oldValue = isGearShootingEndLongitudeDmdSign();
+ gearShootingEndLongitudeDmd.setSign(sign);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_SIGN, oldValue, sign);
+ }
+
+ public Integer getGearShootingEndLongitudeDmdDegree() {
+ return gearShootingEndLongitudeDmd.getDegree();
+ }
+
+ public void setGearShootingEndLongitudeDmdDegree(Integer degree) {
+ Object oldValue = gearShootingEndLongitudeDmd.getDegree();
+ gearShootingEndLongitudeDmd.setDegree(degree);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DEGREE, oldValue, degree);
+ }
+
+ public Integer getGearShootingEndLongitudeDmdMinute() {
+ return gearShootingEndLongitudeDmd.getMinute();
+ }
+
+ public void setGearShootingEndLongitudeDmdMinute(Integer minute) {
+ Object oldValue = gearShootingEndLongitudeDmd.getMinute();
+ gearShootingEndLongitudeDmd.setMinute(minute);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_MINUTE, oldValue, minute);
+ }
+
+ public Integer getGearShootingEndLongitudeDmdDecimal() {
+ return gearShootingEndLongitudeDmd.getDecimal();
+ }
+
+ public void setGearShootingEndLongitudeDmdDecimal(Integer decimal) {
+ Object oldValue = gearShootingEndLongitudeDmd.getDecimal();
+ gearShootingEndLongitudeDmd.setDecimal(decimal);
+ firePropertyChange(PROPERTY_GEAR_SHOOTING_END_LONGITUDE_DMD_DECIMAL, oldValue, decimal);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Start - End Time ----------------------------------------------------//
+ //------------------------------------------------------------------------//
+
+ public void setGearShootingStartTime(Date gearShootingStartDate) {
+ Object oldValue = getGearShootingStartDate();
+ if (oldValue != null) {
+ setGearShootingStartDate(gearShootingStartDate);
+ }
+ }
+
public void setGearShootingEndTime(Date gearShootingEndDate) {
Object oldValue = getGearShootingEndDate();
if (oldValue != null) {
@@ -487,72 +857,75 @@
return minutes <= 45 && minutes >= 20;
}
- public void convertGearShootingCoordinatesDDToDMS() {
- SexagecimalPosition position;
- Integer degree;
+ public boolean isCoordinateDms() {
+ return CoordinateEditorType.DMS.equals(getCoordinateEditorType());
+ }
- position = SexagecimalPosition.valueOf(getGearShootingStartLatitude());
- degree = position.getDegre();
- if (degree != null) {
- degree *= position.isSign() ? -1 : 1;
- }
- setGearShootingStartLatitudeDegree(degree);
- setGearShootingStartLatitudeMinute(position.getMinute());
- setGearShootingStartLatitudeSecond(position.getSeconde());
- setGearShootingStartLatitudeDecimalMinute(position.getMinuteDecimale());
+ public boolean isCoordinateDmd() {
+ return CoordinateEditorType.DMD.equals(getCoordinateEditorType());
+ }
- position = SexagecimalPosition.valueOf(getGearShootingStartLongitude());
- degree = position.getDegre();
- if (degree != null) {
- degree *= position.isSign() ? -1 : 1;
- }
- setGearShootingStartLongitudeDegree(degree);
- setGearShootingStartLongitudeMinute(position.getMinute());
- setGearShootingStartLongitudeSecond(position.getSeconde());
- setGearShootingStartLongitudeDecimalMinute(position.getMinuteDecimale());
+ public void convertGearShootingCoordinatesFromDD() {
+ switch (coordinateEditorType) {
- position = SexagecimalPosition.valueOf(getGearShootingEndLatitude());
- degree = position.getDegre();
- if (degree != null) {
- degree *= position.isSign() ? -1 : 1;
- }
- if (position.getDegre() != null) {
+ case DMS:
+ setGearShootingStartLatitudeDms(getGearShootingStartLatitude());
+ setGearShootingStartLongitudeDms(getGearShootingStartLongitude());
+ setGearShootingEndLatitudeDms(getGearShootingEndLatitude());
+ setGearShootingEndLongitudeDms(getGearShootingEndLongitude());
+ break;
+ case DMD:
+ setGearShootingStartLatitudeDmd(getGearShootingStartLatitude());
+ setGearShootingStartLongitudeDmd(getGearShootingStartLongitude());
+ setGearShootingEndLatitudeDmd(getGearShootingEndLatitude());
+ setGearShootingEndLongitudeDmd(getGearShootingEndLongitude());
+ break;
}
- setGearShootingEndLatitudeDegree(degree);
- setGearShootingEndLatitudeMinute(position.getMinute());
- setGearShootingEndLatitudeSecond(position.getSeconde());
- setGearShootingEndLatitudeDecimalMinute(position.getMinuteDecimale());
- position = SexagecimalPosition.valueOf(getGearShootingEndLongitude());
- degree = position.getDegre();
- if (degree != null) {
- degree *= position.isSign() ? -1 : 1;
- }
- setGearShootingEndLongitudeDegree(degree);
- setGearShootingEndLongitudeMinute(position.getMinute());
- setGearShootingEndLongitudeSecond(position.getSeconde());
- setGearShootingEndLongitudeDecimalMinute(position.getMinuteDecimale());
+// quadrant = GeoPositionHelper.getQuadrant(
+// getGearShootingStartLongitude(),
+// getGearShootingStartLatitude());
}
- public void convertGearShootingCoordinatesDMSToDD() {
- Float decimalValue = gearShootingStartLatitudeAsSexagecimal.toDecimal();
- editObject.setGearShootingStartLatitude(decimalValue);
+ public void convertGearShootingCoordinatesToDD() {
- decimalValue = gearShootingStartLongitudeAsSexagecimal.toDecimal();
- editObject.setGearShootingStartLongitude(decimalValue);
+ switch (coordinateEditorType) {
- decimalValue = gearShootingEndLatitudeAsSexagecimal.toDecimal();
- editObject.setGearShootingEndLatitude(decimalValue);
+ case DMS:
+ editObject.setGearShootingStartLatitude(
+ gearShootingStartLatitudeDms.toDecimal());
- decimalValue = gearShootingEndLongitudeAsSexagecimal.toDecimal();
- editObject.setGearShootingEndLongitude(decimalValue);
+ editObject.setGearShootingStartLongitude(
+ gearShootingStartLongitudeDms.toDecimal());
+
+ editObject.setGearShootingEndLatitude(
+ gearShootingEndLatitudeDms.toDecimal());
+
+ editObject.setGearShootingEndLongitude(
+ gearShootingEndLongitudeDms.toDecimal());
+ break;
+
+ case DMD:
+ editObject.setGearShootingStartLatitude(
+ gearShootingStartLatitudeDmd.toDecimal());
+
+ editObject.setGearShootingStartLongitude(
+ gearShootingStartLongitudeDmd.toDecimal());
+
+ editObject.setGearShootingEndLatitude(
+ gearShootingEndLatitudeDmd.toDecimal());
+
+ editObject.setGearShootingEndLongitude(
+ gearShootingEndLongitudeDmd.toDecimal());
+ break;
+ }
}
public void computeDistance() {
- if (coordinateEditorType != CoordinateEditorType.DD) {
- convertGearShootingCoordinatesDMSToDD();
- }
+
+ convertGearShootingCoordinatesToDD();
+
if (getGearShootingStartLatitude() != null && getGearShootingStartLongitude() != null
&& getGearShootingEndLatitude() != null && getGearShootingEndLongitude() != null) {
Integer distance = TuttiUIUtil.computeDistanceInMeters(
@@ -963,7 +1336,9 @@
List<Vessel> allSecondaryVessel;
List<Vessel> onlyCruisSecondaryVessel;
+
List<Vessel> scientificSecondaryVessel;
+
List<Vessel> fishingSecondaryVessel;
public List<Vessel> getAllSecondaryVessel() {
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SaveFishingOperationAction.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SaveFishingOperationAction.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/SaveFishingOperationAction.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -37,7 +37,6 @@
import fr.ifremer.tutti.ui.swing.content.operation.fishing.VesselUseFeatureTabUIModel;
import fr.ifremer.tutti.ui.swing.util.TuttiBeanMonitor;
import fr.ifremer.tutti.ui.swing.util.action.AbstractTuttiAction;
-import fr.ifremer.tutti.ui.swing.util.editor.CoordinateEditorType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -91,11 +90,8 @@
if (mustSave) {
// prepare model
+ beanToSave.convertGearShootingCoordinatesToDD();
- if (beanToSave.getCoordinateEditorType() != CoordinateEditorType.DD) {
- beanToSave.convertGearShootingCoordinatesDMSToDD();
- }
-
// save modified fishing operation
FishingOperation toSave = beanToSave.toBean();
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/accidental/AccidentalBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -37,6 +37,7 @@
javax.swing.ListSelectionModel
java.awt.Color
+ java.awt.Dimension
static org.nuiton.i18n.I18n._
</import>
@@ -92,4 +93,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
+ <JPanel constraints='BorderLayout.SOUTH'
+ minimumSize="{new Dimension(10,30)}"
+ maximumSize="{new Dimension(10,30)}"
+ preferredSize="{new Dimension(10,30)}"/>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/BenthosBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -37,6 +37,7 @@
javax.swing.ListSelectionModel
java.awt.Color
+ java.awt.Dimension
static org.nuiton.i18n.I18n._
static fr.ifremer.tutti.ui.swing.util.TuttiUIUtil.getWeightStringValue
@@ -172,4 +173,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
+ <JPanel constraints='BorderLayout.SOUTH'
+ minimumSize="{new Dimension(10,30)}"
+ maximumSize="{new Dimension(10,30)}"
+ preferredSize="{new Dimension(10,30)}"/>
</JPanel>
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/individualobservation/IndividualObservationBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -37,6 +37,7 @@
javax.swing.ListSelectionModel
java.awt.Color
+ java.awt.Dimension
static org.nuiton.i18n.I18n._
</import>
@@ -92,4 +93,8 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
+ <JPanel constraints='BorderLayout.SOUTH'
+ minimumSize="{new Dimension(10,30)}"
+ maximumSize="{new Dimension(10,30)}"
+ preferredSize="{new Dimension(10,30)}"/>
</JPanel>
\ No newline at end of file
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/marinelitter/MarineLitterBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -36,6 +36,7 @@
javax.swing.ListSelectionModel
java.awt.Color
+ java.awt.Dimension
static org.nuiton.i18n.I18n._
</import>
@@ -109,4 +110,9 @@
onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
</JScrollPane>
+ <JPanel constraints='BorderLayout.SOUTH'
+ minimumSize="{new Dimension(10,30)}"
+ maximumSize="{new Dimension(10,30)}"
+ preferredSize="{new Dimension(10,30)}"/>
+
</JPanel>
\ No newline at end of file
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/SpeciesBatchUI.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -37,6 +37,7 @@
javax.swing.ListSelectionModel
java.awt.Color
+ java.awt.Dimension
static org.nuiton.i18n.I18n._
static fr.ifremer.tutti.ui.swing.util.TuttiUIUtil.getWeightStringValue
@@ -168,10 +169,18 @@
</Table>
- <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER'>
- <JXTable id='table'
- onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
- onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
+ <JScrollPane id='tableScrollPane' constraints='BorderLayout.CENTER' columnHeaderView="{table.getTableHeader()}">
+ <JPanel layout='{new BorderLayout()}'>
+ <JXTable id='table' constraints='BorderLayout.CENTER'
+ onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)'
+ onKeyPressed='handler.openRowMenu(event, tablePopup)'/>
+ <JLabel constraints='BorderLayout.SOUTH'
+ preferredSize="{new Dimension(10,100)}"/>
+ </JPanel>
+
</JScrollPane>
+
+ <!--background="{Color.WHITE}"/>-->
+
</JPanel>
Copied: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/CoordinateEditorType.java (from rev 1314, trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java)
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/CoordinateEditorType.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/CoordinateEditorType.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,47 @@
+
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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%
+ */
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 1.0
+ */
+public enum CoordinateEditorType {
+
+ /**
+ * Degre-Minute-second.
+ */
+ DMS,
+ /**
+ * Degre decimal.
+ */
+ DD,
+ /**
+ * Degre minute decimal
+ */
+ DMD
+
+}
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinate.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinate.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinate.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,294 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * Geo coordinate in degree decimal, minute format.
+ * <p/>
+ * Created on 10/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmdCoordinate extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+
+ public static final String PROPERTY_SIGN = "sign";
+
+ public static final String PROPERTY_DEGREE = "degree";
+
+ public static final String PROPERTY_MINUTE = "minute";
+
+ public static final String PROPERTY_DECIMAL = "decimal";
+
+ protected boolean sign;
+
+ protected Integer degree;
+
+ protected Integer minute;
+
+ protected Integer decimal;
+
+ public static DmdCoordinate empty() {
+ DmdCoordinate r = new DmdCoordinate();
+ return r;
+ }
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimal la valeur au format decimal
+ * @return une nouvelle instance de position convertie
+ */
+ public static DmdCoordinate valueOf(Float decimal) {
+ DmdCoordinate r = new DmdCoordinate();
+ r.fromDecimal(decimal);
+ return r;
+ }
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * degre décimale minute.
+ *
+ * @param d la valeur des degres
+ * @param m la valeur des minutes
+ * @param dc la valeur des décimales de minutes
+ * @return une nouvelle instance de position convertie
+ */
+ public static DmdCoordinate valueOf(boolean sign, int d, int m, int dc) {
+ DmdCoordinate r = new DmdCoordinate();
+ r.setSign(sign);
+ r.setDegree(d);
+ r.setMinute(m);
+ r.setDecimal(dc);
+ return r;
+ }
+
+ public boolean isSign() {
+ return sign;
+ }
+
+ public Integer getDegree() {
+ return degree;
+ }
+
+ public Integer getMinute() {
+ return minute;
+ }
+
+ public Integer getDecimal() {
+ return decimal;
+ }
+
+ public void setSign(boolean sign) {
+ Object oldValue = isSign();
+ this.sign = sign;
+ firePropertyChange(PROPERTY_SIGN, oldValue, sign);
+ }
+
+ public void setDegree(Integer degree) {
+ Object oldValue = getDegree();
+ this.degree = degree;
+ firePropertyChange(PROPERTY_DEGREE, oldValue, degree);
+ }
+
+ public void setMinute(Integer minute) {
+ Object oldValue = getMinute();
+ this.minute = minute;
+ firePropertyChange(PROPERTY_MINUTE, oldValue, minute);
+ }
+
+ public void setDecimal(Integer decimal) {
+ Object oldValue = getDecimal();
+ this.decimal = decimal;
+ firePropertyChange(PROPERTY_DECIMAL, oldValue, decimal);
+ }
+
+ /**
+ * @return {@code true} si aucune composante n'est renseignée,
+ * {@code false} autrement.
+ */
+ public boolean isNull() {
+ return degree == null && minute == null && decimal == null;
+ }
+
+ public boolean isDegreeNull() {
+ return degree == null || degree == 0;
+ }
+
+ public boolean isMinuteNull() {
+ return minute == null || minute == 0;
+ }
+
+ public boolean isDecimalNull() {
+ return decimal == null || decimal == 0;
+ }
+
+ /**
+ * Mets a jour les composants de la position a partir d'une valeur decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimalValue la valeur decimale a convertir (qui peut etre nulle).
+ */
+ public void fromDecimal(Float decimalValue) {
+ Integer d = null;
+ Integer m = null;
+ Integer dc = null;
+ boolean si = false;
+ if (decimalValue != null) {
+ si = decimalValue < 0;
+
+ float absDecimal = Math.abs(decimalValue);
+
+ d = (int) (Math.round(absDecimal + 0.5) - 1);
+ int rest = Math.round(100 * 60.0f * (absDecimal - d));
+ if (rest > 0) {
+ m = rest / 100;
+ dc = (rest - m * 100);
+
+ // clean not used values
+ if (m == 0) {
+ m = null;
+ }
+ if (dc == 0) {
+ dc = null;
+ }
+ }
+ if (d == 0) {
+ d = null;
+ }
+ }
+
+ degree = d;
+ minute = m;
+ decimal = dc;
+ sign = si;
+ }
+
+ public Float toDecimal() {
+ if (isNull()) {
+ return null;
+ }
+ Integer d = getNotNullDegree();
+ Integer m = getNotNullMinute();
+ Integer dc = getNotNullDecimal();
+ Float result = Float.valueOf(d);
+ result += (m + (dc / 100f)) / 60.0f;
+ if (sign) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public Integer getSignedDegree() {
+ Integer result = null;
+ if (!isDegreeNull()) {
+ result = degree;
+ if (isSign()) {
+ result *= -1;
+ }
+ }
+ return result;
+ }
+
+ public int getNotNullDegree() {
+ return isDegreeNull() ? 0 : degree;
+ }
+
+ public int getNotNullMinute() {
+ return isMinuteNull() ? 0 : minute;
+ }
+
+ public int getNotNullDecimal() {
+ return isDecimalNull() ? 0 : decimal;
+ }
+
+ public boolean isLatitudeDegreeValid() {
+ boolean result = isDegreeValid(false);
+ return result;
+ }
+
+ public boolean isLongitudeDegreeValid() {
+ boolean result = isDegreeValid(true);
+ return result;
+ }
+
+ public boolean isMinuteValid() {
+ boolean result = true;
+ if (!isMinuteNull()) {
+ if (minute == 60) {
+
+ // can not have decimal
+ result = isDecimalNull();
+ } else {
+ result = 0 <= minute && minute < 60;
+ }
+ }
+ return result;
+ }
+
+ public boolean isDecimalValid() {
+ boolean result = isDecimalNull() || (0 <= decimal && decimal < 100);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "DmdCoordinateComponent{" +
+ "sign=" + sign +
+ ", degree=" + degree +
+ ", minute=" + minute +
+ ", decimal=" + decimal +
+ '}';
+ }
+
+ protected boolean isDegreeValid(boolean longitude) {
+ boolean result = true;
+ if (!isDegreeNull()) {
+ int bound = longitude ? 180 : 90;
+ if (bound == degree) {
+
+ // can not have minute nor decimal
+ result = isMinuteNull() && isDecimalNull();
+ } else {
+ result = 0 <= degree && degree < bound;
+ }
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinate.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.css 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,40 @@
+/*
+ * #%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%
+ */
+#toolbarLeft {
+ floatable:false;
+ borderPainted:false;
+ visible:{isShowReset()};
+}
+
+#resetButton {
+ actionIcon:"combobox-reset";
+ toolTipText: {getShowResetTip()};
+ focusable:false;
+ focusPainted:false;
+ enabled:{isEnabled()};
+}
+
+#editor {
+ enabled:{isEnabled()};
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,61 @@
+<!--
+ #%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%
+ -->
+<JPanel id='editorPanel' layout='{new BorderLayout()}'
+ onFocusGained='editor.requestFocus()'>
+ <import>
+ java.io.Serializable
+ java.awt.BorderLayout
+ javax.swing.JFormattedTextField
+ </import>
+
+ <!-- show reset property -->
+ <Boolean id='showReset' javaBean='false'/>
+
+ <!-- show reset tip -->
+ <String id='showResetTip' javaBean=''/>
+
+ <!-- model -->
+ <DmdCoordinateEditorModel id='model'/>
+
+ <!-- handler -->
+ <DmdCoordinateEditorHandler id='handler' constructorParams='this'/>
+
+ <script><![CDATA[
+public void init() { handler.init(); }
+public void setBean(Serializable bean) { model.setBean(bean); }
+public void setPropertySign(String property ) { model.setPropertySign(property); }
+public void setPropertyDegree(String property ) { model.setPropertyDegree(property); }
+public void setPropertyMinute(String property ) { model.setPropertyMinute(property); }
+public void setPropertyDecimal(String property ) { model.setPropertyDecimal(property); }
+public void setLongitudeEditor(boolean longitudeEditor) { model.setLongitudeEditor(longitudeEditor); }
+public void setValue(DmdCoordinate value) { handler.setValue(value, false); }
+]]>
+ </script>
+
+ <JToolBar id='toolbarLeft' constraints='BorderLayout.WEST'>
+ <JButton id='resetButton' onActionPerformed='handler.resetEditor()'/>
+ </JToolBar>
+ <JFormattedTextField id='editor' constraints='BorderLayout.CENTER'
+ onKeyReleased='handler.onKeyReleased(event)'/>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditor.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorHandler.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,358 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 com.google.common.base.Preconditions;
+import fr.ifremer.tutti.TuttiTechnicalException;
+import jaxx.runtime.swing.editor.bean.BeanUIUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JFormattedTextField;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.MaskFormatter;
+import java.awt.event.KeyEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created on 10/16/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmdCoordinateEditorHandler {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DmdCoordinateEditorHandler.class);
+
+ protected static final Pattern VALUE_PATTERN = Pattern.compile("(.*)°(.*)'(.*)");
+
+ private final DmdCoordinateEditor ui;
+
+ protected Method signMutator;
+
+ protected Method degreMutator;
+
+ protected Method minuteMutator;
+
+ protected Method decimalMutator;
+
+ protected DefaultFormatterFactory unsignedFactory;
+
+ protected DefaultFormatterFactory signedFactory;
+
+ protected boolean valueIsAdjusting;
+
+ protected boolean valueModelIsAdjusting;
+
+ public DmdCoordinateEditorHandler(DmdCoordinateEditor ui) {
+ this.ui = ui;
+ }
+
+ public void init() {
+
+ final DmdCoordinateEditorModel model = ui.getModel();
+
+ Preconditions.checkNotNull(model.getBean(), "could not find bean in " + ui);
+ Preconditions.checkNotNull(model.getPropertySign(), "could not find propertySign in " + ui);
+ Preconditions.checkNotNull(model.getPropertyDegree(), "could not find propertyDegree in " + ui);
+ Preconditions.checkNotNull(model.getPropertyMinute(), "could not find propertyMinute in " + ui);
+ Preconditions.checkNotNull(model.getPropertyDecimal(), "could not find propertyDecimal in " + ui);
+
+ Object bean = model.getBean();
+ signMutator = BeanUIUtil.getMutator(bean, model.getPropertySign());
+ Preconditions.checkNotNull(signMutator, "could not find mutator for " + model.getPropertySign());
+
+ degreMutator = BeanUIUtil.getMutator(bean, model.getPropertyDegree());
+ Preconditions.checkNotNull(degreMutator, "could not find mutator for " + model.getPropertyDegree());
+
+ minuteMutator = BeanUIUtil.getMutator(bean, model.getPropertyMinute());
+ Preconditions.checkNotNull(minuteMutator, "could not find mutator for " + model.getPropertyMinute());
+
+ decimalMutator = BeanUIUtil.getMutator(bean, model.getPropertyDecimal());
+ Preconditions.checkNotNull(decimalMutator, "could not find mutator for " + model.getPropertyDecimal());
+
+ MaskFormatter unsignedFormatter;
+ try {
+
+ String pattern = model.getMaskFormatterPattern();
+ unsignedFormatter = new MaskFormatter(pattern);
+ unsignedFormatter.setValidCharacters(" 01234567890");
+ } catch (ParseException e) {
+ // can't happen here
+ throw new TuttiTechnicalException(e);
+ }
+ unsignedFactory = new DefaultFormatterFactory(unsignedFormatter);
+
+ MaskFormatter signedFormatter;
+ try {
+
+ String pattern = model.getMaskFormatterPattern();
+ signedFormatter = new MaskFormatter("-" + pattern);
+ signedFormatter.setValidCharacters(" 01234567890");
+ } catch (ParseException e) {
+ // can't happen here
+ throw new TuttiTechnicalException(e);
+ }
+ signedFactory = new DefaultFormatterFactory(signedFormatter);
+
+ JFormattedTextField editor = ui.getEditor();
+ editor.setFormatterFactory(unsignedFactory);
+ editor.setFocusLostBehavior(JFormattedTextField.COMMIT);
+
+ // When editor changes his value, propagate it to model
+ editor.addPropertyChangeListener("value", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String newValue = (String) evt.getNewValue();
+ if (log.isDebugEnabled()) {
+ log.debug("Value has changed: " + newValue);
+ }
+ DmdCoordinate value = null;
+ if (newValue != null) {
+
+ Matcher matcher = VALUE_PATTERN.matcher(newValue);
+
+ if (matcher.matches()) {
+
+ String degresStr = matcher.group(1).replaceAll("\\s", "");
+ String minutesStr = matcher.group(2).replaceAll("\\s", "");
+ String decimalesStr = matcher.group(3).replaceAll("\\s", "");
+
+ Integer degre = degresStr.isEmpty() || "-".equals(degresStr) ? 0 : Integer.valueOf(degresStr);
+ Integer minutes = minutesStr.isEmpty() ? 0 : Integer.valueOf(minutesStr);
+ Integer decimal = decimalesStr.isEmpty() ? 0 : Integer.valueOf(decimalesStr);
+
+ boolean signed = degre < 0;
+ value =
+ DmdCoordinate.valueOf(signed,
+ Math.abs(degre),
+ minutes,
+ decimal);
+ }
+ }
+ model.setValue(value);
+ }
+ });
+
+ // When model sign changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmdCoordinateEditorModel.PROPERTY_SIGN,
+ new ModelPropertyChangeListener(model, signMutator));
+
+ // When model degre changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmdCoordinateEditorModel.PROPERTY_DEGREE,
+ new ModelPropertyChangeListener(model, degreMutator));
+
+ // When model minute changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmdCoordinateEditorModel.PROPERTY_MINUTE,
+ new ModelPropertyChangeListener(model, minuteMutator));
+
+ // When model decimal changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmdCoordinateEditorModel.PROPERTY_DECIMAL,
+ new ModelPropertyChangeListener(model, decimalMutator));
+ }
+
+ public void setValue(DmdCoordinate value, boolean pushToModel) {
+
+ if (valueModelIsAdjusting) {
+ // avoid re-entrant code
+ return;
+ }
+
+ String signStr = "";
+ String degreeStr = "";
+ String minuteStr = "";
+ String decimalStr = "";
+
+ if (value != null) {
+
+ boolean sign = value.isSign();
+ signStr = sign ? "-" : "";
+
+ Integer degree = value.getDegree();
+ degreeStr = degree == null ? "" : degree.toString();
+
+ Integer minute = value.getMinute();
+ minuteStr = minute == null ? "" : minute.toString();
+
+ Integer decimal = value.getDecimal();
+ decimalStr = decimal == null ? "" : decimal.toString();
+ }
+
+ DmdCoordinateEditorModel model = ui.getModel();
+
+ String stringPattern = model.getStringPattern();
+ String valueStr = String.format(
+ stringPattern,
+ signStr,
+ StringUtils.leftPad(degreeStr, model.isLongitudeEditor() ? 3 : 2, ' '),
+ StringUtils.leftPad(minuteStr, 2, ' '),
+ StringUtils.leftPad(decimalStr, 2, ' '));
+
+ valueIsAdjusting = !pushToModel;
+
+ try {
+ ui.getEditor().setValue(valueStr);
+ } finally {
+ valueIsAdjusting = false;
+ }
+ }
+
+ public void resetEditor() {
+ // set null value to model
+ setValue(null, true);
+
+ // use back unsigned format
+ ui.getEditor().setFormatterFactory(unsignedFactory);
+ }
+
+ public void onKeyReleased(KeyEvent e) {
+
+ JFormattedTextField source = (JFormattedTextField) e.getSource();
+
+ char keyChar = e.getKeyChar();
+ int caretPosition = source.getCaretPosition();
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: " + keyChar + " (caret position: " + caretPosition + ")");
+ }
+
+ String newValue = null;
+ DefaultFormatterFactory newFactory = null;
+ if (keyChar == '-') {
+
+ // try to switch unsigned to signed
+
+ if (unsignedFactory == source.getFormatterFactory()) {
+
+ // switch to signed
+ if (log.isDebugEnabled()) {
+ log.debug("Switch to signed");
+ }
+ newFactory = signedFactory;
+
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+
+ newValue = "-" + source.getValue();
+
+ } else {
+ // switch to unsigned
+
+ if (log.isDebugEnabled()) {
+ log.debug("Switch to unsigned");
+ }
+ newFactory = unsignedFactory;
+
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+
+ newValue = ((String) source.getValue()).substring(1);
+ }
+ } else {
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: newValue " + source.getValue());
+ }
+ }
+
+ if (newFactory != null) {
+
+ // consume event (prevent any side-effects)
+ e.consume();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: newValue " + newValue);
+ }
+ source.setFormatterFactory(newFactory);
+ source.setValue(newValue);
+
+ if (unsignedFactory == newFactory) {
+
+ // remove a sign
+ caretPosition--;
+ } else {
+
+ // add a sign
+ caretPosition++;
+ }
+
+ source.setCaretPosition(caretPosition);
+ }
+ }
+
+ private class ModelPropertyChangeListener implements PropertyChangeListener {
+
+ private final DmdCoordinateEditorModel model;
+
+ private final Method mutator;
+
+ private ModelPropertyChangeListener(DmdCoordinateEditorModel model,
+ Method mutator) {
+ this.model = model;
+ this.mutator = mutator;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!valueIsAdjusting) {
+ Object newValue = evt.getNewValue();
+
+ try {
+
+ valueModelIsAdjusting = true;
+ try {
+ mutator.invoke(model.getBean(), newValue);
+ } finally {
+ valueModelIsAdjusting = false;
+ }
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorModel.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,151 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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.io.Serializable;
+
+/**
+ * Created on 10/16/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.9
+ */
+public class DmdCoordinateEditorModel extends DmdCoordinate {
+
+ public static final String PROPERTY_BEAN = "bean";
+
+ public static final String PROPERTY_PROPERTY_SIGN = "propertySign";
+
+ public static final String PROPERTY_PROPERTY_DEGREE = "propertyDegree";
+
+ public static final String PROPERTY_PROPERTY_MINUTE = "propertyMinute";
+
+ public static final String PROPERTY_PROPERTY_DECIMAL = "propertyDecimal";
+
+ public static final String PROPERTY_LONGITUDE_EDITOR = "longitudeEditor";
+
+ private static final long serialVersionUID = 1L;
+
+ /** Bean where to push data. */
+ protected Serializable bean;
+
+ /** Name of the property of the bean to fire the change of the {@link #sign}. */
+ protected String propertySign;
+
+ /** Name of the property of the bean to fire the change of the {@link #degree}. */
+ protected String propertyDegre;
+
+ /** Name of the property of the bean to fire the change of the {@link #minute}. */
+ protected String propertyMinute;
+
+ /** Name of the property of the bean to fire the change of the {@link #decimal}. */
+ protected String propertyDecimal;
+
+ /**
+ * {@code true} if longitude editor, {@code false} for latitude editor.
+ */
+ protected boolean longitudeEditor;
+
+ public Serializable getBean() {
+ return bean;
+ }
+
+ public void setBean(Serializable bean) {
+ Object oldValue = getBean();
+ this.bean = bean;
+ firePropertyChange(PROPERTY_BEAN, oldValue, bean);
+ }
+
+ public String getPropertySign() {
+ return propertySign;
+ }
+
+ public void setPropertySign(String propertySign) {
+ Object oldValue = getPropertySign();
+ this.propertySign = propertySign;
+ firePropertyChange(PROPERTY_PROPERTY_SIGN, oldValue, propertySign);
+ }
+
+ public String getPropertyDegree() {
+ return propertyDegre;
+ }
+
+ public void setPropertyDegree(String propertyDegree) {
+ Object oldValue = getPropertyDegree();
+ this.propertyDegre = propertyDegree;
+ firePropertyChange(PROPERTY_PROPERTY_DEGREE, oldValue, propertyDegree);
+ }
+
+ public String getPropertyMinute() {
+ return propertyMinute;
+ }
+
+ public void setPropertyMinute(String propertyMinute) {
+ Object oldValue = getPropertyMinute();
+ this.propertyMinute = propertyMinute;
+ firePropertyChange(PROPERTY_PROPERTY_MINUTE, oldValue, propertyMinute);
+ }
+
+ public String getPropertyDecimal() {
+ return propertyDecimal;
+ }
+
+ public void setPropertyDecimal(String propertyDecimal) {
+ Object oldValue = getPropertyDecimal();
+ this.propertyDecimal = propertyDecimal;
+ firePropertyChange(PROPERTY_PROPERTY_DECIMAL, oldValue, propertyDecimal);
+ }
+
+ public boolean isLongitudeEditor() {
+ return longitudeEditor;
+ }
+
+ public void setLongitudeEditor(boolean longitudeEditor) {
+ Object oldValue = isLongitudeEditor();
+ this.longitudeEditor = longitudeEditor;
+ firePropertyChange(PROPERTY_BEAN, oldValue, longitudeEditor);
+ }
+
+ public void setValue(DmdCoordinate value) {
+ setSign(value != null && value.isSign());
+ setDegree(value == null ? null : value.getDegree());
+ setMinute(value == null ? null : value.getMinute());
+ setDecimal(value == null ? null : value.getDecimal());
+ }
+
+ public String getMaskFormatterPattern() {
+ String pattern = "**°**''**";
+ if (isLongitudeEditor()) {
+ // add one more degre
+ pattern = "*" + pattern;
+ }
+ return pattern;
+ }
+
+ public String getStringPattern() {
+ String pattern = "%s%s°%s'%s";
+ return pattern;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinate.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinate.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinate.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,324 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * Geo coordinate in degree, minute, second format.
+ * <p/>
+ * Created on 10/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmsCoordinate extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_SIGN = "sign";
+
+ public static final String PROPERTY_DEGREE = "degree";
+
+ public static final String PROPERTY_MINUTE = "minute";
+
+ public static final String PROPERTY_SECOND = "second";
+
+ protected boolean sign;
+
+ protected Integer degree;
+
+ protected Integer minute;
+
+ protected Integer second;
+
+ public static DmsCoordinate empty() {
+ DmsCoordinate r = new DmsCoordinate();
+ return r;
+ }
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimal la valeur au format decimal
+ * @return une nouvelle instance de position convertie
+ */
+ public static DmsCoordinate valueOf(Float decimal) {
+ DmsCoordinate r = new DmsCoordinate();
+ r.fromDecimal(decimal);
+ return r;
+ }
+
+ /**
+ * Methode statique de fabrique de position a partir d'une valeur du format
+ * degre-minute-seconde.
+ *
+ * @param d la valeur des degres
+ * @param m la valeur des minutes
+ * @param s la valeur des secondes
+ * @return une nouvelle instance de position convertie
+ */
+ public static DmsCoordinate valueOf(boolean sign, int d, int m, int s) {
+ DmsCoordinate r = new DmsCoordinate();
+ r.setSign(sign);
+ r.setDegree(d);
+ r.setMinute(m);
+ r.setSecond(s);
+ return r;
+ }
+
+ public boolean isSign() {
+ return sign;
+ }
+
+ public Integer getDegree() {
+ return degree;
+ }
+
+ public Integer getMinute() {
+ return minute;
+ }
+
+ public Integer getSecond() {
+ return second;
+ }
+
+ public void setSign(boolean sign) {
+ Object oldValue = isSign();
+ this.sign = sign;
+ firePropertyChange(PROPERTY_SIGN, oldValue, sign);
+ }
+
+ public void setDegree(Integer degree) {
+ Object oldValue = getDegree();
+ this.degree = degree;
+ firePropertyChange(PROPERTY_DEGREE, oldValue, degree);
+ }
+
+ public void setMinute(Integer minute) {
+ Object oldValue = getMinute();
+ this.minute = minute;
+ firePropertyChange(PROPERTY_MINUTE, oldValue, minute);
+ }
+
+ public void setSecond(Integer second) {
+ Object oldValue = getSecond();
+ this.second = second;
+ firePropertyChange(PROPERTY_SECOND, oldValue, second);
+ }
+
+ public boolean isDegreeNull() {
+ return degree == null || degree == 0;
+ }
+
+ public boolean isMinuteNull() {
+ return minute == null || minute == 0;
+ }
+
+ public boolean isSecondNull() {
+ return second == null || second == 0;
+ }
+
+ /**
+ * @return {@code true} si aucune composante n'est renseignée,
+ * {@code false} autrement.
+ */
+ public boolean isNull() {
+ return degree == null && minute == null && second == null;
+ }
+
+ /**
+ * Mets a jour les composants de la position a partir d'une valeur decimal.
+ * <p/>
+ * Note : Si la valeur (au format decimal) vaut <code>null</code>, alors on
+ * reinitialise les composants de la position a <code>null</code> et la
+ * methode {@link #isNull()} vaudra alors {@code true}.
+ *
+ * @param decimal la valeur decimale a convertir (qui peut etre nulle).
+ */
+ public void fromDecimal(Float decimal) {
+ Integer d = null;
+ Integer m = null;
+ Integer s = null;
+ boolean si = false;
+ if (decimal != null) {
+ si = decimal < 0;
+
+ decimal = Math.abs(decimal);
+ int remain = 0;
+
+ d = (int) (Math.round(decimal + 0.5) - 1);
+ m = 0;
+ s = 0;
+ decimal = 60.0f * (decimal - d);
+ if (decimal > 0) {
+ m = (int) (Math.round(decimal + 0.5) - 1);
+ decimal = 60 * (decimal - m);
+ if (decimal > 0) {
+ s = (int) (Math.round(decimal + 0.5) - 1);
+ remain = (int) (10 * (decimal - s));
+ }
+ }
+ if (remain > 9) {
+ s++;
+ }
+ if (s == 60) {
+ m++;
+ s = 0;
+ }
+ if (m == 60) {
+ d++;
+ m = 0;
+ }
+
+ // clean not used values
+ if (m == 0) {
+ m = null;
+ }
+ if (s == 0) {
+ s = null;
+ }
+ }
+
+ if (d == 0) {
+ d = null;
+ }
+ degree = d;
+ minute = m;
+ second = s;
+ sign = si;
+
+ }
+
+ public Float toDecimal() {
+ if (isNull()) {
+ return null;
+ }
+ Integer d = getNotNullDegree();
+ Integer m = getNotNullMinute();
+
+ Integer s = getNotNullSecond();
+
+ Float result = Float.valueOf(d);
+
+ if (m > 0) {
+ result += (float) m / 60;
+ if (s == 0) {
+ result += 0.5f / 3600;
+ }
+ }
+ if (s > 0) {
+ result += ((float) s + 0.5f) / 3600;
+ }
+
+ if (sign) {
+ result *= -1;
+ }
+ return result;
+ }
+
+ public Integer getSignedDegree() {
+ Integer result = null;
+ if (!isDegreeNull()) {
+ result = degree;
+ if (isSign()) {
+ result *= -1;
+ }
+ }
+ return result;
+ }
+
+ public int getNotNullDegree() {
+ return isDegreeNull() ? 0 : degree;
+ }
+
+ public int getNotNullMinute() {
+ return isMinuteNull() ? 0 : minute;
+ }
+
+
+ public int getNotNullSecond() {
+ return isSecondNull() ? 0 : second;
+ }
+
+ public boolean isLatitudeDegreeValid() {
+ boolean result = isDegreeValid(false);
+ return result;
+ }
+
+ public boolean isLongitudeDegreeValid() {
+ boolean result = isDegreeValid(true);
+ return result;
+ }
+
+ public boolean isMinuteValid() {
+ boolean result = true;
+ if (!isMinuteNull()) {
+ if (60 == minute) {
+
+ // check minute and second are null
+ result = isSecondNull();
+ } else {
+ result = 0 <= minute && minute < 60;
+ }
+ }
+ return result;
+ }
+
+ public boolean isSecondValid() {
+ boolean result = isSecondNull() || (0 <= second && second < 60);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "DmsCoordinateComponent{" +
+ "sign=" + sign +
+ ", degree=" + degree +
+ ", minute=" + minute +
+ ", second=" + second +
+ '}';
+ }
+
+ protected boolean isDegreeValid(boolean longitude) {
+ boolean result = true;
+ if (!isDegreeNull()) {
+ int bound = longitude ? 180 : 90;
+ if (bound == degree) {
+
+ // check minute and second are null
+ result = isMinuteNull() && isSecondNull();
+ } else {
+ result = degree < bound;
+ }
+ }
+ return result;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinate.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.css
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.css (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.css 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,40 @@
+/*
+ * #%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%
+ */
+#toolbarLeft {
+ floatable:false;
+ borderPainted:false;
+ visible:{isShowReset()};
+}
+
+#resetButton {
+ actionIcon:"combobox-reset";
+ toolTipText: {getShowResetTip()};
+ focusable:false;
+ focusPainted:false;
+ enabled:{isEnabled()};
+}
+
+#editor {
+ enabled:{isEnabled()};
+}
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.jaxx
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.jaxx (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.jaxx 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,62 @@
+<!--
+ #%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%
+ -->
+<JPanel id='editorPanel' layout='{new BorderLayout()}'
+ onFocusGained='editor.requestFocus()'>
+ <import>
+ java.io.Serializable
+ java.awt.BorderLayout
+ javax.swing.JFormattedTextField
+ </import>
+
+ <!-- show reset property -->
+
+ <Boolean id='showReset' javaBean='false'/>
+
+ <!-- show reset tip -->
+ <String id='showResetTip' javaBean=''/>
+
+ <!-- model -->
+ <DmsCoordinateEditorModel id='model'/>
+
+ <!-- handler -->
+ <DmsCoordinateEditorHandler id='handler' constructorParams='this'/>
+
+ <script><![CDATA[
+public void init() { handler.init(); }
+public void setBean(Serializable bean) { model.setBean(bean); }
+public void setPropertySign(String property ) { model.setPropertySign(property); }
+public void setPropertyDegree(String property ) { model.setPropertyDegree(property); }
+public void setPropertyMinute(String property ) { model.setPropertyMinute(property); }
+public void setPropertySecond(String property ) { model.setPropertySecond(property); }
+public void setLongitudeEditor(boolean longitudeEditor) { model.setLongitudeEditor(longitudeEditor); }
+public void setValue(DmsCoordinate value) { handler.setValue(value, false); }
+]]>
+ </script>
+
+ <JToolBar id='toolbarLeft' constraints='BorderLayout.WEST'>
+ <JButton id='resetButton' onActionPerformed='handler.resetEditor()'/>
+ </JToolBar>
+ <JFormattedTextField id='editor' constraints='BorderLayout.CENTER'
+ onKeyReleased='handler.onKeyReleased(event)'/>
+</JPanel>
\ No newline at end of file
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditor.jaxx
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorHandler.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorHandler.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,357 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 com.google.common.base.Preconditions;
+import fr.ifremer.tutti.TuttiTechnicalException;
+import jaxx.runtime.swing.editor.bean.BeanUIUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JFormattedTextField;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.MaskFormatter;
+import java.awt.event.KeyEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created on 10/16/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmsCoordinateEditorHandler {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DmsCoordinateEditorHandler.class);
+
+ protected static final Pattern VALUE_PATTERN =
+ Pattern.compile("(.*)°(.*)'(.*)''");
+
+ private final DmsCoordinateEditor ui;
+
+ protected Method signMutator;
+
+ protected Method degreMutator;
+
+ protected Method minuteMutator;
+
+ protected Method secondMutator;
+
+ protected DefaultFormatterFactory unsignedFactory;
+
+ protected DefaultFormatterFactory signedFactory;
+
+ protected boolean valueIsAdjusting;
+
+ protected boolean valueModelIsAdjusting;
+
+ public DmsCoordinateEditorHandler(DmsCoordinateEditor ui) {
+ this.ui = ui;
+ }
+
+ public void init() {
+
+ final DmsCoordinateEditorModel model = ui.getModel();
+
+ Preconditions.checkNotNull(model.getBean(), "could not find bean in " + ui);
+ Preconditions.checkNotNull(model.getPropertySign(), "could not find propertySign in " + ui);
+ Preconditions.checkNotNull(model.getPropertyDegree(), "could not find propertyDegree in " + ui);
+ Preconditions.checkNotNull(model.getPropertyMinute(), "could not find propertyMinute in " + ui);
+ Preconditions.checkNotNull(model.getPropertySecond(), "could not find propertySecond in " + ui);
+
+ Object bean = model.getBean();
+ signMutator = BeanUIUtil.getMutator(bean, model.getPropertySign());
+ Preconditions.checkNotNull(signMutator, "could not find mutator for " + model.getPropertySign());
+
+ degreMutator = BeanUIUtil.getMutator(bean, model.getPropertyDegree());
+ Preconditions.checkNotNull(degreMutator, "could not find mutator for " + model.getPropertyDegree());
+
+ minuteMutator = BeanUIUtil.getMutator(bean, model.getPropertyMinute());
+ Preconditions.checkNotNull(minuteMutator, "could not find mutator for " + model.getPropertyMinute());
+
+ secondMutator = BeanUIUtil.getMutator(bean, model.getPropertySecond());
+ Preconditions.checkNotNull(secondMutator, "could not find mutator for " + model.getPropertySecond());
+
+ MaskFormatter unsignedFormatter;
+ try {
+
+ String pattern = model.getMaskFormatterPattern();
+ unsignedFormatter = new MaskFormatter(pattern);
+ unsignedFormatter.setValidCharacters(" 01234567890");
+ } catch (ParseException e) {
+ // can't happen here
+ throw new TuttiTechnicalException(e);
+ }
+ unsignedFactory = new DefaultFormatterFactory(unsignedFormatter);
+
+ MaskFormatter signedFormatter;
+ try {
+
+ String pattern = model.getMaskFormatterPattern();
+ signedFormatter = new MaskFormatter("-" + pattern);
+ signedFormatter.setValidCharacters(" 01234567890");
+ } catch (ParseException e) {
+ // can't happen here
+ throw new TuttiTechnicalException(e);
+ }
+ signedFactory = new DefaultFormatterFactory(signedFormatter);
+
+ JFormattedTextField editor = ui.getEditor();
+ editor.setFormatterFactory(unsignedFactory);
+ editor.setFocusLostBehavior(JFormattedTextField.COMMIT);
+
+ // When editor changes his value, propagate it to model
+ editor.addPropertyChangeListener("value", new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String newValue = (String) evt.getNewValue();
+ if (log.isDebugEnabled()) {
+ log.debug("Value has changed: " + newValue);
+ }
+ DmsCoordinate value = null;
+ if (newValue != null) {
+
+ Matcher matcher = VALUE_PATTERN.matcher(newValue);
+
+ if (matcher.matches()) {
+
+ String degresStr = matcher.group(1).replaceAll("\\s","");
+ String minutesStr = matcher.group(2).replaceAll("\\s", "");
+ String secondsStr = matcher.group(3).replaceAll("\\s", "");
+
+ Integer degre = degresStr.isEmpty() || "-".equals(degresStr) ? 0 : Integer.valueOf(degresStr);
+ Integer minutes = minutesStr.isEmpty() ? 0 : Integer.valueOf(minutesStr);
+ Integer seconds = secondsStr.isEmpty() ? 0 : Integer.valueOf(secondsStr);
+
+ boolean signed = degre < 0;
+ value =
+ DmsCoordinate.valueOf(signed,
+ Math.abs(degre),
+ minutes,
+ seconds);
+ }
+ }
+ model.setValue(value);
+ }
+ });
+
+ // When model sign changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmsCoordinateEditorModel.PROPERTY_SIGN,
+ new ModelPropertyChangeListener(model, signMutator));
+
+ // When model degre changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmsCoordinateEditorModel.PROPERTY_DEGREE,
+ new ModelPropertyChangeListener(model, degreMutator));
+
+ // When model minute changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmsCoordinateEditorModel.PROPERTY_MINUTE,
+ new ModelPropertyChangeListener(model, minuteMutator));
+
+ // When model second changed, let's push it back in bean
+ model.addPropertyChangeListener(
+ DmsCoordinateEditorModel.PROPERTY_SECOND,
+ new ModelPropertyChangeListener(model, secondMutator));
+ }
+
+ public void setValue(DmsCoordinate value, boolean pushToModel) {
+
+ if (valueModelIsAdjusting) {
+ // avoid re-entrant code
+ return;
+ }
+
+ String signStr = "";
+ String degreeStr = "";
+ String minuteStr = "";
+ String secondStr = "";
+ if (value != null) {
+
+ boolean sign = value.isSign();
+ signStr = sign ? "-" : "";
+
+ Integer degree = value.getDegree();
+ degreeStr = degree == null ? "" : degree.toString();
+
+ Integer minute = value.getMinute();
+ minuteStr = minute == null ? "" : minute.toString();
+
+ Integer second = value.getSecond();
+ secondStr = second == null ? "" : second.toString();
+ }
+
+ DmsCoordinateEditorModel model = ui.getModel();
+ String stringPattern = model.getStringPattern();
+ String valueStr = String.format(
+ stringPattern,
+ signStr,
+ StringUtils.leftPad(degreeStr, model.isLongitudeEditor() ? 3 : 2, ' '),
+ StringUtils.leftPad(minuteStr, 2, ' '),
+ StringUtils.leftPad(secondStr, 2, ' '));
+
+ valueIsAdjusting = !pushToModel;
+
+ try {
+ ui.getEditor().setValue(valueStr);
+ } finally {
+ valueIsAdjusting = false;
+ }
+ }
+
+ public void resetEditor() {
+ // set null value to model
+ setValue(null, true);
+
+ // use back unsigned format
+ ui.getEditor().setFormatterFactory(unsignedFactory);
+ }
+
+ public void onKeyReleased(KeyEvent e) {
+
+ JFormattedTextField source = (JFormattedTextField) e.getSource();
+
+ char keyChar = e.getKeyChar();
+ int caretPosition = source.getCaretPosition();
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: " + keyChar + " (caret position: " + caretPosition + ")");
+ }
+
+ String newValue = null;
+ DefaultFormatterFactory newFactory = null;
+ if (keyChar == '-') {
+
+ // try to switch unsigned to signed
+
+ if (unsignedFactory == source.getFormatterFactory()) {
+
+ // switch to signed
+ if (log.isDebugEnabled()) {
+ log.debug("Switch to signed");
+ }
+ newFactory = signedFactory;
+
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+
+ newValue = "-" + source.getValue();
+
+ } else {
+ // switch to unsigned
+
+ if (log.isDebugEnabled()) {
+ log.debug("Switch to unsigned");
+ }
+ newFactory = unsignedFactory;
+
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+
+ newValue = ((String) source.getValue()).substring(1);
+ }
+ } else {
+ try {
+ source.commitEdit();
+ } catch (ParseException e1) {
+ // ignore it
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: newValue " + source.getValue());
+ }
+ }
+
+ if (newFactory != null) {
+
+ // consume event (prevent any side-effects)
+ e.consume();
+
+
+ if (log.isDebugEnabled()) {
+ log.debug("Key pressed: newValue " + newValue);
+ }
+ source.setFormatterFactory(newFactory);
+ source.setValue(newValue);
+
+ if (unsignedFactory == newFactory) {
+
+ // remove a sign
+ caretPosition--;
+ } else {
+
+ // add a sign
+ caretPosition++;
+ }
+
+ source.setCaretPosition(caretPosition);
+ }
+ }
+
+ private class ModelPropertyChangeListener implements PropertyChangeListener {
+
+ private final DmsCoordinateEditorModel model;
+
+ private final Method mutator;
+
+ private ModelPropertyChangeListener(DmsCoordinateEditorModel model, Method mutator) {
+ this.model = model;
+ this.mutator = mutator;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (!valueIsAdjusting) {
+ Object newValue = evt.getNewValue();
+
+ try {
+
+ valueModelIsAdjusting = true;
+ try {
+ mutator.invoke(model.getBean(), newValue);
+ } finally {
+ valueModelIsAdjusting = false;
+ }
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorModel.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorModel.java (rev 0)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorModel.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,151 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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.io.Serializable;
+
+/**
+ * Created on 10/16/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmsCoordinateEditorModel extends DmsCoordinate {
+
+ public static final String PROPERTY_BEAN = "bean";
+
+ public static final String PROPERTY_PROPERTY_SIGN = "propertySign";
+
+ public static final String PROPERTY_PROPERTY_DEGREE = "propertyDegree";
+
+ public static final String PROPERTY_PROPERTY_MINUTE = "propertyMinute";
+
+ public static final String PROPERTY_PROPERTY_SECOND = "propertySecond";
+
+ public static final String PROPERTY_LONGITUDE_EDITOR = "longitudeEditor";
+
+ private static final long serialVersionUID = 1L;
+
+ /** Bean where to push data. */
+ protected Serializable bean;
+
+ /** Name of the property of the bean to fire the change of the {@link #sign}. */
+ protected String propertySign;
+
+ /** Name of the property of the bean to fire the change of the {@link #degree}. */
+ protected String propertyDegree;
+
+ /** Name of the property of the bean to fire the change of the {@link #minute}. */
+ protected String propertyMinute;
+
+ /** Name of the property of the bean to fire the change of the {@link #second}. */
+ protected String propertySecond;
+
+ /**
+ * {@code true} if longitude editor, {@code false} for latitude editor.
+ */
+ protected boolean longitudeEditor;
+
+ public Serializable getBean() {
+ return bean;
+ }
+
+ public void setBean(Serializable bean) {
+ Object oldValue = getBean();
+ this.bean = bean;
+ firePropertyChange(PROPERTY_BEAN, oldValue, bean);
+ }
+
+ public String getPropertySign() {
+ return propertySign;
+ }
+
+ public void setPropertySign(String propertySign) {
+ Object oldValue = getPropertySign();
+ this.propertySign = propertySign;
+ firePropertyChange(PROPERTY_PROPERTY_SIGN, oldValue, propertySign);
+ }
+
+ public String getPropertyDegree() {
+ return propertyDegree;
+ }
+
+ public void setPropertyDegree(String propertyDegree) {
+ Object oldValue = getPropertyDegree();
+ this.propertyDegree = propertyDegree;
+ firePropertyChange(PROPERTY_PROPERTY_DEGREE, oldValue, propertyDegree);
+ }
+
+ public String getPropertyMinute() {
+ return propertyMinute;
+ }
+
+ public void setPropertyMinute(String propertyMinute) {
+ Object oldValue = getPropertyMinute();
+ this.propertyMinute = propertyMinute;
+ firePropertyChange(PROPERTY_PROPERTY_MINUTE, oldValue, propertyMinute);
+ }
+
+ public String getPropertySecond() {
+ return propertySecond;
+ }
+
+ public void setPropertySecond(String propertySecond) {
+ Object oldValue = getPropertySecond();
+ this.propertySecond = propertySecond;
+ firePropertyChange(PROPERTY_PROPERTY_SECOND, oldValue, propertySecond);
+ }
+
+ public boolean isLongitudeEditor() {
+ return longitudeEditor;
+ }
+
+ public void setLongitudeEditor(boolean longitudeEditor) {
+ Object oldValue = isLongitudeEditor();
+ this.longitudeEditor = longitudeEditor;
+ firePropertyChange(PROPERTY_BEAN, oldValue, longitudeEditor);
+ }
+
+ public void setValue(DmsCoordinate value) {
+ setSign(value != null && value.isSign());
+ setDegree(value == null ? null : value.getDegree());
+ setMinute(value == null ? null : value.getMinute());
+ setSecond(value == null ? null : value.getSecond());
+ }
+
+ public String getMaskFormatterPattern() {
+ String pattern = "**°**''**''''";
+ if (isLongitudeEditor()) {
+ // add one more degre
+ pattern = "*" + pattern;
+ }
+ return pattern;
+ }
+
+ public String getStringPattern() {
+ String pattern = "%s%s°%s'%s''";
+ return pattern;
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/AbstractTuttiUIHandler.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -39,6 +39,8 @@
import fr.ifremer.tutti.ui.swing.config.TuttiApplicationConfig;
import fr.ifremer.tutti.ui.swing.content.MainUI;
import fr.ifremer.tutti.ui.swing.content.MainUIHandler;
+import fr.ifremer.tutti.ui.swing.spatial.DmdCoordinateEditor;
+import fr.ifremer.tutti.ui.swing.spatial.DmsCoordinateEditor;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionHelper;
import fr.ifremer.tutti.ui.swing.util.action.TuttiActionUI;
import fr.ifremer.tutti.ui.swing.util.attachment.ButtonAttachment;
@@ -660,6 +662,12 @@
} else if (component instanceof JScrollPane) {
initScrollPane((JScrollPane) component);
+ } else if (component instanceof DmsCoordinateEditor) {
+
+ initCoordinateDMSEditor((DmsCoordinateEditor) component);
+ } else if (component instanceof DmdCoordinateEditor) {
+
+ initCoordinateDMDEditor((DmdCoordinateEditor) component);
}
}
@@ -883,6 +891,14 @@
}
}
+ protected void initCoordinateDMSEditor(DmsCoordinateEditor editor) {
+ editor.init();
+ }
+
+ protected void initCoordinateDMDEditor(DmdCoordinateEditor editor) {
+ editor.init();
+ }
+
protected void initDatePicker(final JXDatePicker picker) {
if (log.isDebugEnabled()) {
Deleted: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/util/editor/CoordinateEditorType.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -1,36 +0,0 @@
-
-package fr.ifremer.tutti.ui.swing.util.editor;
-
-/*
- * #%L
- * Tutti :: UI
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2012 - 2013 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * #L%
- */
-
-/**
- * @author kmorin <kmorin(a)codelutin.com>
- * @since 1.0
- */
-public enum CoordinateEditorType {
-
- DMS, DD, DMD
-
-}
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/cruise/EditCruiseUIModel-warning-validation.xml 2013-10-25 16:43:35 UTC (rev 1316)
@@ -32,7 +32,7 @@
<field-validator type="fieldexpression" short-circuit="true">
<param name="expression">
<![CDATA[ name == null || name.equals(getGeneratedCampaignName()) ]]></param>
- <message>tutti.validator.warning.cruise.name.format</message>
+ <message>tutti.validator.error.cruise.name.format</message>
</field-validator>
</field>
Modified: trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-edit-warning-validation.xml 2013-10-25 16:43:35 UTC (rev 1316)
@@ -29,584 +29,356 @@
<validators>
- <field name="gearShootingStartLatitudeDegree">
+ <field name="gearShootingStartLatitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- ( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
- && ( getGearShootingStartLatitudeMinute() == null || getGearShootingStartLatitudeMinute() == 0 )
- && ( getGearShootingStartLatitudeSecond() == null || getGearShootingStartLatitudeSecond() == 0 )
- )
- )
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDms.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeDecimalDegree">
+ <field name="gearShootingStartLatitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- ( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDecimalDegree() == ints.max || getGearShootingStartLatitudeDecimalDegree() == -ints.min )
- && ( getGearShootingStartLatitudeDecimalMinute() == null || getGearShootingStartLatitudeDecimalMinute() == 0.0 )
- )
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
+ <field name="gearShootingStartLatitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingStartLatitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.latitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeMinute">
+ <field name="gearShootingStartLatitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingStartLatitudeMinute() && getGearShootingStartLatitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeDecimalMinute">
+ <field name="gearShootingStartLatitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( doubles.min <= getGearShootingStartLatitudeDecimalMinute() && getGearShootingStartLatitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLatitudeSecond">
+ <field name="gearShootingStartLatitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingStartLatitudeSecond() && getGearShootingStartLatitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.latitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLongitudeDegree">
+ <field name="gearShootingStartLongitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
- && ( getGearShootingStartLongitudeMinute() == null || getGearShootingStartLongitudeMinute() == 0 )
- && ( getGearShootingStartLongitudeSecond() == null || getGearShootingStartLongitudeSecond() == 0 )
- )
- )
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDms.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeDecimalDegree">
+ <field name="gearShootingStartLongitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDecimalDegree() == ints.max || getGearShootingStartLongitudeDecimalDegree() == -ints.min )
- && ( getGearShootingStartLongitudeDecimalMinute() == null || getGearShootingStartLongitudeDecimalMinute() == 0.0 )
- )
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
+ <field name="gearShootingStartLongitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingStartLongitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.longitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeMinute">
+ <field name="gearShootingStartLongitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingStartLongitudeMinute() && getGearShootingStartLongitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeDecimalMinute">
+ <field name="gearShootingStartLongitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( doubles.min <= getGearShootingStartLongitudeDecimalMinute() && getGearShootingStartLongitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLongitudeSecond">
+ <field name="gearShootingStartLongitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingStartLongitudeSecond() && getGearShootingStartLongitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.longitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLatitudeDegree">
+ <field name="gearShootingEndLatitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
- && ( getGearShootingEndLatitudeMinute() == null || getGearShootingEndLatitudeMinute() == 0 )
- && ( getGearShootingEndLatitudeSecond() == null || getGearShootingEndLatitudeSecond() == 0 )
- )
- )
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDms.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeDecimalDegree">
+ <field name="gearShootingEndLatitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDecimalDegree() == ints.max || getGearShootingEndLatitudeDecimalDegree() == -ints.min )
- && ( getGearShootingEndLatitudeDecimalMinute() == null || getGearShootingEndLatitudeDecimalMinute() == 0.0 )
- )
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
+ <field name="gearShootingEndLatitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingEndLatitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.latitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeMinute">
+ <field name="gearShootingEndLatitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingEndLatitudeMinute() && getGearShootingEndLatitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeDecimalMinute">
+ <field name="gearShootingEndLatitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( doubles.min <= getGearShootingEndLatitudeDecimalMinute() && getGearShootingEndLatitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLatitudeSecond">
+ <field name="gearShootingEndLatitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingEndLatitudeSecond() && getGearShootingEndLatitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.latitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLongitudeDegree">
+ <field name="gearShootingEndLongitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
- && ( getGearShootingEndLongitudeMinute() == null || getGearShootingEndLongitudeMinute() == 0 )
- && ( getGearShootingEndLongitudeSecond() == null || getGearShootingEndLongitudeSecond() == 0 )
- )
- )
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDms.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeDecimalDegree">
+ <field name="gearShootingEndLongitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- (-ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDecimalDegree() == ints.max || getGearShootingEndLongitudeDecimalDegree() == -ints.min )
- && ( getGearShootingEndLongitudeDecimalMinute() == null || getGearShootingEndLongitudeDecimalMinute() == 0.0 )
- )
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
+ <field name="gearShootingEndLongitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingEndLongitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.longitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeMinute">
+ <field name="gearShootingEndLongitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingEndLongitudeMinute() && getGearShootingEndLongitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeDecimalMinute">
+ <field name="gearShootingEndLongitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( doubles.min <= getGearShootingEndLongitudeDecimalMinute() && getGearShootingEndLongitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLongitudeSecond">
+ <field name="gearShootingEndLongitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( ints.min <= getGearShootingEndLongitudeSecond() && getGearShootingEndLongitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.longitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
</validators>
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-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/resources/fr/ifremer/tutti/ui/swing/content/operation/EditFishingOperationUIModel-validate-error-validation.xml 2013-10-25 16:43:35 UTC (rev 1316)
@@ -22,621 +22,364 @@
<http://www.gnu.org/licenses/gpl-3.0.html>.
#L%
-->
+
+
<!DOCTYPE validators PUBLIC
"-//Apache Struts//XWork Validator 1.0.3//EN"
"http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+
<validators>
- <field name="gearShootingStartLatitudeDegree">
+ <field name="gearShootingStartLatitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- getGearShootingStartLatitudeDegree() != null &&
- (( -ints.min < getGearShootingStartLatitudeDegree() && getGearShootingStartLatitudeDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDegree() == ints.max || getGearShootingStartLatitudeDegree() == -ints.min )
- && ( getGearShootingStartLatitudeMinute() == null || getGearShootingStartLatitudeMinute() == 0 )
- && ( getGearShootingStartLatitudeSecond() == null || getGearShootingStartLatitudeSecond() == 0 )
- ))
- )
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDms.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeDecimalDegree">
+ <field name="gearShootingStartLatitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- getGearShootingStartLatitudeDecimalDegree() != null &&
- (( -ints.min < getGearShootingStartLatitudeDecimalDegree() && getGearShootingStartLatitudeDecimalDegree() < ints.max )
- || (
- ( getGearShootingStartLatitudeDecimalDegree() == ints.max || getGearShootingStartLatitudeDecimalDegree() == -ints.min )
- && ( getGearShootingStartLatitudeDecimalMinute() == null || getGearShootingStartLatitudeDecimalMinute() == 0.0 )
- ))
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
+ <field name="gearShootingStartLatitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingStartLatitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.latitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeMinute">
+ <field name="gearShootingStartLatitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLatitudeMinute() != null
- && ints.min <= getGearShootingStartLatitudeMinute()
- && getGearShootingStartLatitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLatitudeDecimalMinute">
+ <field name="gearShootingStartLatitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLatitudeDecimalMinute() != null
- && doubles.min <= getGearShootingStartLatitudeDecimalMinute()
- && getGearShootingStartLatitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLatitudeSecond">
+ <field name="gearShootingStartLatitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLatitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingStartLatitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.start.required</message>
+ <message>tutti.validator.error.latitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLatitudeSecond() != null
- && ints.min <= getGearShootingStartLatitudeSecond()
- && getGearShootingStartLatitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.latitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLongitudeDegree">
+ <field name="gearShootingStartLongitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- getGearShootingStartLongitudeDegree() != null &&
- ((-ints.min < getGearShootingStartLongitudeDegree() && getGearShootingStartLongitudeDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDegree() == ints.max || getGearShootingStartLongitudeDegree() == -ints.min )
- && ( getGearShootingStartLongitudeMinute() == null || getGearShootingStartLongitudeMinute() == 0 )
- && ( getGearShootingStartLongitudeSecond() == null || getGearShootingStartLongitudeSecond() == 0 )
- ))
- )
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDms.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeDecimalDegree">
+ <field name="gearShootingStartLongitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- getGearShootingStartLongitudeDecimalDegree() != null &&
- (( -ints.min < getGearShootingStartLongitudeDecimalDegree() && getGearShootingStartLongitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingStartLongitudeDecimalDegree() == ints.max || getGearShootingStartLongitudeDecimalDegree() == -ints.min )
- && ( getGearShootingStartLongitudeDecimalMinute() == null || getGearShootingStartLongitudeDecimalMinute() == 0.0 )
- ))
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
+ <field name="gearShootingStartLongitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingStartLongitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.longitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeMinute">
+ <field name="gearShootingStartLongitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.start.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLongitudeMinute() != null
- && ints.min <= getGearShootingStartLongitudeMinute()
- && getGearShootingStartLongitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingStartLongitudeDecimalMinute">
+ <field name="gearShootingStartLongitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLongitudeDecimalMinute() != null
- && doubles.min <= getGearShootingStartLongitudeDecimalMinute()
- && getGearShootingStartLongitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingStartLongitudeSecond">
+ <field name="gearShootingStartLongitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingStartLongitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingStartLongitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.start.required</message>
+ <message>tutti.validator.error.longitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingStartLongitudeSecond() != null
- && ints.min <= getGearShootingStartLongitudeSecond()
- && getGearShootingStartLongitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.longitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLatitudeDegree">
+ <field name="gearShootingEndLatitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- getGearShootingEndLatitudeDegree() != null &&
- (( -ints.min < getGearShootingEndLatitudeDegree() && getGearShootingEndLatitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDegree() == ints.max || getGearShootingEndLatitudeDegree() == -ints.min )
- && ( getGearShootingEndLatitudeMinute() == null || getGearShootingEndLatitudeMinute() == 0 )
- && ( getGearShootingEndLatitudeSecond() == null || getGearShootingEndLatitudeSecond() == 0 )
- ))
- )
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDms.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeDecimalDegree">
+ <field name="gearShootingEndLatitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:90|max:90</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- getGearShootingEndLatitudeDecimalDegree() != null &&
- (( -ints.min < getGearShootingEndLatitudeDecimalDegree() && getGearShootingEndLatitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingEndLatitudeDecimalDegree() == ints.max || getGearShootingEndLatitudeDecimalDegree() == -ints.min )
- && ( getGearShootingEndLatitudeDecimalMinute() == null || getGearShootingEndLatitudeDecimalMinute() == 0.0 )
- ))
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.latitude.degree.outOfBounds</message>
+ <field name="gearShootingEndLatitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingEndLatitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.latitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeMinute">
+ <field name="gearShootingEndLatitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.latitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLatitudeMinute() != null
- && ints.min <= getGearShootingEndLatitudeMinute()
- && getGearShootingEndLatitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.latitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.latitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLatitudeDecimalMinute">
+ <field name="gearShootingEndLatitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLatitudeDecimalMinute() != null
- && doubles.min <= getGearShootingEndLatitudeDecimalMinute()
- && getGearShootingEndLatitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.latitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLatitudeSecond">
+ <field name="gearShootingEndLatitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLatitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingEndLatitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.latitude.end.required</message>
+ <message>tutti.validator.error.latitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLatitudeSecond() != null
- && ints.min <= getGearShootingEndLatitudeSecond()
- && getGearShootingEndLatitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.latitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLongitudeDegree">
+ <field name="gearShootingEndLongitudeDmsDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmsDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || (
- getGearShootingEndLongitudeDegree() != null &&
- ((-ints.min < getGearShootingEndLongitudeDegree() && getGearShootingEndLongitudeDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDegree() == ints.max || getGearShootingEndLongitudeDegree() == -ints.min )
- && ( getGearShootingEndLongitudeMinute() == null || getGearShootingEndLongitudeMinute() == 0 )
- && ( getGearShootingEndLongitudeSecond() == null || getGearShootingEndLongitudeSecond() == 0 )
- ))
- )
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDms.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeDecimalDegree">
+ <field name="gearShootingEndLongitudeDmsMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalDegree() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDms.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:180|max:180</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || (
- getGearShootingEndLongitudeDecimalDegree() != null &&
- (( -ints.min < getGearShootingEndLongitudeDecimalDegree() && getGearShootingEndLongitudeDecimalDegree() < ints.max)
- || (
- ( getGearShootingEndLongitudeDecimalDegree() == ints.max || getGearShootingEndLongitudeDecimalDegree() == -ints.min )
- && ( getGearShootingEndLongitudeDecimalMinute() == null || getGearShootingEndLongitudeDecimalMinute() == 0.0 )
- ))
- )
- ]]>
- </param>
+ </field>
- <message>tutti.validator.warning.longitude.degree.outOfBounds</message>
+ <field name="gearShootingEndLongitudeDmsSecond">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDms ]]> </param>
+ <param name="expression">
+ <![CDATA[ gearShootingEndLongitudeDms.secondValid ]]>
+ </param>
+ <message>tutti.validator.error.longitude.second.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeMinute">
+ <field name="gearShootingEndLongitudeDmdDegree">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmdDegree != null ]]>
</param>
-
<message>tutti.validator.error.longitude.end.required</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLongitudeMinute() != null
- && ints.min <= getGearShootingEndLongitudeMinute()
- && getGearShootingEndLongitudeMinute() < ints.max )
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.longitudeDegreeValid ]]>
</param>
-
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
+ <message>tutti.validator.error.longitude.degree.outOfBounds</message>
</field-validator>
</field>
- <field name="gearShootingEndLongitudeDecimalMinute">
+ <field name="gearShootingEndLongitudeDmdMinute">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeDecimalMinute() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.minuteValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.minute.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="doubleParams">min:0.0|max:60.0</param>
- <param name="expression">
- <![CDATA[
- !"DMD".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLongitudeDecimalMinute() != null
- && doubles.min <= getGearShootingEndLongitudeDecimalMinute()
- && getGearShootingEndLongitudeDecimalMinute() < doubles.max )
- ]]>
- </param>
- <message>tutti.validator.warning.longitude.minute.outOfBounds</message>
-
- </field-validator>
-
</field>
- <field name="gearShootingEndLongitudeSecond">
+ <field name="gearShootingEndLongitudeDmdDecimal">
- <field-validator type="fieldexpression" short-circuit="true">
+ <field-validator type="skipablefieldexpression" short-circuit="true">
+ <param name="skip"> <![CDATA[ !coordinateDmd ]]> </param>
<param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) || getGearShootingEndLongitudeSecond() != null
- ]]>
+ <![CDATA[ gearShootingEndLongitudeDmd.decimalValid ]]>
</param>
-
- <message>tutti.validator.error.longitude.end.required</message>
+ <message>tutti.validator.error.longitude.decimal.outOfBounds</message>
</field-validator>
- <field-validator type="fieldexpressionwithparams">
- <param name="intParams">min:0|max:60</param>
- <param name="expression">
- <![CDATA[
- !"DMS".equals(coordinateEditorType.toString()) ||
- ( getGearShootingEndLongitudeSecond() != null
- && ints.min <= getGearShootingEndLongitudeSecond()
- && getGearShootingEndLongitudeSecond() < ints.max )
- ]]>
- </param>
-
- <message>tutti.validator.warning.longitude.second.outOfBounds</message>
-
- </field-validator>
-
</field>
</validators>
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties 2013-10-25 16:43:35 UTC (rev 1316)
@@ -1,3 +1,9 @@
+BOUUH=
+coordinate.action.reset.tip=
+observe.common.quadrant1=
+observe.common.quadrant2=
+observe.common.quadrant3=
+observe.common.quadrant4=
swing.error.cannot.mail=
swing.error.cannot.open.file=
swing.error.cannot.open.link=
@@ -172,6 +178,7 @@
tutti.config.title=
tutti.context.helpPage.notFound=
tutti.context.service.close.error=
+tutti.coordinate.action.reset.tip=
tutti.createAccidentalBatch.action.cancel=
tutti.createAccidentalBatch.action.cancel.mnemonic=
tutti.createAccidentalBatch.action.cancel.tip=
@@ -702,11 +709,17 @@
tutti.editFishingOperation.field.gearShootingEndLatitude=
tutti.editFishingOperation.field.gearShootingEndLatitude.tip=
tutti.editFishingOperation.field.gearShootingEndLatitudeDegree=
+tutti.editFishingOperation.field.gearShootingEndLatitudeDm=
+tutti.editFishingOperation.field.gearShootingEndLatitudeDmd=
+tutti.editFishingOperation.field.gearShootingEndLatitudeDms=
tutti.editFishingOperation.field.gearShootingEndLatitudeMinute=
tutti.editFishingOperation.field.gearShootingEndLatitudeSecond=
tutti.editFishingOperation.field.gearShootingEndLongitude=
tutti.editFishingOperation.field.gearShootingEndLongitude.tip=
tutti.editFishingOperation.field.gearShootingEndLongitudeDegree=
+tutti.editFishingOperation.field.gearShootingEndLongitudeDm=
+tutti.editFishingOperation.field.gearShootingEndLongitudeDmd=
+tutti.editFishingOperation.field.gearShootingEndLongitudeDms=
tutti.editFishingOperation.field.gearShootingEndLongitudeMinute=
tutti.editFishingOperation.field.gearShootingEndLongitudeSecond=
tutti.editFishingOperation.field.gearShootingStart=
@@ -715,11 +728,17 @@
tutti.editFishingOperation.field.gearShootingStartLatitude=
tutti.editFishingOperation.field.gearShootingStartLatitude.tip=
tutti.editFishingOperation.field.gearShootingStartLatitudeDegree=
+tutti.editFishingOperation.field.gearShootingStartLatitudeDm=
+tutti.editFishingOperation.field.gearShootingStartLatitudeDmd=
+tutti.editFishingOperation.field.gearShootingStartLatitudeDms=
tutti.editFishingOperation.field.gearShootingStartLatitudeMinute=
tutti.editFishingOperation.field.gearShootingStartLatitudeSecond=
tutti.editFishingOperation.field.gearShootingStartLongitude=
tutti.editFishingOperation.field.gearShootingStartLongitude.tip=
tutti.editFishingOperation.field.gearShootingStartLongitudeDegree=
+tutti.editFishingOperation.field.gearShootingStartLongitudeDm=
+tutti.editFishingOperation.field.gearShootingStartLongitudeDmd=
+tutti.editFishingOperation.field.gearShootingStartLongitudeDms=
tutti.editFishingOperation.field.gearShootingStartLongitudeMinute=
tutti.editFishingOperation.field.gearShootingStartLongitudeSecond=
tutti.editFishingOperation.field.gearTime=
@@ -1516,9 +1535,18 @@
tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required=
tutti.validator.error.createSpeciesBatch.species.required=
tutti.validator.error.createSpeciesBatch.speciesAndCategory.notAvailable=
+tutti.validator.error.cruise.name.format=
+tutti.validator.error.latitude.decimal.outOfBounds=
+tutti.validator.error.latitude.degree.outOfBounds=
tutti.validator.error.latitude.end.required=
+tutti.validator.error.latitude.minute.outOfBounds=
+tutti.validator.error.latitude.second.outOfBounds=
tutti.validator.error.latitude.start.required=
+tutti.validator.error.longitude.decimal.outOfBounds=
+tutti.validator.error.longitude.degree.outOfBounds=
tutti.validator.error.longitude.end.required=
+tutti.validator.error.longitude.minute.outOfBounds=
+tutti.validator.error.longitude.second.outOfBounds=
tutti.validator.error.longitude.start.required=
tutti.validator.error.program.zone.required=
tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required=
@@ -1528,13 +1556,6 @@
tutti.validator.error.splitSpeciesBatch.sampleWeight.sampleBatchGreaterThanBatchWeight=
tutti.validator.error.splitSpeciesBatch.selectedCategory.required=
tutti.validator.info.operation.noError=
-tutti.validator.warning.cruise.name.format=
-tutti.validator.warning.latitude.degree.outOfBounds=
-tutti.validator.warning.latitude.minute.outOfBounds=
-tutti.validator.warning.latitude.second.outOfBounds=
-tutti.validator.warning.longitude.degree.outOfBounds=
-tutti.validator.warning.longitude.minute.outOfBounds=
-tutti.validator.warning.longitude.second.outOfBounds=
tutti.vesselUseFeatureTable.action.removeCaracteristic=
tutti.vesselUseFeatureTable.action.removeCaracteristic.mnemonic=
tutti.vesselUseFeatureTable.action.removeCaracteristic.tip=
Modified: trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties
===================================================================
--- trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-10-25 16:03:33 UTC (rev 1315)
+++ trunk/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties 2013-10-25 16:43:35 UTC (rev 1316)
@@ -1,3 +1,8 @@
+BOUUH=
+observe.common.quadrant1=(1) NE
+observe.common.quadrant2=(2) SE
+observe.common.quadrant3=(3) SW
+observe.common.quadrant4=(4) NW
swing.error.cannot.mail=Erreur lors de l'ouverture du client mail
swing.error.cannot.open.file=Aucun programme n'est défini pour ouvrir ce type de fichier. Enregistrez le fichier et ouvrez le en dehors de l'application
swing.error.cannot.open.link=Impossible d'ouvrir le fichier %s
@@ -170,6 +175,8 @@
tutti.config.title=Configuration
tutti.context.helpPage.notFound=La page d'aide %s n'a pas été trouvée
tutti.context.service.close.error=Erreur lors de la fermeture du service %s
+tutti.coordinate.action.reset.latitude.tip=Réinitialiser la latitude
+tutti.coordinate.action.reset.longitude.tip=Réinitialiser la longitude
tutti.createAccidentalBatch.action.cancel=Annuler
tutti.createAccidentalBatch.action.cancel.mnemonic=A
tutti.createAccidentalBatch.action.cancel.tip=Annuler la création de la capture accidentelle
@@ -700,11 +707,17 @@
tutti.editFishingOperation.field.gearShootingEndLatitude=Latitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLatitude.tip=Latitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLatitudeDegree=Degré de latitude de fin de traîne
+tutti.editFishingOperation.field.gearShootingEndLatitudeDm=
+tutti.editFishingOperation.field.gearShootingEndLatitudeDmd=
+tutti.editFishingOperation.field.gearShootingEndLatitudeDms=
tutti.editFishingOperation.field.gearShootingEndLatitudeMinute=Minute de latitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLatitudeSecond=Seconde de latitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLongitude=Longitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLongitude.tip=Longitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLongitudeDegree=Degré de longitude de fin de traîne
+tutti.editFishingOperation.field.gearShootingEndLongitudeDm=
+tutti.editFishingOperation.field.gearShootingEndLongitudeDmd=
+tutti.editFishingOperation.field.gearShootingEndLongitudeDms=
tutti.editFishingOperation.field.gearShootingEndLongitudeMinute=Minute de longitude de fin de traîne
tutti.editFishingOperation.field.gearShootingEndLongitudeSecond=Seconde de longitude de fin de traîne
tutti.editFishingOperation.field.gearShootingStart=Début de traîne
@@ -713,11 +726,17 @@
tutti.editFishingOperation.field.gearShootingStartLatitude=Latitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLatitude.tip=Latitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLatitudeDegree=Degré de latitude de début de traîne
+tutti.editFishingOperation.field.gearShootingStartLatitudeDm=
+tutti.editFishingOperation.field.gearShootingStartLatitudeDmd=
+tutti.editFishingOperation.field.gearShootingStartLatitudeDms=
tutti.editFishingOperation.field.gearShootingStartLatitudeMinute=Minute de latitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLatitudeSecond=Seconde de latitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLongitude=Longitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLongitude.tip=Longitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLongitudeDegree=Degré de longitude de début de traîne
+tutti.editFishingOperation.field.gearShootingStartLongitudeDm=
+tutti.editFishingOperation.field.gearShootingStartLongitudeDmd=
+tutti.editFishingOperation.field.gearShootingStartLongitudeDms=
tutti.editFishingOperation.field.gearShootingStartLongitudeMinute=Minute de longitude de début de traîne
tutti.editFishingOperation.field.gearShootingStartLongitudeSecond=Seconde de longitude de début de traîne
tutti.editFishingOperation.field.gearTime=Heure
@@ -1515,9 +1534,18 @@
tutti.validator.error.createSpeciesBatch.sortedUnsortedCategory.required=La catégorie Vrac / Hors Vrac est obligatoire
tutti.validator.error.createSpeciesBatch.species.required=L'espèce est obligatoire
tutti.validator.error.createSpeciesBatch.speciesAndCategory.notAvailable=Couple (espèce - Vrac/Hors Vrac) déjà utilisée
+tutti.validator.error.cruise.name.format=Le format n'est pas celui ...
+tutti.validator.error.latitude.decimal.outOfBounds=La décimale de la latitude doit être comprise entre 0 et 99
+tutti.validator.error.latitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -90 et 90
tutti.validator.error.latitude.end.required=La latitude de fin de traîne est obligatoire
+tutti.validator.error.latitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 59
+tutti.validator.error.latitude.second.outOfBounds=La seconde de la latitude doit être comprise entre 0 et 59
tutti.validator.error.latitude.start.required=La latitude de début de traîne est obligatoire
+tutti.validator.error.longitude.decimal.outOfBounds=La décimale de la longitude doit être comprise entre 0 et 99
+tutti.validator.error.longitude.degree.outOfBounds=Le degré de la longitude doit être compris entre -180 et 180
tutti.validator.error.longitude.end.required=La longitude de fin de traîne est obligatoire
+tutti.validator.error.longitude.minute.outOfBounds=La minute de la longitude doit être comprise entre 0 et 59
+tutti.validator.error.longitude.second.outOfBounds=La seconde de la longitude doit être comprise entre 0 et 59
tutti.validator.error.longitude.start.required=La longitude de début de traîne est obligatoire
tutti.validator.error.program.zone.required=La zone de la série est obligatoire
tutti.validator.error.speciesFrequency.lengthStepCaracteristic.required=La classe de taille est obligatoire
@@ -1527,13 +1555,6 @@
tutti.validator.error.splitSpeciesBatch.sampleWeight.sampleBatchGreaterThanBatchWeight=La somme des poids ventilés doit être inférieur ou égale à celle du poids du lot
tutti.validator.error.splitSpeciesBatch.selectedCategory.required=La catégorie est obligatoire
tutti.validator.info.operation.noError=Trait sans erreur
-tutti.validator.warning.cruise.name.format=Le format n'est pas celui ...
-tutti.validator.warning.latitude.degree.outOfBounds=Le degré de la latitude doit être compris entre -90 et 90
-tutti.validator.warning.latitude.minute.outOfBounds=La minute de la latitude doit être comprise entre 0 et 59
-tutti.validator.warning.latitude.second.outOfBounds=La seconde de la latitude doit être comprise entre 0 et 59
-tutti.validator.warning.longitude.degree.outOfBounds=Le degré de la longitude doit être compris entre -180 et 180
-tutti.validator.warning.longitude.minute.outOfBounds=La minute de la longitude doit être comprise entre 0 et 59
-tutti.validator.warning.longitude.second.outOfBounds=La seconde de la longitude doit être comprise entre 0 et 59
tutti.vesselUseFeatureTable.action.removeCaracteristic=Supprimer
tutti.vesselUseFeatureTable.action.removeCaracteristic.mnemonic=S
tutti.vesselUseFeatureTable.action.removeCaracteristic.tip=Supprimer la caractéristique
Added: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorTest.java
===================================================================
--- trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorTest.java (rev 0)
+++ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorTest.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,216 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.border.TitledBorder;
+import java.awt.BorderLayout;
+import java.awt.GridLayout;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.ParseException;
+
+/**
+ * To test the {@link DmsCoordinateEditor}.
+ * <p/>
+ * Created on 10/17/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmdCoordinateEditorTest {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DmdCoordinateEditorTest.class);
+
+ public static class EditorBean extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_LONGITUDE_SIGN = "longitudeSign";
+
+ public static final String PROPERTY_LONGITUDE_DEGREE = "longitudeDegree";
+
+ public static final String PROPERTY_LONGITUDE_MINUTE = "longitudeMinute";
+
+ public static final String PROPERTY_LONGITUDE_DECIMAL = "longitudeDecimal";
+
+ public static final String PROPERTY_LATITUDE_SIGN = "latitudeSign";
+
+ public static final String PROPERTY_LATITUDE_DEGREE = "latitudeDegree";
+
+ public static final String PROPERTY_LATITUDE_MINUTE = "latitudeMinute";
+
+ public static final String PROPERTY_LATITUDE_DECIMAL = "latitudeDecimal";
+
+ protected final DmdCoordinate longitude = DmdCoordinate.empty();
+
+ protected final DmdCoordinate latitude = DmdCoordinate.empty();
+
+ public DmdCoordinate getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitudeDegree(Integer degre) {
+ Object oldValue = longitude.getDegree();
+ longitude.setDegree(degre);
+ firePropertyChange(PROPERTY_LONGITUDE_DEGREE, oldValue, degre);
+ }
+
+ public void setLongitudeMinute(Integer minute) {
+ Object oldValue = longitude.getMinute();
+ longitude.setMinute(minute);
+ firePropertyChange(PROPERTY_LONGITUDE_MINUTE, oldValue, minute);
+ }
+
+ public void setLongitudeDecimal(Integer decimal) {
+ Object oldValue = longitude.getDecimal();
+ longitude.setDecimal(decimal);
+ firePropertyChange(PROPERTY_LONGITUDE_DECIMAL, oldValue, decimal);
+ }
+
+ public void setLongitudeSign(boolean sign) {
+ Object oldValue = longitude.isSign();
+ longitude.setSign(sign);
+ firePropertyChange(PROPERTY_LONGITUDE_SIGN, oldValue, sign);
+ }
+
+ public DmdCoordinate getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitudeSign(boolean sign) {
+ Object oldValue = latitude.isSign();
+ latitude.setSign(sign);
+ firePropertyChange(PROPERTY_LATITUDE_SIGN, oldValue, sign);
+ }
+
+ public void setLatitudeDegree(Integer degre) {
+ Object oldValue = latitude.getDegree();
+ latitude.setDegree(degre);
+ firePropertyChange(PROPERTY_LATITUDE_DEGREE, oldValue, degre);
+ }
+
+ public void setLatitudeMinute(Integer minute) {
+ Object oldValue = latitude.getMinute();
+ latitude.setMinute(minute);
+ firePropertyChange(PROPERTY_LATITUDE_MINUTE, oldValue, minute);
+ }
+
+ public void setLatitudeDecimal(Integer decimal) {
+ Object oldValue = latitude.getDecimal();
+ latitude.setDecimal(decimal);
+ firePropertyChange(PROPERTY_LATITUDE_DECIMAL, oldValue, decimal);
+ }
+
+ @Override
+ public String toString() {
+ return "EditorBean{" +
+ "longitude=" + longitude +
+ ", latitude=" + latitude +
+ '}';
+ }
+ }
+
+ public static void main(String[] args) throws ParseException {
+
+
+ EditorBean bean = new EditorBean();
+
+ DmdCoordinateEditor longitudeEditor = new DmdCoordinateEditor();
+ longitudeEditor.setBean(bean);
+ longitudeEditor.setPropertySign(EditorBean.PROPERTY_LONGITUDE_SIGN);
+ longitudeEditor.setPropertyDegree(EditorBean.PROPERTY_LONGITUDE_DEGREE);
+ longitudeEditor.setPropertyMinute(EditorBean.PROPERTY_LONGITUDE_MINUTE);
+ longitudeEditor.setPropertyDecimal(EditorBean.PROPERTY_LONGITUDE_DECIMAL);
+ longitudeEditor.setLongitudeEditor(true);
+ longitudeEditor.setShowReset(true);
+ longitudeEditor.init();
+
+ DmdCoordinateEditor latitudeEditor = new DmdCoordinateEditor();
+ latitudeEditor.setBean(bean);
+ latitudeEditor.setPropertySign(EditorBean.PROPERTY_LATITUDE_SIGN);
+ latitudeEditor.setPropertyDegree(EditorBean.PROPERTY_LATITUDE_DEGREE);
+ latitudeEditor.setPropertyMinute(EditorBean.PROPERTY_LATITUDE_MINUTE);
+ latitudeEditor.setPropertyDecimal(EditorBean.PROPERTY_LATITUDE_DECIMAL);
+ latitudeEditor.setLongitudeEditor(false);
+ latitudeEditor.setShowReset(true);
+ latitudeEditor.init();
+
+ final JLabel latitudeResult = new JLabel();
+ final JLabel longitudeResult = new JLabel();
+
+ bean.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ EditorBean source = (EditorBean) evt.getSource();
+ String propertyName = evt.getPropertyName();
+ if (log.isInfoEnabled()) {
+ log.info("[" + propertyName + "] value changed: " + evt.getNewValue());
+ }
+ if (propertyName.startsWith("longitude")) {
+ longitudeResult.setText(source.getLongitude().toString());
+ } else {
+
+ latitudeResult.setText(source.getLatitude().toString());
+ }
+ }
+ });
+
+ JPanel longitudeEditorPanel = new JPanel(new GridLayout());
+ longitudeEditorPanel.setBorder(new TitledBorder("Longitude"));
+ longitudeEditorPanel.add(BorderLayout.CENTER, longitudeEditor);
+ longitudeEditorPanel.add(BorderLayout.EAST, longitudeResult);
+
+ JPanel latitudeEditorPanel = new JPanel(new GridLayout());
+ latitudeEditorPanel.setBorder(new TitledBorder("Latitude"));
+ latitudeEditorPanel.add(BorderLayout.CENTER, latitudeEditor);
+ latitudeEditorPanel.add(BorderLayout.EAST, latitudeResult);
+
+ JPanel panel = new JPanel(new GridLayout(0, 1));
+ panel.add(longitudeEditorPanel);
+ panel.add(latitudeEditorPanel);
+
+ final JDialog frame = new JDialog();
+
+ frame.setContentPane(panel);
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ frame.setSize(800, 200);
+ frame.setVisible(true);
+ }
+ });
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateEditorTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateTest.java
===================================================================
--- trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateTest.java (rev 0)
+++ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateTest.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,126 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Created on 10/25/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmdCoordinateTest {
+
+ @Test
+ public void testFromDecimal() throws Exception {
+
+ {
+ DmdCoordinate actual = DmdCoordinate.empty();
+
+ actual.fromDecimal(42.7f);
+
+ Integer expectedDegree = 42;
+ Integer expectedMinute = 42;
+ Integer expectedDecimal = null;
+
+ Assert.assertEquals(expectedDegree, actual.getDegree());
+ Assert.assertEquals(expectedMinute, actual.getMinute());
+ Assert.assertEquals(expectedDecimal, actual.getDecimal());
+ }
+
+ {
+ DmdCoordinate actual = DmdCoordinate.empty();
+
+ float decimalExcepted = 42.707f;
+ actual.fromDecimal(decimalExcepted);
+
+ Integer expectedDegree = 42;
+ Integer expectedMinute = 42;
+ Integer expectedDecimal = 42;
+
+ Assert.assertEquals(expectedDegree, actual.getDegree());
+ Assert.assertEquals(expectedMinute, actual.getMinute());
+ Assert.assertEquals(expectedDecimal, actual.getDecimal());
+
+ Float decimal = actual.toDecimal();
+ Assert.assertEquals(decimalExcepted, decimal, 0.001);
+ }
+ }
+
+ @Test
+ public void testToDecimal() throws Exception {
+
+ {
+ DmdCoordinate component = DmdCoordinate.empty();
+ component.setDegree(42);
+ component.setMinute(42);
+ component.setDecimal(42);
+ Float actual = component.toDecimal();
+ Float expected = 42.707f;
+ Assert.assertEquals(expected, actual, 0.001);
+ }
+
+ {
+ DmdCoordinate component = DmdCoordinate.empty();
+ component.setDegree(12);
+ component.setMinute(12);
+ Float actual = component.toDecimal();
+ Float expected = 12.2f;
+ Assert.assertEquals(expected, actual, 0.0001);
+
+ component.fromDecimal(expected);
+
+ Integer expectedDegree = 12;
+ Integer expectedMinute = 12;
+ Integer expectedDecimal = null;
+
+ Assert.assertEquals(expectedDegree, component.getDegree());
+ Assert.assertEquals(expectedMinute, component.getMinute());
+ Assert.assertEquals(expectedDecimal, component.getDecimal());
+ }
+
+ {
+ DmdCoordinate component = DmdCoordinate.empty();
+ component.setDegree(12);
+ component.setMinute(12);
+ component.setDecimal(20);
+ Float actual = component.toDecimal();
+ Float expected = 12.203333f;
+ Assert.assertEquals(expected, actual, 0.001);
+
+ component.fromDecimal(expected);
+
+ Integer expectedDegree = 12;
+ Integer expectedMinute = 12;
+ Integer expectedDecimal = 20;
+
+ Assert.assertEquals(expectedDegree, component.getDegree());
+ Assert.assertEquals(expectedMinute, component.getMinute());
+ Assert.assertEquals(expectedDecimal, component.getDecimal());
+ }
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmdCoordinateTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorTest.java
===================================================================
--- trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorTest.java (rev 0)
+++ trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorTest.java 2013-10-25 16:43:35 UTC (rev 1316)
@@ -0,0 +1,218 @@
+package fr.ifremer.tutti.ui.swing.spatial;
+
+/*
+ * #%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 org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.border.TitledBorder;
+import java.awt.BorderLayout;
+import java.awt.GridLayout;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.text.ParseException;
+
+/**
+ * To test the {@link DmsCoordinateEditor}.
+ * <p/>
+ * Created on 10/17/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DmsCoordinateEditorTest {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(DmsCoordinateEditorTest.class);
+
+ public static class EditorBean extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_LONGITUDE_SIGN = "longitudeSign";
+
+ public static final String PROPERTY_LONGITUDE_DEGREE = "longitudeDegree";
+
+ public static final String PROPERTY_LONGITUDE_MINUTE = "longitudeMinute";
+
+ public static final String PROPERTY_LONGITUDE_SECOND = "longitudeSecond";
+
+ public static final String PROPERTY_LATITUDE_SIGN = "latitudeSign";
+
+ public static final String PROPERTY_LATITUDE_DEGREE = "latitudeDegree";
+
+ public static final String PROPERTY_LATITUDE_MINUTE = "latitudeMinute";
+
+ public static final String PROPERTY_LATITUDE_SECOND = "latitudeSecond";
+
+ protected final DmsCoordinate longitude = DmsCoordinate.empty();
+
+ protected final DmsCoordinate latitude = DmsCoordinate.empty();
+
+ public DmsCoordinate getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitudeDegre(Integer degre) {
+ Object oldValue = longitude.getDegree();
+ longitude.setDegree(degre);
+ firePropertyChange(PROPERTY_LONGITUDE_DEGREE, oldValue, degre);
+ }
+
+ public void setLongitudeMinute(Integer minute) {
+ Object oldValue = longitude.getMinute();
+ longitude.setMinute(minute);
+ firePropertyChange(PROPERTY_LONGITUDE_MINUTE, oldValue, minute);
+ }
+
+ public void setLongitudeSecond(Integer seconde) {
+ Object oldValue = longitude.getSecond();
+
+ longitude.setSecond(seconde);
+ firePropertyChange(PROPERTY_LONGITUDE_SECOND, oldValue, seconde);
+ }
+
+ public void setLongitudeSign(boolean sign) {
+ Object oldValue = longitude.isSign();
+ longitude.setSign(sign);
+ firePropertyChange(PROPERTY_LONGITUDE_SIGN, oldValue, sign);
+ }
+
+ public DmsCoordinate getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitudeDegre(Integer degre) {
+ Object oldValue = latitude.getDegree();
+ latitude.setDegree(degre);
+ firePropertyChange(PROPERTY_LATITUDE_DEGREE, oldValue, degre);
+ }
+
+ public void setLatitudeMinute(Integer minute) {
+ Object oldValue = latitude.getMinute();
+ latitude.setMinute(minute);
+ firePropertyChange(PROPERTY_LATITUDE_MINUTE, oldValue, minute);
+ }
+
+
+ public void setLatitudeSecond(Integer seconde) {
+ Object oldValue = latitude.getSecond();
+ latitude.setSecond(seconde);
+ firePropertyChange(PROPERTY_LATITUDE_SECOND, oldValue, seconde);
+ }
+
+ public void setLatitudeSign(boolean sign) {
+ Object oldValue = latitude.isSign();
+ latitude.setSign(sign);
+ firePropertyChange(PROPERTY_LATITUDE_SIGN, oldValue, sign);
+ }
+
+ @Override
+ public String toString() {
+ return "EditorBean{" +
+ "longitude=" + longitude +
+ ", latitude=" + latitude +
+ '}';
+ }
+ }
+
+ public static void main(String[] args) throws ParseException {
+
+
+ EditorBean bean = new EditorBean();
+
+ DmsCoordinateEditor longitudeEditor = new DmsCoordinateEditor();
+ longitudeEditor.setBean(bean);
+ longitudeEditor.setPropertySign(EditorBean.PROPERTY_LONGITUDE_SIGN);
+ longitudeEditor.setPropertyDegree(EditorBean.PROPERTY_LONGITUDE_DEGREE);
+ longitudeEditor.setPropertyMinute(EditorBean.PROPERTY_LONGITUDE_MINUTE);
+ longitudeEditor.setPropertySecond(EditorBean.PROPERTY_LONGITUDE_SECOND);
+ longitudeEditor.setLongitudeEditor(true);
+ longitudeEditor.setShowReset(true);
+ longitudeEditor.init();
+
+ DmsCoordinateEditor latitudeEditor = new DmsCoordinateEditor();
+ latitudeEditor.setBean(bean);
+ latitudeEditor.setPropertySign(EditorBean.PROPERTY_LATITUDE_SIGN);
+ latitudeEditor.setPropertyDegree(EditorBean.PROPERTY_LATITUDE_DEGREE);
+ latitudeEditor.setPropertyMinute(EditorBean.PROPERTY_LATITUDE_MINUTE);
+ latitudeEditor.setPropertySecond(EditorBean.PROPERTY_LATITUDE_SECOND);
+ latitudeEditor.setLongitudeEditor(false);
+ latitudeEditor.setShowReset(true);
+ latitudeEditor.init();
+
+ final JLabel latitudeResult = new JLabel();
+ final JLabel longitudeResult = new JLabel();
+
+ bean.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ EditorBean source = (EditorBean) evt.getSource();
+ String propertyName = evt.getPropertyName();
+ if (log.isInfoEnabled()) {
+ log.info("[" + propertyName + "] value changed: " + evt.getNewValue());
+ }
+ if (propertyName.startsWith("longitude")) {
+ longitudeResult.setText(source.getLongitude().toString());
+ } else {
+
+ latitudeResult.setText(source.getLatitude().toString());
+ }
+ }
+ });
+
+ JPanel longitudeEditorPanel = new JPanel(new GridLayout());
+ longitudeEditorPanel.setBorder(new TitledBorder("Longitude"));
+ longitudeEditorPanel.add(BorderLayout.CENTER, longitudeEditor);
+ longitudeEditorPanel.add(BorderLayout.EAST, longitudeResult);
+
+ JPanel latitudeEditorPanel = new JPanel(new GridLayout());
+ latitudeEditorPanel.setBorder(new TitledBorder("Latitude"));
+ latitudeEditorPanel.add(BorderLayout.CENTER, latitudeEditor);
+ latitudeEditorPanel.add(BorderLayout.EAST, latitudeResult);
+
+ JPanel panel = new JPanel(new GridLayout(0, 1));
+ panel.add(longitudeEditorPanel);
+ panel.add(latitudeEditorPanel);
+
+ final JDialog frame = new JDialog();
+
+ frame.setContentPane(panel);
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ frame.setSize(800, 200);
+ frame.setVisible(true);
+ }
+ });
+ }
+}
Property changes on: trunk/tutti-ui-swing/src/test/java/fr/ifremer/tutti/ui/swing/spatial/DmsCoordinateEditorTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0