Author: chatellier Date: 2009-06-16 07:46:23 +0000 (Tue, 16 Jun 2009) New Revision: 2383 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx Log: NaturalDeathRate matrix can be no defined yet. Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-06-16 07:45:55 UTC (rev 2382) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-06-16 07:46:23 UTC (rev 2383) @@ -80,12 +80,21 @@ } protected void setNaturalDeathRateMatrix() { - Population population = getBean(); - AbstractMatrixND naturalDeathRateMatrix = (AbstractMatrixND)population.getNaturalDeathRateMatrix(); + + try { + Population population = getBean(); + AbstractMatrixND naturalDeathRateMatrix = (AbstractMatrixND)population.getNaturalDeathRateMatrix(); - // TODO what is this code for ??? - MatrixND naturalDeathRateMatrix2 = naturalDeathRateMatrix.getSubMatrixOnSemantic(0, getPopulationGroup()); - fieldPopulationGroupNaturalDeathRate.setMatrix(naturalDeathRateMatrix2.copy()); + // extract only line for this population group + MatrixND naturalDeathRateMatrix2 = naturalDeathRateMatrix.getSubMatrixOnSemantic(0, getPopulationGroup()); + fieldPopulationGroupNaturalDeathRate.setMatrix(naturalDeathRateMatrix2.copy()); + } catch (Exception e) { + // can happen if population has no zone yet + // TODO maybe display a message + if (log.isWarnEnabled()) { + log.warn("No zone defined for this population group", e); + } + } } /**
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org