Author: chatellier Date: 2009-06-16 09:04:25 +0000 (Tue, 16 Jun 2009) New Revision: 2387 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx Log: Initialise la matric de changement de groupe si erreur Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx 2009-06-16 09:03:59 UTC (rev 2386) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx 2009-06-16 09:04:25 UTC (rev 2387) @@ -49,6 +49,25 @@ } }; +addPropertyChangeListener("populationSeasonInfo", new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getOldValue() != null || evt.getNewValue() == null) { + matrixPanelPopulationSeasonLengthChange.setMatrix(null); + } + if (evt.getNewValue() != null) { + try { + matrixPanelPopulationSeasonLengthChange.setMatrix(getPopulationSeasonInfo().getLengthChangeMatrix().copy()); + } + catch(Exception e) { + // an exception can happen if lengthChange matrix has never + // been initialized + computeMatrixChangeOfGroup(); + matrixPanelPopulationSeasonLengthChange.setMatrix(getPopulationSeasonInfo().getLengthChangeMatrix().copy()); + } + } + } +}); + @Override public void refresh() { // TODO add only once @@ -148,11 +167,11 @@ <Panel/> </cell> <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> - <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='matrixPanelPopulationSeasonLengthChange' - matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix().copy()}' + <org.codelutin.math.matrix.gui.JAXXMatrixEditor id='matrixPanelPopulationSeasonLengthChange' enabled='{isPopSeasonInfoNotNull()}' _bean='{PopulationSeasonInfoImpl.class}' _method='"LengthChangeMatrix"' visible='{isAgeGroupType()}' decorator='boxed' /> + <!-- matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix().copy()}' --> </cell> </row> </Table>
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org