Author: sletellier Date: 2009-04-30 16:41:43 +0000 (Thu, 30 Apr 2009) New Revision: 2162 Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties Log: Done : [#1817] manque de zones de saisie dans l'interface Population/Saison_ Bloquant EC Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2009-04-30 16:41:43 UTC (rev 2162) @@ -107,6 +107,7 @@ } // go back to previous node returnToPreviousNode(getNavigationTree(), event); + log.info("goBackToPreviousNode"); } @@ -121,7 +122,10 @@ try { currentUI = (InputContentUI) newUI; currentUI.setSens(false); - context.getContextValue(InputSaveVerifier.class).addCurrentPanel(currentUI); + InputSaveVerifier verifier = context.getContextValue(InputSaveVerifier.class); + verifier.removeAllPanels(); + verifier.addCurrentPanel(currentUI); + currentUI.refresh(); currentNode = node; } catch (Exception e) { if (log.isErrorEnabled()) { @@ -148,7 +152,7 @@ exit = false; } if (exit) { - verif.removeAllPanels(); + verif.reset(); } return exit; } @@ -164,9 +168,6 @@ if (TopiaEntity.class.isInstance(data)){ verif.addCurrentEntity((TopiaEntity) data); } - else{ - verif.addCurrentEntity(null); - } verif.refreshAll(); verif.setCurrentNode(node); } Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-30 16:41:43 UTC (rev 2162) @@ -373,6 +373,16 @@ addCurrentEntity(currentEntity, currentEntity.getTopiaId()); } } + public void reset(){ + removeAllEntity(); + removeAllPanels(); + this.currentCancelButton = null; + this.currentDeleteButton = null; + this.currentNewButton = null; + this.currentSaveButton = null; + this.currentOnglet = null; + this.currentNode = null; + } public void removeAllEntity(){ currentEntities.clear(); editable = false; Added: 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 (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonSpacializedUI.jaxx 2009-04-30 16:41:43 UTC (rev 2162) @@ -0,0 +1,124 @@ + +<fr.ifremer.isisfish.ui.input.InputContentUI> + + <!-- bean property --> + <fr.ifremer.isisfish.entities.PopulationImpl id='bean' javaBean='null'/> + + <fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl id='populationSeasonInfo' javaBean='null'/> + + <Boolean id='popSeasonInfoNotNull' javaBean='false'/> + + <Boolean id='ageGroupType' javaBean='false'/> + + <script><![CDATA[ +import fr.ifremer.isisfish.entities.PopulationSeasonInfo; +import org.codelutin.math.matrix.gui.JAXXMatrixEditor; +import fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl; +import org.codelutin.math.matrix.MatrixND; +import org.codelutin.math.matrix.gui.MatrixPanelEvent; +import org.codelutin.math.matrix.gui.MatrixPanelListener; +import fr.ifremer.isisfish.ui.widget.ErrorDialogUI; + +protected MatrixPanelListener listener = null; + +listener = new MatrixPanelListener() { + + @Override + public void matrixChanged(MatrixPanelEvent arg0) { + if (getPopulationSeasonInfo() != null && fieldPopulationSeasonReproductionDistribution.getMatrix() != null){ + getPopulationSeasonInfo().setLengthChangeMatrix(fieldPopulationSeasonReproductionDistribution.getMatrix().copy()); + } + } +}; +public void refresh(){ + fieldPopulationSeasonReproductionDistribution.addMatrixListener(listener); +} +public void spacialized(){ + getPopulationSeasonInfo().setSimpleLengthChangeMatrix(labelPopulationSeasonGroupChangeLengthNoSpacialized.isSelected()); + PopulationSeasonInfo popInfo = getPopulationSeasonInfo(); + try { + MatrixND mat = popInfo.getLengthChangeMatrix(); + if (mat != null){ + if (popInfo.getSimpleLengthChangeMatrix()) { + mat = popInfo.unspacializeLengthChangeMatrix(mat); + } else { + mat = popInfo.spacializeLengthChangeMatrix(mat); + popInfo.setLengthChangeMatrix(mat); + } + } + }catch(Exception eee){ + log.error("Can't (un)spacialize Matrix Change Of Group", eee); + ErrorDialogUI.showError(eee); + } +} + +public void computeMatrixChangeOfGroup(){ + PopulationSeasonInfo popInfo = getPopulationSeasonInfo(); + MatrixND mat = popInfo.computeLengthChangeMatrix(); + if(!popInfo.getSimpleLengthChangeMatrix()){ + mat = popInfo.spacializeLengthChangeMatrix(mat); + } + popInfo.setLengthChangeMatrix(mat); +} + +public void showSpacializedMatrixChangeOfGroup(){ + PopulationSeasonInfo popInfo = getPopulationSeasonInfo(); + MatrixND mat = popInfo.getLengthChangeMatrix(); + if(popInfo.getSimpleLengthChangeMatrix()){ + mat = popInfo.spacializeLengthChangeMatrix(mat); + } + JAXXMatrixEditor panel = new JAXXMatrixEditor(false, 800, 300); + panel.setMatrix(mat); + JOptionPane.showMessageDialog(null, panel, _("isisfish.message.spacialized.visualisation"), JOptionPane.INFORMATION_MESSAGE); +} + ]]></script> + + <Table> + <row> + <cell> + <Panel/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JRadioButton id="labelPopulationSeasonGroupChangeLengthNoSpacialized" + buttonGroup="labelPopulationSeasonGroupChangeLengthSpacializedGroup" + selected='{getPopulationSeasonInfo().getSimpleLengthChangeMatrix()}' + text="isisfish.populationSeasons.noSpacialized" decorator='boxed' + enabled='{isPopSeasonInfoNotNull()}' onItemStateChanged='spacialized()' + visible='{isAgeGroupType()}'/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JRadioButton id="labelPopulationSeasonGroupChangeLengthSpacialized" + buttonGroup="labelPopulationSeasonGroupChangeLengthSpacializedGroup" + selected='{!getPopulationSeasonInfo().getSimpleLengthChangeMatrix()}' + text="isisfish.populationSeasons.spacialized" enabled='{isPopSeasonInfoNotNull()}' + visible='{isAgeGroupType()}' decorator='boxed'/> + </cell> + </row> + <row> + <cell> + <JLabel text="isisfish.populationSeasons.changeGroup" visible='{isAgeGroupType()}'/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JButton text="isisfish.populationSeasons.computeCoefficient" decorator='boxed' visible='{isAgeGroupType()}' + enabled='{isPopSeasonInfoNotNull()}' onActionPerformed='computeMatrixChangeOfGroup()'/> + </cell> + <cell fill='horizontal' weightx='0.5'> + <JButton id="labelPopulationSeasonGroupChangeLengthButtonShow" text="isisfish.populationSeasons.showSpacialized" + enabled='{labelPopulationSeasonGroupChangeLengthNoSpacialized.isSelected()}' decorator='boxed' + onActionPerformed='showSpacializedMatrixChangeOfGroup()' + visible='{isAgeGroupType()}'/> + </cell> + </row> + <row> + <cell> + <Panel/> + </cell> + <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationSeasonReproductionDistribution' + matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix()}' enabled='{isPopSeasonInfoNotNull()}' + decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"LengthChangeMatrix"' + visible='{isAgeGroupType()}'/> + </cell> + </row> + </Table> +</fr.ifremer.isisfish.ui.input.InputContentUI> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-04-30 16:41:43 UTC (rev 2162) @@ -120,6 +120,15 @@ } }); +listener = new MatrixPanelListener() { + + @Override + public void matrixChanged(MatrixPanelEvent arg0) { + if (getPopulationSeasonInfo() != null && fieldPopulationSeasonReproductionDistribution.getMatrix() != null){ + getPopulationSeasonInfo().setLengthChangeMatrix(fieldPopulationSeasonReproductionDistribution.getMatrix().copy()); + } + } +}; public void refresh(){ if (!isActif()){ setPopSeasonInfoNotNull(false); @@ -144,16 +153,14 @@ ip.setLabelRenderer(Month.MONTH); ip.setModel(interval); - listener = new MatrixPanelListener() { - - @Override - public void matrixChanged(MatrixPanelEvent arg0) { - if (getPopulationSeasonInfo() != null && fieldPopulationSeasonReproductionDistribution.getMatrix() != null){ - getPopulationSeasonInfo().setLengthChangeMatrix(fieldPopulationSeasonReproductionDistribution.getMatrix().copy()); - } - } - }; + if(getPopulationSeasonInfo() != null) { + PopulationSeasonInfoImpl popInfo = getPopulationSeasonInfo(); + setPopulationSeasonInfo(null); + setPopulationSeasonInfo(popInfo); + getVerifier().addCurrentEntity(getPopulationSeasonInfo()); + } fieldPopulationSeasonReproductionDistribution.addMatrixListener(listener); + getVerifier().addCurrentPanel(populationSeasonSpecializedUI); } protected void setInterval() { if(getPopulationSeasonInfo() != null) { @@ -191,7 +198,7 @@ } protected void setCombo(){ if (getBean() != null){ - jaxx.runtime.SwingUtil.fillComboBox(fieldPopulationSeasonInfoChooser,getBean().getPopulationSeasonInfo(), getBean().getPopulationSeasonInfo(), true); + jaxx.runtime.SwingUtil.fillComboBox(fieldPopulationSeasonInfoChooser,getBean().getPopulationSeasonInfo(), getPopulationSeasonInfo(), true); } } protected void seasonGroupChanged(){ @@ -204,17 +211,17 @@ setPopulationSeasonInfo((PopulationSeasonInfoImpl)fieldPopulationSeasonInfoChooser.getSelectedItem()); getVerifier().addCurrentEntity(getPopulationSeasonInfo()); setPopSeasonInfoNotNull(getPopulationSeasonInfo() != null); - SwingUtilities.invokeLater(new Runnable() { - public void run() { - setInterval(); - setMatrix(); - init = false; - } - }); + setInterval(); + setMatrix(); + init = false; } protected void setMatrix(){ fieldPopulationSeasonReproductionDistribution.setMatrix(getPopulationSeasonInfo().getLengthChangeMatrix()); } +protected boolean isAgeGroupType(boolean result){ + populationSeasonSpecializedUI.setVisible(result); + return result; +} ]]> </script> <Table id='body'> @@ -240,32 +247,48 @@ </cell> </row> <row> - <cell> + <cell fill='both'> <JPanel/> </cell> - <cell fill='horizontal' weightx='1.0'> + <cell fill='both' weightx='1.0'> <JCheckBox id="fieldPopulationSeasonGroupChange" text="isisfish.populationSeasons.changeGroup" selected='{getPopulationSeasonInfo().getGroupChange()}' decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"GroupChange"' - onActionPerformed='seasonGroupChanged()' enabled='{isPopSeasonInfoNotNull()}'/> + onActionPerformed='seasonGroupChanged()' enabled='{isPopSeasonInfoNotNull()}' visible='{isAgeGroupType(getPopulationSeasonInfo().getPopulation().getSpecies().getAgeGroupType())}'/> </cell> </row> <row> + <cell> + <JPanel/> + </cell> + <cell fill='horizontal' weightx='1.0'> + <JCheckBox id="fieldPopulationSeasonReproduction" selected='{getPopulationSeasonInfo().getReproduction()}' + onActionPerformed='getPopulationSeasonInfo().setReproduction(fieldPopulationSeasonReproduction.isSelected())' + text="isisfish.populationSeasons.Reproduction" enabled='{isPopSeasonInfoNotNull()}'/> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1.0' weighty='0.6'> + <PopulationSeasonSpacializedUI id='populationSeasonSpecializedUI' bean='{getBean()}' + populationSeasonInfo='{getPopulationSeasonInfo()}' popSeasonInfoNotNull='{isPopSeasonInfoNotNull()}' + ageGroupType='{isAgeGroupType(!getPopulationSeasonInfo().getPopulation().getSpecies().getAgeGroupType())}'/> + </cell> + </row> + <row> <cell anchor='east'> - <JLabel text="isisfish.populationSeasons.distributionSpawning" enabled='{isPopSeasonInfoNotNull()}'/> + <JLabel text="isisfish.populationSeasons.distributionSpawning" enabled='{isPopSeasonInfoNotNull()}' visible='{getPopulationSeasonInfo().getReproduction()}'/> </cell> - <cell fill='both' weightx='1.0'> - <JScrollPane> - <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationSeasonReproductionDistribution' - matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix()}' enabled='{isPopSeasonInfoNotNull()}' - decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"LengthChangeMatrix"'/> - </JScrollPane> + <cell fill='both' weightx='1.0' weighty='0.2'> + <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationSeasonReproductionDistribution' + matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getLengthChangeMatrix()}' enabled='{isPopSeasonInfoNotNull()}' + visible='{getPopulationSeasonInfo().getReproduction()}' + decorator='boxed' _bean='{PopulationSeasonInfoImpl.class}' _method='"LengthChangeMatrix"'/> </cell> </row> <row> <cell anchor='east'> <JLabel text="isisfish.populationSeasons.comments" enabled='{isPopSeasonInfoNotNull()}'/> </cell> - <cell fill='both' weightx='1.0' weighty='1.0'> + <cell fill='both' weightx='1.0' weighty='0.1'> <JScrollPane> <JTextArea id="fieldPopulationSeasonComment" text='{jaxx.runtime.SwingUtil.getStringValue(getBean().getSeasonsComment())}' onKeyReleased='getBean().setSeasonsComment(fieldPopulationSeasonComment.getText())' enabled='{isPopSeasonInfoNotNull()}' decorator='boxed'/> </JScrollPane> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-04-30 16:41:43 UTC (rev 2162) @@ -32,8 +32,6 @@ import fr.ifremer.isisfish.entities.Formule; import fr.ifremer.isisfish.entities.SetOfVessels; import fr.ifremer.isisfish.entities.SetOfVesselsImpl; -import java.util.logging.Level; -import java.util.logging.Logger; boolean init = false; addPropertyChangeListener("bean", new PropertyChangeListener() { Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties =================================================================== --- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-30 16:41:43 UTC (rev 2162) @@ -608,6 +608,7 @@ isisfish.message.simulation.ended=Simulation ended isisfish.message.simulation.execution=Simulation execution isisfish.message.simulation.prepare=Preparing simulation +isisfish.message.spacialized.visualisation= isisfish.message.tray.disabled=SystemTray disabled isisfish.message.update.finished=update finished isisfish.metier.comments=Comments @@ -731,10 +732,15 @@ isisfish.populationSeasonInfo.migration=Migration isisfish.populationSeasonInfo.months=Months isisfish.populationSeasonInfo.toString=%1$s season %2$s-%3$s +isisfish.populationSeasons.Reproduction=Reproduction isisfish.populationSeasons.changeGroup=Change of group isisfish.populationSeasons.comments=Comments +isisfish.populationSeasons.computeCoefficient=Calculate coefficient isisfish.populationSeasons.distributionSpawning=Distribution of spawning +isisfish.populationSeasons.noSpacialized=Not spacialized isisfish.populationSeasons.selectSeason=Select a season +isisfish.populationSeasons.showSpacialized=Show the spacialized +isisfish.populationSeasons.spacialized=Spacialized isisfish.populationSeasons.title=Saisons isisfish.populationZones.betweenSpawningRecruitmentAreas=Match between spawning and recruitment areas isisfish.populationZones.selectPopulationAreas=Select the population areas Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties =================================================================== --- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-30 16:21:03 UTC (rev 2161) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-30 16:41:43 UTC (rev 2162) @@ -608,6 +608,7 @@ isisfish.message.simulation.ended=Simulation termin\u00E9e isisfish.message.simulation.execution=Simulation execution isisfish.message.simulation.prepare=Pr\u00E9paration de la simulation +isisfish.message.spacialized.visualisation= isisfish.message.tray.disabled=Icone de notification d\u00E9sactiv\u00E9e isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e isisfish.metier.comments=Commentaires @@ -731,10 +732,15 @@ isisfish.populationSeasonInfo.migration=Migration isisfish.populationSeasonInfo.months=Mois isisfish.populationSeasonInfo.toString=%1$s saison %2$s-%3$s +isisfish.populationSeasons.Reproduction=Reproduction isisfish.populationSeasons.changeGroup=Changement de groupe isisfish.populationSeasons.comments=Commentaires +isisfish.populationSeasons.computeCoefficient=Calculer le coefficient isisfish.populationSeasons.distributionSpawning=Distribution de la reproduction +isisfish.populationSeasons.noSpacialized=Non spacialized isisfish.populationSeasons.selectSeason=S\u00E9lectionnez une saison +isisfish.populationSeasons.showSpacialized=Voir les spacialized +isisfish.populationSeasons.spacialized=Spacialized isisfish.populationSeasons.title=Saisons isisfish.populationZones.betweenSpawningRecruitmentAreas=Correspondance entre les zones de reproduction et de recrutement isisfish.populationZones.selectPopulationAreas=S\u00E9lectionnez les zones des populations @@ -1058,4 +1064,4 @@ minimum\ length= not\ started= region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= -simulate\ %s\ with\ file\ %s= +simulate\ %s\ with\ file\ %s= \ No newline at end of file
participants (1)
-
sletellier@users.labs.libre-entreprise.org