Author: chatellier Date: 2010-12-08 16:03:36 +0000 (Wed, 08 Dec 2010) New Revision: 376 Log: Add/rename matrix name and dimensions Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-08 10:24:17 UTC (rev 375) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-08 16:03:36 UTC (rev 376) @@ -26,6 +26,7 @@ package fr.ifremer.coser.services; import static org.nuiton.i18n.I18n._; +import static org.nuiton.i18n.I18n.n_; import java.beans.Introspector; import java.io.BufferedOutputStream; @@ -1854,15 +1855,15 @@ Collections.sort(lineNames2); List<String> columnsNames2 = new ArrayList<String>(columns); Collections.sort(columnsNames2); - MatrixND matrix = MatrixFactory.getInstance().create("sampling effort", new List<?>[] { + MatrixND matrix = MatrixFactory.getInstance().create(n_("coser.business.matrix.samplingeffort"), new List<?>[] { lineNames2 , columnsNames2}); - + for (Map.Entry<String, Map<String, Double>> dynMatrixEntry : dynMatrix.entrySet()) { for (Map.Entry<String, Double> haulCountForYearEntry : dynMatrixEntry.getValue().entrySet()) { matrix.setValue(dynMatrixEntry.getKey(), haulCountForYearEntry.getKey(), haulCountForYearEntry.getValue()); } } - + return matrix; } @@ -1951,7 +1952,7 @@ Collections.sort(lineNames2); List<String> columnsNames2 = new ArrayList<String>(columns); Collections.sort(columnsNames2); - MatrixND matrix = MatrixFactory.getInstance().create("occurence", new List<?>[] { + MatrixND matrix = MatrixFactory.getInstance().create(n_("coser.business.matrix.occurrence"), new List<?>[] { lineNames2 , columnsNames2}); for (Map.Entry<String, Map<String, Set<String>>> dynMatrixEntry : dynMatrix.entrySet()) { @@ -2142,7 +2143,7 @@ Collections.sort(sortedSpecies); List<String> sortedYears = new ArrayList<String>(yearsList); Collections.sort(sortedYears); - MatrixND matrix = MatrixFactory.getInstance().create("density", new List<?>[] { + MatrixND matrix = MatrixFactory.getInstance().create(n_("coser.business.matrix.density"), new List<?>[] { sortedSpecies , sortedYears}); for (Map.Entry<String, Map<String, Map<String, Set<Double>>>> dynMatrixEntry : densityPerSpecyStrataYear.entrySet()) { @@ -2217,7 +2218,7 @@ Set<Double> lengthSet = new HashSet<Double>(); Set<String> speciesSet = new HashSet<String>(); Set<String> strataSet = new HashSet<String>(); - Set<String> yearSet = new HashSet<String>(); + Set<String> yearsSet = new HashSet<String>(); Iterator<String[]> itData = dataContainer.getLength().iterator(); itData.next(); // skip header @@ -2234,7 +2235,7 @@ // remember for matrix spemantics speciesSet.add(species); strataSet.add(strata); - yearSet.add(year); + yearsSet.add(year); // get correct length step // plain or half centimeters @@ -2288,12 +2289,20 @@ // convert map to matrixND List<Double> lengthSem = new ArrayList<Double>(lengthSet); + Collections.sort(lengthSem); List<String> speciesSem = new ArrayList<String>(speciesSet); + Collections.sort(speciesSem); List<String> strataSem = new ArrayList<String>(strataSet); - List<String> yearSem = new ArrayList<String>(yearSet); + Collections.sort(strataSem); + List<String> yearsSem = new ArrayList<String>(yearsSet); + Collections.sort(yearsSem); - MatrixND matrix = MatrixFactory.getInstance().create("density", new List<?>[] { - lengthSem , speciesSem, strataSem, yearSem}); + MatrixND matrix = MatrixFactory.getInstance().create(n_("coser.business.matrix.lengthstructure"), new List<?>[] { + lengthSem , speciesSem, strataSem, yearsSem}); + matrix.setDimensionName(0, n_("coser.business.common.length")); + matrix.setDimensionName(1, n_("coser.business.common.species")); + matrix.setDimensionName(2, n_("coser.business.common.strata")); + matrix.setDimensionName(3, n_("coser.business.common.years")); for (Map.Entry<Double, Map<String, Map<String, Map<String, Double>>>> lengthTuple : countForLengthSpeciesStrataYear.entrySet()) { Double length = lengthTuple.getKey(); Modified: trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties =================================================================== --- trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2010-12-08 10:24:17 UTC (rev 375) +++ trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2010-12-08 16:03:36 UTC (rev 376) @@ -28,8 +28,12 @@ coser.business.command.deleteline.log=In file %s, line %s has been deleted coser.business.command.mergespecies.log=Species "%2$s" has been merged to "%1$s" coser.business.command.modifyfield.log=In file %s at line %s, field "%s" value as been modify from "%s" to "%s" +coser.business.common.length=Length coser.business.common.number=Number +coser.business.common.species=Species +coser.business.common.strata=Strata coser.business.common.year=Year +coser.business.common.years=Years coser.business.control.error.allCategories=All categories coser.business.control.error.diffCatchLength=Differences between length and catch coser.business.control.error.diffCatchLengthDetail=Differences between length and catch for species %s (year \: %s) @@ -62,6 +66,10 @@ coser.business.control.step.observation=Checking observation number \: %s (%d%%) coser.business.control.step.xworks=Line checks \: %s (%d%%) coser.business.line=Line +coser.business.matrix.density=Density +coser.business.matrix.lengthstructure=Length structure +coser.business.matrix.occurrence=Occurrence +coser.business.matrix.samplingeffort=Sampling effort coser.business.publication.errorexportlines=Lines coser.business.publication.errorexporttitle=Error report for project %s coser.business.publication.errorgraph=Graph Modified: trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties =================================================================== --- trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2010-12-08 10:24:17 UTC (rev 375) +++ trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2010-12-08 16:03:36 UTC (rev 376) @@ -28,8 +28,12 @@ coser.business.command.deleteline.log=Dans le fichier %s, la ligne %s a \u00E9t\u00E9 supprim\u00E9e coser.business.command.mergespecies.log=Les esp\u00E8ces "%2$s" ont \u00E9t\u00E9 fusionn\u00E9es en "%1$s" coser.business.command.modifyfield.log=Dans le ficher %s \u00E0 la ligne %s, le champs "%s" est pass\u00E9 de la valeur "%s" \u00E0 "%s" +coser.business.common.length=Taille coser.business.common.number=Nombre +coser.business.common.species=Esp\u00E8ces +coser.business.common.strata=Strates coser.business.common.year=Ann\u00E9e +coser.business.common.years=Ann\u00E9es coser.business.control.error.allCategories=Toutes les cat\u00E9gories coser.business.control.error.diffCatchLength=Diff\u00E9rence entre les captures et taille coser.business.control.error.diffCatchLengthDetail=Diff\u00E9rence entre les captures et taille pour l'esp\u00E8ce %s (ann\u00E9e %s) @@ -62,6 +66,10 @@ coser.business.control.step.observation=V\u00E9rification du nombre d'observation \: %s (%d%%) coser.business.control.step.xworks=Validation par lignes \: %s (%d%%) coser.business.line=Ligne +coser.business.matrix.density=Densit\u00E9 +coser.business.matrix.lengthstructure=Structure en taille +coser.business.matrix.occurrence=Occurrence +coser.business.matrix.samplingeffort=Effort d'\u00E9chantillonnage coser.business.publication.errorexportlines=Lignes coser.business.publication.errorexporttitle=Rapport d'erreur pour le projet %s coser.business.publication.errorgraph=Graphique