Author: chatellier Date: 2009-06-16 10:39:31 +0000 (Tue, 16 Jun 2009) New Revision: 2389 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/WizardGroupCreationUI.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: Some field are always disabled in populationGroup. Add some translation on group creation wizard. 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 09:21:16 UTC (rev 2388) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-06-16 10:39:31 UTC (rev 2389) @@ -16,8 +16,18 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *##%*/ - --> +--> +<!-- +A terme, cette interface sera appelée à disparaitre. + +La plupart des champs de cette interface sont editable ssi +il n'ont pas d'equation associée. + +Dans le cas contraire, les champs sont désactivés, en lecture +seule, et contiennent les resulats des equations en simple +visualisation. +--> <fr.ifremer.isisfish.ui.input.InputContentUI> <!-- bean property --> @@ -31,8 +41,9 @@ import fr.ifremer.isisfish.entities.PopulationGroupImpl; import fr.ifremer.isisfish.entities.Population; import fr.ifremer.isisfish.entities.PopulationImpl; -import org.codelutin.math.matrix.AbstractMatrixND; import org.codelutin.math.matrix.MatrixND; +import org.codelutin.math.matrix.gui.MatrixPanelEvent; +import org.codelutin.math.matrix.gui.MatrixPanelListener; addPropertyChangeListener("populationGroup", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { @@ -54,6 +65,20 @@ } }); +/*fieldPopulationGroupNaturalDeathRate.addMatrixListener(new MatrixPanelListener() { + @Override + public void matrixChanged(MatrixPanelEvent event) { + if (getPopulationGroup() != null){ + // not sure of this code + // fieldPopulationGroupNaturalDeathRate contains of "part of" + // natural death rate matrix + // can't overrite matrix ... + // just enable save ? + save.setEnabled(true); + } + } +});*/ + @Override public void refresh() { //if (!isActif()) { @@ -80,13 +105,12 @@ } protected void setNaturalDeathRateMatrix() { - try { Population population = getBean(); - AbstractMatrixND naturalDeathRateMatrix = (AbstractMatrixND)population.getNaturalDeathRateMatrix(); - + MatrixND naturalDeathRateMatrix = population.getNaturalDeathRateMatrix(); + // extract only line for this population group - MatrixND naturalDeathRateMatrix2 = naturalDeathRateMatrix.getSubMatrixOnSemantic(0, getPopulationGroup()); + MatrixND naturalDeathRateMatrix2 = naturalDeathRateMatrix.getSubMatrix(0, getPopulationGroup()); fieldPopulationGroupNaturalDeathRate.setMatrix(naturalDeathRateMatrix2.copy()); } catch (Exception e) { // can happen if population has no zone yet @@ -152,7 +176,7 @@ <cell fill='horizontal' anchor='east'> <JLabel text="isisfish.populationGroup.naturalDeathRate" enabled='{isPopGroupNotNull()}'/> </cell> - <cell columns='2' fill='both' weightx='1.0' weighty='1.0'> + <cell columns='2' fill='both' weightx='1.0' weighty='0.5'> <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='fieldPopulationGroupNaturalDeathRate' enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationImpl.class}' _method='"NaturalDeathRateMatrix"' /> <!-- this bindings totaly break UI @@ -178,13 +202,9 @@ <JLabel text="isisfish.populationGroup.age" enabled='{isPopGroupNotNull()}'/> </cell> <cell columns='2' fill='horizontal' weightx='1.0'> - <!--NumberEditor id='fieldPopulationGroupAge' constructorParams='this' - bean='{getPopulationGroup()}' property='age' - useSign='true' enabled='{isPopGroupNotNull()}' decorator='boxed' - _bean='{PopulationGroupImpl.class}' _method='"Age"'/--> + <!-- non editable age field --> <JTextField id="fieldPopulationGroupAge" text='{getPopulationGroup().getAge()}' - onKeyReleased='getPopulationGroup().setAge(Double.parseDouble(fieldPopulationGroupAge.getText()))' - enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"Age"'/> + enabled='false' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"Age"'/> </cell> </row> <row> @@ -192,24 +212,16 @@ <JLabel text="isisfish.populationGroup.length" enabled='{isPopGroupNotNull()}'/> </cell> <cell fill='both' weightx='0.5'> - <!--NumberEditor id='fieldPopulationGroupMinLength' constructorParams='this' - bean='{getPopulationGroup()}' property='minLength' - toolTipText="minimum length" useSign='true' - enabled='{isPopGroupNotNull()}' decorator='boxed' - _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/--> + <!-- non editable min length field --> <JTextField id="fieldPopulationGroupMinLength" text='{getPopulationGroup().getMinLength()}' - toolTipText="minimum length" onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))' - enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/> + toolTipText="isisfish.populationGroup.minimumLength" + enabled='false' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MinLength"'/> </cell> <cell fill='both' weightx='0.5'> - <!--NumberEditor id='fieldPopulationGroupMaxLength' constructorParams='this' - bean='{getPopulationGroup()}' property='maxLength' - toolTipText="maximum length" useSign='true' - enabled='{isPopGroupNotNull()}' decorator='boxed' - _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/--> + <!-- non editable max length field --> <JTextField id="fieldPopulationGroupMaxLength" text='{getPopulationGroup().getMaxLength()}' - toolTipText="maximum length" onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))' - enabled='{isPopGroupNotNull()}' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/> + toolTipText="isisfish.populationGroup.maximumLength" + enabled='false' decorator='boxed' _bean='{PopulationGroupImpl.class}' _method='"MaxLength"'/> </cell> </row> <row> Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-06-16 09:21:16 UTC (rev 2388) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-06-16 10:39:31 UTC (rev 2389) @@ -550,7 +550,7 @@ </row> <row> <cell columns='2' fill='horizontal' weightx='1.0'> - <JLabel text="The equation used is the population's growth curve, it needs to be defined first."/> + <JLabel text="isisfish.wizardGroupCreation.undefinedGrowthEquation"/> </cell> </row> </Table> 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-06-16 09:21:16 UTC (rev 2388) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-06-16 10:39:31 UTC (rev 2389) @@ -60,7 +60,6 @@ Stop\ the\ process= SubProcess\ start\:\ %s\ %s= Switch\ repository\ type\ to\ none= -The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)= Try\ to\ log\ on\ %s@%s\:%d= Use\ branches,\ switch\ not\ needed= @@ -714,7 +713,9 @@ isisfish.populationGroup.age=Age isisfish.populationGroup.comments=Comments isisfish.populationGroup.length=Length +isisfish.populationGroup.maximumLength=Maximum length isisfish.populationGroup.meanWeigth=Mean Weigth +isisfish.populationGroup.minimumLength=Minimum length isisfish.populationGroup.naturalDeathRate=Natural death rate isisfish.populationGroup.price=Price isisfish.populationGroup.reproductionRate=Reproduction rate @@ -1086,11 +1087,10 @@ isisfish.wizardGroupCreation.selectGroupLengthType=Select group length type isisfish.wizardGroupCreation.timeStep=Time step (in month) isisfish.wizardGroupCreation.title=Group creation +isisfish.wizardGroupCreation.undefinedGrowthEquation=The equation used is the population's growth curve, it needs to be defined first. isisfish.zone.cells=Zone cells isisfish.zone.comments=Comments isisfish.zone.name=Name -maximum\ length= -minimum\ length= not\ started= region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= simulate\ %s\ with\ file\ %s= 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-06-16 09:21:16 UTC (rev 2388) +++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-06-16 10:39:31 UTC (rev 2389) @@ -60,7 +60,6 @@ Stop\ the\ process= SubProcess\ start\:\ %s\ %s= Switch\ repository\ type\ to\ none= -The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.= Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)= Try\ to\ log\ on\ %s@%s\:%d= Use\ branches,\ switch\ not\ needed= @@ -714,7 +713,9 @@ isisfish.populationGroup.age=Age isisfish.populationGroup.comments=Commentaires isisfish.populationGroup.length=Longueur +isisfish.populationGroup.maximumLength=Longueur maximale isisfish.populationGroup.meanWeigth=Poids principal +isisfish.populationGroup.minimumLength=Longueur minimale isisfish.populationGroup.naturalDeathRate=Taux de mortalit\u00E9 naturelle isisfish.populationGroup.price=Prix isisfish.populationGroup.reproductionRate=Taux de reproduction @@ -1086,11 +1087,10 @@ isisfish.wizardGroupCreation.selectGroupLengthType=Choisir la longueur du groupe isisfish.wizardGroupCreation.timeStep=Pas de temps (en mois) isisfish.wizardGroupCreation.title=Cr\u00E9ation du groupe +isisfish.wizardGroupCreation.undefinedGrowthEquation=The equation used is the population's growth curve, it needs to be defined first. isisfish.zone.cells=cellules de la Zone isisfish.zone.comments=Commentaires isisfish.zone.name=Nom -maximum\ length= -minimum\ length= not\ started= region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite= simulate\ %s\ with\ file\ %s=