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
February 2009
- 6 participants
- 128 discussions
r1865 - isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors
by chatellier@users.labs.libre-entreprise.org 24 Feb '09
by chatellier@users.labs.libre-entreprise.org 24 Feb '09
24 Feb '09
Author: chatellier
Date: 2009-02-24 10:33:31 +0000 (Tue, 24 Feb 2009)
New Revision: 1865
Modified:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java
Log:
Update factors tests
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java 2009-02-24 09:59:44 UTC (rev 1864)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java 2009-02-24 10:33:31 UTC (rev 1865)
@@ -22,9 +22,9 @@
import org.apache.commons.logging.LogFactory;
import org.codelutin.math.matrix.MatrixFactory;
import org.codelutin.math.matrix.MatrixND;
+import org.junit.Assert;
import org.junit.Test;
-
/**
* Factors test.
*
@@ -38,27 +38,28 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
private static Log log = LogFactory.getLog(FactorTest.class);
-
+
/**
* Test to build new factors with int values.
*/
@Test
public void testIntFactor() {
-
+
Factor<Integer> factor = new Factor<Integer>("testint");
- factor.getDomain().put("i1", 0);
- factor.getDomain().put("i2", 1);
- factor.getDomain().put("i3", 2);
- factor.getDomain().put("i4", 3);
- factor.getDomain().put("i5", 4);
+ ContinuousDomain<Integer> domain = new ContinuousDomain<Integer>();
+ domain.setMinBound(0);
+ domain.setMaxBound(50);
+ factor.setDomain(domain);
factor.setPath("org.codelutin.factor#1234567890#0.12242345354#name");
- factor.setValueLabel("i3");
-
+ factor.setValueForIdentifier(49);
+
+ Assert.assertEquals((Integer) 49, factor.getValue());
+
if (log.isInfoEnabled()) {
log.info("factor#toString() = " + factor);
}
}
-
+
/**
* Test factor with matrix.
*
@@ -66,32 +67,47 @@
*/
@Test
public void testMatrixFactor() {
-
+
// matrix 1
- MatrixND matrix1 = MatrixFactory.getInstance().create("test1", new int[] {3,2}, new String[]{"col1", "col2"});
- matrix1.setValue(new int[]{0,0}, 13);
- matrix1.setValue(new int[]{0,1}, -14);
- matrix1.setValue(new int[]{1,0}, 21);
- matrix1.setValue(new int[]{1,1}, 2);
- matrix1.setValue(new int[]{2,0}, 12);
- matrix1.setValue(new int[]{2,1}, -1);
-
+ MatrixND matrix1 = MatrixFactory.getInstance().create("test1",
+ new int[] { 3, 2 }, new String[] { "col1", "col2" });
+ matrix1.setValue(new int[] { 0, 0 }, 13);
+ matrix1.setValue(new int[] { 0, 1 }, -14);
+ matrix1.setValue(new int[] { 1, 0 }, 21);
+ matrix1.setValue(new int[] { 1, 1 }, 2);
+ matrix1.setValue(new int[] { 2, 0 }, 12);
+ matrix1.setValue(new int[] { 2, 1 }, -1);
+
// matrix 2
- MatrixND matrix2 = MatrixFactory.getInstance().create("test2", new int[] {2,3}, new String[]{"col1", "col2"});
- matrix2.setValue(new int[]{0,0}, 9999);
- matrix2.setValue(new int[]{0,1}, 15000);
- matrix2.setValue(new int[]{0,2}, -40000);
- matrix2.setValue(new int[]{1,0}, 21345);
- matrix2.setValue(new int[]{1,1}, 81000);
- matrix2.setValue(new int[]{1,2}, -13000);
-
+ MatrixND matrix2 = MatrixFactory.getInstance().create("test2",
+ new int[] { 2, 3 }, new String[] { "col1", "col2" });
+ matrix2.setValue(new int[] { 0, 0 }, 9999);
+ matrix2.setValue(new int[] { 0, 1 }, 15000);
+ matrix2.setValue(new int[] { 0, 2 }, -40000);
+ matrix2.setValue(new int[] { 1, 0 }, 21345);
+ matrix2.setValue(new int[] { 1, 1 }, 81000);
+ matrix2.setValue(new int[] { 1, 2 }, -13000);
+
// factor
Factor<MatrixND> factor = new Factor<MatrixND>("testmatrix");
- factor.getDomain().put("m1", matrix1);
- factor.getDomain().put("m2", matrix2);
+ DiscreteDomain<MatrixND> domain = new DiscreteDomain<MatrixND>();
+ domain.getValues().put("m1", matrix1);
+ domain.getValues().put("m2", matrix2);
+ factor.setDomain(domain);
factor.setPath("org.codelutin.math.matrix.MatrixND#563456293453#2.456347646#dim");
- factor.setValueLabel("m2");
-
+ factor.setValueForIdentifier("m2");
+
+ Assert.assertEquals(matrix2, factor.getValue());
+
+ try {
+ factor.setValueForIdentifier("blah blah");
+ Assert.fail("Can't set identifier not present in domain");
+ } catch (IllegalArgumentException e) {
+ if (log.isInfoEnabled()) {
+ log.info("Exception normally thrown");
+ }
+ }
+
if (log.isInfoEnabled()) {
log.info("factor#toString() = " + factor);
}
1
0
r1864 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors
by chatellier@users.labs.libre-entreprise.org 24 Feb '09
by chatellier@users.labs.libre-entreprise.org 24 Feb '09
24 Feb '09
Author: chatellier
Date: 2009-02-24 09:59:44 +0000 (Tue, 24 Feb 2009)
New Revision: 1864
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/ContinuousDomain.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DiscreteDomain.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Domain.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityScenarios.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java
Log:
Update factors classes.
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/ContinuousDomain.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/ContinuousDomain.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/ContinuousDomain.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -0,0 +1,90 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * Domaine continu.
+ *
+ * Composé d'un borne min et max.
+ *
+ * @param <E> type des valeurs gérées par le domaine
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 24 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public class ContinuousDomain<E extends Serializable> implements Domain<E> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -2037768174807839046L;
+
+ /** Borne inférieure */
+ protected E minBound;
+
+ /** Borne supérieure */
+ protected E maxBound;
+
+ /**
+ * Empty constructor.
+ */
+ public ContinuousDomain() {
+
+ }
+
+ /**
+ * Constructor with bounds.
+ *
+ * @param minBound min bound
+ * @param maxBound max bound
+ */
+ public ContinuousDomain(E minBound, E maxBound) {
+ this();
+ this.minBound = minBound;
+ this.maxBound = maxBound;
+ }
+
+ /**
+ * {@inheritDoc}.
+ *
+ * In continuous domain, just return identifier
+ */
+ public E getValueForIdentifier(Serializable identifier) {
+ // FIXME test cast
+ return (E)identifier;
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this);
+ builder.append(minBound);
+ builder.append(minBound);
+
+ return builder.toString();
+ }
+}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java 2009-02-23 23:14:43 UTC (rev 1863)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -22,13 +22,10 @@
import java.util.List;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
/**
* Design plan contenant toutes les
* valeur de facteur possible.
- *
- * @param <E> type des valeurs gérées par le plan
*
* @author chatellier
* @version $Revision: 1.0 $
@@ -36,13 +33,13 @@
* Last update : $Date: 19 févr. 2009 $
* By : $Author: chatellier $
*/
-public class DesignPlan<E extends Serializable> implements Serializable {
+public class DesignPlan implements Serializable {
/** serialVersionUID. */
private static final long serialVersionUID = 977975461743758075L;
/** Liste des facteurs a utiliser */
- protected List<Factor<E>> factors;
+ protected List<Factor<? extends Serializable>> factors;
/**
* Constructor.
@@ -56,7 +53,7 @@
*
* @return factors list
*/
- public List<Factor<E>> getFactors() {
+ public List<Factor<? extends Serializable>> getFactors() {
return factors;
}
@@ -65,7 +62,7 @@
*
* @param factors the factors list to set
*/
- public void setFactors(List<Factor<E>> factors) {
+ public void setFactors(List<Factor<? extends Serializable>> factors) {
this.factors = factors;
}
@@ -75,7 +72,7 @@
@Override
public String toString() {
- ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ ToStringBuilder builder = new ToStringBuilder(this);
builder.append(factors);
return builder.toString();
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DiscreteDomain.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DiscreteDomain.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DiscreteDomain.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -0,0 +1,101 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import java.io.Serializable;
+import java.util.SortedMap;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * Domain discret.
+ *
+ * Ensemble de valeurs.
+ *
+ * @param <E> type des valeurs gérées par le domaine
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 24 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public class DiscreteDomain<E extends Serializable> implements Domain<E> {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -192647757737396585L;
+
+ /**
+ * Value for this domain.
+ *
+ * Each "E" values is identified by a Serializable identifier.
+ */
+ protected SortedMap<Serializable, E> values;
+
+ /**
+ * Contructor.
+ */
+ public DiscreteDomain() {
+
+ }
+
+ /**
+ * Get domaine values.
+ *
+ * @return the values
+ */
+ public SortedMap<Serializable, E> getValues() {
+ return values;
+ }
+
+ /**
+ * Set domain values.
+ *
+ * @param values the values
+ */
+ public void setValues(SortedMap<Serializable, E> values) {
+ this.values = values;
+ }
+
+ /**
+ * {@inheritDoc}.
+ *
+ * @throws IllegalArgumentException if identifier is not a valid key
+ */
+ public E getValueForIdentifier(Serializable identifier) throws IllegalArgumentException{
+
+ if( values == null || !values.containsKey(identifier)) {
+ throw new IllegalArgumentException("Can't get value for identifier " + identifier);
+ }
+
+ return values.get(identifier);
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this);
+ builder.append(values);
+
+ return builder.toString();
+ }
+}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Domain.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Domain.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Domain.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -0,0 +1,53 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import java.io.Serializable;
+
+/**
+ * Domaine du facteur.
+ *
+ * Ensemble des valeurs possibles a prendre en compte.
+ * La clé est un label qui permet d'identifier la valeur.
+ *
+ * Le domain peut etre :
+ * - discret : i.e un ensemble de valeurs
+ * - continu : i.e, une borne min, max
+ *
+ * @param <E> type des valeurs gérées par le domaine
+ *
+ * @see DiscreteDomain
+ * @see ContinuousDomain
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 24 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public interface Domain<E extends Serializable> extends Serializable {
+
+ /**
+ * Return value associated to identifier.
+ *
+ * @param identifier
+ * @return found value or <tt>null</tt> if not found
+ */
+ E getValueForIdentifier(Serializable identifier);
+}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java 2009-02-23 23:14:43 UTC (rev 1863)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -19,11 +19,8 @@
package fr.ifremer.isisfish.simulator.factors;
import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
/**
* Facteur de variation des parametres de simulation.
@@ -50,7 +47,7 @@
protected String name;
/**
- * Domain du facteur.
+ * Domaine du facteur.
*
* Ensemble des valeurs possibles a prendre en compte.
* La clé est un label qui permet d'identifier la valeur.
@@ -58,20 +55,16 @@
* Le domain peut etre :
* - discret : i.e un ensemble de valeurs
* - continu : i.e, une borne min, max
- *
- * FIXME min et max pour un domain continu ?
- * FIXME domain.size() = 2 ?
+ *
+ * @see ContinuousDomain
+ * @see DiscreteDomain
*/
- protected Map<String, E> domain;
+ protected Domain<E> domain;
/**
- * Label de la valeur par defaut.
- *
- * Utilisation différente suivant le cas :
- * - avant envoie vers R : valeur par défaut
- * - apres, valeur a prendre en compte
+ * Factor value.
*/
- protected String valueLabel;
+ protected E value;
/**
* Path permettant d'identifier l'objet et
@@ -91,8 +84,7 @@
* Protected, name is mandatory.
*/
protected Factor() {
- // impl must be Serializable
- domain = new HashMap<String, E>();
+
}
/**
@@ -128,7 +120,7 @@
*
* @return the domain
*/
- public Map<String, E> getDomain() {
+ public Domain<E> getDomain() {
return domain;
}
@@ -137,27 +129,36 @@
*
* @param domain the domain to set
*/
- public void setDomain(Map<String, E> domain) {
+ public void setDomain(Domain<E> domain) {
this.domain = domain;
}
/**
- * Get value label.
+ * Get value.
*
- * @return the valueLabel
+ * @return the value
*/
- public String getValueLabel() {
- return valueLabel;
+ public E getValue() {
+ return value;
}
/**
- * Set value label.
+ * Set value.
*
- * @param valueLabel the valueLabel to set
+ * @param value new value
*/
- public void setValueLabel(String valueLabel) {
- this.valueLabel = valueLabel;
+ public void setValue(E value) {
+ this.value = value;
}
+
+ /**
+ * Set value for label.
+ *
+ * @param valueIdentifier new value identifier to get
+ */
+ public void setValueForIdentifier(Serializable valueIdentifier) {
+ value = domain.getValueForIdentifier(valueIdentifier);
+ }
/**
* Get path.
@@ -183,10 +184,10 @@
@Override
public String toString() {
- ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ ToStringBuilder builder = new ToStringBuilder(this);
builder.append(name);
builder.append(domain);
- builder.append(valueLabel);
+ builder.append(value);
builder.append(path);
return builder.toString();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java 2009-02-23 23:14:43 UTC (rev 1863)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -20,15 +20,11 @@
import java.io.Serializable;
import java.util.List;
-import java.util.Map;
import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
/**
* Scenario d'execution de simulation.
- *
- * @param <E> type des valeurs gérées par le scenario
*
* @author chatellier
* @version $Revision: 1.0 $
@@ -36,20 +32,17 @@
* Last update : $Date: 19 févr. 2009 $
* By : $Author: chatellier $
*/
-public class Scenario<E extends Serializable> implements Serializable {
+public class Scenario implements Serializable {
/** serialVersionUID. */
private static final long serialVersionUID = 4953721873692486687L;
/**
- * Ensemble des simulations a executer.
+ * Ensemble des factors a prendre en compte.
*
- * Chaque simulation a un nom, et une liste de facteur.
- *
- * Chaque facteur a la {@link fr.ifremer.isisfish.simulator.factors.Factor#valueLabel}
- * a prendre en compte pour la simulation.
+ * Chaque facteur a la {@link Factor#value} a prendre en compte pour la simulation.
*/
- protected Map<String, List<Factor<E>>> simulationsFactors;
+ protected List<Factor<? extends Serializable>> factors;
/**
* Constructeur.
@@ -63,17 +56,17 @@
*
* @return the simulations
*/
- public Map<String, List<Factor<E>>> getSimulationsFactors() {
- return simulationsFactors;
+ public List<Factor<? extends Serializable>> getFactors() {
+ return factors;
}
/**
* Set simulation factors.
*
- * @param simulationsFactors the simulations factors to set
+ * @param factors the simulations factors to set
*/
- public void setSimulationsFactors(Map<String, List<Factor<E>>> simulationsFactors) {
- this.simulationsFactors = simulationsFactors;
+ public void setSimulationsFactors(List<Factor<? extends Serializable>> factors) {
+ this.factors = factors;
}
/*
@@ -82,8 +75,8 @@
@Override
public String toString() {
- ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
- builder.append(simulationsFactors);
+ ToStringBuilder builder = new ToStringBuilder(this);
+ builder.append(factors);
return builder.toString();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java 2009-02-23 23:14:43 UTC (rev 1863)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -18,11 +18,14 @@
package fr.ifremer.isisfish.simulator.factors;
-import java.io.Serializable;
-
/**
- * Interface vers le calculateur statistique.
+ * Interface commune à toutes implémentation
+ * de calcul de sensibilité.
*
+ * Les implémentations peuvent contenir des paramètres
+ * nommé "param_xx" (pour le paramètre xx) qui
+ * seront injecté par Isis.
+ *
* @author chatellier
* @version $Revision: 1.0 $
*
@@ -33,22 +36,27 @@
/**
* Envoi un plan a faire analyser par l'outils
- * statistique.
-
+ * d'analyse de sensibilité.
+ *
+ * Retourne un {@link SensitivityScenarios} qui
+ * représente l'ensemble des scenarios à prendre
+ * en compte pour les simulations.
+ *
* @param plan plan a analyser
- * @param <E> type des données du scenario et du plan
*
- * @return un Scenario
+ * @return un {@link SensitivityScenarios}
+ *
* @see DesignPlan
* @see Scenario
+ * @see SensitivityScenarios
*/
- <E extends Serializable> Scenario<E> getScenario(DesignPlan<E> plan);
+ SensitivityScenarios compute(DesignPlan plan);
/**
- * Ajoute un paramètre pour l'outils statistique.
+ * Permet de renvoyer les resultats de simulations
+ * à l'outils de d'analyse de sensibilité.
*
- * @param key nom du parametre
- * @param value valeur du parametre
+ * @param sensitivityScenarios résultats de scenarios
*/
- void setParameter(String key, String value);
+ void analyzeResult(SensitivityScenarios sensitivityScenarios);
}
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityScenarios.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityScenarios.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityScenarios.java 2009-02-24 09:59:44 UTC (rev 1864)
@@ -0,0 +1,80 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import java.util.List;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * Ensemble de {@link Scenario}.
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 24 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public class SensitivityScenarios {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4953721873692486687L;
+
+ /**
+ * Ensemble des scenarios.
+ */
+ protected List<Scenario> scenarios;
+
+ /**
+ * Constructeur.
+ */
+ public SensitivityScenarios() {
+
+ }
+
+ /**
+ * Get scenarios.
+ *
+ * @return the scenarios
+ */
+ public List<Scenario> getScenarios() {
+ return scenarios;
+ }
+
+ /**
+ * Set scenarios.
+ *
+ * @param scenarios the scenarios
+ */
+ public void setScenarios(List<Scenario> scenarios) {
+ this.scenarios = scenarios;
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this);
+ builder.append(scenarios);
+
+ return builder.toString();
+ }
+}
1
0
r1863 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 23 Feb '09
by sletellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: sletellier
Date: 2009-02-23 23:14:43 +0000 (Mon, 23 Feb 2009)
New Revision: 1863
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
Log:
Debug final
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -89,9 +89,11 @@
@Override
public boolean onMouseClicked() {
for (Cell c : cellMap.getSelectedCells()){
- if (!c.getTopiaId().equals(getBean().getTopiaId())){
- jaxx.runtime.swing.Utils.fillComboBox(fieldCell,getRegion().getCell(), c);
- return true;
+ if (getBean() != null){
+ if (!c.getTopiaId().equals(getBean().getTopiaId())){
+ jaxx.runtime.swing.Utils.fillComboBox(fieldCell,getRegion().getCell(), c);
+ return true;
+ }
}
}
return true;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/EffortDescriptionUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -150,7 +150,7 @@
<JLabel text="isisfish.effortDescription.fishingOperationDuration" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}'/>
+ <JTextField id="fieldEffortDescriptionFishingOperationDuration" text='{getEffortDescription().getFishingOperationDuration() == null ? "" : getEffortDescription().getFishingOperationDuration().getHour()}' onKeyReleased='getEffortDescription().setFishingOperationDuration(new TimeUnit(3600 * Double.parseDouble(fieldEffortDescriptionFishingOperationDuration.getText())))' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/GearTabUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -44,7 +44,8 @@
import org.codelutin.topia.TopiaException;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
-
+import fr.ifremer.isisfish.types.RangeOfValues;
+boolean init = false;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getOldValue() != null || evt.getNewValue() == null) {
@@ -75,10 +76,18 @@
values.add(value);
if (getBean() != null){
if (values != null){
- jaxx.runtime.swing.Utils.fillComboBox(fieldGearParamType, values, getBean().getParameterName(), true);
+ init = true;
+ jaxx.runtime.swing.Utils.fillComboBox(fieldGearParamType, values, getBean().getPossibleValue() == null ? null : getBean().getPossibleValue().getType(), true);
+ init = false;
}
}
}
+protected void paramChanged(){
+ if (fieldGearParamType.getSelectedItem() != null){
+ if (!init)
+ getBean().setPossibleValue(new RangeOfValues(fieldGearParamType.getSelectedItem().toString().concat("[" + fieldGearParamPossibleValue.getText() + "]")));
+ }
+}
]]>
</script>
<Table id='body'>
@@ -122,10 +131,10 @@
<JLabel text="isisfish.gear.rangeValues" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JComboBox id="fieldGearParamType" onActionPerformed='getBean().setParameterName(fieldGearParamName.getSelectedText())' enabled='{isActif()}'/>
+ <JComboBox id="fieldGearParamType" onActionPerformed='paramChanged()' enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldGearParamPossibleValue" text='{getBean().getPossibleValue() == null ? null : getBean().getPossibleValue().getValues()}' onKeyReleased='getBean().setStandardisationFactor(Double.parseDouble(fieldGearParamPossibleValue.getText()))' enabled='{isActif()}'/>
+ <JTextField id="fieldGearParamPossibleValue" text='{getBean().getPossibleValue() == null ? "" : getBean().getPossibleValue().getValues()}' onKeyReleased='paramChanged()' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -50,6 +50,7 @@
import java.lang.reflect.Method;
import org.apache.commons.beanutils.MethodUtils;
import org.codelutin.topia.persistence.TopiaEntity;
+import org.codelutin.topia.TopiaContext;
import fr.ifremer.isisfish.entities.EquationDAO;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import jaxx.runtime.swing.Item;
@@ -78,6 +79,7 @@
if (evt.getNewValue() != null) {
// add binding on getBean()
//jaxx.runtime.Util.applyDataBinding(get$Table0(), "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
+ setComboModel();
}
}
});
@@ -101,6 +103,7 @@
}
};
}
+ setComboModel();
editor.getCurrentEditor().addDocumentListener(listener);
}
public void init(String lblText, TopiaEntity bean, String name, String methodGet, String methodSet, Class c){
@@ -155,7 +158,14 @@
editor.getCurrentEditor().addDocumentListener(listener);
}
protected void setComboModel(){
- java.util.List<Formule> formules = getAction().getFormules(getVerifier().getIsisContext(), name);
+ TopiaContext isisContext = getVerifier().getIsisContext();
+ if (isisContext == null && getBean() != null){
+ isisContext = getBean().getTopiaContext();
+ }
+ java.util.List<Formule> formules = null;
+ if (name != null){
+ formules = getAction().getFormules(isisContext, name);
+ }
if (formules != null){
java.util.List<Item> items = new ArrayList<Item>();
items.add(new Item("null", " ", null, false));
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-02-23 23:14:43 UTC (rev 1863)
@@ -154,9 +154,9 @@
boolean doDelete;
ArrayList<TopiaEntity> allWillBeRemoved = new ArrayList<TopiaEntity>();
for (TopiaEntity te : currentEntities){
- if (te.getComposite() != null){
- allWillBeRemoved.addAll(te.getComposite());
- }
+// if (te.getComposite() != null){
+// allWillBeRemoved.addAll(te.getComposite());
+// }
allWillBeRemoved.add(te);
}
if (allWillBeRemoved.size() > 0) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -217,16 +217,16 @@
<JMenuItem text="isisfish.input.menu.importRenameRegion" onActionPerformed="importRegionAndRename()" accelerator="accNew"/>
<JMenuItem text="isisfish.input.menu.importRegionV2" onActionPerformed="importV2Region()" accelerator="accNew"/>
<JMenuItem text="isisfish.input.menu.importRegionSimulation" onActionPerformed="importRegionFromSimulation()" accelerator="accImportFromSimulation"/>
- <JMenuItem text="isisfish.input.menu.exportRegion" onActionPerformed="exportRegion()" accelerator="accExport"/>
- <JMenuItem text="isisfish.input.menu.copyRegion" onActionPerformed="copyRegion()" accelerator="accExport"/>
+ <JMenuItem text="isisfish.input.menu.exportRegion" enabled='{getRegion() != null}' onActionPerformed="exportRegion()" accelerator="accExport"/>
+ <JMenuItem text="isisfish.input.menu.copyRegion" enabled='{getRegion() != null}' onActionPerformed="copyRegion()" accelerator="accExport"/>
<JSeparator/>
- <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocaly" onActionPerformed="removeRegion()" accelerator="accRemove"/>
+ <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocaly" enabled='{getRegion() != null}' onActionPerformed="removeRegion()" accelerator="accRemove"/>
</JMenu>
<JMenu text="isisfish.input.menu.server">
- <JMenuItem text="isisfish.input.menu.addRegion" onActionPerformed="commitRegionInCVS()" accelerator="accAdd"/>
- <JMenuItem text="isisfish.input.menu.commit" onActionPerformed="commitRegionInCVS()" accelerator="accCommitVCS"/>
+ <JMenuItem text="isisfish.input.menu.addRegion" enabled='{getRegion() != null}' onActionPerformed="commitRegionInCVS()" accelerator="accAdd"/>
+ <JMenuItem text="isisfish.input.menu.commit" enabled='{getRegion() != null}' onActionPerformed="commitRegionInCVS()" accelerator="accCommitVCS"/>
<JSeparator/>
- <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocalyRemotely" onActionPerformed="removeRegion()" accelerator="accRemove"/>
+ <JMenuItem name="miRemove" text="isisfish.input.menu.removeLocalyRemotely" enabled='{getRegion() != null}' onActionPerformed="removeRegion()" accelerator="accRemove"/>
</JMenu>
<!--JMenu text="isisfish.input.menu.help">
<JMenuItem name="miAbout" text="isisfish.input.menu.about" onActionPerformed="about()" accelerator="accAbout"/>
@@ -246,13 +246,11 @@
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
<JComboBox id="fieldCurrentRegion" model='{getFieldCurrentRegionModel()}' onItemStateChanged='regionChange()'/>
- <!--JComboBox id="fieldCurrentRegion" model='{getFieldCurrentRegionModel()}' onActionPerformed='regionChange()'/-->
</cell>
</row>
</Table>
<JPanel id="treePanel" name="treePanel" layout='{new BorderLayout()}'>
<JScrollPane constraints='BorderLayout.CENTER'>
- <!--JTree id="tree" name="tree" model='{getTreeModel()}'/-->
<JTree id="navigation" rootVisible="true" selectionRow='0' model='{new DefaultTreeModel(null)}'/>
</JScrollPane>
</JPanel>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoSpeciesUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -36,6 +36,8 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.MetierImpl id='bean' javaBean='null'/>
+ <Boolean id='metierSeasonSelected' javaBean='false'/>
+ <Boolean id='targetSpeciesSelected' javaBean='false'/>
<script><![CDATA[
import com.l2fprod.common.swing.renderer.BooleanCellRenderer;
@@ -70,6 +72,29 @@
}
});
+tableTargetSpecies.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ remove.setEnabled(tableTargetSpecies.getSelectedRow() != -1);
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e) {
+ }
+});
public void refresh() {
getVerifier().setSaveButton(save);
getVerifier().setCancelButton(cancel);
@@ -86,7 +111,7 @@
if (fieldTargetSpecies.getSelectedIndex() <= 0){
setTargetSpeciesModel();
}
-
+ setTableTargetSpeciesModel();
// TODO : Equation selectionne
targetFactor.init(_("isisfish.metierSeasonInfoSpecies.targetFactor"), null, "TargetFactor", null, null, fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation.class);
}
@@ -95,6 +120,8 @@
fieldMetierSeasonInfo.setModel(seasonModel);
setTargetSpeciesModel();
}
+ remove.setEnabled(false);
+ setAddButton();
}
protected void setSeasonModel(){
DefaultComboBoxModel seasonModel = new DefaultComboBoxModel();
@@ -163,7 +190,7 @@
(Species)species,
targetFactor.getEditor().getText(),
fieldPrimaryCatch.isSelected());
- refresh();
+ setTableTargetSpeciesModel();
}
}
protected void remove(){
@@ -176,13 +203,22 @@
if (o != null){
TargetSpecies ts = (TargetSpecies)o;
getAction().removeTargetSpecies(m, ts);
- refresh();
+ setTableTargetSpeciesModel();
}
}
}
protected void metierSeasonChanged(){
- setTableTargetSpeciesModel();
+ setMetierSeasonSelected(fieldMetierSeasonInfo.getSelectedItem() != null);
+ setTargetSpeciesModel();
+ setAddButton();
}
+protected void targetSpeciesChanged(){
+ setTargetSpeciesSelected(fieldTargetSpecies.getSelectedItem() != null);
+ setAddButton();
+}
+protected void setAddButton(){
+ add.setEnabled(getMetierSeasonSelected() && getTargetSpeciesSelected());
+}
]]></script>
<Table id='body'>
<row>
@@ -201,7 +237,7 @@
<JLabel text="isisfish.metierSeasonInfoSpecies.selectSpecies" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldTargetSpecies" enabled='{isActif()}'/>
+ <JComboBox id="fieldTargetSpecies" onActionPerformed='targetSpeciesChanged()' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -225,7 +261,7 @@
<Table>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonMetierSpeciesAddTargetSpecies" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/>
+ <JButton id="add" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -237,7 +273,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonMetierSpeciesRemoveTargetSpecies" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
+ <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -183,6 +183,13 @@
}
getMetierSeasonInfo().setZone(zones);
}
+ protected void seasonChanged(){
+ setMetierSeasonInfo((MetierSeasonInfoImpl)fieldMetierSeasonChoice.getSelectedItem());
+ getVerifier().addCurrentEntity(getMetierSeasonInfo());
+ setMetierSeasonInfoNotNull(getMetierSeasonInfo() != null);
+ setSeason();
+ setMetierZone();
+ }
]]></script>
<Table id='body'>
<row>
@@ -194,7 +201,7 @@
</cell>
<cell fill='horizontal' weightx='1.0'>
<JComboBox id="fieldMetierSeasonChoice"
- onActionPerformed='setMetierSeasonInfo((MetierSeasonInfoImpl)fieldMetierSeasonChoice.getSelectedItem());getVerifier().addCurrentEntity(getMetierSeasonInfo());setMetierSeasonInfoNotNull(getMetierSeasonInfo() != null);setSeason();setMetierZone();'
+ onActionPerformed='seasonChanged()'
enabled='{isActif()}'/>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationBasicsUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -59,6 +59,7 @@
fieldPopulationBasicsNbClasses.setText("");
fieldPopulationBasicsComment.setText("");
fieldPopulationBasicsMatureClass.setSelectedItem(null);
+ tableAgeLength.setModel(new DefaultTableModel());
growthEquation.init(_("isisfish.populationBasics.growth"), null, "Growth", "Growth", "EquationGrowth", fr.ifremer.isisfish.equation.PopulationGrowth.class);
growthReverseEquation.init(_("isisfish.populationBasics.growthReverse"), null, "GrowthReverse", "GrowthReverse", "EquationGrowthReverse", fr.ifremer.isisfish.equation.PopulationGrowthReverse.class);
}
@@ -127,12 +128,6 @@
tableAgeLength.setModel(model);
}
}
-protected String getSizePopulationGroup(){
- if (getBean() != null){
- return String.valueOf(getBean().sizePopulationGroup());
- }
- return "";
-}
protected void create(){
Species species = getAction().getSpeciesByTopiaId(getVerifier().getIsisContext(), getVerifier().getCurrentNode().getParent().getNavigationPath());
if (species == null){
@@ -174,7 +169,7 @@
<JLabel text="isisfish.populationBasics.numberGroup" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
- <JTextField id="fieldPopulationBasicsNbClasses" text='{getSizePopulationGroup()}' editable="false" enabled='{isActif()}'/>
+ <JTextField id="fieldPopulationBasicsNbClasses" text='{getBean() == null ? "" : getBean().sizePopulationGroup()}' editable="false" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='0.5'>
<JButton id="buttonPopulationBasicsCreateClasses" text="isisfish.populationBasics.recreateClasses" onActionPerformed='createClasses()' enabled='{isActif()}'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationCapturabilityUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -43,6 +43,18 @@
import org.codelutin.math.matrix.gui.MatrixPanelEvent;
import org.codelutin.math.matrix.gui.MatrixPanelListener;
+MatrixPanelListener listener = new MatrixPanelListener() {
+
+ @Override
+ public void matrixChanged(MatrixPanelEvent arg0) {
+ if (getBean() != null){
+ if (fieldPopulationCapturability.getMatrix() != null){
+ getBean().setCapturability(fieldPopulationCapturability.getMatrix());
+ }
+ }
+ }
+};
+
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getOldValue() != null || evt.getNewValue() == null) {
@@ -58,21 +70,18 @@
}
});
+
public void refresh(){
getVerifier().setSaveButton(save);
getVerifier().setCancelButton(cancel);
Population population = getVerifier().getEntity(Population.class);
setBean((PopulationImpl) population);
- fieldPopulationCapturability.addMatrixListener(new MatrixPanelListener() {
- @Override
- public void matrixChanged(MatrixPanelEvent arg0) {
- if (getBean() != null){
- if (fieldPopulationCapturability.getMatrix() != null){
- getBean().setCapturability(fieldPopulationCapturability.getMatrix());
- }
- }
- }
- });
+ if (getBean() != null){
+ if (getBean().getCapturability() != null){
+ fieldPopulationCapturability.setMatrix(getBean().getCapturability().copy());
+ }
+ }
+ fieldPopulationCapturability.addMatrixListener(listener);
}
]]>
</script>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationGroupUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -133,7 +133,7 @@
<JLabel text="isisfish.populationGroup.age" enabled='{isPopGroupNotNull()}'/>
</cell>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JTextField id="fieldPopulationGroupAge" text='{getPopulationGroup().getAge()}' enabled='{isPopGroupNotNull()}'/>
+ <JTextField id="fieldPopulationGroupAge" text='{getPopulationGroup().getAge()}' onKeyReleased='getPopulationGroup().setAge(Double.parseDouble(fieldPopulationGroupAge.getText()))' enabled='{isPopGroupNotNull()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationImmigrationUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -144,21 +144,21 @@
getPopInfo().setImmigrationMatrix(mat);
remove.setEnabled(false);
}
- protected void groupChanged(){
- setGPopSelected(fieldPopulationMigrationImmigrationGroupChooser.getSelectedItem() != null);
- setAddButton();
- }
- protected void coefChanged(){
- setCoefNonVide(!fieldPopulationMigrationImmigrationCoefficient.getText().equals(""));
- setAddButton();
- }
- protected void zoneChanged(){
- setZoneDepartSelected(fieldPopulationMigrationImmigrationArrivalZoneChooser.getSelectedItem() != null);
- setAddButton();
- }
- protected void setAddButton(){
- add.setEnabled(getGPopSelected() && getZoneDepartSelected() && getCoefNonVide());
- }
+protected void groupChanged(){
+ setGPopSelected(fieldPopulationMigrationImmigrationGroupChooser.getSelectedItem() != null);
+ setAddButton();
+}
+protected void coefChanged(){
+ setCoefNonVide(!fieldPopulationMigrationImmigrationCoefficient.getText().equals(""));
+ setAddButton();
+}
+protected void zoneChanged(){
+ setZoneDepartSelected(fieldPopulationMigrationImmigrationArrivalZoneChooser.getSelectedItem() != null);
+ setAddButton();
+}
+protected void setAddButton(){
+ add.setEnabled(getGPopSelected() && getZoneDepartSelected() && getCoefNonVide());
+}
]]>
</script>
<Table id='body'>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationMigrationMigrationUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -95,16 +95,15 @@
public void mouseExited(MouseEvent e) {
}
});
+MatrixPanelListener listener = new MatrixPanelListener() {
-populationMigrationMigrationTable.addMatrixListener(new MatrixPanelListener() {
-
@Override
public void matrixChanged(MatrixPanelEvent arg0) {
if (getPopInfo() != null){
getPopInfo().setMigrationMatrix(populationMigrationMigrationTable.getMatrix());
}
}
-});
+};
public void init(PopulationSeasonInfo pi){
setPopInfo((PopulationSeasonInfoImpl)pi);
@@ -117,6 +116,8 @@
setFieldPopulationMigrationMigrationDepartureZoneChooserModel();
setFieldPopulationMigrationMigrationArrivalZoneChooserModel();
+ populationMigrationMigrationTable.addMatrixListener(listener);
+
remove.setEnabled(false);
setAddButton();
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationRecruitmentUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -41,6 +41,8 @@
import fr.ifremer.isisfish.entities.Formule;
import fr.ifremer.isisfish.entities.Population;
import fr.ifremer.isisfish.entities.PopulationImpl;
+import org.codelutin.math.matrix.gui.MatrixPanelEvent;
+import org.codelutin.math.matrix.gui.MatrixPanelListener;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -60,6 +62,17 @@
}
});
+MatrixPanelListener listener = new MatrixPanelListener() {
+ @Override
+ public void matrixChanged(MatrixPanelEvent arg0) {
+ if (getBean() != null){
+ if (fieldPopulationRecruitmentDistribution.getMatrix() != null){
+ getBean().setRecruitmentDistribution(fieldPopulationRecruitmentDistribution.getMatrix());
+ }
+ }
+ }
+};
+
public void refresh() {
getVerifier().setSaveButton(save);
getVerifier().setCancelButton(cancel);
@@ -68,6 +81,11 @@
reproductionEquation.init(_("isisfish.populationRecruitment.reproductionEquation"), getBean(), "Reproduction", "ReproductionEquation", "EquationReproductionEquation", fr.ifremer.isisfish.equation.PopulationReproductionEquation.class);
getVerifier().addCurrentPanel(reproductionEquation);
+
+ if(getBean() != null && getBean().getRecruitmentDistribution() != null){
+ fieldPopulationRecruitmentDistribution.setMatrix(getBean().getRecruitmentDistribution().copy());
+ }
+ fieldPopulationRecruitmentDistribution.addMatrixListener(listener);
}
]]>
</script>
@@ -93,7 +111,7 @@
<JLabel text="isisfish.populationRecruitment.recruitmentDistribution" enabled='{isActif()}'/>
</cell>
<cell fill='both' weightx='1.0'>
- <JTable/>
+ <org.codelutin.math.matrix.gui.MatrixPanelEditor id ='fieldPopulationRecruitmentDistribution' matrix='{getBean().getRecruitmentDistribution() == null ? null : getBean().getRecruitmentDistribution().copy()}' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationSeasonsUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -50,6 +50,7 @@
import fr.ifremer.isisfish.ui.widget.IntervalPanel;
protected IntervalPanel ip = new IntervalPanel();
+protected Interval interval = new Interval();
fieldPopulationSeasonInterval.add(ip, BorderLayout.CENTER);
ip.addPropertyChangeListener("first", new PropertyChangeListener() {
@@ -117,13 +118,20 @@
getVerifier().setDeleteButton(remove, false);
Population population = getVerifier().getEntity(Population.class);
setBean((PopulationImpl) population);
+
// Model instanciation
-
- Interval interval = new Interval();
interval.setMin(0);
interval.setMax(11);
interval.setFirst(0);
interval.setLast(2);
+
+ setInterval();
+
+ ip.setLabelRenderer(Month.MONTH);
+ ip.setModel(interval);
+ setCombo();
+}
+protected void setInterval(){
if(getPopulationSeasonInfo() != null){
try {
log.debug("************** Interval ************");
@@ -148,8 +156,6 @@
// Only trace the error and go on.
}
}
- ip.setLabelRenderer(Month.MONTH);
- ip.setModel(interval);
}
protected void setCombo(){
if (getBean() != null){
@@ -161,6 +167,12 @@
getPopulationSeasonInfo().setGroupChange(fieldPopulationSeasonGroupChange.isSelected());
}
}
+protected void seasonChanged(){
+ setPopulationSeasonInfo((PopulationSeasonInfoImpl)fieldPopulationSeasonInfoChooser.getSelectedItem());
+ getVerifier().addCurrentEntity(getPopulationSeasonInfo());
+ setPopSeasonInfoNotNull(getPopulationSeasonInfo() != null);
+ setInterval();
+}
]]>
</script>
<Table id='body'>
@@ -173,7 +185,7 @@
</cell>
<cell fill='horizontal' weightx='1.0'>
<JComboBox id="fieldPopulationSeasonInfoChooser"
- onActionPerformed='setPopulationSeasonInfo((PopulationSeasonInfoImpl)fieldPopulationSeasonInfoChooser.getSelectedItem());getVerifier().addCurrentEntity(getPopulationSeasonInfo());setPopSeasonInfoNotNull(getPopulationSeasonInfo() != null);'
+ onActionPerformed='seasonChanged()'
enabled='{isActif()}'/>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PopulationZonesUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -48,6 +48,14 @@
import org.codelutin.math.matrix.gui.MatrixPanelEvent;
import org.codelutin.math.matrix.gui.MatrixPanelListener;
+MatrixPanelListener listener = new MatrixPanelListener() {
+
+ @Override
+ public void matrixChanged(MatrixPanelEvent arg0) {
+ fieldPopulationMappingZoneReproZoneRecruChanged();
+ }
+};
+
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getOldValue() != null || evt.getNewValue() == null) {
@@ -69,14 +77,9 @@
setPopulationZonesPresenceModel();
setFieldPopulationZonesReproductionModel();
setFieldPopulationZonesRecruitmentModel();
+ fieldPopulationMappingZoneReproZoneRecru.removeMatrixPanelListener(listener);
setFieldPopulationMappingZoneReproZoneRecru();
- fieldPopulationMappingZoneReproZoneRecru.addMatrixListener(new MatrixPanelListener() {
-
- @Override
- public void matrixChanged(MatrixPanelEvent arg0) {
- fieldPopulationMappingZoneReproZoneRecruChanged();
- }
- });
+ fieldPopulationMappingZoneReproZoneRecru.addMatrixListener(listener);
}
protected void fieldPopulationMappingZoneReproZoneRecruChanged(){
getBean().setMappingZoneReproZoneRecru(fieldPopulationMappingZoneReproZoneRecru.getMatrix());
@@ -135,12 +138,15 @@
}
protected void presenceChanged(){
getBean().setPopulationZone(getSelectedValue(populationZonesPresence));
+ setFieldPopulationMappingZoneReproZoneRecru();
}
protected void reproductionChanged(){
getBean().setReproductionZone(getSelectedValue(fieldPopulationZonesReproduction));
+ setFieldPopulationMappingZoneReproZoneRecru();
}
protected void recruitementChanged(){
getBean().setRecruitmentZone(getSelectedValue(fieldPopulationZonesRecruitment));
+ setFieldPopulationMappingZoneReproZoneRecru();
}
protected java.util.List<Zone> getSelectedValue(JAXXList componant){
Object[] selected = componant.getSelectedValues();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/SelectivityUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -35,6 +35,8 @@
<!-- bean property -->
<fr.ifremer.isisfish.entities.GearImpl id='bean' javaBean='null'/>
+ <Boolean id='selectivityPopulationSelected' javaBean='false'/>
+
<script>
<![CDATA[
@@ -70,6 +72,29 @@
}
});
+selectivityTable.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ }
+
+ @Override
+ public void mousePressed(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent e) {
+ remove.setEnabled(selectivityTable.getSelectedRow() != -1);
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e) {
+ }
+});
public void refresh(){
getVerifier().setSaveButton(save);
getVerifier().setCancelButton(cancel);
@@ -84,7 +109,11 @@
// TODO : Equation selection
selectivityEquation.init(_("isisfish.selectivity.equation"), null, "Selectivity", null, null, fr.ifremer.isisfish.equation.SelectivityEquation.class);
+
getVerifier().addCurrentPanel(selectivityEquation);
+
+ remove.setEnabled(false);
+ setAddButton();
}
protected void setSelectivityTableModel(){
DefaultTableModel model = new DefaultTableModel(){
@@ -130,12 +159,19 @@
}
protected void add(){
getAction().addSelectivity((Population) ((GenericCell) fieldSelectivityPopulation.getSelectedItem()).getValue(), selectivityEquation.getEditor().getText(), getBean());
- refresh();
+ setSelectivityTableModel();
}
protected void remove(){
getAction().removeSelectivity(getBean(), (Selectivity) getBean().getPopulationSelectivity((Population) selectivityTable.getValueAt(selectivityTable.getSelectedRow(), 0)));
- refresh();
+ setSelectivityTableModel();
}
+protected void selectivityChanged(){
+ setSelectivityPopulationSelected(fieldSelectivityPopulation.getSelectedItem() != null);
+ setAddButton();
+}
+protected void setAddButton(){
+ add.setEnabled(getSelectivityPopulationSelected());
+}
]]>
</script>
<Table id='body'>
@@ -147,7 +183,7 @@
<JLabel text="isisfish.selectivity.selectPopulation" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JComboBox id="fieldSelectivityPopulation" enabled='{isActif()}'/>
+ <JComboBox id="fieldSelectivityPopulation" onActionPerformed='selectivityChanged()' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -163,7 +199,7 @@
<Table>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonAddSelectivity" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/>
+ <JButton id="add" text="isisfish.common.add" onActionPerformed='add()' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -175,7 +211,7 @@
</row>
<row>
<cell columns='2' fill='horizontal' weightx='1.0'>
- <JButton id="buttonSelectivityRemove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
+ <JButton id="remove" text="isisfish.common.remove" onActionPerformed='remove()' enabled='{isActif()}'/>
</cell>
</row>
<row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -40,10 +40,9 @@
import fr.ifremer.isisfish.entities.VesselType;
import fr.ifremer.isisfish.entities.VesselTypeImpl;
import fr.ifremer.isisfish.entities.TripType;
+import jaxx.runtime.swing.Item;
import fr.ifremer.isisfish.types.TimeUnit;
-boolean init = false;
-
setButtonTitle(_("isisfish.input.continueSetOfVessels"));
setNextPath("$root/$setOfVessels");
addPropertyChangeListener("bean", new PropertyChangeListener() {
@@ -75,20 +74,23 @@
VesselType vesselType = getVerifier().getEntity(VesselType.class);
setBean((VesselTypeImpl) vesselType);
if (getBean() != null){
- init = true;
- vesselTypeTripType.fillList(getRegion().getTripType(), getBean().getTripType());
- init = false;
+ setListModel();
}
}
+protected void setListModel(){
+ java.util.List<Item> items = new java.util.ArrayList<Item>();
+ for (TripType tt : getRegion().getTripType()){
+ items.add(new Item(tt.getTopiaId(), tt.getName(), tt, false));
+ }
+ vesselTypeTripType.setItems(items);
+ vesselTypeTripType.setSelectedValues(getBean().getTripType().toArray());
+}
protected void tripTypeChanged(){
- if (!init){
- Object[] values = vesselTypeTripType.getSelectedValues();
- Collection<TripType> tripTypes = new LinkedList<TripType>();
- for (Object o : values){
- tripTypes.add((TripType)o);
- }
- getBean().setTripType(tripTypes);
+ java.util.List<TripType> tripTypes = new java.util.ArrayList<TripType>();
+ for (Object o : vesselTypeTripType.getSelectedValues()){
+ tripTypes.add((TripType)o);
}
+ getBean().setTripType(tripTypes);
}
]]></script>
<Table id='body' constraints='BorderLayout.CENTER'>
@@ -157,7 +159,7 @@
</cell>
<cell fill='both' weightx='1.0' weighty='0.7'>
<JScrollPane>
- <JList id="vesselTypeTripType" onMouseClicked='tripTypeChanged()' enabled='{isActif()}'/>
+ <JList id="vesselTypeTripType" selectedValues='{getBean().getTripType().toArray()}' onMouseClicked='tripTypeChanged()' enabled='{isActif()}'/>
</JScrollPane>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-02-23 15:42:34 UTC (rev 1862)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/WizardGroupCreationUI.jaxx 2009-02-23 23:14:43 UTC (rev 1863)
@@ -320,7 +320,7 @@
// ... pour pouvoir avoir la classe pour l'equation
double Lmax = pop.getLength(deltat, group);
-// pop.setMaxLength(Lmax);
+ group.setMaxLength(Lmax);
Lmin = Lmax;
}
}
1
0
r1862 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: . simulator types/hibernate ui/script/action ui/simulator
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: chatellier
Date: 2009-02-23 15:42:34 +0000 (Mon, 23 Feb 2009)
New Revision: 1862
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlan.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanContext.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/RuleMonitor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/types/hibernate/MatrixType.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/CancelAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/ChooseFileAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
Log:
Fix some doc, make some method deprecated, fixe code style
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ * Copyright (C) 2002-2009 Code Lutin, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- *##%*/
+ * ##%*/
package fr.ifremer.isisfish;
@@ -65,7 +65,7 @@
public class IsisConfig extends ApplicationConfig {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(IsisConfig.class);
+ private static Log log = LogFactory.getLog(IsisConfig.class);
/**
* La version du logiciel constitue de l.d.a.r
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlan.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlan.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlan.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2007
+ * Copyright (C) 2007 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,7 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
+package fr.ifremer.isisfish.simulator;
+
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+
+/**
* AnalysePlan.java
*
* Created: 1 mars 07 20:27:28
@@ -28,57 +32,53 @@
* Last update: $Date$
* by : $Author$
*/
-
-package fr.ifremer.isisfish.simulator;
-
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-
-
-/**
- * @author poussin
- *
- */
-
public interface AnalysePlan {
/**
+ * Return plan necessary Results.
+ *
* @return the necessaryResult name
*/
public String[] getNecessaryResult();
-
+
/**
- * return plan description
+ * Return plan description.
+ *
* @return plan description
* @throws Exception
*/
public String getDescription() throws Exception;
-
+
/**
- * Use only once before first simulation. You can modified Param for all
- * simulation or put value in context.values.
- * @param context
+ * Use only once before first simulation.
+ *
+ * You can modified Param for all simulation or put value in context.values.
+ *
+ * @param context plan context
* @throws Exception
*/
public void init(AnalysePlanContext context) throws Exception;
-
+
/**
- * Call before each simulation
+ * Call before each simulation.
+ *
* @param context plan context
* @param nextSimulation storage used for next simulation
* @return true if we must do next simulation, false to stop plan
* @throws Exception
*/
- public boolean beforeSimulation(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception;
-
+ public boolean beforeSimulation(AnalysePlanContext context,
+ SimulationStorage nextSimulation) throws Exception;
+
/**
- * Call after each simulation
+ * Call after each simulation.
+ *
* @param context plan context
* @param lastSimulation storage used for simulation
* @return true if we must do next simulation, false to stop plan
* @throws Exception
*/
- public boolean afterSimulation(AnalysePlanContext context, SimulationStorage lastSimulation) throws Exception;
-
+ public boolean afterSimulation(AnalysePlanContext context,
+ SimulationStorage lastSimulation) throws Exception;
+
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanContext.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanContext.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanContext.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2007
+ * Copyright (C) 2007 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * AnalysePlanContext.java
- *
- * Created: 1 mars 07 20:19:31
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.simulator;
import java.util.HashMap;
@@ -36,77 +24,106 @@
import fr.ifremer.isisfish.datastore.SimulationStorage;
-
/**
+ * AnalysePlanContext.java
+ *
+ * Created: 1 mars 07 20:19:31
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
+public class AnalysePlanContext {
-public class AnalysePlanContext {
-
+ /** Simulation id. */
protected String id;
+
+ /** Analyse plan number. */
protected int number = 0;
+
+ /** Simulation parameters. */
protected SimulationParameter param;
+
+ /** @deprecated on 20080223 seams never used */
protected Map<String, Object> values = new HashMap<String, Object>();
-
+
public AnalysePlanContext(String id, SimulationParameter param) {
this.id = id;
this.param = param;
}
-
+
/**
- * @return Returns the id.
+ * Get id.
+ *
+ * @return the id
*/
public String getId() {
- return this.id;
+ return id;
}
-
+
/**
- * @return Returns the number.
+ * Get analyse plan number.
+ *
+ * @return the number
*/
public int getNumber() {
return number;
}
-
+
/**
- * must be call when new simulation is generated from plan
+ * Must be call when new simulation is generated from plan.
*/
public void incNumber() {
number++;
}
-
+
/**
- * @return Returns the param.
+ * Get simulation parameters.
+ *
+ * @return simulation params
+ * @deprecated on 20080223 seams never used
*/
public SimulationParameter getParam() {
- return this.param;
+ return param;
}
-
+
/**
- * Used in PlanGenerator to set parameter to parameter of the next
- * simulation
- * @param param The param to set.
+ * @param key
+ * @return value for key.
+ * @deprecated on 20080223 seams never used
*/
- public void setParam(SimulationParameter param) {
- this.param = param;
+ public Object getValue(String key) {
+ return this.values.get(key);
}
-
+
/**
- * @return Returns the values.
+ *
+ * @param key
+ * @param value
+ * @deprecated on 20080223 seams never used
*/
- public Object getValue(String key) {
- return this.values.get(key);
- }
-
public void setValue(String key, Object value) {
this.values.put(key, value);
}
-
+
+ /**
+ *
+ * @return
+ * @deprecated on 20080223 seams never used
+ */
public SimulationStorage getLastSimulation() {
- SimulationStorage result = getSimulation(getNumber()-1);
+ SimulationStorage result = getSimulation(getNumber() - 1);
return result;
}
-
+
+ /**
+ * Get {@link SimulationStorage} for specified anaylse plan number.
+ *
+ * @param number number
+ * @return {@link SimulationStorage}
+ */
public SimulationStorage getSimulation(int number) {
SimulationStorage result = null;
if (0 <= number && number <= getNumber()) {
@@ -114,7 +131,4 @@
}
return result;
}
-
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2007
+ * Copyright (C) 2007 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,8 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * AnalysePlan.java
+package fr.ifremer.isisfish.simulator;
+
+/**
+ * Use for Analyse plan that don't need previous simulation to do next
+ * simulation. When Simulation use this plan type, Isis can do more than one
+ * simulation in same time.
*
* Created: 1 mars 07 20:27:28
*
@@ -28,19 +32,6 @@
* Last update: $Date: 2007-03-09 15:10:40 +0100 (ven, 09 mar 2007) $
* by : $Author: bpoussin $
*/
-
-package fr.ifremer.isisfish.simulator;
-
-/**
- * Use for Analyse plan that don't need previous simulation to do next
- * simulation. When Simulation use this plan type, Isis can do more than one
- * simulation in same time.
- *
- * author poussin
- */
public interface AnalysePlanIndependent extends AnalysePlan {
-
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * MetierMonitor.java
- *
- * Created: 21 août 2006 15:43:19
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.simulator;
import static org.codelutin.i18n.I18n.n_;
@@ -59,19 +47,24 @@
import fr.ifremer.isisfish.types.Date;
import fr.ifremer.isisfish.types.Month;
-
/**
* ATTENTION: l'implantation de cette classe n'est peut-etre pas correct. Il faut
* absolument verifier le FIXME, mais il est difficile de le faire car
* la plupart des methodes de cette objets ne semble plus utilisé dans la
* version 2.3.x de isis
*
+ * Created: 21 août 2006 15:43:19
+ *
* @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
public class MetierMonitor {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(MetierMonitor.class);
+ private static Log log = LogFactory.getLog(MetierMonitor.class);
protected Set<Metier> forbiddenMetier = new HashSet<Metier>();
protected Set<MultiKey> forbiddenMetierMonth = new HashSet<MultiKey>();
@@ -317,7 +310,4 @@
return result;
}
-
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/RuleMonitor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/RuleMonitor.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/RuleMonitor.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2006
+ * Copyright (C) 2006 - 2009
* Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * RuleMonitor.java
- *
- * Created: 21 août 2006 15:45:03
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.simulator;
import org.apache.commons.collections.map.MultiKeyMap;
@@ -37,26 +25,28 @@
import fr.ifremer.isisfish.rule.Rule;
import fr.ifremer.isisfish.types.Date;
-
/**
- * This class keep trace of rule evalution condition for all step and all metier
+ * This class keep trace of rule evalution condition for all step and all metier.
*
+ * Created: 21 août 2006 15:45:03
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
public class RuleMonitor {
protected MultiKeyMap evalutionCondition = new MultiKeyMap();
public boolean getEvalutionCondition(Date date, Rule rule, Metier metier) {
- return (Boolean)this.evalutionCondition.get(date, rule, metier);
+ return (Boolean) this.evalutionCondition.get(date, rule, metier);
}
- public void setEvaluationCondition(Date date, Rule rule, Metier metier, boolean evalutionCondition) {
+ public void setEvaluationCondition(Date date, Rule rule, Metier metier,
+ boolean evalutionCondition) {
this.evalutionCondition.put(date, rule, metier, evalutionCondition);
}
-
}
-
-
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002-2005 Code Lutin, Cédric Pineau,
+ * Copyright (C) 2002 - 2009 Code Lutin, Cédric Pineau,
Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,18 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * SimulationControl.java
- *
- * Created: Fri Oct 6 2000
- *
- * @author POUSSIN Benjamin <poussin at codelutin.com>
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-
package fr.ifremer.isisfish.simulator;
import java.beans.PropertyChangeEvent;
@@ -45,13 +33,20 @@
import fr.ifremer.isisfish.types.Date;
/**
- * Permit to communicate with user interface from simulation thread
- * @author poussin
+ * Permit to communicate with user interface from simulation thread.
+ *
+ * Created: Fri Oct 6 2000
+ *
+ * @author POUSSIN Benjamin <poussin at codelutin.com>
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
*/
public class SimulationControl implements PropertyChangeListener { // SimulationControl
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(SimulationControl.class);
+ private static Log log = LogFactory.getLog(SimulationControl.class);
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
protected boolean inUpdateFromHashtable = false;
@@ -385,7 +380,7 @@
}
}
- /* (non-Javadoc)
+ /*
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent e) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,4 @@
-/*
- * *##% Copyright (C) 2006 Code Lutin, C?dric Pineau, Benjamin Poussin
+/* *##% Copyright (C) 2006 - 2009 Code Lutin, Cédric Pineau, Benjamin Poussin
*
* 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
@@ -16,18 +15,8 @@
* Place - Suite 330, Boston, MA 02111-1307, USA. ##%
*/
-/*******************************************************************************
- * SimulationParameter.java
- *
- * Created: 10 janv. 2006 17:03:37
- *
- * @author poussin
- *
- * @version $Revision$
- *
- * Last update: $Date$ by : $Author$
- */
+
package fr.ifremer.isisfish.simulator;
import static org.codelutin.i18n.I18n._;
@@ -71,17 +60,21 @@
/**
* Contains all parameter for one simulation
*
+ * Created: 10 janv. 2006 17:03:37
+ *
* @author poussin
+ *
+ * @version $Revision$
+ *
+ * Last update: $Date$ by : $Author$
*/
public class SimulationParameter {
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory.getLog(SimulationParameter.class);
+ /** Logger for this class. */
+ private static Log log = LogFactory.getLog(SimulationParameter.class);
/** Isis-fish version that permit to do the simulation, must be set just
- * before simulation by simulator */
+ * before simulation by simulator. */
protected String isisFishVersion = IsisConfig.getVersion();
/** description de la simulation */
@@ -138,7 +131,7 @@
protected String analysePlan = "";
/** le numero de sequence de la liste des plans d'analyse, le premier
- * ?lement du plan doit etre 0. Si la simulation ne fait pas partie d'un
+ * élement du plan doit etre 0. Si la simulation ne fait pas partie d'un
* plan la valeur est -1 */
protected int analysePlanNumber = -1;
@@ -150,17 +143,17 @@
/**
* si vrai seul les exports automatiques ne sont souhaiter, la simulation
- * pourrait etre supprim?e a la fin
+ * pourrait etre supprimée a la fin
*/
protected boolean onlyExport = false;
transient protected RegionStorage region = null;
- /** le niveau de log du simulateur ? utiliser pendant la simulation , par default info */
+ /** le niveau de log du simulateur à utiliser pendant la simulation , par default info */
protected String simulLogLevel = "info";
- /** le niveau de log des scripts ? utiliser pendant la simulation , par default info */
+ /** le niveau de log des scripts à utiliser pendant la simulation , par default info */
protected String scriptLogLevel = "info";
- /** le niveau de log des librairies ? utiliser pendant la simulation , par default info */
+ /** le niveau de log des librairies à utiliser pendant la simulation , par default info */
protected String libLogLevel = "error";
/**
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/types/hibernate/MatrixType.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/types/hibernate/MatrixType.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/types/hibernate/MatrixType.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -38,7 +38,6 @@
import java.util.LinkedList;
import java.util.List;
-import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.beanutils.ConvertUtilsBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,12 +53,7 @@
import org.hibernate.type.Type;
import org.hibernate.usertype.CompositeUserType;
-import fr.ifremer.isisfish.types.Date;
-import fr.ifremer.isisfish.types.Month;
import fr.ifremer.isisfish.util.ConverterUtil;
-import fr.ifremer.isisfish.util.DateConverter;
-import fr.ifremer.isisfish.util.MonthConverter;
-import fr.ifremer.isisfish.util.StringConverter;
import fr.ifremer.isisfish.util.TopiaEntityConverter;
public class MatrixType implements CompositeUserType {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,20 +1,49 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.script.action;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.ui.util.IsisAction;
-import org.apache.commons.logging.Log;
-import static org.apache.commons.logging.LogFactory.getLog;
-import org.codelutin.util.FileUtil;
-
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.ui.util.IsisAction;
+
+/**
+ * BackupAction.
+ *
+ * @author bpoussin
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
public class BackupAction extends IsisAction {
- static private Log log = getLog(BackupAction.class);
+ private static Log log = LogFactory.getLog(BackupAction.class);
/** source root directory */
protected File src;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/CancelAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/CancelAction.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/CancelAction.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.script.action;
import fr.ifremer.isisfish.ui.util.IsisAction;
@@ -6,6 +25,7 @@
import java.awt.event.ActionEvent;
public class CancelAction extends IsisAction {
+
private static final long serialVersionUID = 2536223593370089763L;
public CancelAction(JDialog dialog) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/ChooseFileAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/ChooseFileAction.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/action/ChooseFileAction.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.script.action;
import static org.codelutin.i18n.I18n._;
@@ -11,12 +30,12 @@
public class ChooseFileAction extends AbstractAction {
+ private static final long serialVersionUID = -5004217809548352109L;
+
protected JTextField file;
protected JDialog dialog;
- private static final long serialVersionUID = -5004217809548352109L;
-
public ChooseFileAction(JDialog dialog, JTextField file) {
super("...");
this.dialog = dialog;
@@ -41,7 +60,9 @@
if (ret == JFileChooser.APPROVE_OPTION) {
File newFile = chooser.getSelectedFile();
String path;
- if (newFile.isFile()) path = newFile.getAbsolutePath();
+ if (newFile.isFile()) {
+ path = newFile.getAbsolutePath();
+ }
else {
path = newFile.getAbsolutePath();
if (!"".equals(name)) path += File.separator + name;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensWizard.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2002, 2003 Code Lutin
+ * Copyright (C) 2002, 2009 Code Lutin
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -16,8 +16,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * SensWizard.java
+package fr.ifremer.isisfish.ui.simulator;
+
+import javax.swing.JButton;
+import javax.swing.JTabbedPane;
+
+/**
+ * SensWizard.
*
* Created: 14 nov. 2005
*
@@ -27,13 +32,9 @@
*
* Mise a jour: $Date$
* par : $Author$
+ *
+ * @deprecated on 20080223 seams to be unused
*/
-package fr.ifremer.isisfish.ui.simulator;
-
-import javax.swing.JButton;
-import javax.swing.JTabbedPane;
-
-
public class SensWizard {
/**
@@ -41,8 +42,8 @@
* wizard
* @return l'index de la tab a selectionner
*/
- public static int newTab(JButton prev, JButton next,
- JButton finish, JTabbedPane tabPane) {
+ public static int newTab(JButton prev, JButton next, JButton finish,
+ JTabbedPane tabPane) {
// La direction du changement de tab (+1, -1)
//int step = ((Integer)currentContext.getData("_step")).intValue();
// La nouvelle tab sélectionnée par l'utilisateur
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,5 +1,5 @@
/* *##%
- * Copyright (C) 2005
+ * Copyright (C) 2005 - 2009
* Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -17,26 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * IsisFish.java
- *
- * Created: 1 aout 2005 18:37:25 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- * @version $Revision: 1312 $
- *
- * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
- * by : $Author: sletellier $
- */
-
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-/**
- *
- * @author letellier
- */
package fr.ifremer.isisfish.ui.simulator;
import static org.codelutin.i18n.I18n._;
@@ -51,7 +31,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -87,10 +66,21 @@
import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
+/**
+ * SimulAction.
+ *
+ * Created: 1 aout 2005 18:37:25 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ * @version $Revision: 1312 $
+ *
+ * Last update: $Date: 2008-08-28 10:21:07 +0200 (jeu, 28 aoû 2008) $
+ * by : $Author: sletellier $
+ */
public class SimulAction {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(SimulAction.class);
+ private static Log log = LogFactory.getLog(SimulAction.class);
protected SimulationParameter param = null;
protected RegionStorage regionStorage = null;
protected SimulationStorage simulStorage = null;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.simulator;
import fr.ifremer.isisfish.simulator.launcher.SimulationService;
@@ -13,12 +32,6 @@
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.ListModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
/**
* This class contains some listeners used in ui. Some are generics and could
@@ -33,7 +46,7 @@
public class SimulatorListeners {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(SimulatorListeners.class);
+ private static Log log = LogFactory.getLog(SimulatorListeners.class);
public static void initAnalysePlanButtonsListener(JButton remove, JList list) {
initButtonRemoveIfItemSelected(remove, list);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-02-23 15:26:14 UTC (rev 1861)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-02-23 15:42:34 UTC (rev 1862)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2005 - 2009
+ * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.simulator;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
@@ -31,7 +50,7 @@
public class ToolTipListModelFactory {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(SimulAction.class);
+ private static Log log = LogFactory.getLog(SimulAction.class);
/**
* Build a new {@link ToolTipListModel} for for @Doc'field of all given
@@ -92,8 +111,7 @@
* @param names Export names to use
* @return the model builded
*/
-
- static public ToolTipListModel createExportClassDocsModel(
+ public static ToolTipListModel createExportClassDocsModel(
List<String> names) {
List<String> texts = new ArrayList<String>();
@@ -127,7 +145,7 @@
* @param names Rule names
* @return the model builded
*/
- static public ToolTipListModel createRuleDescriptionsModel(
+ public static ToolTipListModel createRuleDescriptionsModel(
List<String> names) {
List<String> texts = new ArrayList<String>();
@@ -167,7 +185,7 @@
* @param list the list containing the renderer
* @return the model builded
*/
- static public ToolTipListModel createRuleDescriptionsModel2(
+ public static ToolTipListModel createRuleDescriptionsModel2(
List<Rule> rules, JButton clearButton, JList list) {
List<String> texts = new ArrayList<String>();
@@ -206,7 +224,7 @@
* @param rules the selected rules (we only use the first one)
* @return the model builded
*/
- static public ToolTipListModel createRuleParamsModel(Collection rules) {
+ public static ToolTipListModel createRuleParamsModel(Collection rules) {
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
@@ -248,7 +266,7 @@
* @return the model builded
*/
@SuppressWarnings({"unchecked"})
- static public ToolTipListModel createAnalysePlanDescriptionsModel(
+ public static ToolTipListModel createAnalysePlanDescriptionsModel(
List<String> names) {
List<String> texts = new ArrayList<String>();
@@ -293,7 +311,7 @@
* @return the model builded
*/
@SuppressWarnings({"unchecked"})
- static public ToolTipListModel createAnalysePlanDescriptionsModel2(
+ public static ToolTipListModel createAnalysePlanDescriptionsModel2(
List<AnalysePlan> plans, JButton clearButton, JList list) {
List<String> texts = new ArrayList<String>();
@@ -333,10 +351,9 @@
* @param analysePlans the selected analyse plan (we only use the first one)
* @return the model builded
*/
- static public ToolTipListModel createAnalysePlanParamsModel(
+ public static ToolTipListModel createAnalysePlanParamsModel(
Collection analysePlans) {
-
List<String> texts = new ArrayList<String>();
List<String> toolTips = new ArrayList<String>();
if (analysePlans.size() > 0) {
@@ -344,7 +361,6 @@
analysePlans.iterator().next());
try {
-
AnalysePlanStorage storage =
AnalysePlanStorage.getAnalysePlan(name);
Map<String, Class> mapParams = storage.getParameterNames();
1
0
r1861 - in isis-fish/trunk/src: main/java/fr/ifremer/isisfish/simulator/factors test/java/fr/ifremer/isisfish/simulator test/java/fr/ifremer/isisfish/simulator/factors
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: chatellier
Date: 2009-02-23 15:26:14 +0000 (Mon, 23 Feb 2009)
New Revision: 1861
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java
Removed:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java
Log:
Improve factors, add test.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java 2009-02-23 10:30:42 UTC (rev 1860)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -21,6 +21,9 @@
import java.io.Serializable;
import java.util.List;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
/**
* Design plan contenant toutes les
* valeur de facteur possible.
@@ -65,6 +68,16 @@
public void setFactors(List<Factor<E>> factors) {
this.factors = factors;
}
-
-
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ builder.append(factors);
+
+ return builder.toString();
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java 2009-02-23 10:30:42 UTC (rev 1860)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -22,6 +22,9 @@
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
/**
* Facteur de variation des parametres de simulation.
*
@@ -101,4 +104,91 @@
this();
this.name = name;
}
+
+ /**
+ * Get name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set name.
+ *
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get domain.
+ *
+ * @return the domain
+ */
+ public Map<String, E> getDomain() {
+ return domain;
+ }
+
+ /**
+ * Set domain.
+ *
+ * @param domain the domain to set
+ */
+ public void setDomain(Map<String, E> domain) {
+ this.domain = domain;
+ }
+
+ /**
+ * Get value label.
+ *
+ * @return the valueLabel
+ */
+ public String getValueLabel() {
+ return valueLabel;
+ }
+
+ /**
+ * Set value label.
+ *
+ * @param valueLabel the valueLabel to set
+ */
+ public void setValueLabel(String valueLabel) {
+ this.valueLabel = valueLabel;
+ }
+
+ /**
+ * Get path.
+ *
+ * @return the path
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * Set path.
+ *
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ builder.append(name);
+ builder.append(domain);
+ builder.append(valueLabel);
+ builder.append(path);
+
+ return builder.toString();
+ }
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java 2009-02-23 10:30:42 UTC (rev 1860)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -22,6 +22,9 @@
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
+
/**
* Scenario d'execution de simulation.
*
@@ -73,4 +76,15 @@
this.simulationsFactors = simulationsFactors;
}
+ /*
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+
+ ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ builder.append(simulationsFactors);
+
+ return builder.toString();
+ }
}
Copied: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java (from rev 1857, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java)
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/SensitivityCalculator.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -0,0 +1,54 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import java.io.Serializable;
+
+/**
+ * Interface vers le calculateur statistique.
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 19 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public interface SensitivityCalculator {
+
+ /**
+ * Envoi un plan a faire analyser par l'outils
+ * statistique.
+
+ * @param plan plan a analyser
+ * @param <E> type des données du scenario et du plan
+ *
+ * @return un Scenario
+ * @see DesignPlan
+ * @see Scenario
+ */
+ <E extends Serializable> Scenario<E> getScenario(DesignPlan<E> plan);
+
+ /**
+ * Ajoute un paramètre pour l'outils statistique.
+ *
+ * @param key nom du parametre
+ * @param value valeur du parametre
+ */
+ void setParameter(String key, String value);
+}
Deleted: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java 2009-02-23 10:30:42 UTC (rev 1860)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -1,54 +0,0 @@
-/* *##%
- * Copyright (C) 2009 Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-package fr.ifremer.isisfish.simulator.factors;
-
-import java.io.Serializable;
-
-/**
- * Interface vers le calculateur statistique.
- *
- * @author chatellier
- * @version $Revision: 1.0 $
- *
- * Last update : $Date: 19 févr. 2009 $
- * By : $Author: chatellier $
- */
-public interface StatisticsCalculator {
-
- /**
- * Envoi un plan a faire analyser par l'outils
- * statistique.
-
- * @param plan plan a analyser
- * @param <E> type des données du scenario et du plan
- *
- * @return un Scenario
- * @see DesignPlan
- * @see Scenario
- */
- <E extends Serializable> Scenario<E> getScenario(DesignPlan<E> plan);
-
- /**
- * Ajoute un paramètre pour l'outils statistique.
- *
- * @param key nom du parametre
- * @param value valeur du parametre
- */
- void setParameter(String key, String value);
-}
Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java (rev 0)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/factors/FactorTest.java 2009-02-23 15:26:14 UTC (rev 1861)
@@ -0,0 +1,99 @@
+/* *##%
+ * Copyright (C) 2009 Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.simulator.factors;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixND;
+import org.junit.Test;
+
+
+/**
+ * Factors test.
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 23 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+public class FactorTest {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(FactorTest.class);
+
+ /**
+ * Test to build new factors with int values.
+ */
+ @Test
+ public void testIntFactor() {
+
+ Factor<Integer> factor = new Factor<Integer>("testint");
+ factor.getDomain().put("i1", 0);
+ factor.getDomain().put("i2", 1);
+ factor.getDomain().put("i3", 2);
+ factor.getDomain().put("i4", 3);
+ factor.getDomain().put("i5", 4);
+ factor.setPath("org.codelutin.factor#1234567890#0.12242345354#name");
+ factor.setValueLabel("i3");
+
+ if (log.isInfoEnabled()) {
+ log.info("factor#toString() = " + factor);
+ }
+ }
+
+ /**
+ * Test factor with matrix.
+ *
+ * @see MatrixND
+ */
+ @Test
+ public void testMatrixFactor() {
+
+ // matrix 1
+ MatrixND matrix1 = MatrixFactory.getInstance().create("test1", new int[] {3,2}, new String[]{"col1", "col2"});
+ matrix1.setValue(new int[]{0,0}, 13);
+ matrix1.setValue(new int[]{0,1}, -14);
+ matrix1.setValue(new int[]{1,0}, 21);
+ matrix1.setValue(new int[]{1,1}, 2);
+ matrix1.setValue(new int[]{2,0}, 12);
+ matrix1.setValue(new int[]{2,1}, -1);
+
+ // matrix 2
+ MatrixND matrix2 = MatrixFactory.getInstance().create("test2", new int[] {2,3}, new String[]{"col1", "col2"});
+ matrix2.setValue(new int[]{0,0}, 9999);
+ matrix2.setValue(new int[]{0,1}, 15000);
+ matrix2.setValue(new int[]{0,2}, -40000);
+ matrix2.setValue(new int[]{1,0}, 21345);
+ matrix2.setValue(new int[]{1,1}, 81000);
+ matrix2.setValue(new int[]{1,2}, -13000);
+
+ // factor
+ Factor<MatrixND> factor = new Factor<MatrixND>("testmatrix");
+ factor.getDomain().put("m1", matrix1);
+ factor.getDomain().put("m2", matrix2);
+ factor.setPath("org.codelutin.math.matrix.MatrixND#563456293453#2.456347646#dim");
+ factor.setValueLabel("m2");
+
+ if (log.isInfoEnabled()) {
+ log.info("factor#toString() = " + factor);
+ }
+ }
+}
1
0
r1860 - in isis-fish/trunk/src/main/resources: . templates
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: chatellier
Date: 2009-02-23 10:30:42 +0000 (Mon, 23 Feb 2009)
New Revision: 1860
Added:
isis-fish/trunk/src/main/resources/templates/
isis-fish/trunk/src/main/resources/templates/analyseplan.ftl
isis-fish/trunk/src/main/resources/templates/equation.ftl
isis-fish/trunk/src/main/resources/templates/export.ftl
isis-fish/trunk/src/main/resources/templates/rule.ftl
isis-fish/trunk/src/main/resources/templates/script.ftl
isis-fish/trunk/src/main/resources/templates/simulator.ftl
Log:
Begin to externalize script, analyseplan... code in ftl template.
(not used for now)
Added: isis-fish/trunk/src/main/resources/templates/analyseplan.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/analyseplan.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/analyseplan.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,81 @@
+package analyseplans;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import scripts.ResultName;
+
+import java.io.Writer;
+import org.codelutin.math.matrix.*;
+import org.codelutin.util.*;
+import org.codelutin.topia.*;
+
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.*;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.types.Date;
+import fr.ifremer.isisfish.entities.*;
+import fr.ifremer.isisfish.simulator.AnalysePlan;
+import fr.ifremer.isisfish.simulator.AnalysePlanContext;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.ResultStorage;
+
+/**
+ * ${name}.java
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <${email}>
+ * @version $Revision: 1545 $
+ * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $
+ * by : $Author: ${author} $
+ */
+public class ${name} implements AnalysePlan {
+
+ /** to use log facility, just put in your code: log.info("..."); */
+ private static Log log = LogFactory.getLog(${name}.class);
+
+ public String [] necessaryResult = {
+ // put here all necessary result for this rule
+ // example:
+ // ResultName.MATRIX_BIOMASS,
+ // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,
+ };
+
+ public String[] getNecessaryResult() {
+ return this.necessaryResult;
+ }
+
+ /**
+ * Permet d''afficher a l''utilisateur une aide sur le plan.
+ * @return L''aide ou la description du plan
+ */
+ public String getDescription() throws Exception {
+ // TODO
+ return _("TODO description plan");
+ }
+
+ /**
+ * Appelé au démarrage de la simulation, cette méthode permet d''initialiser
+ * des valeurs
+ * @param simulation La simulation pour lequel on utilise cette regle
+ */
+ public void init(AnalysePlanContext context) throws Exception {
+ // TODO
+ }
+
+ /**
+ * Call before each simulation
+ * @param context plan context
+ * @param nextSimulation storage used for next simulation
+ * @return true if we must do next simulation, false to stop plan
+ * @throws Exception
+ */
+ public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception {
+ return false;
+ // TODO
+ }
+}
\ No newline at end of file
Added: isis-fish/trunk/src/main/resources/templates/equation.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/equation.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/equation.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,12 @@
+/**
+ * ${name}.
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <${email}>
+ * @version $Revision: 1545 $
+ * Last update: $Date : ${date} $
+ * by : $Author: ${author} $
+ */
+// put your code here
+
Added: isis-fish/trunk/src/main/resources/templates/export.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/export.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/export.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,59 @@
+package exports;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Writer;
+
+import static org.codelutin.i18n.I18n._;
+import org.codelutin.math.matrix.*;
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.entities.*;
+import fr.ifremer.isisfish.export.Export;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.ResultStorage;
+
+/**
+ * ${name}.java
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <${email}>
+ * @version $Revision: 1545 $
+ *
+ * Last update: $Date: ${date} $
+ * by : $Author: ${author} $
+ */
+public class ${name} implements Export {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(${name}.class);
+
+ public String [] necessaryResult = {
+ // put here all necessary result for this rule
+ // example:
+ // ResultName.MATRIX_BIOMASS,
+ // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,
+ };
+
+ public String[] getNecessaryResult() {
+ return this.necessaryResult;
+ }
+
+ public String getExportFilename() {
+ // remove _(...) if you don''t want translation on filename
+ return _("${name}");
+ }
+
+ public String getExtensionFilename() {
+ return ".csv";
+ }
+
+ public String getDescription() {
+ return _("TODO export description");
+ }
+
+ public void export(SimulationStorage simulation, Writer out) throws Exception {
+ // put your code here, and write export with: out.write("...")
+ }
+}
\ No newline at end of file
Added: isis-fish/trunk/src/main/resources/templates/rule.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/rule.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/rule.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,93 @@
+package rules;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import scripts.ResultName;
+
+import java.io.Writer;
+
+import org.codelutin.math.matrix.*;
+
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.types.Date;
+import fr.ifremer.isisfish.entities.*;
+import fr.ifremer.isisfish.rule.AbstractRule;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.ResultStorage;
+
+/**
+ * ${name}.java
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <${email}>
+ * @version $Revision: 1545 $
+ * Last update: $Date: 2008-10-08 16:13:44 +0200 (mer 08 oct 2008) $
+ * by : $Author: ${author} $
+ */
+public class ${name} extends AbstractRule {
+
+ /** to use log facility, just put in your code: log.info("..."); */
+ private static Log log = LogFactory.getLog(${name}.class);
+
+ public String [] necessaryResult = {
+ // put here all necessary result for this rule
+ // example:
+ // ResultName.MATRIX_BIOMASS,
+ // ResultName.MATRIX_NET_VALUE_OF_LANDINGS_PER_STRATEGY_MET,
+ };
+
+ public String[] getNecessaryResult() {
+ return this.necessaryResult;
+ }
+
+ /**
+ * Permet d'afficher a l'utilisateur une aide sur la regle.
+ * @return L'aide ou la description de la regle
+ */
+ public String getDescription() throws Exception {
+ // TODO
+ return _("TODO description rule");
+ }
+
+ /**
+ * Appelé au démarrage de la simulation, cette méthode permet d'initialiser
+ * des valeurs
+ * @param simulation La simulation pour lequel on utilise cette regle
+ */
+ public void init(SimulationContext context) throws Exception {
+ // TODO
+ }
+
+ /**
+ * La condition qui doit etre vrai pour faire les actions
+ * @param simulation La simulation pour lequel on utilise cette regle
+ * @return vrai si on souhaite que les actions soit faites
+ */
+ public boolean condition(SimulationContext context, Date date, Metier metier) throws Exception {
+ // TODO
+ return false;
+ }
+
+ /**
+ * Si la condition est vrai alors cette action est executée avant le pas
+ * de temps de la simulation.
+ * @param simulation La simulation pour lequel on utilise cette regle
+ */
+ public void preAction(SimulationContext context, Date date, Metier metier) throws Exception {
+ // TODO
+ }
+
+ /**
+ * Si la condition est vrai alors cette action est executée apres le pas
+ * de temps de la simulation.
+ * @param simulation La simulation pour lequel on utilise cette regle
+ */
+ public void postAction(SimulationContext context, Date date, Metier metier) throws Exception {
+ // TODO
+ }
+}
\ No newline at end of file
Added: isis-fish/trunk/src/main/resources/templates/script.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/script.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/script.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,28 @@
+package scripts;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.entities.*;
+import org.codelutin.math.matrix.*;
+
+/**
+ * ${name}.java
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <$email}>
+ * @version $Revision: 0 $
+ *
+ * Last update: $Date: ${date} $
+ * by : $Author: ${author} $
+ */
+public class ${name} {
+
+ /** to use log facility, just put in your code: log.info("..."); */
+ private static Log log = LogFactory.getLog(${name}.class);
+
+ // add your method here
+
+}
\ No newline at end of file
Added: isis-fish/trunk/src/main/resources/templates/simulator.ftl
===================================================================
--- isis-fish/trunk/src/main/resources/templates/simulator.ftl (rev 0)
+++ isis-fish/trunk/src/main/resources/templates/simulator.ftl 2009-02-23 10:30:42 UTC (rev 1860)
@@ -0,0 +1,32 @@
+package simulators;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.codelutin.math.matrix.*;
+
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.entities.*;
+import fr.ifremer.isisfish.simulator.Simulator;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+
+/**
+ * ${name}.java
+ *
+ * Created: ${date}
+ *
+ * @author ${author} <${email}>
+ * @version $Revision: 1545 $
+ *
+ * Last update $Date ${date} $
+ * by : $Author: sletellier $
+ */
+public class ${name} implements Simulator {
+
+ /** to use log facility, just put in your code: log.info("..."); */
+ private static Log log = LogFactory.getLog(${name}.class);
+
+ public void simulate(SimulationContext context) throws Exception {
+ // put your code here
+ }
+}
\ No newline at end of file
1
0
r1859 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/vcs src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: chatellier
Date: 2009-02-23 10:29:50 +0000 (Mon, 23 Feb 2009)
New Revision: 1859
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Ask for passphrase in svn+ssh connection
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-02-23 09:02:58 UTC (rev 1858)
+++ isis-fish/trunk/pom.xml 2009-02-23 10:29:50 UTC (rev 1859)
@@ -302,6 +302,12 @@
<version>1.2.2.5405</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>com.trilead</groupId>
+ <artifactId>trilead-ssh2</artifactId>
+ <version>build213-svnkit-1.2</version>
+ <scope>runtime</scope>
+ </dependency>
<!-- fin svnkit pour communication subversion -->
<dependency>
@@ -350,12 +356,12 @@
<lutinj2r.version>0.2</lutinj2r.version>
<jrst.version>0.8.4</jrst.version>
<license-switcher.version>0.6</license-switcher.version>
-
<openmap.version>4.6.4</openmap.version>
<aspectwerkz.version>2.0</aspectwerkz.version>
<sshtool.version>0.2.2</sshtool.version>
<xmlrpc.version>3.1</xmlrpc.version>
-
+ <javadoc.version>2.5</javadoc.version>
+
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2009-02-23 09:02:58 UTC (rev 1858)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2009-02-23 10:29:50 UTC (rev 1859)
@@ -30,6 +30,8 @@
import java.util.Map;
import java.util.Set;
+import javax.swing.JOptionPane;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codelutin.util.VersionNumber;
@@ -39,12 +41,14 @@
import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
+import org.tmatesoft.svn.core.auth.SVNAuthentication;
+import org.tmatesoft.svn.core.auth.SVNSSHAuthentication;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions;
-import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.ISVNStatusHandler;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNCommitClient;
@@ -74,7 +78,7 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
protected static Log log = LogFactory.getLog(VCSSVN.class);
- static enum ConnectionState {
+ protected static enum ConnectionState {
NOT_TESTED, OFF_LINE, ON_LINE
}
@@ -113,25 +117,54 @@
* @return SVNManager instance
*/
protected SVNClientManager getSVNManager() {
+
if (svnManager == null) {
+
+ // log
+ if (log.isInfoEnabled()) {
+ try {
+ log.info("Try to connect to " + getRemoteURL());
+ } catch (SVNException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get remote repo url");
+ }
+ }
+ }
+
String login = getLogin();
String passwd = getPassword();
+ DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
if (getProtocol().contains("ssh")) {
- ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
- // options.setPropertyValue("svnkit.ssh2.key", getSshKeyFile().getAbsolutePath());
- // options.setPropertyValue("svnkit.ssh2.username", login);
- // if (passwd != null && !"".equals(passwd)) {
- // options.setPropertyValue("svnkit.ssh2.passphrase", passwd);
- // }
- ISVNAuthenticationManager auth = SVNWCUtil
- .createDefaultAuthenticationManager(SVNWCUtil
- .getDefaultConfigurationDirectory(), login,
- passwd, sshKeyFile, passwd, false);
+ ISVNAuthenticationManager auth = null;
+
+ if (sshKeyFile != null && sshKeyFile.canRead()) {
+
+ // log for private key
+ if (log.isInfoEnabled()) {
+ log.info("Unsing ssh private key : "
+ + sshKeyFile.getAbsolutePath());
+ }
+
+ // FIXME following AuthenticationManager will try to connect to
+ // realm and if it fail, will try to ask for passphrase
+ // even if there is another error
+ // FIXME 22 here
+ auth = new SSHSVNAuthenticationManager(login, sshKeyFile,
+ null, 22);
+ } else {
+
+ // log for private key
+ if (log.isWarnEnabled()) {
+ log.warn("Cannot read ssh private key : " + sshKeyFile);
+ }
+
+ auth = SVNWCUtil.createDefaultAuthenticationManager(
+ SVNWCUtil.getDefaultConfigurationDirectory(),
+ login, passwd);
+ }
svnManager = SVNClientManager.newInstance(options, auth);
} else {
- DefaultSVNOptions options = SVNWCUtil
- .createDefaultOptions(true);
svnManager = SVNClientManager.newInstance(options, login,
passwd);
}
@@ -165,15 +198,15 @@
getSVNManager().getWCClient().doGetProperty(url, "",
SVNRevision.HEAD, SVNRevision.HEAD);
connectionState = ConnectionState.ON_LINE;
-
- if(log.isInfoEnabled()) {
+
+ if (log.isInfoEnabled()) {
log.info(_("isisfish.vcs.vcssvn.isconnected.switchto",
- getRemoteRepository()));
+ getRemoteRepository()));
}
} catch (SVNException eee) {
- if(log.isWarnEnabled()) {
+ if (log.isWarnEnabled()) {
log.warn(_("isisfish.vcs.vcssvn.isconnected.switchoff",
- getRemoteRepository()));
+ getRemoteRepository()), eee);
}
connectionState = ConnectionState.OFF_LINE;
}
@@ -191,39 +224,42 @@
*/
@Override
public void checkProtocol() throws VCSException {
-
+
// on doit verifier ici que seul le protocole a change
// le doRelocate de svn, ne permet de ne change que
// le protocol ou host par exemple
// dans le cas d'un changement de path, le do relocate
// echoue (operation non permise)
-
+
try {
// test que les protocoles, userInfo, host, port sont egaux.
-
+
// copies locales
File localRoot = getLocalRepository();
SVNInfo info = getSVNManager().getWCClient().doInfo(localRoot,
SVNRevision.WORKING);
SVNURL url = info.getURL();
-
+
// url distante (suposée)
SVNURL newUrl = getRemoteURL();
-
+
// hack just for doRelocate to work
newUrl = newUrl.setPath(url.getPath(), false);
-
+
if (!url.getProtocol().equals(newUrl.getProtocol()) // http, svn ...
- || (url.getUserInfo() == null && newUrl.getUserInfo() != url.getUserInfo()) // username
- || (url.getUserInfo() != null && !url.getUserInfo().equals(newUrl.getUserInfo())) // username
+ || (url.getUserInfo() == null && newUrl.getUserInfo() != url
+ .getUserInfo()) // username
+ || (url.getUserInfo() != null && !url.getUserInfo().equals(
+ newUrl.getUserInfo())) // username
|| url.getPort() != newUrl.getPort() // 80
|| !url.getHost().equals(newUrl.getHost())) {
if (fireAction(VCSActionEvent.SWITCH_PROTOCOL)) {
- if(log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.checkProtocol.relocate", localRoot,
- url, newUrl));
+ if (log.isInfoEnabled()) {
+ log.info(_(
+ "isisfish.vcs.vcssvn.checkProtocol.relocate",
+ localRoot, url, newUrl));
}
-
+
// le relocate de SVNKit
// ne supporte que le changement de protocole/host/port
// pas le path
@@ -390,7 +426,8 @@
SVNDepth.INFINITY); // depth
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision", commitInfo.getNewRevision()));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", commitInfo
+ .getNewRevision()));
}
} catch (SVNException e) {
throw new VCSException(_("isisfish.vcs.vcssvn.commit.error"), e);
@@ -399,8 +436,7 @@
public void add(List<File> files, String msg) throws VCSException {
if (!isWriteable()) {
- throw new VCSException(
- _("isisfish.vcs.vcssvn.add.errorreadonly"));
+ throw new VCSException(_("isisfish.vcs.vcssvn.add.errorreadonly"));
}
try {
if (fireAction(VCSActionEvent.ADD, files.toArray(new File[files
@@ -463,7 +499,8 @@
true); // boolean allowUnversionedObstructions
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
}
} catch (SVNException eee) {
@@ -557,7 +594,8 @@
return result;
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.localstatus.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.localstatus.error"),
+ eee);
}
}
@@ -623,7 +661,8 @@
return result;
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.remotestatus.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.remotestatus.error"),
+ eee);
}
}
@@ -638,7 +677,7 @@
public Map<File, String> getChanglog(List<File> files) throws VCSException {
throw new UnsupportedOperationException("Not supported yet.");
-
+
/*final Map<File, String> changLog = new HashMap<File, String>();
try {
@@ -648,7 +687,7 @@
// Handler
ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
-
+
@Override
public void handleLogEntry(SVNLogEntry logEntry)
throws SVNException {
@@ -790,13 +829,14 @@
final List<File> result = new ArrayList<File>();
ISVNStatusHandler handler = new ISVNStatusHandler() {
+
public void handleStatus(SVNStatus status) throws SVNException {
// log
if (log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.global.filestatus", status.getFile()
- .getAbsolutePath(), status
- .getRemoteContentsStatus().toString()));
+ log.debug(_("isisfish.vcs.vcssvn.global.filestatus",
+ status.getFile().getAbsolutePath(), status
+ .getRemoteContentsStatus().toString()));
}
if (status.getRemoteContentsStatus() == SVNStatusType.STATUS_ADDED
@@ -804,8 +844,8 @@
// log
if (log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.global.foundUpdatedFile", status
- .getFile().getAbsolutePath()));
+ log.debug(_("isisfish.vcs.vcssvn.global.foundUpdatedFile",
+ status.getFile().getAbsolutePath()));
}
result.add(status.getFile());
@@ -826,7 +866,8 @@
return result;
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.getupdate.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.getupdate.error"),
+ eee);
}
}
@@ -837,13 +878,13 @@
* @throws VCSException
*/
public boolean haveUpdate() throws VCSException {
-
+
// c'est juste si la liste renvoyé par getUpdatedFile() n'est pas vide ?
List<File> updatedFiles = getUpdatedFile();
-
+
boolean result = false;
-
- if(updatedFiles != null && !updatedFiles.isEmpty()) {
+
+ if (updatedFiles != null && !updatedFiles.isEmpty()) {
result = true;
}
return result;
@@ -857,29 +898,33 @@
* @throws VCSException
*/
public boolean isOnRemote(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
-
+ SVNStatus status = statusClient
+ .doStatus(localFile, true /*remote*/);
+
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
- if(log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.global.filelocalandremotestatus",localFile.getAbsolutePath(),localStatus, remoteStatus));
+
+ if (log.isDebugEnabled()) {
+ log.debug(_("isisfish.vcs.vcssvn.global.filelocalandremotestatus",
+ localFile.getAbsolutePath(), localStatus,
+ remoteStatus));
}
-
+
// don't return true if:
// - file is locally added
// - file is remotely deleted
- if(!localStatus.equals(SVNStatusType.STATUS_ADDED) && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
+ if (!localStatus.equals(SVNStatusType.STATUS_ADDED)
+ && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
result = true;
}
@@ -887,11 +932,12 @@
// catch exception
// if exception, file doesn't exists on server
// result is still 'false'
- if(log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.isonremote.error",localFile.getAbsolutePath()),e);
+ if (log.isDebugEnabled()) {
+ log.debug(_("isisfish.vcs.vcssvn.isonremote.error", localFile
+ .getAbsolutePath()), e);
}
}
-
+
return result;
}
@@ -904,31 +950,34 @@
*/
@Override
public boolean isUpToDate(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
-
+
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
+ SVNStatus status = statusClient
+ .doStatus(localFile, true /*remote*/);
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
+
// TODO peut on dire que le fichier est à jour
// si le status local est normal et le distant est none
- if (localStatus == SVNStatusType.STATUS_NORMAL && remoteStatus == SVNStatusType.STATUS_NONE) {
+ if (localStatus == SVNStatusType.STATUS_NORMAL
+ && remoteStatus == SVNStatusType.STATUS_NONE) {
result = true;
}
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.isuptodate.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.isuptodate.error"),
+ eee);
}
-
+
return result;
}
@@ -966,7 +1015,8 @@
false); // boolean depthIsSticky
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
// recherche de tous les fichiers locaux en conflit
@@ -1059,8 +1109,7 @@
}
return result;
} catch (SVNException eee) {
- throw new VCSException(
- _("isisfish.vcs.vcssvn.gettag.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.gettag.error"), eee);
}
}
@@ -1069,9 +1118,9 @@
*/
@Override
public List<File> setTag(VersionNumber version) throws VCSException {
-
+
List<File> filesInConflict = null;
-
+
try {
String tag = "/trunk";
@@ -1111,11 +1160,12 @@
// chatellier: allowUnversionedObstructions must be true
// if there is unversionned file or folder in repo, update will fail
// with org.tmatesoft.svn.core.SVNException: svn: Unable to lock 'xxx'
-
+
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision",
+ newRevision));
}
-
+
// recherche de tous les fichiers locaux en conflit apres le switch
Map<File, SVNStatus> status = getLocalStatus(localRoot,
true, SVNStatusType.STATUS_CONFLICTED);
@@ -1134,14 +1184,72 @@
}
}
}
-
-
+
} catch (SVNException eee) {
- throw new VCSException(
- _("isisfish.vcs.vcssvn.setTag.error"), eee);
+ throw new VCSException(_("isisfish.vcs.vcssvn.setTag.error"), eee);
}
-
+
return filesInConflict;
}
+}
+
+/**
+ * Authentication manager, that ask for passphrase
+ * if first authentication fail.
+ *
+ * @author chatellier
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 23 févr. 2009 $
+ * By : $Author: chatellier $
+ */
+class SSHSVNAuthenticationManager extends BasicAuthenticationManager {
+
+ protected String userName;
+ protected File keyFile;
+ protected int portNumber;
+
+ /**
+ * Creates an auth manager given a user credential - a username and an ssh private key.
+ *
+ * @param userName
+ * @param keyFile
+ * @param passphrase
+ * @param portNumber
+ */
+ public SSHSVNAuthenticationManager(String userName, File keyFile,
+ String passphrase, int portNumber) {
+ super(userName, keyFile, passphrase, portNumber);
+ this.userName = userName;
+ this.keyFile = keyFile;
+ this.portNumber = portNumber;
+ }
+
+ /*
+ * @see org.tmatesoft.svn.core.auth.BasicAuthenticationManager#getNextAuthentication(java.lang.String, java.lang.String, org.tmatesoft.svn.core.SVNURL)
+ */
+ @Override
+ public SVNAuthentication getNextAuthentication(String kind, String realm,
+ SVNURL url) throws SVNException {
+
+ SVNAuthentication auth = null;
+
+ if (kind.equals(ISVNAuthenticationManager.SSH) && keyFile != null) {
+
+ String passphrase = JOptionPane.showInputDialog(null, _(
+ "isisfish.vcs.vcssvn.connection.message", keyFile
+ .getAbsolutePath()), _(
+ "isisfish.vcs.vcssvn.connection.title", realm)
+ + url, JOptionPane.QUESTION_MESSAGE);
+
+ if (passphrase != null) {
+ auth = new SVNSSHAuthentication(userName, keyFile, passphrase,
+ portNumber, true);
+ }
+ } else {
+ auth = super.getNextAuthentication(kind, realm, url);
+ }
+ return auth;
+ }
}
\ No newline at end of file
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-23 09:02:58 UTC (rev 1858)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-23 10:29:50 UTC (rev 1859)
@@ -938,6 +938,8 @@
isisfish.vcs.vcssvn.checkout.error=Can't checkout
isisfish.vcs.vcssvn.commit.error=Can't commit files
isisfish.vcs.vcssvn.commit.errorreadonly=You can't commit file, this repository is readonly
+isisfish.vcs.vcssvn.connection.message=Passphrase for key %s
+isisfish.vcs.vcssvn.connection.title=Connecting to %s
isisfish.vcs.vcssvn.delete.error=Can't delete file
isisfish.vcs.vcssvn.delete.errorreadonly=You can't delete file, this repository is readonly
isisfish.vcs.vcssvn.diff.error=Can't get diff
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-23 09:02:58 UTC (rev 1858)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-23 10:29:50 UTC (rev 1859)
@@ -938,6 +938,8 @@
isisfish.vcs.vcssvn.checkout.error=Impossible de mettre \u00E0 jour
isisfish.vcs.vcssvn.commit.error=Impossible de commiter
isisfish.vcs.vcssvn.commit.errorreadonly=Vous ne pouvez pas commiter, le d\u00E9p\u00F4t est en lecture seule
+isisfish.vcs.vcssvn.connection.message=Passphrase pour la cl\u00E9 %s
+isisfish.vcs.vcssvn.connection.title=Connexion \u00E0 %s
isisfish.vcs.vcssvn.delete.error=Impossible de supprimer des fichiers
isisfish.vcs.vcssvn.delete.errorreadonly=Vous ne pouvez pas supprimer ce fichier, le d\u00E9p\u00F4t est en lecture seule
isisfish.vcs.vcssvn.diff.error=Impossible d'obtenir le diff
1
0
r1858 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
by chatellier@users.labs.libre-entreprise.org 23 Feb '09
23 Feb '09
Author: chatellier
Date: 2009-02-23 09:02:58 +0000 (Mon, 23 Feb 2009)
New Revision: 1858
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
Log:
Some code style corrections.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-02-20 17:00:48 UTC (rev 1857)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-02-23 09:02:58 UTC (rev 1858)
@@ -1,3 +1,22 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
package fr.ifremer.isisfish.ui.script;
import static org.codelutin.i18n.I18n._;
@@ -38,7 +57,7 @@
import fr.ifremer.isisfish.vcs.VCSException;
class ScriptFileFilter implements FileFilter {
- final FileFilter filter;
+ protected FileFilter filter;
public ScriptFileFilter(FileFilter filter) {
this.filter = filter;
@@ -50,13 +69,18 @@
}
/**
+ * ScriptAction.
+ *
+ * @author letellier
+ * @version $Revision: 1526 $
*
- * @author letellier
+ * Last update: $Date: 2008-10-07 18:46:13 +0200 (mar 07 oct 2008) $
+ * by : $Author: tchemit $
*/
public class ScriptAction {
/** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(ScriptAction.class);
+ private static Log log = LogFactory.getLog(ScriptAction.class);
protected CodeSourceStorage code;
@@ -74,7 +98,9 @@
return code;
}
- /** @return an array of all script's modules names managed by this screen */
+ /**
+ * @return an array of all script's modules names managed by this screen
+ */
public static String[] getScriptTypesNames() {
ScriptMapping[] values = ScriptMapping.values();
String[] result = new String[values.length];
@@ -136,19 +162,19 @@
return FormuleStorage.getFormuleDirectory();
}
- /*
- * JButton Action
+ /**
+ * Creer un nouveau script, ici un script peut-etre un Script, un Simulator,
+ * un Export.
+ *
+ * @param fileName
+ * @param scriptType le type que l'on souhaite Script, Simulator,
+ * ou Export.
*/
- /**
- * Creer un nouveau script, ici un script peut-etre un Script, un Simulator,
- * un Export.
- *
- * @param fileName
- * @param scriptType le type que l'on souhaite Script, Simulator,
- * ou Export.
- */
public void newScript(String fileName, String scriptType) {
- // log.info("newScript called [" + scriptType + "] " + uiContext);
+
+ if (log.isDebugEnabled()) {
+ log.info("newScript called [" + scriptType + "]");
+ }
Exception e;
try {
@@ -405,7 +431,7 @@
// there is some directories selected by user
for (File dir : dirFound) {
FileFilter filter = new FileFilter() {
- FileFilter excludeFilter = getSCRIPT_FILE_FILTER();
+ FileFilter excludeFilter = getScriptFileFilter();
public boolean accept(File pathname) {
return !excludeFilter.accept(pathname);
@@ -421,13 +447,13 @@
return result;
}
- public static FileFilter SCRIPT_FILE_FILTER;
+ protected static FileFilter scriptFileFilter;
- public static FileFilter getSCRIPT_FILE_FILTER() {
- if (SCRIPT_FILE_FILTER == null) {
- SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.vcs);
+ public static FileFilter getScriptFileFilter() {
+ if (scriptFileFilter == null) {
+ scriptFileFilter = new ScriptFileFilter(IsisFish.vcs);
}
- return SCRIPT_FILE_FILTER;
+ return scriptFileFilter;
}
//public static Object updateScript()
@@ -643,7 +669,8 @@
+ "\n"
+ " public void simulate(SimulationContext context) throws Exception '{'\n"
+ " // put your code here\n" + " '}'\n"
- + "\n" + "'}'\n"), Export(
+ + "\n" + "'}'\n"),
+ Export(
ExportStorage.getExportDirectory(),
/**
* 0 = package name,
@@ -714,7 +741,9 @@
+ "\n"
+ " public void export(SimulationStorage simulation, Writer out) throws Exception '{'\n"
+ " // put your code here, and write export with: out.write(\"...\")\n"
- + " '}'\n" + "\n" + "'}'\n"), Rule(
+ + " '}'\n" + "\n" + "'}'\n"),
+
+ Rule(
RuleStorage.getRuleDirectory(),
/**
* 0 = package name,
@@ -816,7 +845,9 @@
+ " * @param simulation La simulation pour lequel on utilise cette regle\n"
+ " */\n"
+ " public void postAction(SimulationContext context, Date date, Metier metier) throws Exception '{'\n"
- + " // TODO\n" + " '}'\n" + "\n" + "'}'\n"), AnalysePlan(
+ + " // TODO\n" + " '}'\n" + "\n" + "'}'\n"),
+
+ AnalysePlan(
AnalysePlanStorage.getAnalysePlanDirectory(),
/**
* 0 = package name,
@@ -908,8 +939,10 @@
+ " */\n"
+ " public boolean next(AnalysePlanContext context, SimulationStorage nextSimulation) throws Exception '{'\n"
+ " return false; // TODO\n" + " '}'\n"
- + "\n" + "'}'\n"), EquationModel(FormuleStorage
- .getFormuleDirectory(),
+ + "\n" + "'}'\n"),
+
+ EquationModel(
+ FormuleStorage.getFormuleDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -926,19 +959,19 @@
//" */\n" +
"\n" + "// put your code here\n" + "\n");
- private File module;
- private String defaultContent;
+ protected File module;
+ protected String defaultContent;
- ScriptMapping(File module, String defaultContent) {
+ private ScriptMapping(File module, String defaultContent) {
this.module = module;
this.defaultContent = defaultContent;
}
- File getModule() {
+ public File getModule() {
return module;
}
- String getDefaultContent() {
+ public String getDefaultContent() {
return defaultContent;
}
}
1
0
r1857 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 20 Feb '09
by sletellier@users.labs.libre-entreprise.org 20 Feb '09
20 Feb '09
Author: sletellier
Date: 2009-02-20 17:00:48 +0000 (Fri, 20 Feb 2009)
New Revision: 1857
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
Log:
Selection zones bug fixed
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-02-20 16:12:16 UTC (rev 1856)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/MetierSeasonInfoZoneUI.jaxx 2009-02-20 17:00:48 UTC (rev 1857)
@@ -177,9 +177,11 @@
}
protected void metierZonesChanged(){
Object[] selected = metierZones.getSelectedValues();
+ java.util.List<Zone> zones = new ArrayList<Zone>();
for (Object o : selected){
- getMetierSeasonInfo().addZone((Zone)o);
+ zones.add((Zone)o);
}
+ getMetierSeasonInfo().setZone(zones);
}
]]></script>
<Table id='body'>
1
0
Author: tchemit
Date: 2009-02-20 16:12:16 +0000 (Fri, 20 Feb 2009)
New Revision: 1856
Modified:
isis-fish/trunk/pom.xml
Log:
push back generic scm values
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-02-20 15:36:08 UTC (rev 1855)
+++ isis-fish/trunk/pom.xml 2009-02-20 16:12:16 UTC (rev 1856)
@@ -512,9 +512,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/trunk</connection>
- <developerConnection>scm:svn:svn+ssh://tchemit at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/trunk</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/isis-fish/trunk…</url>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>${maven.scm.url}</url>
</scm>
<!--Code Lutin Repository-->
1
0