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
April 2011
- 2 participants
- 83 discussions
r3276 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input: . model renderer
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
20 Apr '11
Author: chatellier
Date: 2011-04-20 15:36:48 +0000 (Wed, 20 Apr 2011)
New Revision: 3276
Log:
Refactoring model.
Fix some ui (binding on validator...)
Added:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ChangeModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/EffortDescriptionListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearPopulationSelectivityModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoTargetSpeciesTableModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationSeasonInfoComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/SpeciesComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/TripTypeListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/ZoneListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/EffortDescriptionListRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierListRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierSeasonInfoComboRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/PopulationSeasonInfoComboRenderer.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/TripTypeListRenderer.java
Removed:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ChangeModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ChangeModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ChangeModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,110 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * Cette classe est utilisé pour conservé un etat de changement
+ * dans une UI, dans les cas ou les beans changent sur les validateurs et
+ * que l'etat change du validateur est reset.
+ *
+ * Elle permet aussi de se bind directement dessus (PCS);
+ *
+ * Cela permet en gros d'agregger plusieurs validateurs.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class ChangeModel {
+
+ public static final String PROPERTY_CHANGED = "changed";
+
+ public static final String PROPERTY_VALID = "valid";
+
+ protected boolean changed;
+
+ protected boolean valid = true;
+
+ /**
+ * If {@code true} true, {@link #isChanged()} will always return true.
+ */
+ protected boolean stayChanged = false;
+
+ protected PropertyChangeSupport support;
+
+ public ChangeModel() {
+ support = new PropertyChangeSupport(this);
+ }
+
+ public boolean isChanged() {
+ return changed || stayChanged;
+ }
+
+ public void setChanged(boolean changed) {
+ boolean oldValue = this.changed;
+ this.changed = changed;
+ support.firePropertyChange(PROPERTY_CHANGED, oldValue, this.changed);
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ boolean oldValue = this.valid;
+ this.valid = valid;
+ support.firePropertyChange(PROPERTY_VALID, oldValue, this.valid);
+ }
+
+ public void setStayChanged(boolean stayChanged) {
+ boolean oldValue = isChanged();
+ this.stayChanged = stayChanged;
+ support.firePropertyChange(PROPERTY_CHANGED, oldValue, isChanged());
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ support.addPropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ support.removePropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {
+ support.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {
+ support.removePropertyChangeListener(propertyName, listener);
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ChangeModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -33,8 +33,8 @@
fr.ifremer.isisfish.entities.EffortDescription;
fr.ifremer.isisfish.entities.SetOfVessels;
fr.ifremer.isisfish.types.TimeUnit;
- fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListModel;
- fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListRenderer;
+ fr.ifremer.isisfish.ui.input.model.EffortDescriptionListModel;
+ fr.ifremer.isisfish.ui.input.renderer.EffortDescriptionListRenderer;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
</import>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -32,10 +32,10 @@
fr.ifremer.isisfish.entities.EffortDescription;
fr.ifremer.isisfish.entities.SetOfVessels;
fr.ifremer.isisfish.entities.Metier;
- fr.ifremer.isisfish.ui.input.setofvessels.MetierListModel;
- fr.ifremer.isisfish.ui.input.setofvessels.MetierListRenderer;
- fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListModel;
- fr.ifremer.isisfish.ui.input.setofvessels.EffortDescriptionListRenderer;
+ fr.ifremer.isisfish.ui.input.model.MetierListModel;
+ fr.ifremer.isisfish.ui.input.renderer.MetierListRenderer;
+ fr.ifremer.isisfish.ui.input.model.EffortDescriptionListModel;
+ fr.ifremer.isisfish.ui.input.renderer.EffortDescriptionListRenderer;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
</import>
Deleted: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -1,230 +0,0 @@
-<!--
- #%L
- IsisFish
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
- %%
- 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, see
- <http://www.gnu.org/licenses/gpl-2.0.html>.
- #L%
- -->
-<fr.ifremer.isisfish.ui.input.InputContentUI superGenericType='fr.ifremer.isisfish.entities.Metier'>
-
- <!-- bean property -->
- <fr.ifremer.isisfish.entities.Metier id='bean' javaBean='null'/>
- <fr.ifremer.isisfish.entities.MetierSeasonInfo id='metierSeasonInfo' javaBean='null'/>
-
- <Boolean id='metierSeasonSelected' javaBean='false'/>
- <Boolean id='targetSpeciesSelected' javaBean='false'/>
-
- <import>
- fr.ifremer.isisfish.entities.Equation;
- fr.ifremer.isisfish.entities.Metier;
- fr.ifremer.isisfish.entities.Species;
- fr.ifremer.isisfish.entities.TargetSpecies;
- fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoTargetSpeciesTableModel;
- fr.ifremer.isisfish.ui.input.metier.SpeciesComboModel;
- fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor;
- java.beans.PropertyChangeEvent;
- java.beans.PropertyChangeListener;
- java.util.ArrayList
- java.awt.Dimension
- javax.swing.DefaultComboBoxModel
- </import>
-
- <script><![CDATA[
-
-protected void $afterCompleteSetup() {
- addPropertyChangeListener(PROPERTY_BEAN, new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getNewValue() == null) {
- setTargetSpeciesModel();
- }
- if (evt.getNewValue() != null) {
- setTableTargetSpeciesModel();
- }
- }
- });
-
- addPropertyChangeListener(PROPERTY_METIER_SEASON_INFO, new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getOldValue() != null || evt.getNewValue() == null) {
-
- }
- if (evt.getNewValue() != null) {
- setTargetSpeciesModel();
- remove.setEnabled(false);
- setAddButton();
-
- // is actif is not working for targetFactor
- // maybe set to true by addCurrentPanel
- targetFactor.setActive(targetSpeciesSelected);
- }
- }
- });
-}
-
-public void refresh() {
- //getSaveVerifier().addCurrentPanel(targetFactor);
- if (getBean() != null) {
- setTableTargetSpeciesModel();
- }
- else {
- setTargetSpeciesModel();
- }
- setTargetSpeciesModel();
- remove.setEnabled(false);
- setAddButton();
-
- // is actif is not working for targetFactor
- // maybe set to true by addCurrentPanel
- targetFactor.setActive(targetSpeciesSelected);
-}
-
-protected void setTargetSpeciesModel() {
- java.util.List<Species> species = getFisheryRegion().getSpecies();
- SpeciesComboModel fieldTargetSpeciesModel = new SpeciesComboModel(species);
- fieldTargetSpecies.setModel(fieldTargetSpeciesModel);
-}
-
-protected void setTableTargetSpeciesModel() {
- if (getMetierSeasonInfo() != null) {
- java.util.List<TargetSpecies> targetSpecies = new ArrayList<TargetSpecies>();
-
- // SpeciesTargetSpecies can be null durring region creation
- if (getMetierSeasonInfo().getSpeciesTargetSpecies() != null) {
- // move collection to list
- // and add all entity to verifier
- for (TargetSpecies oneTargetSpecies : getMetierSeasonInfo().getSpeciesTargetSpecies()) {
- getSaveVerifier().addCurrentEntity(oneTargetSpecies);
- targetSpecies.add(oneTargetSpecies);
- }
- }
-
- // set table model
- MetierSeasonInfoTargetSpeciesTableModel model = new MetierSeasonInfoTargetSpeciesTableModel(targetSpecies);
- tableTargetSpecies.setModel(model);
- tableTargetSpecies.setDefaultRenderer(Equation.class, model);
- tableTargetSpecies.setDefaultEditor(Equation.class, new EquationTableEditor());
- }
-}
-
-protected void add() {
- 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(),
- selectedSpecies,
- targetFactor.getEditor().getText(),
- fieldPrimaryCatch.isSelected());
- setTableTargetSpeciesModel();
- }
-}
-
-protected void remove() {
- if (isMetierSeasonSelected()) {
- // TODO change delete selected truc from model
- Object[] targetSpecies = getMetierSeasonInfo().getSpeciesTargetSpecies().toArray();
-
- Object o = targetSpecies[tableTargetSpecies.getSelectedRow()];
- if (o != null) {
- TargetSpecies ts = (TargetSpecies)o;
- getAction().removeTargetSpecies(getMetierSeasonInfo(), ts);
- setTableTargetSpeciesModel();
- }
- }
-}
-
-protected void targetSpeciesChanged() {
- setTargetSpeciesSelected(fieldTargetSpecies.getSelectedItem() != null);
- setTableTargetSpeciesModel();
- setAddButton();
-}
-
-protected void setAddButton() {
- add.setEnabled(isMetierSeasonSelected() && isTargetSpeciesSelected());
-}
- ]]></script>
- <JPanel id="body">
- <Table>
- <row>
- <cell fill='both' weightx='1.0' weighty='0.5'>
- <Table>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.metierSeasonInfoSpecies.selectSpecies"
- enabled='{isMetierSeasonSelected()}' decorator='boxed'/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldTargetSpecies" onActionPerformed='targetSpeciesChanged()'
- enabled='{isMetierSeasonSelected()}' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <InputOneEquationUI id='targetFactor' constructorParams='this'
- active='{isTargetSpeciesSelected()}'
- text='isisfish.metierSeasonInfoSpecies.targetFactor'
- bean='{getMetierSeasonInfo()}' formuleCategory='TargetFactor'
- clazz='{fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class}'
- decorator='boxed' _sensitivityBean='{Metier.class}' _sensitivityMethod='""'/>
- </cell>
- </row>
- <row>
- <cell fill='horizontal'>
- <JPanel/>
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldPrimaryCatch" text="isisfish.metierSeasonInfoSpecies.mainSpecies"
- enabled='{isTargetSpeciesSelected()}' decorator='boxed'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell fill='both' weightx='1.0' weighty='0.5'>
- <Table>
- <row>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="add" text="isisfish.common.add" onActionPerformed='add()'
- enabled='{isMetierSeasonSelected()}' decorator='boxed'/>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTable id="tableTargetSpecies" rowHeight='24' enabled='{isMetierSeasonSelected()}' decorator='boxed'
- onMouseReleased="remove.setEnabled(tableTargetSpecies.getSelectedRow() != -1)"/>
- </JScrollPane>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="remove" text="isisfish.common.remove"
- onActionPerformed='remove()' enabled='false' decorator='boxed'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- </Table>
- </JPanel>
-</fr.ifremer.isisfish.ui.input.InputContentUI>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -29,22 +29,33 @@
<fr.ifremer.isisfish.entities.MetierSeasonInfo id='metierSeasonInfo' javaBean='null'/>
- <Boolean id='metierSeasonInfoSelected' javaBean='false'/>
+ <fr.ifremer.isisfish.entities.Species id='species' javaBean='null'/>
<import>
- fr.ifremer.isisfish.entities.Metier;
fr.ifremer.isisfish.entities.MetierSeasonInfo;
- fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboModel;
- java.beans.PropertyChangeEvent;
- java.beans.PropertyChangeListener;
+ fr.ifremer.isisfish.ui.input.model.MetierSeasonInfoComboModel;
+ fr.ifremer.isisfish.entities.Equation;
+ fr.ifremer.isisfish.entities.Metier;
+ fr.ifremer.isisfish.entities.Species;
+ fr.ifremer.isisfish.entities.TargetSpecies;
+ fr.ifremer.isisfish.ui.input.model.MetierSeasonInfoTargetSpeciesTableModel;
+ fr.ifremer.isisfish.ui.input.model.SpeciesComboModel;
+ fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor;
+ java.beans.PropertyChangeEvent;
+ java.beans.PropertyChangeListener;
+ java.util.ArrayList
+ java.awt.Dimension
javax.swing.DefaultComboBoxModel
</import>
- <BeanValidator id='validator' context="seasonspecies"
- bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Metier'
+ <BeanValidator id='validator' context="metier"
+ bean='{getMetierSeasonInfo()}' beanClass='fr.ifremer.isisfish.entities.MetierSeasonInfo'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
</BeanValidator>
+ <ChangeModel id="changeModel" changed="{validator.isChanged()}"
+ valid="{validator.isValid()}" />
+
<script><![CDATA[
protected void $afterCompleteSetup() {
@@ -53,57 +64,94 @@
if (evt.getNewValue() == null) {
DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
fieldMetierSeasonInfo.setModel(seasonModel);
+ setMetierSeasonInfo(null);
+ setSpecies(null);
}
if (evt.getNewValue() != null) {
setSeasonModel();
+ setTargetSpeciesModel();
}
}
});
}
-/*public void refresh() {
- //Metier metier = getSaveVerifier().getEntity(Metier.class);
-
- // add null before, for second to be considered as a changed event
- // otherwize, setBean has no effect
- //setBean(null);
- //setBean(metier);
-
- getVerifier().addCurrentPanel(metierSeasonInfoSpeciesEditor);
- if (getBean() != null) {
- setSeasonModel();
- }
- else {
- DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
- fieldMetierSeasonInfo.setModel(seasonModel);
- }
-}*/
-
-protected void setSeasonModel(){
+protected void setSeasonModel() {
java.util.List<MetierSeasonInfo> metierSeasonInfo = getBean().getMetierSeasonInfo();
MetierSeasonInfoComboModel seasonModel = new MetierSeasonInfoComboModel(metierSeasonInfo);
fieldMetierSeasonInfo.setModel(seasonModel);
-
- // fix refresh() problem false, because first is null
- setMetierSeasonInfoSelected(false);
}
+
protected void metierSeasonInfoChanged() {
MetierSeasonInfo selectedMSI = (MetierSeasonInfo)fieldMetierSeasonInfo.getSelectedItem();
- setMetierSeasonInfoSelected( selectedMSI != null);
- if (isMetierSeasonInfoSelected()) {
- if (log.isDebugEnabled()) {
- log.debug("Metier season changed : " + selectedMSI);
- }
- setMetierSeasonInfo(selectedMSI);
+ setMetierSeasonInfo(selectedMSI);
+ if (selectedMSI != null) {
getSaveVerifier().addCurrentEntity(getMetierSeasonInfo());
+ setTableTargetSpeciesModel();
}
- metierSeasonInfoSpeciesEditor.refresh();
}
- at Override
-public void setLayer(boolean active) {
- super.setLayer(active);
- metierSeasonInfoSpeciesEditor.setLayer(active);
+
+protected void setTargetSpeciesModel() {
+ java.util.List<Species> species = getFisheryRegion().getSpecies();
+ SpeciesComboModel fieldTargetSpeciesModel = new SpeciesComboModel(species);
+ fieldTargetSpecies.setModel(fieldTargetSpeciesModel);
}
+
+protected void speciesChanged() {
+ Species species = (Species)fieldTargetSpecies.getSelectedItem();
+ setSpecies(species);
+}
+
+protected void setTableTargetSpeciesModel() {
+ List<TargetSpecies> targetSpecies = new ArrayList<TargetSpecies>();
+
+ // SpeciesTargetSpecies can be null durring region creation
+ if (getMetierSeasonInfo().getSpeciesTargetSpecies() != null) {
+ // move collection to list
+ // and add all entity to verifier
+ for (TargetSpecies oneTargetSpecies : getMetierSeasonInfo().getSpeciesTargetSpecies()) {
+ targetSpecies.add(oneTargetSpecies);
+ getSaveVerifier().addCurrentEntity(oneTargetSpecies);
+ oneTargetSpecies.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ changeModel.setStayChanged(true);
+ }
+ });
+ }
+ }
+
+ // set table model
+ MetierSeasonInfoTargetSpeciesTableModel model = new MetierSeasonInfoTargetSpeciesTableModel(targetSpecies);
+ tableTargetSpecies.setModel(model);
+ tableTargetSpecies.setDefaultRenderer(Equation.class, model);
+ tableTargetSpecies.setDefaultEditor(Equation.class, new EquationTableEditor());
+}
+
+protected void add() {
+ Species selectedSpecies = (Species)fieldTargetSpecies.getSelectedItem();
+ if (selectedSpecies != null) {
+ // il n'y en a pas a la creation de la base
+ //Formule selectedFormule = (Formule)targetFactor.getFormuleComboBox().getSelectedItem();
+ getContextValue(InputAction.class).addTargetSpecies(
+ getBean(),
+ getMetierSeasonInfo(),
+ selectedSpecies,
+ targetFactor.getEditor().getText(),
+ fieldPrimaryCatch.isSelected());
+ setTableTargetSpeciesModel();
+ }
+}
+
+protected void remove() {
+ // TODO change delete selected truc from model
+ Object[] targetSpecies = getMetierSeasonInfo().getSpeciesTargetSpecies().toArray();
+
+ Object o = targetSpecies[tableTargetSpecies.getSelectedRow()];
+ if (o != null) {
+ TargetSpecies ts = (TargetSpecies)o;
+ getAction().removeTargetSpecies(getMetierSeasonInfo(), ts);
+ setTableTargetSpeciesModel();
+ }
+}
]]></script>
<JPanel id="body">
<Table>
@@ -111,22 +159,65 @@
<cell columns="2" fill='both' weightx='1.0' weighty='0.5'>
<Table>
<row>
- <cell fill='horizontal' anchor='east'>
+ <cell fill='horizontal'>
<JLabel text="isisfish.metierSeasonInfoSpecies.selectSeason" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldMetierSeasonInfo" onActionPerformed='metierSeasonInfoChanged()'
- renderer="{new fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboRenderer()}" enabled='{isActive()}'/>
+ <JComboBox id="fieldMetierSeasonInfo" onItemStateChanged='metierSeasonInfoChanged()'
+ renderer="{new fr.ifremer.isisfish.ui.input.renderer.MetierSeasonInfoComboRenderer()}" enabled='{isActive()}'/>
</cell>
</row>
<row>
+ <cell fill='horizontal'>
+ <JLabel text="isisfish.metierSeasonInfoSpecies.selectSpecies"
+ enabled='{getMetierSeasonInfo() != null}' decorator='boxed'/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldTargetSpecies" onItemStateChanged='speciesChanged()'
+ enabled='{getMetierSeasonInfo() != null}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
<cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <MetierSeasonInfoSpeciesEditorUI id='metierSeasonInfoSpeciesEditor' constructorParams='this'
- bean='{getBean()}' metierSeasonInfo='{getMetierSeasonInfo()}' metierSeasonSelected='{isMetierSeasonInfoSelected()}'
- active='{isActive()}'
- _sensitivityBean='{MetierSeasonInfo.class}' _sensitivityMethod='"SpeciesTargetSpecies"'/>
+ <InputOneEquationUI id='targetFactor' constructorParams='this'
+ active='{isActive() && getMetierSeasonInfo() != null}'
+ text='isisfish.metierSeasonInfoSpecies.targetFactor'
+ bean='{getMetierSeasonInfo()}' formuleCategory='TargetFactor'
+ clazz='{fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class}'
+ decorator='boxed'/>
</cell>
</row>
+ <row>
+ <cell fill='horizontal'>
+ <JPanel/>
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JCheckBox id="fieldPrimaryCatch" text="isisfish.metierSeasonInfoSpecies.mainSpecies"
+ enabled='{getMetierSeasonInfo() != null}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JButton id="add" text="isisfish.common.add" onActionPerformed='add()'
+ enabled='{getMetierSeasonInfo() != null && getSpecies() != null}' decorator='boxed'/>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
+ <JTable id="tableTargetSpecies" rowHeight='24' enabled='{getMetierSeasonInfo() != null}'
+ decorator='boxed'/>
+ <ListSelectionModel initializer="tableTargetSpecies.getSelectionModel()"
+ onValueChanged="remove.setEnabled(tableTargetSpecies.getSelectedRow() != -1)" />
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JButton id="remove" text="isisfish.common.remove"
+ onActionPerformed='remove()' enabled='false' decorator='boxed'/>
+ </cell>
+ </row>
</Table>
</cell>
</row>
@@ -134,13 +225,13 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='save' decorator='boxed'
text="isisfish.common.save"
- enabled="{validator.isValid() && validator.isChanged()}"
- onActionPerformed="getSaveVerifier().save();validator.setChanged(false);"/>
+ enabled="{changeModel.isValid() && changeModel.isChanged()}"
+ onActionPerformed="getSaveVerifier().save();validator.setChanged(false);changeModel.setStayChanged(false);"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='cancel' decorator='boxed'
text="isisfish.common.cancel"
- enabled="{validator.isChanged()}"
+ enabled="{changeModel.isChanged()}"
onActionPerformed="getSaveVerifier().cancel()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -35,7 +35,8 @@
fr.ifremer.isisfish.entities.Season;
fr.ifremer.isisfish.entities.Zone;
fr.ifremer.isisfish.types.Month;
- fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboModel;
+ fr.ifremer.isisfish.ui.input.model.MetierSeasonInfoComboModel;
+ fr.ifremer.isisfish.ui.input.model.ZoneListModel;
fr.ifremer.isisfish.ui.widget.Interval;
fr.ifremer.isisfish.ui.widget.IntervalPanel;
java.beans.PropertyChangeEvent;
@@ -43,12 +44,20 @@
java.util.ArrayList
java.awt.Dimension
</import>
-
- <BeanValidator id='validator' context="seasonzones"
+
+ <BeanValidator id='validator' context="metier"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Metier'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
</BeanValidator>
+ <BeanValidator id='validatorSeason' context="metier"
+ bean='{getMetierSeasonInfo()}' beanClass='fr.ifremer.isisfish.entities.MetierSeasonInfo'
+ uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
+ </BeanValidator>
+
+ <ChangeModel id="changeModel" changed="{validator.isChanged() || validatorSeason.isChanged()}"
+ valid="{validator.isValid() && validatorSeason.isValid()}" />
+
<script><![CDATA[
protected Interval interval = null;
@@ -173,7 +182,16 @@
for (ListSelectionListener listener : listeners) {
metierZones.removeListSelectionListener(listener);
}
- metierZones.fillList(getFisheryRegion().getZone(), getMetierSeasonInfo().getZone());
+
+ List<Zone> allZones = getFisheryRegion().getZone();
+ ZoneListModel model = new ZoneListModel(allZones);
+ metierZones.setModel(model);
+ // restore selection
+ for (Zone zone : metierSeasonInfo.getZone()) {
+ int index = allZones.indexOf(zone);
+ metierZones.getSelectionModel().addSelectionInterval(index, index);
+ }
+
for (ListSelectionListener listener : listeners) {
metierZones.addListSelectionListener(listener);
}
@@ -214,8 +232,8 @@
<JLabel text="isisfish.metierSeasonInfoZone.selectSeason" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="metierSeasonInfoCombo" onItemStateChanged='seasonChanged()' enabled='{isActive()}'
- renderer="{new fr.ifremer.isisfish.ui.input.metier.MetierSeasonInfoComboRenderer()}" />
+ <JComboBox id="metierSeasonInfoCombo" onItemStateChanged='seasonChanged()' enabled='{isActive() && !changeModel.isChanged()}'
+ renderer="{new fr.ifremer.isisfish.ui.input.renderer.MetierSeasonInfoComboRenderer()}" />
</cell>
</row>
<row>
@@ -232,7 +250,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.7'>
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JAXXList id="metierZones" onValueChanged='metierZonesChanged()'
+ <JList id="metierZones" onValueChanged='metierZonesChanged()'
enabled='{getMetierSeasonInfo() != null}' decorator='boxed'/>
</JScrollPane>
</cell>
@@ -260,13 +278,13 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='save' decorator='boxed'
text="isisfish.common.save"
- enabled="{validator.isValid() && validator.isChanged()}"
- onActionPerformed="save();validator.setChanged(false);"/>
+ enabled="{changeModel.isValid() && changeModel.isChanged()}"
+ onActionPerformed="save();validator.setChanged(false);validatorSeason.setChanged(false);"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='cancel' decorator='boxed'
text="isisfish.common.cancel"
- enabled="{validator.isChanged()}"
+ enabled="{changeModel.isChanged()}"
onActionPerformed="getSaveVerifier().cancel()"/>
</cell>
</row>
@@ -274,7 +292,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='create' decorator='boxed'
text="isisfish.common.new"
- enabled="{!validator.isChanged()}"
+ enabled="{!changeModel.isChanged()}"
onActionPerformed="create()"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -30,6 +30,7 @@
<import>
fr.ifremer.isisfish.entities.Gear;
fr.ifremer.isisfish.entities.Metier;
+ fr.ifremer.isisfish.ui.input.model.GearComboModel;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
java.awt.Dimension
@@ -42,8 +43,6 @@
</BeanValidator>
<script><![CDATA[
-
-
protected boolean init = false;
protected void $afterCompleteSetup() {
@@ -54,7 +53,9 @@
}
if (evt.getNewValue() != null) {
init = true;
- jaxx.runtime.SwingUtil.fillComboBox(fieldMetierGear, getFisheryRegion().getGear(), getBean().getGear(), true);
+ GearComboModel model = new GearComboModel(getFisheryRegion().getGear());
+ fieldMetierGear.setModel(model);
+ model.setSelectedItem(bean.getGear());
init = false;
}
}
@@ -101,7 +102,7 @@
<JLabel text="isisfish.common.gear" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JAXXComboBox id="fieldMetierGear" onActionPerformed='gearChanged()'
+ <JComboBox id="fieldMetierGear" onItemStateChanged='gearChanged()'
enabled='{isActive()}' decorator='boxed'/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -57,7 +57,7 @@
addPropertyChangeListener(PROPERTY_BEAN, new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getNewValue() == null) {
-
+ setPopulationGroup(null);
}
if (evt.getNewValue() != null) {
if (getBean().getPopulationGroup() != null) {
@@ -120,8 +120,8 @@
*/
protected void populationGroupChanged() {
PopulationGroup selectedPopulationGroup = (PopulationGroup)populationGroupPopulationGroupComboBox.getSelectedItem();
+ setPopulationGroup(selectedPopulationGroup);
if (selectedPopulationGroup != null) {
- setPopulationGroup(selectedPopulationGroup);
getSaveVerifier().addCurrentEntity(selectedPopulationGroup);
setNaturalDeathRateMatrix();
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEmigrationUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -61,8 +61,8 @@
public void init(PopulationSeasonInfo pi){
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
- setPopInfo(null);
- setPopInfo(pi);
+ //setPopInfo(null);
+ //setPopInfo(pi);
populationMigrationEmigrationTable.setMatrix(getPopInfo().getEmigrationMatrix().copy());
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationEquationUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -26,6 +26,7 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Population id='bean' javaBean='null'/>
+
<fr.ifremer.isisfish.entities.PopulationSeasonInfo id='popInfo' javaBean='null'/>
<import>
@@ -37,8 +38,8 @@
public void init(PopulationSeasonInfo populationSeasonInfo) {
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
- setPopInfo(null);
- setPopInfo(populationSeasonInfo);
+ //setPopInfo(null);
+ //setPopInfo(populationSeasonInfo);
}
/*public void refresh() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -67,8 +67,8 @@
public void init(PopulationSeasonInfo populationSeasonInfo) {
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
- setPopInfo(null);
- setPopInfo(populationSeasonInfo);
+ //setPopInfo(null);
+ //setPopInfo(populationSeasonInfo);
populationMigrationImmigrationTable.setMatrix(getPopInfo().getImmigrationMatrix().copy());
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -44,6 +44,7 @@
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
org.nuiton.math.matrix.gui.MatrixPanelListener;
+ javax.swing.text.Document
</import>
<script><![CDATA[
@@ -54,7 +55,7 @@
populationMigrationMigrationTable.setMatrix(null);
}
if (evt.getNewValue() != null) {
-
+ refreshPanel();
}
}
});
@@ -68,8 +69,8 @@
public void init(PopulationSeasonInfo pi) {
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
- setPopInfo(null);
- setPopInfo(pi);
+ //setPopInfo(null);
+ //setPopInfo(pi);
if (getPopInfo() != null && getPopInfo().getMigrationMatrix() != null){
populationMigrationMigrationTable.setMatrix(getPopInfo().getMigrationMatrix().copy());
@@ -91,8 +92,8 @@
//populationMigrationMigrationTable.addMatrixListener(listener);
- remove.setEnabled(false);
- setAddButton();
+ //remove.setEnabled(false);
+ //setAddButton();
}
protected void setFieldPopulationMigrationMigrationGroupChooserModel(){
if (getBean() != null && getBean().getPopulationGroup() != null){
@@ -128,7 +129,7 @@
getPopInfo().setMigrationMatrix(mat);
remove.setEnabled(false);
}
-protected void groupChanged(){
+/*protected void groupChanged(){
setGPopSelected(fieldPopulationMigrationMigrationGroupChooser.getSelectedItem() != null);
setAddButton();
}
@@ -143,10 +144,14 @@
protected void zoneArrivalChanged(){
setZoneArrivalSelected(fieldPopulationMigrationMigrationArrivalZoneChooser.getSelectedItem() != null);
setAddButton();
+}*/
+protected void setAddButton() {
+ add.setEnabled(isActive() &&
+ fieldPopulationMigrationMigrationGroupChooser.getSelectedItem() != null &&
+ !fieldPopulationMigrationMigrationCoefficient.getText().equals("") &&
+ fieldPopulationMigrationMigrationDepartureZoneChooser.getSelectedItem() != null &&
+ fieldPopulationMigrationMigrationArrivalZoneChooser.getSelectedItem() != null);
}
-protected void setAddButton(){
- add.setEnabled(getGPopSelected() && getZoneDepartSelected() && getZoneArrivalSelected() && getCoefNonVide());
-}
]]>
</script>
<JPanel id="body">
@@ -156,13 +161,17 @@
<JLabel text="isisfish.common.populationGroup" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JAXXComboBox id="fieldPopulationMigrationMigrationGroupChooser" enabled='{isActive()}' onActionPerformed='groupChanged()'/>
+ <JAXXComboBox id="fieldPopulationMigrationMigrationGroupChooser" enabled='{isActive()}'
+ onItemStateChanged="setAddButton()"/>
</cell>
<cell>
<JLabel text="isisfish.populationMigrationMigration.coefficient" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldPopulationMigrationMigrationCoefficient" enabled='{isActive()}' onKeyReleased='coefChanged()'/>
+ <JTextField id="fieldPopulationMigrationMigrationCoefficient" enabled='{isActive()}'/>
+ <Document initializer="fieldPopulationMigrationMigrationCoefficient.getDocument()"
+ onInsertUpdate='setAddButton()'
+ onRemoveUpdate='setAddButton()' />
</cell>
</row>
<row>
@@ -170,18 +179,20 @@
<JLabel text="isisfish.populationMigrationMigration.departureZone" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JAXXComboBox id="fieldPopulationMigrationMigrationDepartureZoneChooser" enabled='{isActive()}' onActionPerformed='zoneDepartueChanged()'/>
+ <JAXXComboBox id="fieldPopulationMigrationMigrationDepartureZoneChooser" enabled='{isActive()}'
+ onItemStateChanged="setAddButton()"/>
</cell>
<cell>
<JLabel text="isisfish.populationMigrationMigration.arrivalZone" enabled='{isActive()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JAXXComboBox id="fieldPopulationMigrationMigrationArrivalZoneChooser" enabled='{isActive()}' onActionPerformed='zoneArrivalChanged()'/>
+ <JAXXComboBox id="fieldPopulationMigrationMigrationArrivalZoneChooser" enabled='{isActive()}'
+ onItemStateChanged="setAddButton()"/>
</cell>
</row>
<row columns='4'>
<cell fill='horizontal' weightx='1.0'>
- <JButton id="add" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActive()}'/>
+ <JButton id="add" text="isisfish.common.add" onActionPerformed='add()' enabled='false'/>
</cell>
</row>
<row columns='4'>
@@ -189,12 +200,12 @@
<org.nuiton.math.matrix.gui.MatrixPanelEditor id ='populationMigrationMigrationTable'
linearModel='{true}' enabled='{isActive()}'
onMatrixChanged="populationMigrationMigrationMatrixChanged(event)"
- onMouseReleased="remove.setEnabled(populationMigrationMigrationTable.getTable().getSelectedRow() != -1)"/>
+ onMouseReleased="remove.setEnabled(isActive() && populationMigrationMigrationTable.getTable().getSelectedRow() != -1)"/>
</cell>
</row>
<row>
<cell columns='4' fill='horizontal' weightx='1.0'>
- <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActive()}'/>
+ <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' />
</cell>
</row>
</Table>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -26,15 +26,14 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Population id='bean' javaBean='null'/>
- <fr.ifremer.isisfish.entities.PopulationSeasonInfo id='popInfo' javaBean='null'/>
- <Boolean id="selectedPopulationSeasonInfo" javaBean='false' />
+ <fr.ifremer.isisfish.entities.PopulationSeasonInfo id='popInfo' javaBean='null'/>
<import>
fr.ifremer.isisfish.entities.PopulationSeasonInfo;
fr.ifremer.isisfish.entities.Population;
- fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboModel;
- fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboRenderer;
+ fr.ifremer.isisfish.ui.input.model.PopulationSeasonInfoComboModel;
+ fr.ifremer.isisfish.ui.input.renderer.PopulationSeasonInfoComboRenderer;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
java.awt.CardLayout
@@ -88,13 +87,6 @@
else {
model.setPopulationSeasonInfos(null);
}
-
- //getSaveVerifier().addCurrentPanel(populationMigrationEquationUI, populationMigrationMigrationUI, populationMigrationImmigrationUI, populationMigrationEmigrationUI);
- // addCurrentPanel set all to isActive()
- // force it to isSelectedPopulationSeasonInfo()
- // twice for real change event :(
- setSelectedPopulationSeasonInfo(fieldPopulationMigrationSeasonChooser.getModel().getSelectedItem() == null);
- setSelectedPopulationSeasonInfo(fieldPopulationMigrationSeasonChooser.getModel().getSelectedItem() != null);
}
protected void seasonChanged() {
@@ -107,12 +99,7 @@
populationMigrationMigrationUI.init(getPopInfo());
populationMigrationImmigrationUI.init(getPopInfo());
populationMigrationEmigrationUI.init(getPopInfo());
-
- setSelectedPopulationSeasonInfo(isActive());
}
- else {
- setSelectedPopulationSeasonInfo(false);
- }
refreshHidablePanel();
}
protected void useEquationChanged() {
@@ -155,28 +142,32 @@
<row>
<cell columns='2' anchor='west'>
<JCheckBox id="fieldUseEquationMigration" selected='{getPopInfo().getUseEquationMigration()}'
- text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()' enabled='{isSelectedPopulationSeasonInfo()}' decorator='boxed'/>
+ text="isisfish.populationMigration.useEquation" onActionPerformed='useEquationChanged()'
+ enabled='{getPopInfo() != null}' decorator='boxed'/>
</cell>
</row>
<row>
<cell columns='2' fill='both' weightx='1.0' weighty='0.7'>
<JPanel id="hidablePanel" layout='{new CardLayout()}'>
- <JTabbedPane id="fieldUseMatrix" constraints='"fieldUseMatrix"' enabled='{isSelectedPopulationSeasonInfo()}'>
+ <JTabbedPane id="fieldUseMatrix" constraints='"fieldUseMatrix"' enabled='{getPopInfo() != null}'>
<tab title='{_("isisfish.populationMigrationMigration.title")}'>
<PopulationMigrationMigrationUI id="populationMigrationMigrationUI" constructorParams='this' decorator='boxed'
- _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"MigrationMatrix"' active='{isSelectedPopulationSeasonInfo()}' />
+ bean="{getBean()}" popInfo="{getPopInfo()}" active="{isActive() && getPopInfo() != null}"
+ _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"MigrationMatrix"' />
</tab>
<tab title='{_("isisfish.populationMigrationImmigration.title")}'>
<PopulationMigrationImmigrationUI id="populationMigrationImmigrationUI" constructorParams='this' decorator='boxed'
- _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"ImmigrationMatrix"' active='{isSelectedPopulationSeasonInfo()}' />
+ bean="{getBean()}" popInfo="{getPopInfo()}" active="{isActive() && getPopInfo() != null}"
+ _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"ImmigrationMatrix"' />
</tab>
<tab title='{_("isisfish.populationMigrationEmigration.title")}'>
<PopulationMigrationEmigrationUI id="populationMigrationEmigrationUI" constructorParams='this' decorator='boxed'
- _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"EmigrationMatrix"' active='{isSelectedPopulationSeasonInfo()}' />
+ bean="{getBean()}" popInfo="{getPopInfo()}" active="{isActive() && getPopInfo() != null}"
+ _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"EmigrationMatrix"' />
</tab>
</JTabbedPane>
<PopulationMigrationEquationUI id='populationMigrationEquationUI' constraints='"fieldUseEquation"' constructorParams='this'
- active='{isSelectedPopulationSeasonInfo()}' />
+ bean="{getBean()}" popInfo="{getPopInfo()}" active="{isActive() && getPopInfo() != null}" />
</JPanel>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -117,7 +117,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.5'>
<org.nuiton.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationRecruitmentDistribution'
- matrix='{getBean().getRecruitmentDistribution() == null ? null : getBean().getRecruitmentDistribution().copy()}'
+ matrix='{getBean() == null ? null : bean.getRecruitmentDistribution().copy()}'
enabled='{isActive()}' decorator='boxed' _sensitivityBean='{Population.class}' _sensitivityMethod='"RecruitmentDistribution"'
onMatrixChanged="populationRecruitmentDistributionMatrixChanged(event)" />
</cell>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -32,7 +32,7 @@
<import>
java.beans.PropertyChangeEvent
java.beans.PropertyChangeListener
- fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboModel
+ fr.ifremer.isisfish.ui.input.model.PopulationSeasonInfoComboModel
fr.ifremer.isisfish.entities.PopulationSeasonInfo
fr.ifremer.isisfish.types.Month
fr.ifremer.isisfish.entities.Population
@@ -257,7 +257,7 @@
<cell fill='horizontal' weightx='1.0'>
<JComboBox id="fieldPopulationSeasonInfoChooser"
onItemStateChanged='seasonChanged()' enabled='{isActive()}'
- renderer="{new fr.ifremer.isisfish.ui.input.population.PopulationSeasonInfoComboRenderer()}"/>
+ renderer="{new fr.ifremer.isisfish.ui.input.renderer.PopulationSeasonInfoComboRenderer()}"/>
</cell>
</row>
<row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesEditorUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -29,7 +29,7 @@
<import>
fr.ifremer.isisfish.entities.Zone;
- fr.ifremer.isisfish.ui.input.population.ZoneListModel;
+ fr.ifremer.isisfish.ui.input.model.ZoneListModel;
org.nuiton.math.matrix.gui.MatrixPanelEvent;
org.nuiton.math.matrix.gui.MatrixPanelListener;
java.beans.PropertyChangeEvent;
Deleted: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -1,188 +0,0 @@
-<!--
- #%L
- IsisFish
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2009 - 2011 Ifremer, Code Lutin, Chatellier Eric
- %%
- 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, see
- <http://www.gnu.org/licenses/gpl-2.0.html>.
- #L%
- -->
-<fr.ifremer.isisfish.ui.input.InputContentUI superGenericType='Gear'>
-
- <!-- bean property -->
- <fr.ifremer.isisfish.entities.Gear id='bean' javaBean='null'/>
-
- <fr.ifremer.isisfish.entities.Population id='population' javaBean='null'/>
-
- <import>
- fr.ifremer.isisfish.entities.Equation
- fr.ifremer.isisfish.entities.Gear
- fr.ifremer.isisfish.entities.Population
- fr.ifremer.isisfish.entities.Selectivity
- fr.ifremer.isisfish.entities.Species
- fr.ifremer.isisfish.ui.input.gear.GearPopulationSelectivityModel
- fr.ifremer.isisfish.ui.input.gear.PopulationComboModel
- fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor
- java.beans.PropertyChangeEvent
- java.beans.PropertyChangeListener
- java.util.ArrayList
- javax.swing.DefaultComboBoxModel
- </import>
-
- <script><![CDATA[
-protected void $afterCompleteSetup() {
- addPropertyChangeListener(PROPERTY_BEAN, new PropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getNewValue() == null) {
-
- }
- if (evt.getNewValue() != null) {
- refresh();
- }
- }
- });
-}
-
-/*selectivityTable.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseReleased(MouseEvent e) {
- // le bouton ne doit pas s'activer dans l'analyse de sensibilite
- if (isActive()) {
- removeSelectivityButton.setEnabled(selectivityTable.getSelectedRow() != -1);
- }
- }
-});*/
-
-public void refresh() {
-
- Gear gear = (Gear)getSaveVerifier().getEntity(Gear.class);
-
- // add null before, for second to be considered as a changed event
- // otherwize, setBean has no effect
- //setBean(null);
- //setBean(gear);
-
- if (getBean() != null) {
- setSelectivityTableModel();
- fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
- }
- //getSaveVerifier().addCurrentPanel(selectivityEquation);
-
- // reset to false after addCurrentPanel refresh
- selectivityEquation.setActive(false);
-
- removeSelectivityButton.setEnabled(false);
-}
-
-protected void setSelectivityTableModel() {
-
- java.util.List<Selectivity> selectivitiesList = new ArrayList<Selectivity>();
-
- // set model even if no selectivity
- // to clear data
- if (getBean().getPopulationSelectivity() != null){
- // move collection to list
- // and add all entity to verifier
- for (Selectivity oneSelectivity : getBean().getPopulationSelectivity()) {
- getSaveVerifier().addCurrentEntity(oneSelectivity);
- selectivitiesList.add(oneSelectivity);
- }
- }
-
- // set table model
- GearPopulationSelectivityModel model = new GearPopulationSelectivityModel(selectivitiesList);
- selectivityTable.setModel(model);
- selectivityTable.setDefaultRenderer(Equation.class, model);
- selectivityTable.setDefaultEditor(Equation.class, new EquationTableEditor());
-}
-
-protected void addSelectivity() {
- getAction().addSelectivity(getPopulation(), selectivityEquation.getEditor().getText(), getBean());
- setSelectivityTableModel();
-}
-
-protected void removeSelectivity() {
- GearPopulationSelectivityModel model = (GearPopulationSelectivityModel)selectivityTable.getModel();
- Selectivity selectedSelectivity = model.getSelectivities().get(selectivityTable.getSelectedRow());
- getAction().removeSelectivity(getBean(), selectedSelectivity);
- setSelectivityTableModel();
- removeSelectivityButton.setEnabled(false);
-}
-
-protected DefaultComboBoxModel getSelectivityPopulationModel() {
- java.util.List<Species> species = getFisheryRegion().getSpecies();
- java.util.List<Population> populations = new ArrayList<Population>();
- if (species != null) {
- for (Species s : species) {
- if (s.getPopulation() != null) {
- populations.addAll(s.getPopulation());
- }
- }
- }
- PopulationComboModel selectivityPopulationModel = new PopulationComboModel(populations);
- return selectivityPopulationModel;
-}
-
-protected void selectivityChanged() {
- setPopulation((Population)fieldSelectivityPopulation.getSelectedItem());
- addSelectivityButton.setEnabled(getPopulation() != null);
-}
- ]]></script>
- <JPanel id='body'>
- <Table>
- <row>
- <cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.selectivity.selectPopulation" enabled='{isActive()}' decorator='boxed' />
- </cell>
- <cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSelectivityPopulation" onActionPerformed='selectivityChanged()' enabled='{isActive()}'
- decorator='boxed' />
- </cell>
- </row>
- <row>
- <cell columns='2' fill='both' weightx='1.0' weighty='1.0' insets="0">
- <InputOneEquationUI id='selectivityEquation' constructorParams='this'
- text='isisfish.selectivity.equation'
- bean='{getBean()}' formuleCategory='Selectivity' active='{getPopulation() != null}'
- clazz='{fr.ifremer.isisfish.equation.SelectivityEquation.class}'
- decorator='boxed' />
- </cell>
- </row>
- <row>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="addSelectivityButton" text="isisfish.common.add" onActionPerformed='addSelectivity()'
- enabled='{getPopulation() != null}' decorator='boxed' />
- </cell>
- </row>
- <row>
- <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
- <JScrollPane>
- <JTable id="selectivityTable" rowHeight='24' enabled='{isActive()}'
- decorator='boxed' />
- </JScrollPane>
- </cell>
- </row>
- <row>
- <cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="removeSelectivityButton" text="isisfish.common.remove" onActionPerformed='removeSelectivity()'
- enabled='{isActive() && selectivityTable.getSelectedRow() != -1}' decorator='boxed' />
- </cell>
- </row>
- </Table>
- </JPanel>
-</fr.ifremer.isisfish.ui.input.InputContentUI>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -27,39 +27,164 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Gear id='bean' javaBean='null'/>
+ <fr.ifremer.isisfish.entities.Population id='population' javaBean='null'/>
+
<BeanValidator id='validator' context="selectivity"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Gear'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
</BeanValidator>
<import>
+ fr.ifremer.isisfish.entities.Equation
fr.ifremer.isisfish.entities.Gear
+ fr.ifremer.isisfish.entities.Population
+ fr.ifremer.isisfish.entities.Selectivity
+ fr.ifremer.isisfish.entities.Species
+ fr.ifremer.isisfish.ui.input.model.GearPopulationSelectivityModel
+ fr.ifremer.isisfish.ui.input.model.PopulationComboModel
+ fr.ifremer.isisfish.ui.widget.editor.EquationTableEditor
+ java.beans.PropertyChangeEvent
+ java.beans.PropertyChangeListener
+ java.util.ArrayList
+ javax.swing.DefaultComboBoxModel
</import>
<script><![CDATA[
-/*public void refresh() {
+protected void $afterCompleteSetup() {
+ addPropertyChangeListener(PROPERTY_BEAN, new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getNewValue() == null) {
+ setPopulation(null);
+ selectivityTable.setModel(new GearPopulationSelectivityModel());
+ }
+ if (evt.getNewValue() != null) {
+ refresh();
+ }
+ }
+ });
+}
+
+public void refresh() {
+
Gear gear = (Gear)getSaveVerifier().getEntity(Gear.class);
-
+
// add null before, for second to be considered as a changed event
// otherwize, setBean has no effect
- setBean(null);
- setBean(gear);
+ //setBean(null);
+ //setBean(gear);
+
+ if (getBean() != null) {
+ setSelectivityTableModel();
+ fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
+ }
+}
+
+protected void setSelectivityTableModel() {
- getSaveVerifier().addCurrentPanel(editor);
-}*/
+ java.util.List<Selectivity> selectivitiesList = new ArrayList<Selectivity>();
+
+ // set model even if no selectivity
+ // to clear data
+ if (getBean().getPopulationSelectivity() != null) {
+ // move collection to list
+ // and add all entity to verifier
+ for (Selectivity oneSelectivity : getBean().getPopulationSelectivity()) {
+ getSaveVerifier().addCurrentEntity(oneSelectivity);
+ selectivitiesList.add(oneSelectivity);
- at Override
-public void setLayer(boolean active) {
- super.setLayer(active);
- editor.setLayer(active);
+ // hack to enable save button :(
+ oneSelectivity.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ validator.setChanged(true);
+ }
+ });
+ }
+ }
+
+ // set table model
+ GearPopulationSelectivityModel model = new GearPopulationSelectivityModel(selectivitiesList);
+ selectivityTable.setModel(model);
+ selectivityTable.setDefaultRenderer(Equation.class, model);
+ selectivityTable.setDefaultEditor(Equation.class, new EquationTableEditor());
}
+
+protected void addSelectivity() {
+ getAction().addSelectivity(getPopulation(), selectivityEquation.getEditor().getText(), getBean());
+ setSelectivityTableModel();
+}
+
+protected void removeSelectivity() {
+ GearPopulationSelectivityModel model = (GearPopulationSelectivityModel)selectivityTable.getModel();
+ Selectivity selectedSelectivity = model.getSelectivities().get(selectivityTable.getSelectedRow());
+ getAction().removeSelectivity(getBean(), selectedSelectivity);
+ setSelectivityTableModel();
+ removeSelectivityButton.setEnabled(false);
+}
+
+protected DefaultComboBoxModel getSelectivityPopulationModel() {
+ java.util.List<Species> species = getFisheryRegion().getSpecies();
+ java.util.List<Population> populations = new ArrayList<Population>();
+ if (species != null) {
+ for (Species s : species) {
+ if (s.getPopulation() != null) {
+ populations.addAll(s.getPopulation());
+ }
+ }
+ }
+ PopulationComboModel selectivityPopulationModel = new PopulationComboModel(populations);
+ return selectivityPopulationModel;
+}
+
+protected void selectivityChanged() {
+ setPopulation((Population)fieldSelectivityPopulation.getSelectedItem());
+}
]]></script>
<JPanel id='body'>
<Table>
<row>
<cell columns="2" fill='both' weightx='1.0' weighty='1.0'>
- <SelectivityEditorUI id='editor' constructorParams='this' bean='{getBean()}' active="{isActive()}"
- _sensitivityBean='{Gear.class}' _sensitivityMethod='"PopulationSelectivity"'/>
+ <Table>
+ <row>
+ <cell fill='horizontal' anchor='east'>
+ <JLabel text="isisfish.selectivity.selectPopulation" enabled='{isActive()}' decorator='boxed' />
+ </cell>
+ <cell fill='horizontal' weightx='1.0'>
+ <JComboBox id="fieldSelectivityPopulation" onItemStateChanged='selectivityChanged()'
+ enabled='{isActive()}' decorator='boxed' />
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weightx='1.0' weighty='1.0' insets="0">
+ <InputOneEquationUI id='selectivityEquation' constructorParams='this'
+ text='isisfish.selectivity.equation'
+ bean='{getBean()}' formuleCategory='Selectivity' active='{getPopulation() != null}'
+ clazz='{fr.ifremer.isisfish.equation.SelectivityEquation.class}'
+ decorator='boxed' />
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JButton id="addSelectivityButton" text="isisfish.common.add" onActionPerformed='addSelectivity()'
+ enabled='{getPopulation() != null}' decorator='boxed' />
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='both' weightx='1.0' weighty='1.0'>
+ <JScrollPane>
+ <JTable id="selectivityTable" rowHeight='24' enabled='{isActive()}'
+ decorator='boxed' />
+ <ListSelectionModel initializer='selectivityTable.getSelectionModel()'
+ onValueChanged="removeSelectivityButton.setEnabled(isActive() && selectivityTable.getSelectedRow() != -1)" />
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns='2' fill='horizontal' weightx='1.0'>
+ <JButton id="removeSelectivityButton" text="isisfish.common.remove" onActionPerformed='removeSelectivity()'
+ enabled='false' decorator='boxed' />
+ </cell>
+ </row>
+ </Table>
</cell>
</row>
<row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-20 15:32:27 UTC (rev 3275)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-20 15:36:48 UTC (rev 3276)
@@ -32,7 +32,7 @@
fr.ifremer.isisfish.entities.VesselType
fr.ifremer.isisfish.entities.TripType
fr.ifremer.isisfish.types.TimeUnit
- fr.ifremer.isisfish.ui.input.triptype.TripTypeListModel
+ fr.ifremer.isisfish.ui.input.model.TripTypeListModel
jaxx.runtime.swing.editor.NumberEditor
java.beans.PropertyChangeEvent
java.beans.PropertyChangeListener
@@ -210,7 +210,7 @@
<JScrollPane>
<JAXXList id="vesselTypeTripType" selectedValues='{getBean().getTripType() == null ? null : getBean().getTripType().toArray()}'
onMouseClicked='tripTypeChanged()'
- cellRenderer="{new fr.ifremer.isisfish.ui.input.triptype.TripTypeListRenderer()}"
+ cellRenderer="{new fr.ifremer.isisfish.ui.input.renderer.TripTypeListRenderer()}"
enabled='{isActive()}' decorator='boxed' _sensitivityBean='{VesselType.class}' _sensitivityMethod='"TripType"'/>
</JScrollPane>
</cell>
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/EffortDescriptionListModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/EffortDescriptionListModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/EffortDescriptionListModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,106 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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) {
+ 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;
+ }
+}
Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearComboModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, CodeLutin, Chatellier Eric
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+import fr.ifremer.isisfish.entities.Gear;
+
+/**
+ * Model pour la liste des {@link Gear}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class GearComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** Species list */
+ protected List<Gear> gearList;
+
+ /**
+ * Constructor with gears list.
+ *
+ * @param gearList gears list
+ */
+ public GearComboModel(List<Gear> gearList) {
+ this.gearList = gearList;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return gearList.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (gearList != null) {
+ size = gearList.size();
+ }
+ return size;
+ }
+}
Property changes on: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearComboModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearPopulationSelectivityModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/GearPopulationSelectivityModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearPopulationSelectivityModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/GearPopulationSelectivityModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,259 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.awt.Component;
+import java.util.List;
+
+import javax.swing.JButton;
+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.Gear;
+import fr.ifremer.isisfish.entities.Selectivity;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel;
+
+/**
+ * Table model for {@link Gear}#{@link Selectivity}.
+ *
+ * Columns :
+ * <li>selectivity population name</li>
+ * <li>selectivity equation</li>
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class GearPopulationSelectivityModel extends AbstractTableModel implements TableCellRenderer, SensitivityTableModel {
+
+ /** Log. */
+ private static Log log = LogFactory.getLog(GearPopulationSelectivityModel.class);
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3169786638868209920L;
+
+ /** Columns names. */
+ public final static String[] COLUMN_NAMES = {
+ _("isisfish.common.population"),
+ _("isisfish.common.equation")
+ };
+
+ protected List<Selectivity> selectivities;
+
+ /**
+ * Empty constructor.
+ */
+ public GearPopulationSelectivityModel() {
+ this(null);
+ }
+
+ /**
+ * Constructor with data.
+ *
+ * @param selectivities initial selectivities
+ */
+ public GearPopulationSelectivityModel(
+ List<Selectivity> selectivities) {
+ this.selectivities = selectivities;
+ }
+
+ /**
+ * Set target species list.
+ *
+ * @param selectivities the selectivities to set
+ */
+ public void setSelectivities(List<Selectivity> selectivities) {
+ this.selectivities = selectivities;
+ }
+
+ /**
+ * Get selectivity list.
+ *
+ * @return selectivity list
+ */
+ public List<Selectivity> getSelectivities() {
+ return this.selectivities;
+ }
+
+ /*
+ * @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 (selectivities != null) {
+ rows = selectivities.size();
+ }
+ return rows;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+
+ Object result = null;
+
+ Selectivity selectivity = selectivities.get(rowIndex);
+ switch (columnIndex) {
+ case 0:
+ result = selectivity.getPopulation().getName();
+ break;
+ case 1:
+ result = selectivity.getEquation();
+ 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;
+ 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);
+ }
+
+ Selectivity selectivity = selectivities.get(rowIndex);
+ switch (columnIndex) {
+ case 1:
+ Equation eq = (Equation)value;
+ // two events for event to be fired
+ selectivity.setEquation(null);
+ selectivity.setEquation(eq);
+ 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;
+ default:
+ throw new IndexOutOfBoundsException("No such column " + column);
+ }
+ return c;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel#getPropertyAtColumn(int)
+ */
+ @Override
+ public String getPropertyAtColumn(int column) {
+ String result = null;
+ if (column == 1) {
+ result = "equation";
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel#getBeanAtRow(int)
+ */
+ @Override
+ public Object getBeanAtRow(int rowIndex) {
+ Object result = null;
+ result = selectivities.get(rowIndex);
+ return result;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierListModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierListModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierListModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,106 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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) {
+ 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoComboModel.java (from rev 3249, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoComboModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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) {
+ 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoTargetSpeciesTableModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoTargetSpeciesTableModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/MetierSeasonInfoTargetSpeciesTableModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,267 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel;
+
+/**
+ * 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, SensitivityTableModel {
+
+ /** 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) {
+ 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;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel#getPropertyAtColumn(int)
+ */
+ @Override
+ public String getPropertyAtColumn(int column) {
+ String property = null;
+ if (column == 1) {
+ property = "targetFactorEquation";
+ }
+ return property;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.ui.sensitivity.SensitivityTableModel#getBeanAtRow(int)
+ */
+ @Override
+ public Object getBeanAtRow(int rowIndex) {
+ Object value = null;
+ value = targetSpeciesList.get(rowIndex);
+ return value;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationComboModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/PopulationComboModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationComboModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+import fr.ifremer.isisfish.entities.Population;
+
+/**
+ * Model pour la liste des {@link Population}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class PopulationComboModel extends DefaultComboBoxModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** Population list */
+ protected List<Population> populations;
+
+ /**
+ * Constructor with species list.
+ *
+ * @param populations populations list
+ */
+ public PopulationComboModel(List<Population> populations) {
+ this.populations = populations;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return populations.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (populations != null) {
+ size = populations.size();
+ }
+ return size;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationSeasonInfoComboModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationSeasonInfoComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/PopulationSeasonInfoComboModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,108 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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) {
+ 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/SpeciesComboModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/SpeciesComboModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/SpeciesComboModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+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;
+
+ /** Species list */
+ protected List<Species> speciesList;
+
+ /**
+ * Constructor with species list.
+ *
+ * @param speciesList species list
+ */
+ public SpeciesComboModel(List<Species> speciesList) {
+ this.speciesList = speciesList;
+ }
+
+ /*
+ * @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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/TripTypeListModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/TripTypeListModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/TripTypeListModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+
+import fr.ifremer.isisfish.entities.TripType;
+
+/**
+ * Model pour la liste des {@link TripType}.
+ *
+ * Pas de selection par defaut.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class TripTypeListModel extends DefaultListModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6171850179969290032L;
+
+ /** Trip types list */
+ protected List<TripType> tripTypes;
+
+ /**
+ * Constructor with trip types list.
+ *
+ * @param tripTypes Trip types list
+ */
+ public TripTypeListModel(List<TripType> tripTypes) {
+ this.tripTypes = tripTypes;
+ }
+
+ /*
+ * @see javax.swing.ListModel#getElementAt(int)
+ */
+ @Override
+ public Object getElementAt(int index) {
+ return tripTypes.get(index);
+ }
+
+ /*
+ * @see javax.swing.ListModel#getSize()
+ */
+ @Override
+ public int getSize() {
+ int size = 0;
+
+ if (tripTypes != null) {
+ size = tripTypes.size();
+ }
+ return size;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/ZoneListModel.java (from rev 3273, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/ZoneListModel.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/model/ZoneListModel.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.model;
+
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+
+import fr.ifremer.isisfish.entities.Zone;
+
+/**
+ * Model pour la liste des {@link Zone}.
+ *
+ * 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 zone list.
+ *
+ * @param zones zones list
+ */
+ public ZoneListModel(List<Zone> zones) {
+ 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/EffortDescriptionListRenderer.java (from rev 3148, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListRenderer.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/EffortDescriptionListRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/EffortDescriptionListRenderer.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.renderer;
+
+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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierListRenderer.java (from rev 3148, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListRenderer.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierListRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierListRenderer.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.renderer;
+
+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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierSeasonInfoComboRenderer.java (from rev 3148, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoComboRenderer.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierSeasonInfoComboRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/MetierSeasonInfoComboRenderer.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,70 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.renderer;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+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 {
+
+ /** 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/PopulationSeasonInfoComboRenderer.java (from rev 3148, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboRenderer.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/PopulationSeasonInfoComboRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/PopulationSeasonInfoComboRenderer.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,70 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.renderer;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+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 {
+
+ /** 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;
+ }
+}
Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/TripTypeListRenderer.java (from rev 3148, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListRenderer.java)
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/TripTypeListRenderer.java (rev 0)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/renderer/TripTypeListRenderer.java 2011-04-20 15:36:48 UTC (rev 3276)
@@ -0,0 +1,67 @@
+/*
+ * #%L
+ * IsisFish
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2010 Ifremer, CodeLutin
+ * %%
+ * 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, see
+ * <http://www.gnu.org/licenses/gpl-2.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.isisfish.ui.input.renderer;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JLabel;
+import javax.swing.JList;
+
+import fr.ifremer.isisfish.entities.TripType;
+
+/**
+ * Renderer pour liste des trip types.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author: chatellier $
+ */
+public class TripTypeListRenderer 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 alternated highlight rows and default
+ // selection color
+ JLabel c = (JLabel) super.getListCellRendererComponent(list, value,
+ index, isSelected, cellHasFocus);
+
+ TripType tripType = (TripType) value;
+ c.setText(tripType.getName());
+
+ return c;
+ }
+}
1
0
20 Apr '11
Author: chatellier
Date: 2011-04-20 15:32:27 +0000 (Wed, 20 Apr 2011)
New Revision: 3275
Log:
Use snapshot
Modified:
isis-fish/branches/3.3.1/pom.xml
Modified: isis-fish/branches/3.3.1/pom.xml
===================================================================
--- isis-fish/branches/3.3.1/pom.xml 2011-04-20 11:54:46 UTC (rev 3274)
+++ isis-fish/branches/3.3.1/pom.xml 2011-04-20 15:32:27 UTC (rev 3275)
@@ -493,7 +493,7 @@
<license.licenseName>gpl_v2</license.licenseName>
<!-- Dependencies version -->
- <jaxxVersion>2.4.1</jaxxVersion>
+ <jaxxVersion>2.4.2-SNAPSHOT</jaxxVersion>
<eugeneVersion>2.3.3</eugeneVersion>
<topiaVersion>2.5.3</topiaVersion>
<nuitonUtilsVersion>2.1.1</nuitonUtilsVersion>
1
0
r3274 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
20 Apr '11
Author: chatellier
Date: 2011-04-20 11:54:46 +0000 (Wed, 20 Apr 2011)
New Revision: 3274
Log:
Fix default logLevel
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-04-20 09:41:43 UTC (rev 3273)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-04-20 11:54:46 UTC (rev 3274)
@@ -1328,7 +1328,7 @@
libLogLevel = propertiesParameters.getProperty("libLogLevel",
"error");
} else {
- libLogLevel = "info";
+ libLogLevel = "error";
}
}
1
0
r3273 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input: formule gear metier population setofvessels triptype
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
by chatellier@users.labs.libre-entreprise.org 20 Apr '11
20 Apr '11
Author: chatellier
Date: 2011-04-20 09:41:43 +0000 (Wed, 20 Apr 2011)
New Revision: 3273
Log:
Remove useless super()
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/formule/FormuleComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/GearPopulationSelectivityModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/PopulationComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListModel.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/formule/FormuleComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/formule/FormuleComboModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/formule/FormuleComboModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -56,7 +56,6 @@
* @param formules formules list
*/
public FormuleComboModel(List<Formule> formules) {
- super();
this.formules = formules;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/GearPopulationSelectivityModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/GearPopulationSelectivityModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/GearPopulationSelectivityModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -87,7 +87,6 @@
*/
public GearPopulationSelectivityModel(
List<Selectivity> selectivities) {
- super();
this.selectivities = selectivities;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/PopulationComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/PopulationComboModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/gear/PopulationComboModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -56,7 +56,6 @@
* @param populations populations list
*/
public PopulationComboModel(List<Population> populations) {
- super();
this.populations = populations;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/MetierSeasonInfoTargetSpeciesTableModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -89,7 +89,6 @@
*/
public MetierSeasonInfoTargetSpeciesTableModel(
List<TargetSpecies> targetSpeciesList) {
- super();
this.targetSpeciesList = targetSpeciesList;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/metier/SpeciesComboModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -56,7 +56,6 @@
* @param speciesList species list
*/
public SpeciesComboModel(List<Species> speciesList) {
- super();
this.speciesList = speciesList;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/PopulationSeasonInfoComboModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -61,7 +61,6 @@
* @param populationSeasonInfos population season info list
*/
public PopulationSeasonInfoComboModel(List<PopulationSeasonInfo> populationSeasonInfos) {
- super();
setPopulationSeasonInfos(populationSeasonInfos);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/population/ZoneListModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -56,7 +56,6 @@
* @param zones zones list
*/
public ZoneListModel(List<Zone> zones) {
- super();
this.zones = zones;
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/EffortDescriptionListModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -61,7 +61,6 @@
* @param effortDescriptions liste des effortDescriptions
*/
public EffortDescriptionListModel(List<EffortDescription> effortDescriptions) {
- super();
setEffortDescriptions(effortDescriptions);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/setofvessels/MetierListModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -61,7 +61,6 @@
* @param metiers liste des metiers
*/
public MetierListModel(List<Metier> metiers) {
- super();
setMetiers(metiers);
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListModel.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListModel.java 2011-04-19 16:44:52 UTC (rev 3272)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/triptype/TripTypeListModel.java 2011-04-20 09:41:43 UTC (rev 3273)
@@ -56,7 +56,6 @@
* @param tripTypes Trip types list
*/
public TripTypeListModel(List<TripType> tripTypes) {
- super();
this.tripTypes = tripTypes;
}
1
0
r3272 - in isis-fish/branches/3.3.1/src: main/java/fr/ifremer/isisfish/simulator test/java/fr/ifremer/isisfish/simulator
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
19 Apr '11
Author: chatellier
Date: 2011-04-19 16:44:52 +0000 (Tue, 19 Apr 2011)
New Revision: 3272
Log:
Il ne faut pas que les attribut ai d'initialisation par default (aucun etat autre que le properties inject?\195?\169)
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/SimulationParameterTest.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-04-19 12:08:37 UTC (rev 3271)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameterImpl.java 2011-04-19 16:44:52 UTC (rev 3272)
@@ -83,7 +83,7 @@
public class SimulationParameterImpl implements SimulationParameter {
/** Logger for this class. */
- private static Log log = LogFactory.getLog(SimulationParameter.class);
+ private static Log log = LogFactory.getLog(SimulationParameterImpl.class);
/** Remember last read properties. */
protected Properties propertiesParameters;
@@ -177,11 +177,11 @@
protected Boolean onlyExport;
/** Le niveau de log du simulateur à utiliser pendant la simulation. Par defaut info. */
- protected String simulLogLevel = "info";
+ protected String simulLogLevel;
/** Le niveau de log des scripts à utiliser pendant la simulation. Par defaut info. */
- protected String scriptLogLevel = "info";
+ protected String scriptLogLevel;
/** Le niveau de log des librairies à utiliser pendant la simulation. Par defaut error. */
- protected String libLogLevel = "error";
+ protected String libLogLevel;
/** La region corespondant au parametre {@link #regionName}. */
protected transient RegionStorage region;
Modified: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/SimulationParameterTest.java
===================================================================
--- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/SimulationParameterTest.java 2011-04-19 12:08:37 UTC (rev 3271)
+++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/simulator/SimulationParameterTest.java 2011-04-19 16:44:52 UTC (rev 3272)
@@ -274,4 +274,15 @@
Assert.assertEquals("desc", params2.getDescription());
Assert.assertEquals(1, params2.getResultEnabled().size());
}
+
+ /**
+ * Test que le log level est bien correctement recopié.
+ */
+ @Test
+ public void testLogLevelCopy() {
+ SimulationParameter params = new SimulationParameterImpl();
+ params.setSimulLogLevel("error");
+ SimulationParameter newInstance = params.deepCopy();
+ Assert.assertEquals("error", newInstance.getSimulLogLevel());
+ }
}
1
0
r3271 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
19 Apr '11
Author: chatellier
Date: 2011-04-19 12:08:37 +0000 (Tue, 19 Apr 2011)
New Revision: 3271
Log:
Fix validator code
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesStructuredUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -42,11 +42,11 @@
javax.swing.DefaultComboBoxModel;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Cell'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldCellName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected OMToolSet toolSet = new OMToolSet();
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionParametersUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -39,10 +39,10 @@
java.beans.PropertyChangeListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="effortdescriptionparameters"
+ <BeanValidator id='validator' context="effortdescriptionparameters"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.SetOfVessels'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -40,10 +40,10 @@
java.beans.PropertyChangeListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="effortdescription"
+ <BeanValidator id='validator' context="effortdescription"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.SetOfVessels'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
/**
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -40,11 +40,11 @@
javax.swing.JTable
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.FisheryRegion'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldRegion" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -34,12 +34,12 @@
java.beans.PropertyChangeListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="gear"
+ <BeanValidator id='validator' context="gear"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Gear'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldGearName" />
<field name="effortUnit" component="fieldGearEffortUnit" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -40,10 +40,10 @@
javax.swing.DefaultComboBoxModel
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="seasonspecies"
+ <BeanValidator id='validator' context="seasonspecies"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Metier'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -44,10 +44,10 @@
java.awt.Dimension
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="seasonzones"
+ <BeanValidator id='validator' context="seasonzones"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Metier'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -35,11 +35,11 @@
java.awt.Dimension
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="metier"
+ <BeanValidator id='validator' context="metier"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Metier'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldMetierName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -41,11 +41,11 @@
java.awt.BorderLayout
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="basics"
+ <BeanValidator id='validator' context="basics"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldPopulationBasicsName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -35,10 +35,10 @@
org.nuiton.math.matrix.gui.MatrixPanelListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="capturability"
+ <BeanValidator id='validator' context="capturability"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationEquationUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -32,10 +32,10 @@
fr.ifremer.isisfish.entities.Population;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="equation"
+ <BeanValidator id='validator' context="equation"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
/*public void refresh() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -47,10 +47,10 @@
java.beans.PropertyChangeListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="group"
+ <BeanValidator id='validator' context="group"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -40,10 +40,10 @@
java.awt.CardLayout
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="migration"
+ <BeanValidator id='validator' context="migration"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -35,10 +35,10 @@
org.nuiton.math.matrix.gui.MatrixPanelListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="recruitement"
+ <BeanValidator id='validator' context="recruitement"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -42,11 +42,17 @@
org.nuiton.math.matrix.gui.MatrixPanelListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="seasons"
+ <BeanValidator id='validator' context="seasons"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
+ <BeanValidator id='validatorSeason' context="population"
+ bean='{getPopulationSeasonInfo()}' beanClass='fr.ifremer.isisfish.entities.PopulationSeasonInfo'
+ uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI"
+ parentValidator="{getValidator()}">
+ </BeanValidator>
+
<script><![CDATA[
protected Interval seasonInterval;
@@ -285,7 +291,7 @@
<JPanel/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldPopulationSeasonReproduction" selected='{getPopulationSeasonInfo().getReproduction()}'
+ <JCheckBox id="fieldPopulationSeasonReproduction" selected='{getPopulationSeasonInfo().isReproduction()}'
onActionPerformed='getPopulationSeasonInfo().setReproduction(fieldPopulationSeasonReproduction.isSelected())'
text="isisfish.populationSeasons.Reproduction" enabled='{getPopulationSeasonInfo() != null}' decorator='boxed'/>
</cell>
@@ -293,13 +299,13 @@
<row>
<cell anchor='east'>
<JLabel text="isisfish.populationSeasons.distributionSpawning" enabled='{getPopulationSeasonInfo() != null}'
- visible='{getPopulationSeasonInfo().getReproduction()}'/>
+ visible='{getPopulationSeasonInfo().isReproduction()}'/>
</cell>
<cell fill='both' weightx='1.0' weighty='0.2'>
<org.nuiton.math.matrix.gui.MatrixPanelEditor id='fieldPopulationSeasonReproductionDistribution'
matrix='{getPopulationSeasonInfo() == null ? null : getPopulationSeasonInfo().getReproductionDistribution().copy()}'
enabled='{getPopulationSeasonInfo() != null}'
- visible='{getPopulationSeasonInfo().getReproduction()}'
+ visible='{getPopulationSeasonInfo().isReproduction()}'
decorator='boxed' _sensitivityBean='{PopulationSeasonInfo.class}' _sensitivityMethod='"ReproductionDistribution"'
onMatrixChanged="populationSeasonReproductionDistributionMatrixChanged(event)" />
</cell>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -27,10 +27,10 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Population id='bean' javaBean='null'/>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="zones"
+ <BeanValidator id='validator' context="zones"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Population'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
/*public void refresh() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -40,12 +40,12 @@
java.beans.PropertyChangeListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Port'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldPortName" />
<field name="cell" component="spPortCell" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected OMToolSet toolSet = new OMToolSet();
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityEditorUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -29,8 +29,6 @@
<fr.ifremer.isisfish.entities.Population id='population' javaBean='null'/>
- <Boolean id='selectivityPopulationSelected' javaBean='false'/>
-
<import>
fr.ifremer.isisfish.entities.Equation
fr.ifremer.isisfish.entities.Gear
@@ -80,7 +78,6 @@
//setBean(gear);
if (getBean() != null) {
- setSelectivityPopulationSelected(false);
setSelectivityTableModel();
fieldSelectivityPopulation.setModel(getSelectivityPopulationModel());
}
@@ -89,7 +86,6 @@
// reset to false after addCurrentPanel refresh
selectivityEquation.setActive(false);
- setSelectivityPopulationSelected(false);
removeSelectivityButton.setEnabled(false);
}
@@ -143,9 +139,8 @@
}
protected void selectivityChanged() {
- setSelectivityPopulationSelected(fieldSelectivityPopulation.getSelectedItem() != null);
setPopulation((Population)fieldSelectivityPopulation.getSelectedItem());
- addSelectivityButton.setEnabled(isSelectivityPopulationSelected());
+ addSelectivityButton.setEnabled(getPopulation() != null);
}
]]></script>
<JPanel id='body'>
@@ -163,7 +158,7 @@
<cell columns='2' fill='both' weightx='1.0' weighty='1.0' insets="0">
<InputOneEquationUI id='selectivityEquation' constructorParams='this'
text='isisfish.selectivity.equation'
- bean='{getBean()}' formuleCategory='Selectivity' active='{isSelectivityPopulationSelected()}'
+ bean='{getBean()}' formuleCategory='Selectivity' active='{getPopulation() != null}'
clazz='{fr.ifremer.isisfish.equation.SelectivityEquation.class}'
decorator='boxed' />
</cell>
@@ -171,7 +166,7 @@
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JButton id="addSelectivityButton" text="isisfish.common.add" onActionPerformed='addSelectivity()'
- enabled='{isSelectivityPopulationSelected()}' decorator='boxed' />
+ enabled='{getPopulation() != null}' decorator='boxed' />
</cell>
</row>
<row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -27,10 +27,10 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Gear id='bean' javaBean='null'/>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="selectivity"
+ <BeanValidator id='validator' context="selectivity"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Gear'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<import>
fr.ifremer.isisfish.entities.Gear
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -38,11 +38,11 @@
java.beans.PropertyChangeListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="basics"
+ <BeanValidator id='validator' context="basics"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.SetOfVessels'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldSetOfVesselsName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
boolean init = false;
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesStructuredUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesStructuredUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesStructuredUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -25,7 +25,6 @@
<fr.ifremer.isisfish.ui.input.InputContentUI superGenericType='fr.ifremer.isisfish.entities.Species'>
<fr.ifremer.isisfish.entities.Species id='bean' javaBean='null'/>
- <Boolean id='actif' javaBean='false'/>
<script><![CDATA[
protected void dynamicChanged() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -35,11 +35,11 @@
java.beans.PropertyChangeListener;
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Species'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldSpeciesName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyMonthInfoUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -33,10 +33,10 @@
static org.nuiton.i18n.I18n._
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="month"
+ <BeanValidator id='validator' context="month"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Strategy'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -38,11 +38,11 @@
java.beans.PropertyChangeListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator' context="basics"
+ <BeanValidator id='validator' context="basics"
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Strategy'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldStrategyName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -35,11 +35,11 @@
java.beans.PropertyChangeListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.TripType'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldTripTypeName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -38,11 +38,11 @@
java.beans.PropertyChangeListener
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.VesselType'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldVesselTypeName" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected void $afterCompleteSetup() {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2011-04-19 12:08:37 UTC (rev 3271)
@@ -44,12 +44,12 @@
java.util.ArrayList
</import>
- <jaxx.runtime.validator.swing.SwingValidator id='validator'
+ <BeanValidator id='validator'
bean='{getBean()}' beanClass='fr.ifremer.isisfish.entities.Zone'
uiClass="jaxx.runtime.validator.swing.ui.ImageValidationUI">
<field name="name" component="fieldZoneName" />
<field name="cell" component="spZoneCells" />
- </jaxx.runtime.validator.swing.SwingValidator>
+ </BeanValidator>
<script><![CDATA[
protected OMToolSet toolSet = new OMToolSet();
1
0
r3270 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
by chatellier@users.labs.libre-entreprise.org 19 Apr '11
19 Apr '11
Author: chatellier
Date: 2011-04-19 08:51:10 +0000 (Tue, 19 Apr 2011)
New Revision: 3270
Log:
Fix group creation wizard
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-18 16:43:02 UTC (rev 3269)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
@@ -111,7 +111,6 @@
wizardFrame.pack();
wizardFrame.setLocationRelativeTo(this);
wizardFrame.setVisible(true);
- //refresh();
}
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-18 16:43:02 UTC (rev 3269)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
@@ -36,15 +36,12 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.Population id='bean' javaBean='null'/>
+
<fr.ifremer.isisfish.entities.PopulationGroup id='populationGroup' javaBean='null'/>
- <Boolean id='popGroupNotNull' javaBean='false'/>
-
<import>
fr.ifremer.isisfish.entities.PopulationGroup;
- fr.ifremer.isisfish.entities.PopulationGroupImpl;
fr.ifremer.isisfish.entities.Population;
- fr.ifremer.isisfish.entities.PopulationImpl;
org.nuiton.math.matrix.MatrixND;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
@@ -81,7 +78,6 @@
fieldPopulationGroupMaxLength.setText("");
fieldPopulationGroupComment.setText("");
fieldPopulationGroupNaturalDeathRate.setMatrix(null);
- setPopGroupNotNull(false);
}
if (evt.getNewValue() != null) {
@@ -125,7 +121,7 @@
protected void populationGroupChanged() {
PopulationGroup selectedPopulationGroup = (PopulationGroup)populationGroupPopulationGroupComboBox.getSelectedItem();
if (selectedPopulationGroup != null) {
- setPopulationGroup((PopulationGroupImpl)selectedPopulationGroup);
+ setPopulationGroup(selectedPopulationGroup);
getSaveVerifier().addCurrentEntity(selectedPopulationGroup);
setNaturalDeathRateMatrix();
@@ -134,12 +130,7 @@
fieldPopulationGroupAge.init();
fieldPopulationGroupMinLength.init();
fieldPopulationGroupMaxLength.init();*/
-
- setPopGroupNotNull(true);
}
- else {
- setPopGroupNotNull(false);
- }
}
]]>
</script>
@@ -155,87 +146,89 @@
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.meanWeigth" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.meanWeigth" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JTextField id="fieldPopulationGroupMeanWeight" text='{String.valueOf(getPopulationGroup().getMeanWeight())}'
- enabled='false' decorator='boxed'/>
+ editable="false"
+ enabled='{getPopulationGroup() != null}' decorator='boxed'/>
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.price" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.price" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JTextField id="fieldPopulationGroupPrice" text='{String.valueOf(getPopulationGroup().getPrice())}'
- enabled='false' decorator='boxed'/>
+ editable="false"
+ enabled='{getPopulationGroup() != null}' decorator='boxed'/>
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.naturalDeathRate" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.naturalDeathRate" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
<org.nuiton.math.matrix.gui.MatrixPanelEditor id='fieldPopulationGroupNaturalDeathRate'
- enabled='false' decorator='boxed' _sensitivityBean='{PopulationImpl.class}' _sensitivityMethod='"NaturalDeathRateMatrix"' />
+ enabled='false' decorator='boxed' _sensitivityBean='{Population.class}' _sensitivityMethod='"NaturalDeathRateMatrix"' />
<!-- this bindings totally break UI
matrix='{getBean() == null || getPopulationGroup() == null ? null : ((AbstractMatrixND)getBean().getNaturalDeathRateMatrix()).getSubMatrixOnSemantic(0, getPopulationGroup())}' -->
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.reproductionRate" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.reproductionRate" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
<!--NumberEditor id='fieldPopulationGroupReproductionRate' constructorParams='this'
bean='{getPopulationGroup()}' property='reproductionRate'
useSign='true' enabled='{isPopGroupNotNull()}' decorator='boxed'
- _sensitivityBean='{PopulationGroupImpl.class}' _sensitivityMethod='"ReproductionRate"'/-->
+ _sensitivityBean='{PopulationGroup.class}' _sensitivityMethod='"ReproductionRate"'/-->
<JTextField id="fieldPopulationGroupReproductionRate" text='{String.valueOf(getPopulationGroup().getReproductionRate())}'
onKeyReleased='getPopulationGroup().setReproductionRate(Double.parseDouble(fieldPopulationGroupReproductionRate.getText()))'
- enabled='{isPopGroupNotNull()}' decorator='boxed' _sensitivityBean='{PopulationGroupImpl.class}' _sensitivityMethod='"ReproductionRate"'/>
+ enabled='{getPopulationGroup() != null}' decorator='boxed' _sensitivityBean='{PopulationGroup.class}' _sensitivityMethod='"ReproductionRate"'/>
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.age" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.age" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
<!-- non editable age field -->
<JTextField id="fieldPopulationGroupAge" text='{String.valueOf(getPopulationGroup().getAge())}'
onKeyReleased='getPopulationGroup().setAge(Double.parseDouble(fieldPopulationGroupAge.getText()))'
enabled='{getPopulationGroup().getPopulation().getSpecies().getAgeGroupType()}'
- decorator='boxed' _sensitivityBean='{PopulationGroupImpl.class}' _sensitivityMethod='"Age"'/>
+ decorator='boxed' _sensitivityBean='{PopulationGroup.class}' _sensitivityMethod='"Age"'/>
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.length" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.length" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell fill='both' weightx='0.5'>
<!-- non editable min length field -->
<JTextField id="fieldPopulationGroupMinLength" text='{String.valueOf(getPopulationGroup().getMinLength())}'
toolTipText="isisfish.populationGroup.minimumLength"
onKeyReleased='getPopulationGroup().setMinLength(Double.parseDouble(fieldPopulationGroupMinLength.getText()))'
- enabled='{!getPopulationGroup().getPopulation().getSpecies().getAgeGroupType()}' decorator='boxed' _sensitivityBean='{PopulationGroupImpl.class}' _sensitivityMethod='"MinLength"'/>
+ enabled='{!getPopulationGroup().getPopulation().getSpecies().getAgeGroupType()}' decorator='boxed' _sensitivityBean='{PopulationGroup.class}' _sensitivityMethod='"MinLength"'/>
</cell>
<cell fill='both' weightx='0.5'>
<!-- non editable max length field -->
<JTextField id="fieldPopulationGroupMaxLength" text='{String.valueOf(getPopulationGroup().getMaxLength())}'
toolTipText="isisfish.populationGroup.maximumLength"
onKeyReleased='getPopulationGroup().setMaxLength(Double.parseDouble(fieldPopulationGroupMaxLength.getText()))'
- enabled='{!getPopulationGroup().getPopulation().getSpecies().getAgeGroupType()}' decorator='boxed' _sensitivityBean='{PopulationGroupImpl.class}' _sensitivityMethod='"MaxLength"'/>
+ enabled='{!getPopulationGroup().getPopulation().getSpecies().getAgeGroupType()}' decorator='boxed' _sensitivityBean='{PopulationGroup.class}' _sensitivityMethod='"MaxLength"'/>
</cell>
</row>
<row>
<cell fill='horizontal' anchor='east'>
- <JLabel text="isisfish.populationGroup.comments" enabled='{isPopGroupNotNull()}'/>
+ <JLabel text="isisfish.populationGroup.comments" enabled='{getPopulationGroup() != null}'/>
</cell>
<cell columns='2' fill='both' weightx='1.0' weighty='0.5'>
<JScrollPane>
<!-- jaxx.runtime.SwingUtil.getStringValue() for null values -->
<JTextArea id="fieldPopulationGroupComment" text='{jaxx.runtime.SwingUtil.getStringValue(getPopulationGroup().getComment())}'
- onKeyReleased='getPopulationGroup().setComment(fieldPopulationGroupComment.getText())' enabled='{isPopGroupNotNull()}' decorator='boxed'/>
+ onKeyReleased='getPopulationGroup().setComment(fieldPopulationGroupComment.getText())' enabled='{getPopulationGroup() != null}' decorator='boxed'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2011-04-18 16:43:02 UTC (rev 3269)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2011-04-19 08:51:10 UTC (rev 3270)
@@ -28,7 +28,6 @@
fr.ifremer.isisfish.IsisFishDAOHelper
fr.ifremer.isisfish.entities.Equation
fr.ifremer.isisfish.entities.Population
- fr.ifremer.isisfish.entities.PopulationImpl
fr.ifremer.isisfish.entities.PopulationGroup
fr.ifremer.isisfish.entities.PopulationGroupDAO
fr.ifremer.isisfish.entities.PopulationDAO
@@ -54,8 +53,8 @@
protected double step = 1;
protected PopulationBasicsUI popBasic;
- public void init(PopulationBasicsUI p){
- popBasic = p;
+ public void init(PopulationBasicsUI popBasic) {
+ this.popBasic = popBasic;
}
/**
@@ -232,14 +231,13 @@
}
try {
- Population pop = (Population)getContextValue(InputSaveVerifier.class).getEntity(Population.class);
+ Population pop = popBasic.getBean();
// remove maturity group
pop.setMaturityGroup(null);
-
// remove all old group
- TopiaContext isisContext = ((PopulationImpl)pop).getTopiaContext();
pop.clearPopulationGroup();
+ TopiaContext isisContext = pop.getTopiaContext();
PopulationGroupDAO populationGroupDAO = IsisFishDAOHelper.getPopulationGroupDAO(isisContext);
if (isAgeType()) {
1
0
r3269 - in isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input: . tree
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
18 Apr '11
Author: chatellier
Date: 2011-04-18 16:43:02 +0000 (Mon, 18 Apr 2011)
New Revision: 3269
Log:
Fix population node creation
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2011-04-18 15:47:36 UTC (rev 3268)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2011-04-18 16:43:02 UTC (rev 3269)
@@ -522,21 +522,8 @@
return null;
}
- // Population
- public Species getSpeciesByTopiaId(TopiaContext context, String topiaId) {
- Species result = null;
- try {
- SpeciesDAO dao = IsisFishDAOHelper.getSpeciesDAO(context);
- result = dao.findByTopiaId(topiaId);
- } catch (TopiaException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't get species", e);
- }
- }
- return result;
- }
-
public Population createPopulation(TopiaContext context, Species species) {
+ Population pop = null;
if (log.isTraceEnabled()) {
log.trace("createPopulation called");
}
@@ -544,25 +531,17 @@
String name = "Population_new";
PopulationDAO dao = IsisFishDAOHelper.getPopulationDAO(context);
- Population pop = dao.create();
+ pop = dao.create();
pop.setName(name);
species.addPopulation(pop);
pop.setSpecies(species);
species.update();
pop.update();
- // EC-20091112 : commit() twice cause hibernate error:
- // Found two representations of same collection:
- //context.commitTransaction();
- return pop;
- } catch (Exception eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't create Population", eee);
- }
- ErrorHelper.showErrorDialog(_("isisfish.error.input.addentity",
- "Population"), eee);
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.error.input.addentity", "Population"), eee);
}
- return null;
+ return pop;
}
public PopulationSeasonInfo createPopulationSeasonInfo(Population pop) {
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-18 15:47:36 UTC (rev 3268)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputHandler.java 2011-04-18 16:43:02 UTC (rev 3269)
@@ -55,6 +55,7 @@
import org.nuiton.topia.persistence.TopiaEntityContextable;
import org.nuiton.util.FileUtil;
+import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
@@ -68,6 +69,7 @@
import fr.ifremer.isisfish.entities.Port;
import fr.ifremer.isisfish.entities.SetOfVessels;
import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.SpeciesDAO;
import fr.ifremer.isisfish.entities.Strategy;
import fr.ifremer.isisfish.entities.TripType;
import fr.ifremer.isisfish.entities.VesselType;
@@ -670,9 +672,17 @@
selectedNode = selectedNode.getParent();
}
+ // must use loador to properly load species node
FisheryTreeNodeLoador typeNodeLoador = fisheryTreeHelper.getLoadorFor(nodeClass);
- // must use loador to properly load species node
- FisheryTreeNode newNode = (FisheryTreeNode)typeNodeLoador.createNode(topiaEntity, null);
+ FisheryTreeNode newNode = null;
+ if (newNode != null) {
+ newNode = (FisheryTreeNode)typeNodeLoador.createNode(topiaEntity, null);
+ }
+ else {
+ // FIXME echatellier 20110418 cas non résolu du node "population"
+ // pour lequel on n'a pas le loador
+ newNode = new FisheryTreeNode(nodeClass, topiaEntity.getTopiaId(), null, null);
+ }
fisheryTreeHelper.insertNode(selectedNode, newNode);
fisheryTreeHelper.selectNode(newNode);
}
@@ -728,35 +738,12 @@
}
if (bean != null) {
-
- //JComponent editor = source;
-
- // This is a special case for table source component
- // If current entity is displayed by a JTable component
- // we need to find a better component than
- // can display 'property' on 'bean'
- /*if (editor instanceof JTable) {
- editor = EditorHelper.getEditorForValue(bean, sensitivityMethod);
- }*/
-
- //if (editor != null) {
- FactorWizardUI factorWizardUI = new FactorWizardUI(inputContentUI);
- SensitivityInputHandler handler = factorWizardUI.getHandler();
- handler.initNewFactor(factorWizardUI, bean, sensitivityMethod);
- factorWizardUI.pack();
- factorWizardUI.setLocationRelativeTo(inputContentUI);
- factorWizardUI.setVisible(true);
-
- //Object value = EditorHelper.getMethodValue(bean, fieldName);
- //boolean continuePossible = EditorHelper.canBeContinue(/*source, */value);
- //wizard.initNew(/*source, */bean, continuePossible);
- //wizard.pack();
- //wizard.setLocationRelativeTo(inputContentUI);
- //wizard.setVisible(true);
- /*}
- else if (log.isWarnEnabled()) {
- log.warn("Can't find editor for " + sensitivityBeanClass.getSimpleName() + "#" + sensitivityMethod);
- }*/
+ FactorWizardUI factorWizardUI = new FactorWizardUI(inputContentUI);
+ SensitivityInputHandler handler = factorWizardUI.getHandler();
+ handler.initNewFactor(factorWizardUI, bean, sensitivityMethod);
+ factorWizardUI.pack();
+ factorWizardUI.setLocationRelativeTo(inputContentUI);
+ factorWizardUI.setVisible(true);
}
else {
if (log.isErrorEnabled()) {
@@ -764,4 +751,47 @@
}
}
}
+
+ /**
+ * Dans le cas d'une creation de population, on doit la creer dans
+ * une espèce. On doit rechercher celle qui est sélectionnée dans l'arbre.
+ *
+ * @param inputUI input ui
+ * @return selected species
+ */
+ public Species findSpecies(InputUI inputUI) {
+ // get selected node
+ FisheryTreeHelper treeHelper = inputUI.getContextValue(FisheryTreeHelper.class);
+ FisheryTreeNode selectedNode = treeHelper.getSelectedNode();
+ if (selectedNode == null) {
+ throw new IsisFishRuntimeException("Not selected tree node");
+ }
+
+ // look for parent node (Species type)
+ String speciesId = null;
+ FisheryTreeNode parentNode = selectedNode.getParent();
+ if (parentNode.getInternalClass().equals(Species.class)) {
+ // cas selection du noeud type "Population"
+ speciesId = parentNode.getId();
+ }
+ else if (parentNode.getParent().getInternalClass().equals(Species.class)) {
+ // cas où on est deja sur une population
+ speciesId = parentNode.getParent().getId();
+ }
+ else {
+ throw new IsisFishRuntimeException("Not selected tree node");
+ }
+
+ // look for entities
+ TopiaContext topiaContext = inputUI.getContextValue(TopiaContext.class);
+ Species result = null;
+ try {
+ SpeciesDAO dao = IsisFishDAOHelper.getSpeciesDAO(topiaContext);
+ result = dao.findByTopiaId(speciesId);
+ } catch (TopiaException e) {
+ throw new IsisFishRuntimeException("Can't find ");
+ }
+
+ return result;
+ }
}
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-18 16:43:02 UTC (rev 3269)
@@ -34,7 +34,6 @@
fr.ifremer.isisfish.entities.PopulationGroup;
fr.ifremer.isisfish.entities.Population;
javax.swing.table.DefaultTableModel;
- org.nuiton.topia.persistence.TopiaEntity;
java.beans.PropertyChangeEvent;
java.beans.PropertyChangeListener;
javax.swing.JOptionPane
@@ -102,7 +101,8 @@
wizard.init(this);
wizardFrame.add(wizard, BorderLayout.CENTER);
wizardFrame.setTitle(_("isisfish.wizardGroupCreation.title"));
- wizard.setAgeType(getBean().getSpecies().getAgeGroupType());
+ Species species = getBean().getSpecies();
+ wizard.setAgeType(species.getAgeGroupType());
if (wizard.isAgeType()) {
wizard.setCard("singleGroupAge");
} else {
@@ -138,15 +138,12 @@
}
protected void create() {
- Species species = null; //getAction().getSpeciesByTopiaId(getSaveVerifier().getIsisContext(), getSaveVerifier().getCurrentNode().getParent().getNavigationPath());
- if (species == null){
- species = null; //getAction().getSpeciesByTopiaId(getSaveVerifier().getIsisContext(), getSaveVerifier().getCurrentNode().getParent().getParent().getNavigationPath());
- }
-
- TopiaEntity topia = getContextValue(InputAction.class).createPopulation(getTopiaContext(), species);
- // FIXME echatellier 20110306 use new tree api
- //getParentContainer(InputUI.class).setTreeModel();
- //getParentContainer(InputUI.class).setTreeSelection("$root/$species/"+ species.getTopiaId() +"/$populations/"+topia.getTopiaId());
+ // find species node
+ InputUI inputUI = getContextValue(InputUI.class, JAXXUtil.PARENT);
+ Species species = inputUI.getHandler().findSpecies(inputUI);
+ // create node and select it
+ Population population = getContextValue(InputAction.class).createPopulation(getTopiaContext(), species);
+ inputUI.getHandler().insertTreeNode(inputUI, Population.class, population);
setInfoText(_("isisfish.message.creation.finished"));
}
]]>
@@ -276,7 +273,7 @@
<JButton id='create' decorator='boxed'
text="isisfish.common.new"
enabled="{!validator.isChanged()}"
- onActionPerformed="getSaveVerifier().create(Population.class)"/>
+ onActionPerformed="create()"/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java 2011-04-18 15:47:36 UTC (rev 3268)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/tree/FisheryTreeHelper.java 2011-04-18 16:43:02 UTC (rev 3269)
@@ -141,7 +141,7 @@
FisheryTreeNode strategiesChild = new FisheryTreeNode(Strategy.class,
n_("isisfish.input.tree.strategies"), null, strategiesNodeLoador);
loadorCache.put(Strategy.class, strategiesNodeLoador);
-
+
root.add(cellsChild);
root.add(zonesChild);
root.add(portsChild);
1
0
r3268 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
18 Apr '11
Author: chatellier
Date: 2011-04-18 15:47:36 +0000 (Mon, 18 Apr 2011)
New Revision: 3268
Log:
Activation du bouton "supprimer" seulement si un bean est charg?\195?\169
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -171,7 +171,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesEditorUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -182,7 +182,7 @@
<InputOneEquationUI id='targetFactor' constructorParams='this'
active='{isTargetSpeciesSelected()}'
text='isisfish.metierSeasonInfoSpecies.targetFactor'
- bean='{getBean()}' formuleCategory='TargetFactor'
+ bean='{getMetierSeasonInfo()}' formuleCategory='TargetFactor'
clazz='{fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class}'
decorator='boxed' _sensitivityBean='{Metier.class}' _sensitivityMethod='""'/>
</cell>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/MetierTabUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -158,7 +158,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -196,7 +196,7 @@
</row>
<row>
<cell anchor='east'>
- <JLabel text="isisfish.populationBasics.maturityGroup" enabled='{isActive()}'/>
+ <JLabel text="isisfish.populationBasics.maturityGroup" enabled='{getBean() != null}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
<JAXXComboBox id="fieldPopulationBasicsMatureClass" onActionPerformed='matureClassChanged()'
@@ -281,7 +281,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SetOfVesselsBasicsUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -203,7 +203,7 @@
<cell fill='horizontal' weightx='1.0'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/SpeciesUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -191,7 +191,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/StrategyTabUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -198,7 +198,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/TripTypeUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -147,7 +147,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2011-04-18 15:47:36 UTC (rev 3268)
@@ -256,7 +256,7 @@
<cell fill='horizontal' weightx='0.5'>
<JButton id='delete' decorator='boxed'
text="isisfish.common.remove"
- enabled="{!validator.isChanged()}"
+ enabled="{!validator.isChanged() && getBean() != null}"
onActionPerformed="getSaveVerifier().delete()"/>
</cell>
</row>
1
0
r3267 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
by chatellier@users.labs.libre-entreprise.org 18 Apr '11
18 Apr '11
Author: chatellier
Date: 2011-04-18 15:47:11 +0000 (Mon, 18 Apr 2011)
New Revision: 3267
Log:
Desactivation d'elements qui n'ont plus d'implementation
Modified:
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2011-04-18 15:46:47 UTC (rev 3266)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/FisheryRegionUI.jaxx 2011-04-18 15:47:11 UTC (rev 3267)
@@ -115,13 +115,9 @@
setFieldMapfilesModel(getBean());
}
-protected void cellFillChanged() {
-
-}
-
-protected void cellFile() {
+/*protected void cellFile() {
getInputAction().loadCellFile(fieldCellFile.getText());
-}
+}*/
protected void check() {
getContextValue(InputAction.class).checkFisheryRegion(getBean());
@@ -276,7 +272,7 @@
<JLabel text="isisfish.fisheryRegion.selectFile"/>
</cell>
</row>
- <row>
+ <!-- <row>
<cell columns='3'>
<JLabel text="isisfish.fisheryRegion.ofCells"/>
</cell>
@@ -294,13 +290,13 @@
</row>
</Table>
</cell>
- </row>
+ </row> -->
<row>
<cell fill='horizontal' weightx='0.3'>
<JButton id='save' decorator='boxed'
text="isisfish.common.save"
enabled="{validator.isValid() && validator.isChanged()}"
- onActionPerformed="save()"/>
+ onActionPerformed="save();validator.setChanged(false)"/>
</cell>
<cell fill='horizontal' weightx='0.3'>
<JButton id='cancel' decorator='boxed'
Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2011-04-18 15:46:47 UTC (rev 3266)
+++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2011-04-18 15:47:11 UTC (rev 3267)
@@ -877,19 +877,19 @@
}
}
- /**
+ /*
* Affiche une boite de dialogue demandant a l'utilisateur de rentrer
* un nom de fichier, et met ce nom dans la textField.
* Passe le saveButton en enabled pour marque que la region a ete modifié
*
* @param cellFile file of cells
- */
+ *
public void loadCellFile(String cellFile) {
if (log.isWarnEnabled()) {
log.warn("loadCell called but not implemented");
}
// FIXME todo loadCellFile
- }
+ }*/
public void saveFisheryRegion(FisheryRegion fisheryRegion) {
if (log.isTraceEnabled()) {
1
0