Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
June 2009
- 5 participants
- 152 discussions
r2398 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui/input java/fr/ifremer/isisfish/ui/input/setofvessels resources/i18n
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
17 Jun '09
Author: chatellier
Date: 2009-06-17 13:00:12 +0000 (Wed, 17 Jun 2009)
New Revision: 2398
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.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:
#1891 : UI de flottille/m?\195?\169tiers pratiqu?\195?\169s
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,284 @@
+<!--
+/* *##%
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+ -->
+<fr.ifremer.isisfish.ui.input.InputContentUI>
+
+ <!-- bean property -->
+ <fr.ifremer.isisfish.entities.SetOfVesselsImpl id='bean' javaBean='null'/>
+ <fr.ifremer.isisfish.entities.EffortDescriptionImpl id='effortDescription' javaBean='null'/>
+
+ <script><![CDATA[
+import java.util.ArrayList;
+import fr.ifremer.isisfish.entities.EffortDescription;
+import fr.ifremer.isisfish.entities.EffortDescriptionImpl;
+import fr.ifremer.isisfish.entities.SetOfVesselsImpl;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import fr.ifremer.isisfish.types.TimeUnit;
+import fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListModel;
+import fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListRenderer;
+
+addPropertyChangeListener("effortDescription", new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getOldValue() != null || evt.getNewValue() == null) {
+ fieldEffortDescriptionFishingOperation.setText("");
+ fieldEffortDescriptionFishingOperationDuration.setText("");
+ fieldEffortDescriptionGearsNumberPerOperation.setText("");
+ fieldEffortDescriptionCrewSize.setText("");
+ fieldEffortDescriptionUnitCostOfFishing.setText("");
+ fieldEffortDescriptionFixedCrewSalary.setText("");
+ fieldEffortDescriptionCrewFoodCost.setText("");
+ fieldEffortDescriptionCrewShareRate.setText("");
+ fieldEffortDescriptionRepairAndMaintenanceGearCost.setText("");
+ fieldEffortDescriptionLandingCosts.setText("");
+ fieldEffortDescriptionOtherRunningCost.setText("");
+ }
+ if (evt.getNewValue() != null) {
+
+ }
+ }
+});
+
+ at Override
+public void refresh() {
+ SetOfVessels setOfVessels = getVerifier().getEntity(SetOfVessels.class);
+
+ // twice event for jaxx bindings detection
+ setBean(null);
+ setBean((SetOfVesselsImpl) setOfVessels);
+
+ EffortDescriptionListModel model = (EffortDescriptionListModel)fieldEffortDescriptionEffortDescriptionList.getModel();
+ if (getBean() != null) {
+ java.util.List<EffortDescription> effortDescriptions = new ArrayList<EffortDescription>(getBean().getPossibleMetiers());
+ model.setEffortDescriptions(effortDescriptions);
+ }
+ else {
+ model.setEffortDescriptions(null);
+ }
+}
+
+ at Override
+public void setActionButtons() {
+ getVerifier().setSaveButton(save);
+ getVerifier().setCancelButton(cancel);
+}
+
+protected void effortDescriptionSelectionChanged() {
+ EffortDescriptionImpl selectedEffort = (EffortDescriptionImpl)fieldEffortDescriptionEffortDescriptionList.getSelectedValue();
+ setEffortDescription(selectedEffort);
+
+ if (getEffortDescription() != null) {
+ getVerifier().addCurrentEntity(getEffortDescription());
+
+ /* NumberEditor is not working
+ fieldEffortDescriptionFishingOperation.init();
+ fieldEffortDescriptionGearsNumberPerOperation.init();
+ fieldEffortDescriptionCrewSize.init();
+ fieldEffortDescriptionUnitCostOfFishing.init();
+ fieldEffortDescriptionFixedCrewSalary.init();
+ fieldEffortDescriptionCrewFoodCost.init();
+ fieldEffortDescriptionCrewShareRate.init();
+ fieldEffortDescriptionRepairAndMaintenanceGearCost.init();
+ fieldEffortDescriptionLandingCosts.init();
+ fieldEffortDescriptionOtherRunningCost.init();*/
+ }
+}
+ ]]>
+ </script>
+ <Table>
+ <row>
+ <cell rows='3' fill='both' weightx='0.4' weighty='1.0'>
+ <JScrollPane>
+ <JList id="fieldEffortDescriptionEffortDescriptionList" selectionMode="{javax.swing.ListSelectionModel.SINGLE_SELECTION}"
+ onValueChanged='effortDescriptionSelectionChanged()'
+ model='{new EffortDescriptionListModel()}' cellRenderer='{new EffortDescriptionListRenderer()}'
+ enabled='{isActif()}' decorator='boxed' />
+ </JScrollPane>
+ </cell>
+ <cell columns='2' fill='both' weightx='1.0'>
+ <Table border='{BorderFactory.createTitledBorder(_("isisfish.effortDescription.effortTitle"))}'>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.effortDescription.fishingOperation" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <!--NumberEditor id='fieldEffortDescriptionFishingOperation' constructorParams='this'
+ bean='{getEffortDescription()}' property='fishingOperation'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"FishingOperation"'/-->
+ <JFormattedTextField id="fieldEffortDescriptionFishingOperation" text='{getEffortDescription().getFishingOperation()}'
+ onKeyReleased='getEffortDescription().setFishingOperation(Integer.parseInt(fieldEffortDescriptionFishingOperation.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperation"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldEffortDescriptionFishingOperationDuration"
+ text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}'
+ toolTipText="isisfish.effortDescription.fishingOperationDuration.tooltip" onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.effortDescription.gearsNumberPerOperation" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <!--NumberEditor id='fieldEffortDescriptionGearsNumberPerOperation' constructorParams='this'
+ bean='{getEffortDescription()}' property='gearsNumberPerOperation'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"GearsNumberPerOperation"'/-->
+ <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" text='{getEffortDescription().getGearsNumberPerOperation()}'
+ onKeyReleased='getEffortDescription().setGearsNumberPerOperation(Integer.parseInt(fieldEffortDescriptionGearsNumberPerOperation.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"GearsNumberPerOperation"'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weighty='1.0'>
+ <Table anchor='north' fill='both' weighty='1.0' border='{BorderFactory.createTitledBorder(_("isisfish.effortDescription.economicTitle"))}'>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.crewSize" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionCrewSize' constructorParams='this'
+ bean='{getEffortDescription()}' property='crewSize'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"CrewSize"'/-->
+ <JTextField id="fieldEffortDescriptionCrewSize" text='{getEffortDescription().getCrewSize()}'
+ onKeyReleased='getEffortDescription().setCrewSize(Integer.parseInt(fieldEffortDescriptionCrewSize.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewSize"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.unitCostOfFishing" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionUnitCostOfFishing' constructorParams='this'
+ bean='{getEffortDescription()}' property='unitCostOfFishing'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"UnitCostOfFishing"'/-->
+ <JTextField id="fieldEffortDescriptionUnitCostOfFishing" text='{getEffortDescription().getUnitCostOfFishing()}'
+ onKeyReleased='getEffortDescription().setUnitCostOfFishing(Double.parseDouble(fieldEffortDescriptionUnitCostOfFishing.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"UnitCostOfFishing"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.fixedCrewSalary" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionFixedCrewSalary' constructorParams='this'
+ bean='{getEffortDescription()}' property='fixedCrewSalary'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"FixedCrewSalary"'/-->
+ <JTextField id="fieldEffortDescriptionFixedCrewSalary" text='{getEffortDescription().getFixedCrewSalary()}'
+ onKeyReleased='getEffortDescription().setFixedCrewSalary(Double.parseDouble(fieldEffortDescriptionFixedCrewSalary.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FixedCrewSalary"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.crewFoodCost" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionCrewFoodCost' constructorParams='this'
+ bean='{getEffortDescription()}' property='crewFoodCost'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"CrewFoodCost"'/-->
+ <JTextField id="fieldEffortDescriptionCrewFoodCost" text='{getEffortDescription().getCrewFoodCost()}'
+ onKeyReleased='getEffortDescription().setCrewFoodCost(Double.parseDouble(fieldEffortDescriptionCrewFoodCost.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewFoodCost"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.crewShareRate" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionCrewShareRate' constructorParams='this'
+ bean='{getEffortDescription()}' property='crewShareRate'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"CrewShareRate"'/-->
+ <JTextField id="fieldEffortDescriptionCrewShareRate" text='{getEffortDescription().getCrewShareRate()}'
+ onKeyReleased='getEffortDescription().setCrewShareRate(Double.parseDouble(fieldEffortDescriptionCrewShareRate.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewShareRate"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.repairAndMaintenanceGearCost" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionRepairAndMaintenanceGearCost' constructorParams='this'
+ bean='{getEffortDescription()}' property='repairAndMaintenanceGearCost'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}'
+ _method='"RepairAndMaintenanceGearCost"' useSign='true'/-->
+ <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" text='{getEffortDescription().getRepairAndMaintenanceGearCost()}'
+ onKeyReleased='getEffortDescription().setRepairAndMaintenanceGearCost(Double.parseDouble(fieldEffortDescriptionRepairAndMaintenanceGearCost.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"RepairAndMaintenanceGearCost"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east' fill='none' weighty='0.0'>
+ <JLabel text="isisfish.effortDescription.landingCosts" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0' weighty='0.0'>
+ <!--NumberEditor id='fieldEffortDescriptionLandingCosts' constructorParams='this'
+ bean='{getEffortDescription()}' property='landingCosts'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"LandingCosts"'/-->
+ <JTextField id="fieldEffortDescriptionLandingCosts" text='{getEffortDescription().getLandingCosts()}'
+ onKeyReleased='getEffortDescription().setLandingCosts(Double.parseDouble(fieldEffortDescriptionLandingCosts.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"LandingCosts"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='northeast' fill='none' weighty='1.0'>
+ <JLabel text="isisfish.effortDescription.otherRunningCost" enabled='{isActif()}'/>
+ </cell>
+ <cell anchor='north' fill='horizontal' weightx='1.0' weighty='1.0'>
+ <!--NumberEditor id='fieldEffortDescriptionOtherRunningCost' constructorParams='this'
+ bean='{getEffortDescription()}' property='otherRunningCost'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{EffortDescriptionImpl.class}' _method='"OtherRunningCost"'/-->
+ <JTextField id="fieldEffortDescriptionOtherRunningCost" text='{getEffortDescription().getOtherRunningCost()}'
+ onKeyReleased='getEffortDescription().setOtherRunningCost(Double.parseDouble(fieldEffortDescriptionOtherRunningCost.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"OtherRunningCost"'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.3'>
+ <JButton id='save' decorator='boxed'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.3'>
+ <JButton id='cancel' decorator='boxed'/>
+ </cell>
+ </row>
+ </Table>
+</fr.ifremer.isisfish.ui.input.InputContentUI>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-06-17 08:47:48 UTC (rev 2397)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-06-17 13:00:12 UTC (rev 2398)
@@ -22,70 +22,42 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.SetOfVesselsImpl id='bean' javaBean='null'/>
- <fr.ifremer.isisfish.entities.EffortDescriptionImpl id='effortDescription' javaBean='null'/>
-
- <script><![CDATA[
+ <script><![CDATA[
+import java.util.ArrayList;
import fr.ifremer.isisfish.entities.EffortDescription;
import fr.ifremer.isisfish.entities.EffortDescriptionImpl;
import fr.ifremer.isisfish.entities.SetOfVesselsImpl;
import fr.ifremer.isisfish.entities.SetOfVessels;
import fr.ifremer.isisfish.entities.Metier;
-import fr.ifremer.isisfish.types.TimeUnit;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.ListSelectionEvent;
-import jaxx.runtime.swing.Item;
+import fr.ifremer.isisfish.ui.input.setofvessels.MetierListModel;
+import fr.ifremer.isisfish.ui.input.setofvessels.MetierListRenderer;
+import fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListModel;
+import fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListRenderer;
-addPropertyChangeListener("effortDescription", new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getOldValue() != null || evt.getNewValue() == null) {
- fieldEffortDescriptionFishingOperation.setText("");
- fieldEffortDescriptionFishingOperationDuration.setText("");
- fieldEffortDescriptionGearsNumberPerOperation.setText("");
- fieldEffortDescriptionCrewSize.setText("");
- fieldEffortDescriptionUnitCostOfFishing.setText("");
- fieldEffortDescriptionFixedCrewSalary.setText("");
- fieldEffortDescriptionCrewFoodCost.setText("");
- fieldEffortDescriptionCrewShareRate.setText("");
- fieldEffortDescriptionRepairAndMaintenanceGearCost.setText("");
- fieldEffortDescriptionLandingCosts.setText("");
- fieldEffortDescriptionOtherRunningCost.setText("");
- }
- if (evt.getNewValue() != null) {
+/**
+ * Get input action from context.
+ */
+protected InputAction getInputAction() {
+ return getContextValue(InputAction.class);
+}
- }
- }
-});
-
-fieldEffortDescriptionMetierList.addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- // active le bouton seulement si l'interface est active
- // dans le cas de sensitivity par exemple
- if(isActif()) {
- buttonEffortDescriptionAdd.setEnabled(fieldEffortDescriptionMetierList.getSelectedIndex() != -1);
- }
- }
-});
-
-fieldEffortDescriptionEffortDescriptionList.addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- // active le bouton seulement si l'interface est active
- // dans le cas de sensitivity par exemple
- if(isActif()) {
- removeEffortDescriptionButton.setEnabled(fieldEffortDescriptionEffortDescriptionList.getSelectedIndex() != -1);
- }
- }
-});
-
@Override
public void refresh() {
SetOfVessels setOfVessels = getVerifier().getEntity(SetOfVessels.class);
+
+ // twice event for jaxx bindings detection
+ setBean(null);
setBean((SetOfVesselsImpl) setOfVessels);
- if (getBean() != null){
- if (getRegion().getMetier() != null) {
- fieldEffortDescriptionMetierList.fillList(getRegion().getMetier(), (Object)null);
- }
- setEffortDescriptionEffortDescriptionList();
+
+ // fill available metier list
+ MetierListModel metierModel = (MetierListModel)fieldEffortDescriptionMetierList.getModel();
+ if (getBean() != null) {
+ metierModel.setMetiers(getRegion().getMetier());
}
+ else {
+ metierModel.setMetiers(null);
+ }
+ setEffortDescriptionEffortDescriptionList();
}
@Override
@@ -94,250 +66,88 @@
getVerifier().setCancelButton(cancel);
}
+protected void onFieldEffortDescriptionMetierListValueChanged() {
+ // active le bouton seulement si l'interface est active
+ // dans le cas de sensitivity par exemple
+ if (isActif()) {
+ buttonEffortDescriptionAdd.setEnabled(fieldEffortDescriptionMetierList.getSelectedIndex() != -1);
+ }
+}
+
+protected void onFieldEffortDescriptionEffortDescriptionListValueChanged() {
+ // active le bouton seulement si l'interface est active
+ // dans le cas de sensitivity par exemple
+ if (isActif()) {
+ removeEffortDescriptionButton.setEnabled(fieldEffortDescriptionEffortDescriptionList.getSelectedIndex() != -1);
+ }
+}
+
protected void setEffortDescriptionEffortDescriptionList() {
- if (getBean().getPossibleMetiers() != null){
- java.util.List<Item> items = new ArrayList<Item>();
- for (EffortDescription e : getBean().getPossibleMetiers()){
- items.add(new Item(e.toString(), e.getPossibleMetiers().getName(), e, false));
- }
- fieldEffortDescriptionEffortDescriptionList.setItems(items);
+ EffortDescriptionListModel model = (EffortDescriptionListModel)fieldEffortDescriptionEffortDescriptionList.getModel();
+ if (getBean() != null) {
+ java.util.List<EffortDescription> effortDescriptions = new ArrayList<EffortDescription>(getBean().getPossibleMetiers());
+ model.setEffortDescriptions(effortDescriptions);
}
+ else {
+ model.setEffortDescriptions(null);
+ }
}
-protected void addEffortDescription() {
- Object value = fieldEffortDescriptionMetierList.getSelectedValue();
- if (value != null){
- Metier m = (Metier)value;
- getContextValue(InputAction.class).addEffortDescription(getBean(), m);
- setEffortDescriptionEffortDescriptionList();
+
+protected void addEffortDescriptions() {
+ Object[] selectedValues = (Object[])fieldEffortDescriptionMetierList.getSelectedValues();
+ for (Object selectedValue : selectedValues) {
+ Metier selectedMetier = (Metier)selectedValue;
+ getInputAction().addEffortDescription(getBean(), selectedMetier);
}
+ setEffortDescriptionEffortDescriptionList();
}
-protected void removeEffortDescription() {
- Object value = fieldEffortDescriptionEffortDescriptionList.getSelectedValue();
- if (value != null) {
- EffortDescription e = (EffortDescription)value;
- getContextValue(InputAction.class).removeEffortDescription(getBean(), e);
- setEffortDescriptionEffortDescriptionList();
+protected void removeEffortDescriptions() {
+ Object[] selectedValues = (Object[])fieldEffortDescriptionEffortDescriptionList.getSelectedValues();
+ for (Object selectedValue : selectedValues) {
+ EffortDescription selectedEffortDescription = (EffortDescription)selectedValue;
+ getInputAction().removeEffortDescription(getBean(), selectedEffortDescription);
}
+ setEffortDescriptionEffortDescriptionList();
+ fieldEffortDescriptionEffortDescriptionList.clearSelection(); // bug selected index still exists
}
-protected void effortDescriptionChanged() {
- EffortDescriptionImpl selectedEffort = (EffortDescriptionImpl)fieldEffortDescriptionEffortDescriptionList.getSelectedValue();
- setEffortDescription(selectedEffort);
-
- if (getEffortDescription() != null) {
- getVerifier().addCurrentEntity(getEffortDescription());
-
- /* NumberEditor is not working
- fieldEffortDescriptionFishingOperation.init();
- fieldEffortDescriptionGearsNumberPerOperation.init();
- fieldEffortDescriptionCrewSize.init();
- fieldEffortDescriptionUnitCostOfFishing.init();
- fieldEffortDescriptionFixedCrewSalary.init();
- fieldEffortDescriptionCrewFoodCost.init();
- fieldEffortDescriptionCrewShareRate.init();
- fieldEffortDescriptionRepairAndMaintenanceGearCost.init();
- fieldEffortDescriptionLandingCosts.init();
- fieldEffortDescriptionOtherRunningCost.init();*/
- }
-}
]]>
</script>
- <Table id='body'>
+ <Table>
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
<JScrollPane>
- <JList id="fieldEffortDescriptionMetierList" selectionMode="0" enabled='{isActif()}' decorator='boxed' />
+ <JList id="fieldEffortDescriptionMetierList" selectionMode="{javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ model='{new MetierListModel()}' cellRenderer='{new MetierListRenderer()}'
+ onValueChanged='onFieldEffortDescriptionMetierListValueChanged()' enabled='{isActif()}' decorator='boxed' />
</JScrollPane>
</cell>
</row>
<row>
- <cell fill='both' weightx='0.5'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JButton id="buttonEffortDescriptionAdd" text="isisfish.common.add" onActionPerformed='addEffortDescription()' enabled='false'/>
- </cell>
- </row>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <JScrollPane>
- <JList id="fieldEffortDescriptionEffortDescriptionList" selectionMode="0" onValueChanged='effortDescriptionChanged()' enabled='{isActif()}'/>
- </JScrollPane>
- </cell>
- </row>
- </Table>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id="buttonEffortDescriptionAdd" text="isisfish.common.add" onActionPerformed='addEffortDescriptions()' enabled='false'
+ decorator='boxed' />
</cell>
- <cell fill='both' weightx='0.5'>
- <Table>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.fishingOperation" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionFishingOperation' constructorParams='this'
- bean='{getEffortDescription()}' property='fishingOperation'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"FishingOperation"'/-->
- <JFormattedTextField id="fieldEffortDescriptionFishingOperation" text='{getEffortDescription().getFishingOperation()}'
- onKeyReleased='getEffortDescription().setFishingOperation(Integer.parseInt(fieldEffortDescriptionFishingOperation.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperation"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFishingOperationDuration"
- text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}'
- toolTipText="in hour" onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FishingOperationDuration"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.gearsNumberPerOperation" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionGearsNumberPerOperation' constructorParams='this'
- bean='{getEffortDescription()}' property='gearsNumberPerOperation'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"GearsNumberPerOperation"'/-->
- <JTextField id="fieldEffortDescriptionGearsNumberPerOperation" text='{getEffortDescription().getGearsNumberPerOperation()}'
- onKeyReleased='getEffortDescription().setGearsNumberPerOperation(Integer.parseInt(fieldEffortDescriptionGearsNumberPerOperation.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"GearsNumberPerOperation"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.crewSize" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionCrewSize' constructorParams='this'
- bean='{getEffortDescription()}' property='crewSize'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"CrewSize"'/-->
- <JTextField id="fieldEffortDescriptionCrewSize" text='{getEffortDescription().getCrewSize()}'
- onKeyReleased='getEffortDescription().setCrewSize(Integer.parseInt(fieldEffortDescriptionCrewSize.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewSize"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.unitCostOfFishing" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionUnitCostOfFishing' constructorParams='this'
- bean='{getEffortDescription()}' property='unitCostOfFishing'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"UnitCostOfFishing"'/-->
- <JTextField id="fieldEffortDescriptionUnitCostOfFishing" text='{getEffortDescription().getUnitCostOfFishing()}'
- onKeyReleased='getEffortDescription().setUnitCostOfFishing(Double.parseDouble(fieldEffortDescriptionUnitCostOfFishing.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"UnitCostOfFishing"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.fixedCrewSalary" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionFixedCrewSalary' constructorParams='this'
- bean='{getEffortDescription()}' property='fixedCrewSalary'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"FixedCrewSalary"'/-->
- <JTextField id="fieldEffortDescriptionFixedCrewSalary" text='{getEffortDescription().getFixedCrewSalary()}'
- onKeyReleased='getEffortDescription().setFixedCrewSalary(Double.parseDouble(fieldEffortDescriptionFixedCrewSalary.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"FixedCrewSalary"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.crewFoodCost" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionCrewFoodCost' constructorParams='this'
- bean='{getEffortDescription()}' property='crewFoodCost'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"CrewFoodCost"'/-->
- <JTextField id="fieldEffortDescriptionCrewFoodCost" text='{getEffortDescription().getCrewFoodCost()}'
- onKeyReleased='getEffortDescription().setCrewFoodCost(Double.parseDouble(fieldEffortDescriptionCrewFoodCost.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewFoodCost"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.crewShareRate" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionCrewShareRate' constructorParams='this'
- bean='{getEffortDescription()}' property='crewShareRate'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"CrewShareRate"'/-->
- <JTextField id="fieldEffortDescriptionCrewShareRate" text='{getEffortDescription().getCrewShareRate()}'
- onKeyReleased='getEffortDescription().setCrewShareRate(Double.parseDouble(fieldEffortDescriptionCrewShareRate.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"CrewShareRate"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.repairAndMaintenanceGearCost" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionRepairAndMaintenanceGearCost' constructorParams='this'
- bean='{getEffortDescription()}' property='repairAndMaintenanceGearCost'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}'
- _method='"RepairAndMaintenanceGearCost"' useSign='true'/-->
- <JTextField id="fieldEffortDescriptionRepairAndMaintenanceGearCost" text='{getEffortDescription().getRepairAndMaintenanceGearCost()}'
- onKeyReleased='getEffortDescription().setRepairAndMaintenanceGearCost(Double.parseDouble(fieldEffortDescriptionRepairAndMaintenanceGearCost.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"RepairAndMaintenanceGearCost"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.landingCosts" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionLandingCosts' constructorParams='this'
- bean='{getEffortDescription()}' property='landingCosts'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"LandingCosts"'/-->
- <JTextField id="fieldEffortDescriptionLandingCosts" text='{getEffortDescription().getLandingCosts()}'
- onKeyReleased='getEffortDescription().setLandingCosts(Double.parseDouble(fieldEffortDescriptionLandingCosts.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"LandingCosts"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.effortDescription.otherRunningCost" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldEffortDescriptionOtherRunningCost' constructorParams='this'
- bean='{getEffortDescription()}' property='otherRunningCost'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{EffortDescriptionImpl.class}' _method='"OtherRunningCost"'/-->
- <JTextField id="fieldEffortDescriptionOtherRunningCost" text='{getEffortDescription().getOtherRunningCost()}'
- onKeyReleased='getEffortDescription().setOtherRunningCost(Double.parseDouble(fieldEffortDescriptionOtherRunningCost.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{EffortDescriptionImpl.class}' _method='"OtherRunningCost"'/>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='0.3'>
- <JButton id='save' decorator='boxed'/>
- </cell>
- <cell fill='horizontal' weightx='0.3'>
- <JButton id='cancel' decorator='boxed'/>
- </cell>
- <cell fill='horizontal' weightx='0.3'>
- <JButton id='removeEffortDescriptionButton' text="isisfish.common.remove" onActionPerformed='removeEffortDescription()' enabled='false' decorator='boxed'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- </Table>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id='removeEffortDescriptionButton' text="isisfish.common.remove" onActionPerformed='removeEffortDescriptions()'
+ enabled='false' decorator='boxed' />
</cell>
</row>
+ <row>
+ <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane>
+ <JList id="fieldEffortDescriptionEffortDescriptionList" selectionMode="{javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"
+ model='{new EffortDescriptionListModel()}' cellRenderer='{new EffortDescriptionListRenderer()}'
+ onValueChanged='onFieldEffortDescriptionEffortDescriptionListValueChanged()' enabled='{isActif()}' decorator='boxed' />
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id='save' decorator='boxed'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id='cancel' decorator='boxed'/>
+ </cell>
+ </row>
</Table>
</fr.ifremer.isisfish.ui.input.InputContentUI>
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx (from rev 2393, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,183 @@
+<!--
+/* *##%
+ * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+ -->
+
+<fr.ifremer.isisfish.ui.input.InputContentUI>
+
+ <!-- bean property -->
+ <fr.ifremer.isisfish.entities.SetOfVesselsImpl id='bean' javaBean='null'/>
+
+ <script><![CDATA[
+
+import org.codelutin.topia.TopiaException;
+import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.Equation;
+import fr.ifremer.isisfish.entities.VesselType;
+import fr.ifremer.isisfish.entities.Formule;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import jaxx.runtime.swing.editor.NumberEditor;
+import fr.ifremer.isisfish.entities.SetOfVesselsImpl;
+
+boolean init = false;
+
+ at Override
+public void refresh() {
+ SetOfVessels setOfVessels = (SetOfVessels)getVerifier().getEntity(SetOfVessels.class);
+
+ // add null before, for second to be considered as a changed event
+ // otherwize, setBean has no effect
+ setBean(null);
+ setBean((SetOfVesselsImpl) setOfVessels);
+
+ if (getBean() != null) {
+ init = true;
+ jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsPort,getRegion().getPort(), getBean().getPort(), true);
+ jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsVesselType,getRegion().getVesselType(), getBean().getVesselType(), true);
+ init=false;
+ getVerifier().addCurrentPanel(technicalEfficiency);
+
+ // NumberEditor is not working
+ //fieldSetOfVesselsNumberOfVessels.init();
+ //fieldSetOfVesselsFixedCosts.init();
+ }
+}
+
+ at Override
+public void setActionButtons() {
+ getVerifier().setSaveButton(save);
+ getVerifier().setCancelButton(cancel);
+ getVerifier().setNewButton(create, "SetOfVessels");
+ getVerifier().setDeleteButton(remove);
+}
+
+protected void portChanged() {
+ if (!init) {
+ getBean().setPort((Port)fieldSetOfVesselsPort.getSelectedItem());
+ }
+}
+protected void vesselTypeChanged() {
+ if (!init) {
+ getBean().setVesselType((VesselType)fieldSetOfVesselsVesselType.getSelectedItem());
+ }
+}
+ ]]>
+ </script>
+ <Table id='body'>
+ <row>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
+ <Table>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.name" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JTextField id="fieldSetOfVesselsName" text='{getBean().getName()}' onKeyReleased='getBean().setName(fieldSetOfVesselsName.getText())' enabled='{isActif()}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.common.port" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='portChanged()' enabled='{isActif()}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.vesselType" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='vesselTypeChanged()' enabled='{isActif()}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.numberOfVessels" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <!--NumberEditor id='fieldSetOfVesselsNumberOfVessels' constructorParams='this'
+ bean='{getBean()}' property='numberOfVessels'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{SetOfVesselsImpl.class}' _method='"NumberOfVessels"'/-->
+ <JTextField id="fieldSetOfVesselsNumberOfVessels" text='{getBean().getNumberOfVessels()}'
+ onKeyReleased='getBean().setNumberOfVessels(Integer.parseInt(fieldSetOfVesselsNumberOfVessels.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"NumberOfVessels"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.fixedCosts" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <!--NumberEditor id='fieldSetOfVesselsFixedCosts' constructorParams='this'
+ bean='{getBean()}' property='fixedCosts'
+ enabled='{isActif()}' decorator='boxed' useSign='true'
+ _bean='{SetOfVesselsImpl.class}' _method='"FixedCosts"'/-->
+ <JTextField id="fieldSetOfVesselsFixedCosts" text='{getBean().getFixedCosts()}'
+ onKeyReleased='getBean().setFixedCosts(Double.parseDouble(fieldSetOfVesselsFixedCosts.getText()))'
+ enabled='{isActif()}' decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"FixedCosts"'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weightx='1.0' weighty='0.3'>
+ <InputOneEquationUI id='technicalEfficiency' constructorParams='this'
+ lblText='{_("isisfish.setOfVessels.technicalEfficiency")}'
+ bean='{getBean()}' nameEquation='TechnicalEfficiency' methodGet='TechnicalEfficiencyEquation' methodSet='EquationTechnicalEfficiency'
+ clazz='{fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation.class}'
+ decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"TechnicalEfficiencyEquation"'/>
+ </cell>
+ </row>
+ <row>
+ <cell anchor='east'>
+ <JLabel text="isisfish.setOfVessels.comments" enabled='{isActif()}'/>
+ </cell>
+ <cell fill='both' weightx='1.0' weighty='0.3'>
+ <JScrollPane>
+ <JTextArea id="fieldSetOfVesselsComment" text='{jaxx.runtime.SwingUtil.getStringValue(getBean().getComment())}'
+ onKeyReleased='getBean().setComment(fieldSetOfVesselsComment.getText())' enabled='{isActif()}' decorator='boxed'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <Table>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton id='save' decorator='boxed'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton id='cancel' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton id='create' decorator='boxed'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JButton id='remove' decorator='boxed'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ </Table>
+</fr.ifremer.isisfish.ui.input.InputContentUI>
Deleted: 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-06-17 08:47:48 UTC (rev 2397)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsTabsUI.jaxx 2009-06-17 13:00:12 UTC (rev 2398)
@@ -1,183 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005 - 2009 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
- -->
-
-<fr.ifremer.isisfish.ui.input.InputContentUI>
-
- <!-- bean property -->
- <fr.ifremer.isisfish.entities.SetOfVesselsImpl id='bean' javaBean='null'/>
-
- <script><![CDATA[
-
-import org.codelutin.topia.TopiaException;
-import fr.ifremer.isisfish.entities.Port;
-import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.VesselType;
-import fr.ifremer.isisfish.entities.Formule;
-import fr.ifremer.isisfish.entities.SetOfVessels;
-import jaxx.runtime.swing.editor.NumberEditor;
-import fr.ifremer.isisfish.entities.SetOfVesselsImpl;
-
-boolean init = false;
-
- at Override
-public void refresh() {
- SetOfVessels setOfVessels = (SetOfVessels)getVerifier().getEntity(SetOfVessels.class);
-
- // add null before, for second to be considered as a changed event
- // otherwize, setBean has no effect
- setBean(null);
- setBean((SetOfVesselsImpl) setOfVessels);
-
- if (getBean() != null) {
- init = true;
- jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsPort,getRegion().getPort(), getBean().getPort(), true);
- jaxx.runtime.SwingUtil.fillComboBox(fieldSetOfVesselsVesselType,getRegion().getVesselType(), getBean().getVesselType(), true);
- init=false;
- getVerifier().addCurrentPanel(technicalEfficiency);
-
- // NumberEditor is not working
- //fieldSetOfVesselsNumberOfVessels.init();
- //fieldSetOfVesselsFixedCosts.init();
- }
-}
-
- at Override
-public void setActionButtons() {
- getVerifier().setSaveButton(save);
- getVerifier().setCancelButton(cancel);
- getVerifier().setNewButton(create, "SetOfVessels");
- getVerifier().setDeleteButton(remove);
-}
-
-protected void portChanged() {
- if (!init) {
- getBean().setPort((Port)fieldSetOfVesselsPort.getSelectedItem());
- }
-}
-protected void vesselTypeChanged() {
- if (!init) {
- getBean().setVesselType((VesselType)fieldSetOfVesselsVesselType.getSelectedItem());
- }
-}
- ]]>
- </script>
- <Table id='body'>
- <row>
- <cell fill='both' weightx='1.0' weighty='1.0'>
- <Table>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.name" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldSetOfVesselsName" text='{getBean().getName()}' onKeyReleased='getBean().setName(fieldSetOfVesselsName.getText())' enabled='{isActif()}' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.common.port" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSetOfVesselsPort" onActionPerformed='portChanged()' enabled='{isActif()}' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.vesselType" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSetOfVesselsVesselType" onActionPerformed='vesselTypeChanged()' enabled='{isActif()}' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.numberOfVessels" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldSetOfVesselsNumberOfVessels' constructorParams='this'
- bean='{getBean()}' property='numberOfVessels'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{SetOfVesselsImpl.class}' _method='"NumberOfVessels"'/-->
- <JTextField id="fieldSetOfVesselsNumberOfVessels" text='{getBean().getNumberOfVessels()}'
- onKeyReleased='getBean().setNumberOfVessels(Integer.parseInt(fieldSetOfVesselsNumberOfVessels.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"NumberOfVessels"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.fixedCosts" enabled='{isActif()}'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <!--NumberEditor id='fieldSetOfVesselsFixedCosts' constructorParams='this'
- bean='{getBean()}' property='fixedCosts'
- enabled='{isActif()}' decorator='boxed' useSign='true'
- _bean='{SetOfVesselsImpl.class}' _method='"FixedCosts"'/-->
- <JTextField id="fieldSetOfVesselsFixedCosts" text='{getBean().getFixedCosts()}'
- onKeyReleased='getBean().setFixedCosts(Double.parseDouble(fieldSetOfVesselsFixedCosts.getText()))'
- enabled='{isActif()}' decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"FixedCosts"'/>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='both' weightx='1.0' weighty='0.3'>
- <InputOneEquationUI id='technicalEfficiency' constructorParams='this'
- lblText='{_("isisfish.setOfVessels.technicalEfficiency")}'
- bean='{getBean()}' nameEquation='TechnicalEfficiency' methodGet='TechnicalEfficiencyEquation' methodSet='EquationTechnicalEfficiency'
- clazz='{fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation.class}'
- decorator='boxed' _bean='{SetOfVesselsImpl.class}' _method='"TechnicalEfficiencyEquation"'/>
- </cell>
- </row>
- <row>
- <cell anchor='east'>
- <JLabel text="isisfish.setOfVessels.comments" enabled='{isActif()}'/>
- </cell>
- <cell fill='both' weightx='1.0' weighty='0.3'>
- <JScrollPane>
- <JTextArea id="fieldSetOfVesselsComment" text='{jaxx.runtime.SwingUtil.getStringValue(getBean().getComment())}'
- onKeyReleased='getBean().setComment(fieldSetOfVesselsComment.getText())' enabled='{isActif()}' decorator='boxed'/>
- </JScrollPane>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <Table>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JButton id='save' decorator='boxed'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JButton id='cancel' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='1.0'>
- <JButton id='create' decorator='boxed'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JButton id='remove' decorator='boxed'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- </Table>
-</fr.ifremer.isisfish.ui.input.InputContentUI>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2009-06-17 08:47:48 UTC (rev 2397)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsUI.jaxx 2009-06-17 13:00:12 UTC (rev 2398)
@@ -31,7 +31,7 @@
// (depends on sensitivity can't be done on constructor)
installChangeListener(setOfVesselsTab);
- getVerifier().addCurrentPanel(setOfVesselsTabsUI, effortDescriptionUI);
+ getVerifier().addCurrentPanel(setOfVesselsBasicsUI, effortDescriptionUI, effortParametersUI);
}
@Override
@@ -41,13 +41,16 @@
}
]]></script>
<JPanel layout='{new BorderLayout()}'>
- <JTabbedPane id="setOfVesselsTab" name="SetOfVessels" constraints='BorderLayout.CENTER'>
+ <JTabbedPane id="setOfVesselsTab" constraints='BorderLayout.CENTER'>
<tab title='{_("isisfish.setOfVessels.title")}'>
- <SetOfVesselsTabsUI id='setOfVesselsTabsUI' constructorParams='this'/>
+ <SetOfVesselsBasicsUI id='setOfVesselsBasicsUI' constructorParams='this'/>
</tab>
<tab title='{_("isisfish.effortDescription.title")}'>
<EffortDescriptionUI id='effortDescriptionUI' constructorParams='this'/>
</tab>
+ <tab title='{_("isisfish.effortDescription.parametersTitle")}'>
+ <EffortDescriptionParametersUI id='effortParametersUI' constructorParams='this'/>
+ </tab>
</JTabbedPane>
</JPanel>
</fr.ifremer.isisfish.ui.input.InputContentUI>
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,100 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.setofvessels;
+
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+
+import fr.ifremer.isisfish.entities.EffortDescription;
+
+/**
+ * Model pour la liste des metiers de l'interface SetOfVessels.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EffortDescriptionListModel extends DefaultListModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -2715181950778932871L;
+
+ /** Listes des EffortDescription */
+ protected List<EffortDescription> effortDescriptions;
+
+ /**
+ * Empty constructor.
+ */
+ public EffortDescriptionListModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with effortDescriptions list.
+ *
+ * @param effortDescriptions liste des effortDescriptions
+ */
+ public EffortDescriptionListModel(List<EffortDescription> effortDescriptions) {
+ super();
+ setEffortDescriptions(effortDescriptions);
+ }
+
+ /**
+ * Get effortDescriptions lists.
+ *
+ * @return the effortDescriptions
+ */
+ public List<EffortDescription> getEffortDescriptions() {
+ return effortDescriptions;
+ }
+
+ /**
+ * Set effortDescriptions list.
+ *
+ * @param effortDescriptions the effortDescriptions list to set
+ */
+ public void setEffortDescriptions(List<EffortDescription> effortDescriptions) {
+ this.effortDescriptions = effortDescriptions;
+ fireContentsChanged(this, 0, getSize());
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return effortDescriptions.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (effortDescriptions != null) {
+ size = effortDescriptions.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java
___________________________________________________________________
Name: svn:keywords
+ Date Author Revision
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,60 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.setofvessels;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+import fr.ifremer.isisfish.entities.EffortDescription;
+
+/**
+ * Renderer pour liste des {@link EffortDescription}.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class EffortDescriptionListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1113492654780402245L;
+
+ /*
+ * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
+ */
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ // this must be used to have alterned highlight rows and default
+ // selection color
+ JLabel c = (JLabel) super.getListCellRendererComponent(list, value,
+ index, isSelected, cellHasFocus);
+
+ EffortDescription effort = (EffortDescription) value;
+ c.setText(effort.getPossibleMetiers().getName());
+
+ return c;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java
___________________________________________________________________
Name: svn:keywords
+ Date Author Revision
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,100 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.setofvessels;
+
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+
+import fr.ifremer.isisfish.entities.Metier;
+
+/**
+ * Model pour la liste des metiers de l'interface SetOfVessels.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MetierListModel extends DefaultListModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -2715181950778932871L;
+
+ /** Listes des metiers */
+ protected List<Metier> metiers;
+
+ /**
+ * Empty constructor.
+ */
+ public MetierListModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with metiers list.
+ *
+ * @param metiers liste des metiers
+ */
+ public MetierListModel(List<Metier> metiers) {
+ super();
+ setMetiers(metiers);
+ }
+
+ /**
+ * Get metiers list.
+ *
+ * @return the metiers list
+ */
+ public List<Metier> getMetiers() {
+ return metiers;
+ }
+
+ /**
+ * Set metiers list.
+ *
+ * @param metiers the metiers list to set
+ */
+ public void setMetiers(List<Metier> metiers) {
+ this.metiers = metiers;
+ fireContentsChanged(this, 0, getSize());
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return metiers.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (metiers != null) {
+ size = metiers.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Revision
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java 2009-06-17 13:00:12 UTC (rev 2398)
@@ -0,0 +1,60 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.setofvessels;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+import fr.ifremer.isisfish.entities.Metier;
+
+/**
+ * Renderer pour liste des metiers.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MetierListRenderer extends DefaultListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1113492654780402245L;
+
+ /*
+ * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
+ */
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ // this must be used to have alterned highlight rows and default
+ // selection color
+ JLabel c = (JLabel) super.getListCellRendererComponent(list, value,
+ index, isSelected, cellHasFocus);
+
+ Metier metier = (Metier) value;
+ c.setText(metier.getName());
+
+ return c;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Revision
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-17 08:47:48 UTC (rev 2397)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-06-17 13:00:12 UTC (rev 2398)
@@ -218,19 +218,23 @@
isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
isisfish.date.toString=%1$s %2$s
-isisfish.effortDescription.crewFoodCost=isisfish.effortDescription.crewFoodCost
-isisfish.effortDescription.crewShareRate=isisfish.effortDescription.crewShareRate
-isisfish.effortDescription.crewSize=isisfish.effortDescription.crewSize
-isisfish.effortDescription.fishingOperation=isisfish.effortDescription.fishingOperation
-isisfish.effortDescription.fishingOperationDuration=isisfish.effortDescription.fishingOperationDuration
-isisfish.effortDescription.fixedCrewSalary=isisfish.effortDescription.fixedCrewSalary
-isisfish.effortDescription.gearsNumberPerOperation=isisfish.effortDescription.gearsNumberPerOperation
-isisfish.effortDescription.landingCosts=isisfish.effortDescription.landingCosts
-isisfish.effortDescription.otherRunningCost=isisfish.effortDescription.otherRunningCost
-isisfish.effortDescription.repairAndMaintenanceGearCost=isisfish.effortDescription.repairAndMaintenanceGearCost
-isisfish.effortDescription.title=isisfish.effortDescription.title
+isisfish.effortDescription.crewFoodCost=Crew food cost
+isisfish.effortDescription.crewShareRate=Crew share rate
+isisfish.effortDescription.crewSize=Crew size
+isisfish.effortDescription.economicTitle=\u00C9conomiques parameters
+isisfish.effortDescription.effortTitle=Fishing effort parameters
+isisfish.effortDescription.fishingOperation=Fishing operation
+isisfish.effortDescription.fishingOperationDuration=Fishing operation duration
+isisfish.effortDescription.fishingOperationDuration.tooltip=In hours
+isisfish.effortDescription.fixedCrewSalary=Fixed crew salary
+isisfish.effortDescription.gearsNumberPerOperation=Gears number per operation
+isisfish.effortDescription.landingCosts=Landing costs
+isisfish.effortDescription.otherRunningCost=Other running cost
+isisfish.effortDescription.parametersTitle=M\u00E9tiers parameters
+isisfish.effortDescription.repairAndMaintenanceGearCost=Repair and maintenance gear cost
+isisfish.effortDescription.title=Practiced metier
isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
-isisfish.effortDescription.unitCostOfFishing=isisfish.effortDescription.unitCostOfFishing
+isisfish.effortDescription.unitCostOfFishing=Fishing unit cost
isisfish.equation.editor.title=Equation Editor
isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Error while adding of result to the map.
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-17 08:47:48 UTC (rev 2397)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-06-17 13:00:12 UTC (rev 2398)
@@ -221,12 +221,16 @@
isisfish.effortDescription.crewFoodCost=Co\u00FBt de l'alimentation pour l'\u00E9quipage
isisfish.effortDescription.crewShareRate=Taux de partage de l'\u00E9quipage
isisfish.effortDescription.crewSize=Taille de l'\u00E9quipage
+isisfish.effortDescription.economicTitle=Param\u00E8tres \u00E9conomiques
+isisfish.effortDescription.effortTitle=Param\u00E8tres d'effort de p\u00EAche
isisfish.effortDescription.fishingOperation=Op\u00E9ration de p\u00EAche
isisfish.effortDescription.fishingOperationDuration=Dur\u00E9e de la p\u00EAche
+isisfish.effortDescription.fishingOperationDuration.tooltip=En heures
isisfish.effortDescription.fixedCrewSalary=Salaire d'\u00E9quipage fixe
isisfish.effortDescription.gearsNumberPerOperation=Nombre d'engins par op\u00E9ration
isisfish.effortDescription.landingCosts=Co\u00FBts d'accastillage
isisfish.effortDescription.otherRunningCost=Autres co\u00FBts
+isisfish.effortDescription.parametersTitle=Param\u00E8tres des m\u00E9tiers
isisfish.effortDescription.repairAndMaintenanceGearCost=Co\u00FBts de maintenance
isisfish.effortDescription.title=M\u00E9tiers pratiqu\u00E9s
isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
1
0
r2397 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui/sensitivity resources/i18n
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
17 Jun '09
Author: chatellier
Date: 2009-06-17 08:47:48 +0000 (Wed, 17 Jun 2009)
New Revision: 2397
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
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:
I18Nisation.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:45:20 UTC (rev 2396)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:47:48 UTC (rev 2397)
@@ -18,6 +18,7 @@
package fr.ifremer.isisfish.ui.sensitivity;
+import static org.codelutin.i18n.I18n._;
import java.awt.Component;
import java.util.List;
@@ -53,7 +54,7 @@
JLabel c = (JLabel)super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
if (value instanceof List) {
- c.setText("Facteurs : ");
+ c.setText(_("isisfish.factor.factors") + " : ");
}
else if (value instanceof Factor) {
Factor<? ,?> factor = (Factor<?, ?>)value;
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-17 08:45:20 UTC (rev 2396)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-06-17 08:47:48 UTC (rev 2397)
@@ -383,6 +383,7 @@
isisfish.factor.continue=Continue factor
isisfish.factor.discret=Discret factor
isisfish.factor.factor=Factor
+isisfish.factor.factors=Factors
isisfish.factor.firstValue=First value
isisfish.factor.increment=Cardinality
isisfish.factor.lastValue=Last value
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-17 08:45:20 UTC (rev 2396)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-06-17 08:47:48 UTC (rev 2397)
@@ -383,6 +383,7 @@
isisfish.factor.continue=Facteur continu
isisfish.factor.discret=Facteur discret
isisfish.factor.factor=Facteur
+isisfish.factor.factors=Facteurs
isisfish.factor.firstValue=Premi\u00E8re valeur
isisfish.factor.increment=Cardinalit\u00E9
isisfish.factor.lastValue=Derni\u00E8re valeur
1
0
r2396 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
17 Jun '09
Author: chatellier
Date: 2009-06-17 08:45:20 +0000 (Wed, 17 Jun 2009)
New Revision: 2396
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
Log:
Return super component.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:39:20 UTC (rev 2395)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:45:20 UTC (rev 2396)
@@ -67,7 +67,7 @@
}
}
- return this;
+ return c;
}
}
1
0
r2395 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
17 Jun '09
Author: chatellier
Date: 2009-06-17 08:39:20 +0000 (Wed, 17 Jun 2009)
New Revision: 2395
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
Log:
R?\195?\169tablissement de l'heritage de DefaultTreeCellRenderer pour avoir les icones
par d?\195?\169faut d'un arbre.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:34:54 UTC (rev 2394)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeCellRenderer.java 2009-06-17 08:39:20 UTC (rev 2395)
@@ -23,8 +23,7 @@
import javax.swing.JLabel;
import javax.swing.JTree;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeCellRenderer;
+import javax.swing.tree.DefaultTreeCellRenderer;
import fr.ifremer.isisfish.simulator.sensitivity.Factor;
import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
@@ -38,7 +37,7 @@
* Last update : $Date: 9 mars 2009 $
* By : $Author: chatellier $
*/
-public class FactorTreeCellRenderer extends JLabel implements TreeCellRenderer {
+public class FactorTreeCellRenderer extends DefaultTreeCellRenderer {
/** serialVersionUID. */
private static final long serialVersionUID = 1686424876690392268L;
@@ -51,18 +50,20 @@
boolean selected, boolean expanded, boolean leaf, int row,
boolean hasFocus) {
+ JLabel c = (JLabel)super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+
if (value instanceof List) {
- setText("Facteurs : ");
+ c.setText("Facteurs : ");
}
else if (value instanceof Factor) {
Factor<? ,?> factor = (Factor<?, ?>)value;
if (factor.getDomain() instanceof EquationContinuousDomain) {
EquationContinuousDomain domain = (EquationContinuousDomain)factor.getDomain();
- setText(factor.getName() + "." + domain.getVariableName());
+ c.setText(factor.getName() + "." + domain.getVariableName());
}
else {
- setText(factor.getName());
+ c.setText(factor.getName());
}
}
1
0
r2394 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input: . population
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
by chatellier@users.labs.libre-entreprise.org 17 Jun '09
17 Jun '09
Author: chatellier
Date: 2009-06-17 08:34:54 +0000 (Wed, 17 Jun 2009)
New Revision: 2394
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboRenderer.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
Log:
Conservation de la selection.
Am?\195?\169lioration des propri?\195?\169t?\195?\169s 'enabled/actif'.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2009-06-16 15:54:04 UTC (rev 2393)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2009-06-17 08:34:54 UTC (rev 2394)
@@ -46,29 +46,29 @@
}
]]>
</script>
- <Table id='body'>
+ <Table>
<row>
- <cell fill='both' weightx='1.0' weighty='0.3'>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
<InputOneEquationUI id='migrationEquation' constructorParams='this'
- lblText='{_("isisfish.common.migration")}'
+ lblText='{_("isisfish.common.migration")}' actif='{isActif()}'
bean='{getPopInfo()}' nameEquation='Migration' methodGet='MigrationEquation' methodSet='MigrationEquationAsString'
clazz='{fr.ifremer.isisfish.equation.MigrationEquation.class}'
decorator='boxed' _bean='{PopulationImpl.class}' _method='"Growth"'/>
</cell>
</row>
<row>
- <cell fill='both' weightx='1.0' weighty='0.3'>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
<InputOneEquationUI id='emigrationEquation' constructorParams='this'
- lblText='{_("isisfish.common.emigration")}'
+ lblText='{_("isisfish.common.emigration")}' actif='{isActif()}'
bean='{getPopInfo()}' nameEquation='Emigration' methodGet='EmigrationEquation' methodSet='EmigrationEquationAsString'
clazz='{fr.ifremer.isisfish.equation.EmigrationEquation.class}'
decorator='boxed' _bean='{PopulationImpl.class}' _method='"Growth"'/>
</cell>
</row>
<row>
- <cell fill='both' weightx='1.0' weighty='0.3'>
+ <cell fill='both' weightx='1.0' weighty='1.0'>
<InputOneEquationUI id='immigrationEquation' constructorParams='this'
- lblText='{_("isisfish.common.immigration")}'
+ lblText='{_("isisfish.common.immigration")}' actif='{isActif()}'
bean='{getPopInfo()}' nameEquation='Immigration' methodGet='ImmigrationEquation' methodSet='ImmigrationEquationAsString'
clazz='{fr.ifremer.isisfish.equation.ImmigrationEquation.class}'
decorator='boxed' _bean='{PopulationImpl.class}' _method='"Growth"'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-06-16 15:54:04 UTC (rev 2393)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-06-17 08:34:54 UTC (rev 2394)
@@ -144,10 +144,10 @@
}
]]>
</script>
- <Table id='body'>
+ <Table>
<row>
<cell>
- <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/>
+ <JLabel text="isisfish.common.populationGroup" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JComboBox id="fieldPopulationMigrationImmigrationGroupChooser" enabled='{isActif()}' onActionPerformed='groupChanged()'/>
@@ -177,12 +177,12 @@
</row>
<row columns='4'>
<cell fill='both' weightx='1.0' weighty='1.0'>
- <org.codelutin.math.matrix.gui.JAXXMatrixEditor id ='populationMigrationImmigrationTable' linearModel="true" enabled='{isActif()}'/>
+ <org.codelutin.math.matrix.gui.JAXXMatrixEditor id='populationMigrationImmigrationTable' linearModel="true" enabled='{isActif()}'/>
</cell>
</row>
<row>
<cell columns='4' fill='horizontal' weightx='1.0'>
- <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
+ <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
</cell>
</row>
</Table>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2009-06-16 15:54:04 UTC (rev 2393)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2009-06-17 08:34:54 UTC (rev 2394)
@@ -23,26 +23,26 @@
<fr.ifremer.isisfish.entities.PopulationImpl id='bean' javaBean='null'/>
<fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl id='popInfo' javaBean='null'/>
+ <Boolean id="selectedPopulationSeasonInfo" javaBean='false' />
+
<script><![CDATA[
import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
import fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl;
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.PopulationImpl;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboModel;
+import fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboRenderer;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getOldValue() != null || evt.getNewValue() == null) {
- // remove previous binding on getBean()
- //jaxx.runtime.SwingUtil.removeDataBinding(get$Table0(), "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
fieldPopulationMigrationComment.setText("");
fieldUseEquationMigration.setSelected(false);
}
- if (evt.getNewValue() != null) {
- // add binding on getBean()
- //jaxx.runtime.SwingUtil.applyDataBinding(get$Table0(), "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
- }
+ /*if (evt.getNewValue() != null) {
+
+ }*/
}
});
@@ -55,17 +55,33 @@
setBean(null);
setBean((PopulationImpl) population);
+ // refresh psi list in combo box
+ PopulationSeasonInfoComboModel model = (PopulationSeasonInfoComboModel)fieldPopulationMigrationSeasonChooser.getModel();
if (getBean() != null) {
- setFieldPopulationMigrationSeasonChooserModel();
+ PopulationSeasonInfo previousSelected = (PopulationSeasonInfo)model.getSelectedItem();
+ model.setPopulationSeasonInfos(getBean().getPopulationSeasonInfo());
+
+ // do this to keep selected after cancel/refresh
+ if (previousSelected != null) {
+ for (PopulationSeasonInfo psi : getBean().getPopulationSeasonInfo()) {
+ if (psi.getTopiaId().equals(previousSelected.getTopiaId())) {
+ model.setSelectedItem(psi);
+ }
+ }
+ }
+
+ seasonChanged();
}
-
- // must reset popInfo here, on tree swap
- // there is a popInfo here
- // and useEquationChanged erase saved UseEquationMigration field
- setPopInfo(null);
- useEquationChanged();
-
+ else {
+ model.setPopulationSeasonInfos(null);
+ }
+
getVerifier().addCurrentPanel(populationMigrationEquationUI, populationMigrationMigrationUI, populationMigrationImmigrationUI, populationMigrationEmigrationUI);
+ // addCurrentPanel set all to isActif()
+ // force it to isSelectedPopulationSeasonInfo()
+ // twice for real change event :(
+ setSelectedPopulationSeasonInfo(fieldPopulationMigrationSeasonChooser.getModel().getSelectedItem() == null);
+ setSelectedPopulationSeasonInfo(fieldPopulationMigrationSeasonChooser.getModel().getSelectedItem() != null);
}
@Override
@@ -75,47 +91,38 @@
}
protected void seasonChanged() {
- setPopInfo((PopulationSeasonInfoImpl)getPopulationSeasonInfo());
+ PopulationSeasonInfoComboModel model = (PopulationSeasonInfoComboModel)fieldPopulationMigrationSeasonChooser.getModel();
+ PopulationSeasonInfo selectedPSI = (PopulationSeasonInfo)model.getSelectedItem();
+ setPopInfo((PopulationSeasonInfoImpl)selectedPSI);
if (getPopInfo() != null) {
getVerifier().addCurrentEntity(getPopInfo());
populationMigrationEquationUI.init(getPopInfo());
populationMigrationMigrationUI.init(getPopInfo());
populationMigrationImmigrationUI.init(getPopInfo());
populationMigrationEmigrationUI.init(getPopInfo());
+
+ setSelectedPopulationSeasonInfo(isActif());
}
- useEquationChanged();
-}
-protected void setFieldPopulationMigrationSeasonChooserModel() {
- DefaultComboBoxModel model = new DefaultComboBoxModel();
- if (getBean().getPopulationSeasonInfo() != null) {
- model.addElement(new GenericCell(" ", null, PopulationSeasonInfo.class));
- for (PopulationSeasonInfo psi : getBean().getPopulationSeasonInfo()) {
- model.addElement(new GenericCell(psi.getFirstMonth() + " - " + psi.getLastMonth(), psi, PopulationSeasonInfo.class));
- }
+ else {
+ setSelectedPopulationSeasonInfo(false);
}
- fieldPopulationMigrationSeasonChooser.setModel(model);
+ refreshHidablePanel();
}
-protected PopulationSeasonInfo getPopulationSeasonInfo() {
- PopulationSeasonInfo result = null;
- Object selected = fieldPopulationMigrationSeasonChooser.getSelectedItem();
- if (selected != null) {
- GenericCell cell = (GenericCell)selected;
- if (cell.getValue() != null) {
- result = (PopulationSeasonInfo)cell.getValue();
- }
- }
- return result;
+protected void useEquationChanged() {
+ getPopInfo().setUseEquationMigration(fieldUseEquationMigration.isSelected());
+ refreshHidablePanel();
}
-protected void useEquationChanged() {
+protected void refreshHidablePanel() {
if (getPopInfo() != null) {
- getPopInfo().setUseEquationMigration(fieldUseEquationMigration.isSelected());
+ if (getPopInfo().getUseEquationMigration()) {
+ fieldUseEquationMigration.setSelected(true);
+ ((CardLayout) hidablePanel.getLayout()).show(hidablePanel, "fieldUseEquation");
+ }
+ else {
+ fieldUseEquationMigration.setSelected(false);
+ ((CardLayout) hidablePanel.getLayout()).show(hidablePanel, "fieldUseMatrix");
+ }
}
- if (fieldUseEquationMigration.isSelected()) {
- ((CardLayout) hidablePanel.getLayout()).show(hidablePanel, "fieldUseEquation");
- }
- else {
- ((CardLayout) hidablePanel.getLayout()).show(hidablePanel, "fieldUseMatrix");
- }
}
]]>
</script>
@@ -125,46 +132,51 @@
<JLabel text="isisfish.populationMigration.selectSeason" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldPopulationMigrationSeasonChooser" onActionPerformed='seasonChanged()' enabled='{isActif()}'/>
+ <JComboBox id="fieldPopulationMigrationSeasonChooser"
+ model='{new PopulationSeasonInfoComboModel()}'
+ renderer="{new PopulationSeasonInfoComboRenderer()}"
+ onActionPerformed='seasonChanged()'
+ enabled='{isActif()}'/>
</cell>
</row>
<row>
<cell columns='2' anchor='west'>
<JCheckBox id="fieldUseEquationMigration" selected='{getPopInfo().getUseEquationMigration()}'
- text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isActif()}' decorator='boxed'/>
+ text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isSelectedPopulationSeasonInfo()}' decorator='boxed'/>
</cell>
</row>
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='0.7'>
- <JPanel id="hidablePanel" layout='{new CardLayout()}'>
- <PopulationMigrationEquationUI id='populationMigrationEquationUI' constraints='"fieldUseEquation"' constructorParams='this'/>
- <JTabbedPane id="fieldUseMatrix" constraints='"fieldUseMatrix"'>
+ <JPanel id="hidablePanel" layout='{new CardLayout()}'>
+ <JTabbedPane id="fieldUseMatrix" constraints='"fieldUseMatrix"' enabled='{isSelectedPopulationSeasonInfo()}'>
<tab title='{_("isisfish.populationMigrationMigration.title")}'>
<PopulationMigrationMigrationUI id="populationMigrationMigrationUI" constructorParams='this' decorator='boxed'
- _bean='{PopulationSeasonInfoImpl.class}' _method='"MigrationMatrix"'/>
+ _bean='{PopulationSeasonInfoImpl.class}' _method='"MigrationMatrix"' actif='{isSelectedPopulationSeasonInfo()}' />
</tab>
<tab title='{_("isisfish.populationMigrationImmigration.title")}'>
<PopulationMigrationImmigrationUI id="populationMigrationImmigrationUI" constructorParams='this' decorator='boxed'
- _bean='{PopulationSeasonInfoImpl.class}' _method='"ImmigrationMatrix"'/>
+ _bean='{PopulationSeasonInfoImpl.class}' _method='"ImmigrationMatrix"' actif='{isSelectedPopulationSeasonInfo()}' />
</tab>
<tab title='{_("isisfish.populationMigrationEmigration.title")}'>
<PopulationMigrationEmigrationUI id="populationMigrationEmigrationUI" constructorParams='this' decorator='boxed'
- _bean='{PopulationSeasonInfoImpl.class}' _method='"EmigrationMatrix"'/>
+ _bean='{PopulationSeasonInfoImpl.class}' _method='"EmigrationMatrix"' actif='{isSelectedPopulationSeasonInfo()}' />
</tab>
</JTabbedPane>
+ <PopulationMigrationEquationUI id='populationMigrationEquationUI' constraints='"fieldUseEquation"' constructorParams='this'
+ actif='{isSelectedPopulationSeasonInfo()}' />
</JPanel>
</cell>
</row>
<row>
<cell anchor='east'>
- <JLabel text="isisfish.populationMigration.comments" enabled='{isActif()}'/>
+ <JLabel text="isisfish.populationMigration.comments" enabled='{isSelectedPopulationSeasonInfo()}'/>
</cell>
<cell fill='both' weightx='1.0' weighty='0.3'>
<JScrollPane>
<!-- comment can be null jaxx.runtime.SwingUtil.getStringValue() -->
<JTextArea id="fieldPopulationMigrationComment" text='{jaxx.runtime.SwingUtil.getStringValue(getBean().getMigrationComment())}'
onKeyReleased='getBean().setMigrationComment(fieldPopulationMigrationComment.getText())'
- enabled='{isActif()}' decorator='boxed'/>
+ enabled='{isSelectedPopulationSeasonInfo()}' decorator='boxed'/>
</JScrollPane>
</cell>
</row>
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java 2009-06-17 08:34:54 UTC (rev 2394)
@@ -0,0 +1,102 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.population;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
+
+/**
+ * Model pour la liste des {@link PopulationSeasonInfo}.
+ *
+ * @author chatellier
+ * @version $Revision: 2350 $
+ *
+ * Last update : $Date: 2009-06-09 13:52:58 +0200 (mar. 09 juin 2009) $
+ * By : $Author: chatellier $
+ */
+public class PopulationSeasonInfoComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** PopulationSeasonInfo list */
+ protected List<PopulationSeasonInfo> populationSeasonInfos;
+
+ /**
+ * Empty constructor.
+ */
+ public PopulationSeasonInfoComboModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with population season info list.
+ *
+ * @param populationSeasonInfos population season info list
+ */
+ public PopulationSeasonInfoComboModel(List<PopulationSeasonInfo> populationSeasonInfos) {
+ super();
+ setPopulationSeasonInfos(populationSeasonInfos);
+ }
+
+ /**
+ * Get population season info list.
+ *
+ * @return population season info list
+ */
+ public List<PopulationSeasonInfo> getPopulationSeasonInfos() {
+ return populationSeasonInfos;
+ }
+
+ /**
+ * Set population season info list.
+ *
+ * @param populationSeasonInfos the population season info list to set
+ */
+ public void setPopulationSeasonInfos(List<PopulationSeasonInfo> populationSeasonInfos) {
+ this.populationSeasonInfos = populationSeasonInfos;
+
+ // clear selection
+ setSelectedItem(null);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return populationSeasonInfos.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (populationSeasonInfos != null) {
+ size = populationSeasonInfos.size();
+ }
+ return size;
+ }
+}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboRenderer.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboRenderer.java 2009-06-17 08:34:54 UTC (rev 2394)
@@ -0,0 +1,65 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.population;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.ListCellRenderer;
+
+import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
+
+/**
+ * Renderer pour la combo des {@link PopulationSeasonInfo}.
+ *
+ * @author chatellier
+ * @version $Revision: 2350 $
+ *
+ * Last update : $Date: 2009-06-09 13:52:58 +0200 (mar. 09 juin 2009) $
+ * By : $Author: chatellier $
+ */
+public class PopulationSeasonInfoComboRenderer extends DefaultListCellRenderer implements
+ ListCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -8277883340386163087L;
+
+ /*
+ * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
+ */
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+
+ // this must be used to have alterned highlight rows and default
+ // selection color
+ JLabel c = (JLabel) super.getListCellRendererComponent(list, value,
+ index, isSelected, cellHasFocus);
+
+ PopulationSeasonInfo populationSeasonInfo = (PopulationSeasonInfo) value;
+
+ // there is no default selection
+ if (value != null) {
+ c.setText(populationSeasonInfo.getFirstMonth() + " - " + populationSeasonInfo.getLastMonth());
+ }
+ return c;
+ }
+}
1
0
r2393 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
16 Jun '09
Author: chatellier
Date: 2009-06-16 15:54:04 +0000 (Tue, 16 Jun 2009)
New Revision: 2393
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Vraiement > vraiment
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 15:51:25 UTC (rev 2392)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-06-16 15:54:04 UTC (rev 2393)
@@ -569,7 +569,7 @@
isisfish.message.commiting.region=En train de commiter la r\u00E9gion %1$s ...
isisfish.message.compilation.time=Temps de compilation %1$ss
isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet %1$s
-isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion %1$s ?
+isisfish.message.confirm.remove.region=Voulez-vous vraiment supprimer la r\u00E9gion %1$s ?
isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script '%1$s' ?
isisfish.message.copy.finished=Copie termin\u00E9e
isisfish.message.copy.region=Copier la r\u00E9gion vers %1$s
1
0
r2392 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
16 Jun '09
Author: chatellier
Date: 2009-06-16 15:51:25 +0000 (Tue, 16 Jun 2009)
New Revision: 2392
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
Log:
Permet de redimentionner le splitpane jusqu'ou on veut (#1890)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-06-16 13:12:15 UTC (rev 2391)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-06-16 15:51:25 UTC (rev 2392)
@@ -212,7 +212,7 @@
</JMenu-->
</JMenuBar>
<JSplitPane oneTouchExpandable="true" dividerLocation="200" orientation="HORIZONTAL" constraints='BorderLayout.CENTER'>
- <JPanel layout='{new BorderLayout()}'>
+ <JPanel layout='{new BorderLayout()}' minimumSize="{new java.awt.Dimension(0,0)}">
<Table constraints='BorderLayout.NORTH'>
<row>
<cell fill='horizontal' weightx='1.0'>
@@ -234,7 +234,7 @@
</JScrollPane>
</JPanel>
</JPanel>
- <JPanel id='inputPanePrincipal' layout='{getCardlayoutPrincipal()}'>
+ <JPanel id='inputPanePrincipal' layout='{getCardlayoutPrincipal()}' minimumSize="{new java.awt.Dimension(0,0)}">
<NoneUI id='noneUI' constraints='"none"'/>
<JPanel id="inputPane" layout='{getCardlayout()}' constraints='"normale"'/>
</JPanel>
1
0
r2391 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
16 Jun '09
Author: chatellier
Date: 2009-06-16 13:12:15 +0000 (Tue, 16 Jun 2009)
New Revision: 2391
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
Log:
Changement de l'ordre des onglets (#1889)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2009-06-16 10:45:44 UTC (rev 2390)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationUI.jaxx 2009-06-16 13:12:15 UTC (rev 2391)
@@ -50,27 +50,35 @@
</script>
<JPanel id='body' layout='{new BorderLayout()}'>
<JTabbedPane id="populationTab" constraints='BorderLayout.CENTER'>
+ <!-- Saisie des populations -->
<tab title='{_("isisfish.populationBasics.title")}'>
<PopulationBasicsUI id='populationBasicsUI' constructorParams='this'/>
</tab>
- <tab title='{_("isisfish.populationGroup.title")}'>
- <PopulationGroupUI id='populationGroupUI' constructorParams='this'/>
- </tab>
- <tab title='{_("isisfish.populationEquation.title")}'>
- <PopulationEquationUI id='populationEquationUI' constructorParams='this'/>
- </tab>
+ <!-- Zones -->
<tab title='{_("isisfish.populationZones.title")}'>
<PopulationZonesUI id='populationZoneUI' constructorParams='this'/>
</tab>
+ <!-- Saisons -->
<tab title='{_("isisfish.populationSeasons.title")}'>
<PopulationSeasonsUI id='populationSeasonsUI' constructorParams='this'/>
</tab>
- <tab title='{_("isisfish.populationCapturability.title")}'>
- <PopulationCapturabilityUI id='populationCapturabilityUI' constructorParams='this'/>
+ <!-- Saisie des équations -->
+ <tab title='{_("isisfish.populationEquation.title")}'>
+ <PopulationEquationUI id='populationEquationUI' constructorParams='this'/>
</tab>
+ <!-- Saisie des reproductions -->
<tab title='{_("isisfish.populationRecruitment.title")}'>
<PopulationRecruitmentUI id='populationRecruitementUI' constructorParams='this'/>
</tab>
+ <!-- Saisie des groupes de population -->
+ <tab title='{_("isisfish.populationGroup.title")}'>
+ <PopulationGroupUI id='populationGroupUI' constructorParams='this'/>
+ </tab>
+ <!--Capturabilité -->
+ <tab title='{_("isisfish.populationCapturability.title")}'>
+ <PopulationCapturabilityUI id='populationCapturabilityUI' constructorParams='this'/>
+ </tab>
+ <!-- Migration -->
<tab title='{_("isisfish.populationMigration.title")}'>
<PopulationMigrationUI id='populationMigrationUI' constructorParams='this'/>
</tab>
1
0
r2389 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/ui/input resources/i18n
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
16 Jun '09
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=
2
1
r2390 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
by chatellier@users.labs.libre-entreprise.org 16 Jun '09
16 Jun '09
Author: chatellier
Date: 2009-06-16 10:45:44 +0000 (Tue, 16 Jun 2009)
New Revision: 2390
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Forgot fr translation.
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 10:39:31 UTC (rev 2389)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-06-16 10:45:44 UTC (rev 2390)
@@ -1087,7 +1087,7 @@
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.wizardGroupCreation.undefinedGrowthEquation=L'\u00E9quation utilis\u00E9e est la courbe de croissance de la population. Elle doit \u00EAtre pr\u00E9alablement d\u00E9finie.
isisfish.zone.cells=cellules de la Zone
isisfish.zone.comments=Commentaires
isisfish.zone.name=Nom
1
0