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
November 2009
- 1 participants
- 65 discussions
r2726 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input: . population
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 15:57:12 +0000 (Mon, 02 Nov 2009)
New Revision: 2726
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
Log:
Utilisation des list model pour les zones
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2009-11-02 15:51:03 UTC (rev 2725)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2009-11-02 15:57:12 UTC (rev 2726)
@@ -23,14 +23,8 @@
<fr.ifremer.isisfish.entities.PopulationImpl id='bean' javaBean='null'/>
<script><![CDATA[
-
-import jaxx.runtime.swing.JAXXList;
import fr.ifremer.isisfish.entities.Zone;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationImpl;
-import org.nuiton.topia.persistence.TopiaEntity;
-import fr.ifremer.isisfish.ui.WelcomePanelUI;
+import fr.ifremer.isisfish.ui.input.population.ZoneListModel;
import org.nuiton.math.matrix.gui.MatrixPanelEvent;
import org.nuiton.math.matrix.gui.MatrixPanelListener;
@@ -44,8 +38,8 @@
@Override
public void refresh(){
setPopulationZonesPresenceModel();
- setFieldPopulationZonesReproductionModel(getSelectedValue(populationZonesPresence));
- setFieldPopulationZonesRecruitmentModel(getSelectedValue(populationZonesPresence));
+ setFieldPopulationZonesReproductionModel(getSelectedValues(populationZonesPresence));
+ setFieldPopulationZonesRecruitmentModel(getSelectedValues(populationZonesPresence));
fieldPopulationMappingZoneReproZoneRecru.removeMatrixPanelListener(listener);
setFieldPopulationMappingZoneReproZoneRecru();
fieldPopulationMappingZoneReproZoneRecru.addMatrixListener(listener);
@@ -82,59 +76,42 @@
setModel(zones, getBean().getRecruitmentZone(), fieldPopulationZonesRecruitment);
}
}
-protected void setModel(java.util.List<Zone> zones, java.util.List<Zone> selected, JAXXList componant){
- DefaultListModel model = new DefaultListModel();
- java.util.List<GenericCell> selectedZones = new ArrayList<GenericCell>();
- if (zones != null){
- for (Zone z : zones){
- GenericCell cell = new GenericCell(z.getName(), z, Zone.class);
- model.addElement(cell);
- if (selected != null){
- if (selected.contains(z)){
- selectedZones.add(cell);
- }
- }
- }
+
+/**
+ * Change model of {@code associatedList} with all available zones, but keep
+ * selection with {@code selectedZones}.
+ */
+protected void setModel(java.util.List<Zone> availableZones, java.util.List<Zone> selectedZones, JList associatedList){
+ ZoneListModel zoneModel = new ZoneListModel(availableZones);
+ associatedList.setModel(zoneModel);
+ for (Zone selectedZone : selectedZones) {
+ int index = availableZones.indexOf(selectedZone);
+ associatedList.addSelectionInterval(index, index);
}
- componant.setModel(model);
- if (selectedZones.size() > 0){
- java.util.List <Integer> indicesList = new ArrayList<Integer>();
- for (GenericCell c : selectedZones){
- indicesList.add(model.indexOf(c));
- }
- int[] indices = new int[indicesList.size()];
- int cnt = 0;
- for (Integer i : indicesList){
- indices[cnt]=i;
- cnt ++;
- }
- componant.setSelectedIndices(indices);
- }
}
protected void presenceChanged(){
- getBean().setPopulationZone(getSelectedValue(populationZonesPresence));
- setFieldPopulationZonesReproductionModel(getSelectedValue(populationZonesPresence));
- setFieldPopulationZonesRecruitmentModel(getSelectedValue(populationZonesPresence));
+ getBean().setPopulationZone(getSelectedValues(populationZonesPresence));
+ setFieldPopulationZonesReproductionModel(getSelectedValues(populationZonesPresence));
+ setFieldPopulationZonesRecruitmentModel(getSelectedValues(populationZonesPresence));
setFieldPopulationMappingZoneReproZoneRecru();
}
protected void reproductionChanged(){
- getBean().setReproductionZone(getSelectedValue(fieldPopulationZonesReproduction));
+ getBean().setReproductionZone(getSelectedValues(fieldPopulationZonesReproduction));
setFieldPopulationMappingZoneReproZoneRecru();
}
protected void recruitementChanged(){
- getBean().setRecruitmentZone(getSelectedValue(fieldPopulationZonesRecruitment));
+ getBean().setRecruitmentZone(getSelectedValues(fieldPopulationZonesRecruitment));
setFieldPopulationMappingZoneReproZoneRecru();
}
-protected java.util.List<Zone> getSelectedValue(JAXXList componant){
- Object[] selected = componant.getSelectedValues();
+
+/**
+ * Get selected values for components as list.
+ */
+protected java.util.List<Zone> getSelectedValues(JList component){
+ Object[] selectedValues = component.getSelectedValues();
java.util.List<Zone> selectedZone = new ArrayList<Zone>();
- if (selected != null){
- for (Object i : selected){
- GenericCell cell = (GenericCell)i;
- if (cell.getValue() != null){
- selectedZone.add((Zone)cell.getValue());
- }
- }
+ for (Object value : selectedValues) {
+ selectedZone.add((Zone)value);
}
return selectedZone;
}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java 2009-11-02 15:57:12 UTC (rev 2726)
@@ -0,0 +1,77 @@
+/* *##%
+ * 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.DefaultListModel;
+
+import fr.ifremer.isisfish.entities.MetierSeasonInfo;
+import fr.ifremer.isisfish.entities.Zone;
+
+/**
+ * Model pour la liste des {@link MetierSeasonInfo}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class ZoneListModel extends DefaultListModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** Zones list */
+ protected List<Zone> zones;
+
+ /**
+ * Constructor with species list.
+ *
+ * @param zones zones list
+ */
+ public ZoneListModel(List<Zone> zones) {
+ super();
+ this.zones = zones;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return zones.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (zones != null) {
+ size = zones.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
1
0
r2725 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input: . metier
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 15:51:03 +0000 (Mon, 02 Nov 2009)
New Revision: 2725
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
Log:
Utilisation des model et renderer pour les MetierSeasonInfo
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2009-11-02 14:39:50 UTC (rev 2724)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2009-11-02 15:51:03 UTC (rev 2725)
@@ -32,7 +32,7 @@
import fr.ifremer.isisfish.entities.MetierImpl;
import fr.ifremer.isisfish.entities.MetierSeasonInfo;
import fr.ifremer.isisfish.entities.MetierSeasonInfoImpl;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboModel;
@Override
public void refresh() {
@@ -60,27 +60,22 @@
}
protected void setSeasonModel(){
- DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
java.util.List<MetierSeasonInfo> metierSeasonInfo = getBean().getMetierSeasonInfo();
- if (metierSeasonInfo != null) {
- seasonModel.addElement(new GenericCell(" ", null, null));
- for (MetierSeasonInfo m : metierSeasonInfo){
- seasonModel.addElement(new GenericCell(m.getFirstMonth().toString() + "-" + m.getLastMonth().toString(), m, MetierSeasonInfo.class));
- }
- }
+ MetierSeasonInfoComboModel seasonModel = new MetierSeasonInfoComboModel(metierSeasonInfo);
fieldMetierSeasonInfo.setModel(seasonModel);
// fix refresh() problem false, because first is null
setMetierSeasonInfoSelected(false);
}
protected void metierSeasonInfoChanged() {
- setMetierSeasonInfoSelected(((GenericCell)fieldMetierSeasonInfo.getSelectedItem()).getValue() != null);
+ MetierSeasonInfo selectedMSI = (MetierSeasonInfo)fieldMetierSeasonInfo.getSelectedItem();
+ setMetierSeasonInfoSelected( selectedMSI != null);
if (isMetierSeasonInfoSelected()) {
- MetierSeasonInfoImpl msii = (MetierSeasonInfoImpl)((GenericCell)fieldMetierSeasonInfo.getSelectedItem()).getValue();
if (log.isDebugEnabled()) {
- log.debug("Metier season changed : " + msii);
+ log.debug("Metier season changed : " + selectedMSI);
}
- setMetierSeasonInfo(msii);
+ // FIXME really need to fix impl cast !!!
+ setMetierSeasonInfo((MetierSeasonInfoImpl)selectedMSI);
getVerifier().addCurrentEntity(getMetierSeasonInfo());
}
metierSeasonInfoSpeciesEditor.refresh();
@@ -95,7 +90,8 @@
<JLabel text="isisfish.metierSeasonInfoSpecies.selectSeason" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldMetierSeasonInfo" onActionPerformed='metierSeasonInfoChanged()' enabled='{isActif()}'/>
+ <JComboBox id="fieldMetierSeasonInfo" onActionPerformed='metierSeasonInfoChanged()'
+ renderer="{new fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboRenderer()}" enabled='{isActif()}'/>
</cell>
</row>
<row>
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java 2009-11-02 15:51:03 UTC (rev 2725)
@@ -0,0 +1,76 @@
+/* *##%
+ * 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.metier;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+import fr.ifremer.isisfish.entities.MetierSeasonInfo;
+
+/**
+ * Model pour la liste des {@link MetierSeasonInfo}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class MetierSeasonInfoComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** MetierSeasonInfo list */
+ protected List<MetierSeasonInfo> metierSeasonInfo;
+
+ /**
+ * Constructor with species list.
+ *
+ * @param metierSeasonInfo species list
+ */
+ public MetierSeasonInfoComboModel(List<MetierSeasonInfo> metierSeasonInfo) {
+ super();
+ this.metierSeasonInfo = metierSeasonInfo;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return metierSeasonInfo.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (metierSeasonInfo != null) {
+ size = metierSeasonInfo.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java 2009-11-02 15:51:03 UTC (rev 2725)
@@ -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.metier;
+
+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.MetierSeasonInfo;
+
+/**
+ * Renderer pour la combo des {@link MetierSeasonInfo}.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class MetierSeasonInfoComboRenderer 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);
+
+ MetierSeasonInfo metierSeasonInfo = (MetierSeasonInfo) value;
+
+ // there is no default selection
+ if (value != null) {
+ c.setText(metierSeasonInfo.getFirstMonth() + "-" + metierSeasonInfo.getLastMonth());
+ }
+ return c;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java 2009-11-02 14:39:50 UTC (rev 2724)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java 2009-11-02 15:51:03 UTC (rev 2725)
@@ -40,45 +40,17 @@
/** serialVersionUID. */
private static final long serialVersionUID = 6171850179969290032L;
- /** PopulationSeasonInfo list */
+ /** Species list */
protected List<Species> speciesList;
/**
- * Empty constructor.
- */
- public SpeciesComboModel() {
- this(null);
- }
-
- /**
* Constructor with species list.
*
* @param speciesList species list
*/
public SpeciesComboModel(List<Species> speciesList) {
super();
- setPopulationSeasonInfos(speciesList);
- }
-
- /**
- * Get species list.
- *
- * @return species list
- */
- public List<Species> getPopulationSeasonInfos() {
- return speciesList;
- }
-
- /**
- * Set species list.
- *
- * @param speciesList species list
- */
- public void setPopulationSeasonInfos(List<Species> speciesList) {
this.speciesList = speciesList;
-
- // clear selection
- setSelectedItem(null);
}
/*
1
0
r2724 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 14:39:50 +0000 (Mon, 02 Nov 2009)
New Revision: 2724
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesModel.java
Log:
Use species combo model.
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesModel.java 2009-11-02 14:06:07 UTC (rev 2723)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesModel.java 2009-11-02 14:39:50 UTC (rev 2724)
@@ -1,239 +0,0 @@
-/* *##%
- * Copyright (C) 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.
- *##%*/
-
-package fr.ifremer.isisfish.ui.input.metier;
-
-import static org.nuiton.i18n.I18n._;
-
-import java.awt.Component;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableCellRenderer;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.MetierSeasonInfo;
-import fr.ifremer.isisfish.entities.TargetSpecies;
-
-/**
- * Table model for {@link MetierSeasonInfo}#{@link TargetSpecies}.
- *
- * Columns :
- * <li>target species name</li>
- * <li>target species equation</li>
- * <li>target species primaryCatch</li>
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class MetierSeasonInfoTargetSpeciesModel extends AbstractTableModel implements TableCellRenderer {
-
- /** Log. */
- private static Log log = LogFactory.getLog(MetierSeasonInfoTargetSpeciesModel.class);
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 3169786638868209920L;
-
- /** Columns names. */
- public final static String[] COLUMN_NAMES = {
- _("isisfish.metierSeasonInfoSpecies.species"),
- _("isisfish.metierSeasonInfoSpecies.targetFactor"),
- _("isisfish.metierSeasonInfoSpecies.mainSpecies") };
-
- protected List<TargetSpecies> targetSpeciesList;
-
- /**
- * Empty constructor.
- */
- public MetierSeasonInfoTargetSpeciesModel() {
- this(null);
- }
-
- /**
- * Constructor with data.
- *
- * @param targetSpeciesList initial target species
- */
- public MetierSeasonInfoTargetSpeciesModel(
- List<TargetSpecies> targetSpeciesList) {
- super();
- this.targetSpeciesList = targetSpeciesList;
- }
-
- /**
- * Set target species list.
- *
- * @param targetSpeciesList the targetSpecies to set
- */
- public void setTargetSpecies(List<TargetSpecies> targetSpeciesList) {
- this.targetSpeciesList = targetSpeciesList;
- }
-
- /*
- * @see javax.swing.table.TableModel#getColumnCount()
- */
- @Override
- public int getColumnCount() {
- return COLUMN_NAMES.length;
- }
-
- /*
- * @see javax.swing.table.TableModel#getRowCount()
- */
- @Override
- public int getRowCount() {
- int rows = 0;
- if (targetSpeciesList != null) {
- rows = targetSpeciesList.size();
- }
- return rows;
- }
-
- /*
- * @see javax.swing.table.TableModel#getValueAt(int, int)
- */
- @Override
- public Object getValueAt(int rowIndex, int columnIndex) {
-
- Object result = null;
-
- TargetSpecies targetSpecies = targetSpeciesList.get(rowIndex);
- switch (columnIndex) {
- case 0:
- result = targetSpecies.getSpecies().getName();
- break;
- case 1:
- result = targetSpecies.getTargetFactorEquation();
- break;
- case 2:
- result = targetSpecies.getPrimaryCatch();
- break;
- default:
- throw new IndexOutOfBoundsException("No such column " + columnIndex);
- }
-
- return result;
- }
-
- /*
- * @see javax.swing.table.TableModel#getColumnClass(int)
- */
- @Override
- public Class<?> getColumnClass(int columnIndex) {
-
- Class<?> result = null;
-
- switch (columnIndex) {
- case 0:
- result = String.class;
- break;
- case 1:
- result = Equation.class;
- break;
- case 2:
- result = Boolean.class;
- break;
- default:
- throw new IndexOutOfBoundsException("No such column " + columnIndex);
- }
-
- return result;
- }
-
- /*
- * @see javax.swing.table.TableModel#getColumnName(int)
- */
- @Override
- public String getColumnName(int columnIndex) {
- return COLUMN_NAMES[columnIndex];
- }
-
- /*
- * @see javax.swing.table.TableModel#isCellEditable(int, int)
- */
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return columnIndex > 0;
- }
-
- /*
- * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
- */
- @Override
- public void setValueAt(Object value, int rowIndex, int columnIndex) {
-
- if (log.isDebugEnabled()) {
- log.debug("Cell edition (column " + columnIndex + ") = " + value);
- }
-
- TargetSpecies targetSpecies = targetSpeciesList.get(rowIndex);
- switch (columnIndex) {
- case 1:
- Equation eq = (Equation)value;
- // two events for event to be fired
- targetSpecies.setTargetFactorEquation(null);
- targetSpecies.setTargetFactorEquation(eq);
- break;
- case 2:
- Boolean bValue = (Boolean)value;
- targetSpecies.setPrimaryCatch(bValue);
- break;
- default:
- throw new IndexOutOfBoundsException("Can't edit column " + columnIndex);
- }
-
- }
-
- /*
- * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
- */
- @Override
- public Component getTableCellRendererComponent(JTable table, Object value,
- boolean isSelected, boolean hasFocus, int row, int column) {
-
- Component c = null;
- switch (column) {
- case 0:
- c = new JLabel(value.toString());
- break;
- case 1:
- Equation equation = (Equation)value;
- c = new JButton(equation.getName() + "(" + equation.getCategory() + ")");
- break;
- case 2:
- Boolean bValue = (Boolean)value;
- c = new JCheckBox();
- ((JCheckBox)c).setSelected(bValue);
- break;
- default:
- throw new IndexOutOfBoundsException("No such column " + column);
- }
- return c;
- }
-
-}
1
0
r2723 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input: . metier
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 14:06:07 +0000 (Mon, 02 Nov 2009)
New Revision: 2723
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
Log:
Use species combo model.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2009-11-02 10:11:36 UTC (rev 2722)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2009-11-02 14:06:07 UTC (rev 2723)
@@ -29,17 +29,12 @@
<script><![CDATA[
import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.Formule;
-import fr.ifremer.isisfish.entities.Metier;
import fr.ifremer.isisfish.entities.MetierImpl;
-import fr.ifremer.isisfish.entities.MetierSeasonInfo;
-import fr.ifremer.isisfish.entities.MetierSeasonInfoImpl;
+import fr.ifremer.isisfish.entities.Species;
import fr.ifremer.isisfish.entities.TargetSpecies;
-import fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoTargetSpeciesModel;
-import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+import fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoTargetSpeciesTableModel;
+import fr.ifremer.isisfish.ui.input.metier.SpeciesComboModel;
import fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor;
-import javax.swing.table.DefaultTableModel;
-import fr.ifremer.isisfish.entities.Species;
tableTargetSpecies.addMouseListener(new MouseAdapter() {
@Override
@@ -72,14 +67,8 @@
}
protected void setTargetSpeciesModel() {
- DefaultComboBoxModel fieldTargetSpeciesModel = new DefaultComboBoxModel();
java.util.List<Species> species = getRegion().getSpecies();
- if (species != null){
- fieldTargetSpeciesModel.addElement(new GenericCell(" ", null, null));
- for (Species s : species){
- fieldTargetSpeciesModel.addElement(new GenericCell(s.getName(), s, Species.class));
- }
- }
+ SpeciesComboModel fieldTargetSpeciesModel = new SpeciesComboModel(species);
fieldTargetSpecies.setModel(fieldTargetSpeciesModel);
}
@@ -98,7 +87,7 @@
}
// set table model
- MetierSeasonInfoTargetSpeciesModel model = new MetierSeasonInfoTargetSpeciesModel(targetSpecies);
+ MetierSeasonInfoTargetSpeciesTableModel model = new MetierSeasonInfoTargetSpeciesTableModel(targetSpecies);
tableTargetSpecies.setModel(model);
tableTargetSpecies.setDefaultRenderer(Equation.class, model);
tableTargetSpecies.setDefaultEditor(Equation.class, new EquationTableEditor());
@@ -106,15 +95,14 @@
}
protected void add() {
- Object species = ((GenericCell)fieldTargetSpecies.getSelectedItem()).getValue();
- if (getMetierSeasonInfo() != null && species != null) {
+ Species selectedSpecies = (Species)fieldTargetSpecies.getSelectedItem();
+ if (getMetierSeasonInfo() != null && selectedSpecies != null) {
// il n'y en a pas a la creaion de la base
//Formule selectedFormule = (Formule)targetFactor.getFormuleComboBox().getSelectedItem();
getContextValue(InputAction.class).addTargetSpecies(
getBean(),
getMetierSeasonInfo(),
- (Species)species,
- /* selectedFormule.getName(), */
+ selectedSpecies,
targetFactor.getEditor().getText(),
fieldPrimaryCatch.isSelected());
setTableTargetSpeciesModel();
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java (from rev 2668, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesModel.java)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java 2009-11-02 14:06:07 UTC (rev 2723)
@@ -0,0 +1,239 @@
+/* *##%
+ * Copyright (C) 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.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.input.metier;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.Component;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableCellRenderer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.entities.Equation;
+import fr.ifremer.isisfish.entities.MetierSeasonInfo;
+import fr.ifremer.isisfish.entities.TargetSpecies;
+
+/**
+ * Table model for {@link MetierSeasonInfo}#{@link TargetSpecies}.
+ *
+ * Columns :
+ * <li>target species name</li>
+ * <li>target species equation</li>
+ * <li>target species primaryCatch</li>
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MetierSeasonInfoTargetSpeciesTableModel extends AbstractTableModel implements TableCellRenderer {
+
+ /** Log. */
+ private static Log log = LogFactory.getLog(MetierSeasonInfoTargetSpeciesTableModel.class);
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3169786638868209920L;
+
+ /** Columns names. */
+ public final static String[] COLUMN_NAMES = {
+ _("isisfish.metierSeasonInfoSpecies.species"),
+ _("isisfish.metierSeasonInfoSpecies.targetFactor"),
+ _("isisfish.metierSeasonInfoSpecies.mainSpecies") };
+
+ protected List<TargetSpecies> targetSpeciesList;
+
+ /**
+ * Empty constructor.
+ */
+ public MetierSeasonInfoTargetSpeciesTableModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with data.
+ *
+ * @param targetSpeciesList initial target species
+ */
+ public MetierSeasonInfoTargetSpeciesTableModel(
+ List<TargetSpecies> targetSpeciesList) {
+ super();
+ this.targetSpeciesList = targetSpeciesList;
+ }
+
+ /**
+ * Set target species list.
+ *
+ * @param targetSpeciesList the targetSpecies to set
+ */
+ public void setTargetSpecies(List<TargetSpecies> targetSpeciesList) {
+ this.targetSpeciesList = targetSpeciesList;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
+ @Override
+ public int getColumnCount() {
+ return COLUMN_NAMES.length;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ int rows = 0;
+ if (targetSpeciesList != null) {
+ rows = targetSpeciesList.size();
+ }
+ return rows;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+
+ Object result = null;
+
+ TargetSpecies targetSpecies = targetSpeciesList.get(rowIndex);
+ switch (columnIndex) {
+ case 0:
+ result = targetSpecies.getSpecies().getName();
+ break;
+ case 1:
+ result = targetSpecies.getTargetFactorEquation();
+ break;
+ case 2:
+ result = targetSpecies.getPrimaryCatch();
+ break;
+ default:
+ throw new IndexOutOfBoundsException("No such column " + columnIndex);
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnClass(int)
+ */
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+
+ Class<?> result = null;
+
+ switch (columnIndex) {
+ case 0:
+ result = String.class;
+ break;
+ case 1:
+ result = Equation.class;
+ break;
+ case 2:
+ result = Boolean.class;
+ break;
+ default:
+ throw new IndexOutOfBoundsException("No such column " + columnIndex);
+ }
+
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnName(int)
+ */
+ @Override
+ public String getColumnName(int columnIndex) {
+ return COLUMN_NAMES[columnIndex];
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#isCellEditable(int, int)
+ */
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return columnIndex > 0;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
+ */
+ @Override
+ public void setValueAt(Object value, int rowIndex, int columnIndex) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Cell edition (column " + columnIndex + ") = " + value);
+ }
+
+ TargetSpecies targetSpecies = targetSpeciesList.get(rowIndex);
+ switch (columnIndex) {
+ case 1:
+ Equation eq = (Equation)value;
+ // two events for event to be fired
+ targetSpecies.setTargetFactorEquation(null);
+ targetSpecies.setTargetFactorEquation(eq);
+ break;
+ case 2:
+ Boolean bValue = (Boolean)value;
+ targetSpecies.setPrimaryCatch(bValue);
+ break;
+ default:
+ throw new IndexOutOfBoundsException("Can't edit column " + columnIndex);
+ }
+
+ }
+
+ /*
+ * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
+ */
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ Component c = null;
+ switch (column) {
+ case 0:
+ c = new JLabel(value.toString());
+ break;
+ case 1:
+ Equation equation = (Equation)value;
+ c = new JButton(equation.getName() + "(" + equation.getCategory() + ")");
+ break;
+ case 2:
+ Boolean bValue = (Boolean)value;
+ c = new JCheckBox();
+ ((JCheckBox)c).setSelected(bValue);
+ break;
+ default:
+ throw new IndexOutOfBoundsException("No such column " + column);
+ }
+ return c;
+ }
+
+}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java 2009-11-02 14:06:07 UTC (rev 2723)
@@ -0,0 +1,104 @@
+/* *##%
+ * 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.metier;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+import fr.ifremer.isisfish.entities.Species;
+
+/**
+ * Model pour la liste des {@link Species}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class SpeciesComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** PopulationSeasonInfo list */
+ protected List<Species> speciesList;
+
+ /**
+ * Empty constructor.
+ */
+ public SpeciesComboModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with species list.
+ *
+ * @param speciesList species list
+ */
+ public SpeciesComboModel(List<Species> speciesList) {
+ super();
+ setPopulationSeasonInfos(speciesList);
+ }
+
+ /**
+ * Get species list.
+ *
+ * @return species list
+ */
+ public List<Species> getPopulationSeasonInfos() {
+ return speciesList;
+ }
+
+ /**
+ * Set species list.
+ *
+ * @param speciesList species list
+ */
+ public void setPopulationSeasonInfos(List<Species> speciesList) {
+ this.speciesList = speciesList;
+
+ // clear selection
+ setSelectedItem(null);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return speciesList.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (speciesList != null) {
+ size = speciesList.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
1
0
r2722 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
by chatellier@users.labs.libre-entreprise.org 02 Nov '09
02 Nov '09
Author: chatellier
Date: 2009-11-02 10:11:36 +0000 (Mon, 02 Nov 2009)
New Revision: 2722
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
Log:
Restore previous mecanism (store i18n key non-translated)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-10-30 17:12:08 UTC (rev 2721)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-11-02 10:11:36 UTC (rev 2722)
@@ -507,10 +507,10 @@
if (mat == null) {
log.debug("Capturability is null, create new matrix");
mat = MatrixFactory.getInstance().create(
- _("isisfish.population.capturability"),
+ n_("isisfish.population.capturability"),
sems,
- new String[] { _("isisfish.population.group"),
- _("isisfish.population.season") });
+ new String[] { n_("isisfish.population.group"),
+ n_("isisfish.population.season") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
@@ -518,10 +518,10 @@
log.debug("Capturability has changed, create new matrix and copy old: "
+ mat.getSemantics() + " " + sems);
MatrixND newmat = MatrixFactory.getInstance().create(
- _("isisfish.population.capturability"),
+ n_("isisfish.population.capturability"),
sems,
- new String[] { _("isisfish.population.group"),
- _("isisfish.population.season") });
+ new String[] { n_("isisfish.population.group"),
+ n_("isisfish.population.season") });
boolean allNull = true;
for (List l : mat.getSemantics()) {
@@ -559,17 +559,17 @@
mat = MatrixFactory.getInstance().create(
n_("isisfish.population.mappingZoneReproZoneRecru"),
sems,
- new String[] { _("isisfish.population.reproduction"),
- _("isisfish.population.recruitment") });
+ new String[] { n_("isisfish.population.reproduction"),
+ n_("isisfish.population.recruitment") });
// we don't call setMappingZoneReproZoneRecru because is better to create a valid
// matrix when MappingZoneReproZoneRecru is null instead check validity and
// create new one and paste the old
} else if (!Arrays.equals(mat.getSemantics(), sems)) {
MatrixND newmat = MatrixFactory.getInstance().create(
- _("isisfish.population.mappingZoneReproZoneRecru"),
+ n_("isisfish.population.mappingZoneReproZoneRecru"),
sems,
- new String[] { _("isisfish.population.reproduction"),
- _("isisfish.population.recruitment") });
+ new String[] { n_("isisfish.population.reproduction"),
+ n_("isisfish.population.recruitment") });
newmat.paste(mat);
mat = newmat;
}
@@ -588,7 +588,7 @@
int maxY = N.getDim(1);
MatrixND result = MatrixFactory.getInstance().create(
- _("isisfish.population.matrixAbundance1D"),
+ n_("isisfish.population.matrixAbundance1D"),
new int[] { 1, maxX * maxY });
for (int x = 0; x < maxX; x++) {
@@ -612,10 +612,10 @@
int nbZone = zones.size();
MatrixND result = MatrixFactory.getInstance().create(
- _("isisfish.population.matrixAbundance"),
+ n_("isisfish.population.matrixAbundance"),
new List[] { groups, zones },
- new String[] { _("isisfish.population.groups"),
- _("isisfish.population.zones") });
+ new String[] { n_("isisfish.population.groups"),
+ n_("isisfish.population.zones") });
try {
int c = 0;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-10-30 17:12:08 UTC (rev 2721)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-11-02 10:11:36 UTC (rev 2722)
@@ -77,9 +77,9 @@
if (!months.equals(oldMonths)) {
MatrixND tmp = MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.distributionSpawing"),
+ n_("isisfish.populationSeasonInfo.distributionSpawing"),
new List[] { months },
- new String[] { _("isisfish.populationSeasonInfo.months") });
+ new String[] { n_("isisfish.populationSeasonInfo.months") });
tmp.pasteSemantics(result);
result = tmp;
}
@@ -107,23 +107,23 @@
if (mat == null) {
mat = MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.migration"),
+ n_("isisfish.populationSeasonInfo.migration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.departure"),
- _("isisfish.populationSeasonInfo.arrival") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.departure"),
+ n_("isisfish.populationSeasonInfo.arrival") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
} else if (!Arrays.equals(mat.getSemantics(), sems)) {
MatrixND newmat = MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.migration"),
+ n_("isisfish.populationSeasonInfo.migration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.departure"),
- _("isisfish.populationSeasonInfo.arrival") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.departure"),
+ n_("isisfish.populationSeasonInfo.arrival") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
@@ -147,11 +147,11 @@
if (mat == null) {
mat = MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.emigration"),
+ n_("isisfish.populationSeasonInfo.emigration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.departure") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.departure") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
@@ -160,8 +160,8 @@
n_("isisfish.populationSeasonInfo.emigration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.departure") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.departure") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
@@ -185,11 +185,11 @@
if (mat == null) {
mat = MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.immigration"),
+ n_("isisfish.populationSeasonInfo.immigration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.arrival") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.arrival") });
// we don't call setCapturability because is better to create a valid
// matrix when capturability is null instead check validity and
// create new one and paste the old
@@ -198,8 +198,8 @@
n_("isisfish.populationSeasonInfo.immigration"),
sems,
new String[] {
- _("isisfish.populationSeasonInfo.group"),
- _("isisfish.populationSeasonInfo.arrival") });
+ n_("isisfish.populationSeasonInfo.group"),
+ n_("isisfish.populationSeasonInfo.arrival") });
newmat.pasteSemantics(mat);
mat = newmat;
// perhaps call setCapturability, but if possible wait the user
1
0