Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
April 2009
- 7 participants
- 108 discussions
r2102 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
10 Apr '09
Author: chatellier
Date: 2009-04-10 15:17:12 +0000 (Fri, 10 Apr 2009)
New Revision: 2102
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
Log:
Fix log message
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-04-10 15:08:29 UTC (rev 2101)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-10 15:17:12 UTC (rev 2102)
@@ -291,7 +291,7 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (log.isDebugEnabled()){
- log.debug("PropetyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
+ log.debug("PropertyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
}
topiaChanged();
}
1
0
r2101 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
10 Apr '09
Author: chatellier
Date: 2009-04-10 15:08:29 +0000 (Fri, 10 Apr 2009)
New Revision: 2101
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
Log:
Fix compilation issue
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-04-10 15:02:56 UTC (rev 2100)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-10 15:08:29 UTC (rev 2101)
@@ -68,7 +68,7 @@
combo.setModel(new DefaultComboBoxModel());
try {
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
- } catch (IOException ex) {
+ } catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("Error on property change", e);
}
1
0
r2100 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
by chatellier@users.labs.libre-entreprise.org 10 Apr '09
10 Apr '09
Author: chatellier
Date: 2009-04-10 15:02:56 +0000 (Fri, 10 Apr 2009)
New Revision: 2100
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx
Log:
Add log error message (remove system out)
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-04-09 12:28:24 UTC (rev 2099)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputOneEquationUI.jaxx 2009-04-10 15:02:56 UTC (rev 2100)
@@ -69,7 +69,9 @@
try {
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
} catch (IOException ex) {
- Logger.getLogger(InputOneEquationUI.class.getName()).log(Level.SEVERE, null, ex);
+ if (log.isErrorEnabled()) {
+ log.error("Error on property change", e);
+ }
}
}
if (evt.getNewValue() != null) {
@@ -109,8 +111,10 @@
Method m = bean.getClass().getMethod("get" + methodGet, null);
result = (Equation) m.invoke(bean, (Object[])null);
}
- } catch (Exception ex) {
- System.out.println(ex);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get equation", e);
+ }
}
return result;
}
@@ -120,8 +124,10 @@
Method m = bean.getClass().getMethod("set" + methodSet, String.class);
m.invoke(bean, editor.getText());
}
- } catch (Exception ex) {
- System.out.println(ex);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set equation", e);
+ }
}
}
public void refresh(){
@@ -178,8 +184,10 @@
else {
try {
editor.open(org.codelutin.util.FileUtil.getTempFile("", ".java"));
- } catch (IOException ex) {
- Logger.getLogger(InputOneEquationUI.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Open editor", e);
+ }
}
}
}
1
0
Author: chatellier
Date: 2009-04-09 12:28:24 +0000 (Thu, 09 Apr 2009)
New Revision: 2099
Modified:
isis-fish/trunk/pom.xml
Log:
Fix scm values
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-09 10:59:01 UTC (rev 2098)
+++ isis-fish/trunk/pom.xml 2009-04-09 12:28:24 UTC (rev 2099)
@@ -542,9 +542,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://chatellier 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
Author: chatellier
Date: 2009-04-09 10:59:01 +0000 (Thu, 09 Apr 2009)
New Revision: 2098
Modified:
isis-fish/trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-09 10:58:50 UTC (rev 2097)
+++ isis-fish/trunk/pom.xml 2009-04-09 10:59:01 UTC (rev 2098)
@@ -13,7 +13,7 @@
<groupId>ifremer</groupId>
<artifactId>isis-fish</artifactId>
- <version>3.2.0.4-rc2</version>
+ <version>3.2.0.4-rc3-SNAPSHOT</version>
<!-- POM Relationships : Inheritance : Dependencies -->
<dependencies>
@@ -542,9 +542,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</connection>
- <developerConnection>scm:svn:svn+ssh://chatellier at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</developerConnection>
- <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/isis-fish/tags/…</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/trunk</connection>
+ <developerConnection>scm:svn:svn+ssh://chatellier 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>
</scm>
<!--Code Lutin Repository-->
1
0
r2097 - in isis-fish/tags: . isis-fish-3.2.0.4-rc2 isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/actions isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/migration isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/update isis-fish-3.2.0.4-rc2/src/main/java/fr/ifre
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 10:58:50 +0000 (Thu, 09 Apr 2009)
New Revision: 2097
Added:
isis-fish/tags/isis-fish-3.2.0.4-rc2/
isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/actions/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties
Removed:
isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
[maven-release-plugin] copy for tag isis-fish-3.2.0.4-rc2
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2 (from rev 2073, isis-fish/trunk)
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,725 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <!-- ************************************************************* -->
- <!-- *** POM Relationships *************************************** -->
- <!-- ************************************************************* -->
- <parent>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinproject</artifactId>
- <version>3.4</version>
- </parent>
-
- <groupId>ifremer</groupId>
- <artifactId>isis-fish</artifactId>
- <version>3.2.0.4-rc2-SNAPSHOT</version>
-
- <!-- POM Relationships : Inheritance : Dependencies -->
- <dependencies>
-
- <!--Compile-->
- <!--Librairies CodeLutin-->
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinutil</artifactId>
- <version>${lutinutil.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- <version>${topia.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>topia-service</artifactId>
- <version>${topia.service.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinmatrix</artifactId>
- <version>${lutinmatrix.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinwidget</artifactId>
- <version>${lutinwidget.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!--Jaxx-->
- <dependency>
- <groupId>org.codelutin.jaxx</groupId>
- <artifactId>jaxx-runtime-swing</artifactId>
- <version>${jaxx.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codelutin.jaxx</groupId>
- <artifactId>jaxx-runtime-validator</artifactId>
- <version>${jaxx.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Utilisé dans les scripts -->
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinj2r</artifactId>
- <version>${lutinj2r.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!--Commons-->
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-math</groupId>
- <artifactId>commons-math</artifactId>
- <version>1.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.8.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jdesktop</groupId>
- <artifactId>beansbinding</artifactId>
- <version>1.2.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1</version>
- <scope>compile</scope>
- </dependency>
-
- <!--Other-->
- <dependency>
- <groupId>jfreechart</groupId>
- <artifactId>jfreechart</artifactId>
- <version>0.9.3</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>jcommon</groupId>
- <artifactId>jcommon</artifactId>
- <version>0.7.0</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- XML-RPC Client and server (don't try 3.1.1) -->
- <dependency>
- <groupId>org.apache.xmlrpc</groupId>
- <artifactId>xmlrpc-client</artifactId>
- <version>${xmlrpc.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.xmlrpc</groupId>
- <artifactId>xmlrpc-server</artifactId>
- <version>${xmlrpc.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- encore utilise pour les pre-scripts -->
- <dependency>
- <groupId>org.beanshell</groupId>
- <artifactId>bsh</artifactId>
- <version>2.0b4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>openmap</groupId>
- <artifactId>openmap</artifactId>
- <version>${openmap.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>sshtools</groupId>
- <artifactId>j2ssh-common</artifactId>
- <version>${sshtool.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>sshtools</groupId>
- <artifactId>j2ssh-core</artifactId>
- <version>${sshtool.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.38</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Utilisé lors de l'import xml v2 (entre autre) -->
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- Change this dependence if you change database -->
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.1.110</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- aspectwerkz -->
- <dependency>
- <groupId>aspectwerkz</groupId>
- <artifactId>aspectwerkz</artifactId>
- <version>${aspectwerkz.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>aspectwerkz</groupId>
- <artifactId>aspectwerkz-jdk5</artifactId>
- <version>${aspectwerkz.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>aspectwerkz</groupId>
- <artifactId>aspectwerkz-core</artifactId>
- <version>${aspectwerkz.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- ssj pour les calculs stockastiques -->
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>ssj</artifactId>
- <version>2.1.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>Blas</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>colt</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>interpreter</artifactId>
- <version>1.6.8</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>language</artifactId>
- <version>1.6.7</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>logger</artifactId>
- <version>1.6.4</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>ssj</groupId>
- <artifactId>optimization</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
- </dependency>
- <!-- fin ssj pour les calculs stockastiques -->
-
- <!-- debut svnkit pour communication subversion -->
- <dependency>
- <groupId>org.tmatesoft</groupId>
- <artifactId>svnkit</artifactId>
- <version>1.2.3.5521</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>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.15</version>
- </dependency>
- </dependencies>
-
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
- <name>IsisFish</name>
- <description>Simulateur de pecherie complexe.</description>
- <inceptionYear>1999</inceptionYear>
-
- <licenses>
- <license>
- <name>GPL</name>
- <url>http://www.gnu.org/copyleft/gpl.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
- <packaging>jar</packaging>
-
- <properties>
- <!-- id du projet du labs -->
- <labs.id>8</labs.id>
-
- <!-- nom du projet du labs -->
- <labs.project>isis-fish</labs.project>
-
- <!-- Custom version -->
- <jaxx.version>1.3-SNAPSHOT</jaxx.version>
- <topia.version>2.1.4-SNAPSHOT</topia.version>
- <topia.service.version>1.0.2</topia.service.version>
- <lutinmatrix.version>1.3-SNAPSHOT</lutinmatrix.version>
- <lutinutil.version>1.0.3</lutinutil.version>
- <i18n.version>0.9</i18n.version>
- <lutinwidget.version>0.14-SNAPSHOT</lutinwidget.version>
- <generator.version>0.64</generator.version>
- <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>
-
- <!-- jnlp -->
- <keystorepath>${codelutin.keystorepath}</keystorepath>
- <keystorealias>CodeLutin</keystorealias>
- <keystorepass>codelutin</keystorepass>
- <jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.directory>
-
- <jnlpCodebase>${project.url}</jnlpCodebase>
- <!-- to test jnlp file locally -->
- <jnlpCodebase>file://${jnlp.build.directory}</jnlpCodebase>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-generator-plugin</artifactId>
- <version>${generator.version}</version>
- <executions>
- <execution>
- <id>Generator</id>
- <phase>generate-sources</phase>
- <configuration>
- <srcDirZuml>${project.basedir}/src/main/xmi</srcDirZuml>
- <srcXmiDest>${maven.gen.dir}/xmi/</srcXmiDest>
- <fullPackagePath>fr.ifremer.isisfish</fullPackagePath>
- <extractedPackages>fr.ifremer.isisfish</extractedPackages>
- <!--Config generator-->
- <srcGenDest>${maven.gen.dir}/objectmodel/</srcGenDest>
- <includes>**/*.objectmodel</includes>
- <templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
- <excludeTemplates>
- <value>org.codelutin.topia.generator.EntityEnumGenerator</value>
- <value>org.codelutin.topia.generator.EntityProviderGenerator</value>
- </excludeTemplates>
- <destDirGen>${maven.gen.dir}/java</destDirGen>
- <defaultPackage>fr.ifremer.isisfish</defaultPackage>
- <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%
- </copyVersionDir>
- <copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
- <copyOverwrite>true</copyOverwrite>
- </configuration>
- <goals>
- <goal>zargo2xmi</goal>
- <goal>xmi2objectmodel</goal>
- <goal>generate</goal>
- <goal>copyVersionFiles</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- <version>${topia.version}</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.codelutin.jaxx</groupId>
- <artifactId>maven-jaxx-plugin</artifactId>
- <version>${jaxx.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- <configuration>
- <extraImports>
- <value>jaxx.runtime.SwingUtil</value>
- <value>static jaxx.runtime.Util.getStringValue</value>
- </extraImports>
- <addSourcesToClassPath>true</addSourcesToClassPath>
- <addProjectClassPath>true</addProjectClassPath>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-i18n-plugin</artifactId>
- <version>${i18n.version}</version>
- <configuration>
- <entries>
- <entry>
- <basedir>${maven.gen.dir}/java/</basedir>
- <specificGoal>parserJava</specificGoal>
- <!-- <includes>
- <param>**\/**UI.java</param>
- </includes> -->
- </entry>
- </entries>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>parserJava</goal>
- <goal>gen</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- Always process jrst files, but only called on pre-site phase -->
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-jrst-plugin</artifactId>
- <version>${jrst.version}</version>
- <configuration>
- <defaultLocale>fr</defaultLocale>
- </configuration>
- <executions>
- <execution>
- <phase>pre-site</phase>
- <goals>
- <goal>jrst</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>./lib/</classpathPrefix>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- </build>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
- <url>${maven.scm.url}</url>
- </scm>
-
- <!--Code Lutin Repository-->
- <repositories>
- <repository>
- <id>codelutin-repository</id>
- <name>CodeLutinRepository</name>
- <url>http://lutinbuilder.labs.libre-entreprise.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- <checksumPolicy>warn</checksumPolicy>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- <checksumPolicy>warn</checksumPolicy>
- </releases>
- </repository>
- </repositories>
-
- <profiles>
- <profile>
- <id>release-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
-
- <!-- always add license and third-party files to classpath -->
- <plugin>
- <groupId>org.codelutin</groupId>
- <artifactId>maven-license-switcher-plugin</artifactId>
- <version>${license-switcher.version}</version>
- <configuration>
- <licenseName>${license-switcher.licenseName}</licenseName>
- </configuration>
- <executions>
- <execution>
- <id>attach-licenses</id>
- <goals>
- <goal>license</goal>
- <goal>third-party</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
- <execution>
- <id>JnlpSun</id>
- <phase>verify</phase>
- <configuration>
- <tasks>
- <mkdir dir="${jnlp.build.directory}" />
- <copy file="${project.basedir}/src/main/jnlp/sun.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
- <filterset>
- <filter token="lib-javahelp" value="javahelp-2.0.02.jar" />
- <filter token="lib-activation" value="activation-1.1.jar" />
- <filter token="lib-mail" value="mail-1.4.jar" />
- <filter token="url" value="${jnlpCodebase}" />
- </filterset>
- </copy>
- <copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
- <filterset>
- <filter token="lib" value="jxlayer-3.0.1.jar" />
- <filter token="url" value="${jnlpCodebase}" />
- </filterset>
- </copy>
-
- <copy verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false">
- <fileset dir="${project.build.directory}/lib">
- <include name="javahelp-2.0.02.jar" />
- <include name="activation-1.1.jar" />
- <include name="mail-1.4.jar" />
- <include name="jxlayer-3.0.1.jar" />
- </fileset>
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>JnlpToSite</id>
- <phase>pre-site</phase>
- <configuration>
- <tasks>
- <mkdir dir="${maven.site.gen.dir}/resources" />
- <copy todir="${maven.site.gen.dir}/resources" verbose="true" failonerror="false" overwrite="false">
- <fileset dir="${jnlp.build.directory}">
- <include name="**" />
- </fileset>
- <!-- should be better to use the deployed assembly in lutinbuilder ? -->
- <fileset dir="target">
- <include name="${project.build.finalName}-bin.zip" />
- </fileset>
-
- </copy>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20090204</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <force>false</force>
- <dependencies>
- <excludes>
- <exclude>javax.help:javahelp</exclude>
- <exclude>javax.mail:mail</exclude>
- <exclude>javax.activation:activation</exclude>
- <exclude>org.swinglabs:jxlayer</exclude>
- </excludes>
- </dependencies>
- <libPath>lib</libPath>
- <extensions>
- <sun>sun.jnlp</sun>
- <jxlayer>jxlayer.jnlp</jxlayer>
- </extensions>
- <jnlp>
- <outputFile>isis-fish-v3.jnlp</outputFile>
- <mainClass>${maven.jar.main.class}</mainClass>
- <allPermissions>true</allPermissions>
- <offlineAllowed>true</offlineAllowed>
- </jnlp>
-
- <sign>
- <keystore>${keystorepath}</keystore>
- <keypass />
- <storepass>${keystorepass}</storepass>
- <storetype />
- <alias>${keystorealias}</alias>
- <validity />
- <dnameCn />
- <dnameOu />
- <dnameO />
- <dnameL />
- <dnameSt />
- <dnameC />
- <verify>true</verify>
- <keystoreConfig>
- <delete>false</delete>
- <gen>false</gen>
- </keystoreConfig>
- </sign>
- <pack200>false</pack200>
- <gzip>true</gzip>
- <verbose>false</verbose>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-3</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- </descriptors>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
-</project>
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml (from rev 2096, isis-fish/trunk/pom.xml)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/pom.xml 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,745 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+ <parent>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinproject</artifactId>
+ <version>3.4</version>
+ </parent>
+
+ <groupId>ifremer</groupId>
+ <artifactId>isis-fish</artifactId>
+ <version>3.2.0.4-rc2</version>
+
+ <!-- POM Relationships : Inheritance : Dependencies -->
+ <dependencies>
+
+ <!--Compile-->
+ <!--Librairies CodeLutin-->
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinutil</artifactId>
+ <version>${lutinutil.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ <version>${topia.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>topia-service</artifactId>
+ <version>${topia.service.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinmatrix</artifactId>
+ <version>${lutinmatrix.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinwidget</artifactId>
+ <version>${lutinwidget.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!--Jaxx-->
+ <dependency>
+ <groupId>org.codelutin.jaxx</groupId>
+ <artifactId>jaxx-runtime-swing</artifactId>
+ <version>${jaxx.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codelutin.jaxx</groupId>
+ <artifactId>jaxx-runtime-validator</artifactId>
+ <version>${jaxx.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Utilisé dans les scripts -->
+ <dependency>
+ <groupId>org.codelutin</groupId>
+ <artifactId>lutinj2r</artifactId>
+ <version>${lutinj2r.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!--Commons-->
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-math</groupId>
+ <artifactId>commons-math</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jdesktop</groupId>
+ <artifactId>beansbinding</artifactId>
+ <version>1.2.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!--Other-->
+ <dependency>
+ <groupId>jfreechart</groupId>
+ <artifactId>jfreechart</artifactId>
+ <version>0.9.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jcommon</groupId>
+ <artifactId>jcommon</artifactId>
+ <version>0.7.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- XML-RPC Client and server (don't try 3.1.1) -->
+ <dependency>
+ <groupId>org.apache.xmlrpc</groupId>
+ <artifactId>xmlrpc-client</artifactId>
+ <version>${xmlrpc.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.xmlrpc</groupId>
+ <artifactId>xmlrpc-server</artifactId>
+ <version>${xmlrpc.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- encore utilise pour les pre-scripts -->
+ <dependency>
+ <groupId>org.beanshell</groupId>
+ <artifactId>bsh</artifactId>
+ <version>2.0b4</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>openmap</groupId>
+ <artifactId>openmap</artifactId>
+ <version>${openmap.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>sshtools</groupId>
+ <artifactId>j2ssh-common</artifactId>
+ <version>${sshtool.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>sshtools</groupId>
+ <artifactId>j2ssh-core</artifactId>
+ <version>${sshtool.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.38</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- Utilisé lors de l'import xml v2 (entre autre) -->
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Change this dependence if you change database -->
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.1.110</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- aspectwerkz -->
+ <dependency>
+ <groupId>aspectwerkz</groupId>
+ <artifactId>aspectwerkz</artifactId>
+ <version>${aspectwerkz.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>aspectwerkz</groupId>
+ <artifactId>aspectwerkz-jdk5</artifactId>
+ <version>${aspectwerkz.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>aspectwerkz</groupId>
+ <artifactId>aspectwerkz-core</artifactId>
+ <version>${aspectwerkz.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- ssj pour les calculs stockastiques -->
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>ssj</artifactId>
+ <version>2.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>Blas</artifactId>
+ <version>20081007</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>colt</artifactId>
+ <version>20081007</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>interpreter</artifactId>
+ <version>1.6.8</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>language</artifactId>
+ <version>1.6.7</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>logger</artifactId>
+ <version>1.6.4</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>ssj</groupId>
+ <artifactId>optimization</artifactId>
+ <version>20081007</version>
+ <scope>runtime</scope>
+ </dependency>
+ <!-- fin ssj pour les calculs stockastiques -->
+
+ <!-- debut svnkit pour communication subversion -->
+ <dependency>
+ <groupId>org.tmatesoft</groupId>
+ <artifactId>svnkit</artifactId>
+ <version>1.2.3.5521</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>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.15</version>
+ </dependency>
+ </dependencies>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+ <name>IsisFish</name>
+ <description>Simulateur de pecherie complexe.</description>
+ <inceptionYear>1999</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>GPL</name>
+ <url>http://www.gnu.org/copyleft/gpl.html</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+ <packaging>jar</packaging>
+
+ <properties>
+ <!-- id du projet du labs -->
+ <labs.id>8</labs.id>
+
+ <!-- nom du projet du labs -->
+ <labs.project>isis-fish</labs.project>
+
+ <!-- Custom version -->
+ <jaxx.version>1.3</jaxx.version>
+ <topia.version>2.1.4</topia.version>
+ <topia.service.version>1.0.2</topia.service.version>
+ <lutinmatrix.version>1.3</lutinmatrix.version>
+ <lutinutil.version>1.0.4</lutinutil.version>
+ <i18n.version>0.9</i18n.version>
+ <lutinwidget.version>0.14</lutinwidget.version>
+ <generator.version>0.64</generator.version>
+ <lutinj2r.version>0.3</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>
+
+ <!-- for compilation test to run -->
+ <maven.test.forkMode>once</maven.test.forkMode>
+
+ <!--Main class in JAR -->
+ <maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
+
+ <!-- jnlp -->
+ <keystorepath>${codelutin.keystorepath}</keystorepath>
+ <keystorealias>CodeLutin</keystorealias>
+ <keystorepass>codelutin</keystorepass>
+ <jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.directory>
+
+ <jnlpCodebase>${project.url}</jnlpCodebase>
+ <!-- to test jnlp file locally -->
+ <jnlpCodebase>file://${jnlp.build.directory}</jnlpCodebase>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-generator-plugin</artifactId>
+ <version>${generator.version}</version>
+ <executions>
+ <execution>
+ <id>Generator</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <srcDirZuml>${project.basedir}/src/main/xmi</srcDirZuml>
+ <srcXmiDest>${maven.gen.dir}/xmi/</srcXmiDest>
+ <fullPackagePath>fr.ifremer.isisfish</fullPackagePath>
+ <extractedPackages>fr.ifremer.isisfish</extractedPackages>
+ <!--Config generator-->
+ <srcGenDest>${maven.gen.dir}/objectmodel/</srcGenDest>
+ <includes>**/*.objectmodel</includes>
+ <templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
+ <excludeTemplates>
+ <value>org.codelutin.topia.generator.EntityEnumGenerator</value>
+ <value>org.codelutin.topia.generator.EntityProviderGenerator</value>
+ </excludeTemplates>
+ <destDirGen>${maven.gen.dir}/java</destDirGen>
+ <defaultPackage>fr.ifremer.isisfish</defaultPackage>
+ <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%
+ </copyVersionDir>
+ <copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
+ <copyOverwrite>true</copyOverwrite>
+ </configuration>
+ <goals>
+ <goal>zargo2xmi</goal>
+ <goal>xmi2objectmodel</goal>
+ <goal>generate</goal>
+ <goal>copyVersionFiles</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.codelutin.topia</groupId>
+ <artifactId>topia-persistence</artifactId>
+ <version>${topia.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codelutin.jaxx</groupId>
+ <artifactId>maven-jaxx-plugin</artifactId>
+ <version>${jaxx.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <extraImports>
+ <value>jaxx.runtime.SwingUtil</value>
+ <value>static jaxx.runtime.Util.getStringValue</value>
+ </extraImports>
+ <addSourcesToClassPath>true</addSourcesToClassPath>
+ <addProjectClassPath>true</addProjectClassPath>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <version>${i18n.version}</version>
+ <configuration>
+ <entries>
+ <entry>
+ <basedir>${maven.gen.dir}/java/</basedir>
+ <specificGoal>parserJava</specificGoal>
+ <!-- <includes>
+ <param>**\/**UI.java</param>
+ </includes> -->
+ </entry>
+ </entries>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>parserJava</goal>
+ <goal>gen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Always process jrst files, but only called on pre-site phase -->
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-jrst-plugin</artifactId>
+ <version>${jrst.version}</version>
+ <configuration>
+ <defaultLocale>fr</defaultLocale>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>jrst</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>lib/</classpathPrefix>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/javase/6/docs/api/</link>
+ <link>http://lutinutil.labs.libre-entreprise.org/lutinutil/apidocs/</link>
+ <link>http://lutinmatrix.labs.libre-entreprise.org/lutinmatrix/apidocs/</link>
+ <link>http://topia.labs.libre-entreprise.org/topia/topia-persistence/apidocs/</link>
+ </links>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</connection>
+ <developerConnection>scm:svn:svn+ssh://chatellier at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/isis-fish/tags/…</url>
+ </scm>
+
+ <!--Code Lutin Repository-->
+ <repositories>
+ <repository>
+ <id>codelutin-repository</id>
+ <name>CodeLutinRepository</name>
+ <url>http://lutinbuilder.labs.libre-entreprise.org/maven2</url>
+ <snapshots>
+ <enabled>true</enabled>
+ <checksumPolicy>warn</checksumPolicy>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ <checksumPolicy>warn</checksumPolicy>
+ </releases>
+ </repository>
+ </repositories>
+
+ <profiles>
+ <profile>
+ <id>release-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <!-- always add license and third-party files to classpath -->
+ <plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-license-switcher-plugin</artifactId>
+ <version>${license-switcher.version}</version>
+ <configuration>
+ <licenseName>${license-switcher.licenseName}</licenseName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-licenses</id>
+ <goals>
+ <goal>license</goal>
+ <goal>third-party</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
+ <execution>
+ <id>JnlpSun</id>
+ <phase>verify</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${jnlp.build.directory}" />
+ <copy file="${project.basedir}/src/main/jnlp/sun.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
+ <filterset>
+ <filter token="lib-javahelp" value="javahelp-2.0.02.jar" />
+ <filter token="lib-activation" value="activation-1.1.jar" />
+ <filter token="lib-mail" value="mail-1.4.jar" />
+ <filter token="url" value="${jnlpCodebase}" />
+ </filterset>
+ </copy>
+ <copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp" verbose="${maven.verbose}" todir="${jnlp.build.directory}" failonerror="false">
+ <filterset>
+ <filter token="lib" value="jxlayer-3.0.1.jar" />
+ <filter token="url" value="${jnlpCodebase}" />
+ </filterset>
+ </copy>
+
+ <copy verbose="${maven.verbose}" todir="${jnlp.build.directory}/lib" failonerror="false">
+ <fileset dir="${project.build.directory}/lib">
+ <include name="javahelp-2.0.02.jar" />
+ <include name="activation-1.1.jar" />
+ <include name="mail-1.4.jar" />
+ <include name="jxlayer-3.0.1.jar" />
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>JnlpToSite</id>
+ <phase>pre-site</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${maven.site.gen.dir}/resources" />
+ <copy todir="${maven.site.gen.dir}/resources" verbose="true" failonerror="false" overwrite="false">
+ <fileset dir="${jnlp.build.directory}">
+ <include name="**" />
+ </fileset>
+ <!-- should be better to use the deployed assembly in lutinbuilder ? -->
+ <fileset dir="target">
+ <include name="${project.build.finalName}-bin.zip" />
+ </fileset>
+
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <version>1.0-alpha-2-cl_20090204</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>jnlp-inline</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <force>false</force>
+ <dependencies>
+ <excludes>
+ <exclude>javax.help:javahelp</exclude>
+ <exclude>javax.mail:mail</exclude>
+ <exclude>javax.activation:activation</exclude>
+ <exclude>org.swinglabs:jxlayer</exclude>
+ </excludes>
+ </dependencies>
+ <libPath>lib</libPath>
+ <extensions>
+ <sun>sun.jnlp</sun>
+ <jxlayer>jxlayer.jnlp</jxlayer>
+ </extensions>
+ <jnlp>
+ <outputFile>isis-fish-v3.jnlp</outputFile>
+ <mainClass>${maven.jar.main.class}</mainClass>
+ <allPermissions>true</allPermissions>
+ <offlineAllowed>true</offlineAllowed>
+ </jnlp>
+
+ <sign>
+ <keystore>${keystorepath}</keystore>
+ <keypass />
+ <storepass>${keystorepass}</storepass>
+ <storetype />
+ <alias>${keystorealias}</alias>
+ <validity />
+ <dnameCn />
+ <dnameOu />
+ <dnameO />
+ <dnameL />
+ <dnameSt />
+ <dnameC />
+ <verify>true</verify>
+ <keystoreConfig>
+ <delete>false</delete>
+ <gen>false</gen>
+ </keystoreConfig>
+ </sign>
+ <pack200>false</pack200>
+ <gzip>true</gzip>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-3</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,798 +0,0 @@
-/* *##%
- * 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
- * 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;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import org.apache.commons.beanutils.ConvertUtils;
-import org.apache.commons.lang.time.DurationFormatUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.util.ApplicationConfig;
-import org.codelutin.util.ArgumentsParserException;
-import org.codelutin.util.StringUtil;
-import org.codelutin.util.VersionNumber;
-
-import fr.ifremer.isisfish.actions.ExportAction;
-import fr.ifremer.isisfish.actions.ImportAction;
-import fr.ifremer.isisfish.actions.OtherAction;
-import fr.ifremer.isisfish.actions.SimulationAction;
-import fr.ifremer.isisfish.actions.VCSAction;
-import fr.ifremer.isisfish.simulator.SimulationContext;
-import fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher;
-import fr.ifremer.isisfish.simulator.launcher.SimulationService;
-import fr.ifremer.isisfish.simulator.launcher.SSHSimulatorLauncher;
-import fr.ifremer.isisfish.simulator.launcher.SubProcessSimulationLauncher;
-import fr.ifremer.isisfish.vcs.VCS;
-
-/**
- *
- * @author poussin
- * @version $Revision: 1310 $
- *
- * Last update: $Date: 2008-08-23 00:46:00 +0200 (Sat, 23 Aug 2008) $
- * by : $Author: bpoussin $
- */
-public class IsisConfig extends ApplicationConfig {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(IsisConfig.class);
-
- /**
- * La version du logiciel constitue de l.d.a.r
- * <li>l: le numero de version du logiciel
- * <li>d: le numero de version du schema de la base de donnees
- * <li>a: le numero de version de l'api des scripts
- * <li>r: le numero de version de de l'interface graphique ou autre modif mineur
- * <p>
- * lors de l'increment de l, d, a et r sont remis a 0
- * lors de l'increment de d, a et r sont remis a 0
- * lors de l'increment de a, r est remis a 0
- * <p>
- * Un changement d'UI ne modifie jamais le numero de version de database
- * Un changement de schema de base pour lequel on ne peut pas faire de
- * migration de donnees demande automatiquement un changement de version
- * d'application.
- */
- protected final static VersionNumber version = new VersionNumber(3, 2, 0, 4);
- protected final static VersionNumber databaseVersion = new VersionNumber(
- version.getNumber(0), version.getNumber(1));
- protected final static VersionNumber apiVersion = new VersionNumber(
- version.getNumber(0), version.getNumber(1), version.getNumber(2));
-
- public static VersionNumber getVersionNumber() {
- return version;
- }
-
- /**
- * le nombre global ex: 3.2.0.0
- * @return
- */
- static public String getVersion() {
- String result = version.toString();
- return result;
- }
-
- /**
- * La version de la base ex: 3.2
- * @return
- */
- public static VersionNumber getDatabaseVersion() {
- return databaseVersion;
- }
-
- /**
- * La version de l'api de programmation ex: 3.2.0
- * @return
- */
- public static VersionNumber getApiVersion() {
- return apiVersion;
- }
-
- static final public String COPYRIGHT_TEXT = "Version " + getVersion() + " IFREMER-MAERHA © 2000-2009";
- static final public String CONFIG_FILENAME = "isis-config-" + version.getNumber(0);
-
- /** separateur de liste */
- static final public String SEP = ",";
- static final public String REPORT_EMAIL = "isis-fish-bugreport at lists.labs.libre-entreprise.org";
-
- protected transient File backupSessionDirectory = null;
- protected long startingTime = System.nanoTime();
-
- public IsisConfig() {
-
- for (Option o : Option.values()) {
- setDefaultOption(o.key, o.defaultValue);
- }
-
- for (Action a : Action.values()) {
- for (String alias : a.aliases) {
- addActionAlias(alias, a.action);
- }
- }
-
- }
-
- //////////////////////////////////////////////////
- // Methode d'acces aux options
- //////////////////////////////////////////////////
-
- /**
- * Retourne le repertoire racine de toutes les donnees (script, simulation
- * region, ...)
- * @return
- */
- public File getDatabaseDirectory() {
- File result = getOptionAsFile(Option.DATABASE_DIRECTORY.key);
- return result;
- }
-
- /**
- * retourne le repertoire ou sont stockes les scripts compiles
- * @return
- */
- public File getCompileDirectory() {
- File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
- if (!result.exists()) {
- result.mkdirs();
- }
- return result;
- }
-
- /**
- * Retourne l'objet Local a utilise pour la langue
- * @return
- */
- public Locale getLocale() {
- String value = getOption(Option.LOCALE.key);
- Locale result = (Locale)ConvertUtils.convert(value, Locale.class);
- return result;
- }
-
- /**
- * Retourne l'encoding a utiliser pour les fichiers textes
- * @return
- */
- public String getEncoding() {
- String result = getOption(Option.ENCODING.key);
- return result;
- }
-
- /**
- * Retourne le serveur SMTP a utiliser pour l'envoie de mail
- * @return
- */
- public String getSmtpServer() {
- String result = getOption(Option.SMTP_SERVER.key);
- return result;
- }
-
- /**
- * Retourne le nom usuel de l'utilisateur
- * @return
- */
- public String getUserName() {
- String result = getOption(Option.USER_NAME.key);
- return result;
- }
-
- /**
- * Retourne l'email de l'utilisateur
- * @return
- */
- public String getUserMail() {
- String result = getOption(Option.USER_MAIL.key);
- return result;
- }
-
- /**
- * Retourne l'url du serveur de simulation
- * @return simulator server
- */
- public String getSimulatorServer() {
- String result = getOption(Option.SIMULATOR_SERVER.key);
- return result;
- }
-
- /**
- * Retourne le login pour acceder au serveur de simulation
- * @return simulator username
- */
- public String getSimulatorUsername() {
- String result = getOption(Option.SIMULATOR_USER_NAME.key);
- return result;
- }
-
- /**
- * Retourne le mot de passe pour acceder au serveur de simulation
- * @return simulator password
- */
- public String getSimulatorPassword() {
- String result = getOption(Option.SIMULATOR_PASSWORD.key);
- return result;
- }
-
- public String getSimulatorClassfile() {
- String result = getOption(Option.SIMULATOR_CLASSFILE.key);
- return result;
- }
-
- public void setSimulatorClassfile(String value) {
- setOption(Option.SIMULATOR_CLASSFILE.key, value);
- }
-
- /**
- * Retourne l'url du serveur de simulation accessible via SSH.
- *
- * @return simulator server
- */
- public String getSimulatorSshServer() {
- String result = getOption(Option.SIMULATOR_SSH_SERVER.key);
- return result;
- }
-
- /**
- * Retourne le login pour acceder au serveur de simulation accessible via SSH.
- *
- * @return simulator username
- */
- public String getSimulatorSshUsername() {
- String result = getOption(Option.SIMULATOR_SSH_USER_NAME.key);
- return result;
- }
-
- /**
- * Retourne le chemin relatif ou abs du repertoire
- * root des données d'isis.
- *
- * @return simulator data path
- */
- public String getSimulatorSshDataPath() {
- String result = getOption(Option.SIMULATOR_SSH_DATAPATH.key);
- return result;
- }
-
- /**
- * Retourne le chemin distant ou est installé isis.
- *
- * @return remote isis home
- */
- public String getSimulatorSshIsisHome() {
- String result = getOption(Option.SIMULATOR_SSH_ISIS_HOME.key);
- return result;
- }
-
- /**
- * Retourne l'emplacement du dossier temporaire distant.
- *
- * Ce dossier doit être ABSOLUT.
- *
- * @return tmp dir
- */
- public String getSimulatorSshTmpPath() {
- String result = getOption(Option.SIMULATOR_SSH_TMPPATH.key);
- return result;
- }
-
- /**
- * Retourne la commande a utiliser pour ajouter
- * le script à la queue des simulation.
- *
- * @return add to queue command
- */
- public String getSimulatorSshAddToQueueCommand() {
- String result = getOption(Option.SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND.key);
- return result;
- }
-
- /**
- * Retourne l'interval de temps a utiliser
- * pour recuperer le fichier de control.
- *
- * @return time (in seconds)
- */
- public long getSimulatorSshControlCheckInterval() {
- int result = getOptionAsInt(Option.SIMULATOR_SSH_CONTROLCHECKINTERVAL.key);
- return result;
- }
-
- /**
- * Retourne la clé privée de l'utilisteur courant.
- *
- * @return private ssh key path
- */
- public File getSSHPrivateKeyFilePath() {
- File result = getOptionAsFile(Option.SSH_KEY_FILE.key);
- return result;
- }
-
- /*
- * Le type de simulation par defaut a utiliser (local, remote, ...)
- * @return
- *)
- public boolean isSimulatorLocal() {
- // FIXME never called
- String value = getOption(Option.SIMULATOR_LAUNCHER.key);
- // and following code always return false :
- boolean result = "local".equalsIgnoreCase(value);
- return result;
- }*/
-
- /*public boolean isUseVCS() {
- String value = getOption(Option.VCS_TYPE.key);
- boolean result = !VCSNone.TYPE_NONE.equals(value);
- return result;
- }*/
-
- public boolean isLaunchUI() {
- boolean result = getOptionAsBoolean(Option.LAUNCH_UI.key);
- return result;
- }
-
- public void setSimulatorLauncher(String value) {
- setOption(Option.SIMULATOR_LAUNCHER.key, value);
- }
-
-// public boolean isSimulationShowOnlyQueue() {
-// Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_QUEUE.key);
-// return result;
-// }
-
- public boolean isSimulationShowOnlyError() {
- Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_ERROR.key);
- return result;
- }
-
- public File getDefaultExportDirectory() {
- File result = getOptionAsFile(Option.DEFAULT_EXPORT_DIRECTORY.key);
- if (!result.exists()) {
- result.mkdirs();
- }
- return result;
- }
-
- public void setDefaultExportDirectory(String value) {
- setOption(Option.DEFAULT_EXPORT_DIRECTORY.key, value);
- }
-
- public String getDefaultExportNames() {
- String result = getOption(Option.DEFAULT_EXPORT_NAMES.key);
- return result;
- }
-
- public void setDefaultExportNames(List<String> exportNames) {
- StringBuilder sb = new StringBuilder();
- for (String exportName : exportNames) {
- sb.append(SEP).append(exportName);
- }
- String value = sb.toString().substring(1);
- setOption(Option.DEFAULT_EXPORT_NAMES.key, value);
- saveForUser();
- }
-
- /**
- * @return la liste des noms d'exports par defaut sous forme de liste,
- * a partir de la propriete {@link Option#DEFAULT_EXPORT_NAMES}
- * ou null si ils n'ont jamais ete sauves par l'utilisateur.
- * by user.
- * @see Option#DEFAULT_EXPORT_NAMES
- */
- public List<String> getDefaultExportNamesAsList() {
- List<String> result = null;
- String exportNamesList = getDefaultExportNames();
- if (exportNamesList != null) {
- result = new ArrayList<String>();
- String[] exportNames = StringUtil.split(exportNamesList, ",");
- result.addAll(Arrays.asList(exportNames));
- }
- return result;
- }
-
- public String getDefaultMapFilename() {
- String result = getOption(Option.DEFAULT_MAP_FILENAME.key);
- return result;
- }
-
- public String getDefaultResultNames() {
- String result = getOption(Option.DEFAULT_RESULT_NAMES.key);
- return result;
- }
-
- public void setDefaultResultNames(List<String> resultNames) {
- StringBuilder sb = new StringBuilder();
- for (String resultName : resultNames) {
- sb.append(SEP).append(resultName);
- }
- String value = sb.toString().substring(1);
- setOption(Option.DEFAULT_RESULT_NAMES.key, value);
- saveForUser();
- }
-
- /**
- * @return les resultats par defaut d'une simulation sous forme de liste
- * a partir de la propriete {@link Option#DEFAULT_RESULT_NAMES}
- * @see Option#DEFAULT_RESULT_NAMES
- */
- public List<String> getDefaultResultNamesAsList() {
- List<String> result = null;
- String resultNamesList = getDefaultResultNames();
- if (resultNamesList != null) {
- result = new ArrayList<String>();
- String[] resultNames = StringUtil.split(resultNamesList, ",");
- result.addAll(Arrays.asList(resultNames));
- }
- return result;
- }
-
- public String getDefaultTagValue() {
- String result = getOption(Option.DEFAULT_TAG_VALUE.key);
- return result;
- }
-
- public void setDefaultTagValues(Map<String, String> tagValues) {
- StringBuilder sb = new StringBuilder(" ");
- for (Map.Entry<String, String> entry : tagValues.entrySet()) {
- sb.append(SEP).append('"').append(entry.getKey()).append("\":\"").append(entry.getValue()).append('"');
- }
- String value = sb.toString().trim();
- setOption(Option.DEFAULT_TAG_VALUE.key, value.isEmpty() ? "" : value.substring(1));
- saveForUser();
- }
-
-
-
- /**
- * @return le dictionnaire des tags par defaut d'une simulation a partir
- * de la propriete {@link Option#DEFAULT_TAG_VALUE}
- * @see Option#DEFAULT_TAG_VALUE
- */
- public Map<String, String> getDefaultTagValueAsMap() {
- Map<String, String> result = new HashMap<String, String>();
- String tagValuesList = getDefaultTagValue();
- if (tagValuesList != null) {
- String[] tagValues = StringUtil.split(tagValuesList, ",");
- for (String tagValue : tagValues) {
- String[] tagAndValue = StringUtil.split(tagValue, ":");
-
- String tag = tagAndValue[0].trim();
- tag = tag.substring(1, tag.length() - 1); // remove "..."
-
- String value = tagAndValue[1].trim();
- value = value.substring(1, value.length() - 1); // remove "..."
-
- result.put(tag, value);
- }
- }
- return result;
- }
-
- public String getJavadocURL() {
- String result = getOption(Option.JAVADOC_URL.key);
- return result;
- }
-
- public File getBackupDirectory() {
- File result = getOptionAsFile(Option.BACKUP_DIRECTORY.key);
- return result;
- }
-
- public long getStartingTime() {
- return startingTime;
- }
-
- public String getElapsedTimeAsString() {
- long diff = System.nanoTime() - getStartingTime();
- String result = DurationFormatUtils.formatDuration(diff / 1000000, "s'.'S");
- return result;
- }
-
- public File getBackupSessionDirectory() {
- if (backupSessionDirectory == null) {
- // le timestamp est en nano (on le veut en ms)
- long time = getStartingTime() / 1000;
- // creation de l'unique répertoire de backup pour la session
- String path = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new java.util.Date(time));
- backupSessionDirectory = new File(getBackupDirectory(), path);
- if (!backupSessionDirectory.exists()) {
- backupSessionDirectory.mkdirs();
- }
- }
- return backupSessionDirectory;
- }
-
- /**
- * Retourne un class loader contenant le repertoire de compilation
- * Il permet alors de charger des classes qui viennent d'etre compilees
- * dans isis
- * If current thread is in simulation then return specific simulation
- * compilation directory, else default compilation directory
- *
- * @return the class loader adequate
- */
- public ClassLoader getScriptClassLoader() {
- SimulationContext simContext = SimulationContext.get();
- ClassLoader result = simContext.getClassLoader();
- if (result == null) {
- // on est pas dans une simulation, il faut retourner un nouveau
- // a chaque fois. on force la creation d'un nouveau classloader
- // a chaque fois pour
- // que l'ancienne class compiler et charg<E9> ne soit pas presente
- File f = getCompileDirectory();
- try {
- URL[] cp = new URL[]{f.toURI().toURL()};
- // il faut prendre le ClassLoader du thread courant comme parent
- // car pour les simulations il a ete modifi<E9>, et il faut
- // que les classes de script soit recherch<E9> dedans avant
- // la recherche dans le getCompileDirectory().
- // ce qui est le cas avec les URLClassLoader
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
- result = new URLClassLoader(cp, parent);
- } catch (MalformedURLException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.load.classloader", f, eee.getMessage()), eee);
- }
- }
- return result;
- }
-
- /**
- * Surcharge pour la migration des options de config qui ont change de nom
- * <p>
- * TODO: lors du passage en version 4.0 on pourrait supprimer cette methode
- *
- * @param args
- * @throws org.codelutin.util.ArgumentsParserException
- */
- @Override
- public void parse(String[] args) throws ArgumentsParserException {
- super.parse(args);
- // dans la version precedente (3.1) seul le fichier user existe, il est
- // donc le seul a devoir etre modifie
- boolean mustSave = false;
- String[] keys = new String[]{
- "compileDirectory", Option.COMPILATION_DIRECTORY.key,
- "defaultBackupDirectory", Option.BACKUP_DIRECTORY.key,
- "defaultExportDirectory", Option.DEFAULT_EXPORT_DIRECTORY.key,
- "defaultExportNames", Option.DEFAULT_EXPORT_NAMES.key,
- "defaultMapFile", Option.DEFAULT_MAP_FILENAME.key,
- "defaultResultNames", Option.DEFAULT_RESULT_NAMES.key,
- "defaultSimulator", Option.SIMULATOR_CLASSFILE.key,
- "defaultTagValue", Option.DEFAULT_TAG_VALUE.key,
- "javadocURL", Option.JAVADOC_URL.key,
- "locale", Option.LOCALE.key,
- "login", Option.SIMULATOR_USER_NAME.key,
- "password", Option.SIMULATOR_PASSWORD.key,
- "simulationServer", Option.SIMULATOR_SERVER.key,
- "simulationShowOnlyError", Option.SIMULATION_SHOW_ONLY_ERROR.key,
- "simulationShowOnlyQueue", null, // Option.SIMULATION_SHOW_ONLY_QUEUE.key,
- "smtpServer", Option.SMTP_SERVER.key,
- "userMail", Option.USER_MAIL.key,
- "userName", Option.USER_NAME.key,
- "vcs.keyFile", Option.VCS_SSH_KEY_FILE.key,
- "vcs.localDatabasePath", Option.DATABASE_DIRECTORY.key,
- // on supprime car non compatible, les valeurs par defaut sont tres bien
- "localSimulator", null,
- "vcs.databaseVersion", null,
- "vcs.hostName", null,
- "vcs.noPassPhrase", null,
- "vcs.remoteDatabase", null,
- "vcs.remotePath", null,
- "vcs.type", null,
- "vcs.typeRepo", null,
- "vcs.useSshConnexion", null,
- "vcs.userName", null,
- "version", null,
- "projectName", null,
- "simulationReportMail", null,
-
- };
-
- log.info("Check configuration change");
- for(int i=0; i<keys.length;) {
- String oldKey = keys[i++];
- String newKey = keys[i++];
- if (!oldKey.equals(newKey)) {
- String value = getOption(oldKey);
- if (value != null) {
- mustSave = true;
- // quoi qu'il arrive on enleve l'ancienne cle
- homefile.remove(oldKey);
- if (newKey != null) {
- setOption(newKey, value);
- }
- }
- }
- }
- if (mustSave) {
- saveForUser();
- log.info("Config file migration done");
- }
- if (log.isDebugEnabled()) {
- printConfig();
- }
- }
-
- //////////////////////////////////////////////////
- // Toutes les options disponibles
- //////////////////////////////////////////////////
-
- /**
- * Options.
- *
- * Set it protected to force getOption() call.
- */
- protected static enum Option {
-
- COMPILATION_DIRECTORY("compilation.directory", _("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-build"),
- CONFIG_FILE(CONFIG_FILE_NAME, _("isisfish.config.main.configFileName.description"), CONFIG_FILENAME),
- BACKUP_DIRECTORY("backup.directory", _("isisfish.config.main.defaultBackupDirectory.description"), getUserHome() + File.separator + "isis-backup"),
-
- DEFAULT_EXPORT_DIRECTORY("default.export.directory", _("isisfish.config.main.defaultExportDirectory.description"), getUserHome() + File.separator + "isis-export"),
- DEFAULT_EXPORT_NAMES("default.export.names", _("isisfish.config.main.defaultExportNames.description"), ""),
- DEFAULT_RESULT_NAMES("default.result.names", _("isisfish.config.main.defaultResultNames.description"), ""),
- DEFAULT_MAP_FILENAME("default.map.filename", _("isisfish.config.main.defaultMapFile.description"), "maps/vmap_area_thin"),
- DEFAULT_TAG_VALUE("default.tagvalue", _("isisfish.config.main.defaultTagValue.description"), ""),
- ENCODING("encoding", _("isisfish.config.main.encoding.description"), "UTF-8"),
- JAVADOC_URL("javadoc.url", _("isisfish.config.main.javadocURL.description"), "http://isis-fish.labs.libre-entreprise.org/isis-fish/apidocs/"),
-
- SIMULATOR_CLASSFILE("simulator.classfile", _("isisfish.config.main.defaultSimulator.description"), "DefaultSimulator.java"),
- /** prevu pour l'architecture de lancement en plugin: local, isis-server, caparmor, ... */
- SIMULATOR_LAUNCHER(SimulationService.SIMULATION_LAUNCHER + ".localDefault", _("isisfish.config.main.localSimulator.description"), InProcessSimulatorLauncher.class.getName()),
- SIMULATOR_LAUNCHER_SUB(SimulationService.SIMULATION_LAUNCHER + ".subDefault", _("isisfish.config.main.subSimulator.description"), SubProcessSimulationLauncher.class.getName()),
- SIMULATOR_LAUNCHER_REMOTE(SimulationService.SIMULATION_LAUNCHER + ".remoteCaparmor", _("isisfish.config.main.remoteCaparmor.description"), SSHSimulatorLauncher.class.getName()),
-
- SIMULATOR_SERVER("simulation.server", _("isisfish.config.main.simulationServer.description"), "http://simulateur.ifremer.fr:9090"),
- /** le login a utiliser pour les launcher distant, le type du launcher est ajouter a la cle (car 1 login par launcher) */
- SIMULATOR_USER_NAME("simulator.username", _("isisfish.config.main.login.description"), "anonymous"),
- SIMULATOR_PASSWORD("simulator.password", _("isisfish.config.main.password.description"), "guest"),
-
- /** Serveur accessible par ssh : address */
- SIMULATOR_SSH_SERVER("simulation.ssh.server", _("isisfish.config.main.simulation.ssh.server.description"), "caparmor.ifremer.fr:22"),
- /** Serveur accessible par ssh : login */
- SIMULATOR_SSH_USER_NAME("simulation.ssh.username", _("isisfish.config.main.simulation.ssh.login.description"), "isisfish"),
- /** Serveur accessible par ssh : remote data path */
- SIMULATOR_SSH_DATAPATH("simulation.ssh.datapath", _("isisfish.config.main.simulation.ssh.datapath.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-database-3"),
- /** Serveur accessible par ssh : remote isis home install */
- SIMULATOR_SSH_ISIS_HOME("simulation.ssh.isis.home", _("isisfish.config.main.simulation.ssh.isis.home.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-fish"),
- /** Serveur accessible par ssh : remote tmp path */
- SIMULATOR_SSH_TMPPATH("simulation.ssh.tmppath", _("isisfish.config.main.simulation.ssh.tmppath.description"), "/tmp"),
- /** Serveur accessible par SSH : chemin pour executer le script d'ajout des script dans la queue */
- SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND("simulation.ssh.addscripttoqueuecommand", _("isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description"), "/usr/pbs/bin/qsub"),
- /** Serveur accessible par SSH : interval de check du fichier de control */
- SIMULATOR_SSH_CONTROLCHECKINTERVAL("simulation.ssh.control.check.interval", _("isisfish.config.main.simulation.ssh.control.check.interval.description"), "5"),
-
- LOCALE("locale", _("isisfish.config.main.locale.description"), "fr_FR"),
- // REGION_MAP("regionMap", _("isisfish.config.main.regionMap.description"), "maps"),
- // RESULT_EXPORT("resultExport", String.class, 15, n_("isisfish.config.main.resultExport.description"), "resultExports"),
- SIMULATION_SHOW_ONLY_ERROR("simulationShowOnlyError", _("isisfish.config.main.simulationShowOnlyError.description"), "false"),
- // SIMULATION_SHOW_ONLY_QUEUE("simulationShowOnlyQueue", _("isisfish.config.main.simulationShowOnlyQueue.description"), "true"),
-
- // if false no graphical interface
- LAUNCH_UI("launch.ui", _("isisfish.config.main.launchUI.description"), "true"),
-
- DATABASE_DIRECTORY("database.directory", _("isisfish.config.vcs.localDatabasePath.description"), getUserHome() + File.separator + "isis-database-3"),
-
- // TODO remove duplicated ssh key configuration
- SSH_KEY_FILE("ssh.key.file", _("isisfish.config.vcs.keyFile.description"), getUserHome() + File.separator + ".ssh" + File.separator + "isis_rsa"),
- SSH_PASSPHRASE_ENABLED("ssh.passphrase.enabled", _("isisfish.config.vcs.noPassPhrase.description"), "false"),
- SSH_PASSPHRASE("ssh.passphrase", _("isisfish.config.vcs.passphrase.description"), ""),
-
- // can be None, CVS or SVN. only None or SVN work
- VCS_TYPE(VCS.VCS_TYPE, _("isisfish.config.vcs.type.description"), VCS.TYPE_SVN),
- // depend of VCS_TYPE, for SVN can be svn, svn+ssh, http or file
- VCS_PROTOCOLE(VCS.VCS_PROTOCOLE, _("isisfish.config.vcs.useSshConnexion.description"), "svn"),
- VCS_SSH_KEY_FILE(VCS.VCS_SSH_KEY_FILE, _("isisfish.config.vcs.keyFile.description"), getUserHome() + File.separator + ".ssh" + File.separator + "isis_rsa"),
- // user login to access vcs
- VCS_USER_NAME(VCS.VCS_USER_NAME, _("isisfish.config.vcs.userName.description"), ""),
- VCS_USER_PASSWORD(VCS.VCS_USER_PASSWORD, _("isisfish.config.vcs.userPassword.description"), ""),
- VCS_HOST_NAME(VCS.VCS_HOST_NAME, _("isisfish.config.vcs.hostName.description"), "labs.libre-entreprise.org"),
- VCS_PATH(VCS.VCS_PATH, _("isisfish.config.vcs.remotePath.description"), "/svnroot/isis-fish-data/"),
- // VCS_TAG(VCS.VCS_TAG, _("isisfish.config.vcs.remoteDatabase.description"), "/trunk"),
- // TYPE_REPO_PROPERTY_KEY = newConfigPropertyKey("typeRepo", VCSTypeRepo.class, 9, n_("isisfish.config.vcs.typeRepo.description"), "TAG"),
- // PROJECT_NAME_PROPERTY_KEY = newConfigPropertyKey("projectName", String.class, 11, n_("isisfish.config.main.projectName.description"), "Isis-Fish"),
-
- USER_NAME("user.name", _("isisfish.config.main.userName.description"), System.getProperty("user.name")),
- SMTP_SERVER("smtpServer", _("isisfish.config.main.smtpServer.description"), "smtp"),
- USER_MAIL("userMail", _("isisfish.config.main.userMail.description"), USER_NAME.key + "@" + VCS_HOST_NAME.key);
-
- public final String key;
- public final String description;
- public final String defaultValue;
-
- private Option(String key, String description, String defaultValue) {
- this.key = key;
- this.description = description;
- this.defaultValue = defaultValue;
- }
- }
-
- //////////////////////////////////////////////////
- // Toutes les actions disponibles
- //////////////////////////////////////////////////
-
- static public enum Step {
- AfterInit, AfterInitVCS, AfterUI, BeforeExit
- }
-
- public static enum Action {
- HELP(_("Show help"), OtherAction.class.getName() + "#help", "-h", "--help"),
-
- IMPORT_ANALYSE_PLAN(_(""), ImportAction.class.getName() + "#importAnalysePlan", "--importAnalysePlan"),
- IMPORT_EXPORT(_(""), ImportAction.class.getName() + "#importExport", "--importExport"),
- IMPORT_RULE(_(""), ImportAction.class.getName() + "#importRule", "--importRule"),
- IMPORT_SCRIPT(_("Import one java file script source"), ImportAction.class.getName() + "#importScript", "--importScript"),
- IMPORT_SIMULATOR(_(""), ImportAction.class.getName() + "#importSimulator", "--importSimulator"),
- IMPORT_FORMULA(_(""), ImportAction.class.getName() + "#importFormula", "--importFormula"),
- IMPORT_REGION(_(""), ImportAction.class.getName() + "#importRegion", "--importRegion"),
- IMPORT_REGION_AND_RENAME(_(""), ImportAction.class.getName() + "#importRegionAndRename", "--importRegionAndRename"),
- IMPORT_SIMULATION(_(""), ImportAction.class.getName() + "#importSimulation", "--importSimulation"),
- IMPORT_SCRIPT_MODULE(_("Import zipped file containing all scripts directory structure"), ImportAction.class.getName() + "#importScriptModule", "--importScriptModule"),
-
- LIST_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#listAnalysePlan", "--listAnalysePlan"),
- LIST_EXPORT(_(""), ExportAction.class.getName() + "#listExport", "--listExport"),
- LIST_RULE(_(""), ExportAction.class.getName() + "#listRule", "--listRule"),
- LIST_SCRIPT(_(""), ExportAction.class.getName() + "#listScript", "--listScript"),
- LIST_SIMULATOR(_(""), ExportAction.class.getName() + "#listSimulator", "--listSimulator"),
- LIST_FORMULA(_(""), ExportAction.class.getName() + "#listFormula", "--listFormula"),
- LIST_REGION(_(""), ExportAction.class.getName() + "#listRegion", "--listRegion"),
- LIST_SIMULATION(_(""), ExportAction.class.getName() + "#listSimulation", "--listSimulation"),
-
- EXPORT_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#exportAnalysePlan", "--exportAnalysePlan"),
- EXPORT_EXPORT(_(""), ExportAction.class.getName() + "#exportExport", "--exportExport"),
- EXPORT_RULE(_(""), ExportAction.class.getName() + "#exportRule", "--exportRule"),
- EXPORT_SCRIPT(_(""), ExportAction.class.getName() + "#exportScript", "--exportScript"),
- EXPORT_SIMULATOR(_(""), ExportAction.class.getName() + "#exportSimulator", "--exportSimulator"),
- EXPORT_FORMULA(_(""), ExportAction.class.getName() + "#exportFormula", "--exportFormula"),
- EXPORT_REGION(_(""), ExportAction.class.getName() + "#exportRegion", "--exportRegion"),
- EXPORT_SIMULATION(_(""), ExportAction.class.getName() + "#exportSimulation", "--exportSimulation"),
-
- VCS_SSH_CREATE_KEY(_(""), VCSAction.class.getName() + "#sshCreateKey", "--sshCreateKey"),
- VCS_UPDATE(_(""), VCSAction.class.getName() + "#vcsUpdate", "--vcsUpdate"),
- VCS_ADD(_(""), VCSAction.class.getName() + "#vcsAdd", "--vcsAdd"),
- VCS_REMOVE(_(""), VCSAction.class.getName() + "#vcsRemove", "--vcsRemove"),
- VCS_COMMIT(_(""), VCSAction.class.getName() + "#vcsCommit", "--vcsCommit"),
-
- SIMULATE_WITH_REGION(_(""), SimulationAction.class.getName() + "#simulateWithRegion", "--simulateWithRegion"),
- SIMULATE_WITH_SIMULATION(_(""), SimulationAction.class.getName() + "#simulateWithSimulation", "--simulateWithSimulation"),
- SIMULATE_WITH_SIMULATION_AND_SCRIPT(_(""), SimulationAction.class.getName() + "#simulateWithSimulationAndScript", "--simulateWithSimulationAndScript"),
- ;
-
- public String description;
- public String action;
- public String[] aliases;
-
- private Action(String description, String action, String ... aliases) {
- this.description = description;
- this.action = action;
- this.aliases = aliases;
- }
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,818 @@
+/* *##%
+ * 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
+ * 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;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+import org.codelutin.util.ArgumentsParserException;
+import org.codelutin.util.StringUtil;
+import org.codelutin.util.VersionNumber;
+
+import fr.ifremer.isisfish.actions.ExportAction;
+import fr.ifremer.isisfish.actions.ImportAction;
+import fr.ifremer.isisfish.actions.OtherAction;
+import fr.ifremer.isisfish.actions.SimulationAction;
+import fr.ifremer.isisfish.actions.VCSAction;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher;
+import fr.ifremer.isisfish.simulator.launcher.SimulationService;
+import fr.ifremer.isisfish.simulator.launcher.SSHSimulatorLauncher;
+import fr.ifremer.isisfish.simulator.launcher.SubProcessSimulationLauncher;
+import fr.ifremer.isisfish.vcs.VCS;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision: 1310 $
+ *
+ * Last update: $Date: 2008-08-23 00:46:00 +0200 (Sat, 23 Aug 2008) $
+ * by : $Author: bpoussin $
+ */
+public class IsisConfig extends ApplicationConfig {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(IsisConfig.class);
+
+ /**
+ * La version du logiciel constitue de l.d.a.r
+ * <li>l: le numero de version du logiciel
+ * <li>d: le numero de version du schema de la base de donnees
+ * <li>a: le numero de version de l'api des scripts
+ * <li>r: le numero de version de de l'interface graphique ou autre modif mineur
+ * <p>
+ * lors de l'increment de l, d, a et r sont remis a 0
+ * lors de l'increment de d, a et r sont remis a 0
+ * lors de l'increment de a, r est remis a 0
+ * <p>
+ * Un changement d'UI ne modifie jamais le numero de version de database
+ * Un changement de schema de base pour lequel on ne peut pas faire de
+ * migration de donnees demande automatiquement un changement de version
+ * d'application.
+ */
+ protected final static VersionNumber version = new VersionNumber(3, 2, 0, 4);
+ protected final static VersionNumber databaseVersion = new VersionNumber(
+ version.getNumber(0), version.getNumber(1));
+ protected final static VersionNumber apiVersion = new VersionNumber(
+ version.getNumber(0), version.getNumber(1), version.getNumber(2));
+
+ public static VersionNumber getVersionNumber() {
+ return version;
+ }
+
+ /**
+ * le nombre global ex: 3.2.0.0
+ * @return
+ */
+ static public String getVersion() {
+ String result = version.toString();
+ return result;
+ }
+
+ /**
+ * La version de la base ex: 3.2
+ * @return
+ */
+ public static VersionNumber getDatabaseVersion() {
+ return databaseVersion;
+ }
+
+ /**
+ * La version de l'api de programmation ex: 3.2.0
+ * @return
+ */
+ public static VersionNumber getApiVersion() {
+ return apiVersion;
+ }
+
+ static final public String COPYRIGHT_TEXT = "Version " + getVersion() + " IFREMER-MAERHA © 2000-2009";
+ static final public String CONFIG_FILENAME = "isis-config-" + version.getNumber(0);
+
+ /** separateur de liste */
+ static final public String SEP = ",";
+ static final public String REPORT_EMAIL = "isis-fish-bugreport at lists.labs.libre-entreprise.org";
+
+ protected transient File backupSessionDirectory = null;
+ protected long startingTime = System.nanoTime();
+
+ public IsisConfig() {
+
+ for (Option o : Option.values()) {
+ setDefaultOption(o.key, o.defaultValue);
+ }
+
+ for (Action a : Action.values()) {
+ for (String alias : a.aliases) {
+ addActionAlias(alias, a.action);
+ }
+ }
+
+ }
+
+ //////////////////////////////////////////////////
+ // Methode d'acces aux options
+ //////////////////////////////////////////////////
+
+ /**
+ * Retourne le repertoire racine de toutes les donnees (script, simulation
+ * region, ...)
+ * @return
+ */
+ public File getDatabaseDirectory() {
+ File result = getOptionAsFile(Option.DATABASE_DIRECTORY.key);
+ return result;
+ }
+
+ /**
+ * Retourne le repertoire ou sont stockes les scripts compiles.
+ *
+ * Create directory if not exists.
+ *
+ * @return compilation directory
+ */
+ public File getCompileDirectory() {
+ File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ /**
+ * Get javadoc directory.
+ *
+ * Create directory if not exists.
+ *
+ * @return javadoc directory
+ */
+ public File getJavadocDirectory() {
+ File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ /**
+ * Retourne l'objet {@link Locale} a utilise pour la langue.
+ *
+ * @return application {@link Locale}
+ */
+ public Locale getLocale() {
+ String value = getOption(Option.LOCALE.key);
+ Locale result = (Locale)ConvertUtils.convert(value, Locale.class);
+ return result;
+ }
+
+ /**
+ * Retourne l'encoding a utiliser pour les fichiers textes
+ * @return
+ */
+ public String getEncoding() {
+ String result = getOption(Option.ENCODING.key);
+ return result;
+ }
+
+ /**
+ * Retourne le serveur SMTP a utiliser pour l'envoie de mail
+ * @return
+ */
+ public String getSmtpServer() {
+ String result = getOption(Option.SMTP_SERVER.key);
+ return result;
+ }
+
+ /**
+ * Retourne le nom usuel de l'utilisateur
+ * @return
+ */
+ public String getUserName() {
+ String result = getOption(Option.USER_NAME.key);
+ return result;
+ }
+
+ /**
+ * Retourne l'email de l'utilisateur
+ * @return
+ */
+ public String getUserMail() {
+ String result = getOption(Option.USER_MAIL.key);
+ return result;
+ }
+
+ /**
+ * Retourne l'url du serveur de simulation
+ * @return simulator server
+ */
+ public String getSimulatorServer() {
+ String result = getOption(Option.SIMULATOR_SERVER.key);
+ return result;
+ }
+
+ /**
+ * Retourne le login pour acceder au serveur de simulation
+ * @return simulator username
+ */
+ public String getSimulatorUsername() {
+ String result = getOption(Option.SIMULATOR_USER_NAME.key);
+ return result;
+ }
+
+ /**
+ * Retourne le mot de passe pour acceder au serveur de simulation
+ * @return simulator password
+ */
+ public String getSimulatorPassword() {
+ String result = getOption(Option.SIMULATOR_PASSWORD.key);
+ return result;
+ }
+
+ public String getSimulatorClassfile() {
+ String result = getOption(Option.SIMULATOR_CLASSFILE.key);
+ return result;
+ }
+
+ public void setSimulatorClassfile(String value) {
+ setOption(Option.SIMULATOR_CLASSFILE.key, value);
+ }
+
+ /**
+ * Retourne l'url du serveur de simulation accessible via SSH.
+ *
+ * @return simulator server
+ */
+ public String getSimulatorSshServer() {
+ String result = getOption(Option.SIMULATOR_SSH_SERVER.key);
+ return result;
+ }
+
+ /**
+ * Retourne le login pour acceder au serveur de simulation accessible via SSH.
+ *
+ * @return simulator username
+ */
+ public String getSimulatorSshUsername() {
+ String result = getOption(Option.SIMULATOR_SSH_USER_NAME.key);
+ return result;
+ }
+
+ /**
+ * Retourne le chemin relatif ou abs du repertoire
+ * root des données d'isis.
+ *
+ * @return simulator data path
+ */
+ public String getSimulatorSshDataPath() {
+ String result = getOption(Option.SIMULATOR_SSH_DATAPATH.key);
+ return result;
+ }
+
+ /**
+ * Retourne le chemin distant ou est installé isis.
+ *
+ * @return remote isis home
+ */
+ public String getSimulatorSshIsisHome() {
+ String result = getOption(Option.SIMULATOR_SSH_ISIS_HOME.key);
+ return result;
+ }
+
+ /**
+ * Retourne l'emplacement du dossier temporaire distant.
+ *
+ * Ce dossier doit être ABSOLUT.
+ *
+ * @return tmp dir
+ */
+ public String getSimulatorSshTmpPath() {
+ String result = getOption(Option.SIMULATOR_SSH_TMPPATH.key);
+ return result;
+ }
+
+ /**
+ * Retourne la commande a utiliser pour ajouter
+ * le script à la queue des simulation.
+ *
+ * @return add to queue command
+ */
+ public String getSimulatorSshAddToQueueCommand() {
+ String result = getOption(Option.SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND.key);
+ return result;
+ }
+
+ /**
+ * Retourne l'interval de temps a utiliser
+ * pour recuperer le fichier de control.
+ *
+ * @return time (in seconds)
+ */
+ public long getSimulatorSshControlCheckInterval() {
+ int result = getOptionAsInt(Option.SIMULATOR_SSH_CONTROLCHECKINTERVAL.key);
+ return result;
+ }
+
+ /**
+ * Retourne la clé privée de l'utilisteur courant.
+ *
+ * @return private ssh key path
+ */
+ public File getSSHPrivateKeyFilePath() {
+ File result = getOptionAsFile(Option.SSH_KEY_FILE.key);
+ return result;
+ }
+
+ /*
+ * Le type de simulation par defaut a utiliser (local, remote, ...)
+ * @return
+ *)
+ public boolean isSimulatorLocal() {
+ // FIXME never called
+ String value = getOption(Option.SIMULATOR_LAUNCHER.key);
+ // and following code always return false :
+ boolean result = "local".equalsIgnoreCase(value);
+ return result;
+ }*/
+
+ /*public boolean isUseVCS() {
+ String value = getOption(Option.VCS_TYPE.key);
+ boolean result = !VCSNone.TYPE_NONE.equals(value);
+ return result;
+ }*/
+
+ public boolean isLaunchUI() {
+ boolean result = getOptionAsBoolean(Option.LAUNCH_UI.key);
+ return result;
+ }
+
+ public void setSimulatorLauncher(String value) {
+ setOption(Option.SIMULATOR_LAUNCHER.key, value);
+ }
+
+// public boolean isSimulationShowOnlyQueue() {
+// Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_QUEUE.key);
+// return result;
+// }
+
+ public boolean isSimulationShowOnlyError() {
+ Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_ERROR.key);
+ return result;
+ }
+
+ public File getDefaultExportDirectory() {
+ File result = getOptionAsFile(Option.DEFAULT_EXPORT_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ public void setDefaultExportDirectory(String value) {
+ setOption(Option.DEFAULT_EXPORT_DIRECTORY.key, value);
+ }
+
+ public String getDefaultExportNames() {
+ String result = getOption(Option.DEFAULT_EXPORT_NAMES.key);
+ return result;
+ }
+
+ public void setDefaultExportNames(List<String> exportNames) {
+ StringBuilder sb = new StringBuilder();
+ for (String exportName : exportNames) {
+ sb.append(SEP).append(exportName);
+ }
+ String value = sb.toString().substring(1);
+ setOption(Option.DEFAULT_EXPORT_NAMES.key, value);
+ saveForUser();
+ }
+
+ /**
+ * @return la liste des noms d'exports par defaut sous forme de liste,
+ * a partir de la propriete {@link Option#DEFAULT_EXPORT_NAMES}
+ * ou null si ils n'ont jamais ete sauves par l'utilisateur.
+ * by user.
+ * @see Option#DEFAULT_EXPORT_NAMES
+ */
+ public List<String> getDefaultExportNamesAsList() {
+ List<String> result = null;
+ String exportNamesList = getDefaultExportNames();
+ if (exportNamesList != null) {
+ result = new ArrayList<String>();
+ String[] exportNames = StringUtil.split(exportNamesList, ",");
+ result.addAll(Arrays.asList(exportNames));
+ }
+ return result;
+ }
+
+ public String getDefaultMapFilename() {
+ String result = getOption(Option.DEFAULT_MAP_FILENAME.key);
+ return result;
+ }
+
+ public String getDefaultResultNames() {
+ String result = getOption(Option.DEFAULT_RESULT_NAMES.key);
+ return result;
+ }
+
+ public void setDefaultResultNames(List<String> resultNames) {
+ StringBuilder sb = new StringBuilder();
+ for (String resultName : resultNames) {
+ sb.append(SEP).append(resultName);
+ }
+ String value = sb.toString().substring(1);
+ setOption(Option.DEFAULT_RESULT_NAMES.key, value);
+ saveForUser();
+ }
+
+ /**
+ * @return les resultats par defaut d'une simulation sous forme de liste
+ * a partir de la propriete {@link Option#DEFAULT_RESULT_NAMES}
+ * @see Option#DEFAULT_RESULT_NAMES
+ */
+ public List<String> getDefaultResultNamesAsList() {
+ List<String> result = null;
+ String resultNamesList = getDefaultResultNames();
+ if (resultNamesList != null) {
+ result = new ArrayList<String>();
+ String[] resultNames = StringUtil.split(resultNamesList, ",");
+ result.addAll(Arrays.asList(resultNames));
+ }
+ return result;
+ }
+
+ public String getDefaultTagValue() {
+ String result = getOption(Option.DEFAULT_TAG_VALUE.key);
+ return result;
+ }
+
+ public void setDefaultTagValues(Map<String, String> tagValues) {
+ StringBuilder sb = new StringBuilder(" ");
+ for (Map.Entry<String, String> entry : tagValues.entrySet()) {
+ sb.append(SEP).append('"').append(entry.getKey()).append("\":\"").append(entry.getValue()).append('"');
+ }
+ String value = sb.toString().trim();
+ setOption(Option.DEFAULT_TAG_VALUE.key, value.isEmpty() ? "" : value.substring(1));
+ saveForUser();
+ }
+
+
+
+ /**
+ * @return le dictionnaire des tags par defaut d'une simulation a partir
+ * de la propriete {@link Option#DEFAULT_TAG_VALUE}
+ * @see Option#DEFAULT_TAG_VALUE
+ */
+ public Map<String, String> getDefaultTagValueAsMap() {
+ Map<String, String> result = new HashMap<String, String>();
+ String tagValuesList = getDefaultTagValue();
+ if (tagValuesList != null) {
+ String[] tagValues = StringUtil.split(tagValuesList, ",");
+ for (String tagValue : tagValues) {
+ String[] tagAndValue = StringUtil.split(tagValue, ":");
+
+ String tag = tagAndValue[0].trim();
+ tag = tag.substring(1, tag.length() - 1); // remove "..."
+
+ String value = tagAndValue[1].trim();
+ value = value.substring(1, value.length() - 1); // remove "..."
+
+ result.put(tag, value);
+ }
+ }
+ return result;
+ }
+
+ public String getJavadocURL() {
+ String result = getOption(Option.JAVADOC_URL.key);
+ return result;
+ }
+
+ public File getBackupDirectory() {
+ File result = getOptionAsFile(Option.BACKUP_DIRECTORY.key);
+ return result;
+ }
+
+ public long getStartingTime() {
+ return startingTime;
+ }
+
+ public String getElapsedTimeAsString() {
+ long diff = System.nanoTime() - getStartingTime();
+ String result = DurationFormatUtils.formatDuration(diff / 1000000, "s'.'S");
+ return result;
+ }
+
+ public File getBackupSessionDirectory() {
+ if (backupSessionDirectory == null) {
+ // le timestamp est en nano (on le veut en ms)
+ long time = getStartingTime() / 1000;
+ // creation de l'unique répertoire de backup pour la session
+ String path = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new java.util.Date(time));
+ backupSessionDirectory = new File(getBackupDirectory(), path);
+ if (!backupSessionDirectory.exists()) {
+ backupSessionDirectory.mkdirs();
+ }
+ }
+ return backupSessionDirectory;
+ }
+
+ /**
+ * Retourne un class loader contenant le repertoire de compilation
+ * Il permet alors de charger des classes qui viennent d'etre compilees
+ * dans isis
+ * If current thread is in simulation then return specific simulation
+ * compilation directory, else default compilation directory
+ *
+ * @return the class loader adequate
+ */
+ public ClassLoader getScriptClassLoader() {
+ SimulationContext simContext = SimulationContext.get();
+ ClassLoader result = simContext.getClassLoader();
+ if (result == null) {
+ // on est pas dans une simulation, il faut retourner un nouveau
+ // a chaque fois. on force la creation d'un nouveau classloader
+ // a chaque fois pour
+ // que l'ancienne class compiler et charg<E9> ne soit pas presente
+ File f = getCompileDirectory();
+ try {
+ URL[] cp = new URL[]{f.toURI().toURL()};
+ // il faut prendre le ClassLoader du thread courant comme parent
+ // car pour les simulations il a ete modifi<E9>, et il faut
+ // que les classes de script soit recherch<E9> dedans avant
+ // la recherche dans le getCompileDirectory().
+ // ce qui est le cas avec les URLClassLoader
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ result = new URLClassLoader(cp, parent);
+ } catch (MalformedURLException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.error.load.classloader", f, eee.getMessage()), eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Surcharge pour la migration des options de config qui ont change de nom
+ * <p>
+ * TODO: lors du passage en version 4.0 on pourrait supprimer cette methode
+ *
+ * @param args
+ * @throws org.codelutin.util.ArgumentsParserException
+ */
+ @Override
+ public void parse(String[] args) throws ArgumentsParserException {
+ super.parse(args);
+ // dans la version precedente (3.1) seul le fichier user existe, il est
+ // donc le seul a devoir etre modifie
+ boolean mustSave = false;
+ String[] keys = new String[]{
+ "compileDirectory", Option.COMPILATION_DIRECTORY.key,
+ "defaultBackupDirectory", Option.BACKUP_DIRECTORY.key,
+ "defaultExportDirectory", Option.DEFAULT_EXPORT_DIRECTORY.key,
+ "defaultExportNames", Option.DEFAULT_EXPORT_NAMES.key,
+ "defaultMapFile", Option.DEFAULT_MAP_FILENAME.key,
+ "defaultResultNames", Option.DEFAULT_RESULT_NAMES.key,
+ "defaultSimulator", Option.SIMULATOR_CLASSFILE.key,
+ "defaultTagValue", Option.DEFAULT_TAG_VALUE.key,
+ "javadocURL", Option.JAVADOC_URL.key,
+ "locale", Option.LOCALE.key,
+ "login", Option.SIMULATOR_USER_NAME.key,
+ "password", Option.SIMULATOR_PASSWORD.key,
+ "simulationServer", Option.SIMULATOR_SERVER.key,
+ "simulationShowOnlyError", Option.SIMULATION_SHOW_ONLY_ERROR.key,
+ "simulationShowOnlyQueue", null, // Option.SIMULATION_SHOW_ONLY_QUEUE.key,
+ "smtpServer", Option.SMTP_SERVER.key,
+ "userMail", Option.USER_MAIL.key,
+ "userName", Option.USER_NAME.key,
+ "vcs.keyFile", Option.VCS_SSH_KEY_FILE.key,
+ "vcs.localDatabasePath", Option.DATABASE_DIRECTORY.key,
+ // on supprime car non compatible, les valeurs par defaut sont tres bien
+ "localSimulator", null,
+ "vcs.databaseVersion", null,
+ "vcs.hostName", null,
+ "vcs.noPassPhrase", null,
+ "vcs.remoteDatabase", null,
+ "vcs.remotePath", null,
+ "vcs.type", null,
+ "vcs.typeRepo", null,
+ "vcs.useSshConnexion", null,
+ "vcs.userName", null,
+ "version", null,
+ "projectName", null,
+ "simulationReportMail", null,
+
+ };
+
+ log.info("Check configuration change");
+ for(int i=0; i<keys.length;) {
+ String oldKey = keys[i++];
+ String newKey = keys[i++];
+ if (!oldKey.equals(newKey)) {
+ String value = getOption(oldKey);
+ if (value != null) {
+ mustSave = true;
+ // quoi qu'il arrive on enleve l'ancienne cle
+ homefile.remove(oldKey);
+ if (newKey != null) {
+ setOption(newKey, value);
+ }
+ }
+ }
+ }
+ if (mustSave) {
+ saveForUser();
+ log.info("Config file migration done");
+ }
+ if (log.isDebugEnabled()) {
+ printConfig();
+ }
+ }
+
+ //////////////////////////////////////////////////
+ // Toutes les options disponibles
+ //////////////////////////////////////////////////
+
+ /**
+ * Options.
+ *
+ * Set it protected to force getOption() call.
+ */
+ protected static enum Option {
+
+ COMPILATION_DIRECTORY("compilation.directory", _("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-build"),
+ JAVADOC_DIRECTORY("javadoc.directory", _("isisfish.config.main.javadocDirectory.description"), getUserHome() + File.separator + "isis-docs"),
+ CONFIG_FILE(CONFIG_FILE_NAME, _("isisfish.config.main.configFileName.description"), CONFIG_FILENAME),
+ BACKUP_DIRECTORY("backup.directory", _("isisfish.config.main.defaultBackupDirectory.description"), getUserHome() + File.separator + "isis-backup"),
+
+ DEFAULT_EXPORT_DIRECTORY("default.export.directory", _("isisfish.config.main.defaultExportDirectory.description"), getUserHome() + File.separator + "isis-export"),
+ DEFAULT_EXPORT_NAMES("default.export.names", _("isisfish.config.main.defaultExportNames.description"), ""),
+ DEFAULT_RESULT_NAMES("default.result.names", _("isisfish.config.main.defaultResultNames.description"), ""),
+ DEFAULT_MAP_FILENAME("default.map.filename", _("isisfish.config.main.defaultMapFile.description"), "maps/vmap_area_thin"),
+ DEFAULT_TAG_VALUE("default.tagvalue", _("isisfish.config.main.defaultTagValue.description"), ""),
+ ENCODING("encoding", _("isisfish.config.main.encoding.description"), "UTF-8"),
+ JAVADOC_URL("javadoc.url", _("isisfish.config.main.javadocURL.description"), "http://isis-fish.labs.libre-entreprise.org/isis-fish/apidocs/"),
+
+ SIMULATOR_CLASSFILE("simulator.classfile", _("isisfish.config.main.defaultSimulator.description"), "DefaultSimulator.java"),
+ /** prevu pour l'architecture de lancement en plugin: local, isis-server, caparmor, ... */
+ SIMULATOR_LAUNCHER(SimulationService.SIMULATION_LAUNCHER + ".localDefault", _("isisfish.config.main.localSimulator.description"), InProcessSimulatorLauncher.class.getName()),
+ SIMULATOR_LAUNCHER_SUB(SimulationService.SIMULATION_LAUNCHER + ".subDefault", _("isisfish.config.main.subSimulator.description"), SubProcessSimulationLauncher.class.getName()),
+ SIMULATOR_LAUNCHER_REMOTE(SimulationService.SIMULATION_LAUNCHER + ".remoteCaparmor", _("isisfish.config.main.remoteCaparmor.description"), SSHSimulatorLauncher.class.getName()),
+
+ SIMULATOR_SERVER("simulation.server", _("isisfish.config.main.simulationServer.description"), "http://simulateur.ifremer.fr:9090"),
+ /** le login a utiliser pour les launcher distant, le type du launcher est ajouter a la cle (car 1 login par launcher) */
+ SIMULATOR_USER_NAME("simulator.username", _("isisfish.config.main.login.description"), "anonymous"),
+ SIMULATOR_PASSWORD("simulator.password", _("isisfish.config.main.password.description"), "guest"),
+
+ /** Serveur accessible par ssh : address */
+ SIMULATOR_SSH_SERVER("simulation.ssh.server", _("isisfish.config.main.simulation.ssh.server.description"), "caparmor.ifremer.fr:22"),
+ /** Serveur accessible par ssh : login */
+ SIMULATOR_SSH_USER_NAME("simulation.ssh.username", _("isisfish.config.main.simulation.ssh.login.description"), "isisfish"),
+ /** Serveur accessible par ssh : remote data path */
+ SIMULATOR_SSH_DATAPATH("simulation.ssh.datapath", _("isisfish.config.main.simulation.ssh.datapath.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-database-3"),
+ /** Serveur accessible par ssh : remote isis home install */
+ SIMULATOR_SSH_ISIS_HOME("simulation.ssh.isis.home", _("isisfish.config.main.simulation.ssh.isis.home.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-fish"),
+ /** Serveur accessible par ssh : remote tmp path */
+ SIMULATOR_SSH_TMPPATH("simulation.ssh.tmppath", _("isisfish.config.main.simulation.ssh.tmppath.description"), "/tmp"),
+ /** Serveur accessible par SSH : chemin pour executer le script d'ajout des script dans la queue */
+ SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND("simulation.ssh.addscripttoqueuecommand", _("isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description"), "/usr/pbs/bin/qsub"),
+ /** Serveur accessible par SSH : interval de check du fichier de control */
+ SIMULATOR_SSH_CONTROLCHECKINTERVAL("simulation.ssh.control.check.interval", _("isisfish.config.main.simulation.ssh.control.check.interval.description"), "5"),
+
+ LOCALE("locale", _("isisfish.config.main.locale.description"), "fr_FR"),
+ // REGION_MAP("regionMap", _("isisfish.config.main.regionMap.description"), "maps"),
+ // RESULT_EXPORT("resultExport", String.class, 15, n_("isisfish.config.main.resultExport.description"), "resultExports"),
+ SIMULATION_SHOW_ONLY_ERROR("simulationShowOnlyError", _("isisfish.config.main.simulationShowOnlyError.description"), "false"),
+ // SIMULATION_SHOW_ONLY_QUEUE("simulationShowOnlyQueue", _("isisfish.config.main.simulationShowOnlyQueue.description"), "true"),
+
+ // if false no graphical interface
+ LAUNCH_UI("launch.ui", _("isisfish.config.main.launchUI.description"), "true"),
+
+ DATABASE_DIRECTORY("database.directory", _("isisfish.config.vcs.localDatabasePath.description"), getUserHome() + File.separator + "isis-database-3"),
+
+ // TODO remove duplicated ssh key configuration
+ SSH_KEY_FILE("ssh.key.file", _("isisfish.config.vcs.keyFile.description"), getUserHome() + File.separator + ".ssh" + File.separator + "isis_rsa"),
+ SSH_PASSPHRASE_ENABLED("ssh.passphrase.enabled", _("isisfish.config.vcs.noPassPhrase.description"), "false"),
+ SSH_PASSPHRASE("ssh.passphrase", _("isisfish.config.vcs.passphrase.description"), ""),
+
+ // can be None, CVS or SVN. only None or SVN work
+ VCS_TYPE(VCS.VCS_TYPE, _("isisfish.config.vcs.type.description"), VCS.TYPE_SVN),
+ // depend of VCS_TYPE, for SVN can be svn, svn+ssh, http or file
+ VCS_PROTOCOLE(VCS.VCS_PROTOCOLE, _("isisfish.config.vcs.useSshConnexion.description"), "svn"),
+ VCS_SSH_KEY_FILE(VCS.VCS_SSH_KEY_FILE, _("isisfish.config.vcs.keyFile.description"), getUserHome() + File.separator + ".ssh" + File.separator + "isis_rsa"),
+ // user login to access vcs
+ VCS_USER_NAME(VCS.VCS_USER_NAME, _("isisfish.config.vcs.userName.description"), ""),
+ VCS_USER_PASSWORD(VCS.VCS_USER_PASSWORD, _("isisfish.config.vcs.userPassword.description"), ""),
+ VCS_HOST_NAME(VCS.VCS_HOST_NAME, _("isisfish.config.vcs.hostName.description"), "labs.libre-entreprise.org"),
+ VCS_PATH(VCS.VCS_PATH, _("isisfish.config.vcs.remotePath.description"), "/svnroot/isis-fish-data/"),
+ // VCS_TAG(VCS.VCS_TAG, _("isisfish.config.vcs.remoteDatabase.description"), "/trunk"),
+ // TYPE_REPO_PROPERTY_KEY = newConfigPropertyKey("typeRepo", VCSTypeRepo.class, 9, n_("isisfish.config.vcs.typeRepo.description"), "TAG"),
+ // PROJECT_NAME_PROPERTY_KEY = newConfigPropertyKey("projectName", String.class, 11, n_("isisfish.config.main.projectName.description"), "Isis-Fish"),
+
+ USER_NAME("user.name", _("isisfish.config.main.userName.description"), System.getProperty("user.name")),
+ SMTP_SERVER("smtpServer", _("isisfish.config.main.smtpServer.description"), "smtp"),
+ USER_MAIL("userMail", _("isisfish.config.main.userMail.description"), USER_NAME.key + "@" + VCS_HOST_NAME.key);
+
+ public final String key;
+ public final String description;
+ public final String defaultValue;
+
+ private Option(String key, String description, String defaultValue) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ }
+ }
+
+ //////////////////////////////////////////////////
+ // Toutes les actions disponibles
+ //////////////////////////////////////////////////
+
+ static public enum Step {
+ AfterInit, AfterInitVCS, AfterUI, BeforeExit
+ }
+
+ public static enum Action {
+ HELP(_("Show help"), OtherAction.class.getName() + "#help", "-h", "--help"),
+
+ IMPORT_ANALYSE_PLAN(_(""), ImportAction.class.getName() + "#importAnalysePlan", "--importAnalysePlan"),
+ IMPORT_EXPORT(_(""), ImportAction.class.getName() + "#importExport", "--importExport"),
+ IMPORT_RULE(_(""), ImportAction.class.getName() + "#importRule", "--importRule"),
+ IMPORT_SCRIPT(_("Import one java file script source"), ImportAction.class.getName() + "#importScript", "--importScript"),
+ IMPORT_SIMULATOR(_(""), ImportAction.class.getName() + "#importSimulator", "--importSimulator"),
+ IMPORT_FORMULA(_(""), ImportAction.class.getName() + "#importFormula", "--importFormula"),
+ IMPORT_REGION(_(""), ImportAction.class.getName() + "#importRegion", "--importRegion"),
+ IMPORT_REGION_AND_RENAME(_(""), ImportAction.class.getName() + "#importRegionAndRename", "--importRegionAndRename"),
+ IMPORT_SIMULATION(_(""), ImportAction.class.getName() + "#importSimulation", "--importSimulation"),
+ IMPORT_SCRIPT_MODULE(_("Import zipped file containing all scripts directory structure"), ImportAction.class.getName() + "#importScriptModule", "--importScriptModule"),
+
+ LIST_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#listAnalysePlan", "--listAnalysePlan"),
+ LIST_EXPORT(_(""), ExportAction.class.getName() + "#listExport", "--listExport"),
+ LIST_RULE(_(""), ExportAction.class.getName() + "#listRule", "--listRule"),
+ LIST_SCRIPT(_(""), ExportAction.class.getName() + "#listScript", "--listScript"),
+ LIST_SIMULATOR(_(""), ExportAction.class.getName() + "#listSimulator", "--listSimulator"),
+ LIST_FORMULA(_(""), ExportAction.class.getName() + "#listFormula", "--listFormula"),
+ LIST_REGION(_(""), ExportAction.class.getName() + "#listRegion", "--listRegion"),
+ LIST_SIMULATION(_(""), ExportAction.class.getName() + "#listSimulation", "--listSimulation"),
+
+ EXPORT_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#exportAnalysePlan", "--exportAnalysePlan"),
+ EXPORT_EXPORT(_(""), ExportAction.class.getName() + "#exportExport", "--exportExport"),
+ EXPORT_RULE(_(""), ExportAction.class.getName() + "#exportRule", "--exportRule"),
+ EXPORT_SCRIPT(_(""), ExportAction.class.getName() + "#exportScript", "--exportScript"),
+ EXPORT_SIMULATOR(_(""), ExportAction.class.getName() + "#exportSimulator", "--exportSimulator"),
+ EXPORT_FORMULA(_(""), ExportAction.class.getName() + "#exportFormula", "--exportFormula"),
+ EXPORT_REGION(_(""), ExportAction.class.getName() + "#exportRegion", "--exportRegion"),
+ EXPORT_SIMULATION(_(""), ExportAction.class.getName() + "#exportSimulation", "--exportSimulation"),
+
+ VCS_SSH_CREATE_KEY(_(""), VCSAction.class.getName() + "#sshCreateKey", "--sshCreateKey"),
+ VCS_UPDATE(_(""), VCSAction.class.getName() + "#vcsUpdate", "--vcsUpdate"),
+ VCS_ADD(_(""), VCSAction.class.getName() + "#vcsAdd", "--vcsAdd"),
+ VCS_REMOVE(_(""), VCSAction.class.getName() + "#vcsRemove", "--vcsRemove"),
+ VCS_COMMIT(_(""), VCSAction.class.getName() + "#vcsCommit", "--vcsCommit"),
+
+ SIMULATE_WITH_REGION(_(""), SimulationAction.class.getName() + "#simulateWithRegion", "--simulateWithRegion"),
+ SIMULATE_WITH_SIMULATION(_(""), SimulationAction.class.getName() + "#simulateWithSimulation", "--simulateWithSimulation"),
+ SIMULATE_WITH_SIMULATION_AND_SCRIPT(_(""), SimulationAction.class.getName() + "#simulateWithSimulationAndScript", "--simulateWithSimulationAndScript"),
+ ;
+
+ public String description;
+ public String action;
+ public String[] aliases;
+
+ private Action(String description, String action, String ... aliases) {
+ this.description = description;
+ this.action = action;
+ this.aliases = aliases;
+ }
+ }
+}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/actions/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/actions/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/actions/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,5 @@
+/**
+ * Command line action classes implementation.
+ */
+package fr.ifremer.isisfish.actions;
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,259 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * Cache.aj
- *
- * Created: 25 août 06 22:42:47
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.aspect;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codehaus.aspectwerkz.annotation.Around;
-import org.codehaus.aspectwerkz.annotation.Aspect;
-import org.codehaus.aspectwerkz.annotation.Expression;
-import org.codehaus.aspectwerkz.definition.Pointcut;
-import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
-import org.codehaus.aspectwerkz.joinpoint.MethodRtti;
-import org.codehaus.aspectwerkz.joinpoint.MethodSignature;
-
-/**
- * @author poussin
- *
- */
-
- at Aspect("perJVM")
-public class Cache {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(Cache.class);
-
- static private List<Cache> instances = new ArrayList<Cache>();
-
- protected long totalCall = 0;
- protected long cacheUsed = 0;
-
- protected Map cache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
-// protected Map cache = new AdaptaptativeCache(1000, 95);
-
- @Expression("execution(* scripts..*(..))")
- Pointcut scriptsMethod;
-
- public Cache() {
- instances.add(this);
- }
-
-// @Before("scriptsMethod")
-// public void traceBeforeExecute (JoinPoint jp) {
-// System.out.println("before !!!");
-// }
-//
-// @AfterThrowing("scriptsMethod")
-// public void traceAfterThrowingExecute (JoinPoint jp) {
-// System.out.println("throwing !!!");
-// }
-//
-// @After("scriptsMethod")
-// public void traceAfterExecute (JoinPoint jp) {
-// System.out.println("After !!!");
-// }
-
-
- @Around("scriptsMethod")
- public Object call(final JoinPoint jp) throws Throwable {
- totalCall++;
- Object key = computeKey(jp);
- Object result = cache.get(key);
- if (result == null) {
- result = realCall(jp);
-// addListenerFor(key); // pas necessaire car on a la date et pour une date donnée rien ne peut changer
- if (result != null) { // util pour les methodes retournant void, ne fonctionne pas si on met AND !execute(void *(..)) dans l'aspect. En fait fonction seulement si utilisé avec les traces :(
- cache.put(key, result);
- }
- } else {
- cacheUsed++;
- }
- if (log.isTraceEnabled()) {
- log.trace(((MethodSignature)jp.getSignature()).getMethod()
- + " args " + Arrays.toString(((MethodRtti)jp.getRtti()).getParameterValues())
- + " result = " + result);
- }
- return result;
- }
-
- /**
- * On fait l'appel reel dans une autre methode pour pouvoir le savoir
- * dans les traces
- *
- * @param jp
- * @return ?
- * @throws Throwable
- */
- protected Object realCall(final JoinPoint jp) throws Throwable {
- Object result = jp.proceed();
- return result;
- }
-
- /**
- * Attention pour avoir une chaine en sortie on prend la reprensentation
- * toString des arguments. Mais en utilisant la methode toString implanté
- * dans Object.
- * <p>
- * Pour les objets de style Number ou String, il faut prendre le vrai
- * toString, pour que 2 soit bien egal a 2.
- *
- * @param jp
- * @return ?
- */
- protected Object computeKey(JoinPoint jp) {
- Method method = ((MethodSignature)jp.getSignature()).getMethod();
- Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
-
- String result = method.toString();
- for (Object o : args) {
- result += ";";
- if (o instanceof Number || o instanceof String) {
- result += o.toString();
- } else {
- result += ObjectUtils.identityToString(o);
- }
- }
-
- return result;
-
-// Method method = ((MethodSignature)jp.getSignature()).getMethod();
-// Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
-//
-// Object[] keys = new Object[args.length + 1];
-// keys[0] = method;
-// System.arraycopy(args, 0, keys, 1, args.length);
-//
-// MultiKey result = new MultiKey(keys, false);
-//
-// return result;
- }
-// protected HashMapMultiKey.Key computeKey(JoinPoint jp) {
-// Method method = ((MethodSignature)jp.getSignature()).getMethod();
-// Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
-//
-// HashMapMultiKey.Key result = new HashMapMultiKey.Key();
-// result.add(method);
-// for (Object arg : args) {
-// result.add(arg);
-// }
-//
-// return result;
-// }
-
-
- /**
- * @return Returns the cacheUsed.
- */
- static public long getCacheUsed() {
- long result = 0;
- for (Cache cache : instances) {
- result += cache.cacheUsed;
- }
- return result;
- }
-
- /**
- * @return Returns the totalCall.
- */
- static public long getTotalCall() {
- long result = 0;
- for (Cache cache : instances) {
- result += cache.totalCall;
- }
- return result;
- }
-
- /**
- * Affiche les statistiques
- *
- */
- static public String printStatistiqueAndClear() {
- StringBuffer result = new StringBuffer();
- for (Cache cache : instances) {
- result.append("--- Cache Statistiques ---\n");
- result.append("Total call: " + cache.totalCall + "\n");
- result.append("Cache used: " + cache.cacheUsed + "\n");
- result.append("Cache usage: " + (100*cache.cacheUsed/cache.totalCall) + "%" + "\n");
- result.append("--------------------\n");
- cache.cache.clear();
- }
- System.out.println(result.toString());
- instances.clear();
- return result.toString();
- }
-
-// /**
-// * Parcours les elements de la cle et pour ceux du type Entities se
-// * met listener pour pouvoir supprimer l'entre du cache lors de leur
-// * modification
-// *
-// * @param key
-// */
-// protected void addListenerFor(HashMapMultiKey.Key key) {
-// }
-
-
- class AdaptaptativeCache extends LinkedHashMap<String, Object> {
- protected int maxMemory = 95;
- /**
- *
- * @param capacity initial capacity
- * @param maxMemory maximum memory used (0-100)
- */
- public AdaptaptativeCache(int capacity, int maxMemory) {
- super(capacity, 0.75f, true);
- this.maxMemory = maxMemory;
- }
-
- /* (non-Javadoc)
- * @see java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
- */
- @Override
- protected boolean removeEldestEntry(Entry<String, Object> eldest) {
- double free = 100.0 * Runtime.getRuntime().freeMemory() / Runtime.getRuntime().maxMemory() ;
- boolean result = 100 - free > maxMemory;
- return result;
- }
- }
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java (from rev 2091, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/Cache.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/Cache.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,264 @@
+/* *##%
+ * Copyright (C) 2006
+ * 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.
+ *##%*/
+
+/* *
+ * Cache.aj
+ *
+ * Created: 25 août 06 22:42:47
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+
+package fr.ifremer.isisfish.aspect;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.aspectwerkz.annotation.Around;
+import org.codehaus.aspectwerkz.annotation.Aspect;
+import org.codehaus.aspectwerkz.annotation.Expression;
+import org.codehaus.aspectwerkz.definition.Pointcut;
+import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
+import org.codehaus.aspectwerkz.joinpoint.MethodRtti;
+import org.codehaus.aspectwerkz.joinpoint.MethodSignature;
+
+/**
+ * @author poussin
+ *
+ */
+
+ at Aspect("perJVM")
+public class Cache {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(Cache.class);
+
+ static private List<Cache> instances = new ArrayList<Cache>();
+
+ protected long totalCall = 0;
+ protected long cacheUsed = 0;
+
+ protected Map cache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
+// protected Map cache = new AdaptaptativeCache(1000, 95);
+
+ @Expression("execution(* scripts..*(..))")
+ Pointcut scriptsMethod;
+
+ public Cache() {
+ instances.add(this);
+ }
+
+// @Before("scriptsMethod")
+// public void traceBeforeExecute (JoinPoint jp) {
+// System.out.println("before !!!");
+// }
+//
+// @AfterThrowing("scriptsMethod")
+// public void traceAfterThrowingExecute (JoinPoint jp) {
+// System.out.println("throwing !!!");
+// }
+//
+// @After("scriptsMethod")
+// public void traceAfterExecute (JoinPoint jp) {
+// System.out.println("After !!!");
+// }
+
+
+ @Around("scriptsMethod")
+ public Object call(final JoinPoint jp) throws Throwable {
+ totalCall++;
+ Object key = computeKey(jp);
+ Object result = cache.get(key);
+ if (result == null) {
+
+ // FIXME computation increment (/ by 0)
+ //Method method = ((MethodSignature)jp.getSignature()).getMethod();
+ //trace.traceAfterComputation(method);
+
+ result = realCall(jp);
+// addListenerFor(key); // pas necessaire car on a la date et pour une date donnée rien ne peut changer
+ if (result != null) { // util pour les methodes retournant void, ne fonctionne pas si on met AND !execute(void *(..)) dans l'aspect. En fait fonction seulement si utilisé avec les traces :(
+ cache.put(key, result);
+ }
+ } else {
+ cacheUsed++;
+ }
+ if (log.isTraceEnabled()) {
+ log.trace(((MethodSignature)jp.getSignature()).getMethod()
+ + " args " + Arrays.toString(((MethodRtti)jp.getRtti()).getParameterValues())
+ + " result = " + result);
+ }
+ return result;
+ }
+
+ /**
+ * On fait l'appel reel dans une autre methode pour pouvoir le savoir
+ * dans les traces
+ *
+ * @param jp
+ * @return ?
+ * @throws Throwable
+ */
+ protected Object realCall(final JoinPoint jp) throws Throwable {
+ Object result = jp.proceed();
+ return result;
+ }
+
+ /**
+ * Attention pour avoir une chaine en sortie on prend la reprensentation
+ * toString des arguments. Mais en utilisant la methode toString implanté
+ * dans Object.
+ * <p>
+ * Pour les objets de style Number ou String, il faut prendre le vrai
+ * toString, pour que 2 soit bien egal a 2.
+ *
+ * @param jp
+ * @return ?
+ */
+ protected Object computeKey(JoinPoint jp) {
+ Method method = ((MethodSignature)jp.getSignature()).getMethod();
+ Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
+
+ String result = method.toString();
+ for (Object o : args) {
+ result += ";";
+ if (o instanceof Number || o instanceof String) {
+ result += o.toString();
+ } else {
+ result += ObjectUtils.identityToString(o);
+ }
+ }
+
+ return result;
+
+// Method method = ((MethodSignature)jp.getSignature()).getMethod();
+// Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
+//
+// Object[] keys = new Object[args.length + 1];
+// keys[0] = method;
+// System.arraycopy(args, 0, keys, 1, args.length);
+//
+// MultiKey result = new MultiKey(keys, false);
+//
+// return result;
+ }
+// protected HashMapMultiKey.Key computeKey(JoinPoint jp) {
+// Method method = ((MethodSignature)jp.getSignature()).getMethod();
+// Object[] args = ((MethodRtti)jp.getRtti()).getParameterValues();
+//
+// HashMapMultiKey.Key result = new HashMapMultiKey.Key();
+// result.add(method);
+// for (Object arg : args) {
+// result.add(arg);
+// }
+//
+// return result;
+// }
+
+
+ /**
+ * @return Returns the cacheUsed.
+ */
+ static public long getCacheUsed() {
+ long result = 0;
+ for (Cache cache : instances) {
+ result += cache.cacheUsed;
+ }
+ return result;
+ }
+
+ /**
+ * @return Returns the totalCall.
+ */
+ static public long getTotalCall() {
+ long result = 0;
+ for (Cache cache : instances) {
+ result += cache.totalCall;
+ }
+ return result;
+ }
+
+ /**
+ * Affiche les statistiques
+ *
+ */
+ static public String printStatistiqueAndClear() {
+ StringBuffer result = new StringBuffer();
+ for (Cache cache : instances) {
+ result.append("--- Cache Statistiques ---\n");
+ result.append("Total call: " + cache.totalCall + "\n");
+ result.append("Cache used: " + cache.cacheUsed + "\n");
+ result.append("Cache usage: " + (100*cache.cacheUsed/cache.totalCall) + "%" + "\n");
+ result.append("--------------------\n");
+ cache.cache.clear();
+ }
+ System.out.println(result.toString());
+ instances.clear();
+ return result.toString();
+ }
+
+// /**
+// * Parcours les elements de la cle et pour ceux du type Entities se
+// * met listener pour pouvoir supprimer l'entre du cache lors de leur
+// * modification
+// *
+// * @param key
+// */
+// protected void addListenerFor(HashMapMultiKey.Key key) {
+// }
+
+
+ class AdaptaptativeCache extends LinkedHashMap<String, Object> {
+ protected int maxMemory = 95;
+ /**
+ *
+ * @param capacity initial capacity
+ * @param maxMemory maximum memory used (0-100)
+ */
+ public AdaptaptativeCache(int capacity, int maxMemory) {
+ super(capacity, 0.75f, true);
+ this.maxMemory = maxMemory;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
+ */
+ @Override
+ protected boolean removeEldestEntry(Entry<String, Object> eldest) {
+ double free = 100.0 * Runtime.getRuntime().freeMemory() / Runtime.getRuntime().maxMemory() ;
+ boolean result = 100 - free > maxMemory;
+ return result;
+ }
+ }
+}
+
+
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/aspect/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,11 @@
+/**
+ * Aspect definition classes.
+ *
+ * Contains two aspects :
+ * <ul>
+ * <li>{@link Cache} : cache aspect</li>
+ * <li>{@link Trace} : trace expect</li>
+ * </ul>
+ */
+package fr.ifremer.isisfish.aspect;
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,362 +0,0 @@
-/* *##%
- * Copyright (C) 2005 - 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.datastore;
-
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.simulator.AnalysePlan;
-import fr.ifremer.isisfish.util.Doc;
-import fr.ifremer.isisfish.util.DocHelper;
-import fr.ifremer.isisfish.util.Docable;
-import fr.ifremer.isisfish.vcs.VCSException;
-
-import static org.codelutin.i18n.I18n._;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Class permettant de representer un plan d'analyse.
- * Un plan d'analyse est un fichier Java que l'on compile si besoin.
- * <p/>
- * Gere les fichiers VCS de type {@link AnalysePlan} (package analyseplans)
- *
- * Created: 17 août 2005 11:11:51 CEST
- *
- * @author Benjamin POUSSIN <poussin at codelutin.com>
- *
- * @version $Revision$
- *
- * Last update: $Date$ by : $Author$
- */
-public class AnalysePlanStorage extends JavaSourceStorage implements Docable { // AnalysePlanStorage
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(AnalysePlanStorage.class);
-
- public final static String ANALYSE_PLAN_PATH = "analyseplans";
-
- private final static String PARAM_PREFIX = "param_";
-
- /** Template freemarker pour les plans d'analyse . */
- public static final String ANALYSE_PLAN_TEMPLATE = "templates/script/analyseplan.ftl";
-
- @SuppressWarnings("unchecked")
- static private Map<String, AnalysePlanStorage> plansCache =
- (Map<String, AnalysePlanStorage>) new ReferenceMap();
-
-
- /**
- * Construit un nouveau AnalysePlan storage
- *
- * @param rootSrc repertoire root de stockage des plans
- * @param directory le repertoire ou devrait se trouver le plan
- * @param name le nom du plan
- */
- protected AnalysePlanStorage(File rootSrc, File directory, String name) {
- super(rootSrc, directory, name);
- }
-
- static public File getAnalysePlanDirectory() {
- File result = IsisFish.config.getDatabaseDirectory();
- result = new File(result, ANALYSE_PLAN_PATH);
- result.mkdirs();
- return result;
- }
-
- /**
- * Retourne le nom de toutes les plans existantes
- *
- * @return les noms de tous les plans existant en local
- */
- static public List<String> getAnalysePlanNames() {
- File dir = getAnalysePlanDirectory();
- return AnalysePlanStorage.getStorageNames(dir);
- }
-
- /**
- * Retourne le storage pour le plan demandé
- *
- * @param name le nom du plan souhaité
- * @return Le storage pour le plan
- */
- static public AnalysePlanStorage getAnalysePlan(String name) {
- AnalysePlanStorage result = plansCache.get(name);
- if (result == null) {
- result = new AnalysePlanStorage(IsisFish.config.getDatabaseDirectory(),
- getAnalysePlanDirectory(), name);
- plansCache.put(name, result);
- }
- return result;
- }
-
-
- /**
- * Retourne une nouvelle instance du plan. Compile le fichier si besoin
- *
- * @return retourne une nouvelle instance du plan
- * @throws IsisFishException s'il y a un probleme d'instanciation
- */
- public AnalysePlan getNewAnalysePlanInstance() throws IsisFishException {
- Object result = getNewInstance();
- return (AnalysePlan) result;
- }
-
- /**
- * Permet de recuperer les parametres du plan.
- *
- * @return Une map contenant le nom du parametre et son type
- * @throws IsisFishException s'il est impossible de retourner une map
- * convenable
- */
- public Map<String, Class> getParameterNames() throws IsisFishException {
- Map<String, Class> result = null;
- // On essai de recuperer les paramètres depuis la classe compilé
- // si c possible
- try {
- if (0 == compile(false, null)) {
- AnalysePlan plan = getNewAnalysePlanInstance();
- result = AnalysePlanStorage.getParameterNames(plan);
- }
- } catch (Exception eee) {
- log.info(_("isisfish.error.plan.parameter"), eee);
- }
- // si on ne reussi pas avec la classe compilé on essai en parsant le
- // source
- if (result == null) {
- try {
- //String code = getContent();
- log.fatal("FIXME a faire recherche des parametre dans le source");
- throw new IsisFishException(_("isisfish.error.source.parameter"));
- // TODO implanter la recherche des parametres.
- // Se sont les attributs commencant par 'param_' et ils doivent
- // etre public non static, non transient.
- // ex: public Date param_Date.
- // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
- // le prefix param.
- } catch (Exception eee) {
- throw new IsisFishException(_("isisfish.error.source.parameter"), eee);
- }
- }
- return result;
- }
-
-
- /**
- * Recherche par introspection tous les parametres de la classe
- * commencant par param_
- *
- * @param plan le plan dont on souhaite les infos de parametre
- * @return retourne le nom et le type des parametres du plan
- */
- static public Map<String, Class> getParameterNames(AnalysePlan plan) {
- Map<String, Class> result = new LinkedHashMap<String, Class>();
- for (Field field : plan.getClass().getFields()) {
- if (field.getName().startsWith(PARAM_PREFIX)) {
- result.put(field.getName().substring(PARAM_PREFIX.length()),
- field.getType());
- }
- }
- return result;
- }
-
- /**
- * Donne la valeur d'un parametre par introspection
- *
- * @param name le nom du parametre
- * @param plan le plan dont on souhaite la valeur du parametre
- * @return la valeur courante du parametre
- * @throws IsisFishException s'il y a un probleme pour recuperer la valeur
- */
- static public Object getParameterValue(AnalysePlan plan, String name) throws IsisFishException {
- if (plan == null || name == null || "".equals(name)) {
- return null;
- }
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = plan.getClass().getDeclaredField(fieldName);
- return field.get(plan);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't get plan parameter: " + name, eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't get plan parameter: " + name, eee);
- }
- }
-
- /**
- * Modifie la valeur d'un attribut pas introspection
- *
- * @param name le nom de l'attribut
- * @param value la valeur de l'attribut
- * @param plan le plan dont on souhaite modifier la valeur de parametre
- * @throws IsisFishException s'il y a un probleme
- */
- static public void setParameterValue(AnalysePlan plan, String name, Object value) throws IsisFishException {
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = plan.getClass().getDeclaredField(fieldName);
- field.set(plan, value);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
- } catch (IllegalArgumentException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
- }
- }
-
- /**
- * Recupere les parametres et leur valeur pour les retourner sous forme
- * de chaine. Pour pouvoir par exemple les afficher a l'utilisateur
- *
- * @param plan le plan dont on souhaite la valeur du parametre en string
- * @return la valeur sous forme de string
- * @throws IsisFishException
- */
- public static String getParamAsString(AnalysePlan plan) throws IsisFishException {
- StringBuffer result = new StringBuffer();
-
- for (String name : getParameterNames(plan).keySet()) {
- Object value = getParameterValue(plan, name);
-
- result.append(name).append(" : ").append(value);
- result.append("\n");
- }
- return result.toString();
- }
-
- static public void checkout() throws VCSException {
- checkout(IsisFish.config.getDatabaseDirectory(), ANALYSE_PLAN_PATH);
- }
-
- /**
- * Retourne la liste des noms de tous les plans disponibles en local qui
- * ne sont pas encore sur le serveur VCS.
- *
- * @return liste de noms de plans
- */
- public static List<String> getNewAnalysePlanNames() {
- List<String> result = getAnalysePlanNames();
- result.removeAll(getRemoteAnalysePlanNames());
- return result;
- }
-
- /**
- * Retourne la liste des noms de tous les plans disponibles sur le
- * serveur VCS.
- *
- * @return la liste des noms de tous les plans disponibles sur le serveur
- * VCS. Si le serveur n'est pas disponible la liste retournée est
- * vide.
- */
- public static List<String> getRemoteAnalysePlanNames() {
- File dir = getAnalysePlanDirectory();
- return getRemoteStorageNames(dir);
-
- }
-
- /**
- * Retourne la liste des noms de tous les plans disponibles sur le
- * serveur VCS qui ne sont pas encore en local
- *
- * @return liste de noms de regions
- * @throws VCSException
- */
- public static List<String> getNewRemoteAnalysePlanNames() throws VCSException {
- List<String> result = getRemoteAnalysePlanNames();
- result.removeAll(getAnalysePlanNames());
- return result;
- }
-
- /**
- * @return the @Doc of the underlied AnalysePlan class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getClassDoc() {
- Doc result = null;
- try {
- Class klazz = getCodeClass();
- result = DocHelper.getClassDoc(klazz);
- } catch (IsisFishException e) {
- log.warn(_("isisfish.error.not.found.code", this));
- }
- return result;
- }
-
- /**
- * @param fieldName name of the field to inspect
- * @return the @Doc of the given field of the underlied AnalysePlan class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getFieldDoc(String fieldName) {
- Doc result = null;
- try {
- Class klazz = getCodeClass();
- result = DocHelper.getFieldDoc(klazz, fieldName);
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.field", fieldName, this));
- }
- return result;
- }
-
- /**
- * @param paramName the name of the param to inspect
- * @return the doc associated with the param,
- * (says the field PARAM_PREFIX+fieldName)
- */
- public Doc getParamDoc(String paramName) {
- Doc doc;
- doc = getFieldDoc(PARAM_PREFIX + paramName);
- return doc;
- }
-
- /**
- * <b>Be ware this method require to instanciate a AnalysePlan, so
- * it would be better to call as often as possible.</b>
- *
- * @return the descript of the instanciate AnalysePlan
- * @see Doc
- * @see Docable
- */
-
- public String getDescription() {
- String result = null;
- try {
- AnalysePlan analysePlan = getNewAnalysePlanInstance();
- result = analysePlan == null ? null : analysePlan.getDescription();
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.description", this));
- }
- return result;
- }
-
-} // AnalysePlanStorage
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,361 @@
+/* *##%
+ * Copyright (C) 2005 - 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.datastore;
+
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.simulator.AnalysePlan;
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.util.DocHelper;
+import fr.ifremer.isisfish.util.Docable;
+import fr.ifremer.isisfish.vcs.VCSException;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Class permettant de representer un plan d'analyse.
+ * Un plan d'analyse est un fichier Java que l'on compile si besoin.
+ * <p/>
+ * Gere les fichiers VCS de type {@link AnalysePlan} (package analyseplans)
+ *
+ * Created: 17 août 2005 11:11:51 CEST
+ *
+ * @author Benjamin POUSSIN <poussin at codelutin.com>
+ *
+ * @version $Revision$
+ *
+ * Last update: $Date$ by : $Author$
+ */
+public class AnalysePlanStorage extends JavaSourceStorage implements Docable { // AnalysePlanStorage
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(AnalysePlanStorage.class);
+
+ public final static String ANALYSE_PLAN_PATH = "analyseplans";
+
+ private final static String PARAM_PREFIX = "param_";
+
+ /** Template freemarker pour les plans d'analyse . */
+ public static final String ANALYSE_PLAN_TEMPLATE = "templates/script/analyseplan.ftl";
+
+ @SuppressWarnings("unchecked")
+ static private Map<String, AnalysePlanStorage> plansCache =
+ (Map<String, AnalysePlanStorage>) new ReferenceMap();
+
+
+ /**
+ * Construit un nouveau AnalysePlan storage
+ *
+ * @param rootSrc repertoire root de stockage des plans
+ * @param directory le repertoire ou devrait se trouver le plan
+ * @param name le nom du plan
+ */
+ protected AnalysePlanStorage(File rootSrc, File directory, String name) {
+ super(rootSrc, directory, name);
+ }
+
+ static public File getAnalysePlanDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, ANALYSE_PLAN_PATH);
+ result.mkdirs();
+ return result;
+ }
+
+ /**
+ * Retourne le nom de toutes les plans existantes
+ *
+ * @return les noms de tous les plans existant en local
+ */
+ static public List<String> getAnalysePlanNames() {
+ File dir = getAnalysePlanDirectory();
+ return AnalysePlanStorage.getStorageNames(dir);
+ }
+
+ /**
+ * Retourne le storage pour le plan demandé
+ *
+ * @param name le nom du plan souhaité
+ * @return Le storage pour le plan
+ */
+ static public AnalysePlanStorage getAnalysePlan(String name) {
+ AnalysePlanStorage result = plansCache.get(name);
+ if (result == null) {
+ result = new AnalysePlanStorage(IsisFish.config.getDatabaseDirectory(),
+ getAnalysePlanDirectory(), name);
+ plansCache.put(name, result);
+ }
+ return result;
+ }
+
+
+ /**
+ * Retourne une nouvelle instance du plan. Compile le fichier si besoin
+ *
+ * @return retourne une nouvelle instance du plan
+ * @throws IsisFishException s'il y a un probleme d'instanciation
+ */
+ public AnalysePlan getNewAnalysePlanInstance() throws IsisFishException {
+ Object result = getNewInstance();
+ return (AnalysePlan) result;
+ }
+
+ /**
+ * Permet de recuperer les parametres du plan.
+ *
+ * @return Une map contenant le nom du parametre et son type
+ * @throws IsisFishException s'il est impossible de retourner une map
+ * convenable
+ */
+ public Map<String, Class<?>> getParameterNames() throws IsisFishException {
+ Map<String, Class<?>> result = null;
+ // On essai de recuperer les paramètres depuis la classe compilé
+ // si c possible
+ try {
+ if (0 == compile(false, null)) {
+ AnalysePlan plan = getNewAnalysePlanInstance();
+ result = AnalysePlanStorage.getParameterNames(plan);
+ }
+ } catch (Exception eee) {
+ log.info(_("isisfish.error.plan.parameter"), eee);
+ }
+ // si on ne reussi pas avec la classe compilé on essai en parsant le
+ // source
+ if (result == null) {
+ try {
+ //String code = getContent();
+ log.fatal("FIXME a faire recherche des parametre dans le source");
+ throw new IsisFishException(_("isisfish.error.source.parameter"));
+ // TODO implanter la recherche des parametres.
+ // Se sont les attributs commencant par 'param_' et ils doivent
+ // etre public non static, non transient.
+ // ex: public Date param_Date.
+ // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
+ // le prefix param.
+ } catch (Exception eee) {
+ throw new IsisFishException(_("isisfish.error.source.parameter"), eee);
+ }
+ }
+ return result;
+ }
+
+
+ /**
+ * Recherche par introspection tous les parametres de la classe
+ * commencant par param_
+ *
+ * @param plan le plan dont on souhaite les infos de parametre
+ * @return retourne le nom et le type des parametres du plan
+ */
+ public static Map<String, Class<?>> getParameterNames(AnalysePlan plan) {
+ Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
+ for (Field field : plan.getClass().getFields()) {
+ if (field.getName().startsWith(PARAM_PREFIX)) {
+ result.put(field.getName().substring(PARAM_PREFIX.length()),
+ field.getType());
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Donne la valeur d'un parametre par introspection
+ *
+ * @param name le nom du parametre
+ * @param plan le plan dont on souhaite la valeur du parametre
+ * @return la valeur courante du parametre
+ * @throws IsisFishException s'il y a un probleme pour recuperer la valeur
+ */
+ static public Object getParameterValue(AnalysePlan plan, String name) throws IsisFishException {
+ if (plan == null || name == null || "".equals(name)) {
+ return null;
+ }
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = plan.getClass().getDeclaredField(fieldName);
+ return field.get(plan);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't get plan parameter: " + name, eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't get plan parameter: " + name, eee);
+ }
+ }
+
+ /**
+ * Modifie la valeur d'un attribut pas introspection
+ *
+ * @param name le nom de l'attribut
+ * @param value la valeur de l'attribut
+ * @param plan le plan dont on souhaite modifier la valeur de parametre
+ * @throws IsisFishException s'il y a un probleme
+ */
+ static public void setParameterValue(AnalysePlan plan, String name, Object value) throws IsisFishException {
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = plan.getClass().getDeclaredField(fieldName);
+ field.set(plan, value);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (IllegalArgumentException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name + " with '" + value + "'(" + ObjectUtils.identityToString(value) + ")", eee);
+ }
+ }
+
+ /**
+ * Recupere les parametres et leur valeur pour les retourner sous forme
+ * de chaine. Pour pouvoir par exemple les afficher a l'utilisateur
+ *
+ * @param plan le plan dont on souhaite la valeur du parametre en string
+ * @return la valeur sous forme de string
+ * @throws IsisFishException
+ */
+ public static String getParamAsString(AnalysePlan plan) throws IsisFishException {
+ StringBuffer result = new StringBuffer();
+
+ for (String name : getParameterNames(plan).keySet()) {
+ Object value = getParameterValue(plan, name);
+
+ result.append(name).append(" : ").append(value);
+ result.append("\n");
+ }
+ return result.toString();
+ }
+
+ static public void checkout() throws VCSException {
+ checkout(IsisFish.config.getDatabaseDirectory(), ANALYSE_PLAN_PATH);
+ }
+
+ /**
+ * Retourne la liste des noms de tous les plans disponibles en local qui
+ * ne sont pas encore sur le serveur VCS.
+ *
+ * @return liste de noms de plans
+ */
+ public static List<String> getNewAnalysePlanNames() {
+ List<String> result = getAnalysePlanNames();
+ result.removeAll(getRemoteAnalysePlanNames());
+ return result;
+ }
+
+ /**
+ * Retourne la liste des noms de tous les plans disponibles sur le
+ * serveur VCS.
+ *
+ * @return la liste des noms de tous les plans disponibles sur le serveur
+ * VCS. Si le serveur n'est pas disponible la liste retournée est
+ * vide.
+ */
+ public static List<String> getRemoteAnalysePlanNames() {
+ File dir = getAnalysePlanDirectory();
+ return getRemoteStorageNames(dir);
+
+ }
+
+ /**
+ * Retourne la liste des noms de tous les plans disponibles sur le
+ * serveur VCS qui ne sont pas encore en local
+ *
+ * @return liste de noms de regions
+ * @throws VCSException
+ */
+ public static List<String> getNewRemoteAnalysePlanNames() throws VCSException {
+ List<String> result = getRemoteAnalysePlanNames();
+ result.removeAll(getAnalysePlanNames());
+ return result;
+ }
+
+ /**
+ * @return the @Doc of the underlied AnalysePlan class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getClassDoc() {
+ Doc result = null;
+ try {
+ Class klazz = getCodeClass();
+ result = DocHelper.getClassDoc(klazz);
+ } catch (IsisFishException e) {
+ log.warn(_("isisfish.error.not.found.code", this));
+ }
+ return result;
+ }
+
+ /**
+ * @param fieldName name of the field to inspect
+ * @return the @Doc of the given field of the underlied AnalysePlan class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getFieldDoc(String fieldName) {
+ Doc result = null;
+ try {
+ Class klazz = getCodeClass();
+ result = DocHelper.getFieldDoc(klazz, fieldName);
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.field", fieldName, this));
+ }
+ return result;
+ }
+
+ /**
+ * @param paramName the name of the param to inspect
+ * @return the doc associated with the param,
+ * (says the field PARAM_PREFIX+fieldName)
+ */
+ public Doc getParamDoc(String paramName) {
+ Doc doc;
+ doc = getFieldDoc(PARAM_PREFIX + paramName);
+ return doc;
+ }
+
+ /**
+ * <b>Be ware this method require to instanciate a AnalysePlan, so
+ * it would be better to call as often as possible.</b>
+ *
+ * @return the descript of the instanciate AnalysePlan
+ * @see Doc
+ * @see Docable
+ */
+ public String getDescription() {
+ String result = null;
+ try {
+ AnalysePlan analysePlan = getNewAnalysePlanInstance();
+ result = analysePlan == null ? null : analysePlan.getDescription();
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.description", this));
+ }
+ return result;
+ }
+
+} // AnalysePlanStorage
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,307 +0,0 @@
-/* *##%
- * Copyright (C) 2005 - 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.datastore;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.export.Export;
-import fr.ifremer.isisfish.rule.Rule;
-import fr.ifremer.isisfish.util.Doc;
-import fr.ifremer.isisfish.util.DocHelper;
-import fr.ifremer.isisfish.util.Docable;
-import fr.ifremer.isisfish.vcs.VCSException;
-
-/**
- * Gestion des fichers VCS de type {@link Export}
- * (appartenant au module exports).
- *
- * Created: 18 août 2005 15:07:36 CEST
- *
- * @author Grégoire DESSARD <dessard at codelutin.com>
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class ExportStorage extends JavaSourceStorage implements Docable {
-
- /** Class logger. */
- private static Log log = LogFactory.getLog(ExportStorage.class);
-
- /** Prefix des noms de paramètres. */
- private final static String PARAM_PREFIX = "param_";
-
- public static final String EXPORT_PATH = "exports";
-
- /** Template freemarker pour les scripts d'export . */
- public static final String EXPORT_TEMPLATE = "templates/script/export.ftl";
-
- @SuppressWarnings("unchecked")
- private static Map<String, ExportStorage> scriptsCache = (Map<String, ExportStorage>) new ReferenceMap();
-
- /**
- * Constructeur.
- *
- * @param rootSrc le repertoire root de stockage des exports
- * @param directory le repertoire de l'export
- * @param name le nom de l'export
- */
- protected ExportStorage(File rootSrc, File directory, String name) {
- super(rootSrc, directory, name);
- }
-
- public static File getExportDirectory() {
- File result = IsisFish.config.getDatabaseDirectory();
- result = new File(result, EXPORT_PATH);
- result.mkdirs();
- return result;
- }
-
- /**
- * Retourne une nouvelle instance de la regle. Compile le fichier si besoin
- *
- * @return une nouvelle instance de la classe d'export
- * @throws IsisFishException
- */
- public Export getNewExportInstance() throws IsisFishException {
- Object result = getNewInstance();
- return (Export) result;
- }
-
- /**
- * Retourne le storage pour la regle demandée
- *
- * @param name le nom de la regle souhaitée
- * @return Le storage pour la regle
- */
- public static ExportStorage getExport(String name) {
- ExportStorage result = scriptsCache.get(name);
- if (result == null) {
- result = new ExportStorage(IsisFish.config.getDatabaseDirectory(),
- getExportDirectory(), name);
- scriptsCache.put(name, result);
- }
- return result;
- }
-
- /**
- * Retourne la liste des noms de toutes les régions disponible en local
- *
- * @return la liste des noms de toutes les régions disponible en local
- */
- public static List<String> getExportNames() {
- File dir = getExportDirectory();
- return getStorageNames(dir);
- }
-
- public static void checkout() throws VCSException {
- checkout(IsisFish.config.getDatabaseDirectory(), EXPORT_PATH);
- }
-
- /**
- * @return the @Doc of the underlied rule class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getClassDoc() {
- Doc result = null;
- try {
- Class<?> klazz = getCodeClass();
- result = DocHelper.getClassDoc(klazz);
- } catch (IsisFishException e) {
- log.warn(_("isisfish.error.not.found.code", this));
- }
- return result;
- }
-
- /**
- * @param fieldName name of the field to inspect
- * @return the @Doc of the given field of the underlied Rule class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getFieldDoc(String fieldName) {
- Doc result=null;
- try {
- Class klazz = getCodeClass();
- result = DocHelper.getFieldDoc(klazz,fieldName);
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.field",fieldName,this));
- }
- return result;
- }
-
- /**
- * <b>Be ware this method require to instanciate a Export, so
- * it would be better to call as often as possible.</b>
- *
- * @return the description of the instanciate Export
- * @see Doc
- * @see Docable
- */
- public String getDescription() {
- String result = null;
- try {
- Export export = getNewExportInstance();
- if (export != null) {
- result = export.getDescription();
- }
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.description",this));
- }
- return result;
- }
-
- /**
- * @param paramName the name of the param to inspect
- * @return the doc associated with the param,
- * (says the field PARAM_PREFIX+fieldName)
- */
- public Doc getParamDoc(String paramName) {
- Doc doc;
- doc = getFieldDoc(PARAM_PREFIX + paramName);
- return doc;
- }
-
- /**
- * Permet de recuperer les parametres de l'export.
- *
- * @return Une map contenant le nom du parametre et son type
- * @throws IsisFishException s'il est impossible de retourner une map
- * convenable
- */
- public Map<String, Class<?>> getParameterNames() throws IsisFishException {
- Map<String, Class<?>> result = null;
- // On essai de recuperer les paramètres depuis la classe compilé
- // si c possible
- try {
- if (0 == compile(false, null)) {
- Export export = getNewExportInstance();
- result = ExportStorage.getParameterNames(export);
- }
- } catch (Exception eee) {
- log.info(_("isisfish.error.compiled.parameter"), eee);
- }
- // si on ne reussi pas avec la classe compilé on essai en parsant le
- // source
- if (result == null) {
- try {
- //String code = getContent();
- log.fatal("FIXME a faire recherche des parametre dans le source");
- throw new IsisFishException(_("isisfish.error.source.parameter"));
- // TODO implanter la recherche des parametres.
- // Se sont les attributs commencant par 'param_' et ils doivent
- // etre public non static, non transient.
- // ex: public Date param_Date.
- // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
- // le prefix param.
- } catch (Exception eee) {
- throw new IsisFishException(_("isisfish.error.source.parameter"), eee);
- }
- }
- return result;
- }
-
- /**
- * Recherche par introspection tous les parametres de la classe
- * commencant par {@link #PARAM_PREFIX}.
- *
- * @param export the export to inspect
- * @return the list of parameters for a given export
- */
- public static Map<String, Class<?>> getParameterNames(Export export) {
- Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
- for (Field field : export.getClass().getFields()) {
- if (field.getName().startsWith(PARAM_PREFIX)) {
- result.put(field.getName().substring(PARAM_PREFIX.length()),
- field.getType());
- }
- }
- return result;
- }
-
- /**
- * Donne la valeur d'un parametre par introspection.
- *
- * @param name le nom du parametre
- * @param export the export to inspect
- * @return la valeur courante du parametre
- * @throws IsisFishException if any exception
- */
- public static Object getParameterValue(Export export, String name) throws IsisFishException {
- if (export == null || name == null || "".equals(name)) {
- return null;
- }
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = export.getClass().getDeclaredField(fieldName);
- return field.get(export);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't get rule parameter: " + name, eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't get rule parameter: " + name, eee);
- }
- }
-
- /**
- * Modifie la valeur d'un attribut par introspection.
- *
- * @param name le nom de l'attribut
- * @param value la valeur de l'attribut
- * @param export the export to inspect
- * @throws IsisFishException if any exception
- */
- public static void setParameterValue(Export export, String name,
- Object value) throws IsisFishException {
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = export.getClass().getDeclaredField(fieldName);
- field.set(export, value);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't modify export parameter: "
- + name + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't modify export parameter: "
- + name + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- } catch (IllegalArgumentException eee) {
- throw new IsisFishException("Can't modify export parameter: "
- + name + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- }
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,305 @@
+/* *##%
+ * Copyright (C) 2005 - 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.datastore;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.export.Export;
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.util.DocHelper;
+import fr.ifremer.isisfish.util.Docable;
+import fr.ifremer.isisfish.vcs.VCSException;
+
+/**
+ * Gestion des fichers VCS de type {@link Export}
+ * (appartenant au module exports).
+ *
+ * Created: 18 août 2005 15:07:36 CEST
+ *
+ * @author Grégoire DESSARD <dessard at codelutin.com>
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ExportStorage extends JavaSourceStorage implements Docable {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(ExportStorage.class);
+
+ /** Prefix des noms de paramètres. */
+ private final static String PARAM_PREFIX = "param_";
+
+ public static final String EXPORT_PATH = "exports";
+
+ /** Template freemarker pour les scripts d'export . */
+ public static final String EXPORT_TEMPLATE = "templates/script/export.ftl";
+
+ @SuppressWarnings("unchecked")
+ private static Map<String, ExportStorage> scriptsCache = (Map<String, ExportStorage>) new ReferenceMap();
+
+ /**
+ * Constructeur.
+ *
+ * @param rootSrc le repertoire root de stockage des exports
+ * @param directory le repertoire de l'export
+ * @param name le nom de l'export
+ */
+ protected ExportStorage(File rootSrc, File directory, String name) {
+ super(rootSrc, directory, name);
+ }
+
+ public static File getExportDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, EXPORT_PATH);
+ result.mkdirs();
+ return result;
+ }
+
+ /**
+ * Retourne une nouvelle instance de la regle. Compile le fichier si besoin
+ *
+ * @return une nouvelle instance de la classe d'export
+ * @throws IsisFishException
+ */
+ public Export getNewExportInstance() throws IsisFishException {
+ Object result = getNewInstance();
+ return (Export) result;
+ }
+
+ /**
+ * Retourne le storage pour la regle demandée
+ *
+ * @param name le nom de la regle souhaitée
+ * @return Le storage pour la regle
+ */
+ public static ExportStorage getExport(String name) {
+ ExportStorage result = scriptsCache.get(name);
+ if (result == null) {
+ result = new ExportStorage(IsisFish.config.getDatabaseDirectory(),
+ getExportDirectory(), name);
+ scriptsCache.put(name, result);
+ }
+ return result;
+ }
+
+ /**
+ * Retourne la liste des noms de toutes les régions disponible en local
+ *
+ * @return la liste des noms de toutes les régions disponible en local
+ */
+ public static List<String> getExportNames() {
+ File dir = getExportDirectory();
+ return getStorageNames(dir);
+ }
+
+ public static void checkout() throws VCSException {
+ checkout(IsisFish.config.getDatabaseDirectory(), EXPORT_PATH);
+ }
+
+ /**
+ * @return the @Doc of the underlied rule class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getClassDoc() {
+ Doc result = null;
+ try {
+ Class<?> klazz = getCodeClass();
+ result = DocHelper.getClassDoc(klazz);
+ } catch (IsisFishException e) {
+ log.warn(_("isisfish.error.not.found.code", this));
+ }
+ return result;
+ }
+
+ /**
+ * @param fieldName name of the field to inspect
+ * @return the @Doc of the given field of the underlied Rule class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getFieldDoc(String fieldName) {
+ Doc result=null;
+ try {
+ Class klazz = getCodeClass();
+ result = DocHelper.getFieldDoc(klazz,fieldName);
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.field",fieldName,this));
+ }
+ return result;
+ }
+
+ /**
+ * <b>Be ware this method require to instanciate a Export, so
+ * it would be better to call as often as possible.</b>
+ *
+ * @return the description of the instanciate Export
+ * @see Doc
+ * @see Docable
+ */
+ public String getDescription() {
+ String result = null;
+ try {
+ Export export = getNewExportInstance();
+ if (export != null) {
+ result = export.getDescription();
+ }
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.description",this));
+ }
+ return result;
+ }
+
+ /**
+ * @param paramName the name of the param to inspect
+ * @return the doc associated with the param,
+ * (says the field PARAM_PREFIX+fieldName)
+ */
+ public Doc getParamDoc(String paramName) {
+ Doc doc;
+ doc = getFieldDoc(PARAM_PREFIX + paramName);
+ return doc;
+ }
+
+ /**
+ * Permet de recuperer les parametres de l'export.
+ *
+ * @return Une map contenant le nom du parametre et son type
+ * @throws IsisFishException s'il est impossible de retourner une map
+ * convenable
+ */
+ public Map<String, Class<?>> getParameterNames() throws IsisFishException {
+ Map<String, Class<?>> result = null;
+ // On essai de recuperer les paramètres depuis la classe compilé
+ // si c possible
+ try {
+ if (0 == compile(false, null)) {
+ Export export = getNewExportInstance();
+ result = ExportStorage.getParameterNames(export);
+ }
+ } catch (Exception eee) {
+ log.info(_("isisfish.error.compiled.parameter"), eee);
+ }
+ // si on ne reussi pas avec la classe compilé on essai en parsant le
+ // source
+ if (result == null) {
+ try {
+ //String code = getContent();
+ log.fatal("FIXME a faire recherche des parametre dans le source");
+ throw new IsisFishException(_("isisfish.error.source.parameter"));
+ // TODO implanter la recherche des parametres.
+ // Se sont les attributs commencant par 'param_' et ils doivent
+ // etre public non static, non transient.
+ // ex: public Date param_Date.
+ // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
+ // le prefix param.
+ } catch (Exception eee) {
+ throw new IsisFishException(_("isisfish.error.source.parameter"), eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Recherche par introspection tous les parametres de la classe
+ * commencant par {@link #PARAM_PREFIX}.
+ *
+ * @param export the export to inspect
+ * @return the list of parameters for a given export
+ */
+ public static Map<String, Class<?>> getParameterNames(Export export) {
+ Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
+ for (Field field : export.getClass().getFields()) {
+ if (field.getName().startsWith(PARAM_PREFIX)) {
+ result.put(field.getName().substring(PARAM_PREFIX.length()),
+ field.getType());
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Donne la valeur d'un parametre par introspection.
+ *
+ * @param name le nom du parametre
+ * @param export the export to inspect
+ * @return la valeur courante du parametre
+ * @throws IsisFishException if any exception
+ */
+ public static Object getParameterValue(Export export, String name) throws IsisFishException {
+ if (export == null || name == null || "".equals(name)) {
+ return null;
+ }
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = export.getClass().getDeclaredField(fieldName);
+ return field.get(export);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't get rule parameter: " + name, eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't get rule parameter: " + name, eee);
+ }
+ }
+
+ /**
+ * Modifie la valeur d'un attribut par introspection.
+ *
+ * @param name le nom de l'attribut
+ * @param value la valeur de l'attribut
+ * @param export the export to inspect
+ * @throws IsisFishException if any exception
+ */
+ public static void setParameterValue(Export export, String name,
+ Object value) throws IsisFishException {
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = export.getClass().getDeclaredField(fieldName);
+ field.set(export, value);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't modify export parameter: "
+ + name + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't modify export parameter: "
+ + name + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (IllegalArgumentException eee) {
+ throw new IsisFishException("Can't modify export parameter: "
+ + name + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ }
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,151 +0,0 @@
-/*
- * *##% Copyright (C) 2006 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. ##%
- */
-
-/*******************************************************************************
- * CodeSourceStorage.java
- *
- * Created: 21 janv. 2006 15:20:24
- *
- * @author poussin
- *
- * @version $Revision$
- *
- * Last update: $Date$ by : $Author$
- */
-
-package fr.ifremer.isisfish.datastore;
-
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.util.CompileHelper;
-import org.apache.commons.lang.ClassUtils;
-import static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.io.PrintWriter;
-
-/**
- * Classes abstraite permettant la gestion des fichiers de code source
- * {@link fr.ifremer.isisfish.datastore.ScriptStorage},
- * {@link fr.ifremer.isisfish.datastore.RuleStorage},
- * {@link fr.ifremer.isisfish.datastore.ExportStorage}
- *
- * @author poussin
- *
- */
-
-public abstract class JavaSourceStorage extends CodeSourceStorage {
-
- /**
- * Contruit un nouveau rule storage
- *
- * @param rootSrc repertoire racine des sources
- * @param directory le repertoire ou devrait se trouver la classe. Ce
- * répertoire doit etre un sous répertoire de rootSrc
- * @param name le nom de la classe
- */
- protected JavaSourceStorage(File rootSrc, File directory, String name) {
- super(rootSrc, directory, name, ".java");
- }
-
- /**
- * Retourne le nom complet de la class representant la classe package inclus
- *
- * @return le nom complet avec le package
- */
- public String getFQN() {
- String root = getRoot().getAbsolutePath();
- String path = getFile().getParentFile().getAbsolutePath();
-
- String packageName = path.substring(1 + root.length()).replace(
- File.separatorChar, '.');
-
- String result = packageName + "." + getName();
- if (result.endsWith(".java")) {
- result = result.substring(0, result.length() - ".java".length());
- }
-
- return result;
- }
-
- /**
- * Compile cette classe dans le répertoire par defaut de compilation
- * ({@link fr.ifremer.isisfish.IsisConfig#getCompileDirectory()})
- *
- * @param force si vrai alors meme si le fichier destination est plus recent
- * la compilation aura lieu
- * @param out le flux sur lequel le resultat de la compilation doit
- * apparaitre. Peut-etre null, dans ce cas les sorties standards sont
- * utilisées.
- * @return 0 si la compilation a reussi une autre valeur sinon
- */
- public int compile(boolean force, PrintWriter out) {
- return CompileHelper.compile(this, IsisFish.config.getCompileDirectory(), force, out);
- }
-
- /**
- * Retourne la classe de la rule compilé. Compile le fichier si besoin
- *
- * @return la class representant la regle
- * @throws IsisFishException
- */
- public Class getCodeClass() throws IsisFishException {
- String fqn = getFQN();
-// Class result = CompileHelper.loadClass(fqn);
-// if (result == null) {
- compile(false, null);
- Class result = CompileHelper.loadClass(fqn);
-// }
- if (result == null) {
- throw new IsisFishException(_("isisfish.error.load.class", fqn));
- }
- return result;
- }
-
- /**
- * Retourne une nouvelle instance de la regle. Compile le fichier si besoin
- *
- * @return une novuelle instance de la regle
- * @throws IsisFishException
- */
- public Object getNewInstance() throws IsisFishException {
- Class clazz = getCodeClass();
- Object result;
- try {
- result = clazz.newInstance();
- } catch (InstantiationException eee) {
- throw new IsisFishException("Can't instanciate class: "
- + clazz.getName(), eee);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't instanciate class: "
- + clazz.getName(), eee);
- }
- return result;
- }
-
- /**
- * Retourne le nom de la classe (sans le package) a partir d'un objet.
- *
- * @param instance l'instance dont on veut le nom
- * @return le nom de la classe ou null si instance est null
- */
- static public String getName(Object instance) {
- return ClassUtils.getShortClassName(instance, null);
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java (from rev 2090, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,162 @@
+/*
+ * *##% 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
+ * 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.datastore;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.io.PrintWriter;
+
+import org.apache.commons.lang.ClassUtils;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.util.CompileHelper;
+import fr.ifremer.isisfish.util.JavadocHelper;
+
+/**
+ * Classes abstraite permettant la gestion des fichiers de code source.
+ *
+ * Exemple :
+ * {@link fr.ifremer.isisfish.datastore.ScriptStorage},
+ * {@link fr.ifremer.isisfish.datastore.RuleStorage},
+ * {@link fr.ifremer.isisfish.datastore.ExportStorage}
+ * {@link fr.ifremer.isisfish.datastore.SensitivityStorage}
+ * {@link fr.ifremer.isisfish.datastore.AnalysePlanStorage}
+ *
+ * @author poussin
+ *
+ * @version $Revision$
+ *
+ * Last update: $Date$ by : $Author$
+ */
+public abstract class JavaSourceStorage extends CodeSourceStorage {
+
+ /**
+ * Build a new java source storage.
+ *
+ * @param rootSrc sources root directory
+ * @param directory class location directory (rootSrc subdirectory)
+ * @param name class name
+ */
+ protected JavaSourceStorage(File rootSrc, File directory, String name) {
+ super(rootSrc, directory, name, ".java");
+ }
+
+ /**
+ * Return class fully qualified name.
+ *
+ * @return class name including package name
+ */
+ public String getFQN() {
+ String root = getRoot().getAbsolutePath();
+ String path = getFile().getParentFile().getAbsolutePath();
+
+ String packageName = path.substring(1 + root.length()).replace(
+ File.separatorChar, '.');
+
+ String result = packageName + "." + getName();
+ if (result.endsWith(".java")) {
+ result = result.substring(0, result.length() - ".java".length());
+ }
+
+ return result;
+ }
+
+ /**
+ * Retourne le nom de la classe (sans le package) a partir d'un objet.
+ *
+ * @param instance l'instance dont on veut le nom
+ * @return le nom de la classe ou null si instance est null
+ */
+ public static String getName(Object instance) {
+ return ClassUtils.getShortClassName(instance, null);
+ }
+
+ /**
+ * Compile cette classe dans le répertoire par defaut de compilation
+ * ({@link fr.ifremer.isisfish.IsisConfig#getCompileDirectory()})
+ *
+ * @param force si vrai alors meme si le fichier destination est plus recent
+ * la compilation aura lieu
+ * @param out le flux sur lequel le resultat de la compilation doit
+ * apparaitre. Peut-etre null, dans ce cas les sorties standards sont
+ * utilisées.
+ * @return 0 si la compilation a reussi, une autre valeur sinon
+ */
+ public int compile(boolean force, PrintWriter out) {
+ return CompileHelper.compile(this, IsisFish.config
+ .getCompileDirectory(), force, out);
+ }
+
+ /**
+ * Build class javadoc.
+ *
+ * Ouput javadoc will be stored in default javadoc directory :
+ * {@link fr.ifremer.isisfish.IsisConfig#getJavadocDirectory()}
+ *
+ * @param force force javadoc build even if destination file is never
+ * @param out output print stream. if <tt>null</tt standart output will be used
+ * @return
+ */
+ public int doJavadoc(boolean force, PrintWriter out) {
+ int result = JavadocHelper.generateJavadoc(this, IsisFish.config.getJavadocDirectory(), force, out);
+ return result;
+ }
+
+ /**
+ * Retourne la classe compilée. Compile le fichier si besoin.
+ *
+ * @return la class
+ * @throws IsisFishException
+ */
+ public Class<?> getCodeClass() throws IsisFishException {
+ String fqn = getFQN();
+ // Class result = CompileHelper.loadClass(fqn);
+ // if (result == null) {
+ compile(false, null);
+ Class<?> result = CompileHelper.loadClass(fqn);
+ // }
+ if (result == null) {
+ throw new IsisFishException(_("isisfish.error.load.class", fqn));
+ }
+ return result;
+ }
+
+ /**
+ * Retourne une nouvelle instance de la class. Compile le fichier si besoin.
+ *
+ * @return une nouvelle instance de la class
+ * @throws IsisFishException if can't make new instance
+ */
+ public Object getNewInstance() throws IsisFishException {
+ Class<?> clazz = getCodeClass();
+ Object result;
+ try {
+ result = clazz.newInstance();
+ } catch (InstantiationException eee) {
+ throw new IsisFishException("Can't instanciate class: "
+ + clazz.getName(), eee);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't instanciate class: "
+ + clazz.getName(), eee);
+ }
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,391 +0,0 @@
-/* *##% Copyright (C) 2009 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307, USA. ##%
- */
-
-package fr.ifremer.isisfish.datastore;
-
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
-import fr.ifremer.isisfish.util.Doc;
-import fr.ifremer.isisfish.util.DocHelper;
-import fr.ifremer.isisfish.util.Docable;
-import fr.ifremer.isisfish.vcs.VCSException;
-
-import static org.codelutin.i18n.I18n._;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Cette class permet de stocker les fichiers de calculateur de sensibilité.
- * <p/>
- * Gere les fichiers VCS de type {@link SensitivityCalculator} (package sensitivity).
- *
- * Created: 17 août 2005 11:11:51 CEST
- *
- * @author chatellier <chatellier at codelutin.com>
- * @version $Revision: 1628 $
- * Last update: $Date: 2008-11-28 10:25:59 +0100 (ven 28 nov 2008) $ by : $Author: chatellier $
- */
-public class SensitivityStorage extends JavaSourceStorage implements Docable { // SensitivityStorage
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SensitivityStorage.class);
-
- /** Emplacement de stockage des fichiers de sensibilité */
- public final static String SENSITIVITY_PATH = "sensitivity";
-
- /** Template freemarker pour les scripts de sensibilité. */
- public static final String SENSIVITY_TEMPLATE = "templates/script/sensitivity.ftl";
-
- /**
- * Prefix des paramètres de la classe.
- *
- * ex : public int param_count;
- */
- protected final static String PARAM_PREFIX = "param_";
-
- /** Cache. */
- protected static Map<String, SensitivityStorage> sensitivityCache = new ReferenceMap();
-
- /**
- * Build new {@link SensitivityStorage}.
- *
- * @param rootSrc repertoire root de stockage des calculateurs de sensibilité.
- * @param directory le repertoire ou devrait se trouver le calculateur de sensibilité
- * @param name le nom du calculateur de sensibilité
- */
- protected SensitivityStorage(File rootSrc, File directory, String name) {
- super(rootSrc, directory, name);
- }
-
- /**
- * Get sensitivity storage directory.
- *
- * Create directory if not exists.
- *
- * @return sensitivity storage directory
- */
- public static File getSensitivityDirectory() {
- File result = IsisFish.config.getDatabaseDirectory();
- result = new File(result, SENSITIVITY_PATH);
- result.mkdirs();
- return result;
- }
-
- /**
- * Retourne le nom de tous les calculateurs de sensibilité existans.
- *
- * @return le nom de tous les calculateurs de sensibilité existans en local
- */
- public static List<String> getSensitivityNames() {
- File dir = getSensitivityDirectory();
- return SensitivityStorage.getStorageNames(dir);
- }
-
- /**
- * Retourne le storage pour le calculateur demandé.
- *
- * @param name le nom du calculateur souhaité
- * @return Le {@link SensitivityStorage} pour le calculateur
- */
- public static SensitivityStorage getSensitivity(String name) {
- SensitivityStorage result = sensitivityCache.get(name);
- if (result == null) {
- result = new SensitivityStorage(IsisFish.config
- .getDatabaseDirectory(), getSensitivityDirectory(), name);
- sensitivityCache.put(name, result);
- }
- return result;
- }
-
- /**
- * Retourne une nouvelle instance du calculateur. Compile le fichier si besoin
- *
- * @return retourne une nouvelle instance du calculateur
- * @throws IsisFishException s'il y a un problème d'instanciation
- */
- public SensitivityCalculator getNewSensitivityInstance() throws IsisFishException {
- Object result = getNewInstance();
- return (SensitivityCalculator) result;
- }
-
- /**
- * Permet de recuperer les parametres du calculateur.
- *
- * @return Une map contenant le nom du parametre et son type
- * @throws IsisFishException s'il est impossible de retourner une map
- * convenable
- */
- public Map<String, Class<?>> getParameterNames() throws IsisFishException {
- Map<String, Class<?>> result = null;
- // On essai de recuperer les paramètres depuis la classe compilé
- // si c possible
- try {
- if (0 == compile(false, null)) {
- SensitivityCalculator calculator = getNewSensitivityInstance();
- result = SensitivityStorage.getParameterNames(calculator);
- }
- } catch (Exception eee) {
- log.info(_("isisfish.error.sensitivity.parameter"), eee);
- }
- // si on ne reussi pas avec la classe compilé on essai en parsant le
- // source
- if (result == null) {
- try {
- //String code = getContent();
- log
- .fatal("FIXME a faire recherche des parametre dans le source");
- throw new IsisFishException(
- _("isisfish.error.source.parameter"));
- // TODO implanter la recherche des parametres.
- // Se sont les attributs commencant par 'param_' et ils doivent
- // etre public non static, non transient.
- // ex: public Date param_Date.
- // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
- // le prefix param.
- } catch (Exception eee) {
- throw new IsisFishException(
- _("isisfish.error.source.parameter"), eee);
- }
- }
- return result;
- }
-
- /**
- * Recherche par introspection tous les parametres de la classe
- * commencant par {@link #PARAM_PREFIX}.
- *
- * @param calculator le calculateur dont on souhaite les infos de parametre
- * @return retourne le nom et le type des parametres du calculateur
- */
- public static Map<String, Class<?>> getParameterNames(
- SensitivityCalculator calculator) {
- Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
- for (Field field : calculator.getClass().getFields()) {
- if (field.getName().startsWith(PARAM_PREFIX)) {
- result.put(field.getName().substring(PARAM_PREFIX.length()),
- field.getType());
- }
- }
- return result;
- }
-
- /**
- * Donne la valeur d'un parametre par introspection.
- *
- * @param name le nom du parametre
- * @param calculator le calculateur dont on souhaite la valeur du parametre
- * @return la valeur courante du parametre
- * @throws IsisFishException s'il y a un probleme pour recuperer la valeur
- */
- public static Object getParameterValue(SensitivityCalculator calculator,
- String name) throws IsisFishException {
- if (calculator == null || name == null || "".equals(name)) {
- return null;
- }
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = calculator.getClass().getDeclaredField(fieldName);
- return field.get(calculator);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't get plan parameter: " + name,
- eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't get plan parameter: " + name,
- eee);
- }
- }
-
- /**
- * Modifie la valeur d'un attribut pas introspection.
- *
- * @param name le nom de l'attribut
- * @param value la valeur de l'attribut
- * @param calculator le calculator dont on souhaite modifier la valeur de parametre
- * @throws IsisFishException s'il y a un probleme
- */
- public static void setParameterValue(SensitivityCalculator calculator,
- String name, Object value) throws IsisFishException {
- try {
- String fieldName = PARAM_PREFIX + name;
- Field field = calculator.getClass().getDeclaredField(fieldName);
- field.set(calculator, value);
- } catch (IllegalAccessException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name
- + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- } catch (NoSuchFieldException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name
- + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- } catch (IllegalArgumentException eee) {
- throw new IsisFishException("Can't modify plan parameter: " + name
- + " with '" + value + "'("
- + ObjectUtils.identityToString(value) + ")", eee);
- }
- }
-
- /**
- * Recupere les paramètres et leur valeur pour les retourner sous forme
- * de chaine. Pour pouvoir par exemple les afficher à l'utilisateur.
- *
- * @param calculator le calculateur dont on souhaite la valeur du parametre en string
- * @return la valeur sous forme de string
- * @throws IsisFishException
- */
- public static String getParamAsString(SensitivityCalculator calculator)
- throws IsisFishException {
- StringBuffer result = new StringBuffer();
-
- for (String name : getParameterNames(calculator).keySet()) {
- Object value = getParameterValue(calculator, name);
-
- result.append(name).append(" : ").append(value);
- result.append("\n");
- }
- return result.toString();
- }
-
- /**
- * Effectue un chekout VCS sur le répertoire des calculateurs.
- *
- * @see VersionStorage#checkout(File, String)
- * @see #SENSITIVITY_PATH
- *
- * @throws VCSException if an error occurs during checkout
- */
- public static void checkout() throws VCSException {
- checkout(IsisFish.config.getDatabaseDirectory(), SENSITIVITY_PATH);
- }
-
- /**
- * Retourne la liste des noms de tous les calculateurs disponibles en local qui
- * ne sont pas encore sur le serveur VCS.
- *
- * @return liste de noms de calculateurs
- */
- static public List<String> getNewSensitivityNames() {
- List<String> result = getSensitivityNames();
- result.removeAll(getRemoteSensitivityNames());
- return result;
- }
-
- /**
- * Retourne la liste des noms de tous les calculateurs disponibles sur le
- * serveur VCS
- *
- * @return la liste des noms de tous les calculateurs disponibles sur le serveur
- * VCS. Si le serveur n'est pas disponible la liste retournée est
- * vide.
- */
- static public List<String> getRemoteSensitivityNames() {
- File dir = getSensitivityDirectory();
- return getRemoteStorageNames(dir);
-
- }
-
- /**
- * Retourne la liste des noms de tous les calculateurs disponibles sur le
- * serveur VCS qui ne sont pas encore en local.
- *
- * @return liste de noms de regions
- * @throws VCSException
- */
- static public List<String> getNewRemoteSensitivityNames()
- throws VCSException {
- List<String> result = getRemoteSensitivityNames();
- result.removeAll(getSensitivityNames());
- return result;
- }
-
- /**
- * @return the @Doc of the underlied {@link SensitivityCalculator} class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getClassDoc() {
- Doc result = null;
- try {
- Class<?> klazz = getCodeClass();
- result = DocHelper.getClassDoc(klazz);
- } catch (IsisFishException e) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.not.found.code", this));
- }
- }
- return result;
- }
-
- /**
- * @param fieldName name of the field to inspect
- * @return the @Doc of the given field of the underlied {@link SensitivityCalculator} class
- * @see DocHelper
- * @see Doc
- * @see Docable
- */
- public Doc getFieldDoc(String fieldName) {
- Doc result = null;
- try {
- Class<?> klazz = getCodeClass();
- result = DocHelper.getFieldDoc(klazz, fieldName);
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.field", fieldName, this));
- }
- return result;
- }
-
- /**
- * @param paramName the name of the param to inspect
- * @return the doc associated with the param,
- * (says the field {@link #PARAM_PREFIX} + fieldName)
- */
- public Doc getParamDoc(String paramName) {
- Doc doc;
- doc = getFieldDoc(PARAM_PREFIX + paramName);
- return doc;
- }
-
- /**
- * <b>Be ware this method require to instanciate a AnalysePlan, so
- * it would be better to call as often as possible.</b>
- *
- * @return the descript of the instanciate AnalysePlan
- * @see Doc
- * @see Docable
- */
- public String getDescription() {
- String result = null;
- try {
- SensitivityCalculator calculator = getNewSensitivityInstance();
- result = calculator == null ? null : calculator.getDescription();
- } catch (Exception e) {
- log.warn(_("isisfish.error.not.found.description", this));
- }
- return result;
- }
-
-} // SensitivityStorage
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/SensitivityStorage.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,390 @@
+/* *##% Copyright (C) 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307, USA. ##%
+ */
+
+package fr.ifremer.isisfish.datastore;
+
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
+import fr.ifremer.isisfish.util.Doc;
+import fr.ifremer.isisfish.util.DocHelper;
+import fr.ifremer.isisfish.util.Docable;
+import fr.ifremer.isisfish.vcs.VCSException;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Cette class permet de stocker les fichiers de calculateur de sensibilité.
+ * <p/>
+ * Gere les fichiers VCS de type {@link SensitivityCalculator} (package sensitivity).
+ *
+ * Created: 17 août 2005 11:11:51 CEST
+ *
+ * @author chatellier <chatellier at codelutin.com>
+ * @version $Revision$
+ * Last update: $Date$ by : $Author$
+ */
+public class SensitivityStorage extends JavaSourceStorage implements Docable { // SensitivityStorage
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(SensitivityStorage.class);
+
+ /** Emplacement de stockage des fichiers de sensibilité */
+ public final static String SENSITIVITY_PATH = "sensitivity";
+
+ /** Template freemarker pour les scripts de sensibilité. */
+ public static final String SENSIVITY_TEMPLATE = "templates/script/sensitivity.ftl";
+
+ /**
+ * Prefix des paramètres de la classe.
+ *
+ * ex : public int param_count;
+ */
+ protected final static String PARAM_PREFIX = "param_";
+
+ /** Cache. */
+ protected static Map<String, SensitivityStorage> sensitivityCache = new ReferenceMap();
+
+ /**
+ * Build new {@link SensitivityStorage}.
+ *
+ * @param rootSrc repertoire root de stockage des calculateurs de sensibilité.
+ * @param directory le repertoire ou devrait se trouver le calculateur de sensibilité
+ * @param name le nom du calculateur de sensibilité
+ */
+ protected SensitivityStorage(File rootSrc, File directory, String name) {
+ super(rootSrc, directory, name);
+ }
+
+ /**
+ * Get sensitivity storage directory.
+ *
+ * Create directory if not exists.
+ *
+ * @return sensitivity storage directory
+ */
+ public static File getSensitivityDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, SENSITIVITY_PATH);
+ result.mkdirs();
+ return result;
+ }
+
+ /**
+ * Retourne le nom de tous les calculateurs de sensibilité existans.
+ *
+ * @return le nom de tous les calculateurs de sensibilité existans en local
+ */
+ public static List<String> getSensitivityNames() {
+ File dir = getSensitivityDirectory();
+ return SensitivityStorage.getStorageNames(dir);
+ }
+
+ /**
+ * Retourne le storage pour le calculateur demandé.
+ *
+ * @param name le nom du calculateur souhaité
+ * @return Le {@link SensitivityStorage} pour le calculateur
+ */
+ public static SensitivityStorage getSensitivity(String name) {
+ SensitivityStorage result = sensitivityCache.get(name);
+ if (result == null) {
+ result = new SensitivityStorage(IsisFish.config
+ .getDatabaseDirectory(), getSensitivityDirectory(), name);
+ sensitivityCache.put(name, result);
+ }
+ return result;
+ }
+
+ /**
+ * Retourne une nouvelle instance du calculateur. Compile le fichier si besoin
+ *
+ * @return retourne une nouvelle instance du calculateur
+ * @throws IsisFishException s'il y a un problème d'instanciation
+ */
+ public SensitivityCalculator getNewSensitivityInstance() throws IsisFishException {
+ Object result = getNewInstance();
+ return (SensitivityCalculator) result;
+ }
+
+ /**
+ * Permet de recuperer les parametres du calculateur.
+ *
+ * @return Une map contenant le nom du parametre et son type
+ * @throws IsisFishException s'il est impossible de retourner une map
+ * convenable
+ */
+ public Map<String, Class<?>> getParameterNames() throws IsisFishException {
+ Map<String, Class<?>> result = null;
+ // On essai de recuperer les paramètres depuis la classe compilé
+ // si c possible
+ try {
+ if (0 == compile(false, null)) {
+ SensitivityCalculator calculator = getNewSensitivityInstance();
+ result = SensitivityStorage.getParameterNames(calculator);
+ }
+ } catch (Exception eee) {
+ log.info(_("isisfish.error.sensitivity.parameter"), eee);
+ }
+ // si on ne reussi pas avec la classe compilé on essai en parsant le
+ // source
+ if (result == null) {
+ try {
+ //String code = getContent();
+ log.fatal("FIXME a faire recherche des parametres dans le source");
+ throw new IsisFishException(
+ _("isisfish.error.source.parameter"));
+ // TODO implanter la recherche des parametres.
+ // Se sont les attributs commencant par 'param_' et ils doivent
+ // etre public non static, non transient.
+ // ex: public Date param_Date.
+ // Lorsqu'on ajoute un champs dans la map il ne faut pas mettre
+ // le prefix param.
+ } catch (Exception eee) {
+ throw new IsisFishException(
+ _("isisfish.error.source.parameter"), eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Recherche par introspection tous les parametres de la classe
+ * commencant par {@link #PARAM_PREFIX}.
+ *
+ * @param calculator le calculateur dont on souhaite les infos de parametre
+ * @return retourne le nom et le type des parametres du calculateur
+ */
+ public static Map<String, Class<?>> getParameterNames(
+ SensitivityCalculator calculator) {
+ Map<String, Class<?>> result = new LinkedHashMap<String, Class<?>>();
+ for (Field field : calculator.getClass().getFields()) {
+ if (field.getName().startsWith(PARAM_PREFIX)) {
+ result.put(field.getName().substring(PARAM_PREFIX.length()),
+ field.getType());
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Donne la valeur d'un parametre par introspection.
+ *
+ * @param name le nom du parametre
+ * @param calculator le calculateur dont on souhaite la valeur du parametre
+ * @return la valeur courante du parametre
+ * @throws IsisFishException s'il y a un probleme pour recuperer la valeur
+ */
+ public static Object getParameterValue(SensitivityCalculator calculator,
+ String name) throws IsisFishException {
+ if (calculator == null || name == null || "".equals(name)) {
+ return null;
+ }
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = calculator.getClass().getDeclaredField(fieldName);
+ return field.get(calculator);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't get plan parameter: " + name,
+ eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't get plan parameter: " + name,
+ eee);
+ }
+ }
+
+ /**
+ * Modifie la valeur d'un attribut pas introspection.
+ *
+ * @param name le nom de l'attribut
+ * @param value la valeur de l'attribut
+ * @param calculator le calculator dont on souhaite modifier la valeur de parametre
+ * @throws IsisFishException s'il y a un probleme
+ */
+ public static void setParameterValue(SensitivityCalculator calculator,
+ String name, Object value) throws IsisFishException {
+ try {
+ String fieldName = PARAM_PREFIX + name;
+ Field field = calculator.getClass().getDeclaredField(fieldName);
+ field.set(calculator, value);
+ } catch (IllegalAccessException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name
+ + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (NoSuchFieldException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name
+ + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ } catch (IllegalArgumentException eee) {
+ throw new IsisFishException("Can't modify plan parameter: " + name
+ + " with '" + value + "'("
+ + ObjectUtils.identityToString(value) + ")", eee);
+ }
+ }
+
+ /**
+ * Recupere les paramètres et leur valeur pour les retourner sous forme
+ * de chaine. Pour pouvoir par exemple les afficher à l'utilisateur.
+ *
+ * @param calculator le calculateur dont on souhaite la valeur du parametre en string
+ * @return la valeur sous forme de string
+ * @throws IsisFishException
+ */
+ public static String getParamAsString(SensitivityCalculator calculator)
+ throws IsisFishException {
+ StringBuffer result = new StringBuffer();
+
+ for (String name : getParameterNames(calculator).keySet()) {
+ Object value = getParameterValue(calculator, name);
+
+ result.append(name).append(" : ").append(value);
+ result.append("\n");
+ }
+ return result.toString();
+ }
+
+ /**
+ * Effectue un chekout VCS sur le répertoire des calculateurs.
+ *
+ * @see VersionStorage#checkout(File, String)
+ * @see #SENSITIVITY_PATH
+ *
+ * @throws VCSException if an error occurs during checkout
+ */
+ public static void checkout() throws VCSException {
+ checkout(IsisFish.config.getDatabaseDirectory(), SENSITIVITY_PATH);
+ }
+
+ /**
+ * Retourne la liste des noms de tous les calculateurs disponibles en local qui
+ * ne sont pas encore sur le serveur VCS.
+ *
+ * @return liste de noms de calculateurs
+ */
+ static public List<String> getNewSensitivityNames() {
+ List<String> result = getSensitivityNames();
+ result.removeAll(getRemoteSensitivityNames());
+ return result;
+ }
+
+ /**
+ * Retourne la liste des noms de tous les calculateurs disponibles sur le
+ * serveur VCS
+ *
+ * @return la liste des noms de tous les calculateurs disponibles sur le serveur
+ * VCS. Si le serveur n'est pas disponible la liste retournée est
+ * vide.
+ */
+ static public List<String> getRemoteSensitivityNames() {
+ File dir = getSensitivityDirectory();
+ return getRemoteStorageNames(dir);
+
+ }
+
+ /**
+ * Retourne la liste des noms de tous les calculateurs disponibles sur le
+ * serveur VCS qui ne sont pas encore en local.
+ *
+ * @return liste de noms de regions
+ * @throws VCSException
+ */
+ static public List<String> getNewRemoteSensitivityNames()
+ throws VCSException {
+ List<String> result = getRemoteSensitivityNames();
+ result.removeAll(getSensitivityNames());
+ return result;
+ }
+
+ /**
+ * @return the @Doc of the underlied {@link SensitivityCalculator} class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getClassDoc() {
+ Doc result = null;
+ try {
+ Class<?> klazz = getCodeClass();
+ result = DocHelper.getClassDoc(klazz);
+ } catch (IsisFishException e) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.not.found.code", this));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @param fieldName name of the field to inspect
+ * @return the @Doc of the given field of the underlied {@link SensitivityCalculator} class
+ * @see DocHelper
+ * @see Doc
+ * @see Docable
+ */
+ public Doc getFieldDoc(String fieldName) {
+ Doc result = null;
+ try {
+ Class<?> klazz = getCodeClass();
+ result = DocHelper.getFieldDoc(klazz, fieldName);
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.field", fieldName, this));
+ }
+ return result;
+ }
+
+ /**
+ * @param paramName the name of the param to inspect
+ * @return the doc associated with the param,
+ * (says the field {@link #PARAM_PREFIX} + fieldName)
+ */
+ public Doc getParamDoc(String paramName) {
+ Doc doc;
+ doc = getFieldDoc(PARAM_PREFIX + paramName);
+ return doc;
+ }
+
+ /**
+ * <b>Be ware this method require to instanciate a AnalysePlan, so
+ * it would be better to call as often as possible.</b>
+ *
+ * @return the descript of the instanciate AnalysePlan
+ * @see Doc
+ * @see Docable
+ */
+ public String getDescription() {
+ String result = null;
+ try {
+ SensitivityCalculator calculator = getNewSensitivityInstance();
+ result = calculator == null ? null : calculator.getDescription();
+ } catch (Exception e) {
+ log.warn(_("isisfish.error.not.found.description", this));
+ }
+ return result;
+ }
+
+} // SensitivityStorage
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/migration/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,5 @@
+/**
+ * IsisFish V2 import.
+ */
+package fr.ifremer.isisfish.datastore.migration;
+
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,14 @@
+/**
+ * Data storage.
+ *
+ * Contains all classes used to store isis fish data.
+ *
+ * Cant be :
+ * <ul>
+ * <li>H2 database storage
+ * <li>H2 memory storage
+ * <li>Java source storage
+ * </ul>
+ */
+package fr.ifremer.isisfish.datastore;
+
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/datastore/update/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,5 @@
+/**
+ * Database storage migration.
+ */
+package fr.ifremer.isisfish.datastore.update;
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,34 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-/**
- * Implantation des operations pour l'entité Cell.
- */
-public class CellImpl extends CellAbstract implements Serializable, Cell {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.CellAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //CellImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/CellImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,60 @@
+/* *##%
+ * Copyright (C) 2006 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.entities;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * Implantation des operations pour l'entité Cell.
+ *
+ * Created: 19 oct. 06 16:30:35
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class CellImpl extends CellAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.CellAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //CellImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,52 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * EffortDescriptionImpl.java
- *
- * Created: 19 oct. 06 16:30:35
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-/**
- * @author poussin
- */
-public class EffortDescriptionImpl extends EffortDescriptionAbstract {
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.EffortDescriptionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = _("isisfish.effortDescription.toString", getSetOfVessels(), getPossibleMetiers());
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EffortDescriptionImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,48 @@
+/* *##%
+ * Copyright (C) 2006 - 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+/**
+ * EffortDescriptionImpl.
+ *
+ * Created: 19 oct. 06 16:30:35
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class EffortDescriptionImpl extends EffortDescriptionAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3668146790780517650L;
+
+ /*
+ * @see fr.ifremer.isisfish.entities.EffortDescriptionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = _("isisfish.effortDescription.toString",
+ getSetOfVessels(), getPossibleMetiers());
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,128 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * EquationImpl.java
- *
- * Created: 20 janv. 2006 03:43:01
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import bsh.Interpreter;
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.FormuleStorage;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.simulator.SimulationContext;
-import fr.ifremer.isisfish.util.EvaluatorHelper;
-import static org.codelutin.i18n.I18n._;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author poussin
- *
- */
-
-public class EquationImpl extends EquationAbstract implements Serializable, Cloneable {
-
- /** */
- private static final long serialVersionUID = -2195404062556810283L;
-
- /**
- * Evalue l'equation et retourne le résultat
- * @param param
- * @return
- * @throws IsisFishException
- */
- public double evaluate(Map<String, Object> param) {
- String eq = getContent();
- try {
- // add Simulation context in map
- param.put("context", SimulationContext.get());
-
- // default is BSH
- if (Language.BSH.equals(getLanguage()) ||
- (("".equals(getLanguage()) || getLanguage() == null ) &&
- getJavaInterface() == null)) {
- Interpreter bsh = new Interpreter();
- for (Map.Entry<String, Object> e : param.entrySet()) {
- bsh.set(e.getKey(), e.getValue());
- }
- Object val = bsh.eval(eq);
- if (val instanceof Number) {
- double result =((Number)val).doubleValue();
- return result;
- } else {
- throw new IsisFishRuntimeException(_("isisfish.error.equation.retun.number", eq));
- }
- } else // default Java if there are javaInterface
- if (Language.JAVA.equals(getLanguage()) || getJavaInterface() != null) {
- Object val = EvaluatorHelper.evaluate(FormuleStorage.FORMULE_PATH,
- getTopiaId(), getJavaInterface(), getContent(), param);
- if (val instanceof Number) {
- double result =((Number)val).doubleValue();
- return result;
- } else {
- throw new IsisFishRuntimeException(_("isisfish.error.equation.retun.number", eq));
- }
- } else
- // TODO other language support
- {
- throw new IsisFishRuntimeException(_("isisfish.error.unsupported.equation.langage", getLanguage(), eq));
- }
- } catch (Exception eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.evaluate.equation", eq), eee);
- }
-
- }
-
- public double evaluate(String name, Object value, Object ... others) {
- Map<String, Object> param = new HashMap<String, Object>();
- param.put(name, value);
- for (int i=0; i<others.length;) {
- name = (String)others[i++];
- value = others[i++];
- param.put(name, value);
- }
- double result = evaluate(param);
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.EquationAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName() + "("+getCategory()+")";
- return result;
- }
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/EquationImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,123 @@
+/* *##%
+ * 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 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import bsh.Interpreter;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.util.EvaluatorHelper;
+
+/**
+ * EquationImpl.
+ *
+ * Created: 20 janv. 2006 03:43:01
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class EquationImpl extends EquationAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -2195404062556810283L;
+
+ /**
+ * Evalue l'equation et retourne le résultat.
+ *
+ * @param param equation args
+ * @return equation evaluation
+ */
+ public double evaluate(Map<String, Object> param) {
+ String eq = getContent();
+ try {
+ // add Simulation context in map
+ param.put("context", SimulationContext.get());
+
+ // default is BSH
+ if (Language.BSH.equals(getLanguage())
+ || (("".equals(getLanguage()) || getLanguage() == null) && getJavaInterface() == null)) {
+ Interpreter bsh = new Interpreter();
+ for (Map.Entry<String, Object> e : param.entrySet()) {
+ bsh.set(e.getKey(), e.getValue());
+ }
+ Object val = bsh.eval(eq);
+ if (val instanceof Number) {
+ double result = ((Number) val).doubleValue();
+ return result;
+ } else {
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.equation.return.number", eq));
+ }
+ } else if (Language.JAVA.equals(getLanguage())
+ || getJavaInterface() != null) {
+ // default Java if there are javaInterface
+ Object val = EvaluatorHelper.evaluate(
+ FormuleStorage.FORMULE_PATH, getTopiaId(),
+ getJavaInterface(), getContent(), param);
+ if (val instanceof Number) {
+ double result = ((Number) val).doubleValue();
+ return result;
+ } else {
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.equation.return.number", eq));
+ }
+ } else {
+ // TODO other language support
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.unsupported.equation.langage",
+ getLanguage(), eq));
+ }
+ } catch (Exception eee) {
+ throw new IsisFishRuntimeException(_(
+ "isisfish.error.evaluate.equation", eq), eee);
+ }
+
+ }
+
+ public double evaluate(String name, Object value, Object... others) {
+ Map<String, Object> param = new HashMap<String, Object>();
+ param.put(name, value);
+ for (int i = 0; i < others.length;) {
+ name = (String) others[i++];
+ value = others[i++];
+ param.put(name, value);
+ }
+ double result = evaluate(param);
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.EquationAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName() + "(" + getCategory() + ")";
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,241 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * FisheryRegionImpl.java
- *
- * Created: 3 janv. 2006 17:14:52
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-
-
-/**
- * @author poussin
- *
- */
-
-public class FisheryRegionImpl extends FisheryRegionAbstract {
-
- /** */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getMapFileList()
- */
- public List<String> getMapFileList() {
- ArrayList<String> result = new ArrayList<String>();
- String mapfiles = getMapFiles();
- if (mapfiles != null) {
- String[] mapNames = mapfiles.split(",");
- for (String mapName : mapNames) {
- if (!"".equals(mapName.trim())) {
- result.add(mapName.trim());
- }
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#setMapFileList(java.util.List)
- */
- public void setMapFileList(List<String> maps) {
- StringBuffer result = new StringBuffer();
- String sep = "";
- if (maps != null) {
- for (String filename : maps) {
- result.append(sep + filename);
- sep = ",";
- }
- }
- setMapFiles(result.toString());
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getMapFilePath()
- */
- public List<String> getMapFilePath() {
- List<String> mapNames = getMapFileList();
- ArrayList<String> result = new ArrayList<String>();
- RegionStorage regionStorage = RegionStorage.getRegion(getName());
- for (String mapName : mapNames) {
- result.add(regionStorage.getMapRepository().getPath() + File.separator
- + mapName);
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getPort()
- */
- public List<Port> getPort() {
- try {
- PortDAO dao = IsisFishDAOHelper.getPortDAO(getTopiaContext());
- List<Port> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getCell()
- */
- public List<Cell> getCell() {
- try {
- CellDAO dao = IsisFishDAOHelper.getCellDAO(getTopiaContext());
- List<Cell> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getVesselType()
- */
- public List<VesselType> getVesselType() {
- try {
- VesselTypeDAO dao = IsisFishDAOHelper.getVesselTypeDAO(getTopiaContext());
- List<VesselType> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getGear()
- */
- public List<Gear> getGear() {
- try {
- GearDAO dao = IsisFishDAOHelper.getGearDAO(getTopiaContext());
- List<Gear> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getMetier()
- */
- public List<Metier> getMetier() {
- try {
- MetierDAO dao = IsisFishDAOHelper.getMetierDAO(getTopiaContext());
- List<Metier> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getSetOfVessels()
- */
- public List<SetOfVessels> getSetOfVessels() {
- try {
- SetOfVesselsDAO dao = IsisFishDAOHelper.getSetOfVesselsDAO(getTopiaContext());
- List<SetOfVessels> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getSpecies()
- */
- public List<Species> getSpecies() {
- try {
- SpeciesDAO dao = IsisFishDAOHelper.getSpeciesDAO(getTopiaContext());
- List<Species> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getStrategy()
- */
- public List<Strategy> getStrategy() {
- try {
- StrategyDAO dao = IsisFishDAOHelper.getStrategyDAO(getTopiaContext());
- List<Strategy> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getTripType()
- */
- public List<TripType> getTripType() {
- try {
- TripTypeDAO dao = IsisFishDAOHelper.getTripTypeDAO(getTopiaContext());
- List<TripType> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegion#getZone()
- */
- public List<Zone> getZone() {
- try {
- ZoneDAO dao = IsisFishDAOHelper.getZoneDAO(getTopiaContext());
- List<Zone> result = dao.findAll();
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/FisheryRegionImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,236 @@
+/* *##%
+ * 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 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.entities;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+
+/**
+ * FisheryRegionImpl.
+ *
+ * Created: 3 janv. 2006 17:14:52
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class FisheryRegionImpl extends FisheryRegionAbstract {
+
+ /** serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getMapFileList()
+ */
+ public List<String> getMapFileList() {
+ ArrayList<String> result = new ArrayList<String>();
+ String mapfiles = getMapFiles();
+ if (mapfiles != null) {
+ String[] mapNames = mapfiles.split(",");
+ for (String mapName : mapNames) {
+ if (!"".equals(mapName.trim())) {
+ result.add(mapName.trim());
+ }
+ }
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#setMapFileList(java.util.List)
+ */
+ public void setMapFileList(List<String> maps) {
+ StringBuffer result = new StringBuffer();
+ String sep = "";
+ if (maps != null) {
+ for (String filename : maps) {
+ result.append(sep + filename);
+ sep = ",";
+ }
+ }
+ setMapFiles(result.toString());
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getMapFilePath()
+ */
+ public List<String> getMapFilePath() {
+ List<String> mapNames = getMapFileList();
+ ArrayList<String> result = new ArrayList<String>();
+ RegionStorage regionStorage = RegionStorage.getRegion(getName());
+ for (String mapName : mapNames) {
+ result.add(regionStorage.getMapRepository().getPath()
+ + File.separator + mapName);
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getPort()
+ */
+ public List<Port> getPort() {
+ try {
+ PortDAO dao = IsisFishDAOHelper.getPortDAO(getTopiaContext());
+ List<Port> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getCell()
+ */
+ public List<Cell> getCell() {
+ try {
+ CellDAO dao = IsisFishDAOHelper.getCellDAO(getTopiaContext());
+ List<Cell> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getVesselType()
+ */
+ public List<VesselType> getVesselType() {
+ try {
+ VesselTypeDAO dao = IsisFishDAOHelper
+ .getVesselTypeDAO(getTopiaContext());
+ List<VesselType> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getGear()
+ */
+ public List<Gear> getGear() {
+ try {
+ GearDAO dao = IsisFishDAOHelper.getGearDAO(getTopiaContext());
+ List<Gear> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getMetier()
+ */
+ public List<Metier> getMetier() {
+ try {
+ MetierDAO dao = IsisFishDAOHelper.getMetierDAO(getTopiaContext());
+ List<Metier> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getSetOfVessels()
+ */
+ public List<SetOfVessels> getSetOfVessels() {
+ try {
+ SetOfVesselsDAO dao = IsisFishDAOHelper
+ .getSetOfVesselsDAO(getTopiaContext());
+ List<SetOfVessels> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getSpecies()
+ */
+ public List<Species> getSpecies() {
+ try {
+ SpeciesDAO dao = IsisFishDAOHelper.getSpeciesDAO(getTopiaContext());
+ List<Species> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getStrategy()
+ */
+ public List<Strategy> getStrategy() {
+ try {
+ StrategyDAO dao = IsisFishDAOHelper
+ .getStrategyDAO(getTopiaContext());
+ List<Strategy> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getTripType()
+ */
+ public List<TripType> getTripType() {
+ try {
+ TripTypeDAO dao = IsisFishDAOHelper
+ .getTripTypeDAO(getTopiaContext());
+ List<TripType> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegion#getZone()
+ */
+ public List<Zone> getZone() {
+ try {
+ ZoneDAO dao = IsisFishDAOHelper.getZoneDAO(getTopiaContext());
+ List<Zone> result = dao.findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,46 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * Formule.java
- *
- * Created: 14 févr. 2006 11:32:40
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-
-/**
- * @author poussin
- *
- */
-
-public interface Formule {
-
- public String getName();
- public String getCategory();
- public String getContent();
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/Formule.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/Formule.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,55 @@
+/* *##%
+ * 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 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.entities;
+
+/**
+ * Formule.
+ *
+ * Created: 14 févr. 2006 11:32:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public interface Formule {
+
+ /**
+ * Return formule name.
+ *
+ * @return formule name
+ */
+ String getName();
+
+ /**
+ * Return formule category name.
+ *
+ * @return formule category name
+ */
+ String getCategory();
+
+ /**
+ * Return formule content.
+ *
+ * @return formule content
+ */
+ String getContent();
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,36 +0,0 @@
-
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-/**
- * Implantation des operations pour l'entité Gear.
- */
-public class GearImpl extends GearAbstract implements Serializable, Gear {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage
- .getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} // GearImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/GearImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,62 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, 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
+ * 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.entities;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * Implantation des operations pour l'entité Gear.
+ *
+ * Created: 14 févr. 2006 11:32:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class GearImpl extends GearAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} // GearImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,60 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-import fr.ifremer.isisfish.types.Month;
-
-/**
- * Implantation des operations pour l'entité Metier.
- */
-public class MetierImpl extends fr.ifremer.isisfish.entities.MetierAbstract implements Serializable, fr.ifremer.isisfish.entities.Metier {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Metier#getMetierSeasonInfo(fr.ifremer.isisfish.types.Month)
- */
- public MetierSeasonInfo getMetierSeasonInfo(Month month) {
- Collection<MetierSeasonInfo> all = getMetierSeasonInfo();
- MetierSeasonInfo result = null;
- for(MetierSeasonInfo msi : all) {
- if (msi.containsMonth(month)) {
- result = msi;
- break;
- }
- }
- return result;
- }
-
- public double getGearParameterValueAsDouble() {
- String val = getGearParameterValue();
- double result = 0;
- if (val != null && !"".equals(val)) {
- result = Double.parseDouble(val);
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.MetierAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //MetierImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,91 @@
+/* *##%
+ * Copyright (C) 2006 - 2009
+ * Ifremer, 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
+ * 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.entities;
+
+import java.util.Collection;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.types.Month;
+
+/**
+ * Implantation des operations pour l'entité Metier.
+ *
+ * Created: 14 févr. 2006 11:32:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class MetierImpl extends MetierAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.Metier#getMetierSeasonInfo(fr.ifremer.isisfish.types.Month)
+ */
+ @Override
+ public MetierSeasonInfo getMetierSeasonInfo(Month month) {
+ Collection<MetierSeasonInfo> all = getMetierSeasonInfo();
+ MetierSeasonInfo result = null;
+ for (MetierSeasonInfo msi : all) {
+ if (msi.containsMonth(month)) {
+ result = msi;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public double getGearParameterValueAsDouble() {
+ String val = getGearParameterValue();
+ double result = 0;
+ if (val != null && !"".equals(val)) {
+ result = Double.parseDouble(val);
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.MetierAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //MetierImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,93 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * MetierSeasonInfoImpl.java
- *
- * Created: 23 août 2006 16:25:40
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author poussin
- *
- */
-
-public class MetierSeasonInfoImpl extends MetierSeasonInfoAbstract {
-
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory.getLog(MetierSeasonInfoImpl.class);
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.MetierSeasonInfo#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
- */
- public double getTargetFactor(PopulationGroup group) {
- // Par defaut on retourne 1 si dans les donnes rien n'est
- // precisé (20041108: Stef + dom)
- double result = 1;
-
- Species species = group.getPopulation().getSpecies();
- TargetSpecies targetSpecies = this.getSpeciesTargetSpecies(species);
- if (targetSpecies != null) {
- result = targetSpecies.getTargetFactor(group);
- } else {
- if (log.isDebugEnabled()) {
- log.debug(_("isisfish.error.no.target.species", this, group));
- }
- }
- return result;
- }
-
- public List<Cell> getCells() {
- List<Cell> result = new ArrayList<Cell>();
- for (Zone zone : getZone()) {
- result.addAll(zone.getCell());
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = _("isisfish.metierSeasonInfo.toString", this.getMetier(), this.getFirstMonth(), this.getLastMonth());
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/MetierSeasonInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,90 @@
+/* *##%
+ * 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * MetierSeasonInfoImpl.
+ *
+ * Created: 23 août 2006 16:25:40
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class MetierSeasonInfoImpl extends MetierSeasonInfoAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4554500494092542926L;
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory
+ .getLog(MetierSeasonInfoImpl.class);
+
+ /*
+ * @see fr.ifremer.isisfish.entities.MetierSeasonInfo#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
+ */
+ @Override
+ public double getTargetFactor(PopulationGroup group) {
+ // Par defaut on retourne 1 si dans les donnes rien n'est
+ // precisé (20041108: Stef + dom)
+ double result = 1;
+
+ Species species = group.getPopulation().getSpecies();
+ TargetSpecies targetSpecies = this.getSpeciesTargetSpecies(species);
+ if (targetSpecies != null) {
+ result = targetSpecies.getTargetFactor(group);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug(_("isisfish.error.no.target.species", this, group));
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public List<Cell> getCells() {
+ List<Cell> result = new ArrayList<Cell>();
+ for (Zone zone : getZone()) {
+ result.addAll(zone.getCell());
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = _("isisfish.metierSeasonInfo.toString", this
+ .getMetier(), this.getFirstMonth(), this.getLastMonth());
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,159 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * PopulationGroupImpl.java
- *
- * Created: 3 janv. 2006 15:26:53
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import fr.ifremer.isisfish.types.Month;
-
-
-/**
- * @author poussin
- *
- */
-
-public class PopulationGroupImpl extends PopulationGroupAbstract {
-
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory.getLog(PopulationGroupImpl.class);
-
- /** */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationGroup#getAge()
- */
- public double getAge() {
- double result = 0;
- if (getPopulation() != null && getPopulation().getSpecies() != null) {
- if (getPopulation().getSpecies().getAgeGroupType()) {
- result = super.getAge();
- } else {
- result = getPopulation().getAge(getLength(), this) / Month.NUMBER_OF_MONTH;
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationGroup#getLongueurMin()
- */
- public double getLength() {
- double result = 0;
- if (getPopulation() != null && getPopulation().getSpecies() != null) {
- if(!getPopulation().getSpecies().getAgeGroupType()) {
- result = (getMinLength() + getMaxLength()) / 2.0;
- } else {
- result = getPopulation().getLength(getAge() * Month.NUMBER_OF_MONTH, this);
- }
- }
- return result;
- }
-
- public boolean isInLength(double length) {
- boolean result = getMinLength() <= length && length <= getMaxLength();
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationGroup#getMeanWeight()
- */
- public double getMeanWeight() {
- double result = 0;
- try {
- Equation eq = getPopulation().getMeanWeight();
- result = eq.evaluate("group", this);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in mean weight equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationGroup#getNaturalDeathRate()
- */
- public double getNaturalDeathRate(Zone zone) {
- double result = 0;
- try {
- Equation eq = getPopulation().getNaturalDeathRate();
- if (eq != null) {
- result = eq.evaluate("pop", this.getPopulation(), "group", this, "zone", zone);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in natural death rate equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationGroup#getPrice()
- */
- public double getPrice() {
- double result = 0;
- try {
- Equation eq = getPopulation().getPrice();
- if (eq != null) {
- result = eq.evaluate("group", this);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in price equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- public String toString() {
- return _("isisfish.populationGroup.toString", this.getPopulation(), this.getId());
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationGroupImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,158 @@
+/* *##%
+ * 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 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.types.Month;
+
+/**
+ * PopulationGroupImpl.
+ *
+ * Created: 3 janv. 2006 15:26:53
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class PopulationGroupImpl extends PopulationGroupAbstract {
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(PopulationGroupImpl.class);
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationGroup#getAge()
+ */
+ @Override
+ public double getAge() {
+ double result = 0;
+ if (getPopulation() != null && getPopulation().getSpecies() != null) {
+ if (getPopulation().getSpecies().getAgeGroupType()) {
+ result = super.getAge();
+ } else {
+ result = getPopulation().getAge(getLength(), this)
+ / Month.NUMBER_OF_MONTH;
+ }
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationGroup#getLongueurMin()
+ */
+ @Override
+ public double getLength() {
+ double result = 0;
+ if (getPopulation() != null && getPopulation().getSpecies() != null) {
+ if (!getPopulation().getSpecies().getAgeGroupType()) {
+ result = (getMinLength() + getMaxLength()) / 2.0;
+ } else {
+ result = getPopulation().getLength(
+ getAge() * Month.NUMBER_OF_MONTH, this);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public boolean isInLength(double length) {
+ boolean result = getMinLength() <= length && length <= getMaxLength();
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationGroup#getMeanWeight()
+ */
+ @Override
+ public double getMeanWeight() {
+ double result = 0;
+ try {
+ Equation eq = getPopulation().getMeanWeight();
+ result = eq.evaluate("group", this);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in mean weight equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationGroup#getNaturalDeathRate()
+ */
+ @Override
+ public double getNaturalDeathRate(Zone zone) {
+ double result = 0;
+ try {
+ Equation eq = getPopulation().getNaturalDeathRate();
+ if (eq != null) {
+ result = eq.evaluate("pop", this.getPopulation(), "group",
+ this, "zone", zone);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in natural death rate equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationGroup#getPrice()
+ */
+ @Override
+ public double getPrice() {
+ double result = 0;
+ try {
+ Equation eq = getPopulation().getPrice();
+ if (eq != null) {
+ result = eq.evaluate("group", this);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in price equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return _("isisfish.populationGroup.toString", this.getPopulation(),
+ this.getId());
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,594 +0,0 @@
-/* *##%
- * 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 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.entities;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixException;
-import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.math.matrix.MatrixIterator;
-import org.codelutin.math.matrix.MatrixND;
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.PopulationGrowth;
-import fr.ifremer.isisfish.equation.PopulationGrowthReverse;
-import fr.ifremer.isisfish.equation.PopulationMeanWeight;
-import fr.ifremer.isisfish.equation.PopulationNaturalDeathRate;
-import fr.ifremer.isisfish.equation.PopulationPrice;
-import fr.ifremer.isisfish.equation.PopulationReproductionEquation;
-import fr.ifremer.isisfish.types.Month;
-
-/**
- * PopulationImpl.
- *
- * Created: 11 janv. 2006 20:16:27
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class PopulationImpl extends PopulationAbstract {
-
- /** Logger for this class. */
- private static final Log log = LogFactory.getLog(PopulationImpl.class);
-
- /** serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- /**
- * Overwrite delete.
- * @throws TopiaException
- */
- @Override
- public void delete() throws TopiaException {
- // chatellier 20090317 fix hibernate exeception
- // object will be resaved ...
- // FIXME should be fixed on topia maybe ?
- this.getSpecies().getPopulation().remove(this);
-
- super.delete();
- }
-
- /*
- * @see fr.ifremer.isisfish.entities.PopulationAbstract#toString()
- */
- @Override
- public String toString() {
- return getName();
- }
-
- /**
- * override to change name of equation
- * @see fr.ifremer.isisfish.entities.PopulationAbstract#setName(java.lang.String)
- */
- @Override
- public void setName(String value) {
- super.setName(value);
- updateEquationName();
- }
-
- private void updateEquationName() {
- Equation eq = null;
- eq = getGrowth();
- if (eq != null) {
- eq.setName(getName());
- }
- eq = getGrowthReverse();
- if (eq != null) {
- eq.setName(getName());
- }
- eq = getMeanWeight();
- if (eq != null) {
- eq.setName(getName());
- }
- eq = getNaturalDeathRate();
- if (eq != null) {
- eq.setName(getName());
- }
- eq = getPrice();
- if (eq != null) {
- eq.setName(getName());
- }
- eq = getReproductionEquation();
- if (eq != null) {
- eq.setName(getName());
- }
- }
-
- public void setEquationReproductionEquation(String content) {
- try {
- Equation eq = getReproductionEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("Reproduction");
- eq.setJavaInterface(PopulationReproductionEquation.class);
- eq.setLanguage(Language.JAVA);
- setReproductionEquation(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setEquationGrowth(String content) {
- try {
- Equation eq = getGrowth();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create Growth equation
- eq = dao.create();
- eq.setCategory("Growth");
- eq.setJavaInterface(PopulationGrowth.class);
- eq.setLanguage(Language.JAVA);
- setGrowth(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.change.equation"),
- eee);
- }
- }
-
- public void setEquationGrowthReverse(String content) {
- try {
- Equation eq = getGrowthReverse();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("GrowthReverse");
- eq.setJavaInterface(PopulationGrowthReverse.class);
- eq.setLanguage(Language.JAVA);
- setGrowthReverse(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setEquationNaturalDeathRate(String content) {
- try {
- Equation eq = getNaturalDeathRate();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("NaturalDeathRate");
- eq.setJavaInterface(PopulationNaturalDeathRate.class);
- eq.setLanguage(Language.JAVA);
- setNaturalDeathRate(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setEquationMeanWeight(String content) {
- try {
- Equation eq = getMeanWeight();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("MeanWeight");
- eq.setJavaInterface(PopulationMeanWeight.class);
- eq.setLanguage(Language.JAVA);
- setMeanWeight(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setEquationPrice(String content) {
- try {
- Equation eq = getPrice();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper
- .getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("Price");
- eq.setJavaInterface(PopulationPrice.class);
- eq.setLanguage(Language.JAVA);
- setPrice(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.change.equation"), eee);
- }
- }
-
- /*
- * @see fr.ifremer.isisfish.entities.Population#getNaturalDeathBirth()
- */
- @Override
- public double getNaturalDeathBirth(Zone zone) {
- double result = 0;
- try {
- Equation eq = getNaturalDeathRate();
- result = eq.evaluate("pop", this, "group", null, "zone", zone);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in natural death rate equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- /**
- * return Matrix [groups x zones] of Natural death rate
- * @return
- */
- @Override
- public MatrixND getNaturalDeathRateMatrix() {
- List<PopulationGroup> groups = getPopulationGroup();
- List<Zone> zones = getPopulationZone();
-
- MatrixND result = MatrixFactory.getInstance().create(
- "Natural death rate", new List[] { groups, zones },
- new String[] { "Groups", "Zones" });
-
- for (MatrixIterator i = result.iterator(); i.hasNext();) {
- i.next();
- PopulationGroup group = (PopulationGroup) i
- .getSemanticsCoordinates()[0];
- Zone zone = (Zone) i.getSemanticsCoordinates()[1];
-
- double value = group.getNaturalDeathRate(zone);
- i.setValue(value);
- }
-
- return result;
- }
-
- @Override
- public PopulationSeasonInfo getPopulationSeasonInfo(Month month) {
- Collection<PopulationSeasonInfo> all = getPopulationSeasonInfo();
- PopulationSeasonInfo result = null;
- for (PopulationSeasonInfo psi : all) {
- if (psi.containsMonth(month)) {
- result = psi;
- break;
- }
- }
- return result;
- }
-
- /**
- * Compute age of group with length
- * @param length length of group
- * @param group group
- * @return age in month
- */
- @Override
- public double getAge(double length, PopulationGroup group) {
- double result = 0;
- try {
- Equation growth = getGrowthReverse();
- result = growth.evaluate("length", length, "group", group);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in get age");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- /**
- * Compute length of group with age
- * @param age age of group in month
- * @param group group
- * @return length of group
- */
- @Override
- public double getLength(double age, PopulationGroup group) {
- double result = 0;
- try {
- Equation growth = getGrowth();
- result = growth.evaluate("age", age, "group", group);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in get length");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- // /* (non-Javadoc)
- // * @see fr.ifremer.isisfish.entities.PopulationAbstract#addPopulationSeasonInfo(fr.ifremer.isisfish.entities.PopulationSeasonInfo)
- // */
- // @Override
- // public void addPopulationSeasonInfo(PopulationSeasonInfo populationSeasonInfo) {
- // super.addPopulationSeasonInfo(populationSeasonInfo);
- // changeCapturability();
- // }
- //
- // /* (non-Javadoc)
- // * @see fr.ifremer.isisfish.entities.PopulationAbstract#addPopulationGroup(fr.ifremer.isisfish.entities.PopulationGroup)
- // */
- // @Override
- // public void addPopulationGroup(PopulationGroup populationGroup) {
- // super.addPopulationGroup(populationGroup);
- // changeCapturability();
- // }
-
- // protected void changeCapturability() {
- // MatrixND mat = null;
- // if (sizePopulationGroup() == 0 || sizePopulationSeasonInfo() == 0) {
- // log.warn("Population doesn't have population group or population season info");
- // } else {
- // List [] sems = new List[]{
- // getPopulationGroup(),
- // getPopulationSeasonInfo(),
- // };
- // mat = MatrixFactory.getInstance().create(_("isisfish.population.capturability"), sems,
- // new String[]{_("isisfish.population.group"), _("isisfish.population.season")});
- //
- //
- // MatrixND oldMat = getCapturability();
- // if (oldMat != null) {
- // mat.pasteSemantics(oldMat);
- // }
- // }
- // setCapturability(mat);
- // }
-
- /*
- * @see fr.ifremer.isisfish.entities.PopulationAbstract#getCapturability()
- */
- @Override
- public MatrixND getCapturability() {
- MatrixND mat = super.getCapturability();
- // check the validity
- if (sizePopulationGroup() == 0 || sizePopulationSeasonInfo() == 0) {
- log
- .warn("Population doesn't have population group or population season info");
- return null;
- }
- List[] sems = new List[] { getPopulationGroup(),
- getPopulationSeasonInfo(), };
- if (mat == null) {
- log.debug("Capturability is null, create new matrix");
- mat = MatrixFactory.getInstance().create(
- n_("isisfish.population.capturability"),
- sems,
- new String[] { n_("isisfish.population.group"),
- n_("isisfish.population.season") });
- // we don't call setCapturability because is better to create a valid
- // matrix when capturability is null instead check validity and
- // create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)) {
- log
- .debug("Capturability has changed, create new matrix and copy old: "
- + mat.getSemantics() + " " + sems);
- MatrixND newmat = MatrixFactory.getInstance().create(
- n_("isisfish.population.capturability"),
- sems,
- new String[] { n_("isisfish.population.group"),
- n_("isisfish.population.season") });
- newmat.pasteSemantics(mat);
- mat = newmat;
- // perhaps call setCapturability, but if possible wait the user
- // call setCapturability explicitly with this new matrix
- }
- return mat;
- }
-
- /*
- * @see fr.ifremer.isisfish.entities.PopulationAbstract#getMappingZoneReproZoneRecru()
- */
- @Override
- public MatrixND getMappingZoneReproZoneRecru() {
- if (sizeReproductionZone() == 0 || sizeRecruitmentZone() == 0) {
- log
- .warn("Population doesn't have zone reproduction or zone recruitment");
- return null;
- }
- MatrixND mat = super.getMappingZoneReproZoneRecru();
- List[] sems = new List[] { getReproductionZone(), getRecruitmentZone(), };
- if (mat == null) {
- mat = MatrixFactory.getInstance().create(
- n_("isisfish.population.mappingZoneReproZoneRecru"),
- sems,
- new String[] { n_("isisfish.population.reproduction"),
- n_("isisfish.population.recruitment") });
- // we don't call setMappingZoneReproZoneRecru because is better to create a valid
- // matrix when MappingZoneReproZoneRecru is null instead check validity and
- // create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)) {
- MatrixND newmat = MatrixFactory.getInstance().create(
- n_("isisfish.population.mappingZoneReproZoneRecru"),
- sems,
- new String[] { n_("isisfish.population.reproduction"),
- n_("isisfish.population.recruitment") });
- newmat.paste(mat);
- mat = newmat;
- }
- return mat;
- }
-
- /**
- * convertie une matrice N 2D en une matrice N 1D strucutre pour les
- * calcules.
- * N2D[classes, zones] --> N1D[classe1(zone1, zone2, ...), classe2(zone1, zone2, ...)]
- *
- * @see #split2D(MatrixND)
- */
- public MatrixND N2DToN1D(MatrixND N) {
- int maxX = N.getDim(0);
- int maxY = N.getDim(1);
-
- MatrixND result = MatrixFactory.getInstance().create(
- n_("isisfish.population.matrixAbundance1D"),
- new int[] { 1, maxX * maxY });
-
- for (int x = 0; x < maxX; x++) {
- for (int y = 0; y < maxY; y++) {
- result.setValue(0, x * maxY + y, N.getValue(x, y));
- }
- }
- return result;
- }
-
- /**
- * a partir d'une matrice N structure selon l'ecriture matricielle
- * en classe puis en zone, construit une matrice 2D en Classe(X)
- * et en Zone(Y)
- *
- * @see #N2DToN1D(MatrixND)
- */
- public MatrixND split2D(MatrixND N) {
- List<Zone> zones = getPopulationZone();
- List<PopulationGroup> groups = getPopulationGroup();
- int nbZone = zones.size();
-
- MatrixND result = MatrixFactory.getInstance().create(
- n_("isisfish.population.matrixAbundance"),
- new List[] { groups, zones },
- new String[] { n_("isisfish.population.groups"),
- n_("isisfish.population.zones") });
-
- try {
- int c = 0;
- int z = 0;
- for (MatrixIterator mi = N.iterator(); mi.next();) {
- result.setValue(c, z, mi.getValue());
- if (z + 1 == nbZone) {
- c++;
- }
- z = (z + 1) % nbZone;
- }
- } catch (MatrixException eee) {
- log.warn("MatrixException", eee);
- }
- return result;
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,593 @@
+/* *##%
+ * 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 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18n.n_;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixException;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixIterator;
+import org.codelutin.math.matrix.MatrixND;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.PopulationGrowth;
+import fr.ifremer.isisfish.equation.PopulationGrowthReverse;
+import fr.ifremer.isisfish.equation.PopulationMeanWeight;
+import fr.ifremer.isisfish.equation.PopulationNaturalDeathRate;
+import fr.ifremer.isisfish.equation.PopulationPrice;
+import fr.ifremer.isisfish.equation.PopulationReproductionEquation;
+import fr.ifremer.isisfish.types.Month;
+
+/**
+ * PopulationImpl.
+ *
+ * Created: 11 janv. 2006 20:16:27
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class PopulationImpl extends PopulationAbstract {
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(PopulationImpl.class);
+
+ /** serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Overwrite delete.
+ * @throws TopiaException
+ */
+ @Override
+ public void delete() throws TopiaException {
+ // chatellier 20090317 fix hibernate exception
+ // object will be resaved ...
+ // FIXME should be fixed on topia maybe ?
+ this.getSpecies().getPopulation().remove(this);
+
+ super.delete();
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ /**
+ * override to change name of equation
+ * @see fr.ifremer.isisfish.entities.PopulationAbstract#setName(java.lang.String)
+ */
+ @Override
+ public void setName(String value) {
+ super.setName(value);
+ updateEquationName();
+ }
+
+ private void updateEquationName() {
+ Equation eq = null;
+ eq = getGrowth();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ eq = getGrowthReverse();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ eq = getMeanWeight();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ eq = getNaturalDeathRate();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ eq = getPrice();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ eq = getReproductionEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ }
+
+ public void setEquationReproductionEquation(String content) {
+ try {
+ Equation eq = getReproductionEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Reproduction");
+ eq.setJavaInterface(PopulationReproductionEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setReproductionEquation(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setEquationGrowth(String content) {
+ try {
+ Equation eq = getGrowth();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create Growth equation
+ eq = dao.create();
+ eq.setCategory("Growth");
+ eq.setJavaInterface(PopulationGrowth.class);
+ eq.setLanguage(Language.JAVA);
+ setGrowth(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"),
+ eee);
+ }
+ }
+
+ public void setEquationGrowthReverse(String content) {
+ try {
+ Equation eq = getGrowthReverse();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("GrowthReverse");
+ eq.setJavaInterface(PopulationGrowthReverse.class);
+ eq.setLanguage(Language.JAVA);
+ setGrowthReverse(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setEquationNaturalDeathRate(String content) {
+ try {
+ Equation eq = getNaturalDeathRate();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("NaturalDeathRate");
+ eq.setJavaInterface(PopulationNaturalDeathRate.class);
+ eq.setLanguage(Language.JAVA);
+ setNaturalDeathRate(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setEquationMeanWeight(String content) {
+ try {
+ Equation eq = getMeanWeight();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("MeanWeight");
+ eq.setJavaInterface(PopulationMeanWeight.class);
+ eq.setLanguage(Language.JAVA);
+ setMeanWeight(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setEquationPrice(String content) {
+ try {
+ Equation eq = getPrice();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Price");
+ eq.setJavaInterface(PopulationPrice.class);
+ eq.setLanguage(Language.JAVA);
+ setPrice(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.Population#getNaturalDeathBirth()
+ */
+ @Override
+ public double getNaturalDeathBirth(Zone zone) {
+ double result = 0;
+ try {
+ Equation eq = getNaturalDeathRate();
+ result = eq.evaluate("pop", this, "group", null, "zone", zone);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in natural death rate equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Return Matrix [groups x zones] of Natural death rate.
+ *
+ * @return a matrix
+ */
+ @Override
+ public MatrixND getNaturalDeathRateMatrix() {
+ List<PopulationGroup> groups = getPopulationGroup();
+ List<Zone> zones = getPopulationZone();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ "Natural death rate", new List[] { groups, zones },
+ new String[] { "Groups", "Zones" });
+
+ for (MatrixIterator i = result.iterator(); i.hasNext();) {
+ i.next();
+ PopulationGroup group = (PopulationGroup) i
+ .getSemanticsCoordinates()[0];
+ Zone zone = (Zone) i.getSemanticsCoordinates()[1];
+
+ double value = group.getNaturalDeathRate(zone);
+ i.setValue(value);
+ }
+
+ return result;
+ }
+
+ @Override
+ public PopulationSeasonInfo getPopulationSeasonInfo(Month month) {
+ Collection<PopulationSeasonInfo> all = getPopulationSeasonInfo();
+ PopulationSeasonInfo result = null;
+ for (PopulationSeasonInfo psi : all) {
+ if (psi.containsMonth(month)) {
+ result = psi;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Compute age of group with length
+ * @param length length of group
+ * @param group group
+ * @return age in month
+ */
+ @Override
+ public double getAge(double length, PopulationGroup group) {
+ double result = 0;
+ try {
+ Equation growth = getGrowthReverse();
+ result = growth.evaluate("length", length, "group", group);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in get age");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Compute length of group with age.
+ *
+ * @param age age of group in month
+ * @param group group
+ * @return length of group
+ */
+ @Override
+ public double getLength(double age, PopulationGroup group) {
+ double result = 0;
+ try {
+ Equation growth = getGrowth();
+ result = growth.evaluate("age", age, "group", group);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in get length");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ // /* (non-Javadoc)
+ // * @see fr.ifremer.isisfish.entities.PopulationAbstract#addPopulationSeasonInfo(fr.ifremer.isisfish.entities.PopulationSeasonInfo)
+ // */
+ // @Override
+ // public void addPopulationSeasonInfo(PopulationSeasonInfo populationSeasonInfo) {
+ // super.addPopulationSeasonInfo(populationSeasonInfo);
+ // changeCapturability();
+ // }
+ //
+ // /* (non-Javadoc)
+ // * @see fr.ifremer.isisfish.entities.PopulationAbstract#addPopulationGroup(fr.ifremer.isisfish.entities.PopulationGroup)
+ // */
+ // @Override
+ // public void addPopulationGroup(PopulationGroup populationGroup) {
+ // super.addPopulationGroup(populationGroup);
+ // changeCapturability();
+ // }
+
+ // protected void changeCapturability() {
+ // MatrixND mat = null;
+ // if (sizePopulationGroup() == 0 || sizePopulationSeasonInfo() == 0) {
+ // log.warn("Population doesn't have population group or population season info");
+ // } else {
+ // List [] sems = new List[]{
+ // getPopulationGroup(),
+ // getPopulationSeasonInfo(),
+ // };
+ // mat = MatrixFactory.getInstance().create(_("isisfish.population.capturability"), sems,
+ // new String[]{_("isisfish.population.group"), _("isisfish.population.season")});
+ //
+ //
+ // MatrixND oldMat = getCapturability();
+ // if (oldMat != null) {
+ // mat.pasteSemantics(oldMat);
+ // }
+ // }
+ // setCapturability(mat);
+ // }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationAbstract#getCapturability()
+ */
+ @Override
+ public MatrixND getCapturability() {
+ MatrixND mat = super.getCapturability();
+ // check the validity
+ if (sizePopulationGroup() == 0 || sizePopulationSeasonInfo() == 0) {
+ log.warn("Population doesn't have population group or population season info");
+ return null;
+ }
+ List[] sems = new List[] { getPopulationGroup(),
+ getPopulationSeasonInfo(), };
+ if (mat == null) {
+ log.debug("Capturability is null, create new matrix");
+ mat = MatrixFactory.getInstance().create(
+ n_("isisfish.population.capturability"),
+ sems,
+ new String[] { n_("isisfish.population.group"),
+ n_("isisfish.population.season") });
+ // we don't call setCapturability because is better to create a valid
+ // matrix when capturability is null instead check validity and
+ // create new one and paste the old
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ log.debug("Capturability has changed, create new matrix and copy old: "
+ + mat.getSemantics() + " " + sems);
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.population.capturability"),
+ sems,
+ new String[] { n_("isisfish.population.group"),
+ n_("isisfish.population.season") });
+ newmat.pasteSemantics(mat);
+ mat = newmat;
+ // perhaps call setCapturability, but if possible wait the user
+ // call setCapturability explicitly with this new matrix
+ }
+ return mat;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationAbstract#getMappingZoneReproZoneRecru()
+ */
+ @Override
+ public MatrixND getMappingZoneReproZoneRecru() {
+ if (sizeReproductionZone() == 0 || sizeRecruitmentZone() == 0) {
+ log.warn("Population doesn't have zone reproduction or zone recruitment");
+ return null;
+ }
+ MatrixND mat = super.getMappingZoneReproZoneRecru();
+ List[] sems = new List[] { getReproductionZone(), getRecruitmentZone(), };
+ if (mat == null) {
+ mat = MatrixFactory.getInstance().create(
+ n_("isisfish.population.mappingZoneReproZoneRecru"),
+ sems,
+ new String[] { n_("isisfish.population.reproduction"),
+ n_("isisfish.population.recruitment") });
+ // we don't call setMappingZoneReproZoneRecru because is better to create a valid
+ // matrix when MappingZoneReproZoneRecru is null instead check validity and
+ // create new one and paste the old
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.population.mappingZoneReproZoneRecru"),
+ sems,
+ new String[] { n_("isisfish.population.reproduction"),
+ n_("isisfish.population.recruitment") });
+ newmat.paste(mat);
+ mat = newmat;
+ }
+ return mat;
+ }
+
+ /**
+ * Convertie une matrice N 2D en une matrice N 1D strucutre pour les calculer.
+ *
+ * N2D[classes, zones] --> N1D[classe1(zone1, zone2, ...), classe2(zone1, zone2, ...)]
+ *
+ * @see #split2D(MatrixND)
+ */
+ public MatrixND N2DToN1D(MatrixND N) {
+ int maxX = N.getDim(0);
+ int maxY = N.getDim(1);
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ n_("isisfish.population.matrixAbundance1D"),
+ new int[] { 1, maxX * maxY });
+
+ for (int x = 0; x < maxX; x++) {
+ for (int y = 0; y < maxY; y++) {
+ result.setValue(0, x * maxY + y, N.getValue(x, y));
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A partir d'une matrice N structure selon l'ecriture matricielle
+ * en classe puis en zone, construit une matrice 2D en Classe(X)
+ * et en Zone(Y)
+ *
+ * @see #N2DToN1D(MatrixND)
+ */
+ public MatrixND split2D(MatrixND N) {
+ List<Zone> zones = getPopulationZone();
+ List<PopulationGroup> groups = getPopulationGroup();
+ int nbZone = zones.size();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ n_("isisfish.population.matrixAbundance"),
+ new List[] { groups, zones },
+ new String[] { n_("isisfish.population.groups"),
+ n_("isisfish.population.zones") });
+
+ try {
+ int c = 0;
+ int z = 0;
+ for (MatrixIterator mi = N.iterator(); mi.next();) {
+ result.setValue(c, z, mi.getValue());
+ if (z + 1 == nbZone) {
+ c++;
+ }
+ z = (z + 1) % nbZone;
+ }
+ } catch (MatrixException eee) {
+ log.warn("MatrixException", eee);
+ }
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,775 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * PopulationSeasonInfoImpl.java
- *
- * Created: 18 mars 2006 15:24:56
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.math.matrix.MatrixHelper;
-import org.codelutin.math.matrix.MatrixIterator;
-import org.codelutin.math.matrix.MatrixND;
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.equation.EmigrationEquation;
-import fr.ifremer.isisfish.equation.ImmigrationEquation;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.MigrationEquation;
-import fr.ifremer.isisfish.types.Month;
-
-
-/**
- * @author poussin
- *
- */
-
-public class PopulationSeasonInfoImpl extends PopulationSeasonInfoAbstract {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(PopulationSeasonInfoImpl.class);
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getReproductionDistribution()
- */
- @Override
- public MatrixND getReproductionDistribution() {
- MatrixND result = super.getReproductionDistribution();
- List oldMonths = null;
-
- if (result != null) {
- oldMonths = result.getSemantics(0);
- }
-
- List<Month> months = getMonths();
-
- if ( ! months.equals(oldMonths)) {
- MatrixND tmp =
- MatrixFactory.getInstance().create(
- _("isisfish.populationSeasonInfo.distributionSpawing"),
- new List[]{months},
- new String[]{_("isisfish.populationSeasonInfo.months")});
- tmp.pasteSemantics(result);
- result = tmp;
- }
-
- return result;
- }
-
- /**
- * overload to return matrix if no matrix available. The matrix returned
- * by this method can't be used directly because it conatins only the
- * migration (departure != arrival) and not the coefficient that stay on
- * the same zone. This coefficient is calculated with over coefficient to
- * have 1 as sum of all coefficient.
- *
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getMigrationMatrix()
- */
- @Override
- public MatrixND getMigrationMatrix() {
- // check the validity
- MatrixND mat = super.getMigrationMatrix();
- if (getPopulation() != null) {
- List groups = getPopulation().getPopulationGroup();
- List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones, zones };
-
- if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.migration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure"), _("isisfish.populationSeasonInfo.arrival")});
- // we don't call setCapturability because is better to create a valid
- // matrix when capturability is null instead check validity and
- // create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.migration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure"), _("isisfish.populationSeasonInfo.arrival")});
- newmat.pasteSemantics(mat);
- mat = newmat;
- // perhaps call setCapturability, but if possible wait the user
- // call setCapturability explicitly with this new matrix
- }
- }
- return mat;
- }
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getEmigrationMatrix()
- */
- @Override
- public MatrixND getEmigrationMatrix() {
- // check the validity
- MatrixND mat = super.getEmigrationMatrix();
- if (getPopulation() != null) {
- List groups = getPopulation().getPopulationGroup();
- List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones };
-
- if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.emigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure")});
- // we don't call setCapturability because is better to create a valid
- // matrix when capturability is null instead check validity and
- // create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(n_("isisfish.populationSeasonInfo.emigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.departure")});
- newmat.pasteSemantics(mat);
- mat = newmat;
- // perhaps call setCapturability, but if possible wait the user
- // call setCapturability explicitly with this new matrix
- }
- }
- return mat;
- }
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getImmigrationMatrix()
- */
- @Override
- public MatrixND getImmigrationMatrix() {
- // check the validity
- MatrixND mat = super.getImmigrationMatrix();
- if (getPopulation() != null) {
- List groups = getPopulation().getPopulationGroup();
- List zones = getPopulation().getPopulationZone();
- List [] sems = new List[]{ groups, zones };
-
- if (mat == null) {
- mat = MatrixFactory.getInstance().create(_("isisfish.populationSeasonInfo.immigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.arrival")});
- // we don't call setCapturability because is better to create a valid
- // matrix when capturability is null instead check validity and
- // create new one and paste the old
- } else if (!Arrays.equals(mat.getSemantics(), sems)){
- MatrixND newmat = MatrixFactory.getInstance().create(n_("isisfish.populationSeasonInfo.immigration"), sems,
- new String[]{_("isisfish.populationSeasonInfo.group"), _("isisfish.populationSeasonInfo.arrival")});
- newmat.pasteSemantics(mat);
- mat = newmat;
- // perhaps call setCapturability, but if possible wait the user
- // call setCapturability explicitly with this new matrix
- }
- }
- return mat;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getCapturability(fr.ifremer.isisfish.entities.PopulationGroup)
- */
- public double getCapturability(PopulationGroup group) {
- double result = 0;
- if (getPopulation() != null) {
- MatrixND captu = getPopulation().getCapturability();
- result = captu.getValue(group, this);
- }
- return result;
- }
-
- /**
- * Create not initialized no spacialized change group matrix
- * @return
- */
- public MatrixND createNoSpacializedChangeGroupMatrix() {
- Population pop = getPopulation();
-
- List<PopulationGroup> groups = pop.getPopulationGroup();
-
- MatrixND result = MatrixFactory.getInstance().create(new List[]{groups, groups});
- return result;
- }
-
- /**
- * Converte spacialized matrix to no spacialized matrix
- * @param mat spacialized matrix
- * @return spacialized matrix
- */
- public MatrixND unspacializeLengthChangeMatrix(MatrixND mat) {
-
- Population pop = getPopulation();
-
- int nbsecteurs = pop.sizePopulationZone();
- int nbclasses = pop.sizePopulationGroup();
-
- MatrixND smallmat = createNoSpacializedChangeGroupMatrix();
-
- for(int i=0; i<nbclasses; i++){
- for(int j=0; j<nbclasses; j++){
- double val = mat.getValue(i*nbsecteurs, j*nbsecteurs);
- smallmat.setValue(i,j, val);
- }
- }
- return smallmat;
- }
-
- /**
- * Create not initialized spacialized change group matrix
- * @return
- */
- protected MatrixND createSpacializedChangeGroupMatrix() {
- Population pop = getPopulation();
-
- List<Zone> zones = pop.getPopulationZone();
- List<PopulationGroup> groups = pop.getPopulationGroup();
-
- ArrayList<String> semantique = new ArrayList<String>();
-
- for (PopulationGroup group : groups) {
- for (Zone zone : zones) {
- semantique.add(group + "/" + zone);
- }
- }
-
- MatrixND result = MatrixFactory.getInstance().create(new List[]{semantique, semantique});
- return result;
- }
-
- /**
- * Converte no spacialized matrix to spacialized matrix
- * @param mat no spacialized matrix
- * @return spacialized matrix
- */
- public MatrixND spacializeLengthChangeMatrix(MatrixND mat) {
-
- Population pop = getPopulation();
-
- int nbsecteurs = pop.sizePopulationZone();
- int nbclasses = pop.sizePopulationGroup();
-
- MatrixND bigmat = createSpacializedChangeGroupMatrix();
-
- for(int i=0; i<nbclasses; i++){
- for(int j=0; j<nbclasses; j++){
- MatrixND matId = MatrixFactory.getInstance().matrixId(nbsecteurs);
- matId.mults(mat.getValue(i,j));
- bigmat.paste(new int[]{i*nbsecteurs, j*nbsecteurs}, matId);
- }
- }
- return bigmat;
- }
-
- /**
- * Create default non spacialized matrix group changement
- */
- public MatrixND computeLengthChangeMatrix() {
-
- int NB_DISCRETISATION = 10;
-
- Population pop = getPopulation();
- List<PopulationGroup> groups = pop.getPopulationGroup();
-
- MatrixND result = createNoSpacializedChangeGroupMatrix();
-
- for (int i=0; i<groups.size(); i++) {
- PopulationGroup group = groups.get(i);
- double min = group.getMinLength();
- double max = group.getMaxLength();
-
- // creation de la matrice de longueurs pour la classe
- double step = (max-min)/NB_DISCRETISATION;
- double [] length = new double[NB_DISCRETISATION];
- length[0] = min;
- for(int l=1; l<NB_DISCRETISATION; l++){
- length[l] = length[l-1] + step;
- }
-
- // calcul des nouvelles longueurs pour la classe
- for(int l=0; l<NB_DISCRETISATION; l++){
- double age = pop.getAge(length[l], group);
- length[l] = pop.getLength(age + 1, group); // + 1 mois
- }
-
- // modification de la matrice de changement d'age en fonction
- // de la vitesse croissance de la classe.
-
- for(int l=0; l<NB_DISCRETISATION; l++){
- int c = 0;
- while(c<groups.size() && ! groups.get(c).isInLength(length[l])){
- c++;
- }
- if(c >= groups.size()){
- log.warn(_("isisfish.error.acceptable.population") + " (group=" + group +" new length: " + length[l] + ")");
- // pas retrouver une classe pour cette longueur, on le laisse dans la meme classe.
- result.setValue(i, i, result.getValue(i, i) + 1);
- } else {
- result.setValue(i, c, result.getValue(i, c) + 1); // on ajoute des 1
- // on divisera par NB_DISCRETISATION juste avant de retourner le
- // resultat
- }
- }
- }
- result = result.divs(NB_DISCRETISATION);
- return result;
- }
-
- /**
- * return change group matrix for the given month
- * for species in Length, matrix returned is all time spacialized (needed
- * for simulation)
- */
- public MatrixND getGroupChangeMatrix(Month month) {
- Population pop = getPopulation();
-
- if (log.isDebugEnabled()) {
- log.debug("pop: " + pop + " AgeGroup: " + pop.getSpecies().getAgeGroupType() + " groupChange: " + getGroupChange() + " month: " + month + " firstMonth: " + getFirstMonth());
- }
-
- // si en longueur
- if (! pop.getSpecies().getAgeGroupType()){
- if(getSimpleLengthChangeMatrix()){
- return spacializeLengthChangeMatrix(getLengthChangeMatrix());
- }else{
- return getLengthChangeMatrix();
- }
- }else if(getGroupChange() &&
- month.getMonthNumber() == getFirstMonth().getMonthNumber()){
- // create identity matrix with special 1 for plus group if necessary
- int nbrAge = pop.sizePopulationGroup();
- int nbrZone = pop.sizePopulationZone();
- boolean groupplus = pop.getPlusGroup();
-
- MatrixND result = createSpacializedChangeGroupMatrix();
- for(MatrixIterator mi=result.iterator(); mi.next();){
- int [] dim = mi.getCoordinates();
- int i = dim[0];
- int j = dim[1];
-
- if(
- // un element de la diagonale dans le block choisi
- (i+nbrZone == j)
- || // calcul pour savoir s'il y a le groupe plus
- (groupplus
- // regarde si on est bien dans le dernier block
- && (nbrAge-1 == i/nbrZone)
- // regarde si on est bien sur la diagonal
- && (i == j))
- ){
- mi.setValue(1);
- }
- }
- return result;
- }else{
- int nbsecteurs = pop.sizePopulationZone();
- int nbclasses = pop.sizePopulationGroup();
-
- int dim = nbsecteurs * nbclasses;
-
- return MatrixFactory.getInstance().matrixId(dim);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getMigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
- */
- public MatrixND getMigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
- return getMigrationMatrix(N);
- }else{
- MatrixND result = createSpacializedChangeGroupMatrix();
- MatrixHelper.convertToId(result);
- return result;
- }
- }
-
- protected MatrixND getMigrationMatrix(MatrixND aN) {
- MatrixND mat = null;
- try{
- Population population = getPopulation();
-
- List<Zone> zones = population.getPopulationZone();
- List<PopulationGroup> groups = population.getPopulationGroup();
-
- int nbSecteur = zones.size();
-
- mat = createSpacializedChangeGroupMatrix();
- MatrixHelper.convertToId(mat);
-
- if (getUseEquationMigration()) {
- // on commence par faire une copie pour ne pas modifier N
- MatrixND N = MatrixFactory.getInstance().create(aN);
-
- Equation eq = getMigrationEquation();
-
- for (int c=0; c<groups.size(); c++) {
- PopulationGroup group = groups.get(c);
- for (int d=0; d<zones.size(); d++) {
- Zone departureZone = zones.get(d);
- for (int a=0; a<zones.size(); a++) {
- Zone arrivalZone = zones.get(a);
- if (departureZone.equals(arrivalZone)) {
- // pour zd == za on ne fait pas le calcul
- // car au retire automatiquement les autres
- // valeur de celle-ci
- continue;
- }
-
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
- "departureZone", departureZone,
- "arrivalZone", arrivalZone);
-
- int x = c*nbSecteur+d;
- int y = c*nbSecteur+a;
- double ancienne_val = mat.getValue(x,x) - coef;
- mat.setValue(x,x, ancienne_val);
- if(ancienne_val<0){
- /*#java.util.logging.Logger.getLogger("fr.ifremer.db.InfoSaisonPop.getMatriceMigration").info("Erreur dans la migration, un coef est negatif");#*/
- }
- mat.setValue(x, y, coef);
- }
- }
- }
- } else {
-
- // matrix 3D: Group, departure, arrival
- MatrixND mig = getMigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
- i.next();
- double coef = i.getValue();
- if (coef != 0) {
- int [] coord = i.getCoordinates();
-
- int posClasse = coord[0];
- int posSecteurD = coord[1];
- int posSecteurA = coord[2];
-
- int x = posClasse*nbSecteur+posSecteurD;
- int y = posClasse*nbSecteur+posSecteurA;
- // toutes les migrations doivent etre precisees.
- // Peut-etre faire un teste pour que les migrations ne depassent pas 1
- double ancienne_val = mat.getValue(x,x);
- mat.setValue(x,x, ancienne_val - coef);
- if(ancienne_val<0){
- /*#log.info("Erreur dans la migration, un coef est negatif");#*/
- }
- mat.setValue(x, y, coef);
- }
- }
- }
- }
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice de migration", eee);
- }
- return mat;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getEmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
- */
- public MatrixND getEmigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
- return getEmigrationMatrix(N);
- }else{
- MatrixND result = createSpacializedChangeGroupMatrix();
- return result;
- }
- }
-
- protected MatrixND getEmigrationMatrix(MatrixND aN) {
- MatrixND mat = null;
- try{
- Population population = getPopulation();
-
- List<Zone> zones = population.getPopulationZone();
- List<PopulationGroup> groups = population.getPopulationGroup();
-
- int nbSecteur = zones.size();
-
- mat = createSpacializedChangeGroupMatrix();
-
- if (getUseEquationMigration()) {
- // on commence par faire une copie pour ne pas modifier N
- MatrixND N = MatrixFactory.getInstance().create(aN);
-
- Equation eq = getEmigrationEquation();
-
- for (int c=0; c<groups.size(); c++) {
- PopulationGroup group = groups.get(c);
- for (int d=0; d<zones.size(); d++) {
- Zone departureZone = zones.get(d);
-
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
- "departureZone", departureZone
- );
-
- int x = c*nbSecteur+d;
- mat.setValue(x, x, coef);
- }
- }
- } else {
-
- // matrix 3D: Group, departure, arrival
- MatrixND mig = getEmigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
- i.next();
- double coef = i.getValue();
- if (coef != 0) {
- int [] coord = i.getCoordinates();
-
- int posClasse = coord[0];
- int posSecteurD = coord[1];
-
- int x = posClasse*nbSecteur+posSecteurD;
- mat.setValue(x, x, coef);
- }
- }
- }
- }
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice d'emigration", eee);
- }
- return mat;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getImmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
- */
- public MatrixND getImmigrationMatrix(Month month, MatrixND N) {
- if(month.getMonthNumber() == getFirstMonth().getMonthNumber()){
- return getImmigrationMatrix(N);
- }else{
- MatrixND result = createSpacializedChangeGroupMatrix();
- return result;
- }
- }
-
- protected MatrixND getImmigrationMatrix(MatrixND aN) {
- MatrixND mat = null;
- try{
- Population population = getPopulation();
-
- List<Zone> zones = population.getPopulationZone();
- List<PopulationGroup> groups = population.getPopulationGroup();
-
- int nbSecteur = zones.size();
-
- mat = MatrixFactory.getInstance().create(new int[]{groups.size() * nbSecteur});
-
- if (getUseEquationMigration()) {
- // on commence par faire une copie pour ne pas modifier N
- MatrixND N = MatrixFactory.getInstance().create(aN);
-
- Equation eq = getImmigrationEquation();
-
- for (int c=0; c<groups.size(); c++) {
- PopulationGroup group = groups.get(c);
- for (int a=0; a<zones.size(); a++) {
- Zone arrivalZone = zones.get(a);
-
- double coef = eq.evaluate(
- "N", N,
- "pop", population,
- "group", group,
- "arrivalZone", arrivalZone);
-
- int y = c*nbSecteur+a;
- mat.setValue(y, coef);
- }
- }
- } else {
-
- // matrix 3D: Group, departure, arrival
- MatrixND mig = getImmigrationMatrix();
-
- for (MatrixIterator i=mig.iterator(); i.hasNext();) {
- i.next();
- double coef = i.getValue();
- if (coef != 0) {
- int [] coord = i.getCoordinates();
-
- int posClasse = coord[0];
- int posSecteurA = coord[1];
-
- int y = posClasse*nbSecteur+posSecteurA;
- mat.setValue(y, coef);
- }
- }
- }
- }
- catch(Exception eee){
- log.warn("Erreur lors de la creation de la matrice d'immigration", eee);
- }
- return mat;
- }
-
- public void setMigrationEquationAsString(String content) {
- try {
- Equation eq = getMigrationEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("Migration");
- eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(MigrationEquation.class);
- setMigrationEquation(eq);
- }
-
- if (getPopulation() != null) {
- eq.setName(getPopulation().getName() + "(" + toString() + ")");
- }
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setEmigrationEquationAsString(String content) {
- try {
- Equation eq = getEmigrationEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("Emigration");
- eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(EmigrationEquation.class);
- setEmigrationEquation(eq);
- }
-
- if (getPopulation() != null) {
- eq.setName(getPopulation().getName() + "(" + toString() + ")");
- }
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
- }
- }
-
- public void setImmigrationEquationAsString(String content) {
- try {
- Equation eq = getImmigrationEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create equation
- eq = dao.create();
- eq.setCategory("Immigration");
- eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(ImmigrationEquation.class);
- setImmigrationEquation(eq);
- }
-
- if (getPopulation() != null) {
- eq.setName(getPopulation().getName() + "(" + toString() + ")");
- }
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.change.equation"), eee);
- }
- }
-
- /**
- * Construit la matrice de reproduction. C'est un vecteur contenant le
- * nombre d'individu creer par la reproduction. Le vecteur est structure
- * en zone de reproduction.
- */
- public MatrixND getReproductionMatrix(Month month, MatrixND aN) {
- Population pop = getPopulation();
- List<Zone> zoneRepro = pop.getReproductionZone();
- MatrixND result = MatrixFactory.getInstance().create(new List[]{zoneRepro});
- try{
- // on commence par faire une copie pour ne pas modifier N
- MatrixND N = aN.copy();
-
- if(getReproduction()){
- //recuperation de l'equation de reproduction
- Equation e = pop.getReproductionEquation();
-
- //le coeff de repro pour le mois demande
- MatrixND coeff = getReproductionDistribution().copy();
-
- // l'equation doit mettre les resultats dans la matrice result
- e.evaluate(
- "N", N,
- "pop", pop,
- "month", month,
- "prepro", coeff.getValue(month),
- "zoneRepro", zoneRepro,
- "groups", N.getSemantics(0),
- "zones", N.getSemantics(1),
- "result", result
- );
- }
- }catch(Exception eee){
- log.fatal("Error in matrix reproduction creation", eee);
- }
- return result;
- }
-
- public String toString() {
- String result = _("isisfish.populationSeasonInfo.toString", this.getPopulation(), this.getFirstMonth(), this.getLastMonth());
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,803 @@
+/* *##%
+ * 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18n.n_;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixHelper;
+import org.codelutin.math.matrix.MatrixIterator;
+import org.codelutin.math.matrix.MatrixND;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.equation.EmigrationEquation;
+import fr.ifremer.isisfish.equation.ImmigrationEquation;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.MigrationEquation;
+import fr.ifremer.isisfish.types.Month;
+
+/**
+ * PopulationSeasonInfoImpl.java
+ *
+ * Created: 18 mars 2006 15:24:56
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class PopulationSeasonInfoImpl extends PopulationSeasonInfoAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1375563617129149755L;
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(PopulationSeasonInfoImpl.class);
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getReproductionDistribution()
+ */
+ @Override
+ public MatrixND getReproductionDistribution() {
+ MatrixND result = super.getReproductionDistribution();
+ List oldMonths = null;
+
+ if (result != null) {
+ oldMonths = result.getSemantics(0);
+ }
+
+ List<Month> months = getMonths();
+
+ if (!months.equals(oldMonths)) {
+ MatrixND tmp = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.distributionSpawing"),
+ new List[] { months },
+ new String[] { _("isisfish.populationSeasonInfo.months") });
+ tmp.pasteSemantics(result);
+ result = tmp;
+ }
+
+ return result;
+ }
+
+ /**
+ * overload to return matrix if no matrix available. The matrix returned
+ * by this method can't be used directly because it conatins only the
+ * migration (departure != arrival) and not the coefficient that stay on
+ * the same zone. This coefficient is calculated with over coefficient to
+ * have 1 as sum of all coefficient.
+ *
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getMigrationMatrix()
+ */
+ @Override
+ public MatrixND getMigrationMatrix() {
+ // check the validity
+ MatrixND mat = super.getMigrationMatrix();
+ if (getPopulation() != null) {
+ List groups = getPopulation().getPopulationGroup();
+ List zones = getPopulation().getPopulationZone();
+ List[] sems = new List[] { groups, zones, zones };
+
+ if (mat == null) {
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.migration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure"),
+ _("isisfish.populationSeasonInfo.arrival") });
+ // we don't call setCapturability because is better to create a valid
+ // matrix when capturability is null instead check validity and
+ // create new one and paste the old
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.migration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure"),
+ _("isisfish.populationSeasonInfo.arrival") });
+ newmat.pasteSemantics(mat);
+ mat = newmat;
+ // perhaps call setCapturability, but if possible wait the user
+ // call setCapturability explicitly with this new matrix
+ }
+ }
+ return mat;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getEmigrationMatrix()
+ */
+ @Override
+ public MatrixND getEmigrationMatrix() {
+ // check the validity
+ MatrixND mat = super.getEmigrationMatrix();
+ if (getPopulation() != null) {
+ List groups = getPopulation().getPopulationGroup();
+ List zones = getPopulation().getPopulationZone();
+ List[] sems = new List[] { groups, zones };
+
+ if (mat == null) {
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.emigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure") });
+ // we don't call setCapturability because is better to create a valid
+ // matrix when capturability is null instead check validity and
+ // create new one and paste the old
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.populationSeasonInfo.emigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.departure") });
+ newmat.pasteSemantics(mat);
+ mat = newmat;
+ // perhaps call setCapturability, but if possible wait the user
+ // call setCapturability explicitly with this new matrix
+ }
+ }
+ return mat;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfoAbstract#getImmigrationMatrix()
+ */
+ @Override
+ public MatrixND getImmigrationMatrix() {
+ // check the validity
+ MatrixND mat = super.getImmigrationMatrix();
+ if (getPopulation() != null) {
+ List groups = getPopulation().getPopulationGroup();
+ List zones = getPopulation().getPopulationZone();
+ List[] sems = new List[] { groups, zones };
+
+ if (mat == null) {
+ mat = MatrixFactory.getInstance().create(
+ _("isisfish.populationSeasonInfo.immigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.arrival") });
+ // we don't call setCapturability because is better to create a valid
+ // matrix when capturability is null instead check validity and
+ // create new one and paste the old
+ } else if (!Arrays.equals(mat.getSemantics(), sems)) {
+ MatrixND newmat = MatrixFactory.getInstance().create(
+ n_("isisfish.populationSeasonInfo.immigration"),
+ sems,
+ new String[] {
+ _("isisfish.populationSeasonInfo.group"),
+ _("isisfish.populationSeasonInfo.arrival") });
+ newmat.pasteSemantics(mat);
+ mat = newmat;
+ // perhaps call setCapturability, but if possible wait the user
+ // call setCapturability explicitly with this new matrix
+ }
+ }
+ return mat;
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getCapturability(fr.ifremer.isisfish.entities.PopulationGroup)
+ */
+ public double getCapturability(PopulationGroup group) {
+ double result = 0;
+ if (getPopulation() != null) {
+ MatrixND captu = getPopulation().getCapturability();
+ result = captu.getValue(group, this);
+ }
+ return result;
+ }
+
+ /**
+ * Create not initialized no spacialized change group matrix.
+ *
+ * @return
+ */
+ public MatrixND createNoSpacializedChangeGroupMatrix() {
+ Population pop = getPopulation();
+
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { groups, groups });
+ return result;
+ }
+
+ /**
+ * Convert spacialized matrix to non spacialized matrix.
+ *
+ * @param mat spacialized matrix
+ * @return non spacialized matrix
+ */
+ public MatrixND unspacializeLengthChangeMatrix(MatrixND mat) {
+
+ Population pop = getPopulation();
+
+ int nbsecteurs = pop.sizePopulationZone();
+ int nbclasses = pop.sizePopulationGroup();
+
+ MatrixND smallmat = createNoSpacializedChangeGroupMatrix();
+
+ for (int i = 0; i < nbclasses; i++) {
+ for (int j = 0; j < nbclasses; j++) {
+ double val = mat.getValue(i * nbsecteurs, j * nbsecteurs);
+ smallmat.setValue(i, j, val);
+ }
+ }
+ return smallmat;
+ }
+
+ /**
+ * Create not initialized spacialized change group matrix.
+ *
+ * @return
+ */
+ protected MatrixND createSpacializedChangeGroupMatrix() {
+ Population pop = getPopulation();
+
+ List<Zone> zones = pop.getPopulationZone();
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+
+ ArrayList<String> semantique = new ArrayList<String>();
+
+ for (PopulationGroup group : groups) {
+ for (Zone zone : zones) {
+ semantique.add(group + "/" + zone);
+ }
+ }
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { semantique, semantique });
+ return result;
+ }
+
+ /**
+ * Convert no spacialized matrix to spacialized matrix.
+ *
+ * @param mat no spacialized matrix
+ * @return spacialized matrix
+ */
+ public MatrixND spacializeLengthChangeMatrix(MatrixND mat) {
+
+ Population pop = getPopulation();
+
+ int nbsecteurs = pop.sizePopulationZone();
+ int nbclasses = pop.sizePopulationGroup();
+
+ MatrixND bigmat = createSpacializedChangeGroupMatrix();
+
+ for (int i = 0; i < nbclasses; i++) {
+ for (int j = 0; j < nbclasses; j++) {
+ MatrixND matId = MatrixFactory.getInstance().matrixId(
+ nbsecteurs);
+ matId.mults(mat.getValue(i, j));
+ bigmat.paste(new int[] { i * nbsecteurs, j * nbsecteurs },
+ matId);
+ }
+ }
+ return bigmat;
+ }
+
+ /**
+ * Create default non spacialized matrix group changement.
+ *
+ */
+ public MatrixND computeLengthChangeMatrix() {
+
+ int NB_DISCRETISATION = 10;
+
+ Population pop = getPopulation();
+ List<PopulationGroup> groups = pop.getPopulationGroup();
+
+ MatrixND result = createNoSpacializedChangeGroupMatrix();
+
+ for (int i = 0; i < groups.size(); i++) {
+ PopulationGroup group = groups.get(i);
+ double min = group.getMinLength();
+ double max = group.getMaxLength();
+
+ // creation de la matrice de longueurs pour la classe
+ double step = (max - min) / NB_DISCRETISATION;
+ double[] length = new double[NB_DISCRETISATION];
+ length[0] = min;
+ for (int l = 1; l < NB_DISCRETISATION; l++) {
+ length[l] = length[l - 1] + step;
+ }
+
+ // calcul des nouvelles longueurs pour la classe
+ for (int l = 0; l < NB_DISCRETISATION; l++) {
+ double age = pop.getAge(length[l], group);
+ length[l] = pop.getLength(age + 1, group); // + 1 mois
+ }
+
+ // modification de la matrice de changement d'age en fonction
+ // de la vitesse croissance de la classe.
+
+ for (int l = 0; l < NB_DISCRETISATION; l++) {
+ int c = 0;
+ while (c < groups.size()
+ && !groups.get(c).isInLength(length[l])) {
+ c++;
+ }
+ if (c >= groups.size()) {
+ log.warn(_("isisfish.error.acceptable.population")
+ + " (group=" + group + " new length: " + length[l]
+ + ")");
+ // pas retrouver une classe pour cette longueur, on le laisse dans la meme classe.
+ result.setValue(i, i, result.getValue(i, i) + 1);
+ } else {
+ result.setValue(i, c, result.getValue(i, c) + 1); // on ajoute des 1
+ // on divisera par NB_DISCRETISATION juste avant de retourner le
+ // resultat
+ }
+ }
+ }
+ result = result.divs(NB_DISCRETISATION);
+ return result;
+ }
+
+ /**
+ * return change group matrix for the given month
+ * for species in Length, matrix returned is all time spacialized (needed
+ * for simulation)
+ */
+ public MatrixND getGroupChangeMatrix(Month month) {
+ Population pop = getPopulation();
+
+ if (log.isDebugEnabled()) {
+ log.debug("pop: " + pop + " AgeGroup: "
+ + pop.getSpecies().getAgeGroupType() + " groupChange: "
+ + getGroupChange() + " month: " + month + " firstMonth: "
+ + getFirstMonth());
+ }
+
+ // si en longueur
+ if (!pop.getSpecies().getAgeGroupType()) {
+ if (getSimpleLengthChangeMatrix()) {
+ return spacializeLengthChangeMatrix(getLengthChangeMatrix());
+ } else {
+ return getLengthChangeMatrix();
+ }
+ } else if (getGroupChange()
+ && month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
+ // create identity matrix with special 1 for plus group if necessary
+ int nbrAge = pop.sizePopulationGroup();
+ int nbrZone = pop.sizePopulationZone();
+ boolean groupplus = pop.getPlusGroup();
+
+ MatrixND result = createSpacializedChangeGroupMatrix();
+ for (MatrixIterator mi = result.iterator(); mi.next();) {
+ int[] dim = mi.getCoordinates();
+ int i = dim[0];
+ int j = dim[1];
+
+ if (
+ // un element de la diagonale dans le block choisi
+ (i + nbrZone == j) || // calcul pour savoir s'il y a le groupe plus
+ (groupplus
+ // regarde si on est bien dans le dernier block
+ && (nbrAge - 1 == i / nbrZone)
+ // regarde si on est bien sur la diagonal
+ && (i == j))) {
+ mi.setValue(1);
+ }
+ }
+ return result;
+ } else {
+ int nbsecteurs = pop.sizePopulationZone();
+ int nbclasses = pop.sizePopulationGroup();
+
+ int dim = nbsecteurs * nbclasses;
+
+ return MatrixFactory.getInstance().matrixId(dim);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getMigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
+ */
+ public MatrixND getMigrationMatrix(Month month, MatrixND N) {
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
+ return getMigrationMatrix(N);
+ } else {
+ MatrixND result = createSpacializedChangeGroupMatrix();
+ MatrixHelper.convertToId(result);
+ return result;
+ }
+ }
+
+ protected MatrixND getMigrationMatrix(MatrixND aN) {
+ MatrixND mat = null;
+ try {
+ Population population = getPopulation();
+
+ List<Zone> zones = population.getPopulationZone();
+ List<PopulationGroup> groups = population.getPopulationGroup();
+
+ int nbSecteur = zones.size();
+
+ mat = createSpacializedChangeGroupMatrix();
+ MatrixHelper.convertToId(mat);
+
+ if (getUseEquationMigration()) {
+ // on commence par faire une copie pour ne pas modifier N
+ MatrixND N = MatrixFactory.getInstance().create(aN);
+
+ Equation eq = getMigrationEquation();
+
+ for (int c = 0; c < groups.size(); c++) {
+ PopulationGroup group = groups.get(c);
+ for (int d = 0; d < zones.size(); d++) {
+ Zone departureZone = zones.get(d);
+ for (int a = 0; a < zones.size(); a++) {
+ Zone arrivalZone = zones.get(a);
+ if (departureZone.equals(arrivalZone)) {
+ // pour zd == za on ne fait pas le calcul
+ // car au retire automatiquement les autres
+ // valeur de celle-ci
+ continue;
+ }
+
+ double coef = eq.evaluate("N", N, "pop",
+ population, "group", group,
+ "departureZone", departureZone,
+ "arrivalZone", arrivalZone);
+
+ int x = c * nbSecteur + d;
+ int y = c * nbSecteur + a;
+ double ancienne_val = mat.getValue(x, x) - coef;
+ mat.setValue(x, x, ancienne_val);
+ if (ancienne_val < 0) {
+ /*#java.util.logging.Logger.getLogger("fr.ifremer.db.InfoSaisonPop.getMatriceMigration").info("Erreur dans la migration, un coef est negatif");#*/
+ }
+ mat.setValue(x, y, coef);
+ }
+ }
+ }
+ } else {
+
+ // matrix 3D: Group, departure, arrival
+ MatrixND mig = getMigrationMatrix();
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
+ i.next();
+ double coef = i.getValue();
+ if (coef != 0) {
+ int[] coord = i.getCoordinates();
+
+ int posClasse = coord[0];
+ int posSecteurD = coord[1];
+ int posSecteurA = coord[2];
+
+ int x = posClasse * nbSecteur + posSecteurD;
+ int y = posClasse * nbSecteur + posSecteurA;
+ // toutes les migrations doivent etre precisees.
+ // Peut-etre faire un teste pour que les migrations ne depassent pas 1
+ double ancienne_val = mat.getValue(x, x);
+ mat.setValue(x, x, ancienne_val - coef);
+ if (ancienne_val < 0) {
+ /*#log.info("Erreur dans la migration, un coef est negatif");#*/
+ }
+ mat.setValue(x, y, coef);
+ }
+ }
+ }
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice de migration",
+ eee);
+ }
+ return mat;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getEmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
+ */
+ public MatrixND getEmigrationMatrix(Month month, MatrixND N) {
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
+ return getEmigrationMatrix(N);
+ } else {
+ MatrixND result = createSpacializedChangeGroupMatrix();
+ return result;
+ }
+ }
+
+ protected MatrixND getEmigrationMatrix(MatrixND aN) {
+ MatrixND mat = null;
+ try {
+ Population population = getPopulation();
+
+ List<Zone> zones = population.getPopulationZone();
+ List<PopulationGroup> groups = population.getPopulationGroup();
+
+ int nbSecteur = zones.size();
+
+ mat = createSpacializedChangeGroupMatrix();
+
+ if (getUseEquationMigration()) {
+ // on commence par faire une copie pour ne pas modifier N
+ MatrixND N = MatrixFactory.getInstance().create(aN);
+
+ Equation eq = getEmigrationEquation();
+
+ for (int c = 0; c < groups.size(); c++) {
+ PopulationGroup group = groups.get(c);
+ for (int d = 0; d < zones.size(); d++) {
+ Zone departureZone = zones.get(d);
+
+ double coef = eq.evaluate("N", N, "pop", population,
+ "group", group, "departureZone", departureZone);
+
+ int x = c * nbSecteur + d;
+ mat.setValue(x, x, coef);
+ }
+ }
+ } else {
+
+ // matrix 3D: Group, departure, arrival
+ MatrixND mig = getEmigrationMatrix();
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
+ i.next();
+ double coef = i.getValue();
+ if (coef != 0) {
+ int[] coord = i.getCoordinates();
+
+ int posClasse = coord[0];
+ int posSecteurD = coord[1];
+
+ int x = posClasse * nbSecteur + posSecteurD;
+ mat.setValue(x, x, coef);
+ }
+ }
+ }
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice d'emigration",
+ eee);
+ }
+ return mat;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.PopulationSeasonInfo#getImmigrationMatrix(fr.ifremer.isisfish.types.Month, org.codelutin.math.matrix.MatrixND)
+ */
+ public MatrixND getImmigrationMatrix(Month month, MatrixND N) {
+ if (month.getMonthNumber() == getFirstMonth().getMonthNumber()) {
+ return getImmigrationMatrix(N);
+ } else {
+ MatrixND result = createSpacializedChangeGroupMatrix();
+ return result;
+ }
+ }
+
+ protected MatrixND getImmigrationMatrix(MatrixND aN) {
+ MatrixND mat = null;
+ try {
+ Population population = getPopulation();
+
+ List<Zone> zones = population.getPopulationZone();
+ List<PopulationGroup> groups = population.getPopulationGroup();
+
+ int nbSecteur = zones.size();
+
+ mat = MatrixFactory.getInstance().create(
+ new int[] { groups.size() * nbSecteur });
+
+ if (getUseEquationMigration()) {
+ // on commence par faire une copie pour ne pas modifier N
+ MatrixND N = MatrixFactory.getInstance().create(aN);
+
+ Equation eq = getImmigrationEquation();
+
+ for (int c = 0; c < groups.size(); c++) {
+ PopulationGroup group = groups.get(c);
+ for (int a = 0; a < zones.size(); a++) {
+ Zone arrivalZone = zones.get(a);
+
+ double coef = eq.evaluate("N", N, "pop", population,
+ "group", group, "arrivalZone", arrivalZone);
+
+ int y = c * nbSecteur + a;
+ mat.setValue(y, coef);
+ }
+ }
+ } else {
+
+ // matrix 3D: Group, departure, arrival
+ MatrixND mig = getImmigrationMatrix();
+
+ for (MatrixIterator i = mig.iterator(); i.hasNext();) {
+ i.next();
+ double coef = i.getValue();
+ if (coef != 0) {
+ int[] coord = i.getCoordinates();
+
+ int posClasse = coord[0];
+ int posSecteurA = coord[1];
+
+ int y = posClasse * nbSecteur + posSecteurA;
+ mat.setValue(y, coef);
+ }
+ }
+ }
+ } catch (Exception eee) {
+ log.warn("Erreur lors de la creation de la matrice d'immigration",
+ eee);
+ }
+ return mat;
+ }
+
+ public void setMigrationEquationAsString(String content) {
+ try {
+ Equation eq = getMigrationEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Migration");
+ eq.setLanguage(Language.JAVA);
+ eq.setJavaInterface(MigrationEquation.class);
+ setMigrationEquation(eq);
+ }
+
+ if (getPopulation() != null) {
+ eq.setName(getPopulation().getName() + "(" + toString() + ")");
+ }
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setEmigrationEquationAsString(String content) {
+ try {
+ Equation eq = getEmigrationEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Emigration");
+ eq.setLanguage(Language.JAVA);
+ eq.setJavaInterface(EmigrationEquation.class);
+ setEmigrationEquation(eq);
+ }
+
+ if (getPopulation() != null) {
+ eq.setName(getPopulation().getName() + "(" + toString() + ")");
+ }
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ public void setImmigrationEquationAsString(String content) {
+ try {
+ Equation eq = getImmigrationEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ eq = dao.create();
+ eq.setCategory("Immigration");
+ eq.setLanguage(Language.JAVA);
+ eq.setJavaInterface(ImmigrationEquation.class);
+ setImmigrationEquation(eq);
+ }
+
+ if (getPopulation() != null) {
+ eq.setName(getPopulation().getName() + "(" + toString() + ")");
+ }
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.change.equation"), eee);
+ }
+ }
+
+ /**
+ * Construit la matrice de reproduction. C'est un vecteur contenant le
+ * nombre d'individu creer par la reproduction. Le vecteur est structure
+ * en zone de reproduction.
+ */
+ public MatrixND getReproductionMatrix(Month month, MatrixND aN) {
+ Population pop = getPopulation();
+ List<Zone> zoneRepro = pop.getReproductionZone();
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[] { zoneRepro });
+ try {
+ // on commence par faire une copie pour ne pas modifier N
+ MatrixND N = aN.copy();
+
+ if (getReproduction()) {
+ //recuperation de l'equation de reproduction
+ Equation e = pop.getReproductionEquation();
+
+ //le coeff de repro pour le mois demande
+ MatrixND coeff = getReproductionDistribution().copy();
+
+ // l'equation doit mettre les resultats dans la matrice result
+ e.evaluate("N", N, "pop", pop, "month", month, "prepro", coeff
+ .getValue(month), "zoneRepro", zoneRepro, "groups", N
+ .getSemantics(0), "zones", N.getSemantics(1), "result",
+ result);
+ }
+ } catch (Exception eee) {
+ log.fatal("Error in matrix reproduction creation", eee);
+ }
+ return result;
+ }
+
+ public String toString() {
+ String result = _("isisfish.populationSeasonInfo.toString", this
+ .getPopulation(), this.getFirstMonth(), this.getLastMonth());
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,34 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-/**
- * Implantation des operations pour l'entité Port.
- */
-public class PortImpl extends fr.ifremer.isisfish.entities.PortAbstract implements Serializable, fr.ifremer.isisfish.entities.Port {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //PortImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/PortImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,61 @@
+/* *##%
+ * 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.entities;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * Implantation des operations pour l'entité Port.
+ *
+ * Created: 18 mars 2006 15:24:56
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class PortImpl extends PortAbstract {
+
+ /** serialVersionUID.*/
+ private static final long serialVersionUID = 1L;
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //PortImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,113 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * SeasonImpl.java
- *
- * Created: 3 janv. 2006 18:28:19
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import fr.ifremer.isisfish.types.Month;
-import static org.codelutin.i18n.I18n._;
-
-
-/**
- * @author poussin
- *
- */
-
-public class SeasonImpl extends SeasonAbstract {
-
- /** */
- private static final long serialVersionUID = 1L;
-
- /**
- *
- */
- public SeasonImpl() {
- super();
- setFirstMonth(Month.JANUARY);
- setLastMonth(Month.JANUARY);
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Season#getMonths()
- */
- public List<Month> getMonths() {
- List<Month> result = new ArrayList<Month>();
- Month m = getFirstMonth();
- while (m.equals(getLastMonth()) == false) {
- result.add(m);
- m = m.next();
- }
- result.add(m); // add last month because we exit loop before
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Season#setMonths(java.util.List)
- */
- public void setMonths(List<Month> listMonth) {
- if (listMonth == null || listMonth.size() == 0) {
- throw new IllegalArgumentException("listMonth must contains one month or more");
- }
- Month first = listMonth.get(0);
- Month last = listMonth.get(listMonth.size()-1);
-
- setFirstMonth(first);
- setLastMonth(last);
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Season#containsMonth(fr.ifremer.isisfish.types.Month)
- */
- public boolean containsMonth(Month month) {
- boolean result = month.equals(getLastMonth()); // check first last month, because loop don't do that
-
- Month m = getFirstMonth();
- while (result == false && m.equals(getLastMonth()) == false) {
- result = m.equals(month);
- m = m.next();
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.SeasonAbstract#toString()
- */
- @Override
- public String toString() {
- String result = _("isisfish.season.toString", this.getFirstMonth(), this.getLastMonth());
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SeasonImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,106 @@
+/* *##%
+ * 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 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.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import fr.ifremer.isisfish.types.Month;
+import static org.codelutin.i18n.I18n._;
+
+/***
+ * SeasonImpl.
+ *
+ * Created: 3 janv. 2006 18:28:19
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SeasonImpl extends SeasonAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ public SeasonImpl() {
+ super();
+ setFirstMonth(Month.JANUARY);
+ setLastMonth(Month.JANUARY);
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.Season#getMonths()
+ */
+ public List<Month> getMonths() {
+ List<Month> result = new ArrayList<Month>();
+ Month m = getFirstMonth();
+ while (m.equals(getLastMonth()) == false) {
+ result.add(m);
+ m = m.next();
+ }
+ result.add(m); // add last month because we exit loop before
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.Season#setMonths(java.util.List)
+ */
+ public void setMonths(List<Month> listMonth) {
+ if (listMonth == null || listMonth.size() == 0) {
+ throw new IllegalArgumentException(
+ "listMonth must contains one month or more");
+ }
+ Month first = listMonth.get(0);
+ Month last = listMonth.get(listMonth.size() - 1);
+
+ setFirstMonth(first);
+ setLastMonth(last);
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.Season#containsMonth(fr.ifremer.isisfish.types.Month)
+ */
+ public boolean containsMonth(Month month) {
+ boolean result = month.equals(getLastMonth()); // check first last month, because loop don't do that
+
+ Month m = getFirstMonth();
+ while (result == false && m.equals(getLastMonth()) == false) {
+ result = m.equals(month);
+ m = m.next();
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.SeasonAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = _("isisfish.season.toString", this.getFirstMonth(),
+ this.getLastMonth());
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,123 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * SelectivityImpl.java
- *
- * Created: 20 janv. 2006 03:29:14
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.SelectivityEquation;
-
-
-/**
- * @author poussin
- *
- */
-
-public class SelectivityImpl extends SelectivityAbstract implements Selectivity {
-
- /** */
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Selectivity#getCoefficient(double, double, fr.ifremer.isisfish.entities.Metier)
- */
- public double getCoefficient(Population pop, PopulationGroup group, Metier metier) {
- Equation eq = getEquation();
- // poussin 20060823: modification par rapport a la version 2, on ne passe
- // plus age et length mais pop et group sur lequel on pourra recuperer
- // age et length. Ca evite de calculer age et length si on ne les utilise
- // pas dans l'equation
- double result = eq.evaluate("pop", pop, "group", group, "metier", metier);
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.SelectivityAbstract#getEquation()
- */
- @Override
- public Equation getEquation() {
- if (super.getEquation() == null) {
- Equation eq;
- try {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- eq = dao.create();
- eq.setCategory("Selectivity");
- eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(SelectivityEquation.class);
- eq.update();
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException("Can't create equation");
- }
- super.setEquation(eq);
- }
- return super.getEquation();
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.SelectivityAbstract#setGear(fr.ifremer.isisfish.entities.Gear)
- */
- @Override
- public void setGear(Gear value) {
- super.setGear(value);
- setEquationName(getEquation());
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.SelectivityAbstract#setPopulation(fr.ifremer.isisfish.entities.Population)
- */
- @Override
- public void setPopulation(Population value) {
- super.setPopulation(value);
- setEquationName(getEquation());
- }
-
- protected void setEquationName(Equation eq) {
- if (getGear() != null && getPopulation() != null) {
- eq.setName(getGear().getName() + " - " + getPopulation().getName()
- + "(" + getPopulation().getSpecies().getName() + ")");
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = "" + getEquation();
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SelectivityImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,117 @@
+/* *##%
+ * 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 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.entities;
+
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.SelectivityEquation;
+
+/**
+ * SelectivityImpl.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SelectivityImpl extends SelectivityAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.Selectivity#getCoefficient(double, double, fr.ifremer.isisfish.entities.Metier)
+ */
+ public double getCoefficient(Population pop, PopulationGroup group,
+ Metier metier) {
+ Equation eq = getEquation();
+ // poussin 20060823: modification par rapport a la version 2, on ne passe
+ // plus age et length mais pop et group sur lequel on pourra recuperer
+ // age et length. Ca evite de calculer age et length si on ne les utilise
+ // pas dans l'equation
+ double result = eq.evaluate("pop", pop, "group", group, "metier",
+ metier);
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.SelectivityAbstract#getEquation()
+ */
+ @Override
+ public Equation getEquation() {
+ if (super.getEquation() == null) {
+ Equation eq;
+ try {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ eq = dao.create();
+ eq.setCategory("Selectivity");
+ eq.setLanguage(Language.JAVA);
+ eq.setJavaInterface(SelectivityEquation.class);
+ eq.update();
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException("Can't create equation");
+ }
+ super.setEquation(eq);
+ }
+ return super.getEquation();
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.SelectivityAbstract#setGear(fr.ifremer.isisfish.entities.Gear)
+ */
+ @Override
+ public void setGear(Gear value) {
+ super.setGear(value);
+ setEquationName(getEquation());
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.SelectivityAbstract#setPopulation(fr.ifremer.isisfish.entities.Population)
+ */
+ @Override
+ public void setPopulation(Population value) {
+ super.setPopulation(value);
+ setEquationName(getEquation());
+ }
+
+ protected void setEquationName(Equation eq) {
+ if (getGear() != null && getPopulation() != null) {
+ eq.setName(getGear().getName() + " - " + getPopulation().getName()
+ + "(" + getPopulation().getSpecies().getName() + ")");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = "" + getEquation();
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,118 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation;
-import fr.ifremer.isisfish.types.Date;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaException;
-
-/**
- * Implantation des operations pour l'entité SetOfVessels.
- */
-public class SetOfVesselsImpl extends fr.ifremer.isisfish.entities.SetOfVesselsAbstract implements Serializable, fr.ifremer.isisfish.entities.SetOfVessels {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory.getLog(SetOfVesselsImpl.class);
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /**
- * override to change name of equation
- * @see fr.ifremer.isisfish.entities.SetOfVesselsAbstract#setName(java.lang.String)
- */
- @Override
- public void setName(String value) {
- super.setName(value);
- Equation eq = getTechnicalEfficiencyEquation();
- if (eq != null) {
- eq.setName(getName());
- }
- }
-
- /**
- * Compute or return inactivity days
- * @param length length of group
- * @param group group
- * @return age in month
- */
- @Override
- public double getTechnicalEfficiency(Date date, Metier metier) {
- double result = 1;
-
- try {
- Gear gear = metier.getGear();
- Equation eq = getTechnicalEfficiencyEquation();
- if (eq != null) {
- result = eq.evaluate("date", date, "metier", metier, "gear", gear);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in technical efficiency equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- public void setEquationTechnicalEfficiency(String content) {
- try {
- Equation eq = getTechnicalEfficiencyEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create Growth equation
- eq = dao.create();
- eq.setCategory("TechnicalEfficiency");
- eq.setJavaInterface(SoVTechnicalEfficiencyEquation.class);
- eq.setLanguage(Language.JAVA);
- setTechnicalEfficiencyEquation(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //SetOfVesselsImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,142 @@
+/* *##%
+ * 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 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation;
+import fr.ifremer.isisfish.types.Date;
+
+/**
+ * Implantation des operations pour l'entité SetOfVessels.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SetOfVesselsImpl extends SetOfVesselsAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(SetOfVesselsImpl.class);
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /**
+ * Override to change name of equation.
+ *
+ * @see SetOfVesselsAbstract#setName(java.lang.String)
+ */
+ @Override
+ public void setName(String value) {
+ super.setName(value);
+ Equation eq = getTechnicalEfficiencyEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ }
+
+ @Override
+ public double getTechnicalEfficiency(Date date, Metier metier) {
+ double result = 1;
+
+ try {
+ Gear gear = metier.getGear();
+ Equation eq = getTechnicalEfficiencyEquation();
+ if (eq != null) {
+ result = eq.evaluate("date", date, "metier", metier, "gear",
+ gear);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in technical efficiency equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ public void setEquationTechnicalEfficiency(String content) {
+ try {
+ Equation eq = getTechnicalEfficiencyEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create Growth equation
+ eq = dao.create();
+ eq.setCategory("TechnicalEfficiency");
+ eq.setJavaInterface(SoVTechnicalEfficiencyEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setTechnicalEfficiencyEquation(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"),
+ eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //SetOfVesselsImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,34 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-/**
- * Implantation des operations pour l'entité Species.
- */
-public class SpeciesImpl extends fr.ifremer.isisfish.entities.SpeciesAbstract implements Serializable, fr.ifremer.isisfish.entities.Species {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //SpeciesImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/SpeciesImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,61 @@
+/* *##%
+ * 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 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.entities;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * Implantation des operations pour l'entité Species.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SpeciesImpl extends SpeciesAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //SpeciesImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,172 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.StrategyInactivityEquation;
-import fr.ifremer.isisfish.types.Month;
-
-/**
- * Implantation des operations pour l'entité Strategy.
- */
-public class StrategyImpl extends fr.ifremer.isisfish.entities.StrategyAbstract implements Serializable, fr.ifremer.isisfish.entities.Strategy {
-
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(StrategyImpl.class);
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /**
- * override to change name of equation
- * @see fr.ifremer.isisfish.entities.StrategyAbstract#setName(java.lang.String)
- */
- @Override
- public void setName(String value) {
- super.setName(value);
- Equation eq = getInactivityEquation();
- if (eq != null) {
- eq.setName(getName());
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.StrategyAbstract#getStrategyMonthInfo()
- */
- @Override
- public List<StrategyMonthInfo> getStrategyMonthInfo() {
- try {
- List<StrategyMonthInfo> result = super.getStrategyMonthInfo();
- if (result == null) { // Faire le test suivant pose de gros probleme, car il essai de faire un getStrategyMonthInfo et donc ca boucle || result.size() != Month.NUMBER_OF_MONTH) {
- if (result != null) {
- log.warn(_("isisfish.error.strategy.order", getName(), result.size()));
- clearStrategyMonthInfo();
- } else {
- result = new ArrayList<StrategyMonthInfo>(Month.NUMBER_OF_MONTH);
- setStrategyMonthInfo(result);
- }
- for (Month month : Month.MONTH) {
- StrategyMonthInfoDAO dao = IsisFishDAOHelper.getStrategyMonthInfoDAO(getTopiaContext());
- StrategyMonthInfo smi = dao.create();
- smi.setMonth(month);
- smi.setStrategy(this);
- smi.update();
- addStrategyMonthInfo(smi);
- }
- this.update();
- result = super.getStrategyMonthInfo();
- }
- return result;
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException("Can't create StrategyMonthInfo", eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.Strategy#getStrategyMonthInfo(fr.ifremer.isisfish.types.Month)
- */
- public StrategyMonthInfo getStrategyMonthInfo(Month month) {
- List<StrategyMonthInfo> smis = getStrategyMonthInfo();
- StrategyMonthInfo result = smis.get(month.getMonthNumber());
- if (!month.equals(result.getMonth())) {
- // normalement les StrategyMonthInfo sont dans l'ordre mais
- // pour etre sur que ca fonctionne on fait un petit test
- log.warn("StrategyMonthInfo not in month order, i take time to find good StrategyMonthInfo");
- result = null;
- for (StrategyMonthInfo smi : smis) {
- if (month.equals(smi.getMonth())) {
- result = smi;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Compute or return inactivity days
- * @param length length of group
- * @param group group
- * @return age in month
- */
- public double getInactivityDays(Month month) {
- double result = 0;
-
- StrategyMonthInfo info = getStrategyMonthInfo(month);
- if (!getInactivityEquationUsed()) {
- result = info.getMinInactivityDays();
- } else {
- try {
- Equation eq = getInactivityEquation();
- result = eq.evaluate("month", month, "info", info);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in inactivityDays equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- }
- return result;
- }
- public void setEquationInactivity(String content) {
- try {
- Equation eq = getInactivityEquation();
-
- if (eq == null) {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create Growth equation
- eq = dao.create();
- eq.setCategory("Inactivity");
- eq.setJavaInterface(StrategyInactivityEquation.class);
- eq.setLanguage(Language.JAVA);
- setInactivityEquation(eq);
- }
-
- eq.setName(getName());
-
- // Fire
- String _oldValue = eq.getContent();
- fireOnPreWrite("content", _oldValue, content);
-
- eq.setContent(content);
- eq.update();
-
- fireOnPostWrite("content", _oldValue, content);
-
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.StrategyAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //StrategyImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,209 @@
+/* *##%
+ * 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 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.StrategyInactivityEquation;
+import fr.ifremer.isisfish.types.Month;
+
+/**
+ * Implantation des operations pour l'entité Strategy.
+ *
+ * Created: 20 janv. 2006 03:29:14
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class StrategyImpl extends StrategyAbstract {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(StrategyImpl.class);
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /**
+ * Override to change name of equation.
+ *
+ * @see StrategyAbstract#setName(java.lang.String)
+ */
+ @Override
+ public void setName(String value) {
+ super.setName(value);
+ Equation eq = getInactivityEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.StrategyAbstract#getStrategyMonthInfo()
+ */
+ @Override
+ public List<StrategyMonthInfo> getStrategyMonthInfo() {
+ try {
+ List<StrategyMonthInfo> result = super.getStrategyMonthInfo();
+ if (result == null) { // Faire le test suivant pose de gros probleme, car il essai de faire un getStrategyMonthInfo et donc ca boucle || result.size() != Month.NUMBER_OF_MONTH) {
+ if (result != null) {
+ log.warn(_("isisfish.error.strategy.order", getName(),
+ result.size()));
+ clearStrategyMonthInfo();
+ } else {
+ result = new ArrayList<StrategyMonthInfo>(
+ Month.NUMBER_OF_MONTH);
+ setStrategyMonthInfo(result);
+ }
+ for (Month month : Month.MONTH) {
+ StrategyMonthInfoDAO dao = IsisFishDAOHelper
+ .getStrategyMonthInfoDAO(getTopiaContext());
+ StrategyMonthInfo smi = dao.create();
+ smi.setMonth(month);
+ smi.setStrategy(this);
+ smi.update();
+ addStrategyMonthInfo(smi);
+ }
+ this.update();
+ result = super.getStrategyMonthInfo();
+ }
+ return result;
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ "Can't create StrategyMonthInfo", eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.Strategy#getStrategyMonthInfo(fr.ifremer.isisfish.types.Month)
+ */
+ public StrategyMonthInfo getStrategyMonthInfo(Month month) {
+ List<StrategyMonthInfo> smis = getStrategyMonthInfo();
+ StrategyMonthInfo result = smis.get(month.getMonthNumber());
+ if (!month.equals(result.getMonth())) {
+ // normalement les StrategyMonthInfo sont dans l'ordre mais
+ // pour etre sur que ca fonctionne on fait un petit test
+ log
+ .warn("StrategyMonthInfo not in month order, i take time to find good StrategyMonthInfo");
+ result = null;
+ for (StrategyMonthInfo smi : smis) {
+ if (month.equals(smi.getMonth())) {
+ result = smi;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Compute or return inactivity days.
+ *
+ * @param month month
+ * @return age in month
+ */
+ public double getInactivityDays(Month month) {
+ double result = 0;
+
+ StrategyMonthInfo info = getStrategyMonthInfo(month);
+ if (!getInactivityEquationUsed()) {
+ result = info.getMinInactivityDays();
+ } else {
+ try {
+ Equation eq = getInactivityEquation();
+ result = eq.evaluate("month", month, "info", info);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in inactivityDays equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ }
+ return result;
+ }
+
+ public void setEquationInactivity(String content) {
+ try {
+ Equation eq = getInactivityEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create Growth equation
+ eq = dao.create();
+ eq.setCategory("Inactivity");
+ eq.setJavaInterface(StrategyInactivityEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setInactivityEquation(eq);
+ }
+
+ eq.setName(getName());
+
+ // Fire
+ String _oldValue = eq.getContent();
+ fireOnPreWrite("content", _oldValue, content);
+
+ eq.setContent(content);
+ eq.update();
+
+ fireOnPostWrite("content", _oldValue, content);
+
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"),
+ eee);
+ }
+ }
+
+ /*
+ * @see fr.ifremer.isisfish.entities.StrategyAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //StrategyImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,177 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * StrategyMonthInfoImpl.java
- *
- * Created: 29 août 06 11:30:27
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-import static org.codelutin.i18n.I18n.n_;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-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 fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-
-/**
- * @author poussin
- *
- */
-
-public class StrategyMonthInfoImpl extends StrategyMonthInfoAbstract {
-
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(StrategyMonthInfoImpl.class);
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- public double getProportionMetier(Metier metier) {
- double result = 0;
- // on prend le super car ca ne sert a rien de mettre a jour,
- // se le metier n'y ait pas on renvera 0;
- MatrixND mat = super.getProportionMetier();
- if (mat != null) {
- int indice = mat.getSemantics(0).indexOf(metier);
- if (indice >= 0) {
- result = mat.getValue(indice);
- }
- }
- return result;
- }
-
- public void setProportionMetier(Metier metier, double value) {
- MatrixND mat = getProportionMetier();
- if (mat != null) {
- mat = mat.copy();
- mat.setValue(metier, value);
- setProportionMetier(mat);
- } else {
- log.warn("Can't set proportion of metier, not enough information available");
- }
- }
-
- @Override
- public MatrixND getProportionMetier() {
- if (getStrategy() == null
- || getStrategy().getSetOfVessels() == null
- || getStrategy().getSetOfVessels().getPossibleMetiers() == null) {
- return null;
- }
-
- Collection<EffortDescription> efforts = getStrategy().getSetOfVessels().getPossibleMetiers();
-
- List<Metier> metiers = new ArrayList<Metier>(efforts.size());
- for (EffortDescription effort : efforts) {
- metiers.add(effort.getPossibleMetiers());
- }
-
- if (metiers.size() <= 0) {
- return null;
- }
-
- MatrixND result = super.getProportionMetier();
-
- if (result == null) {
- result = MatrixFactory.getInstance().create(
- _("isisfish.strategyMonthInfo.proportion"),
- new List[]{metiers},
- new String[]{_("isisfish.strategyMonthInfo.metier")}
- );
- } else if (!result.getSemantics(0).equals(metiers)) {
- MatrixND tmp = MatrixFactory.getInstance().create(
- _("isisfish.strategyMonthInfo.proportion"),
- new List[]{metiers},
- new String[]{_("isisfish.strategyMonthInfo.metier")}
- );
- tmp.pasteSemantics(result);
- result = tmp;
- }
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.StrategyMonthInfoAbstract#setTripType(fr.ifremer.isisfish.entities.TripType)
- */
- @Override
- public void setTripType(TripType value) {
- super.setTripType(value);
- computeNumberOfTrips();
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.StrategyMonthInfoAbstract#setMinInactivityDays(int)
- */
- @Override
- public void setMinInactivityDays(double value) {
- super.setMinInactivityDays(value);
- computeNumberOfTrips();
- }
-
- public void computeNumberOfTrips() {
- TripType tripType = getTripType();
- // remplace un simple getMinInactivityDays(), pour pouvoir utiliser une
- // equation si besoin (tout est pret, il ne manque que l'interface
- // graphique pour saisir l'equation dans strategie
- double inactivity = getStrategy().getInactivityDays(getMonth());
- if(tripType != null && tripType.getTripDuration() != null && inactivity >= 0){
- int nbDayMonth = getMonth().getNumbersOfDays();
- double result = (nbDayMonth - inactivity) / tripType.getTripDuration().getDay();
- setNumberOfTrips(result);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = _("isisfish.strategyMonthInfo.toString", this.getStrategy(), this.getMonth());
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,173 @@
+/* *##%
+ * 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+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 fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * StrategyMonthInfoImpl.
+ *
+ * Created: 29 août 06 11:30:27
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class StrategyMonthInfoImpl extends StrategyMonthInfoAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 4266095355294103240L;
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(StrategyMonthInfoImpl.class);
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ public double getProportionMetier(Metier metier) {
+ double result = 0;
+ // on prend le super car ca ne sert a rien de mettre a jour,
+ // se le metier n'y ait pas on renvera 0;
+ MatrixND mat = super.getProportionMetier();
+ if (mat != null) {
+ int indice = mat.getSemantics(0).indexOf(metier);
+ if (indice >= 0) {
+ result = mat.getValue(indice);
+ }
+ }
+ return result;
+ }
+
+ public void setProportionMetier(Metier metier, double value) {
+ MatrixND mat = getProportionMetier();
+ if (mat != null) {
+ mat = mat.copy();
+ mat.setValue(metier, value);
+ setProportionMetier(mat);
+ } else {
+ log
+ .warn("Can't set proportion of metier, not enough information available");
+ }
+ }
+
+ @Override
+ public MatrixND getProportionMetier() {
+ if (getStrategy() == null || getStrategy().getSetOfVessels() == null
+ || getStrategy().getSetOfVessels().getPossibleMetiers() == null) {
+ return null;
+ }
+
+ Collection<EffortDescription> efforts = getStrategy().getSetOfVessels()
+ .getPossibleMetiers();
+
+ List<Metier> metiers = new ArrayList<Metier>(efforts.size());
+ for (EffortDescription effort : efforts) {
+ metiers.add(effort.getPossibleMetiers());
+ }
+
+ if (metiers.size() <= 0) {
+ return null;
+ }
+
+ MatrixND result = super.getProportionMetier();
+
+ if (result == null) {
+ result = MatrixFactory.getInstance().create(
+ _("isisfish.strategyMonthInfo.proportion"),
+ new List[] { metiers },
+ new String[] { _("isisfish.strategyMonthInfo.metier") });
+ } else if (!result.getSemantics(0).equals(metiers)) {
+ MatrixND tmp = MatrixFactory.getInstance().create(
+ _("isisfish.strategyMonthInfo.proportion"),
+ new List[] { metiers },
+ new String[] { _("isisfish.strategyMonthInfo.metier") });
+ tmp.pasteSemantics(result);
+ result = tmp;
+ }
+
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.StrategyMonthInfoAbstract#setTripType(fr.ifremer.isisfish.entities.TripType)
+ */
+ @Override
+ public void setTripType(TripType value) {
+ super.setTripType(value);
+ computeNumberOfTrips();
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.StrategyMonthInfoAbstract#setMinInactivityDays(int)
+ */
+ @Override
+ public void setMinInactivityDays(double value) {
+ super.setMinInactivityDays(value);
+ computeNumberOfTrips();
+ }
+
+ public void computeNumberOfTrips() {
+ TripType tripType = getTripType();
+ // remplace un simple getMinInactivityDays(), pour pouvoir utiliser une
+ // equation si besoin (tout est pret, il ne manque que l'interface
+ // graphique pour saisir l'equation dans strategie
+ double inactivity = getStrategy().getInactivityDays(getMonth());
+ if (tripType != null && tripType.getTripDuration() != null
+ && inactivity >= 0) {
+ int nbDayMonth = getMonth().getNumbersOfDays();
+ double result = (nbDayMonth - inactivity)
+ / tripType.getTripDuration().getDay();
+ setNumberOfTrips(result);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = _("isisfish.strategyMonthInfo.toString", this
+ .getStrategy(), this.getMonth());
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,140 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * TargetSpeciesImpl.java
- *
- * Created: 23 août 2006 16:38:23
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.entities;
-
-import static org.codelutin.i18n.I18n._;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.equation.Language;
-import fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation;
-
-
-/**
- * @author poussin
- *
- */
-
-public class TargetSpeciesImpl extends TargetSpeciesAbstract {
-
- /** to use log facility, just put in your code: log.info("..."); */
- static private Log log = LogFactory.getLog(TargetSpeciesImpl.class);
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#getTargetFactorEquation()
- */
- @Override
- public Equation getTargetFactorEquation() {
- if (super.getTargetFactorEquation() == null) {
- try {
- EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
- // create equation
- Equation eq = dao.create();
- eq.setCategory("TargetFactor");
- eq.setLanguage(Language.JAVA);
- eq.setJavaInterface(TargetSpeciesTargetFactorEquation.class);
- eq.update();
- setTargetFactorEquation(eq);
- } catch (TopiaException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.create.equation"), eee);
- }
-
- }
- return super.getTargetFactorEquation();
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setMetierSeasonInfo(fr.ifremer.isisfish.entities.MetierSeasonInfo)
- */
- @Override
- public void setMetierSeasonInfo(MetierSeasonInfo value) {
- super.setMetierSeasonInfo(value);
- setEquationName(getTargetFactorEquation());
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setSpecies(fr.ifremer.isisfish.entities.Species)
- */
- @Override
- public void setSpecies(Species value) {
- super.setSpecies(value);
- setEquationName(getTargetFactorEquation());
- }
-
- protected void setEquationName(Equation eq) {
- if (getMetierSeasonInfo() != null && getMetierSeasonInfo().getMetier() != null
- && getSpecies() != null) {
- eq.setName(getMetierSeasonInfo().getMetier().getName()+ "-" +
- getSpecies().getName() + "(" + getMetierSeasonInfo().toString() + ")");
- }
- }
-
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.TargetSpecies#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
- */
- public double getTargetFactor(PopulationGroup group) {
- double result = 0;
- try {
- Equation eq = getTargetFactorEquation();
- Species species = getSpecies();
- MetierSeasonInfo msi = getMetierSeasonInfo();
- boolean primaryCatch = getPrimaryCatch();
- result = eq.evaluate("group", group, "species", species,
- "infoMetier", msi, "primaryCatch", primaryCatch);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Error in target factor equation");
- }
- if (log.isDebugEnabled()) {
- log.debug("StackTrace", eee);
- }
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = "" + getTargetFactorEquation();
- return result;
- }
-
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TargetSpeciesImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,137 @@
+/* *##%
+ * 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.entities;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.TargetSpeciesTargetFactorEquation;
+
+/**
+ * TargetSpeciesImpl.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class TargetSpeciesImpl extends TargetSpeciesAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8028733540961872729L;
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(TargetSpeciesImpl.class);
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#getTargetFactorEquation()
+ */
+ @Override
+ public Equation getTargetFactorEquation() {
+ if (super.getTargetFactorEquation() == null) {
+ try {
+ EquationDAO dao = IsisFishDAOHelper
+ .getEquationDAO(getTopiaContext());
+ // create equation
+ Equation eq = dao.create();
+ eq.setCategory("TargetFactor");
+ eq.setLanguage(Language.JAVA);
+ eq.setJavaInterface(TargetSpeciesTargetFactorEquation.class);
+ eq.update();
+ setTargetFactorEquation(eq);
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.create.equation"), eee);
+ }
+
+ }
+ return super.getTargetFactorEquation();
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setMetierSeasonInfo(fr.ifremer.isisfish.entities.MetierSeasonInfo)
+ */
+ @Override
+ public void setMetierSeasonInfo(MetierSeasonInfo value) {
+ super.setMetierSeasonInfo(value);
+ setEquationName(getTargetFactorEquation());
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.TargetSpeciesAbstract#setSpecies(fr.ifremer.isisfish.entities.Species)
+ */
+ @Override
+ public void setSpecies(Species value) {
+ super.setSpecies(value);
+ setEquationName(getTargetFactorEquation());
+ }
+
+ protected void setEquationName(Equation eq) {
+ if (getMetierSeasonInfo() != null
+ && getMetierSeasonInfo().getMetier() != null
+ && getSpecies() != null) {
+ eq.setName(getMetierSeasonInfo().getMetier().getName() + "-"
+ + getSpecies().getName() + "("
+ + getMetierSeasonInfo().toString() + ")");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.TargetSpecies#targetFactor(fr.ifremer.isisfish.entities.PopulationGroup)
+ */
+ public double getTargetFactor(PopulationGroup group) {
+ double result = 0;
+ try {
+ Equation eq = getTargetFactorEquation();
+ Species species = getSpecies();
+ MetierSeasonInfo msi = getMetierSeasonInfo();
+ boolean primaryCatch = getPrimaryCatch();
+ result = eq.evaluate("group", group, "species", species,
+ "infoMetier", msi, "primaryCatch", primaryCatch);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in target factor equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = "" + getTargetFactorEquation();
+ return result;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,46 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-import fr.ifremer.isisfish.types.TimeUnit;
-
-/**
- * Implantation des operations pour l'entité TripType.
- */
-public class TripTypeImpl extends fr.ifremer.isisfish.entities.TripTypeAbstract implements Serializable, fr.ifremer.isisfish.entities.TripType {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.codelutin.topia.persistence.TopiaEntityAbstract#postCreate()
- */
- @Override
- public void postCreate() throws TopiaException {
- setMinTimeBetweenTrip(new TimeUnit(0));
- setTripDuration(new TimeUnit(0));
- }
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.TripTypeAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName() + "(" + getTripDuration() + ":" + getMinTimeBetweenTrip() + ")";
- return result;
- }
-
-} //TripTypeImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/TripTypeImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,74 @@
+/* *##%
+ * 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.entities;
+
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.types.TimeUnit;
+
+/**
+ * Implantation des operations pour l'entité TripType.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class TripTypeImpl extends TripTypeAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see org.codelutin.topia.persistence.TopiaEntityAbstract#postCreate()
+ */
+ @Override
+ public void postCreate() throws TopiaException {
+ setMinTimeBetweenTrip(new TimeUnit(0));
+ setTripDuration(new TimeUnit(0));
+ }
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.TripTypeAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName() + "(" + getTripDuration() + ":"
+ + getMinTimeBetweenTrip() + ")";
+ return result;
+ }
+
+} //TripTypeImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,45 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-import fr.ifremer.isisfish.types.TimeUnit;
-
-/**
- * Implantation des operations pour l'entité VesselType.
- */
-public class VesselTypeImpl extends fr.ifremer.isisfish.entities.VesselTypeAbstract implements Serializable, fr.ifremer.isisfish.entities.VesselType {
-
- private static final long serialVersionUID = 1L;
-
- /* (non-Javadoc)
- * @see org.codelutin.topia.persistence.TopiaEntityAbstract#postCreate()
- */
- @Override
- public void postCreate() throws TopiaException {
- setMaxTripDuration(new TimeUnit(0));
- }
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //VesselTypeImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/VesselTypeImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,72 @@
+/* *##%
+ * 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.entities;
+
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.types.TimeUnit;
+
+/**
+ * Implantation des operations pour l'entité VesselType.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VesselTypeImpl extends VesselTypeAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see org.codelutin.topia.persistence.TopiaEntityAbstract#postCreate()
+ */
+ @Override
+ public void postCreate() throws TopiaException {
+ setMaxTripDuration(new TimeUnit(0));
+ }
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //VesselTypeImpl
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,34 +0,0 @@
-package fr.ifremer.isisfish.entities;
-
-import java.io.Serializable;
-
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.StorageException;
-
-/**
- * Implantation des operations pour l'entité Zone.
- */
-public class ZoneImpl extends fr.ifremer.isisfish.entities.ZoneAbstract implements Serializable, fr.ifremer.isisfish.entities.Zone {
-
- private static final long serialVersionUID = 1L;
-
- public FisheryRegion getFisheryRegion() {
- try {
- FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
- return result;
- } catch (StorageException eee) {
- throw new IsisFishRuntimeException(eee);
- }
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
- */
- @Override
- public String toString() {
- String result = getName();
- return result;
- }
-
-} //ZoneImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/ZoneImpl.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,61 @@
+/* *##%
+ * 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.entities;
+
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.StorageException;
+
+/**
+ * Implantation des operations pour l'entité Zone.
+ *
+ * Created: 23 août 2006 16:38:23
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ZoneImpl extends ZoneAbstract {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ public FisheryRegion getFisheryRegion() {
+ try {
+ FisheryRegion result = RegionStorage
+ .getFisheryRegion(getTopiaContext());
+ return result;
+ } catch (StorageException eee) {
+ throw new IsisFishRuntimeException(eee);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
+ */
+ @Override
+ public String toString() {
+ String result = getName();
+ return result;
+ }
+
+} //ZoneImpl
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/package-info.java (from rev 2081, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/entities/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,5 @@
+/**
+ * Database storage migration.
+ */
+package fr.ifremer.isisfish.entities;
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,372 +0,0 @@
-/* *##%
- * 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.simulator;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.topia.TopiaException;
-
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-
-/**
- * Keep all information on one simulation.
- *
- * <li> Launch parameter
- * <li> Database (TopiaContext)
- * <li> SimulationControl
- * <li> Effectif by pop (N)
- * <li> Result
- *
- * Created: 3 juil. 2006 17:05:27
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class SimulationContext {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulationContext.class);
-
- protected Map<String, Object> values = new HashMap<String, Object>();
- protected SimulationStorage simulation = null;
- protected SimulationControl simulationControl = null;
- protected PopulationMonitor populationMonitor = null;
- protected MetierMonitor metierMonitor = null;
- protected RuleMonitor ruleMonitor = null;
- protected ResultManager resultManager = null;
- protected Set<SimulationListener> simulationListeners = new LinkedHashSet<SimulationListener>();
- protected ClassLoader classLoader = null;
- protected File scriptDirectory;
-
- /** TopiaContext must be used by rule action to modify data */
- protected TopiaContext db = null;
-
- /** TopiaContext must be used to save result */
- protected TopiaContext dbResult = null;
-
- /** Context value used in equation. */
- protected Map<String, Double> contextEquationValue = new HashMap<String, Double>();
- /** Operator used in equation values */
- protected Map<String, String> contextEquationOperator = new HashMap<String, String>();
-
- private static ThreadLocal<SimulationContext> simulationContext = new ThreadLocal<SimulationContext>() {
- protected synchronized SimulationContext initialValue() {
- return new SimulationContext();
- }
- };
-
- protected SimulationContext() {
-
- }
-
- /**
- * @return simulation context for the current simulation (current thread)
- */
- public static SimulationContext get() {
- return simulationContext.get();
- }
-
- /**
- * remove simulation associate with current thread
- */
- public static void remove() {
- SimulationContext current = get();
- current.values.clear();
- current.classLoader = null;
- simulationContext.remove();
- }
-
- /**
- * Add simulation listener, if listener is {@link SimulationResultListener}, it's
- * automatically added as listener on {@link ResultManager}
- * @param l
- */
- public void addSimulationListener(SimulationListener l) {
- simulationListeners.add(l);
- if (l instanceof SimulationResultListener) {
- getResultManager().addSimulationResultListener(
- (SimulationResultListener) l);
- }
- }
-
- public void closeDB() {
- if (db != null) {
- try {
- db.closeContext();
- } catch (TopiaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't close simulation topia context", eee);
- }
- }
- }
- }
-
- public void closeDBResult() {
- if (dbResult != null) {
- try {
- dbResult.commitTransaction();
- dbResult.closeContext();
- } catch (TopiaException eee) {
- if (log.isDebugEnabled()) {
- log.debug("Can't close simulation result topia context",
- eee);
- }
- }
- }
- }
-
- /**
- * Remove simulation listener, if listener is {@link SimulationResultListener}, it's
- * Automatically removed as listener on {@link ResultManager}
- * @param l
- */
- public void removeSimulationListener(SimulationListener l) {
- simulationListeners.remove(l);
- if (l instanceof SimulationResultListener) {
- getResultManager().addSimulationResultListener(
- (SimulationResultListener) l);
- }
- }
-
- public void fireBeforeSimulation() {
- for (SimulationListener l : simulationListeners) {
- l.beforeSimulation(this);
- }
- }
-
- public void fireAfterSimulation() {
- for (SimulationListener l : simulationListeners) {
- l.afterSimulation(this);
- }
- }
-
- /**
- * @return Returns the classLoader.
- */
- public ClassLoader getClassLoader() {
- return this.classLoader;
- }
-
- /**
- * @param classLoader The classLoader to set.
- */
- public void setClassLoader(ClassLoader classLoader) {
- this.classLoader = classLoader;
- }
-
- /**
- * Permet de recuperer une valeur prealablement stocker avec un setValue
- * @param name le nom de la valeur souhaitée
- * @return la valeur ou null si aucune valeur ne porte se nom
- */
- public Object getValue(String name) {
- Object result = values.get(name);
- return result;
- }
-
- /**
- * Permet de stocker une valeur en fonction d'une cle, cela peut-etre util
- * pour partager des informations entre Rule ou d'autre objet.
- * @param name le nom de la valeur
- * @param value la valeur
- */
- public void setValue(String name, Object value) {
- values.put(name, value);
- }
-
- /**
- * @return Returns the topiaContext.
- */
- public SimulationStorage getSimulationStorage() {
- return this.simulation;
- }
-
- /**
- * @param simulation The simulation storage to set.
- */
- public void setSimulationStorage(SimulationStorage simulation) {
- this.simulation = simulation;
- }
-
- /**
- * @return Returns the simulationControl.
- */
- public SimulationControl getSimulationControl() {
- return this.simulationControl;
- }
-
- /**
- * @param simulationControl The simulationControl to set.
- */
- public void setSimulationControl(SimulationControl simulationControl) {
- this.simulationControl = simulationControl;
- }
-
- /**
- * @return Returns the populationMonitor.
- */
- public PopulationMonitor getPopulationMonitor() {
- if (this.populationMonitor == null) {
- this.populationMonitor = new PopulationMonitor();
- }
- return this.populationMonitor;
- }
-
- /**
- * @return Returns the metierMonitor.
- */
- public MetierMonitor getMetierMonitor() {
- if (this.metierMonitor == null) {
- this.metierMonitor = new MetierMonitor();
- }
- return this.metierMonitor;
- }
-
- /**
- * @return Returns the ruleMonitor.
- */
- public RuleMonitor getRuleMonitor() {
- if (this.ruleMonitor == null) {
- this.ruleMonitor = new RuleMonitor();
- }
- return this.ruleMonitor;
- }
-
- /**
- * @return Returns the resultManager.
- */
- public ResultManager getResultManager() {
- if (this.resultManager == null) {
- this.resultManager = new ResultManager(this);
- }
- return this.resultManager;
- }
-
- /**
- * This method return TopiaContext that Rule action must used to modify
- * data. This TopiaContext is rollbacked after each step.
- * @return TopiaContext that Rule action must used
- * @throws TopiaException
- */
- public TopiaContext getDB() throws TopiaException {
- if (db == null && getSimulationStorage() != null) {
- db = getSimulationStorage().getMemStorage().beginTransaction();
- }
- return db;
- }
-
- /**
- * this method return TopiaContext that must be used to save result
- * @return Returns the dbResult.
- * @throws TopiaException
- */
- public TopiaContext getDbResult() throws TopiaException {
- if (dbResult == null && getSimulationStorage() != null) {
- dbResult = getSimulationStorage().getStorage().beginTransaction();
- }
- return this.dbResult;
- }
-
- /**
- * @return Returns the scriptDirectory.
- */
- public File getScriptDirectory() {
- return this.scriptDirectory;
- }
-
- /**
- * @param scriptDirectory
- */
- public void setScriptDirectory(File scriptDirectory) {
- this.scriptDirectory = scriptDirectory;
- }
-
- /**
- * @param message message
- */
- public void message(String message) {
- log.info(message);
- if (getSimulationControl() != null) {
- getSimulationControl().setText(message);
- }
- }
-
- /**
- * Add value/key pair into context.
- *
- * @param key key
- * @param value value
- * @param operator operator
- */
- public void setValue(String key, Double value, String operator) {
- contextEquationValue.put(key, value);
- contextEquationOperator.put(key, operator);
- }
-
- /**
- * Return value from context.
- *
- * @param key key
- * @param defaultValue default value or value to compute
- * @return computed value or <tt>defaultValue</tt> if not found
- */
- public double getValueAndCompute(String key, double defaultValue) {
-
- double result = defaultValue;
-
- if (contextEquationValue.containsKey(key) && contextEquationOperator.containsKey(key)) {
- Double value = contextEquationValue.get(key);
- String operator = contextEquationOperator.get(key);
-
- if ("+".equals(operator)) {
- result = value + defaultValue;
- }
- else if ("-".equals(operator)) {
- result = value - defaultValue;
- }
- else if ("*".equals(operator)) {
- result = value * defaultValue;
- }
- else if ("/".equals(operator)) {
- result = value / defaultValue;
- }
- else {
- throw new IllegalArgumentException("Unknown operator '" + operator + "'");
- }
- }
- else {
- if (log.isWarnEnabled()) {
- log.warn("No key defined for key '" + key + "' in context");
- }
- }
-
- return result;
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java (from rev 2085, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,377 @@
+/* *##%
+ * 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.simulator;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.TopiaException;
+
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+
+/**
+ * Keep all information on one simulation.
+ *
+ * <li> Launch parameter
+ * <li> Database (TopiaContext)
+ * <li> SimulationControl
+ * <li> Effectif by pop (N)
+ * <li> Result
+ *
+ * Created: 3 juil. 2006 17:05:27
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SimulationContext {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(SimulationContext.class);
+
+ protected Map<String, Object> values = new HashMap<String, Object>();
+ protected SimulationStorage simulation = null;
+ protected SimulationControl simulationControl = null;
+ protected PopulationMonitor populationMonitor = null;
+ protected MetierMonitor metierMonitor = null;
+ protected RuleMonitor ruleMonitor = null;
+ protected ResultManager resultManager = null;
+ protected Set<SimulationListener> simulationListeners = new LinkedHashSet<SimulationListener>();
+ protected ClassLoader classLoader = null;
+ protected File scriptDirectory;
+
+ /** TopiaContext must be used by rule action to modify data */
+ protected TopiaContext db = null;
+
+ /** TopiaContext must be used to save result */
+ protected TopiaContext dbResult = null;
+
+ /** Context value used in equation. */
+ protected Map<String, Double> contextEquationValue = new HashMap<String, Double>();
+ /** Operator used in equation values */
+ protected Map<String, String> contextEquationOperator = new HashMap<String, String>();
+
+ private static ThreadLocal<SimulationContext> simulationContext = new ThreadLocal<SimulationContext>() {
+ protected synchronized SimulationContext initialValue() {
+ return new SimulationContext();
+ }
+ };
+
+ protected SimulationContext() {
+
+ }
+
+ /**
+ * @return simulation context for the current simulation (current thread)
+ */
+ public static SimulationContext get() {
+ return simulationContext.get();
+ }
+
+ /**
+ * remove simulation associate with current thread
+ */
+ public static void remove() {
+ SimulationContext current = get();
+ current.values.clear();
+ current.classLoader = null;
+ simulationContext.remove();
+ }
+
+ /**
+ * Add simulation listener, if listener is {@link SimulationResultListener}, it's
+ * automatically added as listener on {@link ResultManager}
+ * @param l
+ */
+ public void addSimulationListener(SimulationListener l) {
+ simulationListeners.add(l);
+ if (l instanceof SimulationResultListener) {
+ getResultManager().addSimulationResultListener(
+ (SimulationResultListener) l);
+ }
+ }
+
+ public void closeDB() {
+ if (db != null) {
+ try {
+ db.closeContext();
+ } catch (TopiaException eee) {
+ if (log.isDebugEnabled()) {
+ log.debug("Can't close simulation topia context", eee);
+ }
+ }
+ }
+ }
+
+ public void closeDBResult() {
+ if (dbResult != null) {
+ try {
+ dbResult.commitTransaction();
+ dbResult.closeContext();
+ } catch (TopiaException eee) {
+ if (log.isDebugEnabled()) {
+ log.debug("Can't close simulation result topia context",
+ eee);
+ }
+ }
+ }
+ }
+
+ /**
+ * Remove simulation listener, if listener is {@link SimulationResultListener}, it's
+ * Automatically removed as listener on {@link ResultManager}
+ * @param l
+ */
+ public void removeSimulationListener(SimulationListener l) {
+ simulationListeners.remove(l);
+ if (l instanceof SimulationResultListener) {
+ getResultManager().addSimulationResultListener(
+ (SimulationResultListener) l);
+ }
+ }
+
+ public void fireBeforeSimulation() {
+ for (SimulationListener l : simulationListeners) {
+ l.beforeSimulation(this);
+ }
+ }
+
+ public void fireAfterSimulation() {
+ for (SimulationListener l : simulationListeners) {
+ l.afterSimulation(this);
+ }
+ }
+
+ /**
+ * @return Returns the classLoader.
+ */
+ public ClassLoader getClassLoader() {
+ return this.classLoader;
+ }
+
+ /**
+ * @param classLoader The classLoader to set.
+ */
+ public void setClassLoader(ClassLoader classLoader) {
+ this.classLoader = classLoader;
+ }
+
+ /**
+ * Permet de recuperer une valeur prealablement stocker avec un setValue
+ * @param name le nom de la valeur souhaitée
+ * @return la valeur ou null si aucune valeur ne porte se nom
+ */
+ public Object getValue(String name) {
+ Object result = values.get(name);
+ return result;
+ }
+
+ /**
+ * Permet de stocker une valeur en fonction d'une cle, cela peut-etre util
+ * pour partager des informations entre Rule ou d'autre objet.
+ * @param name le nom de la valeur
+ * @param value la valeur
+ */
+ public void setValue(String name, Object value) {
+ values.put(name, value);
+ }
+
+ /**
+ * @return Returns the topiaContext.
+ */
+ public SimulationStorage getSimulationStorage() {
+ return this.simulation;
+ }
+
+ /**
+ * @param simulation The simulation storage to set.
+ */
+ public void setSimulationStorage(SimulationStorage simulation) {
+ this.simulation = simulation;
+ }
+
+ /**
+ * @return Returns the simulationControl.
+ */
+ public SimulationControl getSimulationControl() {
+ return this.simulationControl;
+ }
+
+ /**
+ * @param simulationControl The simulationControl to set.
+ */
+ public void setSimulationControl(SimulationControl simulationControl) {
+ this.simulationControl = simulationControl;
+ }
+
+ /**
+ * @return Returns the populationMonitor.
+ */
+ public PopulationMonitor getPopulationMonitor() {
+ if (this.populationMonitor == null) {
+ this.populationMonitor = new PopulationMonitor();
+ }
+ return this.populationMonitor;
+ }
+
+ /**
+ * @return Returns the metierMonitor.
+ */
+ public MetierMonitor getMetierMonitor() {
+ if (this.metierMonitor == null) {
+ this.metierMonitor = new MetierMonitor();
+ }
+ return this.metierMonitor;
+ }
+
+ /**
+ * @return Returns the ruleMonitor.
+ */
+ public RuleMonitor getRuleMonitor() {
+ if (this.ruleMonitor == null) {
+ this.ruleMonitor = new RuleMonitor();
+ }
+ return this.ruleMonitor;
+ }
+
+ /**
+ * @return Returns the resultManager.
+ */
+ public ResultManager getResultManager() {
+ if (this.resultManager == null) {
+ this.resultManager = new ResultManager(this);
+ }
+ return this.resultManager;
+ }
+
+ /**
+ * This method return TopiaContext that Rule action must used to modify
+ * data. This TopiaContext is rollbacked after each step.
+ * @return TopiaContext that Rule action must used
+ * @throws TopiaException
+ */
+ public TopiaContext getDB() throws TopiaException {
+ if (db == null && getSimulationStorage() != null) {
+ db = getSimulationStorage().getMemStorage().beginTransaction();
+ }
+ return db;
+ }
+
+ /**
+ * this method return TopiaContext that must be used to save result
+ * @return Returns the dbResult.
+ * @throws TopiaException
+ */
+ public TopiaContext getDbResult() throws TopiaException {
+ if (dbResult == null && getSimulationStorage() != null) {
+ dbResult = getSimulationStorage().getStorage().beginTransaction();
+ }
+ return this.dbResult;
+ }
+
+ /**
+ * @return Returns the scriptDirectory.
+ */
+ public File getScriptDirectory() {
+ return this.scriptDirectory;
+ }
+
+ /**
+ * @param scriptDirectory
+ */
+ public void setScriptDirectory(File scriptDirectory) {
+ this.scriptDirectory = scriptDirectory;
+ }
+
+ /**
+ * @param message message
+ */
+ public void message(String message) {
+ log.info(message);
+ if (getSimulationControl() != null) {
+ getSimulationControl().setText(message);
+ }
+ }
+
+ /**
+ * Add value/key pair into context.
+ *
+ * @param key key
+ * @param value value
+ * @param operator operator
+ */
+ public void setValue(String key, Double value, String operator) {
+ contextEquationValue.put(key, value);
+ contextEquationOperator.put(key, operator);
+ }
+
+ /**
+ * Return value from context.
+ *
+ * @param key key
+ * @param defaultValue default value or value to compute
+ * @return computed value or <tt>defaultValue</tt> if not found
+ */
+ public double getValueAndCompute(String key, double defaultValue) {
+
+ double result = defaultValue;
+
+ if (contextEquationValue.containsKey(key) && contextEquationOperator.containsKey(key)) {
+
+ Double value = contextEquationValue.get(key);
+ String operator = contextEquationOperator.get(key);
+
+ if (log.isTraceEnabled()) {
+ log.trace("Found key '" + key + "' current value = " + value);
+ }
+
+ if ("+".equals(operator)) {
+ result = value + defaultValue;
+ }
+ else if ("-".equals(operator)) {
+ result = value - defaultValue;
+ }
+ else if ("*".equals(operator)) {
+ result = value * defaultValue;
+ }
+ else if ("/".equals(operator)) {
+ result = value / defaultValue;
+ }
+ else {
+ throw new IllegalArgumentException("Unknown operator '" + operator + "'");
+ }
+ }
+ else {
+ if (log.isTraceEnabled()) {
+ log.trace("No key defined for key '" + key + "' in context");
+ }
+ }
+
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,1243 +0,0 @@
-/* *##% 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
- * 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;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.beanutils.ConvertUtilsBean;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.math.matrix.MatrixHelper;
-import org.codelutin.math.matrix.MatrixND;
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.topia.TopiaException;
-import org.codelutin.topia.persistence.TopiaEntity;
-import org.codelutin.util.StringUtil;
-
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
-import fr.ifremer.isisfish.datastore.ExportStorage;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.RuleStorage;
-import fr.ifremer.isisfish.datastore.SensitivityStorage;
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationDAO;
-import fr.ifremer.isisfish.entities.Strategy;
-import fr.ifremer.isisfish.entities.StrategyDAO;
-import fr.ifremer.isisfish.export.Export;
-import fr.ifremer.isisfish.export.ExportHelper;
-import fr.ifremer.isisfish.export.SensitivityExport;
-import fr.ifremer.isisfish.rule.Rule;
-import fr.ifremer.isisfish.rule.RuleHelper;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
-import fr.ifremer.isisfish.util.ConverterUtil;
-
-/**
- * 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 Log log = LogFactory.getLog(SimulationParameter.class);
-
- /**
- * Isis-fish version that permit to do the simulation, must be set just
- * before simulation by simulator.
- */
- protected String isisFishVersion = IsisConfig.getVersion();
-
- /** description de la simulation */
- protected String description = "";
-
- /** nom de la region sur lequel on simule */
- protected String regionName = "";
-
- /** nombre d'année sur lequel on souhaite simuler */
- protected int numberOfYear = 1;
-
- /** le nom de l'objet script a utiliser pour faire la simulation */
- protected String simulatorName = "DefaultSimulator.java";
-
- /** utilisation ou non des optimisations */
- protected boolean useOptimization = true;
-
- /** utilisation ou non des statistiques */
- protected boolean useStatistic = false;
-
- /** la liste des strategies a utiliser pour la simulation */
- protected List<Strategy> strategies = new ArrayList<Strategy>();
-
- /** la liste des populations a utiliser pour la simulation */
- protected List<Population> populations = new ArrayList<Population>();
-
- /** les effectifs initiaux des différentes population */
- protected Map<Population, MatrixND> numbers = new HashMap<Population, MatrixND>();
-
- /** la liste des regles de gestions a utiliser pour la simulation */
- protected List<Rule> rules = new ArrayList<Rule>();
-
- /** la liste des regles potentiellement ajoutée par les plans d'analyse */
- protected List<String> extraRules = new ArrayList<String>();
-
- /** la liste des plans a utiliser pour la simulation */
- protected List<AnalysePlan> plans = new ArrayList<AnalysePlan>();
-
- /** la liste des exports automatique a faire en fin de simulation */
- protected List<String> exportNames = new ArrayList<String>();
-
- protected String exportDirectory = "/tmp";
-
- /** utilisation du script de pre simulation */
- protected boolean usePreScript = false;
-
- /** le script de pre simulation a utiliser */
- protected String preScript = "";
-
- /** utilisation du plan d'analyse */
- protected boolean useAnalysePlan = false;
-
- /** le script de plan d'analyse */
- 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
- * plan la valeur est -1 */
- protected int analysePlanNumber = -1;
-
- /** Export utilisés pour les analyses de sensibilités. */
- protected List<SensitivityExport> sensitivityExport = new ArrayList<SensitivityExport>();
-
- /**
- * Nombre de simulation constituant l'analyse de sensibilité.
- *
- * FIXME ce parametre ne devrait pas ce trouver à cet endroit.
- * Ce n'est pas un parametres, mais une infos de simulation.
- * Cela permet de savoir combien de simulation il y a au total
- * pour savoir quand elle sont terminées.
- */
- protected int numberOfSensitivitySimulation = -1;
-
- /** Export utilisés pour les analyses de sensibilités. */
- protected SensitivityCalculator sensitivityCalculator = null;
-
- /** la liste des resultats qui nous interesse */
- protected Collection<String> resultEnabled = new HashSet<String>();
-
- /** autre parametre defini par l'utilisateur */
- protected Map<String, String> tagValue = new LinkedHashMap<String, String>();
-
- /**
- * si vrai seul les exports automatiques ne sont souhaiter, la simulation
- * pourrait etre supprimée a la fin
- */
- protected boolean onlyExport = false;
-
- protected transient RegionStorage region = null;
-
- /** 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 */
- protected String scriptLogLevel = "info";
- /** le niveau de log des librairies à utiliser pendant la simulation , par default info */
- protected String libLogLevel = "error";
-
- /**
- * Permet de verifier que tous les parametres sont bon. Si ce n'est pas le
- * cas la liste retournée contient la liste des messages d'erreur.
- *
- * @return la liste d'erreur
- */
- public List<String> check() {
- List<String> result = new ArrayList<String>();
- // TODO faire la verif et pour chaque erreur mettre un message
- // dans la liste result (par exemple si pas d'effectif
- // pour une pop
- return result;
- }
-
- /**
- * @return Returns the isisFishVersion.
- */
- public String getIsisFishVersion() {
- return this.isisFishVersion;
- }
-
- /**
- * @param isisFishVersion The isisFishVersion to set.
- */
- public void setIsisFishVersion(String isisFishVersion) {
- this.isisFishVersion = isisFishVersion;
- }
-
- /**
- * Get description property.
- *
- * @return Description property.
- */
- public String getDescription() {
- return this.description;
- }
-
- /**
- * @param description The description to set.
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Permet de convertir l'objet SimulationParameter en un objet Properties
- * Cela permet de le stocker facilement sur le disque.
- *
- * @return L'objet Properties representant les parametres
- * @see #fromProperties(File,Properties)
- */
- public Properties toProperties() {
- Properties result = new Properties();
-
- result.setProperty("isisFishVersion", isisFishVersion);
- result.setProperty("description", description);
- result.setProperty("regionName", regionName);
- result.setProperty("numberOfYear", String.valueOf(numberOfYear));
- result.setProperty("simulatorName", simulatorName);
- result.setProperty("useOptimization", String.valueOf(useOptimization));
- result.setProperty("useStatistic", String.valueOf(useStatistic));
-
- String strategyList = "";
- for (Strategy str : getStrategies()) {
- strategyList += str.getName() + ",";
- }
- result.setProperty("strategies", StringUtil.substring(strategyList, 0,
- -1));
-
- String populationList = "";
- for (Population pop : getPopulations()) {
- populationList += pop.getName() + ",";
- MatrixND number = getNumberOf(pop);
- String numberAsString = String.valueOf(number.toList());
- result.setProperty("population." + pop.getName() + ".number",
- numberAsString);
- }
- result.setProperty("populations", StringUtil.substring(populationList,
- 0, -1));
-
- String ruleList = "";
- int ruleIndex = 0;
- for (Rule rule : getRules()) {
- ruleList += RuleStorage.getName(rule) + ",";
- Properties ruleProp = ruleParametertoProperties(ruleIndex++, rule);
- result.putAll(ruleProp);
- }
- result.setProperty("rules", ruleList);
-
- String planList = "";
- int planIndex = 0;
- for (AnalysePlan plan : getAnalysePlans()) {
- planList += AnalysePlanStorage.getName(plan) + ",";
- Properties planProp = planParametertoProperties(planIndex++, plan);
- result.putAll(planProp);
- }
- result.setProperty("plans", planList);
-
- String exportList = "";
- int exportIndex = 0;
- for (String export : getExportNames()) {
- exportList += export + ",";
-
- }
- result.setProperty("exports", exportList);
-
- // number of sensitivity simulation
- result.setProperty("numberOfSensitivitySimulation", String.valueOf(numberOfSensitivitySimulation));
-
- // calculator name
- if (getSensitivityCalculator() != null) {
- String calculatorName = SensitivityStorage.getName(getSensitivityCalculator());
- result.setProperty("sensitivitycalculator", calculatorName);
- }
- // number of sensitivity simulation
- String sensitivityExportList = "";
- // WARN only SENSITIVITY are parametrable for now
- for (SensitivityExport export : getSensitivityExport()) {
- sensitivityExportList += ExportStorage.getName(export) + ",";
- Properties exportProp = exportParametertoProperties(exportIndex++, export);
- result.putAll(exportProp);
- }
- result.setProperty("sensitivityexports", sensitivityExportList);
-
-
-
- result.setProperty("usePreScript", String.valueOf(usePreScript));
- result.setProperty("preScript", preScript);
- result.setProperty("useAnalysePlan", String.valueOf(useAnalysePlan));
- result.setProperty("analysePlan", analysePlan);
- result.setProperty("analysePlanNumber", String.valueOf(analysePlanNumber));
-
- String resultList = "";
- for (String r : getResultEnabled()) {
- resultList += r + ",";
- }
- result.setProperty("resultNames", resultList);
-
- for (Map.Entry<String, String> e : getTagValue().entrySet()) {
- result.setProperty("tagValue." + e.getKey(), e.getValue());
- }
-
- result.setProperty("onlyExport", String.valueOf(onlyExport));
- result.setProperty("exportDirectory", String.valueOf(exportDirectory));
-
- result.setProperty("simulLogLevel", simulLogLevel);
- result.setProperty("scriptLogLevel", scriptLogLevel);
- result.setProperty("libLogLevel", libLogLevel);
- return result;
- }
-
- public void fromProperties(File directory, Properties props) {
- isisFishVersion = props.getProperty("isisFishVersion", "");
- description = props.getProperty("description", "");
- regionName = props.getProperty("regionName", "");
- numberOfYear = Integer.parseInt(props.getProperty("numberOfYear", "1"));
- simulatorName = props.getProperty("simulatorName", "DefaultSimulator");
- useOptimization = Boolean.parseBoolean(props.getProperty(
- "useOptimization", "true"));
- useStatistic = Boolean.parseBoolean(props.getProperty(
- "useStatistic", "true"));
-
- // FIXME not good place and code
- if(this.region == null || !region.getName().equals(regionName)) {
- this.region = RegionStorage.getRegion(directory, regionName);
- }
-
- try {
- TopiaContext tx = getRegion().getStorage().beginTransaction();
-
- try {
- StrategyDAO strategyDAO = IsisFishDAOHelper.getStrategyDAO(tx);
- String[] strategyList = props.getProperty("strategies", "")
- .split(",");
- for (String name : strategyList) {
- if (name != null && !"".equals(name)) {
- try {
- Strategy str = strategyDAO.findByName(name);
- getStrategies().add(str);
- } catch (TopiaException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find strategy: " + name, eee);
- }
- }
- }
- }
- } catch (TopiaException eee1) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get StrategyDAO", eee1);
- }
- }
-
- try {
- PopulationDAO populationDAO = IsisFishDAOHelper
- .getPopulationDAO(tx);
- String[] populationList = props.getProperty("populations", "")
- .split(",");
- for (String name : populationList) {
- if (name != null && !"".equals(name)) {
- try {
- Population population = populationDAO
- .findByName(name);
- getPopulations().add(population);
-
- String numberAsString = props
- .getProperty("population." + name
- + ".number");
- List number = MatrixHelper
- .convertStringToList(numberAsString);
- MatrixND mat = getNumberOf(population);
- mat.fromList(number);
- } catch (TopiaException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find population: " + name, eee);
- }
- }
- }
- }
- } catch (TopiaException eee1) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get PopulationDAO", eee1);
- }
- }
-
- tx.commitTransaction();
- tx.closeContext();
- } catch (TopiaException eee1) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get TopiaContext", eee1);
- }
- }
-
- String[] ruleList = props.getProperty("rules", "").split(",");
- int ruleIndex = 0;
- for (String name : ruleList) {
- if (name != null && !"".equals(name)) {
- try {
- Rule rule = RuleStorage.getRule(name).getNewRuleInstance();
- RuleHelper.populateRule(ruleIndex++, getRegion(), rule, props);
- getRules().add(rule);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find rule: " + name, eee);
- }
- }
- }
- }
-
- String[] planList = props.getProperty("plans", "").split(",");
- int planIndex = 0;
- for (String name : planList) {
- if (name != null && !"".equals(name)) {
- try {
- AnalysePlan plan = AnalysePlanStorage.getAnalysePlan(name).getNewAnalysePlanInstance();
- populateAnalysePlan(planIndex++, plan, props);
- getAnalysePlans().add(plan);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find plan: " + name, eee);
- }
- }
- }
- }
-
- String[] exportList = props.getProperty("exports", "").split(",");
- int exportIndex = 0;
- for (String name : exportList) {
- if (name != null && !"".equals(name)) {
- getExportNames().add(name);
- }
- }
-
- // number of sensitivity simulation
- numberOfSensitivitySimulation = Integer.parseInt(props.getProperty("numberOfSensitivitySimulation", "-1"));
- // calculator name
- String sensitivityCalculator = props.getProperty("sensitivitycalculator", null);
- if (!StringUtils.isEmpty(sensitivityCalculator)) {
- try {
- SensitivityCalculator calculator = SensitivityStorage.getSensitivity(sensitivityCalculator).getNewSensitivityInstance();
- setSensitivityCalculator(calculator);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find sensitivity: " + sensitivityCalculator, eee);
- }
- }
- }
- // sensitivity export
- String[] sensitivityExportList = props.getProperty("sensitivityexports", "").split(",");
- for (String name : sensitivityExportList) {
- try {
- if (!StringUtils.isEmpty(name)) {
- SensitivityExport export = (SensitivityExport)ExportStorage.getExport(name).getNewExportInstance();
- ExportHelper.populateExport(exportIndex++, getRegion(), export, props);
- getSensitivityExport().add(export);
- }
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find SensitivityExport: " + name, eee);
- }
- }
- }
-
- usePreScript = Boolean.parseBoolean(props.getProperty("usePreScript",
- "false"));
- preScript = props.getProperty("preScript");
- useAnalysePlan = Boolean.parseBoolean(props.getProperty(
- "useAnalysePlan", "false"));
- analysePlan = props.getProperty("analysePlan");
- analysePlanNumber = Integer.parseInt(props.getProperty("analysePlanNumber", "-1"));
-
- String[] resultList = props.getProperty("resultNames", "").split(",");
- for (String name : resultList) {
- if (name != null && !"".equals(name)) {
- getResultEnabled().add(name);
- }
- }
-
- for (Object k : props.keySet()) {
- if (k.toString().startsWith("tagValue.")) {
- String key = k.toString().substring("tagValue.".length());
- String value = props.getProperty(k.toString());
- getTagValue().put(key, value);
- }
- }
-
- onlyExport = Boolean.parseBoolean(props.getProperty("onlyExport",
- "false"));
-
- exportDirectory = props.getProperty("exportDirectory");
-
- simulLogLevel = props.getProperty("simulLogLevel","info");
- scriptLogLevel = props.getProperty("scriptLogLevel","info");
- libLogLevel = props.getProperty("libLogLevel","info");
- }
-
- /**
- * @return Returns the region.
- */
- public RegionStorage getRegion() {
- if (region == null || !region.getName().equals(getRegionName())) {
- region = RegionStorage.getRegion(getRegionName());
- }
- else {
- if(log.isDebugEnabled()) {
- log.debug(_("Region %s already inited", getRegionName()));
- }
- }
- return this.region;
- }
-
- public MatrixND getNumberOf(Population pop) {
- MatrixND result = numbers.get(pop);
- if (result == null) {
- List groups = pop.getPopulationGroup();
- List zones = pop.getPopulationZone();
-
- if (groups.size() == 0) {
- groups.add("No group");
- }
- if (zones.size() == 0) {
- zones.add("No zone");
- }
- List[] semantics = new List[] { groups, zones };
- result = MatrixFactory.getInstance().create(semantics);
-
- numbers.put(pop, result);
- }
- return result;
- }
-
- /**
- * Permet de mettre les parametres de la regle sous une forme String pour
- * pouvoir les relire ensuite.
- *
- * @param ruleIndex l'index de la rule
- * @param rule La regle dont on souhaite mettre les parametres dans l'objet
- * Properties retourne
- * @return L'objet Properties contenant les valeurs des parametres de la
- * regle
- */
- protected Properties ruleParametertoProperties(int ruleIndex, Rule rule) {
- Properties result = new Properties();
- ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
- for (String paramName : RuleStorage.getParameterNames(rule).keySet()) {
- String paramValueString;
- try {
- Object value = RuleStorage.getParameterValue(rule, paramName);
- paramValueString = beanUtils.convert(value);
- if (paramValueString != null) {
- result.setProperty("rule." + ruleIndex + ".parameter."
- + paramName, paramValueString);
- }
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert parameter value to String: "
- + paramName, eee);
- }
- }
- }
-
- return result;
- }
-
- /**
- * Permet de mettre les parametres de l'export sous une forme String pour
- * pouvoir les relire ensuite.
- *
- * @param exportIndex l'index de l'export
- * @param export L'export dont on souhaite mettre les parametres dans l'objet
- * Properties retourne
- * @return L'objet Properties contenant les valeurs des parametres de la
- * regle
- */
- protected Properties exportParametertoProperties(int exportIndex, Export export) {
- Properties result = new Properties();
- ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
- for (String paramName : ExportStorage.getParameterNames(export).keySet()) {
- String paramValueString;
- try {
- Object value = ExportStorage.getParameterValue(export, paramName);
- paramValueString = beanUtils.convert(value);
- if (paramValueString != null) {
- result.setProperty("export." + exportIndex + ".parameter."
- + paramName, paramValueString);
- }
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert parameter value to String: "
- + paramName, eee);
- }
- }
- }
-
- return result;
- }
-
- /**
- * Permet de mettre les parametres du plan sous une forme String pour
- * pouvoir les relire ensuite.
- *
- * @param planIndex l'index du plan
- * @param plan Le plan dont on souhaite mettre les parametres dans l'objet
- * Properties retourne
- * @return L'objet Properties contenant les valeurs des parametres du plan
- */
- protected Properties planParametertoProperties(int planIndex, AnalysePlan plan) {
- Properties result = new Properties();
- ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
- for (String paramName : AnalysePlanStorage.getParameterNames(plan).keySet()) {
- String paramValueString;
- try {
- Object value = AnalysePlanStorage.getParameterValue(plan, paramName);
- paramValueString = beanUtils.convert(value);
- if (paramValueString != null) {
- result.setProperty("plan." + planIndex + ".parameter."
- + paramName, paramValueString);
- }
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert parametre value to String: "
- + paramName, eee);
- }
- }
- }
-
- return result;
- }
-
- /**
- * Recupere dans prop les valeurs des champs specifique a le plan et met a
- * jour les champs du plan
- *
- * @param planIndex l'index du plan
- * @param plan le plan dont les parametres doivent etre lu depuis les
- * proprietes
- * @param props les proprietes contenant les parametre du plan
- */
- protected void populateAnalysePlan(int planIndex, AnalysePlan plan, Properties props) {
- ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
- String planName = AnalysePlanStorage.getName(plan);
- String paramTag = "plan." + planIndex + ".parameter.";
-
- for (Map.Entry<String, Class> entry : AnalysePlanStorage.getParameterNames(plan).entrySet()) {
- String propName = entry.getKey();
- Class type = entry.getValue();
- if (TopiaEntity.class.isAssignableFrom(type)) {
- type = TopiaEntity.class;
- }
- String valueString = props.getProperty(paramTag + propName);
- Object value = beanUtils.convert(valueString, type);
- try {
- AnalysePlanStorage.setParameterValue(plan, propName, value);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't reload field " + propName + " for plan " + planName , eee);
- }
- }
- }
- }
-
- /**
- * @return Returns the extraRules.
- */
- public List<String> getExtraRules() {
- return this.extraRules;
- }
-
- /**
- * @param extraRules The extraRules to set.
- */
- public void addExtraRules(String ... extraRules) {
- this.extraRules.addAll(Arrays.asList(extraRules));
- }
-
- /**
- * @return Returns the populations.
- */
- public List<Population> getPopulations() {
- if (populations == null) {
- populations = new ArrayList<Population>();
- }
- return this.populations;
- }
-
- /**
- * @param populations The populations to set.
- */
- public void setPopulations(List<Population> populations) {
- this.populations = populations;
- }
-
- /**
- * @return Returns the strategies.
- */
- public List<Strategy> getStrategies() {
- if (strategies == null) {
- strategies = new ArrayList<Strategy>();
- }
- return this.strategies;
- }
-
- /**
- * @param strategies The strategies to set.
- */
- public void setStrategies(List<Strategy> strategies) {
- this.strategies = strategies;
- }
-
- public void addRule(Rule rule) {
- getRules().add(rule);
- }
-
- public void removeRule(Rule rule) {
- getRules().remove(rule);
- }
-
- public void addAnalysePlan(AnalysePlan plan) {
- getAnalysePlans().add(plan);
- }
-
- public void removeAnalysePlan(AnalysePlan plan) {
- getAnalysePlans().remove(plan);
- }
-
- /**
- * @return Returns the rules.
- */
- public List<Rule> getRules() {
- if (rules == null) {
- rules = new ArrayList<Rule>();
- }
- return this.rules;
- }
-
- /**
- * @param rules The rules to set.
- */
- public void setRules(List<Rule> rules) {
- this.rules = rules;
- }
-
- /**
- * @return Returns the plans.
- */
- public List<AnalysePlan> getAnalysePlans() {
- if (plans == null) {
- plans = new ArrayList<AnalysePlan>();
- }
- return this.plans;
- }
-
- /**
- * @param plans The plans to set.
- */
- public void setAnalysePlans(List<AnalysePlan> plans) {
- this.plans = plans;
- }
-
- /**
- * @return Returns the useOptimization.
- */
- public boolean getUseOptimization() {
- return this.useOptimization;
- }
-
- /**
- * @param useOptimization The useOptimization to set.
- */
- public void setUseOptimization(boolean useOptimization) {
- this.useOptimization = useOptimization;
- }
-
- /**
- * @return Returns the useStatistic.
- */
- public boolean getUseStatistic() {
- return this.useStatistic;
- }
-
- public boolean isIndependentPlan() {
- boolean result = true;
- for (AnalysePlan plan : getAnalysePlans()) {
- if (!(plan instanceof AnalysePlanIndependent)) {
- result = false;
- break;
- }
- }
- return result;
- }
-
- /**
- * @param useStatistic The useStatistic to set.
- */
- public void setUseStatistic(boolean useStatistic) {
- this.useStatistic = useStatistic;
- }
-
- /**
- * @return Returns the exportNames.
- */
- public List<String> getExportNames() {
- if (exportNames == null) {
- exportNames = new ArrayList<String>();
- }
- return this.exportNames;
- }
-
- /**
- * @param exportNames The exportNames to set.
- */
- public void setExportNames(List<String> exportNames) {
- this.exportNames = exportNames;
- }
-
-
- /**
- * @return the numberOfSensitivitySimulation
- */
- public int getNumberOfSensitivitySimulation() {
- return numberOfSensitivitySimulation;
- }
-
- /**
- * @param numberOfSensitivitySimulation the numberOfSensitivitySimulation to set
- */
- public void setNumberOfSensitivitySimulation(int numberOfSensitivitySimulation) {
- this.numberOfSensitivitySimulation = numberOfSensitivitySimulation;
- }
-
- /**
- * @return the sensitivityCalculator
- */
- public SensitivityCalculator getSensitivityCalculator() {
- return sensitivityCalculator;
- }
-
- /**
- * @param sensitivityCalculator the sensitivityCalculator to set
- */
- public void setSensitivityCalculator(SensitivityCalculator sensitivityCalculator) {
- this.sensitivityCalculator = sensitivityCalculator;
- }
-
- /**
- * @return the sensitivityExportNames
- */
- public List<SensitivityExport> getSensitivityExport() {
- if (sensitivityExport == null) {
- sensitivityExport = new ArrayList<SensitivityExport>();
- }
- return sensitivityExport;
- }
-
- /**
- * @param sensitivityExport the sensitivityExportNames to set
- */
- public void setSensitivityExport(List<SensitivityExport> sensitivityExport) {
- this.sensitivityExport = sensitivityExport;
- }
-
- /**
- * @return Returns the useAnalysePlan.
- */
- public boolean getUseAnalysePlan() {
- return this.useAnalysePlan;
- }
-
- /**
- * @param useAnalysePlan The useAnalysePlan to set.
- */
- public void setUseAnalysePlan(boolean useAnalysePlan) {
- this.useAnalysePlan = useAnalysePlan;
- }
-
- /**
- * @return Returns the analysePlan.
- */
- public String getAnalysePlan() {
- return this.analysePlan;
- }
-
- /**
- * @param analysePlan The analysePlan to set.
- */
- public void setAnalysePlan(String analysePlan) {
- this.analysePlan = analysePlan;
- }
-
- /**
- * @return Returns the analysePlanNumber.
- */
- public int getAnalysePlanNumber() {
- return this.analysePlanNumber;
- }
-
- /**
- * @param analysePlanNumber The analysePlanNumber to set.
- */
- public void setAnalysePlanNumber(int analysePlanNumber) {
- this.analysePlanNumber = analysePlanNumber;
- }
-
- /**
- * @return Returns the numberOfYear.
- */
- public int getNumberOfYear() {
- return this.numberOfYear;
- }
-
- /**
- * @param numberOfYear The numberOfYear to set.
- */
- public void setNumberOfYear(int numberOfYear) {
- this.numberOfYear = numberOfYear;
- }
-
- /**
- * @return Returns the usePreScript.
- */
- public boolean getUsePreScript() {
- return this.usePreScript;
- }
-
- /**
- * @param usePreScript The usePreScript to set.
- */
- public void setUsePreScript(boolean usePreScript) {
- this.usePreScript = usePreScript;
- }
-
- /**
- * @return Returns the preScript.
- */
- public String getPreScript() {
- return this.preScript;
- }
-
- /**
- * @param preScript The preScript to set.
- */
- public void setPreScript(String preScript) {
- this.preScript = preScript;
- }
-
- /**
- * @return Returns the regionName.
- */
- public String getRegionName() {
- return this.regionName;
- }
-
- /**
- * @param regionName The regionName to set.
- */
- public void setRegionName(String regionName) {
- this.regionName = regionName;
- }
-
- /**
- * @return Returns the simulatorName.
- */
- public String getSimulatorName() {
- return this.simulatorName;
- }
-
- /**
- * @param simulatorName The simulatorName to set.
- */
- public void setSimulatorName(String simulatorName) {
- this.simulatorName = simulatorName;
- }
-
- /**
- * @return Returns the resultNotEnabled.
- */
- public Collection<String> getResultEnabled() {
- return this.resultEnabled;
- }
-
- /**
- * @param resultEnabled The resultNotEnabled to set.
- */
- public void setResultEnabled(Collection<String> resultEnabled) {
- this.resultEnabled = resultEnabled;
- }
-
- /**
- * @return Returns the tagValue.
- */
- public Map<String, String> getTagValue() {
- return this.tagValue;
- }
-
- /**
- * @param tagValue The tagValue to set.
- */
- public void setTagValue(Map<String, String> tagValue) {
- this.tagValue = tagValue;
- }
-
- /**
- * @return Returns the onlyExport.
- */
- public boolean getOnlyExport() {
- return onlyExport;
- }
-
- /**
- * @param onlyExport The onlyExport to set.
- */
- public void setOnlyExport(boolean onlyExport) {
- this.onlyExport = onlyExport;
- }
-
- /**
- * @return Returns the exportDirectory.
- */
- public String getExportDirectory() {
- return this.exportDirectory;
- }
-
- /**
- * @param exportDirectory The exportDirectory to set.
- */
- public void setExportDirectory(String exportDirectory) {
- this.exportDirectory = exportDirectory;
- }
-
- public String getSimulLogLevel() {
- return simulLogLevel;
- }
-
- public void setSimulLogLevel(String logLevel) {
- log.info(_("isisfish.params.changeLogLev",simulLogLevel ,logLevel));
- this.simulLogLevel = logLevel;
- }
-
- public String getScriptLogLevel() {
- return scriptLogLevel;
- }
-
- public void setScriptLogLevel(String logLevel) {
- log.info(_("isisfish.params.changeLogLev",scriptLogLevel,logLevel));
- this.scriptLogLevel = logLevel;
- }
-
- public String getLibLogLevel() {
- return libLogLevel;
- }
-
- public void setLibLogLevel(String logLevel) {
- log.info(_("isisfish.params.changeLogLev",libLogLevel,logLevel));
- this.libLogLevel = logLevel;
- }
-
- /**
- * @return a copy of this instance
- */
- public SimulationParameter copy() {
- SimulationParameter result = new SimulationParameter();
-
- result.isisFishVersion = isisFishVersion;
- result.description = description;
- result.regionName = regionName;
- result.numberOfYear = numberOfYear;
- result.simulatorName = simulatorName;
- result.useOptimization = useOptimization;
- result.useStatistic = useStatistic;
- result.usePreScript = usePreScript;
- result.preScript = preScript;
- result.useAnalysePlan = useAnalysePlan;
- result.analysePlan = analysePlan;
- result.analysePlanNumber = analysePlanNumber;
- result.onlyExport = onlyExport;
- result.exportNames.addAll(exportNames);
- result.exportDirectory = exportDirectory;
- result.strategies.addAll(strategies) ;
- result.populations.addAll(populations) ;
- result.rules.addAll(rules) ;
- result.plans.addAll(plans) ;
- result.resultEnabled.addAll(resultEnabled);
- result.numbers.putAll(numbers) ;
- result.tagValue.putAll(tagValue) ;
- result.simulLogLevel = simulLogLevel;
- result.scriptLogLevel = scriptLogLevel;
- result.libLogLevel = libLogLevel;
- result.numberOfSensitivitySimulation = numberOfSensitivitySimulation;
- result.sensitivityExport.addAll(sensitivityExport);
- result.sensitivityCalculator = sensitivityCalculator;
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuffer result = new StringBuffer();
- result.append(_("isisfish.params.toString.simulation.done", getIsisFishVersion())).append('\n');
- result.append("--------------------\n");
- result.append(getDescription()).append('\n');
- result.append("--------------------\n");
-
- if (getUseAnalysePlan()) {
- result.append(_("isisfish.params.toString.plan.number", getAnalysePlanNumber()));
- }
-
- RegionStorage region = getRegion();
- result.append(_("isisfish.params.toString.fishery", region.getName()));
- result.append(_("isisfish.params.toString.number.years", getNumberOfYear()));
- List strs = getStrategies();
- result.append(_("isisfish.params.toString.strategies"));
- String sep = "";
- for (Object str : strs) {
- result.append(sep).append(str);
- sep = ",";
- }
- result.append("\n\n");
- result.append(_("isisfish.params.toString.populations"));
- sep = "";
- for(Population pop : getPopulations()){
- result.append(sep).append(pop.getName());
- sep =",";
- }
- result.append("\n\n");
- for (Rule rule : getRules()) {
- String name = RuleStorage.getName(rule);
- String param = "";
- try {
- param = RuleStorage.getParamAsString(rule);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert rule parameter to string for " + name, eee);
- }
- }
- result.append(_("isisfish.params.toString.rule", name));
- result.append(param);
- result.append("\n");
-
- }
- result.append("\n\n");
- for (AnalysePlan plan : getAnalysePlans()) {
- String name = RuleStorage.getName(plan);
- String param = "";
- try {
- param = AnalysePlanStorage.getParamAsString(plan);
- } catch (IsisFishException eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't convert plan parameter to string for " + name, eee);
- }
- }
- result.append(_("isisfish.params.toString.plan", name));
- result.append(param);
- result.append('\n');
-
- }
- result.append('\n');
- result.append(_("isisfish.params.toString.script.presimulation")).append(":\n");
- result.append(getPreScript());
- result.append('\n');
- result.append(_("isisfish.params.toString.simul.logger.level", simulLogLevel));
- result.append('\n');
- result.append(_("isisfish.params.toString.script.logger.level", scriptLogLevel));
- result.append('\n');
- result.append(_("isisfish.params.toString.lib.logger.level", libLogLevel));
- result.append('\n');
- return result.toString();
- }
-
- public boolean isSimulErrorLevel() {
- return "error".equals(simulLogLevel);
- }
- public boolean isSimulWarnLevel() {
- return "warn".equals(simulLogLevel);
- }
- public boolean isSimulInfoLevel() {
- return "info".equals(simulLogLevel);
- }
- public boolean isSimulDebugLevel() {
- return "debug".equals(simulLogLevel);
- }
-
- public boolean isScriptErrorLevel() {
- return "error".equals(scriptLogLevel);
- }
- public boolean isScriptWarnLevel() {
- return "warn".equals(scriptLogLevel);
- }
- public boolean isScriptInfoLevel() {
- return "info".equals(scriptLogLevel);
- }
- public boolean isScriptDebugLevel() {
- return "debug".equals(scriptLogLevel);
- }
-
- public boolean isLibErrorLevel() {
- return "error".equals(libLogLevel);
- }
- public boolean isLibWarnLevel() {
- return "warn".equals(libLogLevel);
- }
- public boolean isLibInfoLevel() {
- return "info".equals(libLogLevel);
- }
- public boolean isLibDebugLevel() {
- return "debug".equals(libLogLevel);
- }
-
-
- public void clearRules() {
- if (rules != null) {
- rules.clear();
- }
- }
- public void clearPlans() {
- if (plans!= null) {
- plans.clear();
- }
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,1243 @@
+/* *##% 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
+ * 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;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.beanutils.ConvertUtilsBean;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixHelper;
+import org.codelutin.math.matrix.MatrixND;
+import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.TopiaException;
+import org.codelutin.topia.persistence.TopiaEntity;
+import org.codelutin.util.StringUtil;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.SensitivityStorage;
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.PopulationDAO;
+import fr.ifremer.isisfish.entities.Strategy;
+import fr.ifremer.isisfish.entities.StrategyDAO;
+import fr.ifremer.isisfish.export.Export;
+import fr.ifremer.isisfish.export.ExportHelper;
+import fr.ifremer.isisfish.export.SensitivityExport;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.rule.RuleHelper;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
+import fr.ifremer.isisfish.util.ConverterUtil;
+
+/**
+ * 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 Log log = LogFactory.getLog(SimulationParameter.class);
+
+ /**
+ * Isis-fish version that permit to do the simulation, must be set just
+ * before simulation by simulator.
+ */
+ protected String isisFishVersion = IsisConfig.getVersion();
+
+ /** description de la simulation */
+ protected String description = "";
+
+ /** nom de la region sur lequel on simule */
+ protected String regionName = "";
+
+ /** nombre d'année sur lequel on souhaite simuler */
+ protected int numberOfYear = 1;
+
+ /** le nom de l'objet script a utiliser pour faire la simulation */
+ protected String simulatorName = "DefaultSimulator.java";
+
+ /** utilisation ou non des optimisations */
+ protected boolean useOptimization = true;
+
+ /** utilisation ou non des statistiques */
+ protected boolean useStatistic = false;
+
+ /** la liste des strategies a utiliser pour la simulation */
+ protected List<Strategy> strategies = new ArrayList<Strategy>();
+
+ /** la liste des populations a utiliser pour la simulation */
+ protected List<Population> populations = new ArrayList<Population>();
+
+ /** les effectifs initiaux des différentes population */
+ protected Map<Population, MatrixND> numbers = new HashMap<Population, MatrixND>();
+
+ /** la liste des regles de gestions a utiliser pour la simulation */
+ protected List<Rule> rules = new ArrayList<Rule>();
+
+ /** la liste des regles potentiellement ajoutée par les plans d'analyse */
+ protected List<String> extraRules = new ArrayList<String>();
+
+ /** la liste des plans a utiliser pour la simulation */
+ protected List<AnalysePlan> plans = new ArrayList<AnalysePlan>();
+
+ /** la liste des exports automatique a faire en fin de simulation */
+ protected List<String> exportNames = new ArrayList<String>();
+
+ protected String exportDirectory = "/tmp";
+
+ /** utilisation du script de pre simulation */
+ protected boolean usePreScript = false;
+
+ /** le script de pre simulation a utiliser */
+ protected String preScript = "";
+
+ /** utilisation du plan d'analyse */
+ protected boolean useAnalysePlan = false;
+
+ /** le script de plan d'analyse */
+ 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
+ * plan la valeur est -1 */
+ protected int analysePlanNumber = -1;
+
+ /** Export utilisés pour les analyses de sensibilités. */
+ protected List<SensitivityExport> sensitivityExport = new ArrayList<SensitivityExport>();
+
+ /**
+ * Nombre de simulation constituant l'analyse de sensibilité.
+ *
+ * FIXME ce parametre ne devrait pas ce trouver à cet endroit.
+ * Ce n'est pas un parametres, mais une infos de simulation.
+ * Cela permet de savoir combien de simulation il y a au total
+ * pour savoir quand elle sont terminées.
+ */
+ protected int numberOfSensitivitySimulation = -1;
+
+ /** Export utilisés pour les analyses de sensibilités. */
+ protected SensitivityCalculator sensitivityCalculator = null;
+
+ /** la liste des resultats qui nous interesse */
+ protected Collection<String> resultEnabled = new HashSet<String>();
+
+ /** autre parametre defini par l'utilisateur */
+ protected Map<String, String> tagValue = new LinkedHashMap<String, String>();
+
+ /**
+ * si vrai seul les exports automatiques ne sont souhaiter, la simulation
+ * pourrait etre supprimée a la fin
+ */
+ protected boolean onlyExport = false;
+
+ protected transient RegionStorage region = null;
+
+ /** 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 */
+ protected String scriptLogLevel = "info";
+ /** le niveau de log des librairies à utiliser pendant la simulation , par default info */
+ protected String libLogLevel = "error";
+
+ /**
+ * Permet de verifier que tous les parametres sont bon. Si ce n'est pas le
+ * cas la liste retournée contient la liste des messages d'erreur.
+ *
+ * @return la liste d'erreur
+ */
+ public List<String> check() {
+ List<String> result = new ArrayList<String>();
+ // TODO faire la verif et pour chaque erreur mettre un message
+ // dans la liste result (par exemple si pas d'effectif
+ // pour une pop
+ return result;
+ }
+
+ /**
+ * @return Returns the isisFishVersion.
+ */
+ public String getIsisFishVersion() {
+ return this.isisFishVersion;
+ }
+
+ /**
+ * @param isisFishVersion The isisFishVersion to set.
+ */
+ public void setIsisFishVersion(String isisFishVersion) {
+ this.isisFishVersion = isisFishVersion;
+ }
+
+ /**
+ * Get description property.
+ *
+ * @return Description property.
+ */
+ public String getDescription() {
+ return this.description;
+ }
+
+ /**
+ * @param description The description to set.
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Permet de convertir l'objet SimulationParameter en un objet Properties
+ * Cela permet de le stocker facilement sur le disque.
+ *
+ * @return L'objet Properties representant les parametres
+ * @see #fromProperties(File,Properties)
+ */
+ public Properties toProperties() {
+ Properties result = new Properties();
+
+ result.setProperty("isisFishVersion", isisFishVersion);
+ result.setProperty("description", description);
+ result.setProperty("regionName", regionName);
+ result.setProperty("numberOfYear", String.valueOf(numberOfYear));
+ result.setProperty("simulatorName", simulatorName);
+ result.setProperty("useOptimization", String.valueOf(useOptimization));
+ result.setProperty("useStatistic", String.valueOf(useStatistic));
+
+ String strategyList = "";
+ for (Strategy str : getStrategies()) {
+ strategyList += str.getName() + ",";
+ }
+ result.setProperty("strategies", StringUtil.substring(strategyList, 0,
+ -1));
+
+ String populationList = "";
+ for (Population pop : getPopulations()) {
+ populationList += pop.getName() + ",";
+ MatrixND number = getNumberOf(pop);
+ String numberAsString = String.valueOf(number.toList());
+ result.setProperty("population." + pop.getName() + ".number",
+ numberAsString);
+ }
+ result.setProperty("populations", StringUtil.substring(populationList,
+ 0, -1));
+
+ String ruleList = "";
+ int ruleIndex = 0;
+ for (Rule rule : getRules()) {
+ ruleList += RuleStorage.getName(rule) + ",";
+ Properties ruleProp = ruleParametertoProperties(ruleIndex++, rule);
+ result.putAll(ruleProp);
+ }
+ result.setProperty("rules", ruleList);
+
+ String planList = "";
+ int planIndex = 0;
+ for (AnalysePlan plan : getAnalysePlans()) {
+ planList += AnalysePlanStorage.getName(plan) + ",";
+ Properties planProp = planParametertoProperties(planIndex++, plan);
+ result.putAll(planProp);
+ }
+ result.setProperty("plans", planList);
+
+ String exportList = "";
+ int exportIndex = 0;
+ for (String export : getExportNames()) {
+ exportList += export + ",";
+
+ }
+ result.setProperty("exports", exportList);
+
+ // number of sensitivity simulation
+ result.setProperty("numberOfSensitivitySimulation", String.valueOf(numberOfSensitivitySimulation));
+
+ // calculator name
+ if (getSensitivityCalculator() != null) {
+ String calculatorName = SensitivityStorage.getName(getSensitivityCalculator());
+ result.setProperty("sensitivitycalculator", calculatorName);
+ }
+ // number of sensitivity simulation
+ String sensitivityExportList = "";
+ // WARN only SENSITIVITY are parametrable for now
+ for (SensitivityExport export : getSensitivityExport()) {
+ sensitivityExportList += ExportStorage.getName(export) + ",";
+ Properties exportProp = exportParametertoProperties(exportIndex++, export);
+ result.putAll(exportProp);
+ }
+ result.setProperty("sensitivityexports", sensitivityExportList);
+
+
+
+ result.setProperty("usePreScript", String.valueOf(usePreScript));
+ result.setProperty("preScript", preScript);
+ result.setProperty("useAnalysePlan", String.valueOf(useAnalysePlan));
+ result.setProperty("analysePlan", analysePlan);
+ result.setProperty("analysePlanNumber", String.valueOf(analysePlanNumber));
+
+ String resultList = "";
+ for (String r : getResultEnabled()) {
+ resultList += r + ",";
+ }
+ result.setProperty("resultNames", resultList);
+
+ for (Map.Entry<String, String> e : getTagValue().entrySet()) {
+ result.setProperty("tagValue." + e.getKey(), e.getValue());
+ }
+
+ result.setProperty("onlyExport", String.valueOf(onlyExport));
+ result.setProperty("exportDirectory", String.valueOf(exportDirectory));
+
+ result.setProperty("simulLogLevel", simulLogLevel);
+ result.setProperty("scriptLogLevel", scriptLogLevel);
+ result.setProperty("libLogLevel", libLogLevel);
+ return result;
+ }
+
+ public void fromProperties(File directory, Properties props) {
+ isisFishVersion = props.getProperty("isisFishVersion", "");
+ description = props.getProperty("description", "");
+ regionName = props.getProperty("regionName", "");
+ numberOfYear = Integer.parseInt(props.getProperty("numberOfYear", "1"));
+ simulatorName = props.getProperty("simulatorName", "DefaultSimulator");
+ useOptimization = Boolean.parseBoolean(props.getProperty(
+ "useOptimization", "true"));
+ useStatistic = Boolean.parseBoolean(props.getProperty(
+ "useStatistic", "true"));
+
+ // FIXME not good place and code
+ if(this.region == null || !region.getName().equals(regionName)) {
+ this.region = RegionStorage.getRegion(directory, regionName);
+ }
+
+ try {
+ TopiaContext tx = getRegion().getStorage().beginTransaction();
+
+ try {
+ StrategyDAO strategyDAO = IsisFishDAOHelper.getStrategyDAO(tx);
+ String[] strategyList = props.getProperty("strategies", "")
+ .split(",");
+ for (String name : strategyList) {
+ if (name != null && !"".equals(name)) {
+ try {
+ Strategy str = strategyDAO.findByName(name);
+ getStrategies().add(str);
+ } catch (TopiaException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find strategy: " + name, eee);
+ }
+ }
+ }
+ }
+ } catch (TopiaException eee1) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get StrategyDAO", eee1);
+ }
+ }
+
+ try {
+ PopulationDAO populationDAO = IsisFishDAOHelper
+ .getPopulationDAO(tx);
+ String[] populationList = props.getProperty("populations", "")
+ .split(",");
+ for (String name : populationList) {
+ if (name != null && !"".equals(name)) {
+ try {
+ Population population = populationDAO
+ .findByName(name);
+ getPopulations().add(population);
+
+ String numberAsString = props
+ .getProperty("population." + name
+ + ".number");
+ List number = MatrixHelper
+ .convertStringToList(numberAsString);
+ MatrixND mat = getNumberOf(population);
+ mat.fromList(number);
+ } catch (TopiaException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find population: " + name, eee);
+ }
+ }
+ }
+ }
+ } catch (TopiaException eee1) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get PopulationDAO", eee1);
+ }
+ }
+
+ tx.commitTransaction();
+ tx.closeContext();
+ } catch (TopiaException eee1) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get TopiaContext", eee1);
+ }
+ }
+
+ String[] ruleList = props.getProperty("rules", "").split(",");
+ int ruleIndex = 0;
+ for (String name : ruleList) {
+ if (name != null && !"".equals(name)) {
+ try {
+ Rule rule = RuleStorage.getRule(name).getNewRuleInstance();
+ RuleHelper.populateRule(ruleIndex++, getRegion(), rule, props);
+ getRules().add(rule);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find rule: " + name, eee);
+ }
+ }
+ }
+ }
+
+ String[] planList = props.getProperty("plans", "").split(",");
+ int planIndex = 0;
+ for (String name : planList) {
+ if (name != null && !"".equals(name)) {
+ try {
+ AnalysePlan plan = AnalysePlanStorage.getAnalysePlan(name).getNewAnalysePlanInstance();
+ populateAnalysePlan(planIndex++, plan, props);
+ getAnalysePlans().add(plan);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find plan: " + name, eee);
+ }
+ }
+ }
+ }
+
+ String[] exportList = props.getProperty("exports", "").split(",");
+ int exportIndex = 0;
+ for (String name : exportList) {
+ if (name != null && !"".equals(name)) {
+ getExportNames().add(name);
+ }
+ }
+
+ // number of sensitivity simulation
+ numberOfSensitivitySimulation = Integer.parseInt(props.getProperty("numberOfSensitivitySimulation", "-1"));
+ // calculator name
+ String sensitivityCalculator = props.getProperty("sensitivitycalculator", null);
+ if (!StringUtils.isEmpty(sensitivityCalculator)) {
+ try {
+ SensitivityCalculator calculator = SensitivityStorage.getSensitivity(sensitivityCalculator).getNewSensitivityInstance();
+ setSensitivityCalculator(calculator);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find sensitivity: " + sensitivityCalculator, eee);
+ }
+ }
+ }
+ // sensitivity export
+ String[] sensitivityExportList = props.getProperty("sensitivityexports", "").split(",");
+ for (String name : sensitivityExportList) {
+ try {
+ if (!StringUtils.isEmpty(name)) {
+ SensitivityExport export = (SensitivityExport)ExportStorage.getExport(name).getNewExportInstance();
+ ExportHelper.populateExport(exportIndex++, getRegion(), export, props);
+ getSensitivityExport().add(export);
+ }
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find SensitivityExport: " + name, eee);
+ }
+ }
+ }
+
+ usePreScript = Boolean.parseBoolean(props.getProperty("usePreScript",
+ "false"));
+ preScript = props.getProperty("preScript");
+ useAnalysePlan = Boolean.parseBoolean(props.getProperty(
+ "useAnalysePlan", "false"));
+ analysePlan = props.getProperty("analysePlan");
+ analysePlanNumber = Integer.parseInt(props.getProperty("analysePlanNumber", "-1"));
+
+ String[] resultList = props.getProperty("resultNames", "").split(",");
+ for (String name : resultList) {
+ if (name != null && !"".equals(name)) {
+ getResultEnabled().add(name);
+ }
+ }
+
+ for (Object k : props.keySet()) {
+ if (k.toString().startsWith("tagValue.")) {
+ String key = k.toString().substring("tagValue.".length());
+ String value = props.getProperty(k.toString());
+ getTagValue().put(key, value);
+ }
+ }
+
+ onlyExport = Boolean.parseBoolean(props.getProperty("onlyExport",
+ "false"));
+
+ exportDirectory = props.getProperty("exportDirectory");
+
+ simulLogLevel = props.getProperty("simulLogLevel","info");
+ scriptLogLevel = props.getProperty("scriptLogLevel","info");
+ libLogLevel = props.getProperty("libLogLevel","info");
+ }
+
+ /**
+ * @return Returns the region.
+ */
+ public RegionStorage getRegion() {
+ if (region == null || !region.getName().equals(getRegionName())) {
+ region = RegionStorage.getRegion(getRegionName());
+ }
+ else {
+ if(log.isDebugEnabled()) {
+ log.debug(_("Region %s already inited", getRegionName()));
+ }
+ }
+ return this.region;
+ }
+
+ public MatrixND getNumberOf(Population pop) {
+ MatrixND result = numbers.get(pop);
+ if (result == null) {
+ List groups = pop.getPopulationGroup();
+ List zones = pop.getPopulationZone();
+
+ if (groups.size() == 0) {
+ groups.add("No group");
+ }
+ if (zones.size() == 0) {
+ zones.add("No zone");
+ }
+ List[] semantics = new List[] { groups, zones };
+ result = MatrixFactory.getInstance().create(semantics);
+
+ numbers.put(pop, result);
+ }
+ return result;
+ }
+
+ /**
+ * Permet de mettre les parametres de la regle sous une forme String pour
+ * pouvoir les relire ensuite.
+ *
+ * @param ruleIndex l'index de la rule
+ * @param rule La regle dont on souhaite mettre les parametres dans l'objet
+ * Properties retourne
+ * @return L'objet Properties contenant les valeurs des parametres de la
+ * regle
+ */
+ protected Properties ruleParametertoProperties(int ruleIndex, Rule rule) {
+ Properties result = new Properties();
+ ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
+ for (String paramName : RuleStorage.getParameterNames(rule).keySet()) {
+ String paramValueString;
+ try {
+ Object value = RuleStorage.getParameterValue(rule, paramName);
+ paramValueString = beanUtils.convert(value);
+ if (paramValueString != null) {
+ result.setProperty("rule." + ruleIndex + ".parameter."
+ + paramName, paramValueString);
+ }
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert parameter value to String: "
+ + paramName, eee);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Permet de mettre les parametres de l'export sous une forme String pour
+ * pouvoir les relire ensuite.
+ *
+ * @param exportIndex l'index de l'export
+ * @param export L'export dont on souhaite mettre les parametres dans l'objet
+ * Properties retourne
+ * @return L'objet Properties contenant les valeurs des parametres de la
+ * regle
+ */
+ protected Properties exportParametertoProperties(int exportIndex, Export export) {
+ Properties result = new Properties();
+ ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
+ for (String paramName : ExportStorage.getParameterNames(export).keySet()) {
+ String paramValueString;
+ try {
+ Object value = ExportStorage.getParameterValue(export, paramName);
+ paramValueString = beanUtils.convert(value);
+ if (paramValueString != null) {
+ result.setProperty("export." + exportIndex + ".parameter."
+ + paramName, paramValueString);
+ }
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert parameter value to String: "
+ + paramName, eee);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Permet de mettre les parametres du plan sous une forme String pour
+ * pouvoir les relire ensuite.
+ *
+ * @param planIndex l'index du plan
+ * @param plan Le plan dont on souhaite mettre les parametres dans l'objet
+ * Properties retourne
+ * @return L'objet Properties contenant les valeurs des parametres du plan
+ */
+ protected Properties planParametertoProperties(int planIndex, AnalysePlan plan) {
+ Properties result = new Properties();
+ ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
+ for (String paramName : AnalysePlanStorage.getParameterNames(plan).keySet()) {
+ String paramValueString;
+ try {
+ Object value = AnalysePlanStorage.getParameterValue(plan, paramName);
+ paramValueString = beanUtils.convert(value);
+ if (paramValueString != null) {
+ result.setProperty("plan." + planIndex + ".parameter."
+ + paramName, paramValueString);
+ }
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert parametre value to String: "
+ + paramName, eee);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Recupere dans prop les valeurs des champs specifique a le plan et met a
+ * jour les champs du plan
+ *
+ * @param planIndex l'index du plan
+ * @param plan le plan dont les parametres doivent etre lu depuis les
+ * proprietes
+ * @param props les proprietes contenant les parametre du plan
+ */
+ protected void populateAnalysePlan(int planIndex, AnalysePlan plan, Properties props) {
+ ConvertUtilsBean beanUtils = ConverterUtil.getConverter(getRegion().getStorage());
+ String planName = AnalysePlanStorage.getName(plan);
+ String paramTag = "plan." + planIndex + ".parameter.";
+
+ for (Map.Entry<String, Class<?>> entry : AnalysePlanStorage.getParameterNames(plan).entrySet()) {
+ String propName = entry.getKey();
+ Class<?> type = entry.getValue();
+ if (TopiaEntity.class.isAssignableFrom(type)) {
+ type = TopiaEntity.class;
+ }
+ String valueString = props.getProperty(paramTag + propName);
+ Object value = beanUtils.convert(valueString, type);
+ try {
+ AnalysePlanStorage.setParameterValue(plan, propName, value);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't reload field " + propName + " for plan " + planName , eee);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return Returns the extraRules.
+ */
+ public List<String> getExtraRules() {
+ return this.extraRules;
+ }
+
+ /**
+ * @param extraRules The extraRules to set.
+ */
+ public void addExtraRules(String ... extraRules) {
+ this.extraRules.addAll(Arrays.asList(extraRules));
+ }
+
+ /**
+ * @return Returns the populations.
+ */
+ public List<Population> getPopulations() {
+ if (populations == null) {
+ populations = new ArrayList<Population>();
+ }
+ return this.populations;
+ }
+
+ /**
+ * @param populations The populations to set.
+ */
+ public void setPopulations(List<Population> populations) {
+ this.populations = populations;
+ }
+
+ /**
+ * @return Returns the strategies.
+ */
+ public List<Strategy> getStrategies() {
+ if (strategies == null) {
+ strategies = new ArrayList<Strategy>();
+ }
+ return this.strategies;
+ }
+
+ /**
+ * @param strategies The strategies to set.
+ */
+ public void setStrategies(List<Strategy> strategies) {
+ this.strategies = strategies;
+ }
+
+ public void addRule(Rule rule) {
+ getRules().add(rule);
+ }
+
+ public void removeRule(Rule rule) {
+ getRules().remove(rule);
+ }
+
+ public void addAnalysePlan(AnalysePlan plan) {
+ getAnalysePlans().add(plan);
+ }
+
+ public void removeAnalysePlan(AnalysePlan plan) {
+ getAnalysePlans().remove(plan);
+ }
+
+ /**
+ * @return Returns the rules.
+ */
+ public List<Rule> getRules() {
+ if (rules == null) {
+ rules = new ArrayList<Rule>();
+ }
+ return this.rules;
+ }
+
+ /**
+ * @param rules The rules to set.
+ */
+ public void setRules(List<Rule> rules) {
+ this.rules = rules;
+ }
+
+ /**
+ * @return Returns the plans.
+ */
+ public List<AnalysePlan> getAnalysePlans() {
+ if (plans == null) {
+ plans = new ArrayList<AnalysePlan>();
+ }
+ return this.plans;
+ }
+
+ /**
+ * @param plans The plans to set.
+ */
+ public void setAnalysePlans(List<AnalysePlan> plans) {
+ this.plans = plans;
+ }
+
+ /**
+ * @return Returns the useOptimization.
+ */
+ public boolean getUseOptimization() {
+ return this.useOptimization;
+ }
+
+ /**
+ * @param useOptimization The useOptimization to set.
+ */
+ public void setUseOptimization(boolean useOptimization) {
+ this.useOptimization = useOptimization;
+ }
+
+ /**
+ * @return Returns the useStatistic.
+ */
+ public boolean getUseStatistic() {
+ return this.useStatistic;
+ }
+
+ public boolean isIndependentPlan() {
+ boolean result = true;
+ for (AnalysePlan plan : getAnalysePlans()) {
+ if (!(plan instanceof AnalysePlanIndependent)) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @param useStatistic The useStatistic to set.
+ */
+ public void setUseStatistic(boolean useStatistic) {
+ this.useStatistic = useStatistic;
+ }
+
+ /**
+ * @return Returns the exportNames.
+ */
+ public List<String> getExportNames() {
+ if (exportNames == null) {
+ exportNames = new ArrayList<String>();
+ }
+ return this.exportNames;
+ }
+
+ /**
+ * @param exportNames The exportNames to set.
+ */
+ public void setExportNames(List<String> exportNames) {
+ this.exportNames = exportNames;
+ }
+
+
+ /**
+ * @return the numberOfSensitivitySimulation
+ */
+ public int getNumberOfSensitivitySimulation() {
+ return numberOfSensitivitySimulation;
+ }
+
+ /**
+ * @param numberOfSensitivitySimulation the numberOfSensitivitySimulation to set
+ */
+ public void setNumberOfSensitivitySimulation(int numberOfSensitivitySimulation) {
+ this.numberOfSensitivitySimulation = numberOfSensitivitySimulation;
+ }
+
+ /**
+ * @return the sensitivityCalculator
+ */
+ public SensitivityCalculator getSensitivityCalculator() {
+ return sensitivityCalculator;
+ }
+
+ /**
+ * @param sensitivityCalculator the sensitivityCalculator to set
+ */
+ public void setSensitivityCalculator(SensitivityCalculator sensitivityCalculator) {
+ this.sensitivityCalculator = sensitivityCalculator;
+ }
+
+ /**
+ * @return the sensitivityExportNames
+ */
+ public List<SensitivityExport> getSensitivityExport() {
+ if (sensitivityExport == null) {
+ sensitivityExport = new ArrayList<SensitivityExport>();
+ }
+ return sensitivityExport;
+ }
+
+ /**
+ * @param sensitivityExport the sensitivityExportNames to set
+ */
+ public void setSensitivityExport(List<SensitivityExport> sensitivityExport) {
+ this.sensitivityExport = sensitivityExport;
+ }
+
+ /**
+ * @return Returns the useAnalysePlan.
+ */
+ public boolean getUseAnalysePlan() {
+ return this.useAnalysePlan;
+ }
+
+ /**
+ * @param useAnalysePlan The useAnalysePlan to set.
+ */
+ public void setUseAnalysePlan(boolean useAnalysePlan) {
+ this.useAnalysePlan = useAnalysePlan;
+ }
+
+ /**
+ * @return Returns the analysePlan.
+ */
+ public String getAnalysePlan() {
+ return this.analysePlan;
+ }
+
+ /**
+ * @param analysePlan The analysePlan to set.
+ */
+ public void setAnalysePlan(String analysePlan) {
+ this.analysePlan = analysePlan;
+ }
+
+ /**
+ * @return Returns the analysePlanNumber.
+ */
+ public int getAnalysePlanNumber() {
+ return this.analysePlanNumber;
+ }
+
+ /**
+ * @param analysePlanNumber The analysePlanNumber to set.
+ */
+ public void setAnalysePlanNumber(int analysePlanNumber) {
+ this.analysePlanNumber = analysePlanNumber;
+ }
+
+ /**
+ * @return Returns the numberOfYear.
+ */
+ public int getNumberOfYear() {
+ return this.numberOfYear;
+ }
+
+ /**
+ * @param numberOfYear The numberOfYear to set.
+ */
+ public void setNumberOfYear(int numberOfYear) {
+ this.numberOfYear = numberOfYear;
+ }
+
+ /**
+ * @return Returns the usePreScript.
+ */
+ public boolean getUsePreScript() {
+ return this.usePreScript;
+ }
+
+ /**
+ * @param usePreScript The usePreScript to set.
+ */
+ public void setUsePreScript(boolean usePreScript) {
+ this.usePreScript = usePreScript;
+ }
+
+ /**
+ * @return Returns the preScript.
+ */
+ public String getPreScript() {
+ return this.preScript;
+ }
+
+ /**
+ * @param preScript The preScript to set.
+ */
+ public void setPreScript(String preScript) {
+ this.preScript = preScript;
+ }
+
+ /**
+ * @return Returns the regionName.
+ */
+ public String getRegionName() {
+ return this.regionName;
+ }
+
+ /**
+ * @param regionName The regionName to set.
+ */
+ public void setRegionName(String regionName) {
+ this.regionName = regionName;
+ }
+
+ /**
+ * @return Returns the simulatorName.
+ */
+ public String getSimulatorName() {
+ return this.simulatorName;
+ }
+
+ /**
+ * @param simulatorName The simulatorName to set.
+ */
+ public void setSimulatorName(String simulatorName) {
+ this.simulatorName = simulatorName;
+ }
+
+ /**
+ * @return Returns the resultNotEnabled.
+ */
+ public Collection<String> getResultEnabled() {
+ return this.resultEnabled;
+ }
+
+ /**
+ * @param resultEnabled The resultNotEnabled to set.
+ */
+ public void setResultEnabled(Collection<String> resultEnabled) {
+ this.resultEnabled = resultEnabled;
+ }
+
+ /**
+ * @return Returns the tagValue.
+ */
+ public Map<String, String> getTagValue() {
+ return this.tagValue;
+ }
+
+ /**
+ * @param tagValue The tagValue to set.
+ */
+ public void setTagValue(Map<String, String> tagValue) {
+ this.tagValue = tagValue;
+ }
+
+ /**
+ * @return Returns the onlyExport.
+ */
+ public boolean getOnlyExport() {
+ return onlyExport;
+ }
+
+ /**
+ * @param onlyExport The onlyExport to set.
+ */
+ public void setOnlyExport(boolean onlyExport) {
+ this.onlyExport = onlyExport;
+ }
+
+ /**
+ * @return Returns the exportDirectory.
+ */
+ public String getExportDirectory() {
+ return this.exportDirectory;
+ }
+
+ /**
+ * @param exportDirectory The exportDirectory to set.
+ */
+ public void setExportDirectory(String exportDirectory) {
+ this.exportDirectory = exportDirectory;
+ }
+
+ public String getSimulLogLevel() {
+ return simulLogLevel;
+ }
+
+ public void setSimulLogLevel(String logLevel) {
+ log.info(_("isisfish.params.changeLogLev",simulLogLevel ,logLevel));
+ this.simulLogLevel = logLevel;
+ }
+
+ public String getScriptLogLevel() {
+ return scriptLogLevel;
+ }
+
+ public void setScriptLogLevel(String logLevel) {
+ log.info(_("isisfish.params.changeLogLev",scriptLogLevel,logLevel));
+ this.scriptLogLevel = logLevel;
+ }
+
+ public String getLibLogLevel() {
+ return libLogLevel;
+ }
+
+ public void setLibLogLevel(String logLevel) {
+ log.info(_("isisfish.params.changeLogLev",libLogLevel,logLevel));
+ this.libLogLevel = logLevel;
+ }
+
+ /**
+ * @return a copy of this instance
+ */
+ public SimulationParameter copy() {
+ SimulationParameter result = new SimulationParameter();
+
+ result.isisFishVersion = isisFishVersion;
+ result.description = description;
+ result.regionName = regionName;
+ result.numberOfYear = numberOfYear;
+ result.simulatorName = simulatorName;
+ result.useOptimization = useOptimization;
+ result.useStatistic = useStatistic;
+ result.usePreScript = usePreScript;
+ result.preScript = preScript;
+ result.useAnalysePlan = useAnalysePlan;
+ result.analysePlan = analysePlan;
+ result.analysePlanNumber = analysePlanNumber;
+ result.onlyExport = onlyExport;
+ result.exportNames.addAll(exportNames);
+ result.exportDirectory = exportDirectory;
+ result.strategies.addAll(strategies) ;
+ result.populations.addAll(populations) ;
+ result.rules.addAll(rules) ;
+ result.plans.addAll(plans) ;
+ result.resultEnabled.addAll(resultEnabled);
+ result.numbers.putAll(numbers) ;
+ result.tagValue.putAll(tagValue) ;
+ result.simulLogLevel = simulLogLevel;
+ result.scriptLogLevel = scriptLogLevel;
+ result.libLogLevel = libLogLevel;
+ result.numberOfSensitivitySimulation = numberOfSensitivitySimulation;
+ result.sensitivityExport.addAll(sensitivityExport);
+ result.sensitivityCalculator = sensitivityCalculator;
+
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append(_("isisfish.params.toString.simulation.done", getIsisFishVersion())).append('\n');
+ result.append("--------------------\n");
+ result.append(getDescription()).append('\n');
+ result.append("--------------------\n");
+
+ if (getUseAnalysePlan()) {
+ result.append(_("isisfish.params.toString.plan.number", getAnalysePlanNumber()));
+ }
+
+ RegionStorage region = getRegion();
+ result.append(_("isisfish.params.toString.fishery", region.getName()));
+ result.append(_("isisfish.params.toString.number.years", getNumberOfYear()));
+ List strs = getStrategies();
+ result.append(_("isisfish.params.toString.strategies"));
+ String sep = "";
+ for (Object str : strs) {
+ result.append(sep).append(str);
+ sep = ",";
+ }
+ result.append("\n\n");
+ result.append(_("isisfish.params.toString.populations"));
+ sep = "";
+ for(Population pop : getPopulations()){
+ result.append(sep).append(pop.getName());
+ sep =",";
+ }
+ result.append("\n\n");
+ for (Rule rule : getRules()) {
+ String name = RuleStorage.getName(rule);
+ String param = "";
+ try {
+ param = RuleStorage.getParamAsString(rule);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert rule parameter to string for " + name, eee);
+ }
+ }
+ result.append(_("isisfish.params.toString.rule", name));
+ result.append(param);
+ result.append("\n");
+
+ }
+ result.append("\n\n");
+ for (AnalysePlan plan : getAnalysePlans()) {
+ String name = RuleStorage.getName(plan);
+ String param = "";
+ try {
+ param = AnalysePlanStorage.getParamAsString(plan);
+ } catch (IsisFishException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't convert plan parameter to string for " + name, eee);
+ }
+ }
+ result.append(_("isisfish.params.toString.plan", name));
+ result.append(param);
+ result.append('\n');
+
+ }
+ result.append('\n');
+ result.append(_("isisfish.params.toString.script.presimulation")).append(":\n");
+ result.append(getPreScript());
+ result.append('\n');
+ result.append(_("isisfish.params.toString.simul.logger.level", simulLogLevel));
+ result.append('\n');
+ result.append(_("isisfish.params.toString.script.logger.level", scriptLogLevel));
+ result.append('\n');
+ result.append(_("isisfish.params.toString.lib.logger.level", libLogLevel));
+ result.append('\n');
+ return result.toString();
+ }
+
+ public boolean isSimulErrorLevel() {
+ return "error".equals(simulLogLevel);
+ }
+ public boolean isSimulWarnLevel() {
+ return "warn".equals(simulLogLevel);
+ }
+ public boolean isSimulInfoLevel() {
+ return "info".equals(simulLogLevel);
+ }
+ public boolean isSimulDebugLevel() {
+ return "debug".equals(simulLogLevel);
+ }
+
+ public boolean isScriptErrorLevel() {
+ return "error".equals(scriptLogLevel);
+ }
+ public boolean isScriptWarnLevel() {
+ return "warn".equals(scriptLogLevel);
+ }
+ public boolean isScriptInfoLevel() {
+ return "info".equals(scriptLogLevel);
+ }
+ public boolean isScriptDebugLevel() {
+ return "debug".equals(scriptLogLevel);
+ }
+
+ public boolean isLibErrorLevel() {
+ return "error".equals(libLogLevel);
+ }
+ public boolean isLibWarnLevel() {
+ return "warn".equals(libLogLevel);
+ }
+ public boolean isLibInfoLevel() {
+ return "info".equals(libLogLevel);
+ }
+ public boolean isLibDebugLevel() {
+ return "debug".equals(libLogLevel);
+ }
+
+
+ public void clearRules() {
+ if (rules != null) {
+ rules.clear();
+ }
+ }
+ public void clearPlans() {
+ if (plans!= null) {
+ plans.clear();
+ }
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,1009 +0,0 @@
-/* *##%
- * 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
- * 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.launcher;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.mutable.MutableInt;
-import org.apache.commons.lang.time.DurationFormatUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.topia.TopiaException;
-import org.codelutin.util.FileUtil;
-import org.codelutin.util.ListenerSet;
-import org.codelutin.util.ObjectUtil;
-import org.codelutin.util.ZipUtil;
-
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
-import fr.ifremer.isisfish.datastore.ExportStorage;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.RuleStorage;
-import fr.ifremer.isisfish.datastore.ScriptStorage;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.mexico.MexicoHelper;
-import fr.ifremer.isisfish.rule.Rule;
-import fr.ifremer.isisfish.simulator.AnalysePlan;
-import fr.ifremer.isisfish.simulator.AnalysePlanContext;
-import fr.ifremer.isisfish.simulator.SimulationControl;
-import fr.ifremer.isisfish.simulator.SimulationException;
-import fr.ifremer.isisfish.simulator.SimulationParameter;
-import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
-import fr.ifremer.isisfish.simulator.sensitivity.Scenario;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityScenarios;
-import fr.ifremer.isisfish.util.ClasspathTemplateLoader;
-import fr.ifremer.isisfish.util.CompileHelper;
-import fr.ifremer.isisfish.util.ConverterUtil;
-import freemarker.cache.TemplateLoader;
-import freemarker.ext.beans.BeansWrapper;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
-
-/**
- * Cette classe est responsable de conservation de toutes les simulations faites
- * ou a faire. Pour ajouter une nouvelle simulation on appelle la methode
- * {@link #submit}.
- * <p>
- * Cette classe sert aussi de modele pour le moniteur de queue
- * <p>
- * Il existe une instance unique pour toute l'application
- * <p>
- * Lors de l'instanciation de la classe, l'ensemble des
- * {@link SimulatorLauncher} disponible est recherche dans la configuration
- * et un executor est cree pour chaque.
- * <p>
- * Si un {@link SimulatorLauncher} genere trop d'erreur (RemoteException)
- * Il est alors suspendu pour ne plus etre utilise pour les simulations.
- *
- * @author poussin
- * @version $Revision: 1.0 $
- *
- * Last update : $Date: 5 mars 2009 $
- * By : $Author: chatellier $
- */
-public class SimulationService {
-
- public static final String SIMULATION_LAUNCHER = "simulation.launcher";
- /** nombre maximal de simulation autoriser pour un plan */
- // FIXME a rendre configurable MAX_PLAN_SIMULATION
- public static final int MAX_PLAN_SIMULATION = 20000;
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulationService.class);
-
- protected static SimulationService instance = new SimulationService();
-
- /** Freemarker configuration used to get prescripts content. */
- protected Configuration freemarkerConfiguration;
-
- /** Freemarker pre script template. */
- protected static final String SENSITIVITY_PRE_SCRIPT = "templates/prescript/factorprescript.ftl";
-
- /**
- * Retourne l'instance du {@link SimulationService} a utiliser
- * @return l'instance a utiliser
- */
- public static SimulationService getService() {
- return instance;
- }
-
- protected PropertyChangeSupport propertyListeners = new PropertyChangeSupport(
- this);
- protected ListenerSet<SimulationServiceListener> listeners = new ListenerSet<SimulationServiceListener>();
-
- // FIXME pouvoir configurer ceci en fichier de config
- // FIXME ainsi que la mise a false, lors de la simulation de la derniere
- // (sans doute ajoute un boolean, simulationListAsQueue = true|false)
- protected boolean autoLaunch = true;
-
- /** L'executor utilise pour creer toutes les sous simulations des plans
- * independants */
- protected ExecutorService subSimulationComputationExecutor = Executors
- .newSingleThreadExecutor();
- /** Tous les types de {@link SimulatorLauncher} disponibles, et leur
- * executors associe */
- protected Map<SimulatorLauncher, SimulationExecutor> executors = new LinkedHashMap<SimulatorLauncher, SimulationExecutor>();
- /** Le nombre d'erreur pour les SimulatorLauncher */
- protected Map<SimulatorLauncher, MutableInt> launcherError = new HashMap<SimulatorLauncher, MutableInt>();
- /** La queue contenant toutes les simulations a faire */
- protected SimulationQueue queue = new SimulationQueue();
-
- /** Contient les identifiants des simulations presentes dans {@link #jobs}*/
- protected Set<String> idJobs = new HashSet<String>();
- /** La liste des jobs existant (queue + job demarre) */
- protected Set<SimulationJob> jobs = new TreeSet<SimulationJob>();
-
- /** La liste des jobs termines */
- protected Set<SimulationJob> jobDones = new TreeSet<SimulationJob>();
-
- /**
- * Cree une instance et initialise les executors ainsi que le launcherError
- */
- protected SimulationService() {
- // on cree un executor par type SimulatorLauncher
- Properties prop = IsisFish.config
- .getOptionStartsWith(SIMULATION_LAUNCHER);
-
- // sort simulation names by... names
- // this solve "local" "sub", "remote" order
- // default "local" is in first in UI.
- List<String> simulationKeys = new ArrayList<String>(prop
- .stringPropertyNames());
- Collections.sort(simulationKeys);
-
- for (String key : simulationKeys) {
- String value = prop.getProperty(key);
- try {
- SimulatorLauncher sl = (SimulatorLauncher) ObjectUtil
- .newInstance(value);
- addSimulationLauncher(sl);
- } catch (Exception eee) {
- log.warn(_("Can't instantiate %s", value), eee);
- }
- }
-
- // fait un appel au moniteur
- // pour reprendre le monitoring des simulation en cours
- SimulationMonitor.getInstance().reloadConfig(this);
- }
-
- /**
- * Permet d'ajouter un nouveau SimulatorLauncher. Cela cree automatiquement
- * un executor pour ce SimulatorLauncher. S'il y avait deja un
- * SimulatorLauncher de ce type un nouveau est ajoute.
- * @param sl le SimulatorLauncher a ajouter
- */
- public void addSimulationLauncher(SimulatorLauncher sl) {
- SimulationQueue executorQueue = new SimulationQueue(queue);
- SimulationExecutor se = new SimulationExecutor(this, sl, executorQueue);
- executors.put(sl, se);
- launcherError.put(sl, new MutableInt(0));
- }
-
- /**
- * @return les SimulatorLauncher et leurs noms
- */
- public List<SimulatorLauncher> getSimulationLaunchers() {
- List<SimulatorLauncher> result = new ArrayList<SimulatorLauncher>(
- executors.keySet());
- return result;
- }
-
- public Collection<SimulationExecutor> getSimulationExecutors() {
- return executors.values();
- }
-
- public Set<SimulationJob> getJobs() {
- return jobs;
- }
-
- public Set<SimulationJob> getJobDones() {
- return jobDones;
- }
-
- /**
- * Retourne la liste de tous les {@link SimulatorLauncher} disponible
- * @return
- */
- protected Set<SimulatorLauncher> getSimulatorLaunchers() {
- return executors.keySet();
- }
-
- public void addSimulationServiceListener(SimulationServiceListener l) {
- listeners.add(l);
- }
-
- public void removeSimulationServiceListener(SimulationServiceListener l) {
- listeners.remove(l);
- }
-
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- propertyListeners.addPropertyChangeListener(listener);
- }
-
- public void addPropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyListeners.addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- propertyListeners.removePropertyChangeListener(listener);
- }
-
- public void removePropertyChangeListener(String propertyName,
- PropertyChangeListener listener) {
- propertyListeners.removePropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Ajoute le job au job en cours previent s'il n'etait pas deja present
- * les listener {@link SimulationServiceListener#simulationStart}.
- * @param job
- */
- protected void fireStartEvent(SimulationJob job) {
- // on ajoute au cas on il n'y serait pas
- if (jobs.add(job)) {
- idJobs.add(job.getItem().getControl().getId());
- for (SimulationServiceListener l : listeners) {
- l.simulationStart(this, job);
- }
- }
- }
-
- /**
- * Supprime le job de la liste des jobs en cours et l'ajoute le job si
- * besoin a la liste des jobs faits (s'il y a une erreur ou qu'il ne sagit
- * pas d'une simulation lancer par un plan d'analyse).
- * Les listener sont prevenu par la methode
- * {@link SimulationServiceListener#simulationStop}.
- * @param job
- */
- protected void fireStopEvent(SimulationJob job) {
- jobs.remove(job);
- idJobs.remove(job.getItem().getControl().getId());
-
- // on ajout au jobDones que les simulations avec erreur ou les
- // simulation reellement demande par l'utilisateur (pas de simulation
- // de plan
- jobDones.add(job);
- for (SimulationServiceListener l : listeners) {
- l.simulationStop(this, job);
- }
- }
-
- /**
- * Nettoie la liste des jobs faits
- */
- public void clearJobDone() {
- jobDones.clear();
- for (SimulationServiceListener l : listeners) {
- l.clearJobDone(this);
- }
- }
-
- /**
- * @return Returns the autoLaunch.
- */
- public boolean isAutoLaunch() {
- return this.autoLaunch;
- }
-
- /**
- * @param autoLaunch The autoLaunch to set.
- */
- public void setAutoLaunch(boolean autoLaunch) {
- synchronized (this) {
- boolean oldValue = this.autoLaunch;
- this.autoLaunch = autoLaunch;
- if (this.autoLaunch) {
- this.notifyAll();
- }
- propertyListeners.firePropertyChange("autoLaunch", oldValue,
- autoLaunch);
- }
- }
-
- /**
- * Permet de mettre en attente les threads de simulation si l'utilisateur
- * a suspendu la queue
- */
- protected void waitAutoLaunch() {
- synchronized (this) {
- while (!isAutoLaunch()) {
- try {
- log.info("autoLaunch is false waiting queue start");
- this.wait();
- } catch (InterruptedException eee) {
- log.warn("Error during wait autoLaunch flag", eee);
- }
- }
- }
- }
-
- /**
- * Permet d'ajouter une nouvelle simulation a la queue. Si la simulation est
- * simple ou avec un plan d'experience dependant, un nouveau job est cree
- * et directement ajout a la queue de jobs. S'il la simulation est un plan
- * ou les simulations sont independantes, toutes les simulations sont
- * genere et toute ajoute a la queue de simulation. Mais dans ce cas seul
- * la simulation de depart est ajoute au jobs en cours, les simulations
- * generees seront ajoutees lors de leur reel execution
- *
- * @param id l'identifiant de la simulation
- * @param param les parametres de la simulation
- * @param launcher le launcher a utiliser pour lancer la simulation
- * @param priority la priorite de la simulation
- */
- public void submit(String id, SimulationParameter param,
- SimulatorLauncher launcher, int priority) {
- // on l'ajoute tout de suite a la liste des simulations demandee
- SimulationControl control = new SimulationControl(id);
- SimulationItem item = new SimulationItem(control, param);
- SimulationJob job = new SimulationJob(this, item, priority);
- job.setLauncher(launcher);
- fireStartEvent(job);
-
- // on construit le zip de la simulation
- File zip = prepareSimulationZipFile(control, param, null, true);
- item.setSimulationZip(zip);
-
- if (param.getUseAnalysePlan() && param.isIndependentPlan()) {
- // c un plan d'analyse independant, on construit toute les sous simu
- Runnable task = new PrepareSimulationJob(this, job);
- subSimulationComputationExecutor.execute(task);
- } else {
- // l'item est fini d'etre initialise, on peut l'ajouter a la queue
- // sauf si c'etait un plan independant ou se seront les sous simu
- // qui seront dans la queue
- submit(job);
- }
-
- }
-
- /**
- * Permet d'ajouter une simulation avec des factors a prendre en compte.
- *
- * @param id l'identifiant de la simulation
- * @param param les parametres de la simulation
- * @param launcher le launcher a utiliser pour lancer la simulation
- * @param priority la priorite de la simulation
- * @param sensitivitycalculator l'implementation du calculateur de sensibiilite
- * @param designPlan le design plan qui contient les facteurs
- */
- public void submit(String id, SimulationParameter param,
- SimulatorLauncher launcher, int priority,
- SensitivityCalculator sensitivitycalculator, DesignPlan designPlan) {
-
- try {
-
- // build master sensitivity export directory
- File masterExportDirectory = new File(IsisFish.config.getDefaultExportDirectory(), id);
- if (!masterExportDirectory.isDirectory()) {
- masterExportDirectory.mkdirs();
- }
-
- SensitivityScenarios sensitivityScenarios = sensitivitycalculator
- .compute(designPlan, masterExportDirectory);
-
- // ajout des parametres de simulation
- param.setSensitivityCalculator(sensitivitycalculator);
- param.setNumberOfSensitivitySimulation(sensitivityScenarios.getScenarios().size());
-
- // export designplan as XML
- String xmlDesignPlan = MexicoHelper.getDesignPlanAsXML(designPlan);
-
- // on l'ajoute tout de suite a la liste des simulations demandee
- // init with default "id" must been changed for designPlan
- // simulation
- SimulationControl controlJustForZip = new SimulationControl(id);
-
- // on construit le zip de la simulation
- // in zip, there will be param "without" prescript
- File zip = prepareSimulationZipFile(controlJustForZip, param, xmlDesignPlan, true);
-
- // for each simulation, we neeed to launch a specific simulation
- // new simulation ids will be id + "_" + x
- // where x is a int starting at 0
- int simulationIndex = 0;
- for (Scenario scenario : sensitivityScenarios.getScenarios()) {
-
- // modify modification parameter
- // subParam only convenient for add pre script
- // for launcher
- SimulationParameter subParam = param.copy();
- String preScriptContent = generatePreScript(scenario);
- subParam.setUsePreScript(true);
- subParam.setPreScript(preScriptContent);
-
- // build new simulation id
- String subsimulationId = id + "_" + simulationIndex;
- SimulationControl realSimulationControl = new SimulationControl(
- subsimulationId);
-
- // new item, with zip
- SimulationItem item = new SimulationItem(realSimulationControl,
- subParam);
- item.setSimulationZip(zip);
-
- SimulationJob job = new SimulationJob(this, item, priority);
- job.setLauncher(launcher);
- fireStartEvent(job);
-
- if (subParam.getUseAnalysePlan()
- && subParam.isIndependentPlan()) {
- // c un plan d'analyse independant, on construit toute les sous simu
- Runnable task = new PrepareSimulationJob(this, job);
- subSimulationComputationExecutor.execute(task);
- } else {
- // l'item est fini d'etre initialise, on peut l'ajouter a la queue
- // sauf si c'etait un plan independant ou se seront les sous simu
- // qui seront dans la queue
- submit(job);
- }
-
- simulationIndex++;
- }
-
- } catch (Exception e) {
- if (log.isErrorEnabled()) {
- log.error("Can't get scenarios from calculator", e);
- }
- }
- }
-
- /**
- * Get freemarker configuration.
- */
- protected Configuration getFreemarkerConfiguration() {
- Configuration configuration = new Configuration();
-
- // needed to overwrite "Defaults to default system encoding."
- // fix encoding issue on some systems
- configuration.setDefaultEncoding("utf-8");
-
- // specific template loader to get template from jars (classpath)
- TemplateLoader templateLoader = new ClasspathTemplateLoader();
- configuration.setTemplateLoader(templateLoader);
-
- configuration.setObjectWrapper(new BeansWrapper());
-
- return configuration;
- }
-
- /**
- * Generate prescript to set factor values before simulation start.
- *
- * @param scenario
- * @return simulation pre script with correct values
- * @throws IOException if pre script can't be made
- * @throws TemplateException if pre script can't be made
- */
- protected String generatePreScript(Scenario scenario) throws IOException,
- TemplateException {
-
- // init one at first call
- if (freemarkerConfiguration == null) {
- freemarkerConfiguration = getFreemarkerConfiguration();
- }
-
- Writer out = new StringWriter();
- Template template = freemarkerConfiguration
- .getTemplate(SENSITIVITY_PRE_SCRIPT);
- Map<String, Object> root = new HashMap<String, Object>();
- root.put("scenario", scenario);
- root.put("beanUtils", ConverterUtil.getConverter(null));
-
- template.process(root, out);
- out.flush();
- String scriptContent = out.toString();
-
- if (log.isTraceEnabled()) {
- log.trace("Simulation prescript content = " + scriptContent);
- }
-
- return scriptContent;
- }
-
- /**
- * Resoumet une simulation qui a deja été démarrée, mais
- * on ne faisant que du control de monitoring.
- *
- * @param id
- * @param param
- * @param launcher
- * @param priority
- */
- public void submitForCheckOnly(String id, SimulationParameter param,
- SimulatorLauncher launcher, int priority) {
- // on l'ajoute tout de suite a la liste des simulations demandee
- SimulationControl control = new SimulationControl(id);
- SimulationItem item = new SimulationItem(control, param);
- SimulationJob job = new SimulationJob(this, item, priority);
- job.setLauncher(launcher);
- fireStartEvent(job);
-
- job.setOnlyCheckControl(true);
-
- //if (param.getUseAnalysePlan() && param.isIndependentPlan()) {
- // // c un plan d'analyse independant, on construit toute les sous simu
- // Runnable task = new PrepareSimulationJob(this, job);
- // subSimulationComputationExecutor.execute(task);
- //} else {
- // l'item est fini d'etre initialise, on peut l'ajouter a la queue
- // sauf si c'etait un plan independant ou se seront les sous simu
- // qui seront dans la queue
- submit(job);
- //}
-
- }
-
- protected void submit(SimulationJob job) {
- SimulatorLauncher launcher = job.getLauncher();
- // on ajoute a la queue qui utilise le launcher defini dans le job
- if (launcher != null) {
- for (SimulatorLauncher l : executors.keySet()) {
- if (launcher == l) {
- log.info(_("Add to %s queue", l));
- SimulationExecutor executor = executors.get(l);
- executor.execute(job);
- return;
- }
- }
- }
- // dernier recours on ajoute a la queue sans launcher
- log.info(_("Add to default queue"));
- queue.add(job);
- }
-
- /**
- * Permet de resoumettre un job qui a ete pris par un thread mais qu'il
- * ne peut pas traiter. Cela arrive lorsque l'executor est en pause, ou
- * que le launcher de l'executor ne fonctionne plus (il se met en pause
- * tout seul)
- *
- * @param job l'item a resoumettre
- */
- protected void resubmit(SimulationJob job) {
- submit(job);
- }
-
- /**
- * Permet de soumettre a la queue un job provenant d'un plan.
- * Ce plan ne doit pas apparaitre dans la console de queue.
- *
- * @param job
- */
- protected void submitSubJob(SimulationJob job) {
- submit(job);
- }
-
- /**
- * Supprime un job de la queue (annulation d'une simulation). Appele
- * depuis {@link SimulationJob#stop}
- *
- * @param job le job a annuler
- * @return vrai si la simulation a pu etre annulee avant sont lancement
- * (encore presente dans la queue), faux si la simulation a deja ete
- * prise par un thread de simulation ou quelle est terminee
- */
- protected boolean cancel(SimulationJob job) {
- boolean result = queue.remove(job);
- return result;
- }
-
- public boolean exists(String id) {
- boolean result = idJobs.contains(id);
- return result;
- }
-
- /**
- * Report une erreur pour un launcher, on resoumet le job en supprimant
- * le launcher utilise
- *
- * @param launcher le launcher posant probleme
- * @param job le job qui n'a pas reussi a se faire
- */
- protected void reportError(SimulatorLauncher launcher, SimulationJob job) {
- MutableInt i = launcherError.get(launcher);
- i.setValue(i.intValue() + 1);
- // si on a plus de N error, on stop l'executor associe
- if (i.intValue() >= 5) {
- log.error(_("Launcher %s will be stopped because there are too many error (%s)",
- launcher, i.intValue()));
- SimulationExecutor e = executors.get(launcher);
- e.pause();
- }
- // il faut bien penser a supprimer le launcher pour qu'un autre executor
- // puisse y mettre le sien.
- // FIXME: est ce le bon choix si l'utilisateur avait force un launcher particulier, ne faudrait t'il pas prevenir l'utilisateur ?
- job.setLauncher(null);
- resubmit(job);
- }
-
- /**
- * Permet de genere les sous simulations d'un plan d'analyse. Pour les
- * plan independant, on l'utilise en Runnable pour genere tous les plans
- * possible et les soumettre a la queue. Pour les plans dependant
- * on l'utilise seulement comme iterator. La methode afterSimulation des plans
- * est appelee automatiquement a la fin de la simulation grace au mecanisme
- * de PostAction sur les {@link SimulationJob}.
- */
- public static class PrepareSimulationJob implements Runnable,
- Iterator<SimulationJob>, SimulationJob.PostAction {
-
- protected SimulationService simulationService;
- protected AnalysePlanContext planContext;
- protected SimulationJob job;
- protected SimulationJob nextJob;
- protected boolean doNext = true;
- protected String id;
- protected SimulationControl control;
- protected SimulationParameter param;
- protected int done = 0;
-
- public PrepareSimulationJob(SimulationService simulationService,
- SimulationJob job) {
- this.simulationService = simulationService;
- this.job = job;
- id = job.getItem().getControl().getId();
- control = job.getItem().getControl();
- param = job.getItem().getParameter();
- this.planContext = new AnalysePlanContext(control.getId(), param);
- }
-
- /**
- * genere toutes les sous simulations et les places dans la queue
- */
- public void run() {
- while (hasNext()) {
- try {
- SimulationJob subJob = next();
- simulationService.submitSubJob(subJob);
- } catch (Exception eee) {
- log.error(_("Can't add simulation: ", job.getItem()
- .getControl().getId()), eee);
- }
- }
-
- }
-
- /**
- * Indique s'il y a encore des simulations dans le plan. Par defaut pour
- * Eviter les plans sans fin, le nombre de plan genere par simulation
- * est limite a {@link SimulationService#MAX_PLAN_SIMULATION}
- *
- * @return <tt>true</tt> if has next
- */
- public boolean hasNext() {
- try {
- // if user request stop simulation, stop all futur planned simulation
- // and if last doNext is false not do next simulation
- boolean result = !control.isStopSimulationRequest() && doNext;
- if (result) {
- // si deja creer on ne le refet pas
- if (nextJob == null) {
- // Prepration de la simulation a faire
- // create next id simulation
-
- // this start a 0
- int planNumber = planContext.getNumber();
-
- if (planNumber > MAX_PLAN_SIMULATION) {
- log.error(_("Analyse plan error, too many simulation for %s : %s",
- id, planNumber));
- doNext = false;
- result = false;
- } else {
- String simId = id + "_" + planNumber;
- param.setAnalysePlanNumber(planNumber);
-
- File tmpDirectory = FileUtil.createTempDirectory(
- "isisfish-simultation-", "-preparation");
- SimulationStorage sim = SimulationStorage
- .importAndRenameZip(tmpDirectory, job
- .getItem().getSimulationZip(),
- simId);
- sim.getParameter().setAnalysePlanNumber(planNumber);
-
- // appel de tous les plans pour modifier la simulation
- for (AnalysePlan plan : param.getAnalysePlans()) {
- result = result
- && plan.beforeSimulation(planContext,
- sim);
- if (!result) {
- nextJob = null;
- break;
- }
- }
- doNext = result;
- if (result) {
- File zip = sim.createZip();
- SimulationControl childControl = new SimulationControl(
- simId);
- SimulationParameter childParam = param.copy();
- SimulationItem item = new SimulationItem(
- childControl, childParam);
- item.setSimulationZip(zip);
- nextJob = new SimulationJob(simulationService,
- job, item, job.getPriority());
- nextJob.setLauncher(job.getLauncher());
- nextJob.addPostAction(this); // pour l'appel des after des plans
- }
- // quoi qu'il arrive on supprime le repertoire temporaire
- if (!FileUtil.deleteRecursively(tmpDirectory)) {
- log.warn(_("isisfish.error.remove.directory",
- tmpDirectory));
- }
- }
-
- // increment number for next simulation job
- planContext.incNumber();
- }
- }
- return result;
- } catch (Exception eee) {
- throw new IsisFishRuntimeException(
- _("isisfish.error.evalute.plan.script"), eee);
- }
-
- }
-
- public SimulationJob next() {
- hasNext(); // pour etre sur qu'il a ete appele au moins une fois
- SimulationJob result = nextJob;
- nextJob = null;
- return result;
-
- }
-
- public void remove() {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- public void finished(SimulationJob job, SimulationStorage sim) {
- // doNext = true;
-
- // appel de tous les plans pour modifier la simulation
- for (AnalysePlan plan : sim.getParameter().getAnalysePlans()) {
- try {
- boolean result = plan.afterSimulation(planContext, sim);
- doNext = doNext && result;
- } catch (Exception eee) {
- log.error(_("Stop simulation plan, because can't call afterSimulation correctly on plan %s",
- plan.getClass().getName()), eee);
- doNext = false;
- }
- }
- // une sim vient de se finir, on incremente le compteur
- done++;
- if (!hasNext() && (done + 1 == planContext.getNumber())) {
- // on enleve le master plan des simulations en cours, vu que
- // toutes les simu sont terminees
- simulationService.fireStopEvent(this.job);
- }
- }
-
- public void exception(SimulationJob job, Throwable eee) {
- // il y a une simulation d'echoue, on ne fait pas les suivantes
- // cela n'impacte pas les plan independant puisque toutes les
- // simulation on deja ete generee
- doNext = false;
- simulationService.fireStopEvent(this.job);
- }
- }
-
- /**
- * Prepare les fichiers qui seront utilsé à la simulation:
- * <li> scripts
- * <li> rules
- * <li> exports
- * <li> simulators
- * <li> export de la database de la region
- * <li> analyseplan
- * <p>
- * Le tout est zippé et le zip est retourné, il peut-être directement
- * importé dans le {@link SimulationStorage} (en le renommant comme
- * il faut {@link SimulationStorage#importAndRenameZip(File, String)}.
- * <p>
- * Ce zip est automatiquement supprimé à la fin de l'application.
- *
- * @param control le controleur
- * @param param les parametre de la simulation
- * @param xmlDesignPlan contenu xml des design plan
- * @param compile si vrai la version compile des fichiers Java est aussi
- * mise dans le fichier zip. Cela peut servir pour les simulations locales
- * pour ne pas recompiler pour chaque simulation avec plan d'analyse
- * @return un zip de simulation pour une simulation pret a être faite
- * @throws SimulationException pour tout problème rencontré (IO,Topia...)
- */
- protected File prepareSimulationZipFile(SimulationControl control,
- SimulationParameter param, String xmlDesignPlan, boolean compile)
- throws SimulationException {
- try {
- File tmpDirectory = FileUtil.createTempDirectory(
- "isisfish-simultation-", "-preparation");
- //File regionXML = IsisConfig.getDataBackupFile(tmpDirectory);
- File regionXML = new File(tmpDirectory,
- SimulationStorage.DATA_BACKUP_FILENAME);
-
- // sauvegarde des parametres
- Properties prop = param.toProperties();
- //File f = IsisConfig.getSimulationParametersFile(tmpDirectory);
- File f = new File(tmpDirectory,
- SimulationStorage.PARAMETERS_FILENAME);
- FileOutputStream out = new FileOutputStream(f);
- //FileOutputStream out = new FileOutputStream(new File(tmpDirectory, IsisConfig.SIMULATION_PARAMETERS));
- prop.store(out, "Parameters");
- out.close();
-
- // backup pour toutes les simulations, pour eviter que l'utilisateur
- // ne puisse le modifier en meme temps
- control.setText(_("isisfish.message.backup.database.progress"));
- RegionStorage region = RegionStorage.getRegion(param
- .getRegionName());
- TopiaContext tc = region.getStorage().beginTransaction();
- tc.backup(regionXML, true);
- tc.closeContext();
- control.setText(_("isisfish.message.backup.database.finished"));
-
- // copie de toutes regles a utiliser
- List<Rule> rules = param.getRules();
- for (Rule rule : rules) {
- String name = RuleStorage.getName(rule);
- FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name
- + ".java"),
- new File(tmpDirectory, RuleStorage.RULE_PATH
- + File.separator + name + ".java"));
- }
- // copie des regles reclamées par les plans d'analyse
- for (String name : param.getExtraRules()) {
- FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name
- + ".java"),
- new File(tmpDirectory, RuleStorage.RULE_PATH
- + File.separator + name + ".java"));
- }
-
- // copie de toutes regles a utiliser
- List<AnalysePlan> plans = param.getAnalysePlans();
- for (AnalysePlan plan : plans) {
- String name = AnalysePlanStorage.getName(plan);
- FileUtil.copy(new File(AnalysePlanStorage
- .getAnalysePlanDirectory(), name + ".java"), new File(
- tmpDirectory, AnalysePlanStorage.ANALYSE_PLAN_PATH
- + File.separator + name + ".java"));
- }
-
- // copie de tous les exports a utiliser
- for (String name : param.getExportNames()) {
- name = name.endsWith(".java") ? name : name + ".java";
- FileUtil.copy(
- new File(ExportStorage.getExportDirectory(), name),
- new File(tmpDirectory, ExportStorage.EXPORT_PATH
- + File.separator + name));
- }
-
- // copie de tous les scripts a utiliser
- FileUtil.copyRecursively(ScriptStorage.getScriptDirectory(),
- tmpDirectory, ".*\\.java$");
-
- // copie de tous les simulateurs a utiliser
- FileUtil.copy(new File(SimulatorStorage.getSimulatorDirectory(),
- param.getSimulatorName()), new File(tmpDirectory,
- SimulatorStorage.SIMULATOR_PATH + File.separator
- + param.getSimulatorName()));
-
- if (compile) {
- compileAllFile(control, tmpDirectory);
- }
-
- // Sauvegarde du design plan en XML
- if (!StringUtils.isEmpty(xmlDesignPlan)) {
- File simulationDesignPlanFile = SimulationStorage.getMexicoDesignPlan(tmpDirectory);
- FileUtil.writeString(simulationDesignPlanFile, xmlDesignPlan);
- }
-
- FileUtil.copy(new File(SimulatorStorage.getSimulatorDirectory(),
- param.getSimulatorName()), new File(tmpDirectory,
- SimulatorStorage.SIMULATOR_PATH + File.separator
- + param.getSimulatorName()));
-
- // creation du zip
- File result = new File(tmpDirectory.getPath() + ".zip");
- result.deleteOnExit();
- ZipUtil.compress(result, tmpDirectory, null);
-
- // poussin 20071015: remove temp directory
- if (!FileUtil.deleteRecursively(tmpDirectory)) {
- log.warn(_("isisfish.error.remove.directory", tmpDirectory));
- }
-
- return result;
- } catch (IOException eee) {
- throw new SimulationException(
- _("isisfish.error.prepare.information.simulation"), eee);
- } catch (TopiaException eee) {
- throw new SimulationException(
- _("isisfish.error.prepare.information.simulation"), eee);
- }
-
- }
-
- /**
- * Compile les fichiers présent dans le répertoire passé en
- * parametre, ce répertoire est hiérarchisé en: rules, exports, simulators
- * et scripts. Seuls les fichiers des 3 premiers répertoires sont compilés
- * les fichiers du dernier sont compilé par les dépendances qu'on les autres
- * <p>
- * Il permet donc de compiler facilement tous les fichiers pour une
- * simulation
- *
- * @param control le controleur
- * @param directory le répertoire où compiler
- */
- protected void compileAllFile(SimulationControl control, File directory) {
-
- control.setText("Scripts and rules Compilation");
- long currentTime = System.nanoTime();
-
- //
- // Recherche des fichiers a compiler
- // On ne prend pas les scripts, car ils sont tous copiés mais pas
- // forcément util. Lors de la compilation des autres fichiers, les
- // script servant réellement seront automatiquement compilé
-
- List<File> fileToCompile = new ArrayList<File>();
-
- List<File> tmp = FileUtil.find(new File(directory,
- ExportStorage.EXPORT_PATH), ".*\\.java$", true);
- fileToCompile.addAll(tmp);
-
- tmp = FileUtil.find(new File(directory, RuleStorage.RULE_PATH),
- ".*\\.java$", true);
- fileToCompile.addAll(tmp);
-
- tmp = FileUtil.find(new File(directory,
- AnalysePlanStorage.ANALYSE_PLAN_PATH), ".*\\.java$", true);
- fileToCompile.addAll(tmp);
-
- tmp = FileUtil.find(
- new File(directory, SimulatorStorage.SIMULATOR_PATH),
- ".*\\.java$", true);
- fileToCompile.addAll(tmp);
-
- //
- // Compilation
- //
-
- CompileHelper.compile(directory, fileToCompile, directory, null);
- long time = System.nanoTime() - currentTime;
- control.setText(_("isisfish.message.compilation.time",
- DurationFormatUtils.formatDuration(time / 1000000, "s'.'S")));
-
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,1008 @@
+/* *##%
+ * 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
+ * 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.launcher;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.mutable.MutableInt;
+import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.TopiaException;
+import org.codelutin.util.FileUtil;
+import org.codelutin.util.ListenerSet;
+import org.codelutin.util.ObjectUtil;
+import org.codelutin.util.ZipUtil;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.mexico.MexicoHelper;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.simulator.AnalysePlan;
+import fr.ifremer.isisfish.simulator.AnalysePlanContext;
+import fr.ifremer.isisfish.simulator.SimulationControl;
+import fr.ifremer.isisfish.simulator.SimulationException;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
+import fr.ifremer.isisfish.simulator.sensitivity.Scenario;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityScenarios;
+import fr.ifremer.isisfish.util.ClasspathTemplateLoader;
+import fr.ifremer.isisfish.util.CompileHelper;
+import fr.ifremer.isisfish.util.ConverterUtil;
+import freemarker.cache.TemplateLoader;
+import freemarker.ext.beans.BeansWrapper;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
+
+/**
+ * Cette classe est responsable de conservation de toutes les simulations faites
+ * ou a faire. Pour ajouter une nouvelle simulation on appelle la methode
+ * {@link #submit}.
+ * <p>
+ * Cette classe sert aussi de modele pour le moniteur de queue
+ * <p>
+ * Il existe une instance unique pour toute l'application
+ * <p>
+ * Lors de l'instanciation de la classe, l'ensemble des
+ * {@link SimulatorLauncher} disponible est recherche dans la configuration
+ * et un executor est cree pour chaque.
+ * <p>
+ * Si un {@link SimulatorLauncher} genere trop d'erreur (RemoteException)
+ * Il est alors suspendu pour ne plus etre utilise pour les simulations.
+ *
+ * @author poussin
+ * @version $Revision: 1.0 $
+ *
+ * Last update : $Date: 5 mars 2009 $
+ * By : $Author: chatellier $
+ */
+public class SimulationService {
+
+ public static final String SIMULATION_LAUNCHER = "simulation.launcher";
+ /** nombre maximal de simulation autoriser pour un plan */
+ // FIXME a rendre configurable MAX_PLAN_SIMULATION
+ public static final int MAX_PLAN_SIMULATION = 20000;
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(SimulationService.class);
+
+ protected static SimulationService instance = new SimulationService();
+
+ /** Freemarker configuration used to get prescripts content. */
+ protected Configuration freemarkerConfiguration;
+
+ /** Freemarker pre script template. */
+ protected static final String SENSITIVITY_PRE_SCRIPT = "templates/prescript/factorprescript.ftl";
+
+ /**
+ * Retourne l'instance du {@link SimulationService} a utiliser
+ * @return l'instance a utiliser
+ */
+ public static SimulationService getService() {
+ return instance;
+ }
+
+ protected PropertyChangeSupport propertyListeners = new PropertyChangeSupport(
+ this);
+ protected ListenerSet<SimulationServiceListener> listeners = new ListenerSet<SimulationServiceListener>();
+
+ // FIXME pouvoir configurer ceci en fichier de config
+ // FIXME ainsi que la mise a false, lors de la simulation de la derniere
+ // (sans doute ajoute un boolean, simulationListAsQueue = true|false)
+ protected boolean autoLaunch = true;
+
+ /** L'executor utilise pour creer toutes les sous simulations des plans
+ * independants */
+ protected ExecutorService subSimulationComputationExecutor = Executors
+ .newSingleThreadExecutor();
+ /** Tous les types de {@link SimulatorLauncher} disponibles, et leur
+ * executors associe */
+ protected Map<SimulatorLauncher, SimulationExecutor> executors = new LinkedHashMap<SimulatorLauncher, SimulationExecutor>();
+ /** Le nombre d'erreur pour les SimulatorLauncher */
+ protected Map<SimulatorLauncher, MutableInt> launcherError = new HashMap<SimulatorLauncher, MutableInt>();
+ /** La queue contenant toutes les simulations a faire */
+ protected SimulationQueue queue = new SimulationQueue();
+
+ /** Contient les identifiants des simulations presentes dans {@link #jobs}*/
+ protected Set<String> idJobs = new HashSet<String>();
+ /** La liste des jobs existant (queue + job demarre) */
+ protected Set<SimulationJob> jobs = new TreeSet<SimulationJob>();
+
+ /** La liste des jobs termines */
+ protected Set<SimulationJob> jobDones = new TreeSet<SimulationJob>();
+
+ /**
+ * Cree une instance et initialise les executors ainsi que le launcherError
+ */
+ protected SimulationService() {
+ // on cree un executor par type SimulatorLauncher
+ Properties prop = IsisFish.config
+ .getOptionStartsWith(SIMULATION_LAUNCHER);
+
+ // sort simulation names by... names
+ // this solve "local" "sub", "remote" order
+ // default "local" is in first in UI.
+ List<String> simulationKeys = new ArrayList<String>(prop
+ .stringPropertyNames());
+ Collections.sort(simulationKeys);
+
+ for (String key : simulationKeys) {
+ String value = prop.getProperty(key);
+ try {
+ SimulatorLauncher sl = (SimulatorLauncher) ObjectUtil
+ .newInstance(value);
+ addSimulationLauncher(sl);
+ } catch (Exception eee) {
+ log.warn(_("Can't instantiate %s", value), eee);
+ }
+ }
+
+ // fait un appel au moniteur
+ // pour reprendre le monitoring des simulation en cours
+ SimulationMonitor.getInstance().reloadConfig(this);
+ }
+
+ /**
+ * Permet d'ajouter un nouveau SimulatorLauncher. Cela cree automatiquement
+ * un executor pour ce SimulatorLauncher. S'il y avait deja un
+ * SimulatorLauncher de ce type un nouveau est ajoute.
+ * @param sl le SimulatorLauncher a ajouter
+ */
+ public void addSimulationLauncher(SimulatorLauncher sl) {
+ SimulationQueue executorQueue = new SimulationQueue(queue);
+ SimulationExecutor se = new SimulationExecutor(this, sl, executorQueue);
+ executors.put(sl, se);
+ launcherError.put(sl, new MutableInt(0));
+ }
+
+ /**
+ * @return les SimulatorLauncher et leurs noms
+ */
+ public List<SimulatorLauncher> getSimulationLaunchers() {
+ List<SimulatorLauncher> result = new ArrayList<SimulatorLauncher>(
+ executors.keySet());
+ return result;
+ }
+
+ public Collection<SimulationExecutor> getSimulationExecutors() {
+ return executors.values();
+ }
+
+ public Set<SimulationJob> getJobs() {
+ return jobs;
+ }
+
+ public Set<SimulationJob> getJobDones() {
+ return jobDones;
+ }
+
+ /**
+ * Retourne la liste de tous les {@link SimulatorLauncher} disponible
+ * @return
+ */
+ protected Set<SimulatorLauncher> getSimulatorLaunchers() {
+ return executors.keySet();
+ }
+
+ public void addSimulationServiceListener(SimulationServiceListener l) {
+ listeners.add(l);
+ }
+
+ public void removeSimulationServiceListener(SimulationServiceListener l) {
+ listeners.remove(l);
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ propertyListeners.addPropertyChangeListener(listener);
+ }
+
+ public void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {
+ propertyListeners.addPropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ propertyListeners.removePropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {
+ propertyListeners.removePropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * Ajoute le job au job en cours previent s'il n'etait pas deja present
+ * les listener {@link SimulationServiceListener#simulationStart}.
+ * @param job
+ */
+ protected void fireStartEvent(SimulationJob job) {
+ // on ajoute au cas on il n'y serait pas
+ if (jobs.add(job)) {
+ idJobs.add(job.getItem().getControl().getId());
+ for (SimulationServiceListener l : listeners) {
+ l.simulationStart(this, job);
+ }
+ }
+ }
+
+ /**
+ * Supprime le job de la liste des jobs en cours et l'ajoute le job si
+ * besoin a la liste des jobs faits (s'il y a une erreur ou qu'il ne sagit
+ * pas d'une simulation lancer par un plan d'analyse).
+ * Les listener sont prevenu par la methode
+ * {@link SimulationServiceListener#simulationStop}.
+ * @param job
+ */
+ protected void fireStopEvent(SimulationJob job) {
+ jobs.remove(job);
+ idJobs.remove(job.getItem().getControl().getId());
+
+ // on ajout au jobDones que les simulations avec erreur ou les
+ // simulation reellement demande par l'utilisateur (pas de simulation
+ // de plan
+ jobDones.add(job);
+ for (SimulationServiceListener l : listeners) {
+ l.simulationStop(this, job);
+ }
+ }
+
+ /**
+ * Nettoie la liste des jobs faits
+ */
+ public void clearJobDone() {
+ jobDones.clear();
+ for (SimulationServiceListener l : listeners) {
+ l.clearJobDone(this);
+ }
+ }
+
+ /**
+ * @return Returns the autoLaunch.
+ */
+ public boolean isAutoLaunch() {
+ return this.autoLaunch;
+ }
+
+ /**
+ * @param autoLaunch The autoLaunch to set.
+ */
+ public void setAutoLaunch(boolean autoLaunch) {
+ synchronized (this) {
+ boolean oldValue = this.autoLaunch;
+ this.autoLaunch = autoLaunch;
+ if (this.autoLaunch) {
+ this.notifyAll();
+ }
+ propertyListeners.firePropertyChange("autoLaunch", oldValue,
+ autoLaunch);
+ }
+ }
+
+ /**
+ * Permet de mettre en attente les threads de simulation si l'utilisateur
+ * a suspendu la queue
+ */
+ protected void waitAutoLaunch() {
+ synchronized (this) {
+ while (!isAutoLaunch()) {
+ try {
+ log.info("autoLaunch is false waiting queue start");
+ this.wait();
+ } catch (InterruptedException eee) {
+ log.warn("Error during wait autoLaunch flag", eee);
+ }
+ }
+ }
+ }
+
+ /**
+ * Permet d'ajouter une nouvelle simulation a la queue. Si la simulation est
+ * simple ou avec un plan d'experience dependant, un nouveau job est cree
+ * et directement ajout a la queue de jobs. S'il la simulation est un plan
+ * ou les simulations sont independantes, toutes les simulations sont
+ * genere et toute ajoute a la queue de simulation. Mais dans ce cas seul
+ * la simulation de depart est ajoute au jobs en cours, les simulations
+ * generees seront ajoutees lors de leur reel execution
+ *
+ * @param id l'identifiant de la simulation
+ * @param param les parametres de la simulation
+ * @param launcher le launcher a utiliser pour lancer la simulation
+ * @param priority la priorite de la simulation
+ */
+ public void submit(String id, SimulationParameter param,
+ SimulatorLauncher launcher, int priority) {
+ // on l'ajoute tout de suite a la liste des simulations demandee
+ SimulationControl control = new SimulationControl(id);
+ SimulationItem item = new SimulationItem(control, param);
+ SimulationJob job = new SimulationJob(this, item, priority);
+ job.setLauncher(launcher);
+ fireStartEvent(job);
+
+ // on construit le zip de la simulation
+ File zip = prepareSimulationZipFile(control, param, null, true);
+ item.setSimulationZip(zip);
+
+ if (param.getUseAnalysePlan() && param.isIndependentPlan()) {
+ // c un plan d'analyse independant, on construit toute les sous simu
+ Runnable task = new PrepareSimulationJob(this, job);
+ subSimulationComputationExecutor.execute(task);
+ } else {
+ // l'item est fini d'etre initialise, on peut l'ajouter a la queue
+ // sauf si c'etait un plan independant ou se seront les sous simu
+ // qui seront dans la queue
+ submit(job);
+ }
+
+ }
+
+ /**
+ * Permet d'ajouter une simulation avec des factors a prendre en compte.
+ *
+ * @param id l'identifiant de la simulation
+ * @param param les parametres de la simulation
+ * @param launcher le launcher a utiliser pour lancer la simulation
+ * @param priority la priorite de la simulation
+ * @param sensitivitycalculator l'implementation du calculateur de sensibilite
+ * @param designPlan le design plan qui contient les facteurs
+ */
+ public void submit(String id, SimulationParameter param,
+ SimulatorLauncher launcher, int priority,
+ SensitivityCalculator sensitivitycalculator, DesignPlan designPlan) {
+
+ try {
+ // build master sensitivity export directory
+ File masterExportDirectory = new File(IsisFish.config.getDefaultExportDirectory(), id);
+ if (!masterExportDirectory.isDirectory()) {
+ masterExportDirectory.mkdirs();
+ }
+
+ SensitivityScenarios sensitivityScenarios = sensitivitycalculator
+ .compute(designPlan, masterExportDirectory);
+
+ // ajout des parametres de simulation
+ param.setSensitivityCalculator(sensitivitycalculator);
+ param.setNumberOfSensitivitySimulation(sensitivityScenarios.getScenarios().size());
+
+ // export designplan as XML
+ String xmlDesignPlan = MexicoHelper.getDesignPlanAsXML(designPlan);
+
+ // on l'ajoute tout de suite a la liste des simulations demandee
+ // init with default "id" must been changed for designPlan
+ // simulation
+ SimulationControl controlJustForZip = new SimulationControl(id);
+
+ // on construit le zip de la simulation
+ // in zip, there will be param "without" prescript
+ File zip = prepareSimulationZipFile(controlJustForZip, param, xmlDesignPlan, true);
+
+ // for each simulation, we neeed to launch a specific simulation
+ // new simulation ids will be id + "_" + x
+ // where x is a int starting at 0
+ int simulationIndex = 0;
+ for (Scenario scenario : sensitivityScenarios.getScenarios()) {
+
+ // modify modification parameter
+ // subParam only convenient for add pre script
+ // for launcher
+ SimulationParameter subParam = param.copy();
+ String preScriptContent = generatePreScript(scenario);
+ subParam.setUsePreScript(true);
+ subParam.setPreScript(preScriptContent);
+
+ // build new simulation id
+ String subsimulationId = id + "_" + simulationIndex;
+ SimulationControl realSimulationControl = new SimulationControl(
+ subsimulationId);
+
+ // new item, with zip
+ SimulationItem item = new SimulationItem(realSimulationControl,
+ subParam);
+ item.setSimulationZip(zip);
+
+ SimulationJob job = new SimulationJob(this, item, priority);
+ job.setLauncher(launcher);
+ fireStartEvent(job);
+
+ if (subParam.getUseAnalysePlan()
+ && subParam.isIndependentPlan()) {
+ // c un plan d'analyse independant, on construit toute les sous simu
+ Runnable task = new PrepareSimulationJob(this, job);
+ subSimulationComputationExecutor.execute(task);
+ } else {
+ // l'item est fini d'etre initialise, on peut l'ajouter a la queue
+ // sauf si c'etait un plan independant ou se seront les sous simu
+ // qui seront dans la queue
+ submit(job);
+ }
+
+ simulationIndex++;
+ }
+
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get scenarios from calculator", e);
+ }
+ }
+ }
+
+ /**
+ * Get freemarker configuration.
+ */
+ protected Configuration getFreemarkerConfiguration() {
+ Configuration configuration = new Configuration();
+
+ // needed to overwrite "Defaults to default system encoding."
+ // fix encoding issue on some systems
+ configuration.setDefaultEncoding("utf-8");
+
+ // specific template loader to get template from jars (classpath)
+ TemplateLoader templateLoader = new ClasspathTemplateLoader();
+ configuration.setTemplateLoader(templateLoader);
+
+ configuration.setObjectWrapper(new BeansWrapper());
+
+ return configuration;
+ }
+
+ /**
+ * Generate prescript to set factor values before simulation start.
+ *
+ * @param scenario
+ * @return simulation pre script with correct values
+ * @throws IOException if pre script can't be made
+ * @throws TemplateException if pre script can't be made
+ */
+ protected String generatePreScript(Scenario scenario) throws IOException,
+ TemplateException {
+
+ // init one at first call
+ if (freemarkerConfiguration == null) {
+ freemarkerConfiguration = getFreemarkerConfiguration();
+ }
+
+ Writer out = new StringWriter();
+ Template template = freemarkerConfiguration
+ .getTemplate(SENSITIVITY_PRE_SCRIPT);
+ Map<String, Object> root = new HashMap<String, Object>();
+ root.put("scenario", scenario);
+ root.put("beanUtils", ConverterUtil.getConverter(null));
+
+ template.process(root, out);
+ out.flush();
+ String scriptContent = out.toString();
+
+ if (log.isTraceEnabled()) {
+ log.trace("Simulation prescript content = " + scriptContent);
+ }
+
+ return scriptContent;
+ }
+
+ /**
+ * Resoumet une simulation qui a deja été démarrée, mais
+ * on ne faisant que du control de monitoring.
+ *
+ * @param id
+ * @param param
+ * @param launcher
+ * @param priority
+ */
+ public void submitForCheckOnly(String id, SimulationParameter param,
+ SimulatorLauncher launcher, int priority) {
+ // on l'ajoute tout de suite a la liste des simulations demandee
+ SimulationControl control = new SimulationControl(id);
+ SimulationItem item = new SimulationItem(control, param);
+ SimulationJob job = new SimulationJob(this, item, priority);
+ job.setLauncher(launcher);
+ fireStartEvent(job);
+
+ job.setOnlyCheckControl(true);
+
+ //if (param.getUseAnalysePlan() && param.isIndependentPlan()) {
+ // // c un plan d'analyse independant, on construit toute les sous simu
+ // Runnable task = new PrepareSimulationJob(this, job);
+ // subSimulationComputationExecutor.execute(task);
+ //} else {
+ // l'item est fini d'etre initialise, on peut l'ajouter a la queue
+ // sauf si c'etait un plan independant ou se seront les sous simu
+ // qui seront dans la queue
+ submit(job);
+ //}
+
+ }
+
+ protected void submit(SimulationJob job) {
+ SimulatorLauncher launcher = job.getLauncher();
+ // on ajoute a la queue qui utilise le launcher defini dans le job
+ if (launcher != null) {
+ for (SimulatorLauncher l : executors.keySet()) {
+ if (launcher == l) {
+ log.info(_("Add to %s queue", l));
+ SimulationExecutor executor = executors.get(l);
+ executor.execute(job);
+ return;
+ }
+ }
+ }
+ // dernier recours on ajoute a la queue sans launcher
+ log.info(_("Add to default queue"));
+ queue.add(job);
+ }
+
+ /**
+ * Permet de resoumettre un job qui a ete pris par un thread mais qu'il
+ * ne peut pas traiter. Cela arrive lorsque l'executor est en pause, ou
+ * que le launcher de l'executor ne fonctionne plus (il se met en pause
+ * tout seul)
+ *
+ * @param job l'item a resoumettre
+ */
+ protected void resubmit(SimulationJob job) {
+ submit(job);
+ }
+
+ /**
+ * Permet de soumettre a la queue un job provenant d'un plan.
+ * Ce plan ne doit pas apparaitre dans la console de queue.
+ *
+ * @param job
+ */
+ protected void submitSubJob(SimulationJob job) {
+ submit(job);
+ }
+
+ /**
+ * Supprime un job de la queue (annulation d'une simulation). Appele
+ * depuis {@link SimulationJob#stop}
+ *
+ * @param job le job a annuler
+ * @return vrai si la simulation a pu etre annulee avant sont lancement
+ * (encore presente dans la queue), faux si la simulation a deja ete
+ * prise par un thread de simulation ou quelle est terminee
+ */
+ protected boolean cancel(SimulationJob job) {
+ boolean result = queue.remove(job);
+ return result;
+ }
+
+ public boolean exists(String id) {
+ boolean result = idJobs.contains(id);
+ return result;
+ }
+
+ /**
+ * Report une erreur pour un launcher, on resoumet le job en supprimant
+ * le launcher utilise
+ *
+ * @param launcher le launcher posant probleme
+ * @param job le job qui n'a pas reussi a se faire
+ */
+ protected void reportError(SimulatorLauncher launcher, SimulationJob job) {
+ MutableInt i = launcherError.get(launcher);
+ i.setValue(i.intValue() + 1);
+ // si on a plus de N error, on stop l'executor associe
+ if (i.intValue() >= 5) {
+ log.error(_("Launcher %s will be stopped because there are too many error (%s)",
+ launcher, i.intValue()));
+ SimulationExecutor e = executors.get(launcher);
+ e.pause();
+ }
+ // il faut bien penser a supprimer le launcher pour qu'un autre executor
+ // puisse y mettre le sien.
+ // FIXME: est ce le bon choix si l'utilisateur avait force un launcher particulier, ne faudrait t'il pas prevenir l'utilisateur ?
+ job.setLauncher(null);
+ resubmit(job);
+ }
+
+ /**
+ * Permet de genere les sous simulations d'un plan d'analyse. Pour les
+ * plan independant, on l'utilise en Runnable pour genere tous les plans
+ * possible et les soumettre a la queue. Pour les plans dependant
+ * on l'utilise seulement comme iterator. La methode afterSimulation des plans
+ * est appelee automatiquement a la fin de la simulation grace au mecanisme
+ * de PostAction sur les {@link SimulationJob}.
+ */
+ public static class PrepareSimulationJob implements Runnable,
+ Iterator<SimulationJob>, SimulationJob.PostAction {
+
+ protected SimulationService simulationService;
+ protected AnalysePlanContext planContext;
+ protected SimulationJob job;
+ protected SimulationJob nextJob;
+ protected boolean doNext = true;
+ protected String id;
+ protected SimulationControl control;
+ protected SimulationParameter param;
+ protected int done = 0;
+
+ public PrepareSimulationJob(SimulationService simulationService,
+ SimulationJob job) {
+ this.simulationService = simulationService;
+ this.job = job;
+ id = job.getItem().getControl().getId();
+ control = job.getItem().getControl();
+ param = job.getItem().getParameter();
+ this.planContext = new AnalysePlanContext(control.getId(), param);
+ }
+
+ /**
+ * genere toutes les sous simulations et les places dans la queue
+ */
+ public void run() {
+ while (hasNext()) {
+ try {
+ SimulationJob subJob = next();
+ simulationService.submitSubJob(subJob);
+ } catch (Exception eee) {
+ log.error(_("Can't add simulation: ", job.getItem()
+ .getControl().getId()), eee);
+ }
+ }
+
+ }
+
+ /**
+ * Indique s'il y a encore des simulations dans le plan. Par defaut pour
+ * Eviter les plans sans fin, le nombre de plan genere par simulation
+ * est limite a {@link SimulationService#MAX_PLAN_SIMULATION}
+ *
+ * @return <tt>true</tt> if has next
+ */
+ public boolean hasNext() {
+ try {
+ // if user request stop simulation, stop all futur planned simulation
+ // and if last doNext is false not do next simulation
+ boolean result = !control.isStopSimulationRequest() && doNext;
+ if (result) {
+ // si deja creer on ne le refet pas
+ if (nextJob == null) {
+ // Prepration de la simulation a faire
+ // create next id simulation
+
+ // this start a 0
+ int planNumber = planContext.getNumber();
+
+ if (planNumber > MAX_PLAN_SIMULATION) {
+ log.error(_("Analyse plan error, too many simulation for %s : %s",
+ id, planNumber));
+ doNext = false;
+ result = false;
+ } else {
+ String simId = id + "_" + planNumber;
+ param.setAnalysePlanNumber(planNumber);
+
+ File tmpDirectory = FileUtil.createTempDirectory(
+ "isisfish-simulation-", "-preparation");
+ SimulationStorage sim = SimulationStorage
+ .importAndRenameZip(tmpDirectory, job
+ .getItem().getSimulationZip(),
+ simId);
+ sim.getParameter().setAnalysePlanNumber(planNumber);
+
+ // appel de tous les plans pour modifier la simulation
+ for (AnalysePlan plan : param.getAnalysePlans()) {
+ result = result
+ && plan.beforeSimulation(planContext,
+ sim);
+ if (!result) {
+ nextJob = null;
+ break;
+ }
+ }
+ doNext = result;
+ if (result) {
+ File zip = sim.createZip();
+ SimulationControl childControl = new SimulationControl(
+ simId);
+ SimulationParameter childParam = param.copy();
+ SimulationItem item = new SimulationItem(
+ childControl, childParam);
+ item.setSimulationZip(zip);
+ nextJob = new SimulationJob(simulationService,
+ job, item, job.getPriority());
+ nextJob.setLauncher(job.getLauncher());
+ nextJob.addPostAction(this); // pour l'appel des after des plans
+ }
+ // quoi qu'il arrive on supprime le repertoire temporaire
+ if (!FileUtil.deleteRecursively(tmpDirectory)) {
+ log.warn(_("isisfish.error.remove.directory",
+ tmpDirectory));
+ }
+ }
+
+ // increment number for next simulation job
+ planContext.incNumber();
+ }
+ }
+ return result;
+ } catch (Exception eee) {
+ throw new IsisFishRuntimeException(
+ _("isisfish.error.evalute.plan.script"), eee);
+ }
+
+ }
+
+ public SimulationJob next() {
+ hasNext(); // pour etre sur qu'il a ete appele au moins une fois
+ SimulationJob result = nextJob;
+ nextJob = null;
+ return result;
+
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException("Not supported.");
+ }
+
+ public void finished(SimulationJob job, SimulationStorage sim) {
+ // doNext = true;
+
+ // appel de tous les plans pour modifier la simulation
+ for (AnalysePlan plan : sim.getParameter().getAnalysePlans()) {
+ try {
+ boolean result = plan.afterSimulation(planContext, sim);
+ doNext = doNext && result;
+ } catch (Exception eee) {
+ log.error(_("Stop simulation plan, because can't call afterSimulation correctly on plan %s",
+ plan.getClass().getName()), eee);
+ doNext = false;
+ }
+ }
+ // une sim vient de se finir, on incremente le compteur
+ done++;
+ if (!hasNext() && (done + 1 == planContext.getNumber())) {
+ // on enleve le master plan des simulations en cours, vu que
+ // toutes les simu sont terminees
+ simulationService.fireStopEvent(this.job);
+ }
+ }
+
+ public void exception(SimulationJob job, Throwable eee) {
+ // il y a une simulation d'echoue, on ne fait pas les suivantes
+ // cela n'impacte pas les plan independant puisque toutes les
+ // simulation on deja ete generee
+ doNext = false;
+ simulationService.fireStopEvent(this.job);
+ }
+ }
+
+ /**
+ * Prepare les fichiers qui seront utilsé à la simulation:
+ * <li> scripts
+ * <li> rules
+ * <li> exports
+ * <li> simulators
+ * <li> export de la database de la region
+ * <li> analyseplan
+ * <p>
+ * Le tout est zippé et le zip est retourné, il peut-être directement
+ * importé dans le {@link SimulationStorage} (en le renommant comme
+ * il faut {@link SimulationStorage#importAndRenameZip(File, String)}.
+ * <p>
+ * Ce zip est automatiquement supprimé à la fin de l'application.
+ *
+ * @param control le controleur
+ * @param param les parametre de la simulation
+ * @param xmlDesignPlan contenu xml des design plan
+ * @param compile si vrai la version compile des fichiers Java est aussi
+ * mise dans le fichier zip. Cela peut servir pour les simulations locales
+ * pour ne pas recompiler pour chaque simulation avec plan d'analyse
+ * @return un zip de simulation pour une simulation pret a être faite
+ * @throws SimulationException pour tout problème rencontré (IO,Topia...)
+ */
+ protected File prepareSimulationZipFile(SimulationControl control,
+ SimulationParameter param, String xmlDesignPlan, boolean compile)
+ throws SimulationException {
+ try {
+ File tmpDirectory = FileUtil.createTempDirectory(
+ "isisfish-simulation-", "-preparation");
+ //File regionXML = IsisConfig.getDataBackupFile(tmpDirectory);
+ File regionXML = new File(tmpDirectory,
+ SimulationStorage.DATA_BACKUP_FILENAME);
+
+ // sauvegarde des parametres
+ Properties prop = param.toProperties();
+ //File f = IsisConfig.getSimulationParametersFile(tmpDirectory);
+ File f = new File(tmpDirectory,
+ SimulationStorage.PARAMETERS_FILENAME);
+ FileOutputStream out = new FileOutputStream(f);
+ //FileOutputStream out = new FileOutputStream(new File(tmpDirectory, IsisConfig.SIMULATION_PARAMETERS));
+ prop.store(out, "Parameters");
+ out.close();
+
+ // backup pour toutes les simulations, pour eviter que l'utilisateur
+ // ne puisse le modifier en meme temps
+ control.setText(_("isisfish.message.backup.database.progress"));
+ RegionStorage region = RegionStorage.getRegion(param
+ .getRegionName());
+ TopiaContext tc = region.getStorage().beginTransaction();
+ tc.backup(regionXML, true);
+ tc.closeContext();
+ control.setText(_("isisfish.message.backup.database.finished"));
+
+ // copie de toutes regles a utiliser
+ List<Rule> rules = param.getRules();
+ for (Rule rule : rules) {
+ String name = RuleStorage.getName(rule);
+ FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name
+ + ".java"),
+ new File(tmpDirectory, RuleStorage.RULE_PATH
+ + File.separator + name + ".java"));
+ }
+ // copie des regles reclamées par les plans d'analyse
+ for (String name : param.getExtraRules()) {
+ FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name
+ + ".java"),
+ new File(tmpDirectory, RuleStorage.RULE_PATH
+ + File.separator + name + ".java"));
+ }
+
+ // copie de toutes regles a utiliser
+ List<AnalysePlan> plans = param.getAnalysePlans();
+ for (AnalysePlan plan : plans) {
+ String name = AnalysePlanStorage.getName(plan);
+ FileUtil.copy(new File(AnalysePlanStorage
+ .getAnalysePlanDirectory(), name + ".java"), new File(
+ tmpDirectory, AnalysePlanStorage.ANALYSE_PLAN_PATH
+ + File.separator + name + ".java"));
+ }
+
+ // copie de tous les exports a utiliser
+ for (String name : param.getExportNames()) {
+ name = name.endsWith(".java") ? name : name + ".java";
+ FileUtil.copy(
+ new File(ExportStorage.getExportDirectory(), name),
+ new File(tmpDirectory, ExportStorage.EXPORT_PATH
+ + File.separator + name));
+ }
+
+ // copie de tous les scripts a utiliser
+ FileUtil.copyRecursively(ScriptStorage.getScriptDirectory(),
+ tmpDirectory, ".*\\.java$");
+
+ // copie de tous les simulateurs a utiliser
+ FileUtil.copy(new File(SimulatorStorage.getSimulatorDirectory(),
+ param.getSimulatorName()), new File(tmpDirectory,
+ SimulatorStorage.SIMULATOR_PATH + File.separator
+ + param.getSimulatorName()));
+
+ if (compile) {
+ compileAllFile(control, tmpDirectory);
+ }
+
+ // Sauvegarde du design plan en XML
+ if (!StringUtils.isEmpty(xmlDesignPlan)) {
+ File simulationDesignPlanFile = SimulationStorage.getMexicoDesignPlan(tmpDirectory);
+ FileUtil.writeString(simulationDesignPlanFile, xmlDesignPlan);
+ }
+
+ FileUtil.copy(new File(SimulatorStorage.getSimulatorDirectory(),
+ param.getSimulatorName()), new File(tmpDirectory,
+ SimulatorStorage.SIMULATOR_PATH + File.separator
+ + param.getSimulatorName()));
+
+ // creation du zip
+ File result = new File(tmpDirectory.getPath() + ".zip");
+ result.deleteOnExit();
+ ZipUtil.compress(result, tmpDirectory, null);
+
+ // poussin 20071015: remove temp directory
+ if (!FileUtil.deleteRecursively(tmpDirectory)) {
+ log.warn(_("isisfish.error.remove.directory", tmpDirectory));
+ }
+
+ return result;
+ } catch (IOException eee) {
+ throw new SimulationException(
+ _("isisfish.error.prepare.information.simulation"), eee);
+ } catch (TopiaException eee) {
+ throw new SimulationException(
+ _("isisfish.error.prepare.information.simulation"), eee);
+ }
+
+ }
+
+ /**
+ * Compile les fichiers présent dans le répertoire passé en
+ * parametre, ce répertoire est hiérarchisé en: rules, exports, simulators
+ * et scripts. Seuls les fichiers des 3 premiers répertoires sont compilés
+ * les fichiers du dernier sont compilé par les dépendances qu'on les autres
+ * <p>
+ * Il permet donc de compiler facilement tous les fichiers pour une
+ * simulation
+ *
+ * @param control le controleur
+ * @param directory le répertoire où compiler
+ */
+ protected void compileAllFile(SimulationControl control, File directory) {
+
+ control.setText("Scripts and rules Compilation");
+ long currentTime = System.nanoTime();
+
+ //
+ // Recherche des fichiers a compiler
+ // On ne prend pas les scripts, car ils sont tous copiés mais pas
+ // forcément util. Lors de la compilation des autres fichiers, les
+ // script servant réellement seront automatiquement compilé
+
+ List<File> fileToCompile = new ArrayList<File>();
+
+ List<File> tmp = FileUtil.find(new File(directory,
+ ExportStorage.EXPORT_PATH), ".*\\.java$", true);
+ fileToCompile.addAll(tmp);
+
+ tmp = FileUtil.find(new File(directory, RuleStorage.RULE_PATH),
+ ".*\\.java$", true);
+ fileToCompile.addAll(tmp);
+
+ tmp = FileUtil.find(new File(directory,
+ AnalysePlanStorage.ANALYSE_PLAN_PATH), ".*\\.java$", true);
+ fileToCompile.addAll(tmp);
+
+ tmp = FileUtil.find(
+ new File(directory, SimulatorStorage.SIMULATOR_PATH),
+ ".*\\.java$", true);
+ fileToCompile.addAll(tmp);
+
+ //
+ // Compilation
+ //
+
+ CompileHelper.compile(directory, fileToCompile, directory, null);
+ long time = System.nanoTime() - currentTime;
+ control.setText(_("isisfish.message.compilation.time",
+ DurationFormatUtils.formatDuration(time / 1000000, "s'.'S")));
+
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,121 +0,0 @@
-/**
- * <h1>Launcher</h1>
- * <h2>To do</h2>
- * <li> voir pourquoi l'interface de visu des simulations en cours ne se
- * rafraichi pas
- * <li> supprimer le SimulationItem et tout mettre dans SimulationJob (reflechir
- * si au niveau design c'est une bonne chose
- * <li> faire une interface graphique de monitoring des Executors (nombre de
- * threads actif, nombre de simulations terminer, nombre de simulation
- * explicitement pour cet executor, afficher l'etat pause/resume/error et
- * permettre de modifier l'etat. Avec le nombre
- * de jobs dans la queue pour tous les Executors. Permettre de soumettre toutes
- * les simulations d'un executor sur un autre executor. (par exemple si un
- * executor est mis en pause a cause des erreurs, cela permet a l'utilisateur
- * d'utiliser un autre executor sans devoir annuler/relancer toutes ces
- * simulations.
- * <li> ajouter dans l'interface de vision des simulations en cours, de
- * modifier le launcher des simulations non lancee.
- * <li> tester les differents launcher
- * <li> trouver une solution pour que les jobs soumis pour un launcher
- * particulier soit bien executer par l'executor de ce launcher. (penser au
- * changement de priority avec resoumission si ce choix est pris, c-a-d que le
- * job s'appercoit qu'il va etre utilise par le mauvais Executor, il ne fait
- * pas la simu et la resoumet a queue en augmentant la priority pour que le job
- * qui devait etre fait maintenant ne le soit pas dans 10ans).
- * Une autre possibilite d'implantation est que chaque executor est une queue
- * propre, et lorsque celle-ci est vide il vont piocher dans la queue commune.
- * Pour cela, simplement implanter un nouveau type de queue qui permette
- * d'avoir une queue mere. Lors de la soumission au SimulationService soit le
- * job est directement soumis au bon executor soit ajoute a la queue general.
- * (ajouter un bool qui permette lors de report d'erreur de resoumettre un job
- * avec launcher fixe par l'utilisateur sur la queue general ou non.
- *
- * <h2>Architecture global</h2>
- * <img src="doc-files/isis-simulation.png" alt="archi"/>
- *
- * <h2>Principe general</h2>
- * <p>
- * Les simulations sont soumises au {@link SimulationService} via sa methode
- * submit. Un objet {@link SimulationJob} est alors cree et ajoute a la liste
- * des simulations presentes ({@link SimulationService#getJobs}). Si la
- * simulation est une simple simulation ou une simulation avec plan d'analyse
- * dependant, elle est alors directement ajoutee a la queue de simulation
- * (simulation a faire). Si
- * la simulation utilise un plan d'analyse independant, un thread est
- * specialement utilise pour generer toutes les simulations du plan, celles-ci
- * sont alors ajoutee a la queue, mais n'apparaitront dans la liste des
- * simulations qu'au moment ou un thread de simulation executera reellement le
- * job.
- * </p>
- *
- * <p>
- * Lorsqu'un thread recupere un job dans la queue, il leve un event {@link
- * SimulationListener#start}, la simulation est alors ajoutee a la liste des
- * simulations visibles si elle ne l'etait pas encore.
- * </p>
- *
- * <p>
- * Une fois terminees, les simulations finissent dans la liste des simulations
- * terminees.
- * </p>
- *
- * <p>
- * Le {@link SimulationService#autoLaunch} permet d'indique si le service est
- * actif ou non. S'il n'est pas actif, il accepte les simulations mais ne les
- * execute pas (elles sont en attente). S'il est actif alors les differents
- * {@link SimulationExecutor}) prenent les jobs de la queue pour faire les
- * simulations.
- * </p>
- *
- * <h2>SimulationExecutor</h2>
- * <p>
- * Lors de sa creation le {@link SimulationService} a initialise different
- * {@link SimulationExecutor} en fonction de la configuration. Ces {@link
- * SimulationExecutor} sont responsable de l'execution des simulations de la
- * queue. Chaque {@link SimulationExecutor} a un {@link SimulatorLauncher}
- * qu'il utilise si la simulation n'a pas encore de {@link SimulatorLauncher}
- * d'assigne.
- * </p>
- * <p>
- * Un {@link SimulationExecutor} peut etre mis en pause puis relance. Lorsqu'il
- * est en pause, il termine les simulations en cours mais n'en reprend pas de
- * nouvelle. Cela permet d'arrete un {@link SimulationExecutor} particulier
- * sans devoir arreter tout le service de simulation.
- * </p>
- * <p>Si un {@link SimulationExecutor} prend un job ayant deja un {@link
- * SimulatorLauncher} d'assigne, il utilise alors ce launcher plutot que le
- * sien. Ce choix est derangeant lorsque l'on souhaite utilise un nombre de
- * thread limite pour un launcher particulier, mais il est le plus raisonnable
- * car l'autre possibilite est que le job soit resoumis au {@link
- * SimulationService} jusqu'a ce que le bon {@link SimulationExecutor} le
- * prenne pour l'executer. On risque dans ce cas d'arriver a une forte
- * consommation CPU si le seul {@link SimulationExecutor} disponible ne gere
- * pas les jobs en queue.
- * </p>
- *
- * <h2>SimulationJob</h2>
- *
- * <p>
- * Le simulation Job encapsule l'appel pour que les implantantations des {@link
- * SimulatorLauncher} soit la plus simple possible. Il gere les simulations
- * avec plan dependant, les exports depandes par l'utilisateur, ainsi que
- * l'effacement des simulations si seul les exports interessait l'utilisateur.
- * </p>
- *
- * <p>
- * Si le job n'arrive pas a utilise le {@link SimulatorLauncher} il en notifie
- * le {@link SimulationService} qui resoumet le job dans la queue pour qu'un
- * autre {@link SimulationExecutor} prenne ce job. Si trop d'erreurs sont
- * notifiees pour un meme {@link SimulatorLauncher}, le {@link
- * SimulatorService} prend alors la decision d'arreter l'executor associe.
- * </p>
- * <p>
- * Pour les simulations ou l'utilisateur avait fixe un {@link
- * SimulatorLauncher} particulier en cas de notification d'erreur au {@link
- * SimulationService} ce {@link SimulatorLauncher} n'est plus pris en compte et
- * n'importe quel {@link SimulatorLauncher} peut faire cette simulation.
- * </p>
- */
-package fr.ifremer.isisfish.simulator.launcher;
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,122 @@
+/**
+ * <h1>Isis fish simulation launchers.</h1>
+ *
+ * <h2>To do</h2>
+ * <li> voir pourquoi l'interface de visu des simulations en cours ne se
+ * rafraichi pas
+ * <li> supprimer le SimulationItem et tout mettre dans SimulationJob (reflechir
+ * si au niveau design c'est une bonne chose
+ * <li> faire une interface graphique de monitoring des Executors (nombre de
+ * threads actif, nombre de simulations terminer, nombre de simulation
+ * explicitement pour cet executor, afficher l'etat pause/resume/error et
+ * permettre de modifier l'etat. Avec le nombre
+ * de jobs dans la queue pour tous les Executors. Permettre de soumettre toutes
+ * les simulations d'un executor sur un autre executor. (par exemple si un
+ * executor est mis en pause a cause des erreurs, cela permet a l'utilisateur
+ * d'utiliser un autre executor sans devoir annuler/relancer toutes ces
+ * simulations.
+ * <li> ajouter dans l'interface de vision des simulations en cours, de
+ * modifier le launcher des simulations non lancee.
+ * <li> tester les differents launcher
+ * <li> trouver une solution pour que les jobs soumis pour un launcher
+ * particulier soit bien executer par l'executor de ce launcher. (penser au
+ * changement de priority avec resoumission si ce choix est pris, c-a-d que le
+ * job s'appercoit qu'il va etre utilise par le mauvais Executor, il ne fait
+ * pas la simu et la resoumet a queue en augmentant la priority pour que le job
+ * qui devait etre fait maintenant ne le soit pas dans 10ans).
+ * Une autre possibilite d'implantation est que chaque executor est une queue
+ * propre, et lorsque celle-ci est vide il vont piocher dans la queue commune.
+ * Pour cela, simplement implanter un nouveau type de queue qui permette
+ * d'avoir une queue mere. Lors de la soumission au SimulationService soit le
+ * job est directement soumis au bon executor soit ajoute a la queue general.
+ * (ajouter un bool qui permette lors de report d'erreur de resoumettre un job
+ * avec launcher fixe par l'utilisateur sur la queue general ou non.
+ *
+ * <h2>Architecture global</h2>
+ * <img src="doc-files/isis-simulation.png" alt="archi"/>
+ *
+ * <h2>Principe general</h2>
+ * <p>
+ * Les simulations sont soumises au {@link SimulationService} via sa methode
+ * submit. Un objet {@link SimulationJob} est alors cree et ajoute a la liste
+ * des simulations presentes ({@link SimulationService#getJobs}). Si la
+ * simulation est une simple simulation ou une simulation avec plan d'analyse
+ * dependant, elle est alors directement ajoutee a la queue de simulation
+ * (simulation a faire). Si
+ * la simulation utilise un plan d'analyse independant, un thread est
+ * specialement utilise pour generer toutes les simulations du plan, celles-ci
+ * sont alors ajoutee a la queue, mais n'apparaitront dans la liste des
+ * simulations qu'au moment ou un thread de simulation executera reellement le
+ * job.
+ * </p>
+ *
+ * <p>
+ * Lorsqu'un thread recupere un job dans la queue, il leve un event {@link
+ * SimulationListener#start}, la simulation est alors ajoutee a la liste des
+ * simulations visibles si elle ne l'etait pas encore.
+ * </p>
+ *
+ * <p>
+ * Une fois terminees, les simulations finissent dans la liste des simulations
+ * terminees.
+ * </p>
+ *
+ * <p>
+ * Le {@link SimulationService#autoLaunch} permet d'indique si le service est
+ * actif ou non. S'il n'est pas actif, il accepte les simulations mais ne les
+ * execute pas (elles sont en attente). S'il est actif alors les differents
+ * {@link SimulationExecutor}) prenent les jobs de la queue pour faire les
+ * simulations.
+ * </p>
+ *
+ * <h2>SimulationExecutor</h2>
+ * <p>
+ * Lors de sa creation le {@link SimulationService} a initialise different
+ * {@link SimulationExecutor} en fonction de la configuration. Ces {@link
+ * SimulationExecutor} sont responsable de l'execution des simulations de la
+ * queue. Chaque {@link SimulationExecutor} a un {@link SimulatorLauncher}
+ * qu'il utilise si la simulation n'a pas encore de {@link SimulatorLauncher}
+ * d'assigne.
+ * </p>
+ * <p>
+ * Un {@link SimulationExecutor} peut etre mis en pause puis relance. Lorsqu'il
+ * est en pause, il termine les simulations en cours mais n'en reprend pas de
+ * nouvelle. Cela permet d'arrete un {@link SimulationExecutor} particulier
+ * sans devoir arreter tout le service de simulation.
+ * </p>
+ * <p>Si un {@link SimulationExecutor} prend un job ayant deja un {@link
+ * SimulatorLauncher} d'assigne, il utilise alors ce launcher plutot que le
+ * sien. Ce choix est derangeant lorsque l'on souhaite utilise un nombre de
+ * thread limite pour un launcher particulier, mais il est le plus raisonnable
+ * car l'autre possibilite est que le job soit resoumis au {@link
+ * SimulationService} jusqu'a ce que le bon {@link SimulationExecutor} le
+ * prenne pour l'executer. On risque dans ce cas d'arriver a une forte
+ * consommation CPU si le seul {@link SimulationExecutor} disponible ne gere
+ * pas les jobs en queue.
+ * </p>
+ *
+ * <h2>SimulationJob</h2>
+ *
+ * <p>
+ * Le simulation Job encapsule l'appel pour que les implantantations des {@link
+ * SimulatorLauncher} soit la plus simple possible. Il gere les simulations
+ * avec plan dependant, les exports depandes par l'utilisateur, ainsi que
+ * l'effacement des simulations si seul les exports interessait l'utilisateur.
+ * </p>
+ *
+ * <p>
+ * Si le job n'arrive pas a utilise le {@link SimulatorLauncher} il en notifie
+ * le {@link SimulationService} qui resoumet le job dans la queue pour qu'un
+ * autre {@link SimulationExecutor} prenne ce job. Si trop d'erreurs sont
+ * notifiees pour un meme {@link SimulatorLauncher}, le {@link
+ * SimulatorService} prend alors la decision d'arreter l'executor associe.
+ * </p>
+ * <p>
+ * Pour les simulations ou l'utilisateur avait fixe un {@link
+ * SimulatorLauncher} particulier en cas de notification d'erreur au {@link
+ * SimulationService} ce {@link SimulatorLauncher} n'est plus pris en compte et
+ * n'importe quel {@link SimulatorLauncher} peut faire cette simulation.
+ * </p>
+ */
+package fr.ifremer.isisfish.simulator.launcher;
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/ExitUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,53 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * 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.
- *##%*/
-
-/* *
- * 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 $
- */
- -->
-<JFrame id="exitComment" name="isisfish.exit.title" visible="true" size='{new Dimension(400,100)}' title="isisfish.exit.title"
- layout='{new XMLGridLayout("fr/ifremer/isisfish/ui/Exit.xgl")}'>
-<!--
- Resizable="true"
- bundle="org.codelutin.i18n.I18nBundleBridge"
--->
- <script>
- import org.codelutin.widget.XMLGridLayout;
- </script>
-
- <JLabel constraints='"labelExitComment"' text="isisfish.exit.text"/>
-
- <JTextArea constraints='"fieldExitComment"' id="fieldExitComment" />
-
- <JButton constraints='"buttonExitOK"' id="buttonExitOK" text="isisfish.common.ok"/>
-
-<!--
-actionCommand="Saisie.saveCommentAndExit($fieldExitComment/text)"
--->
-
-</JFrame>
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,78 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * 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.
- *##%*/
-
-/* *
- * Help.java
- *
- * Created: 2 août 2006 10:53:43
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.ui;
-
-import java.util.HashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-//import org.swixat.framework.OutputView;
-
-
-/**
- * @author poussin
- */
-public class Help {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(Help.class);
-
- // URL alias
- static public HashMap<String, String> urlAlias = new HashMap<String, String>();
-
- static {
- urlAlias.put("JAVA_API", "http://java.sun.com/j2se/1.5.0/api/index.html");
- urlAlias.put("ISIS_API", "http://isisfish.labs.libre-entreprise.org/apidocs/index.html");
- urlAlias.put("MATRIX_API", "http://lutinmath.labs.libre-entreprise.org/apidocs/index.html");
- }
-
- static public Object showURL(String urlOrAlias) {
- try {
- String url = urlAlias.get(urlOrAlias);
- if (url == null) {
- url = urlOrAlias;
- }
-
- // FIXME jdk1.6 recupere le navigateur souhaité par l'utilisateur dans
- // IsisConfig et le lancer en ouvrant la page url
- // avec jdk1.6
- // Desktop.getDesktop().browse(new URL(url));
-// return new OutputView("Error.xml", "error", "Not implemented: " + url);
- } catch(Exception eee){
- log.error("Can't show help", eee);
-// return new OutputView("Error.xml", "error", eee.getMessage());
- }
- return null;
- }
-}
-
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/Help.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/Help.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,79 @@
+/* *##%
+ * 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;
+
+import java.awt.Desktop;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Help.
+ *
+ * Created: 2 août 2006 10:53:43
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class Help {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(Help.class);
+
+ // URL alias
+ public static Map<String, String> URLSALIAS = new HashMap<String, String>();
+
+ static {
+ URLSALIAS.put("ISISFISH", "http://isis-fish.labs.libre-entreprise.org/");
+ URLSALIAS.put("JAVA_API", "http://java.sun.com/javase/6/docs/api/index.html");
+ URLSALIAS.put("ISIS_API", "http://isis-fish.labs.libre-entreprise.org/isis-fish/apidocs/index.html");
+ URLSALIAS.put("MATRIX_API", "http://lutinmatrix.labs.libre-entreprise.org/lutinmatrix/apidocs/index.html");
+ URLSALIAS.put("TOPIA_API", "http://topia.labs.libre-entreprise.org/topia/topia-persistence/apidocs/inde…");
+ }
+
+ /**
+ * Open url using default system browser.
+ *
+ * @param urlOrAlias url alias, or full url
+ */
+ public static void showURL(String urlOrAlias) {
+ try {
+ String url = URLSALIAS.get(urlOrAlias);
+
+ if (url == null) {
+ url = urlOrAlias;
+ }
+
+ Desktop.getDesktop().browse(new URL(url).toURI());
+ } catch(Exception e){
+ if (log.isErrorEnabled()) {
+ log.error("Can't show help", e);
+ }
+ }
+ }
+}
+
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerfier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,28 +0,0 @@
-/* *##%
- * 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;
-
-/**
- *
- * @author letellier
- */
-public interface SaveVerfier {
- public int checkEdit();
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/SaveVerifier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,28 @@
+/* *##%
+ * 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;
+
+/**
+ *
+ * @author letellier
+ */
+public interface SaveVerifier {
+ public int checkEdit();
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/UIHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,233 +0,0 @@
-/* *##%
- * 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.
- *##%*/
-
-/* *
- * UIHelper.java
- *
- * Created: 10 août 2006 12:08:13
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.ui;
-
-import fr.ifremer.isisfish.ui.util.IDialog;
-
-
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.util.FileUtil;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTree;
-import static javax.swing.Action.NAME;
-import javax.swing.table.TableColumn;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-import java.io.File;
-import java.util.Arrays;
-
-
-/**
- * Set of usefull method for all swixat UI
- *
- * @author poussin
- */
-public class UIHelper {
-
- /**
- * to use log facility, just put in your code: log.info(\"...\");
- */
- static private Log log = LogFactory.getLog(UIHelper.class);
-
- /**
- * only used to debug action in XML
- *
- * @param o object
- */
- static public void print(Object o) {
- System.out.println("++++++++++ print: '" + o + "'(" + (o != null ? o.getClass().getName() : "null") + ")");
- }
-
- static public void closeContext(TopiaContext context) {
- try {
- log.debug("clause TopiaContext: " + context);
- if (context != null) {
- context.closeContext();
- }
- } catch (Exception eee) {
- log.warn("Can't close context: " + context, eee);
- }
- }
-
- /**
- * Permet de modifier l'element selection dans l'arbre
- *
- * @param tree l'arbre ou doit se faire la selection
- * @param jmodel le JTreeModel de l'arbre
- * @param o l'objet a selectionner dans l'arbre
- */
-// static public void setTreeSelection(JTree tree, JTreeModel jmodel, Object o) {
-// try {
-// log.debug("try to select objet in tree: " + o);
-// DefaultMutableTreeNode node = jmodel.getNode(o);
-// TreeNode[] path = node.getPath();
-// if (log.isDebugEnabled()) {
-// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
-// }
-// TreePath newSelectionPath = new TreePath(path);
-// tree.setSelectionPath(newSelectionPath);
-// tree.scrollPathToVisible(newSelectionPath);
-// tree.revalidate();
-// tree.repaint();
-// } catch (Exception eee) {
-// log.warn("Can't select object in tree: " + o, eee);
-// }
-// }
-
-// static public void setTreeSelectionFirstChild(JTree tree, JTreeModel jmodel, Object o) {
-// try {
-// log.debug("try to select first child of objet in tree: " + o);
-// DefaultMutableTreeNode node = jmodel.getNode(o);
-// TreeNode[] path = ((DefaultMutableTreeNode) node.getFirstChild()).getPath();
-// if (log.isDebugEnabled()) {
-// log.debug("chemin du prochain noeud selectionnée: " + Arrays.toString(path));
-// }
-// TreePath newSelectionPath = new TreePath(path);
-// tree.setSelectionPath(newSelectionPath);
-// tree.scrollPathToVisible(newSelectionPath);
-// tree.revalidate();
-// tree.repaint();
-// } catch (Exception eee) {
-// log.warn("Can't select child of object in tree: " + o, eee);
-// }
-// }
-
-
- public static void setColumnsWidth(JTable table, int... widths) {
- for (int i = 0; i < widths.length; i++) {
- String colName;
- colName = table.getColumnName(i);
- TableColumn column;
- column = table.getColumn(colName);
- column.setPreferredWidth(widths[i]);
- }
- table.repaint();
- }
-
- /**
- * Init a dialog
- *
- * @param dial the dialog to prepare
- * @param okAction action to be process by {@link fr.ifremer.isisfish.ui.util.IDialog#getOk()} button
- * @param cancelAction action to be process by {@link fr.ifremer.isisfish.ui.util.IDialog#getCancel()}} button
- * @param show flag to set visible dialog after init
- * @param maxWidth maximum width authorized
- * @param minHeight minimum height
- * @param maxHeight maximum height authorized
- */
- public static void prepareDialog(JDialog dial, AbstractAction okAction,
- AbstractAction cancelAction, boolean show,
- int maxWidth, int minHeight, int maxHeight) {
- if (!IDialog.class.isAssignableFrom(dial.getClass())) {
- return;
- }
-
- IDialog dialog = (IDialog) dial;
- //dialog.frame = frame;
- if (okAction != null) {
- okAction.putValue(NAME, dialog.getOk().getText());
- dialog.setOkAction(okAction);
- dialog.getOk().setAction(okAction);
- }
- if (cancelAction != null) {
- cancelAction.putValue(NAME, dialog.getCancel().getText());
- dialog.setCancelAction(cancelAction);
- dialog.getCancel().setAction(cancelAction);
- }
-
- dialog.setMaxWidth(maxWidth);
- dialog.setMinHeight(minHeight);
- dialog.setMaxHeight(maxHeight);
- dialog.setMaximumSize(new java.awt.Dimension(maxWidth, maxHeight));
-
- int width = dialog.computeWidth();
- int height = dialog.computeHeight();
-
- if (width > maxWidth) {
- width = maxWidth;
- }
- if (height > maxHeight) {
- height = maxHeight;
- }
- dialog.setSize(width, height);
- dialog.doRefresh();
- if (show) {
- dialog.setVisible(true);
- }
- }
-
- /**
- * Open a directory and push it back in the field given.
- * it field given was previously containing the absolute path of a file
- * then it will use the same file name for push back.
- *
- * @param field the JTextField containing the path where to put new dir
- * @param ok the ok button to activate if everything is allwright
- */
- public static void openDirChooser(JTextField field, JButton ok) {
- // assumer field contain path to a filename
- File dir = new File(field.getText());
- String name = "";
- File oldDir = dir;
- if (dir.isFile() || !dir.exists()) {
- name = dir.getName();
- oldDir = dir.getParentFile();
- }
-
- String newDir = FileUtil.getDirectory();
-
- if (newDir != null) {
- File newFile = new File(newDir);
- String path;
-
- path = newFile.getAbsolutePath();
- if (!"".equals(name)) {
- path += File.separator + name;
- }
-
- field.setText(path);
- }
- ok.setEnabled(newDir != null || oldDir.exists());
- }
-
-}
-
-
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,38 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package fr.ifremer.isisfish.ui;
-
-import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
-import java.util.ArrayList;
-import java.util.List;
-import javax.swing.JOptionPane;
-/**
- *
- * @author letellier
- */
-public class WelcomeSaveVerifier {
- protected List<fr.ifremer.isisfish.ui.SaveVerfier> verifiers = new ArrayList<fr.ifremer.isisfish.ui.SaveVerfier>();
-
- public void addSaveVerifier(InputSaveVerifier inputVerifier) {
- verifiers.add(inputVerifier);
- }
-
- public boolean allIsSaved(){
- boolean exit = true;
- int responce = JOptionPane.CANCEL_OPTION;
- for (fr.ifremer.isisfish.ui.SaveVerfier s : verifiers){
- responce = s.checkEdit();
- }
- //boolean exit = checkEdit(event, component);
- if (responce == JOptionPane.OK_OPTION){
- }
- else if (responce == JOptionPane.CANCEL_OPTION){
- exit = false;
- }
- return exit;
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeSaveVerifier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,38 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package fr.ifremer.isisfish.ui;
+
+import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JOptionPane;
+/**
+ *
+ * @author letellier
+ */
+public class WelcomeSaveVerifier {
+ protected List<fr.ifremer.isisfish.ui.SaveVerifier> verifiers = new ArrayList<fr.ifremer.isisfish.ui.SaveVerifier>();
+
+ public void addSaveVerifier(InputSaveVerifier inputVerifier) {
+ verifiers.add(inputVerifier);
+ }
+
+ public boolean allIsSaved(){
+ boolean exit = true;
+ int responce = JOptionPane.CANCEL_OPTION;
+ for (fr.ifremer.isisfish.ui.SaveVerifier s : verifiers){
+ responce = s.checkEdit();
+ }
+ //boolean exit = checkEdit(event, component);
+ if (responce == JOptionPane.OK_OPTION){
+ }
+ else if (responce == JOptionPane.CANCEL_OPTION){
+ exit = false;
+ }
+ return exit;
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,183 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * 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.
- *##%*/
-
-/* *
- * 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 $
- */
- -->
-<JFrame id='isisfishFrame' title="isisfish.welcome.title" width='874' height='736' resizable="true" location='{new Point(0,23)}' layout='{new BorderLayout()}'>
- <script><![CDATA[
- import static org.codelutin.i18n.I18n._;
- import fr.ifremer.isisfish.ui.simulator.SimulAction;
- import fr.ifremer.isisfish.ui.input.InputUI;
- import fr.ifremer.isisfish.ui.input.InputAction;
- import fr.ifremer.isisfish.ui.sensitivity.SensitivityUI;
- import fr.ifremer.isisfish.ui.result.ResultAction;
- import fr.ifremer.isisfish.ui.result.ResultView;
- import fr.ifremer.isisfish.ui.script.ScriptUI;
- import fr.ifremer.isisfish.ui.simulator.SimulUI;
- import fr.ifremer.isisfish.ui.simulator.QueueUI;
- import jaxx.runtime.DefaultJAXXContext;
- import fr.ifremer.isisfish.IsisFish;
- import fr.ifremer.isisfish.IsisConfig;
- import javax.swing.JFrame;
- import org.codelutin.widget.AboutFrame;
- import jaxx.runtime.JAXXInitialContext;
- import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
-
- java.util.Map <JFrame, WelcomePanelUI> allFrameOpened;
- WelcomeSaveVerifier verifier = new WelcomeSaveVerifier();
- setContextValue(verifier);
- allFrameOpened = new java.util.HashMap <JFrame, WelcomePanelUI> ();
- welcomePanelUI.setContent(new WelcomeTabUI(new JAXXInitialContext().add(getVerifier())));
- protected void openFrame(Container c, String title){
- JFrame f = new JFrame();
- f.setLayout(new BorderLayout());
- WelcomePanelUI welcome = new WelcomePanelUI(new JAXXInitialContext().add(verifier).add(this));
- welcome.setContent(c);
- f.add(welcome, BorderLayout.CENTER);
- f.setTitle(title);
- f.setSize(new Dimension(800, 600));
- f.setDefaultCloseOperation(f.DO_NOTHING_ON_CLOSE);
- allFrameOpened.put(f, welcome);
- f.addWindowListener(new WindowListener() {
-
- @Override
- public void windowOpened(WindowEvent e) {
- }
-
- @Override
- public void windowClosing(WindowEvent e) {
- JFrame f = (JFrame) e.getSource();
- allFrameOpened.get(f).close(f);
- }
-
- @Override
- public void windowClosed(WindowEvent e) {
- }
-
- @Override
- public void windowIconified(WindowEvent e) {
- }
-
- @Override
- public void windowDeiconified(WindowEvent e) {
- }
-
- @Override
- public void windowActivated(WindowEvent e) {
- }
-
- @Override
- public void windowDeactivated(WindowEvent e) {
- }
- });
- f.setVisible(true);
- }
- public void close() {
- if (verifier.allIsSaved()){
- exit();
- }
- }
- protected void exit(){
- this.dispose();
- IsisFish.quit();
- }
- protected WelcomeSaveVerifier getVerifier(){
- return getContextValue(WelcomeSaveVerifier.class);
- }
- protected void monitorUI() {
- new ApplicationMonitorUI();
- }
- protected void updateVCS(){
-// FIXME a reimplanter
-// thread:Welcome.updateVCS()
- }
- protected void config(){
-// FIXME a reimplanter
-// Welcome.showConfig()
- }
- protected void configVCS(){
-// FIXME a reimplanter
-// fr.ifremer.isisfish.versionning.ui.VCSConfigUI.doLaunch()
- }
- protected void help(){
-// FIXME a reimplanter
- }
- protected void about(){
- org.codelutin.widget.AboutFrame about = new org.codelutin.widget.AboutFrame();
-// about.setAboutHtmlText($jaxxObjectDescriptor)
-// AboutFrame about = new AboutFrame();
- about.setTitle(_("isisfish.about.title"));
- about.setIconPath("images/strategy.jpg");
- about.setAboutHtmlText(_("isisfish.about.abouthtmltext", IsisConfig.getVersion()));
- about.setLicenseText(_("isisfish.about.licensetext"));
- about.setBackgroundColor(Color.WHITE);
- // center frame
- Dimension dim = getToolkit().getScreenSize();
- about.setSize(640, 520);
- about.setLocation((dim.width - about.getSize().width) / 2,
- (dim.height - about.getSize().height) / 2);
-// about.pack();
- about.setVisible(true);
- }
- ]]>
- </script>
- <JMenuBar>
-<!--
- id="menuBar"
--->
- <JMenu text='isisfish.welcome.menu.file'>
- <JMenuItem text="isisfish.welcome.menu.synchro" enabled='false' onActionPerformed='updateVCS()'/>
- <JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.close" onActionPerformed='close()'/>
- </JMenu>
- <JMenu text="isisfish.welcome.menu.frame">
- <JMenuItem text="isisfish.welcome.menu.simulation" onActionPerformed='openFrame(new SimulUI(new SimulAction()), _("isisfish.simulation.title"))'/>
- <JMenuItem text="isisfish.welcome.menu.result" onActionPerformed='openFrame(new ResultView(), _("isisfish.result.title"))'/>
- <JMenuItem text="isisfish.welcome.menu.input" onActionPerformed='openFrame(new InputUI(new JAXXInitialContext().add(verifier).add(new InputAction()).add(new InputSaveVerifier()).add(this)), _("isisfish.input.title"))'/>
- <JMenuItem text="isisfish.welcome.menu.script" onActionPerformed='openFrame(new ScriptUI(), _("isisfish.script.title"))'/>
- <JMenuItem text="isisfish.sensitivity.title" onActionPerformed='openFrame(new SensitivityUI(new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add(this)), _("isisfish.sensitivity.title"))'/>
- <JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.queue" onActionPerformed='openFrame(new QueueUI(), _("isisfish.queue.title"))'/>
- <JSeparator/>
- <JMenu text="isisfish.welcome.menu.configuration">
- <JMenuItem text="isisfish.welcome.menu.configuration" enabled='false' onActionPerformed='config()'/>
- <JMenuItem text="isisfish.welcome.menu.vcs.configuration" enabled='false' onActionPerformed='configVCS()'/>
- </JMenu>
- </JMenu>
- <JMenu text="isisfish.welcome.menu.help">
- <JMenuItem text="isisfish.welcome.menu.help" onActionPerformed='help()'/>
- <JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.monitor" onActionPerformed='monitorUI()'/>
- <JSeparator/>
- <JMenuItem text="isisfish.welcome.menu.about" onActionPerformed='about()'/>
- </JMenu>
- </JMenuBar>
- <WelcomePanelUI id="welcomePanelUI" constructorParams='new DefaultJAXXContext(this)'/>
-</JFrame>
\ No newline at end of file
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/WelcomeUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,188 @@
+<!--
+/* *##%
+ * 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.
+ *##%*/
+
+/**
+ * WelcomeUI.
+ *
+ * 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 $
+ */
+ -->
+<JFrame id='isisfishFrame' title="isisfish.welcome.title" width='874' height='736' resizable="true" location='{new Point(0,23)}' layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ import static org.codelutin.i18n.I18n._;
+ import fr.ifremer.isisfish.ui.simulator.SimulAction;
+ import fr.ifremer.isisfish.ui.input.InputUI;
+ import fr.ifremer.isisfish.ui.input.InputAction;
+ import fr.ifremer.isisfish.ui.sensitivity.SensitivityUI;
+ import fr.ifremer.isisfish.ui.result.ResultAction;
+ import fr.ifremer.isisfish.ui.result.ResultView;
+ import fr.ifremer.isisfish.ui.script.ScriptUI;
+ import fr.ifremer.isisfish.ui.simulator.SimulUI;
+ import fr.ifremer.isisfish.ui.simulator.QueueUI;
+ import jaxx.runtime.DefaultJAXXContext;
+ import fr.ifremer.isisfish.IsisFish;
+ import fr.ifremer.isisfish.IsisConfig;
+ import javax.swing.JFrame;
+ import org.codelutin.widget.AboutFrame;
+ import jaxx.runtime.JAXXInitialContext;
+ import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
+
+ Map<JFrame, WelcomePanelUI> allFrameOpened;
+ WelcomeSaveVerifier verifier = new WelcomeSaveVerifier();
+ setContextValue(verifier);
+ allFrameOpened = new java.util.HashMap<JFrame, WelcomePanelUI>();
+ welcomePanelUI.setContent(new WelcomeTabUI(new JAXXInitialContext().add(getVerifier())));
+
+ protected void openFrame(Container c, String title) {
+ JFrame f = new JFrame();
+ f.setLayout(new BorderLayout());
+ WelcomePanelUI welcome = new WelcomePanelUI(new JAXXInitialContext().add(verifier).add(this));
+ welcome.setContent(c);
+ f.add(welcome, BorderLayout.CENTER);
+ f.setTitle(title);
+ f.setSize(new Dimension(800, 600));
+ f.setDefaultCloseOperation(f.DO_NOTHING_ON_CLOSE);
+ allFrameOpened.put(f, welcome);
+ f.addWindowListener(new WindowListener() {
+
+ @Override
+ public void windowOpened(WindowEvent e) {
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ JFrame f = (JFrame) e.getSource();
+ allFrameOpened.get(f).close(f);
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent e) {
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e) {
+ }
+ });
+ f.setVisible(true);
+ }
+ public void close() {
+ if (verifier.allIsSaved()) {
+ exit();
+ }
+ }
+ protected void exit() {
+ this.dispose();
+ IsisFish.quit();
+ }
+ protected WelcomeSaveVerifier getVerifier() {
+ return getContextValue(WelcomeSaveVerifier.class);
+ }
+ protected void monitorUI() {
+ new ApplicationMonitorUI();
+ }
+ protected void updateVCS() {
+// FIXME a reimplanter
+// thread:Welcome.updateVCS()
+ }
+ protected void config() {
+// FIXME a reimplanter
+// Welcome.showConfig()
+ }
+ protected void configVCS() {
+// FIXME a reimplanter
+// fr.ifremer.isisfish.versionning.ui.VCSConfigUI.doLaunch()
+ }
+ protected void help(String urlAlias) {
+ Help.showURL(urlAlias);
+ }
+
+ protected void about() {
+ AboutFrame about = new AboutFrame();
+ // about.setAboutHtmlText($jaxxObjectDescriptor)
+ // AboutFrame about = new AboutFrame();
+ about.setTitle(_("isisfish.about.title"));
+ about.setIconPath("images/strategy.jpg");
+ about.setAboutHtmlText(_("isisfish.about.abouthtmltext", IsisConfig.getVersion()));
+ about.setLicenseText(_("isisfish.about.licensetext"));
+ about.setBackgroundColor(Color.WHITE);
+ // center frame
+ Dimension dim = getToolkit().getScreenSize();
+ about.setSize(640, 520);
+ about.setLocation((dim.width - about.getSize().width) / 2,
+ (dim.height - about.getSize().height) / 2);
+ about.setVisible(true);
+ }
+ ]]>
+ </script>
+ <JMenuBar>
+ <JMenu text='isisfish.welcome.menu.file'>
+ <JMenuItem text="isisfish.welcome.menu.synchro" enabled='false' onActionPerformed='updateVCS()'/>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.close" onActionPerformed='close()'/>
+ </JMenu>
+ <JMenu text="isisfish.welcome.menu.frame">
+ <JMenuItem text="isisfish.welcome.menu.simulation" onActionPerformed='openFrame(new SimulUI(new SimulAction()), _("isisfish.simulation.title"))'/>
+ <JMenuItem text="isisfish.welcome.menu.result" onActionPerformed='openFrame(new ResultView(), _("isisfish.result.title"))'/>
+ <JMenuItem text="isisfish.welcome.menu.input" onActionPerformed='openFrame(new InputUI(new JAXXInitialContext().add(verifier).add(new InputAction()).add(new InputSaveVerifier()).add(this)), _("isisfish.input.title"))'/>
+ <JMenuItem text="isisfish.welcome.menu.script" onActionPerformed='openFrame(new ScriptUI(), _("isisfish.script.title"))'/>
+ <JMenuItem text="isisfish.sensitivity.title" onActionPerformed='openFrame(new SensitivityUI(new JAXXInitialContext().add(new InputAction()).add(new InputSaveVerifier()).add(this)), _("isisfish.sensitivity.title"))'/>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.queue" onActionPerformed='openFrame(new QueueUI(), _("isisfish.queue.title"))'/>
+ <JSeparator/>
+ <JMenu text="isisfish.welcome.menu.configuration">
+ <JMenuItem text="isisfish.welcome.menu.configuration" enabled='false' onActionPerformed='config()'/>
+ <JMenuItem text="isisfish.welcome.menu.vcs.configuration" enabled='false' onActionPerformed='configVCS()'/>
+ </JMenu>
+ </JMenu>
+ <JMenu text="isisfish.welcome.menu.help">
+ <JMenu text="isisfish.welcome.menu.help">
+ <JMenuItem text="isisfish.welcome.menu.help.isisfish" onActionPerformed='help("ISISFISH")'/>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.help.javaapi" onActionPerformed='help("JAVA_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.isisfishapi" onActionPerformed='help("ISIS_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.lutinmatrixapi" onActionPerformed='help("MATRIX_API")'/>
+ <JMenuItem text="isisfish.welcome.menu.help.topiaapi" onActionPerformed='help("TOPIA_API")'/>
+ </JMenu>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.monitor" onActionPerformed='monitorUI()'/>
+ <JSeparator/>
+ <JMenuItem text="isisfish.welcome.menu.about" onActionPerformed='about()'/>
+ </JMenu>
+ </JMenuBar>
+ <WelcomePanelUI id="welcomePanelUI" constructorParams='new DefaultJAXXContext(this)'/>
+</JFrame>
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,440 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package fr.ifremer.isisfish.ui.input;
-
-import fr.ifremer.isisfish.IsisFishDAOHelper;
-import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
-import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import javax.swing.JButton;
-import javax.swing.JOptionPane;
-import jaxx.runtime.JAXXAction;
-import jaxx.runtime.JAXXContext;
-import jaxx.runtime.JAXXInitialContext;
-import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
-import org.apache.commons.beanutils.MethodUtils;
-import org.apache.commons.lang.ClassUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.topia.TopiaContext;
-import org.codelutin.topia.TopiaException;
-import org.codelutin.topia.persistence.TopiaDAO;
-import org.codelutin.topia.persistence.TopiaEntity;
-import static org.codelutin.i18n.I18n._;
-
-/**
- *
- * @author letellier
- */
-public class InputSaveVerifier implements JAXXAction, fr.ifremer.isisfish.ui.SaveVerfier {
- protected JButton currentNewButton = null;
- protected JButton currentDeleteButton = null;
- protected JButton currentSaveButton = null;
- protected JButton currentCancelButton = null;
-
- protected ActionListener saveListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaSave();
- }
- };
- protected ActionListener cancelListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaCancel();
- }
- };
- protected ActionListener newListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaCreate();
- }
- };
- protected ActionListener deleteListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- topiaRemove();
- }
- };
-
- protected String type = null;
-
- protected boolean editable = false;
- protected boolean changed = false;
-
- protected NavigationTreeNode currentNode = null;
- protected String currentOnglet = null;
-
- protected TopiaContext isisContext = null;
- protected List<TopiaEntity> currentEntities = new ArrayList <TopiaEntity>();
- protected List<InputContentUI> currentPanels = new ArrayList <InputContentUI>();
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(InputAction.class);
- protected InputUI rootUI;
- protected SensitivityTabUI sensUI;
-
- public InputSaveVerifier(){
- }
- @Override
- public JAXXInitialContext init(JAXXContext parentContent, Object... datas) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int checkEdit() {
- int responce = JOptionPane.NO_OPTION;
- if (editable) {
- if (changed) {
- // ask user to close edition
- // still in edit mode, must warn user
- responce = askUser(_("isisfish.message.page.modified"));
- if (responce == JOptionPane.NO_OPTION) {
- topiaCancel();
- } else if (responce == JOptionPane.OK_OPTION) {
- topiaSave();
- }
- }
- }
- return responce;
- }
-
- public int askUser(String message) {
- int response = JOptionPane.showConfirmDialog(rootUI, message,
- _("isisfish.input.menu.commit"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
- return response;
- }
-
- protected void topiaChanged(){
- changed = true;
- setPanelsActifs();
- setEnabled(currentSaveButton, true);
- setEnabled(currentCancelButton, true);
- setEnabled(currentNewButton, false);
- setEnabled(currentDeleteButton, false);
- }
- protected void noModif(){
- changed = false;
- setPanelsActifs();
- setEnabled(currentSaveButton, false);
- setEnabled(currentCancelButton, false);
- setEnabled(currentNewButton, true);
- setEnabled(currentDeleteButton, editable);
- }
- protected void setEnabled(JButton b, boolean enabled){
- if (b != null){
- b.setEnabled(enabled);
- }
- }
-
- /**
- * Delete one entity and commit the change, try to selected intelligently
- * other node in tree.
- * <p/>
- * Refresh all ui component where name match "input<entity type without
- * package >.*"
- */
- public void topiaRemove() {
- if (log.isTraceEnabled()) {
- log.trace("remove called");
- }
- String msg = "";
- try {
- boolean doDelete;
- TopiaEntity topiaEntity = (TopiaEntity)currentNode.getJAXXContextValue(rootUI);
- List<TopiaEntity> allWillBeRemoved = topiaEntity.getComposite();
- if (allWillBeRemoved.size() > 0) {
- String text = _(
- "isisfish.message.delete.object", currentEntities.get(0).toString());
- for (TopiaEntity e : allWillBeRemoved) {
- text += ClassUtils.getShortClassName(e.getClass()) + " - "
- + e.toString() + "\n";
- }
- int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION);
- doDelete = resp == JOptionPane.YES_OPTION;
- } else {
- String text = _("isisfish.message.confirm.delete.object", currentEntities.get(0).toString());
- int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
- doDelete = resp == JOptionPane.YES_OPTION;
- }
-
- if (doDelete) {
- topiaEntity.delete();
- isisContext.commitTransaction();
- msg = _("isisfish.message.remove.finished");
- } else {
- msg = _("isisfish.message.remove.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't remove entity: " + currentEntities.get(0), eee);
- ErrorDialogUI.showError(eee);
- }
- rootUI.setInfoText(msg);
- String path = currentNode.getParent().getContextPath();
- rootUI.setTreeModel();
- rootUI.setTreeSelection(path);
- noModif();
- }
-
-
- protected void topiaCreate(){
-
- if (log.isTraceEnabled()) {
- log.trace("create called for " + type);
- }
- try {
- //TODO use the IsisFishEntityEnum for this purpose :
- //TopiaDAO<TopiaEntity> dao = IsisFishEntityEnum.getEntry(type).getDAO(isisContext);
- String name = type + "_new";
-
- Method method = MethodUtils.getAccessibleMethod(
- IsisFishDAOHelper.class, "get" + type + "DAO",
- TopiaContext.class);
- TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, isisContext);
-
- TopiaEntity entity = dao.create("name", name);
- entity.update();
- isisContext.commitTransaction();
-
- String path = currentNode.getParent().getContextPath() + "/" + entity.getTopiaId();
- if (!editable){
- path = currentNode.getContextPath() + "/" + entity.getTopiaId();
- }
-
- rootUI.setTreeModel();
- rootUI.setTreeSelection(path);
-
- rootUI.setInfoText(_("isisfish.message.creation.finished"));
-
- } catch (Exception eee) {
- log.error("Can't create entity", eee);
- showMsgBox(eee);
- }
- }
-
- public void topiaSave(){
- try {
- noModif();
- for (TopiaEntity t : currentEntities){
- t.update();
- if (log.isDebugEnabled())
- log.debug("updating : " + t);
- }
- isisContext.commitTransaction();
- rootUI.repaintNode(currentNode.getContextPath());
- rootUI.setInfoText(_("isisfish.message.save.finished"));
- } catch (TopiaException eee) {
- log.error("Can't save region", eee);
- showMsgBox(eee);
- }
- }
-
- /**
- * Cancel all modification on entity (rollback), and force reload it and
- * refresh all ui component that name match 'type'Tab
- */
- public void topiaCancel() {
- try {
- noModif();
- isisContext.rollbackTransaction();
- List<TopiaEntity> canceledEntity = new ArrayList<TopiaEntity>();
- for (TopiaEntity t : currentEntities){
- t = isisContext.findByTopiaId(t.getTopiaId());
- rootUI.repaintNode(currentNode.getContextPath());
- rootUI.setTreeSelection(currentNode.getContextPath());
- canceledEntity.add(t);
- }
- currentEntities = canceledEntity;
- rootUI.setInfoText(_("isisfish.message.cancel.finished"));
- } catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
- showMsgBox(eee);
- }
- }
-
- protected void showMsgBox(Exception eee) {
- ErrorDialogUI.showError(eee);
- }
- protected void setPanelsActifs(){
- if (!currentPanels.isEmpty()){
- for (InputContentUI panel : currentPanels){
- panel.setActif(editable);
- }
- }
- }
- public void refreshAll(){
- for (InputContentUI panel : currentPanels){
- panel.refresh();
- panel.setActif(editable);
- }
- }
- public void addCurrentEntity(TopiaEntity currentEntity) {
- if (currentEntity != null){
- editable = true;
- isisContext = currentEntity.getTopiaContext();
- currentEntity.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- if (log.isDebugEnabled()){
- log.debug("PropetyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
- }
- topiaChanged();
- }
- });
- TopiaEntity entity = getEntity(currentEntity.getClass());
- if (entity != null){
- currentEntities.remove(entity);
- }
- this.currentEntities.add(currentEntity);
- setPanelsActifs();
- }
- }
- public void removeAllEntity(){
- currentEntities.clear();
- editable = false;
- noModif();
- setPanelsActifs();
- }
- public void addCurrentPanel(InputContentUI... panels) {
- for (InputContentUI ui : panels){
- editable = !currentEntities.isEmpty();
- this.currentPanels.add(ui);
- if (rootUI == null){
- ui.setSens(true);
- ui.setLayer(true);
- }
- ui.refresh();
- ui.setActif(editable);
- }
- }
- public void removeAllPanels(){
- currentPanels.clear();
- }
-
- public boolean isEditable() {
- return editable;
- }
-
- public void setSaveButton(JButton saveButton){
- setSaveButton(saveButton, true);
- }
-
- public void setSaveButton(JButton saveButton, Boolean listener){
- if (listener){
- saveButton.removeActionListener(saveListener);
- saveButton.addActionListener(saveListener);
- }
- saveButton.setEnabled(changed);
- saveButton.setText(_("isisfish.common.save"));
- this.currentSaveButton = saveButton;
- }
-
- public void setNewButton(JButton saveButton, String name){
- setNewButton(saveButton, name, true);
- }
-
- public void setNewButton(JButton newButton, String t, Boolean listener){
- if (listener){
- newButton.removeActionListener(newListener);
- newButton.addActionListener(newListener);
- }
- newButton.setText(_("isisfish.common.new"));
- newButton.setEnabled(!changed);
- this.type = t;
- this.currentNewButton = newButton;
- }
-
- public void setCancelButton(JButton cancelButton){
- cancelButton.removeActionListener(cancelListener);
- cancelButton.addActionListener(cancelListener);
- cancelButton.setText(_("isisfish.common.cancel"));
- cancelButton.setEnabled(changed);
- this.currentCancelButton = cancelButton;
- }
-
- public void setDeleteButton(JButton deleteButton){
- setDeleteButton(deleteButton, true);
- }
-
- public void setDeleteButton(JButton deleteButton, boolean listener){
- if (listener){
- deleteButton.removeActionListener(deleteListener);
- deleteButton.addActionListener(deleteListener);
- }
- deleteButton.setEnabled(editable);
- deleteButton.setText(_("isisfish.common.remove"));
- this.currentDeleteButton = deleteButton;
- }
-
- public TopiaContext getIsisContext() {
- return isisContext;
- }
-
- public List<TopiaEntity> getCurrentEntities() {
- return currentEntities;
- }
-
- public <E extends TopiaEntity> E getEntity(Class<E> clazz){
- for (TopiaEntity te : currentEntities){
- if (clazz.isInstance(te)){
- return (E) te;
- }
- }
- return null;
- }
-
- public List<InputContentUI> getCurrentPanels() {
- return currentPanels;
- }
-
- public String getCurrentOnglet() {
- return currentOnglet;
- }
-
- public NavigationTreeNode getCurrentNode() {
- return currentNode;
- }
-
- public void setIsisContext(TopiaContext isisContext) {
- this.isisContext = isisContext;
- }
-
- public void setEditable(boolean editable) {
- this.editable = editable;
- }
-
- public void setCurrentOnglet(String currentOnglet) {
- this.currentOnglet = currentOnglet;
- }
-
- public void setCurrentNode(NavigationTreeNode currentNode) {
- this.currentNode = currentNode;
- }
-
- void setRootPanel(InputUI inputUI) {
- this.rootUI = inputUI;
- }
-
- public SensitivityTabUI getSensPanel() {
- return sensUI;
- }
-
- public void setSensPanel(SensitivityTabUI sensUI) {
- this.sensUI = sensUI;
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,440 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package fr.ifremer.isisfish.ui.input;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
+import fr.ifremer.isisfish.ui.sensitivity.SensitivityTabUI;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import jaxx.runtime.JAXXAction;
+import jaxx.runtime.JAXXContext;
+import jaxx.runtime.JAXXInitialContext;
+import jaxx.runtime.swing.navigation.NavigationTreeModel.NavigationTreeNode;
+import org.apache.commons.beanutils.MethodUtils;
+import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaContext;
+import org.codelutin.topia.TopiaException;
+import org.codelutin.topia.persistence.TopiaDAO;
+import org.codelutin.topia.persistence.TopiaEntity;
+import static org.codelutin.i18n.I18n._;
+
+/**
+ *
+ * @author letellier
+ */
+public class InputSaveVerifier implements JAXXAction, fr.ifremer.isisfish.ui.SaveVerifier {
+ protected JButton currentNewButton = null;
+ protected JButton currentDeleteButton = null;
+ protected JButton currentSaveButton = null;
+ protected JButton currentCancelButton = null;
+
+ protected ActionListener saveListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaSave();
+ }
+ };
+ protected ActionListener cancelListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaCancel();
+ }
+ };
+ protected ActionListener newListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaCreate();
+ }
+ };
+ protected ActionListener deleteListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ topiaRemove();
+ }
+ };
+
+ protected String type = null;
+
+ protected boolean editable = false;
+ protected boolean changed = false;
+
+ protected NavigationTreeNode currentNode = null;
+ protected String currentOnglet = null;
+
+ protected TopiaContext isisContext = null;
+ protected List<TopiaEntity> currentEntities = new ArrayList <TopiaEntity>();
+ protected List<InputContentUI> currentPanels = new ArrayList <InputContentUI>();
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(InputAction.class);
+ protected InputUI rootUI;
+ protected SensitivityTabUI sensUI;
+
+ public InputSaveVerifier(){
+ }
+ @Override
+ public JAXXInitialContext init(JAXXContext parentContent, Object... datas) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public int checkEdit() {
+ int responce = JOptionPane.NO_OPTION;
+ if (editable) {
+ if (changed) {
+ // ask user to close edition
+ // still in edit mode, must warn user
+ responce = askUser(_("isisfish.message.page.modified"));
+ if (responce == JOptionPane.NO_OPTION) {
+ topiaCancel();
+ } else if (responce == JOptionPane.OK_OPTION) {
+ topiaSave();
+ }
+ }
+ }
+ return responce;
+ }
+
+ public int askUser(String message) {
+ int response = JOptionPane.showConfirmDialog(rootUI, message,
+ _("isisfish.input.menu.commit"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
+ return response;
+ }
+
+ protected void topiaChanged(){
+ changed = true;
+ setPanelsActifs();
+ setEnabled(currentSaveButton, true);
+ setEnabled(currentCancelButton, true);
+ setEnabled(currentNewButton, false);
+ setEnabled(currentDeleteButton, false);
+ }
+ protected void noModif(){
+ changed = false;
+ setPanelsActifs();
+ setEnabled(currentSaveButton, false);
+ setEnabled(currentCancelButton, false);
+ setEnabled(currentNewButton, true);
+ setEnabled(currentDeleteButton, editable);
+ }
+ protected void setEnabled(JButton b, boolean enabled){
+ if (b != null){
+ b.setEnabled(enabled);
+ }
+ }
+
+ /**
+ * Delete one entity and commit the change, try to selected intelligently
+ * other node in tree.
+ * <p/>
+ * Refresh all ui component where name match "input<entity type without
+ * package >.*"
+ */
+ public void topiaRemove() {
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
+ String msg = "";
+ try {
+ boolean doDelete;
+ TopiaEntity topiaEntity = (TopiaEntity)currentNode.getJAXXContextValue(rootUI);
+ List<TopiaEntity> allWillBeRemoved = topiaEntity.getComposite();
+ if (allWillBeRemoved.size() > 0) {
+ String text = _(
+ "isisfish.message.delete.object", currentEntities.get(0).toString());
+ for (TopiaEntity e : allWillBeRemoved) {
+ text += ClassUtils.getShortClassName(e.getClass()) + " - "
+ + e.toString() + "\n";
+ }
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entities"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ } else {
+ String text = _("isisfish.message.confirm.delete.object", currentEntities.get(0).toString());
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ }
+
+ if (doDelete) {
+ topiaEntity.delete();
+ isisContext.commitTransaction();
+ msg = _("isisfish.message.remove.finished");
+ } else {
+ msg = _("isisfish.message.remove.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't remove entity: " + currentEntities.get(0), eee);
+ ErrorDialogUI.showError(eee);
+ }
+ rootUI.setInfoText(msg);
+ String path = currentNode.getParent().getContextPath();
+ rootUI.setTreeModel();
+ rootUI.setTreeSelection(path);
+ noModif();
+ }
+
+
+ protected void topiaCreate(){
+
+ if (log.isTraceEnabled()) {
+ log.trace("create called for " + type);
+ }
+ try {
+ //TODO use the IsisFishEntityEnum for this purpose :
+ //TopiaDAO<TopiaEntity> dao = IsisFishEntityEnum.getEntry(type).getDAO(isisContext);
+ String name = type + "_new";
+
+ Method method = MethodUtils.getAccessibleMethod(
+ IsisFishDAOHelper.class, "get" + type + "DAO",
+ TopiaContext.class);
+ TopiaDAO<TopiaEntity> dao = (TopiaDAO<TopiaEntity>) method.invoke(null, isisContext);
+
+ TopiaEntity entity = dao.create("name", name);
+ entity.update();
+ isisContext.commitTransaction();
+
+ String path = currentNode.getParent().getContextPath() + "/" + entity.getTopiaId();
+ if (!editable){
+ path = currentNode.getContextPath() + "/" + entity.getTopiaId();
+ }
+
+ rootUI.setTreeModel();
+ rootUI.setTreeSelection(path);
+
+ rootUI.setInfoText(_("isisfish.message.creation.finished"));
+
+ } catch (Exception eee) {
+ log.error("Can't create entity", eee);
+ showMsgBox(eee);
+ }
+ }
+
+ public void topiaSave(){
+ try {
+ noModif();
+ for (TopiaEntity t : currentEntities){
+ t.update();
+ if (log.isDebugEnabled())
+ log.debug("updating : " + t);
+ }
+ isisContext.commitTransaction();
+ rootUI.repaintNode(currentNode.getContextPath());
+ rootUI.setInfoText(_("isisfish.message.save.finished"));
+ } catch (TopiaException eee) {
+ log.error("Can't save region", eee);
+ showMsgBox(eee);
+ }
+ }
+
+ /**
+ * Cancel all modification on entity (rollback), and force reload it and
+ * refresh all ui component that name match 'type'Tab
+ */
+ public void topiaCancel() {
+ try {
+ noModif();
+ isisContext.rollbackTransaction();
+ List<TopiaEntity> canceledEntity = new ArrayList<TopiaEntity>();
+ for (TopiaEntity t : currentEntities){
+ t = isisContext.findByTopiaId(t.getTopiaId());
+ rootUI.repaintNode(currentNode.getContextPath());
+ rootUI.setTreeSelection(currentNode.getContextPath());
+ canceledEntity.add(t);
+ }
+ currentEntities = canceledEntity;
+ rootUI.setInfoText(_("isisfish.message.cancel.finished"));
+ } catch (Exception eee) {
+ log.error("Can't cancel modification in region", eee);
+ showMsgBox(eee);
+ }
+ }
+
+ protected void showMsgBox(Exception eee) {
+ ErrorDialogUI.showError(eee);
+ }
+ protected void setPanelsActifs(){
+ if (!currentPanels.isEmpty()){
+ for (InputContentUI panel : currentPanels){
+ panel.setActif(editable);
+ }
+ }
+ }
+ public void refreshAll(){
+ for (InputContentUI panel : currentPanels){
+ panel.refresh();
+ panel.setActif(editable);
+ }
+ }
+ public void addCurrentEntity(TopiaEntity currentEntity) {
+ if (currentEntity != null){
+ editable = true;
+ isisContext = currentEntity.getTopiaContext();
+ currentEntity.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()){
+ log.debug("PropetyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
+ }
+ topiaChanged();
+ }
+ });
+ TopiaEntity entity = getEntity(currentEntity.getClass());
+ if (entity != null){
+ currentEntities.remove(entity);
+ }
+ this.currentEntities.add(currentEntity);
+ setPanelsActifs();
+ }
+ }
+ public void removeAllEntity(){
+ currentEntities.clear();
+ editable = false;
+ noModif();
+ setPanelsActifs();
+ }
+ public void addCurrentPanel(InputContentUI... panels) {
+ for (InputContentUI ui : panels){
+ editable = !currentEntities.isEmpty();
+ this.currentPanels.add(ui);
+ if (rootUI == null){
+ ui.setSens(true);
+ ui.setLayer(true);
+ }
+ ui.refresh();
+ ui.setActif(editable);
+ }
+ }
+ public void removeAllPanels(){
+ currentPanels.clear();
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setSaveButton(JButton saveButton){
+ setSaveButton(saveButton, true);
+ }
+
+ public void setSaveButton(JButton saveButton, Boolean listener){
+ if (listener){
+ saveButton.removeActionListener(saveListener);
+ saveButton.addActionListener(saveListener);
+ }
+ saveButton.setEnabled(changed);
+ saveButton.setText(_("isisfish.common.save"));
+ this.currentSaveButton = saveButton;
+ }
+
+ public void setNewButton(JButton saveButton, String name){
+ setNewButton(saveButton, name, true);
+ }
+
+ public void setNewButton(JButton newButton, String t, Boolean listener){
+ if (listener){
+ newButton.removeActionListener(newListener);
+ newButton.addActionListener(newListener);
+ }
+ newButton.setText(_("isisfish.common.new"));
+ newButton.setEnabled(!changed);
+ this.type = t;
+ this.currentNewButton = newButton;
+ }
+
+ public void setCancelButton(JButton cancelButton){
+ cancelButton.removeActionListener(cancelListener);
+ cancelButton.addActionListener(cancelListener);
+ cancelButton.setText(_("isisfish.common.cancel"));
+ cancelButton.setEnabled(changed);
+ this.currentCancelButton = cancelButton;
+ }
+
+ public void setDeleteButton(JButton deleteButton){
+ setDeleteButton(deleteButton, true);
+ }
+
+ public void setDeleteButton(JButton deleteButton, boolean listener){
+ if (listener){
+ deleteButton.removeActionListener(deleteListener);
+ deleteButton.addActionListener(deleteListener);
+ }
+ deleteButton.setEnabled(editable);
+ deleteButton.setText(_("isisfish.common.remove"));
+ this.currentDeleteButton = deleteButton;
+ }
+
+ public TopiaContext getIsisContext() {
+ return isisContext;
+ }
+
+ public List<TopiaEntity> getCurrentEntities() {
+ return currentEntities;
+ }
+
+ public <E extends TopiaEntity> E getEntity(Class<E> clazz){
+ for (TopiaEntity te : currentEntities){
+ if (clazz.isInstance(te)){
+ return (E) te;
+ }
+ }
+ return null;
+ }
+
+ public List<InputContentUI> getCurrentPanels() {
+ return currentPanels;
+ }
+
+ public String getCurrentOnglet() {
+ return currentOnglet;
+ }
+
+ public NavigationTreeNode getCurrentNode() {
+ return currentNode;
+ }
+
+ public void setIsisContext(TopiaContext isisContext) {
+ this.isisContext = isisContext;
+ }
+
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public void setCurrentOnglet(String currentOnglet) {
+ this.currentOnglet = currentOnglet;
+ }
+
+ public void setCurrentNode(NavigationTreeNode currentNode) {
+ this.currentNode = currentNode;
+ }
+
+ void setRootPanel(InputUI inputUI) {
+ this.rootUI = inputUI;
+ }
+
+ public SensitivityTabUI getSensPanel() {
+ return sensUI;
+ }
+
+ public void setSensPanel(SensitivityTabUI sensUI) {
+ this.sensUI = sensUI;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,459 +0,0 @@
-/* *##%
-* Copyright (C) 2002, 2003 Code Lutin
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Static 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 Static public License for more details.
-*
-* You should have received a copy of the GNU General Static 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.
-*##%*/
-
-/* *
-* CheckSaisie.java
-*
-* Created: 9 janv. 2004
-*
-* @author Benjamin Poussin <poussin at codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-
-package fr.ifremer.isisfish.ui.input.check;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.codelutin.math.matrix.MatrixIterator;
-import org.codelutin.math.matrix.MatrixND;
-
-import fr.ifremer.isisfish.entities.Cell;
-import fr.ifremer.isisfish.entities.EffortDescription;
-import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.FisheryRegion;
-import fr.ifremer.isisfish.entities.Gear;
-import fr.ifremer.isisfish.entities.Metier;
-import fr.ifremer.isisfish.entities.MetierSeasonInfo;
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationGroup;
-import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
-import fr.ifremer.isisfish.entities.Port;
-import fr.ifremer.isisfish.entities.Selectivity;
-import fr.ifremer.isisfish.entities.SetOfVessels;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Strategy;
-import fr.ifremer.isisfish.entities.StrategyMonthInfo;
-import fr.ifremer.isisfish.entities.TargetSpecies;
-import fr.ifremer.isisfish.entities.TripType;
-import fr.ifremer.isisfish.entities.VesselType;
-import fr.ifremer.isisfish.entities.Zone;
-import fr.ifremer.isisfish.types.Month;
-import fr.ifremer.isisfish.util.EvaluatorHelper;
-
-public class CheckRegion { // CheckSaisie
-/*
- // check equation compilation
- for (Species species : fisheryRegion.getSpecies()) {
- for (Population pop : species.getPopulation()) {
- pop.getGrowth();
- pop.getGrowthReverse();
- pop.getMeanWeight();
- pop.getNaturalDeathRate();
- pop.getPrice();
- pop.getReproductionEquation();
- for (PopulationSeasonInfo info : pop.getPopulationSeasonInfo()) {
- info.getMigrationEquation();
- info.getEmigrationEquation();
- info.getImmigrationEquation();
- }
- }
- }
-
- */
-
- static public void check(Equation eq, CheckResult result) {
- if (0 != EvaluatorHelper.check(eq.getJavaInterface(), eq.getContent(), null)) {
- result.addError(eq, _("isisfish.error.invalid.equation"));
- }
- }
-
- static public void check(TargetSpecies capturabilite, CheckResult result){
- check(capturabilite.getTargetFactorEquation(), result);
- }
-
- static public void check(PopulationGroup classPop, CheckResult result){
- // error
- if(classPop.getMeanWeight() < 0){
- result.addError(classPop, _("isisfish.error.invalid.mean.weight"));
- }
- // if(classPop.getMortaliteNaturelle() < 0){
- // result.addError(classPop, _("isisfish.error.invalidate.natural.death"));
- // }
-
- // warning
- if(classPop.getMeanWeight() == 0){
- result.addWarning(classPop, _("isisfish.error.not.null.mean.weight"));
- }
- // if(classPop.getMortaliteNaturelle() == 0){
- // result.addWarning(classPop, _("isisfish.error.not.null.natiral.death"));
- // }
- }
-
- static public void check(Gear engin, CheckResult result){
- if("".equals(engin.getName())){
- result.addWarning(engin, _("isisfish.error.empty.name"));
- }
- if("".equals(engin.getEffortUnit())){
- result.addWarning(engin, _("isisfish.error.empty.unit"));
- }
-
- Collection<Selectivity> selectivites = engin.getPopulationSelectivity();
- if(selectivites.size() == 0){
- result.addWarning(engin, _("isisfish.error.empty.selectivity"));
- }else{
- for(Selectivity selectivity : selectivites){
- check(selectivity, result);
- }
- }
- if(engin.getPossibleValue() == null){
- result.addWarning(engin, _("isisfish.error.invalid.range"));
- }
-
- if("".equals(engin.getParameterName())){
- result.addInfo(engin, _("isisfish.error.empty.params.name"));
- }
- }
-
- static public void check(MetierSeasonInfo infoSaisonMetier, CheckResult result){
- if(infoSaisonMetier.getZone() == null || infoSaisonMetier.getZone().size() == 0){
- result.addWarning(infoSaisonMetier, _("isisfish.error.no.sector"));
- }
- Collection<TargetSpecies> especeCaptus = infoSaisonMetier.getSpeciesTargetSpecies();
- if(especeCaptus.size() == 0){
- result.addInfo(infoSaisonMetier, _("isisfish.error.empty.species"));
- }else{
- for(TargetSpecies i : especeCaptus){
- check(i, result);
- }
- }
- }
-
- static public boolean isEmptyMatrix(MatrixND mat) {
- boolean result = true;
- for (MatrixIterator i = mat.iterator(); result && i.next();) {
- result = false;
- }
- return result;
- }
-
- static public boolean isNullMatrix(MatrixND mat) {
- boolean result = true;
- if (mat != null) {
- for (MatrixIterator i = mat.iterator(); result && i.next();) {
- result = i.getValue() == 0;
- }
- }
- return result;
- }
-
- static public boolean isNegativeMatrix(MatrixND mat) {
- boolean result = true;
- for (MatrixIterator i = mat.iterator(); result && i.next();) {
- result = i.getValue() < 0;
- }
- return result;
- }
-
- static public double sumMatrix(MatrixND mat) {
- double result = 0;
- for (MatrixIterator i = mat.iterator(); i.next();) {
- result += i.getValue();
- }
- return result;
- }
-
- static public void check(PopulationSeasonInfo infoSaisonPop, CheckResult result){
- if (infoSaisonPop.getUseEquationMigration()) {
- check(infoSaisonPop.getMigrationEquation(), result);
- check(infoSaisonPop.getEmigrationEquation(), result);
- check(infoSaisonPop.getImmigrationEquation(), result);
- } else {
- if (isEmptyMatrix(infoSaisonPop.getMigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.empty.migration"));
- } else if(isNullMatrix(infoSaisonPop.getMigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.emty.migration"));
- } else if(isNegativeMatrix(infoSaisonPop.getMigrationMatrix())) {
- result.addError(infoSaisonPop, _("isisfish.error.migration.negative"));
- }
-
-
- if (isEmptyMatrix(infoSaisonPop.getEmigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.emty.emigration"));
- } else if(isNullMatrix(infoSaisonPop.getEmigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.empty.emigration"));
- } else if(isNegativeMatrix(infoSaisonPop.getEmigrationMatrix())) {
- result.addError(infoSaisonPop, _("isisfish.error.emigration.negative"));
- }
-
- if (isEmptyMatrix(infoSaisonPop.getImmigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.empty.immigration"));
- } else if(isNullMatrix(infoSaisonPop.getImmigrationMatrix())) {
- result.addInfo(infoSaisonPop, _("isisfish.error.empty.immigration"));
- } else if(isNegativeMatrix(infoSaisonPop.getImmigrationMatrix())) {
- result.addError(infoSaisonPop, _("isisfish.error.immigration.negative"));
- }
- }
- }
-
- static public void check(Cell maille, CheckResult result){
- if("".equals(maille.getName())){
- result.addWarning(maille, _("isisfish.error.empty.name"));
- }
- }
-
- static public void check(Species metaPop, CheckResult result){
- Collection<Population> pops = metaPop.getPopulation();
- if(pops.size() == 0){
- result.addWarning(metaPop, _("isisfish.error.empty.population"));
- }else{
- for(Population pop : pops){
- check(pop, result);
- }
- }
- if("".equals(metaPop.getName())){
- result.addInfo(metaPop, _("isisfish.error.empty.species.name"));
- }
- if("".equals(metaPop.getScientificName())){
- result.addInfo(metaPop, _("isisfish.error.empty.scientific.name"));
- }
- if("".equals(metaPop.getCodeRubbin())){
- result.addInfo(metaPop, _("isisfish.error.empty.code.rubbin"));
- }
- }
-
- static public void check(Metier metier, CheckResult result){
- if("".equals(metier.getName())){
- result.addWarning(metier, _("isisfish.error.empty.name"));
- }
- List<MetierSeasonInfo> infoSaisons = metier.getMetierSeasonInfo();
- if(infoSaisons.size() == 0){
- result.addWarning(metier, _("isisfish.error.empty.season"));
- }else{
- Set<Month> months = new HashSet<Month>();
- for(MetierSeasonInfo info : infoSaisons){
- if (!Collections.disjoint(months, info.getMonths())) {
- result.addError(info, _("isisfish.error.overlap.season"));
- }
- months.addAll(info.getMonths());
- check(info, result);
- }
- }
- if(metier.getGear() == null){
- result.addError(metier, _("isisfish.error.undefined.gear"));
- }else{
- check(metier.getGear(), result);
- }
-
- if (!metier.getGear().getPossibleValue().contains(metier.getGearParameterValue())) {
- result.addWarning(metier, _("isisfish.error.invalid.values.params"));
- }
-
- }
-
- static public void check(Population pop, CheckResult result){
- if("".equals(pop.getName())){
- result.addWarning(pop, _("isisfish.error.empty.name"));
- }
- if("".equals(pop.getGeographicId())){
- result.addInfo(pop, _("isisfish.error.empty.id.geographic"));
- }
- if(pop.getMaturityGroup() == null){
- result.addInfo(pop, _("isisfish.error.not.null.class.grown"));
- }
- check(pop.getGrowth(), result);
- check(pop.getGrowthReverse(), result);
- List<PopulationGroup> classes = pop.getPopulationGroup();
- if(classes.size() == 0){
- result.addWarning(pop, _("isisfish.error.undefined.classes"));
- }else{
- for(PopulationGroup group : classes){
- check(group, result);
- }
- }
- // if(pop.getMortNatClasseNaissance() == 0){
- // result.addInfo(pop, _("isisfish.error.undefined.natural.death"));
- // }
- // if(pop.getMortNatClasseNaissance() < 0){
- // result.addWarning(pop, _("isisfish.error.invalid.natural.death"));
- // }
- if(pop.getMonthGapBetweenReproRecrutement() < 0){
- result.addWarning(pop, _("isisfish.error.invalid.interval.reproduction.recruitment"));
- }
- if (isNullMatrix(pop.getMappingZoneReproZoneRecru())) {
- result.addWarning(pop, _("isisfish.error.undefined.correspondence.zones.reproduction.recruitment"));
- }
- if(pop.getPopulationZone() == null || pop.getPopulationZone().size() == 0){
- result.addWarning(pop, _("isisfish.error.undefined.zone.population"));
- }
- if(pop.getRecruitmentZone() == null || pop.getRecruitmentZone().size() == 0){
- result.addWarning(pop, _("isisfish.error.undefined.zone.recruitment"));
- }
- if(pop.getReproductionZone() == null || pop.getReproductionZone().size() == 0){
- result.addWarning(pop, _("isisfish.error.undefined.zone.reproduction"));
- }
- List<PopulationSeasonInfo> infoSaisons = pop.getPopulationSeasonInfo();
- if(infoSaisons.size() == 0){
- result.addWarning(pop, _("isisfish.error.empty.season"));
- }else{
- Set<Month> months = new HashSet<Month>();
- for(PopulationSeasonInfo info : infoSaisons){
- if (!Collections.disjoint(months, info.getMonths())) {
- result.addError(info, _("isisfish.error.overlap.season"));
- }
- months.addAll(info.getMonths());
- check(info, result);
- }
- }
- check(pop.getPrice(), result);
- check(pop.getMeanWeight(), result);
- check(pop.getReproductionEquation(), result);
- check(pop.getNaturalDeathRate(), result);
-
- if (sumMatrix(pop.getRecruitmentDistribution()) != 1) {
- result.addWarning(pop, _("isisfish.error.invalid.distribution.recruitment"));
- }
- }
-
- static public void check(FisheryRegion region, CheckResult result){
- if("".equals(region.getName())){
- result.addWarning(region, _("isisfish.error.empty.name"));
- }
-
- List<Zone> secteurs = region.getZone();;
- if(secteurs.size() == 0){
- result.addWarning(region, _("isisfish.error.undefined.sector"));
- }else{
- for(Zone zone : secteurs){
- check(zone, result);
- }
- }
- List<Cell> mailles = region.getCell();
- if(mailles.size() == 0){
- result.addWarning(region, _("isisfish.error.undefined.mesh"));
- }else{
- for(Cell cell : mailles){
- check(cell, result);
- }
- }
- List<Species> metaPops = region.getSpecies();
- if(metaPops.size() == 0){
- result.addWarning(region, _("isisfish.error.undefined.meta.population"));
- }else{
- for(Species species : metaPops){
- check(species, result);
- }
- }
- List<Metier> metiers = region.getMetier();
- if(metiers.size() == 0){
- result.addWarning(region, _("isisfish.error.undefined.meta.population"));
- }else{
- for(Metier metier : metiers){
- check(metier, result);
- }
- }
- List<Strategy> strategies = region.getStrategy();
- if(strategies.size() == 0){
- result.addWarning(region, _("isisfish.error.undefined.stategy"));
- }else{
- for(Strategy strategy : strategies){
- check(strategy, result);
- }
- }
- }
-
- static public void check(Zone secteur, CheckResult result){
- if("".equals(secteur.getName())){
- result.addWarning(secteur, _("isisfish.error.empty.name"));
- }
- if(secteur.getCell().size() == 0){
- result.addWarning(secteur, _("isisfish.error.undefined.mesh.sector"));
- }
- }
-
- static public void check(Selectivity selectivite, CheckResult result){
-
- }
-
-
- static public void check(Strategy strategy, CheckResult result){
- if("".equals(strategy.getName())){
- result.addWarning(strategy, _("isisfish.error.empty.name"));
- }
- check(strategy.getSetOfVessels(), result);
-
- List<StrategyMonthInfo> smi = strategy.getStrategyMonthInfo();
- if(smi.size() != 12){
- result.addWarning(strategy, _("isisfish.error.undefined.stategy.months"));
- }else{
- for(StrategyMonthInfo info : smi){
- check(info, result);
- }
- }
-
- }
-
- static public void check(SetOfVessels sov, CheckResult result){
- check(sov.getPort(), result);
- if(sov.getNumberOfVessels() < 0){
- result.addWarning(sov, _("isisfish.error.invalid.number"));
- }
- if(sov.getFixedCosts() < 0){
- result.addWarning(sov, _("isisfish.error.invalid.costs.fix"));
- }
- Collection<EffortDescription> efforts = sov.getPossibleMetiers();
- if(efforts.size() == 0){
- result.addWarning(sov, _("isisfish.error.not.possible.metier"));
- }else{
- for(EffortDescription effort : efforts) {
- check(effort, result);
- }
- }
- }
-
- // TODO check for VesselType, TripType, Port, StrategyMonthInfo
- static public void check(EffortDescription effort, CheckResult result){
-
- }
- static public void check(StrategyMonthInfo smi, CheckResult result){
-
- }
- static public void check(VesselType vesselType, CheckResult result){
-
- }
- static public void check(TripType tripType, CheckResult result){
-
- }
- static public void check(Port port, CheckResult result){
-
- }
-
-
-
- } // CheckSaisie
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/input/check/CheckRegion.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,459 @@
+/* *##%
+* Copyright (C) 2002, 2003 Code Lutin
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Static 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 Static public License for more details.
+*
+* You should have received a copy of the GNU General Static 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.
+*##%*/
+
+/* *
+* CheckSaisie.java
+*
+* Created: 9 janv. 2004
+*
+* @author Benjamin Poussin <poussin at codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+
+package fr.ifremer.isisfish.ui.input.check;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.codelutin.math.matrix.MatrixIterator;
+import org.codelutin.math.matrix.MatrixND;
+
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.EffortDescription;
+import fr.ifremer.isisfish.entities.Equation;
+import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.entities.Gear;
+import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.entities.MetierSeasonInfo;
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.PopulationGroup;
+import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
+import fr.ifremer.isisfish.entities.Port;
+import fr.ifremer.isisfish.entities.Selectivity;
+import fr.ifremer.isisfish.entities.SetOfVessels;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.Strategy;
+import fr.ifremer.isisfish.entities.StrategyMonthInfo;
+import fr.ifremer.isisfish.entities.TargetSpecies;
+import fr.ifremer.isisfish.entities.TripType;
+import fr.ifremer.isisfish.entities.VesselType;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.util.EvaluatorHelper;
+
+public class CheckRegion { // CheckSaisie
+/*
+ // check equation compilation
+ for (Species species : fisheryRegion.getSpecies()) {
+ for (Population pop : species.getPopulation()) {
+ pop.getGrowth();
+ pop.getGrowthReverse();
+ pop.getMeanWeight();
+ pop.getNaturalDeathRate();
+ pop.getPrice();
+ pop.getReproductionEquation();
+ for (PopulationSeasonInfo info : pop.getPopulationSeasonInfo()) {
+ info.getMigrationEquation();
+ info.getEmigrationEquation();
+ info.getImmigrationEquation();
+ }
+ }
+ }
+
+ */
+
+ static public void check(Equation eq, CheckResult result) {
+ if (0 != EvaluatorHelper.check(eq.getJavaInterface(), eq.getContent(), null)) {
+ result.addError(eq, _("isisfish.error.invalid.equation"));
+ }
+ }
+
+ static public void check(TargetSpecies capturabilite, CheckResult result){
+ check(capturabilite.getTargetFactorEquation(), result);
+ }
+
+ static public void check(PopulationGroup classPop, CheckResult result){
+ // error
+ if(classPop.getMeanWeight() < 0){
+ result.addError(classPop, _("isisfish.error.invalid.mean.weight"));
+ }
+ // if(classPop.getMortaliteNaturelle() < 0){
+ // result.addError(classPop, _("isisfish.error.invalidate.natural.death"));
+ // }
+
+ // warning
+ if(classPop.getMeanWeight() == 0){
+ result.addWarning(classPop, _("isisfish.error.not.null.mean.weight"));
+ }
+ // if(classPop.getMortaliteNaturelle() == 0){
+ // result.addWarning(classPop, _("isisfish.error.not.null.natiral.death"));
+ // }
+ }
+
+ static public void check(Gear engin, CheckResult result){
+ if("".equals(engin.getName())){
+ result.addWarning(engin, _("isisfish.error.empty.name"));
+ }
+ if("".equals(engin.getEffortUnit())){
+ result.addWarning(engin, _("isisfish.error.empty.unit"));
+ }
+
+ Collection<Selectivity> selectivites = engin.getPopulationSelectivity();
+ if(selectivites.size() == 0){
+ result.addWarning(engin, _("isisfish.error.empty.selectivity"));
+ }else{
+ for(Selectivity selectivity : selectivites){
+ check(selectivity, result);
+ }
+ }
+ if(engin.getPossibleValue() == null){
+ result.addWarning(engin, _("isisfish.error.invalid.range"));
+ }
+
+ if("".equals(engin.getParameterName())){
+ result.addInfo(engin, _("isisfish.error.empty.params.name"));
+ }
+ }
+
+ static public void check(MetierSeasonInfo infoSaisonMetier, CheckResult result){
+ if(infoSaisonMetier.getZone() == null || infoSaisonMetier.getZone().size() == 0){
+ result.addWarning(infoSaisonMetier, _("isisfish.error.no.sector"));
+ }
+ Collection<TargetSpecies> especeCaptus = infoSaisonMetier.getSpeciesTargetSpecies();
+ if(especeCaptus.size() == 0){
+ result.addInfo(infoSaisonMetier, _("isisfish.error.empty.species"));
+ }else{
+ for(TargetSpecies i : especeCaptus){
+ check(i, result);
+ }
+ }
+ }
+
+ static public boolean isEmptyMatrix(MatrixND mat) {
+ boolean result = true;
+ for (MatrixIterator i = mat.iterator(); result && i.next();) {
+ result = false;
+ }
+ return result;
+ }
+
+ static public boolean isNullMatrix(MatrixND mat) {
+ boolean result = true;
+ if (mat != null) {
+ for (MatrixIterator i = mat.iterator(); result && i.next();) {
+ result = i.getValue() == 0;
+ }
+ }
+ return result;
+ }
+
+ static public boolean isNegativeMatrix(MatrixND mat) {
+ boolean result = true;
+ for (MatrixIterator i = mat.iterator(); result && i.next();) {
+ result = i.getValue() < 0;
+ }
+ return result;
+ }
+
+ static public double sumMatrix(MatrixND mat) {
+ double result = 0;
+ for (MatrixIterator i = mat.iterator(); i.next();) {
+ result += i.getValue();
+ }
+ return result;
+ }
+
+ static public void check(PopulationSeasonInfo infoSaisonPop, CheckResult result){
+ if (infoSaisonPop.getUseEquationMigration()) {
+ check(infoSaisonPop.getMigrationEquation(), result);
+ check(infoSaisonPop.getEmigrationEquation(), result);
+ check(infoSaisonPop.getImmigrationEquation(), result);
+ } else {
+ if (isEmptyMatrix(infoSaisonPop.getMigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.migration"));
+ } else if(isNullMatrix(infoSaisonPop.getMigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.migration"));
+ } else if(isNegativeMatrix(infoSaisonPop.getMigrationMatrix())) {
+ result.addError(infoSaisonPop, _("isisfish.error.migration.negative"));
+ }
+
+
+ if (isEmptyMatrix(infoSaisonPop.getEmigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.emigration"));
+ } else if(isNullMatrix(infoSaisonPop.getEmigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.emigration"));
+ } else if(isNegativeMatrix(infoSaisonPop.getEmigrationMatrix())) {
+ result.addError(infoSaisonPop, _("isisfish.error.emigration.negative"));
+ }
+
+ if (isEmptyMatrix(infoSaisonPop.getImmigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.immigration"));
+ } else if(isNullMatrix(infoSaisonPop.getImmigrationMatrix())) {
+ result.addInfo(infoSaisonPop, _("isisfish.error.empty.immigration"));
+ } else if(isNegativeMatrix(infoSaisonPop.getImmigrationMatrix())) {
+ result.addError(infoSaisonPop, _("isisfish.error.immigration.negative"));
+ }
+ }
+ }
+
+ static public void check(Cell maille, CheckResult result){
+ if("".equals(maille.getName())){
+ result.addWarning(maille, _("isisfish.error.empty.name"));
+ }
+ }
+
+ static public void check(Species metaPop, CheckResult result){
+ Collection<Population> pops = metaPop.getPopulation();
+ if(pops.size() == 0){
+ result.addWarning(metaPop, _("isisfish.error.empty.population"));
+ }else{
+ for(Population pop : pops){
+ check(pop, result);
+ }
+ }
+ if("".equals(metaPop.getName())){
+ result.addInfo(metaPop, _("isisfish.error.empty.species.name"));
+ }
+ if("".equals(metaPop.getScientificName())){
+ result.addInfo(metaPop, _("isisfish.error.empty.scientific.name"));
+ }
+ if("".equals(metaPop.getCodeRubbin())){
+ result.addInfo(metaPop, _("isisfish.error.empty.code.rubbin"));
+ }
+ }
+
+ static public void check(Metier metier, CheckResult result){
+ if("".equals(metier.getName())){
+ result.addWarning(metier, _("isisfish.error.empty.name"));
+ }
+ List<MetierSeasonInfo> infoSaisons = metier.getMetierSeasonInfo();
+ if(infoSaisons.size() == 0){
+ result.addWarning(metier, _("isisfish.error.empty.season"));
+ }else{
+ Set<Month> months = new HashSet<Month>();
+ for(MetierSeasonInfo info : infoSaisons){
+ if (!Collections.disjoint(months, info.getMonths())) {
+ result.addError(info, _("isisfish.error.overlap.season"));
+ }
+ months.addAll(info.getMonths());
+ check(info, result);
+ }
+ }
+ if(metier.getGear() == null){
+ result.addError(metier, _("isisfish.error.undefined.gear"));
+ }else{
+ check(metier.getGear(), result);
+ }
+
+ if (!metier.getGear().getPossibleValue().contains(metier.getGearParameterValue())) {
+ result.addWarning(metier, _("isisfish.error.invalid.values.params"));
+ }
+
+ }
+
+ static public void check(Population pop, CheckResult result){
+ if("".equals(pop.getName())){
+ result.addWarning(pop, _("isisfish.error.empty.name"));
+ }
+ if("".equals(pop.getGeographicId())){
+ result.addInfo(pop, _("isisfish.error.empty.id.geographic"));
+ }
+ if(pop.getMaturityGroup() == null){
+ result.addInfo(pop, _("isisfish.error.not.null.class.grown"));
+ }
+ check(pop.getGrowth(), result);
+ check(pop.getGrowthReverse(), result);
+ List<PopulationGroup> classes = pop.getPopulationGroup();
+ if(classes.size() == 0){
+ result.addWarning(pop, _("isisfish.error.undefined.classes"));
+ }else{
+ for(PopulationGroup group : classes){
+ check(group, result);
+ }
+ }
+ // if(pop.getMortNatClasseNaissance() == 0){
+ // result.addInfo(pop, _("isisfish.error.undefined.natural.death"));
+ // }
+ // if(pop.getMortNatClasseNaissance() < 0){
+ // result.addWarning(pop, _("isisfish.error.invalid.natural.death"));
+ // }
+ if(pop.getMonthGapBetweenReproRecrutement() < 0){
+ result.addWarning(pop, _("isisfish.error.invalid.interval.reproduction.recruitment"));
+ }
+ if (isNullMatrix(pop.getMappingZoneReproZoneRecru())) {
+ result.addWarning(pop, _("isisfish.error.undefined.correspondence.zones.reproduction.recruitment"));
+ }
+ if(pop.getPopulationZone() == null || pop.getPopulationZone().size() == 0){
+ result.addWarning(pop, _("isisfish.error.undefined.zone.population"));
+ }
+ if(pop.getRecruitmentZone() == null || pop.getRecruitmentZone().size() == 0){
+ result.addWarning(pop, _("isisfish.error.undefined.zone.recruitment"));
+ }
+ if(pop.getReproductionZone() == null || pop.getReproductionZone().size() == 0){
+ result.addWarning(pop, _("isisfish.error.undefined.zone.reproduction"));
+ }
+ List<PopulationSeasonInfo> infoSaisons = pop.getPopulationSeasonInfo();
+ if(infoSaisons.size() == 0){
+ result.addWarning(pop, _("isisfish.error.empty.season"));
+ }else{
+ Set<Month> months = new HashSet<Month>();
+ for(PopulationSeasonInfo info : infoSaisons){
+ if (!Collections.disjoint(months, info.getMonths())) {
+ result.addError(info, _("isisfish.error.overlap.season"));
+ }
+ months.addAll(info.getMonths());
+ check(info, result);
+ }
+ }
+ check(pop.getPrice(), result);
+ check(pop.getMeanWeight(), result);
+ check(pop.getReproductionEquation(), result);
+ check(pop.getNaturalDeathRate(), result);
+
+ if (sumMatrix(pop.getRecruitmentDistribution()) != 1) {
+ result.addWarning(pop, _("isisfish.error.invalid.distribution.recruitment"));
+ }
+ }
+
+ static public void check(FisheryRegion region, CheckResult result){
+ if("".equals(region.getName())){
+ result.addWarning(region, _("isisfish.error.empty.name"));
+ }
+
+ List<Zone> secteurs = region.getZone();;
+ if(secteurs.size() == 0){
+ result.addWarning(region, _("isisfish.error.undefined.sector"));
+ }else{
+ for(Zone zone : secteurs){
+ check(zone, result);
+ }
+ }
+ List<Cell> mailles = region.getCell();
+ if(mailles.size() == 0){
+ result.addWarning(region, _("isisfish.error.undefined.mesh"));
+ }else{
+ for(Cell cell : mailles){
+ check(cell, result);
+ }
+ }
+ List<Species> metaPops = region.getSpecies();
+ if(metaPops.size() == 0){
+ result.addWarning(region, _("isisfish.error.undefined.meta.population"));
+ }else{
+ for(Species species : metaPops){
+ check(species, result);
+ }
+ }
+ List<Metier> metiers = region.getMetier();
+ if(metiers.size() == 0){
+ result.addWarning(region, _("isisfish.error.undefined.meta.population"));
+ }else{
+ for(Metier metier : metiers){
+ check(metier, result);
+ }
+ }
+ List<Strategy> strategies = region.getStrategy();
+ if(strategies.size() == 0){
+ result.addWarning(region, _("isisfish.error.undefined.stategy"));
+ }else{
+ for(Strategy strategy : strategies){
+ check(strategy, result);
+ }
+ }
+ }
+
+ static public void check(Zone secteur, CheckResult result){
+ if("".equals(secteur.getName())){
+ result.addWarning(secteur, _("isisfish.error.empty.name"));
+ }
+ if(secteur.getCell().size() == 0){
+ result.addWarning(secteur, _("isisfish.error.undefined.mesh.sector"));
+ }
+ }
+
+ static public void check(Selectivity selectivite, CheckResult result){
+
+ }
+
+
+ static public void check(Strategy strategy, CheckResult result){
+ if("".equals(strategy.getName())){
+ result.addWarning(strategy, _("isisfish.error.empty.name"));
+ }
+ check(strategy.getSetOfVessels(), result);
+
+ List<StrategyMonthInfo> smi = strategy.getStrategyMonthInfo();
+ if(smi.size() != 12){
+ result.addWarning(strategy, _("isisfish.error.undefined.stategy.months"));
+ }else{
+ for(StrategyMonthInfo info : smi){
+ check(info, result);
+ }
+ }
+
+ }
+
+ static public void check(SetOfVessels sov, CheckResult result){
+ check(sov.getPort(), result);
+ if(sov.getNumberOfVessels() < 0){
+ result.addWarning(sov, _("isisfish.error.invalid.number"));
+ }
+ if(sov.getFixedCosts() < 0){
+ result.addWarning(sov, _("isisfish.error.invalid.costs.fix"));
+ }
+ Collection<EffortDescription> efforts = sov.getPossibleMetiers();
+ if(efforts.size() == 0){
+ result.addWarning(sov, _("isisfish.error.not.possible.metier"));
+ }else{
+ for(EffortDescription effort : efforts) {
+ check(effort, result);
+ }
+ }
+ }
+
+ // TODO check for VesselType, TripType, Port, StrategyMonthInfo
+ static public void check(EffortDescription effort, CheckResult result){
+
+ }
+ static public void check(StrategyMonthInfo smi, CheckResult result){
+
+ }
+ static public void check(VesselType vesselType, CheckResult result){
+
+ }
+ static public void check(TripType tripType, CheckResult result){
+
+ }
+ static public void check(Port port, CheckResult result){
+
+ }
+
+
+
+ } // CheckSaisie
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,62 +0,0 @@
-<JDialog modal="true" resizable='false' title='isisfish.script.export'>
- <script>
- // FIXME a refaire
-
-// public org.codelutin.vcs.ui.FieldModelUtil.ModuleFile model;
- public Object model = null;
- public boolean isOkEnabled() {
- return !isEmpty(); // && model.getSelected(0).size() > 0;
- }
- public boolean isEmpty() {
- return model == null; // || model.getRowCount() == 0;
- }
-
- public void doCheckAll() {
-// if (model!=null) model.checkAll();
- doRefresh();
- }
-
- public void doRefresh() {
- fr.ifremer.isisfish.ui.util.JaxxUtil.refresh(this,"items.enabled",
- "checkAll.enabled","ok.enabled","chooseDir.enabled",
- "archivePath.enabled");
- }
-
- </script>
- <Table anchor='center'>
- <row weighty="2">
- <cell columns='2' fill='both'>
- <JScrollPane id='table'>
- <JTable id="items" autoResizeMode='3'
- enabled='{!isEmpty()}' onMouseClicked="doRefresh()"/>
- </JScrollPane>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell weightx="1" fill='both'>
- <JTextField id='archivePath' font-size='11' columns='30' height='25' enabled='{!isEmpty()}'/>
- </cell>
- <cell fill='both'>
- <JButton id='chooseDir'
- text='isisfish.script.export.chooseDir'
- toolTipText='isisfish.script.export.tooltip.chooseDir'
- enabled='{!isEmpty()}'
- onActionPerformed="fr.ifremer.isisfish.ui.UIHelper.openDirChooser(archivePath,ok)"/>
- </cell>
- </row>
- <row fill='horizontal'>
- <cell columns="2" fill='both'>
- <JPanel layout='{new GridLayout(0, 3, 2, 2)}'>
- <JCheckBox id='checkAll'
- text='isisfish.script.export.checkAll'
- toolTipText='isisfish.script.export.tooltip.checkAll'
- enabled='{!isEmpty()}'
- onActionPerformed="doCheckAll()" />
- <JButton id='ok' text='isisfish.script.export.ok'
- enabled='{isOkEnabled()}'/>
- <JButton id='cancel' text='isisfish.script.export.cancel'/>
- </JPanel>
- </cell>
- </row>
- </Table>
-</JDialog>
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx (from rev 2089, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/script/ExportDialogUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,63 @@
+<JDialog modal="true" resizable='false' title='isisfish.script.export'>
+ <script>
+ // FIXME a refaire
+
+// public org.codelutin.vcs.ui.FieldModelUtil.ModuleFile model;
+ public Object model = null;
+ public boolean isOkEnabled() {
+ return !isEmpty(); // && model.getSelected(0).size() > 0;
+ }
+ public boolean isEmpty() {
+ return model == null; // || model.getRowCount() == 0;
+ }
+
+ public void doCheckAll() {
+// if (model!=null) model.checkAll();
+ doRefresh();
+ }
+
+ public void doRefresh() {
+ fr.ifremer.isisfish.ui.util.JaxxUtil.refresh(this,"items.enabled",
+ "checkAll.enabled","ok.enabled","chooseDir.enabled",
+ "archivePath.enabled");
+ }
+
+ </script>
+ <Table anchor='center'>
+ <row weighty="2">
+ <cell columns='2' fill='both'>
+ <JScrollPane id='table'>
+ <JTable id="items" autoResizeMode='3'
+ enabled='{!isEmpty()}' onMouseClicked="doRefresh()"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell weightx="1" fill='both'>
+ <JTextField id='archivePath' font-size='11' columns='30' height='25' enabled='{!isEmpty()}'/>
+ </cell>
+ <cell fill='both'>
+ <JButton id='chooseDir'
+ text='isisfish.script.export.chooseDir'
+ toolTipText='isisfish.script.export.tooltip.chooseDir'
+ enabled='{!isEmpty()}'
+ />
+ <!-- onActionPerformed="fr.ifremer.isisfish.ui.UIHelper.openDirChooser(archivePath,ok)" -->
+ </cell>
+ </row>
+ <row fill='horizontal'>
+ <cell columns="2" fill='both'>
+ <JPanel layout='{new GridLayout(0, 3, 2, 2)}'>
+ <JCheckBox id='checkAll'
+ text='isisfish.script.export.checkAll'
+ toolTipText='isisfish.script.export.tooltip.checkAll'
+ enabled='{!isEmpty()}'
+ onActionPerformed="doCheckAll()" />
+ <JButton id='ok' text='isisfish.script.export.ok'
+ enabled='{isOkEnabled()}'/>
+ <JButton id='cancel' text='isisfish.script.export.cancel'/>
+ </JPanel>
+ </cell>
+ </row>
+ </Table>
+</JDialog>
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,267 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * 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.
- *##%*/
-
-/* *
- * 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 $
- */
- -->
-<ContinuousPanelContainer>
-
- <!-- bean property -->
- <fr.ifremer.isisfish.entities.Formule id='formule' javaBean='null'/>
- <String id='lblText' javaBean='null'/>
- <org.codelutin.topia.persistence.TopiaEntity id='bean' javaBean='null'/>
- <Class id='clazz' javaBean='null'/>
- <String id='methodGet' javaBean='null'/>
- <String id='methodSet' javaBean='null'/>
- <String id='nameEquation' javaBean='null'/>
- <fr.ifremer.isisfish.entities.Equation id='selectedEquation' javaBean='null'/>
-
- <script><![CDATA[
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.DefaultTableModel;
-import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableModel;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.apache.commons.lang.StringUtils;
-
-protected String[] columnNames = {"Name", "Value", "Coef", "Operator", "Action"};
-protected java.util.List<EquationContinuousDomain> datas = new ArrayList<EquationContinuousDomain>();
-protected java.util.List<JComboBox> operateurs = new ArrayList<JComboBox>();
-protected java.util.List<JButton> actions = new ArrayList<JButton>();
-
-public java.util.List<EquationContinuousDomain> getDomains(){
- return datas;
-}
-public void setDomains(java.util.List<EquationContinuousDomain> domains){
- datas.clear();
- for (EquationContinuousDomain d : domains){
- addDomain(d);
- }
-}
-public void addDomain(EquationContinuousDomain domain){
- newButton();
- datas.add(domain);
-}
-protected AbstractTableModel getTableModel(){
- AbstractTableModel model = new AbstractTableModel() {
-
- @Override
- public int getRowCount() {
- return datas.size();
- }
-
- @Override
- public int getColumnCount() {
- return columnNames.length;
- }
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return true;
- }
- @Override
- public Object getValueAt(int rowIndex, int columnIndex) {
- if (columnIndex == 0){
- return datas.get(rowIndex).getVariableName();
- } else if (columnIndex == 1){
- return datas.get(rowIndex).getReferenceValue();
- } else if (columnIndex == 2){
- return datas.get(rowIndex).getCoefficient();
- } else if (columnIndex == 3){
- return datas.get(rowIndex).getOperator();
- } else if (columnIndex == 4){
- return _("isisfish.factor.validDiscretNumber");
- }
- return null;
- }
-
- @Override
- public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
- if (String.class.isInstance(aValue)){
- if (!((String)aValue).equals("")){
- if (columnIndex == 0){
- datas.get(rowIndex).setVariableName((String)aValue);
- } else if (columnIndex == 1){
- datas.get(rowIndex).setReferenceValue(Double.parseDouble((String)aValue));
- } else if (columnIndex == 2){
- datas.get(rowIndex).setCoefficient(Double.parseDouble((String)aValue));
- } else if (columnIndex == 3){
- datas.get(rowIndex).setOperator((String)aValue);
- }
- }
- }
- }
-
- @Override
- public String getColumnName(int col) {
- return columnNames[col].toString();
- }
-
- };
- return model;
-}
-protected JComboBox getOperateur(){
- JComboBox result = new JComboBox();
- result.addItem("+");
- result.addItem("-");
- result.addItem("*");
- result.addItem("/");
- operateurs.add(result);
- result.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- JComboBox source = (JComboBox)e.getSource();
- int i = operateurs.indexOf(source);
- if (datas.size() <= i){
- datas.get(i).setOperator((String)source.getSelectedItem());
- }
- }
- });
- return result;
-}
-protected void newButton(){
- JButton result = new JButton();
- result.setText(_("isisfish.factor.validDiscretNumber"));
- actions.add(result);
- result.addActionListener(new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- JButton source = (JButton)e.getSource();
- int i = actions.indexOf(source);
- valid(i);
- }
- });
-}
-protected JButton getActionButton(int i){
- return actions.get(i);
-}
-protected void valid(int i) {
- String variableName = datas.get(i).getVariableName();
- String[] lines = editor.getEditor().getText().split("\n");
- String result = "";
- for (String line : lines) {
- Pattern p = Pattern.compile("(^.*\\s+" + variableName + "\\s*\\=\\s*)([\\d\\.]+).*\\;$");
- Matcher matcher = p.matcher(line);
- if (matcher.find()) {
- String fullVariableName = bean.toString() + "." + StringUtils.uncapitalize(methodGet) + "." + variableName;
- line = matcher.group(1) + "context.getValueAndCompute(\"" + fullVariableName + "\", " + matcher.group(2) + ");";
- }
- result += line + "\n";
- }
- editor.getEditor().setText(result);
-}
-protected void setTable(){
- params.setModel(getTableModel());
- params.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(getOperateur()));
- params.getColumnModel().getColumn(4).setCellEditor(new TableCellEditor() {
-
- @Override
- public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
- return getActionButton(row);
- }
-
- @Override
- public Object getCellEditorValue() {
- return null;
- }
-
- @Override
- public boolean isCellEditable(EventObject anEvent) {
- return true;
- }
-
- @Override
- public boolean shouldSelectCell(EventObject anEvent) {
- return true;
- }
-
- @Override
- public boolean stopCellEditing() {
- return true;
- }
-
- @Override
- public void cancelCellEditing() {
- }
-
- @Override
- public void addCellEditorListener(CellEditorListener l) {
- }
-
- @Override
- public void removeCellEditorListener(CellEditorListener l) {
- }
- });
-}
-protected void add(){
- datas.add(new EquationContinuousDomain());
- newButton();
- setTable();
-}
-protected void remove(){
- int i = params.getSelectedRow();
- if (i != -1){
- datas.remove(i);
- operateurs.remove(i);
- actions.remove(i);
- setTable();
- }
-}
- ]]>
- </script>
- <Table id='content' constraints='BorderLayout.CENTER'>
- <row>
- <cell fill='both' columns='2' weightx='1' weighty='0.5'>
- <JScrollPane>
- <JTable id='params' visible='{isContinuePossible()}' model='{getTableModel()}' enabled='{isContinueSelected()}'/>
- </JScrollPane>
- </cell>
- </row>
- <row>
- <cell fill='horizontal' weightx='0.5'>
- <JButton id='add' text='isisfish.common.add' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='add()'/>
- </cell>
- <cell fill='horizontal' weightx='0.5'>
- <JButton id='remove' text='isisfish.common.remove' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='remove()'/>
- </cell>
- </row>
- <row>
- <cell fill='both' columns='2' weightx='1' weighty='0.5'>
- <fr.ifremer.isisfish.ui.input.InputOneEquationUI id='editor' formule='{getFormule()}' lblText='{getLblText()}'
- constructorParams='this' bean='{getBean()}' clazz='{getClazz()}' methodGet='{getMethodGet()}' actif='{isContinueSelected()}'
- methodSet='{getMethodSet()}' nameEquation='{getNameEquation()}' selectedEquation='{getSelectedEquation()}'
- visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
- </cell>
- </row>
- </Table>
-</ContinuousPanelContainer>
\ No newline at end of file
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx (from rev 2074, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanel.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,267 @@
+<!--
+/* *##%
+ * Copyright (C) 2005
+ * 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.
+ *##%*/
+
+/* *
+ * 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 $
+ */
+ -->
+<ContinuousPanelContainer>
+
+ <!-- bean property -->
+ <fr.ifremer.isisfish.entities.Formule id='formule' javaBean='null'/>
+ <String id='lblText' javaBean='null'/>
+ <org.codelutin.topia.persistence.TopiaEntity id='bean' javaBean='null'/>
+ <Class id='clazz' javaBean='null'/>
+ <String id='methodGet' javaBean='null'/>
+ <String id='methodSet' javaBean='null'/>
+ <String id='nameEquation' javaBean='null'/>
+ <fr.ifremer.isisfish.entities.Equation id='selectedEquation' javaBean='null'/>
+
+ <script><![CDATA[
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableModel;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableModel;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.commons.lang.StringUtils;
+
+protected String[] columnNames = {"Name", "Value", "Coef (in %)", "Operator", "Action"};
+protected java.util.List<EquationContinuousDomain> datas = new ArrayList<EquationContinuousDomain>();
+protected java.util.List<JComboBox> operateurs = new ArrayList<JComboBox>();
+protected java.util.List<JButton> actions = new ArrayList<JButton>();
+
+public java.util.List<EquationContinuousDomain> getDomains(){
+ return datas;
+}
+public void setDomains(java.util.List<EquationContinuousDomain> domains){
+ datas.clear();
+ for (EquationContinuousDomain d : domains){
+ addDomain(d);
+ }
+}
+public void addDomain(EquationContinuousDomain domain){
+ newButton();
+ datas.add(domain);
+}
+protected AbstractTableModel getTableModel(){
+ AbstractTableModel model = new AbstractTableModel() {
+
+ @Override
+ public int getRowCount() {
+ return datas.size();
+ }
+
+ @Override
+ public int getColumnCount() {
+ return columnNames.length;
+ }
+
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return true;
+ }
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ if (columnIndex == 0){
+ return datas.get(rowIndex).getVariableName();
+ } else if (columnIndex == 1){
+ return datas.get(rowIndex).getReferenceValue();
+ } else if (columnIndex == 2){
+ return datas.get(rowIndex).getCoefficient() == null ? 100 : datas.get(rowIndex).getCoefficient() * 100;
+ } else if (columnIndex == 3){
+ return datas.get(rowIndex).getOperator();
+ } else if (columnIndex == 4){
+ return _("isisfish.factor.validDiscretNumber");
+ }
+ return null;
+ }
+
+ @Override
+ public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ if (String.class.isInstance(aValue)){
+ if (!((String)aValue).equals("")){
+ if (columnIndex == 0){
+ datas.get(rowIndex).setVariableName((String)aValue);
+ } else if (columnIndex == 1){
+ datas.get(rowIndex).setReferenceValue(Double.parseDouble((String)aValue));
+ } else if (columnIndex == 2){
+ datas.get(rowIndex).setCoefficient(Double.parseDouble((String)aValue) / 100);
+ } else if (columnIndex == 3){
+ datas.get(rowIndex).setOperator((String)aValue);
+ }
+ }
+ }
+ }
+
+ @Override
+ public String getColumnName(int col) {
+ return columnNames[col].toString();
+ }
+
+ };
+ return model;
+}
+protected JComboBox getOperateur(){
+ JComboBox result = new JComboBox();
+ result.addItem("+");
+ result.addItem("-");
+ result.addItem("*");
+ result.addItem("/");
+ operateurs.add(result);
+ result.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JComboBox source = (JComboBox)e.getSource();
+ int i = operateurs.indexOf(source);
+ if (datas.size() <= i){
+ datas.get(i).setOperator((String)source.getSelectedItem());
+ }
+ }
+ });
+ return result;
+}
+protected void newButton(){
+ JButton result = new JButton();
+ result.setText(_("isisfish.factor.validDiscretNumber"));
+ actions.add(result);
+ result.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ JButton source = (JButton)e.getSource();
+ int i = actions.indexOf(source);
+ valid(i);
+ }
+ });
+}
+protected JButton getActionButton(int i){
+ return actions.get(i);
+}
+protected void valid(int i) {
+ String variableName = datas.get(i).getVariableName();
+ String[] lines = editor.getEditor().getText().split("\n");
+ String result = "";
+ for (String line : lines) {
+ Pattern p = Pattern.compile("(^.*\\s+" + variableName + "\\s*\\=\\s*)([\\d\\.]+).*\\;$");
+ Matcher matcher = p.matcher(line);
+ if (matcher.find()) {
+ String fullVariableName = bean.toString() + "." + StringUtils.uncapitalize(methodGet) + "." + variableName;
+ line = matcher.group(1) + "context.getValueAndCompute(\"" + fullVariableName + "\", " + matcher.group(2) + ");";
+ }
+ result += line + "\n";
+ }
+ editor.getEditor().setText(result);
+}
+protected void setTable(){
+ params.setModel(getTableModel());
+ params.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(getOperateur()));
+ params.getColumnModel().getColumn(4).setCellEditor(new TableCellEditor() {
+
+ @Override
+ public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+ return getActionButton(row);
+ }
+
+ @Override
+ public Object getCellEditorValue() {
+ return null;
+ }
+
+ @Override
+ public boolean isCellEditable(EventObject anEvent) {
+ return true;
+ }
+
+ @Override
+ public boolean shouldSelectCell(EventObject anEvent) {
+ return true;
+ }
+
+ @Override
+ public boolean stopCellEditing() {
+ return true;
+ }
+
+ @Override
+ public void cancelCellEditing() {
+ }
+
+ @Override
+ public void addCellEditorListener(CellEditorListener l) {
+ }
+
+ @Override
+ public void removeCellEditorListener(CellEditorListener l) {
+ }
+ });
+}
+protected void add(){
+ datas.add(new EquationContinuousDomain());
+ newButton();
+ setTable();
+}
+protected void remove(){
+ int i = params.getSelectedRow();
+ if (i != -1){
+ datas.remove(i);
+ operateurs.remove(i);
+ actions.remove(i);
+ setTable();
+ }
+}
+ ]]>
+ </script>
+ <Table id='content' constraints='BorderLayout.CENTER'>
+ <row>
+ <cell fill='both' columns='2' weightx='1' weighty='0.5'>
+ <JScrollPane>
+ <JTable id='params' visible='{isContinuePossible()}' model='{getTableModel()}' enabled='{isContinueSelected()}'/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id='add' text='isisfish.common.add' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='add()'/>
+ </cell>
+ <cell fill='horizontal' weightx='0.5'>
+ <JButton id='remove' text='isisfish.common.remove' visible='{isContinuePossible()}' enabled='{isContinueSelected()}' onActionPerformed='remove()'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill='both' columns='2' weightx='1' weighty='0.5'>
+ <fr.ifremer.isisfish.ui.input.InputOneEquationUI id='editor' formule='{getFormule()}' lblText='{getLblText()}'
+ constructorParams='this' bean='{getBean()}' clazz='{getClazz()}' methodGet='{getMethodGet()}' actif='{isContinueSelected()}'
+ methodSet='{getMethodSet()}' nameEquation='{getNameEquation()}' selectedEquation='{getSelectedEquation()}'
+ visible='{isContinuePossible()}' enabled='{isContinueSelected()}'/>
+ </cell>
+ </row>
+ </Table>
+</ContinuousPanelContainer>
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,105 +0,0 @@
-/* *##%
- * Copyright (C) 2009 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-package fr.ifremer.isisfish.ui.sensitivity;
-
-import static org.codelutin.i18n.I18n._;
-
-import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
-import fr.ifremer.isisfish.ui.simulator.SimulAction;
-import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JOptionPane;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixND;
-import org.codelutin.topia.persistence.TopiaEntity;
-
-/**
- *
- * @author letellier
- */
-public class FactorAction {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulAction.class);
-
- public static void saveContinue(JComponent cOrigine, String name, String comment, String path, ContinuousPanelContainer panel, SimulAction action, boolean exist){
- DefaultContinuousPanel defaultPanel = null;
- if (MatrixContinuousPanel.class.isInstance(panel)){
- MatrixContinuousPanel matrixPanel = (MatrixContinuousPanel)panel;
- Double coef = Double.valueOf(matrixPanel.getCoef().getText());
- MatrixND matrix = matrixPanel.getMatrix();
- String operateur = (String)matrixPanel.getOperator().getSelectedItem();
- action.addContinuousMatrixFactor(name, comment, path, coef, matrix, operateur, cOrigine, exist);
-
- } else if (EquationContinuousPanel.class.isInstance(panel)){
- try {
- EquationContinuousPanel equationPanel = (EquationContinuousPanel) panel;
-
- TopiaEntity bean = equationPanel.getBean();
- String methodSet = equationPanel.getMethodSet();
- Method m = bean.getClass().getMethod("set" + methodSet, String.class);
- m.invoke(bean, equationPanel.getEditor().getEditor().getText());
-
- // Save equation
- bean.update();
- bean.getTopiaContext().commitTransaction();
-
- List<EquationContinuousDomain> domains = equationPanel.getDomains();
- for (EquationContinuousDomain domain : domains) {
- if (domain.getCoefficient() != null && domain.getCoefficient() == 1){
- JOptionPane.showMessageDialog(equationPanel, _("isisfish.error.factor.coefValueIsOne"));
- }
- else if (domain.getReferenceValue() != null && domain.getCoefficient() != null && domain.getCoefficient() < 1 && domain.getCoefficient() > 0 && domain.getOperator() != null && domain.getVariableName() != null ){
- action.addContinuousEquationFactor(name, comment, path, domain, cOrigine, exist);
- }
- else {
- JOptionPane.showMessageDialog(equationPanel, _("isisfish.error.factor.invalid"));
- }
- }
- } catch (Exception ex) {
- if (log.isErrorEnabled()) {
- log.error("Can't call method : ", ex);
- }
- }
- } else if (DefaultContinuousPanel.class.isInstance(panel)){
- defaultPanel = (DefaultContinuousPanel)panel;
- action.addContinuousFactor(name, comment, path, getMin(defaultPanel), getMax(defaultPanel), cOrigine, exist);
- }
- }
- protected static Double getMin(DefaultContinuousPanel defaultPanel){
- return Double.parseDouble(defaultPanel.getMin());
- }
- protected static Double getMax(DefaultContinuousPanel defaultPanel){
- return Double.parseDouble(defaultPanel.getMax());
- }
- public static void saveDiscret(JComponent cOrigine, String name, String comment, String path, List<JComponent> components, SimulAction action, boolean exist){
- List<Serializable> values = new ArrayList<Serializable>();
- for(JComponent c: components){
- values.add((Serializable)EditorHelper.getValue(c));
- }
- action.addDiscreteFactor(name, comment, path, values, cOrigine, exist);
- }
-}
-;
\ No newline at end of file
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java (from rev 2074, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorAction.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,102 @@
+/* *##%
+ * Copyright (C) 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.ui.sensitivity;
+
+import static org.codelutin.i18n.I18n._;
+
+import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
+import fr.ifremer.isisfish.ui.simulator.SimulAction;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixND;
+import org.codelutin.topia.persistence.TopiaEntity;
+
+/**
+ *
+ * @author letellier
+ */
+public class FactorAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(SimulAction.class);
+
+ public static void saveContinue(JComponent cOrigine, String name, String comment, String path, ContinuousPanelContainer panel, SimulAction action, boolean exist){
+ DefaultContinuousPanel defaultPanel = null;
+ if (MatrixContinuousPanel.class.isInstance(panel)){
+ MatrixContinuousPanel matrixPanel = (MatrixContinuousPanel)panel;
+ Double coef = Double.valueOf(matrixPanel.getCoef().getText());
+ MatrixND matrix = matrixPanel.getMatrix();
+ String operateur = (String)matrixPanel.getOperator().getSelectedItem();
+ action.addContinuousMatrixFactor(name, comment, path, coef, matrix, operateur, cOrigine, exist);
+
+ } else if (EquationContinuousPanel.class.isInstance(panel)){
+ try {
+ EquationContinuousPanel equationPanel = (EquationContinuousPanel) panel;
+
+ TopiaEntity bean = equationPanel.getBean();
+ String methodSet = equationPanel.getMethodSet();
+ Method m = bean.getClass().getMethod("set" + methodSet, String.class);
+ m.invoke(bean, equationPanel.getEditor().getEditor().getText());
+
+ // Save equation
+ bean.update();
+ bean.getTopiaContext().commitTransaction();
+
+ List<EquationContinuousDomain> domains = equationPanel.getDomains();
+ for (EquationContinuousDomain domain : domains) {
+ if (domain.getReferenceValue() != null && domain.getCoefficient() != null && domain.getCoefficient() <= 100 && domain.getCoefficient() > 0 && domain.getOperator() != null && domain.getVariableName() != null ){
+ action.addContinuousEquationFactor(name, comment, path, domain, cOrigine, exist);
+ }
+ else {
+ JOptionPane.showMessageDialog(equationPanel, _("isisfish.error.factor.invalid") + domain.getVariableName());
+ }
+ }
+ } catch (Exception ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't call method : ", ex);
+ }
+ }
+ } else if (DefaultContinuousPanel.class.isInstance(panel)){
+ defaultPanel = (DefaultContinuousPanel)panel;
+ action.addContinuousFactor(name, comment, path, getMin(defaultPanel), getMax(defaultPanel), cOrigine, exist);
+ }
+ }
+ protected static Double getMin(DefaultContinuousPanel defaultPanel){
+ return Double.parseDouble(defaultPanel.getMin());
+ }
+ protected static Double getMax(DefaultContinuousPanel defaultPanel){
+ return Double.parseDouble(defaultPanel.getMax());
+ }
+ public static void saveDiscret(JComponent cOrigine, String name, String comment, String path, List<JComponent> components, SimulAction action, boolean exist){
+ List<Serializable> values = new ArrayList<Serializable>();
+ for(JComponent c: components){
+ values.add((Serializable)EditorHelper.getValue(c));
+ }
+ action.addDiscreteFactor(name, comment, path, values, cOrigine, exist);
+ }
+}
+;
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,118 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2009 Ifremer, Code Lutin
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * SensitivitySecondPassUI.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
- -->
-<Table>
-<script><![CDATA[
- import jaxx.runtime.swing.Item;
- import java.util.List;
- import java.util.ArrayList;
- import java.io.File;
- import org.codelutin.util.FileUtil;
- import fr.ifremer.isisfish.ui.simulator.SimulAction;
- import fr.ifremer.isisfish.datastore.SimulationStorage;
-
- /**
- * Model de contenu de la liste des nom de simulations
- */
- public ComboBoxModel getSensitivitySimulationModel() {
- List<String> asNames = new ArrayList<String>();
- for (String simulationName : SimulationStorage.getSimulationNames()) {
- if (simulationName.startsWith("as_")) {
- String masterSensitivityName = simulationName.substring(0, simulationName.lastIndexOf("_"));
- if (!asNames.contains(masterSensitivityName)) {
- asNames.add(masterSensitivityName);
- }
- }
- }
-
- List<Item> items = new ArrayList<Item>();
- items.add(new Item("null", " ", null, true));
- for (String asName : asNames) {
- items.add(new Item(asName, asName, asName, true));
- }
-
- fieldSensitivitySimulationSelect.setItems(items);
- return fieldSensitivitySimulationSelect.getModel();
- }
-
- protected SimulAction getSimulAction() {
- return getContextValue(SimulAction.class);
- }
-
- protected void launchSecondPass(ActionEvent event) {
- if (fieldSensitivitySimulationSelect.getSelectedIndex() != -1) {
- getSimulAction().runSensitivitySecondPass((String)fieldSensitivitySimulationSelect.getSelectedItem());
- displaySensitivitySecondPass(event);
- }
- }
-
- protected void displaySensitivitySecondPass(ActionEvent event) {
- if (fieldSensitivitySimulationSelect.getSelectedIndex() != -1) {
-
- try {
- List<File> files = getSimulAction().getSensitivitySecondPassResults((String)fieldSensitivitySimulationSelect.getSelectedItem());
-
- String content = "";
- for(File file : files) {
- content += "Fichier " + file.getName() + "\n";
- content += "------------------------------\n";
- content += FileUtil.readAsString(file) + "\n";
- content += "\n";
- }
- textAreaSensitivitySecondpassResult.setText(content);
- }
- catch(IOException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't run second pass", e);
- }
- }
- }
- }
-
- ]]>
- </script>
- <row>
- <cell fill="horizontal" weightx="1.0">
- <JComboBox id="fieldSensitivitySimulationSelect" model='{getSensitivitySimulationModel()}' />
- </cell>
- <cell fill="horizontal">
- <JButton id="runSecondPassButton" text='isisfish.sensitivity.secondpass' onActionPerformed='launchSecondPass(event)' enabled="{fieldSensitivitySimulationSelect.getSelectedItem() != null}" />
- </cell>
- <cell fill="horizontal">
- <JButton id="displaySecondPassButton" text='isisfish.sensitivity.displaysecondpass' onActionPerformed='displaySensitivitySecondPass(event)' enabled="{fieldSensitivitySimulationSelect.getSelectedItem() != null}" />
- </cell>
- </row>
- <row>
- <cell columns="3" fill="both" weightx="1.0" weighty="1.0">
- <JScrollPane>
- <JTextArea id='textAreaSensitivitySecondpassResult' text='' editable="false" />
- </JScrollPane>
- </cell>
- </row>
-</Table>
\ No newline at end of file
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx (from rev 2094, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,145 @@
+<!--
+/* *##%
+ * Copyright (C) 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/* *
+ * SensitivitySecondPassUI.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+ -->
+<Table>
+<script><![CDATA[
+ import jaxx.runtime.swing.Item;
+ import java.util.List;
+ import java.util.ArrayList;
+ import java.io.File;
+ import org.codelutin.util.FileUtil;
+ import fr.ifremer.isisfish.ui.simulator.SimulAction;
+ import fr.ifremer.isisfish.datastore.SimulationStorage;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationService;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener;
+
+ // declaration sépérée de la variable d'instance (jaxx)
+ SimulationServiceListener simulationListener;
+
+ // permet de rafaichir la liste les simulations
+ // des qu'une simulation se termine
+ simulationListener = new SimulationServiceListener() {
+ @Override
+ public void simulationStart(SimulationService simService, SimulationJob job) {
+ }
+
+ @Override
+ public void simulationStop(SimulationService simService, SimulationJob job) {
+ if (log.isDebugEnabled()) {
+ log.debug("Refresh second pass UI simulations list");
+ }
+ fieldSensitivitySimulationSelect.setModel(getSensitivitySimulationModel());
+ }
+
+ @Override
+ public void clearJobDone(SimulationService simService) {
+ }
+ }
+ SimulationService.getService().addSimulationServiceListener(simulationListener);
+
+ /**
+ * Model de contenu de la liste des nom de simulations
+ */
+ public ComboBoxModel getSensitivitySimulationModel() {
+ List<String> asNames = new ArrayList<String>();
+ for (String simulationName : SimulationStorage.getSimulationNames()) {
+ if (simulationName.startsWith("as_")) {
+ String masterSensitivityName = simulationName.substring(0, simulationName.lastIndexOf("_"));
+ if (!asNames.contains(masterSensitivityName)) {
+ asNames.add(masterSensitivityName);
+ }
+ }
+ }
+
+ List<Item> items = new ArrayList<Item>();
+ items.add(new Item("null", " ", null, true));
+ for (String asName : asNames) {
+ items.add(new Item(asName, asName, asName, true));
+ }
+
+ fieldSensitivitySimulationSelect.setItems(items);
+ return fieldSensitivitySimulationSelect.getModel();
+ }
+
+ protected SimulAction getSimulAction() {
+ return getContextValue(SimulAction.class);
+ }
+
+ protected void launchSecondPass(ActionEvent event) {
+ if (fieldSensitivitySimulationSelect.getSelectedIndex() != -1) {
+ getSimulAction().runSensitivitySecondPass((String)fieldSensitivitySimulationSelect.getSelectedItem());
+ displaySensitivitySecondPass(event);
+ }
+ }
+
+ protected void displaySensitivitySecondPass(ActionEvent event) {
+ if (fieldSensitivitySimulationSelect.getSelectedIndex() != -1) {
+
+ try {
+ List<File> files = getSimulAction().getSensitivitySecondPassResults((String)fieldSensitivitySimulationSelect.getSelectedItem());
+
+ String content = "";
+ for(File file : files) {
+ content += "Fichier " + file.getName() + "\n";
+ content += "------------------------------\n";
+ content += FileUtil.readAsString(file) + "\n";
+ content += "\n";
+ }
+ textAreaSensitivitySecondpassResult.setText(content);
+ }
+ catch(IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't run second pass", e);
+ }
+ }
+ }
+ }
+
+ ]]>
+ </script>
+ <row>
+ <cell fill="horizontal" weightx="1.0">
+ <JComboBox id="fieldSensitivitySimulationSelect" model='{getSensitivitySimulationModel()}' />
+ </cell>
+ <cell fill="horizontal">
+ <JButton id="runSecondPassButton" text='isisfish.sensitivity.secondpass' onActionPerformed='launchSecondPass(event)' enabled="{fieldSensitivitySimulationSelect.getSelectedItem() != null}" />
+ </cell>
+ <cell fill="horizontal">
+ <JButton id="displaySecondPassButton" text='isisfish.sensitivity.displaysecondpass' onActionPerformed='displaySensitivitySecondPass(event)' enabled="{fieldSensitivitySimulationSelect.getSelectedItem() != null}" />
+ </cell>
+ </row>
+ <row>
+ <cell columns="3" fill="both" weightx="1.0" weighty="1.0">
+ <JScrollPane>
+ <JTextArea id='textAreaSensitivitySecondpassResult' text='' editable="false" />
+ </JScrollPane>
+ </cell>
+ </row>
+</Table>
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,187 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * 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.
- *##%*/
-
-/* *
- * 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 $
- */
- -->
-
-<Table>
-<script><![CDATA[
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.table.DefaultTableModel;
- import javax.swing.table.TableModel;
- import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
- import javax.swing.table.TableColumn;
- import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer;
- import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
- import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
- import fr.ifremer.isisfish.simulator.AnalysePlan;
- import jaxx.runtime.swing.Item;
-
- public SensUI (SimulAction action){
-
- setContextValue(action);
- }
- public void refresh(){
- java.util.List<Item> items = new ArrayList<Item>();
- java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans();
-
- for (AnalysePlan ap : values){
- items.add(new Item(ap.toString(), fr.ifremer.isisfish.datastore.AnalysePlanStorage.getName(ap), ap, false));
- }
- listSimulParamsAnalysePlansList.setItems(items);
- listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
- setSimulParamsAnalysePlans();
- }
- public void addAnalysePlan(){
- getContextValue(SimulAction.class).addAnalysePlan(fieldSimulParamsAnalysePlansSelect.getSelectedItem().toString());
- setAnalysePlanButton();
- refresh();
- }
- public void removeAnalysePlan(){
- getContextValue(SimulAction.class).removeAnalysePlan((AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
- refresh();
- }
- public void clearAnalysePlan(){
- getContextValue(SimulAction.class).clearAnalysePlan();
- refresh();
- }
- protected void setAnalysePlanButton(){
- if (getContextValue(SimulAction.class).getParamAnalysePlans().toArray().length == 0){
- buttonSimulParamsAnalysePlansClear.setEnabled(false);
- buttonSimulParamsAnalysePlansRemove.setEnabled(false);
- }
- else{
- if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1){
- buttonSimulParamsAnalysePlansRemove.setEnabled(true);
- setSimulParamsAnalysePlans();
- }
- buttonSimulParamsAnalysePlansClear.setEnabled(true);
- }
- }
- protected void setSimulParamsAnalysePlans(){
- if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1){
- Map<String, Class> values = getContextValue(SimulAction.class).getAnalysePlanParameterName((AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
- int row = 0;
- if (values != null){
- DefaultTableModel model = new DefaultTableModel(){
- @Override
- public boolean isCellEditable(int row, int column) {
- boolean result = false;
- if (column > 0){
- result =true;
- }
- return result;
- }
- };
- java.util.List<GenericCell> valuesList = new ArrayList<GenericCell>();
- java.util.List<Object> propertyList = new ArrayList<Object>();
- for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
- String name = it.next();
- Object properties = getContextValue(SimulAction.class).getAnalysePlanParameterValue(name, (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
- GenericCell value = new GenericCell(name, values.get(name), null);
- valuesList.add(value);
- propertyList.add(properties);
- row++;
- }
- model.addColumn("Name", valuesList.toArray());
- model.addColumn("Value", propertyList.toArray());
- simulParamsAnalysePlans.setModel(model);
- ParameterColumnEditor cellEditor = new ParameterColumnEditor();
- cellEditor.setRegion(getContextValue(SimulAction.class).getRegionStorage());
- simulParamsAnalysePlans.getColumnModel().getColumn(1).setCellEditor(cellEditor);
- simulParamsAnalysePlans.getModel().addTableModelListener(new TableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- int row = e.getFirstRow();
- TableModel model = (TableModel)e.getSource();
- GenericCell data = (GenericCell) model.getValueAt(row, 0);
- getContextValue(SimulAction.class).setAnalysePlanParameterValue(data.getName(), (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue(), model.getValueAt(row, 1));
- }
- });
- simulParamsAnalysePlans.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createAnalysePlanParamsModel(listSimulParamsAnalysePlansList.getSelectedValue().toString())));
- }
- }
- }
- protected void backParameter(){
- SimulUI simul = getParentContainer(SimulUI.class);
- simul.selTab(0);
- }
- protected DefaultComboBoxModel getAnalysePlansSelectModel(){
- java.util.List values = getContextValue(SimulAction.class).getAnalysePlanNames();
- fieldSimulParamsAnalysePlansSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel(values)));
- return new DefaultComboBoxModel(values.toArray());
- }
- ]]>
- </script>
- <row>
- <cell columns="2" fill="horizontal" weightx="1.0">
- <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{getAnalysePlansSelectModel()}'/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="0.5">
- <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JList id="listSimulParamsAnalysePlansList" selectionMode="0" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getParamAnalysePlans().toArray())}' onValueChanged='setAnalysePlanButton()'/>
- </JScrollPane>
- </cell>
- <cell fill="both" weightx="0.5">
- <Table id="simulSens" name="isisfish.sens.title">
- <row>
- <cell fill="both" weightx="1.0">
- <JButton id="buttonSimulParamsAnalysePlansAdd" text="isisfish.common.add" onActionPerformed='addAnalysePlan()'/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1.0">
- <JButton id="buttonSimulParamsAnalysePlansRemove" text="isisfish.common.remove" onActionPerformed='removeAnalysePlan()' enabled='false'/>
- </cell>
- </row>
- <row>
- <cell fill="both" weightx="1.0">
- <JButton id="buttonSimulParamsAnalysePlansClear" text="isisfish.common.clear" onActionPerformed='clearAnalysePlan()' enabled='false'/>
- </cell>
- </row>
- </Table>
- </cell>
- </row>
- <row>
- <cell columns="2" fill="both" weightx="1.0" weighty="1.0">
- <JScrollPane>
- <JTable id="simulParamsAnalysePlans" rowHeight='24' name="isisfish.sens.planParameters"/>
- </JScrollPane>
- </cell>
- </row>
- <row>
- <cell columns="2" fill="horizontal" weightx="1.0">
- <JButton text="isisfish.sens.backParameter" onActionPerformed='backParameter()'/>
- </cell>
- </row>
-</Table>
-
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SensUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,194 @@
+<!--
+/* *##%
+ * 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.
+ *##%*/
+
+/* *
+ * SensUI.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 $
+ */
+ -->
+
+<Table>
+<script><![CDATA[
+ import javax.swing.DefaultComboBoxModel;
+ import javax.swing.table.DefaultTableModel;
+ import javax.swing.table.TableModel;
+ import fr.ifremer.isisfish.ui.widget.editor.ParameterColumnEditor;
+ import javax.swing.table.TableColumn;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipTableColumnRenderer;
+ import fr.ifremer.isisfish.ui.widget.renderer.SimpleToolTipComboBoxRenderer;
+ import fr.ifremer.isisfish.ui.widget.editor.GenericCell;
+ import fr.ifremer.isisfish.simulator.AnalysePlan;
+ import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+ import jaxx.runtime.swing.Item;
+
+ public SensUI (SimulAction action) {
+ setContextValue(action);
+ }
+
+ public void refresh() {
+ java.util.List<Item> items = new ArrayList<Item>();
+ java.util.List<AnalysePlan> values = getContextValue(SimulAction.class).getParamAnalysePlans();
+ for (AnalysePlan ap : values) {
+ items.add(new Item(ap.toString(), AnalysePlanStorage.getName(ap), ap, false));
+ }
+ listSimulParamsAnalysePlansList.setItems(items);
+ // Tooltip here break Name display
+ //listSimulParamsAnalysePlansList.setCellRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel2(values, buttonSimulParamsAnalysePlansClear, listSimulParamsAnalysePlansList)));
+ setSimulParamsAnalysePlans();
+ }
+
+ public void addAnalysePlan() {
+ getContextValue(SimulAction.class).addAnalysePlan(fieldSimulParamsAnalysePlansSelect.getSelectedItem().toString());
+ setAnalysePlanButton();
+ refresh();
+ }
+
+ public void removeAnalysePlan() {
+ getContextValue(SimulAction.class).removeAnalysePlan((AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
+ refresh();
+ }
+
+ public void clearAnalysePlan() {
+ getContextValue(SimulAction.class).clearAnalysePlan();
+ refresh();
+ }
+
+ protected void setAnalysePlanButton() {
+ if (getContextValue(SimulAction.class).getParamAnalysePlans().toArray().length == 0) {
+ buttonSimulParamsAnalysePlansClear.setEnabled(false);
+ buttonSimulParamsAnalysePlansRemove.setEnabled(false);
+ }
+ else {
+ if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1) {
+ buttonSimulParamsAnalysePlansRemove.setEnabled(true);
+ setSimulParamsAnalysePlans();
+ }
+ buttonSimulParamsAnalysePlansClear.setEnabled(true);
+ }
+ }
+
+ protected void setSimulParamsAnalysePlans() {
+ if (listSimulParamsAnalysePlansList.getSelectedIndex() != -1) {
+ AnalysePlan analysePlan = (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue();
+ Map<String, Class<?>> values = getContextValue(SimulAction.class).getAnalysePlanParameterName(analysePlan);
+ int row = 0;
+ if (values != null) {
+ DefaultTableModel model = new DefaultTableModel() {
+ @Override
+ public boolean isCellEditable(int row, int column) {
+ boolean result = false;
+ if (column > 0){
+ result =true;
+ }
+ return result;
+ }
+ };
+ java.util.List<GenericCell> valuesList = new ArrayList<GenericCell>();
+ java.util.List<Object> propertyList = new ArrayList<Object>();
+ for (Iterator<String> it = values.keySet().iterator(); it.hasNext();) {
+ String name = it.next();
+ Object properties = getContextValue(SimulAction.class).getAnalysePlanParameterValue(name, (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue());
+ GenericCell value = new GenericCell(name, values.get(name), null);
+ valuesList.add(value);
+ propertyList.add(properties);
+ row++;
+ }
+ model.addColumn(_("isisfish.common.name"), valuesList.toArray());
+ model.addColumn(_("isisfish.common.value"), propertyList.toArray());
+ simulParamsAnalysePlans.setModel(model);
+ ParameterColumnEditor cellEditor = new ParameterColumnEditor();
+ cellEditor.setRegion(getContextValue(SimulAction.class).getRegionStorage());
+ simulParamsAnalysePlans.getColumnModel().getColumn(1).setCellEditor(cellEditor);
+ simulParamsAnalysePlans.getModel().addTableModelListener(new TableModelListener() {
+ @Override
+ public void tableChanged(TableModelEvent e) {
+ int row = e.getFirstRow();
+ TableModel model = (TableModel)e.getSource();
+ GenericCell data = (GenericCell) model.getValueAt(row, 0);
+ getContextValue(SimulAction.class).setAnalysePlanParameterValue(data.getName(), (AnalysePlan)listSimulParamsAnalysePlansList.getSelectedValue(), model.getValueAt(row, 1));
+ }
+ });
+ simulParamsAnalysePlans.getColumnModel().getColumn(0).setCellRenderer(new SimpleToolTipTableColumnRenderer(ToolTipListModelFactory.createAnalysePlanParamsModel(AnalysePlanStorage.getName(analysePlan))));
+ }
+ }
+ }
+ protected void backParameter(){
+ SimulUI simul = getParentContainer(SimulUI.class);
+ simul.selTab(0);
+ }
+ protected DefaultComboBoxModel getAnalysePlansSelectModel(){
+ java.util.List values = getContextValue(SimulAction.class).getAnalysePlanNames();
+ fieldSimulParamsAnalysePlansSelect.setRenderer(new SimpleToolTipComboBoxRenderer(ToolTipListModelFactory.createAnalysePlanDescriptionsModel(values)));
+ return new DefaultComboBoxModel(values.toArray());
+ }
+ ]]>
+ </script>
+ <row>
+ <cell columns="2" fill="horizontal" weightx="1.0">
+ <JComboBox id="fieldSimulParamsAnalysePlansSelect" model='{getAnalysePlansSelectModel()}'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="0.5">
+ <JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
+ <JList id="listSimulParamsAnalysePlansList" selectionMode="0" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getParamAnalysePlans().toArray())}' onValueChanged='setAnalysePlanButton()'/>
+ </JScrollPane>
+ </cell>
+ <cell fill="both" weightx="0.5">
+ <Table id="simulSens" name="isisfish.sens.title">
+ <row>
+ <cell fill="both" weightx="1.0">
+ <JButton id="buttonSimulParamsAnalysePlansAdd" text="isisfish.common.add" onActionPerformed='addAnalysePlan()'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1.0">
+ <JButton id="buttonSimulParamsAnalysePlansRemove" text="isisfish.common.remove" onActionPerformed='removeAnalysePlan()' enabled='false'/>
+ </cell>
+ </row>
+ <row>
+ <cell fill="both" weightx="1.0">
+ <JButton id="buttonSimulParamsAnalysePlansClear" text="isisfish.common.clear" onActionPerformed='clearAnalysePlan()' enabled='false'/>
+ </cell>
+ </row>
+ </Table>
+ </cell>
+ </row>
+ <row>
+ <cell columns="2" fill="both" weightx="1.0" weighty="1.0">
+ <JScrollPane>
+ <JTable id="simulParamsAnalysePlans" rowHeight='24' name="isisfish.sens.planParameters"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell columns="2" fill="horizontal" weightx="1.0">
+ <JButton text="isisfish.sens.backParameter" onActionPerformed='backParameter()'/>
+ </cell>
+ </row>
+</Table>
+
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,1128 +0,0 @@
-/* *##%
- * 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 static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.JComponent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.log.UserLog;
-import org.codelutin.math.matrix.MatrixND;
-import org.codelutin.topia.TopiaContext;
-
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
-import fr.ifremer.isisfish.datastore.ExportStorage;
-import fr.ifremer.isisfish.datastore.RegionStorage;
-import fr.ifremer.isisfish.datastore.RuleStorage;
-import fr.ifremer.isisfish.datastore.ScriptStorage;
-import fr.ifremer.isisfish.datastore.SensitivityStorage;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Strategy;
-import fr.ifremer.isisfish.export.Export;
-import fr.ifremer.isisfish.export.SensitivityExport;
-import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
-import fr.ifremer.isisfish.mexico.MexicoHelper;
-import fr.ifremer.isisfish.rule.Rule;
-import fr.ifremer.isisfish.simulator.AnalysePlan;
-import fr.ifremer.isisfish.simulator.SimulationParameter;
-import fr.ifremer.isisfish.simulator.SimulationProperties;
-import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
-import fr.ifremer.isisfish.simulator.launcher.SimulationService;
-import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
-import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
-import fr.ifremer.isisfish.simulator.sensitivity.Factor;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
-import fr.ifremer.isisfish.simulator.sensitivity.SensitivityException;
-import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
-import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
-import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
-import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
-import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
-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$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class SimulAction {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulAction.class);
-
- private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd-HH-mm");
-
- protected SimulationParameter param = null;
- protected RegionStorage regionStorage = null;
- protected SimulationStorage simulStorage = null;
- protected RuleStorage ruleStorage = null;
- protected List<String> analysePlan = null;
- protected Map<Rule, String> rules = new HashMap<Rule, String>();
- protected Map<SensitivityExport, String> sensitivityExports = new HashMap<SensitivityExport, String>();
-
- protected List<String> oldSimulNames = null;
- protected String simulName = null;
- protected SensitivityStorage sensitivityStorage = null;
- protected Map<String, Factor<? extends Serializable>> factors = new HashMap<String, Factor<? extends Serializable>>();
- protected Map<String, JComponent> factorComponent = new HashMap<String, JComponent>();
- protected DesignPlan designPlan = new DesignPlan();
- protected SensitivityCalculator sensitivityCalculator = null;
-
- /*
- ************
- * Init
- ************
- */
-
- public SimulAction() {
- init();
- }
-
- protected void showMsgBox(Exception eee) {
- ErrorDialogUI.showError(eee);
- }
-
- public void init() {
- log.debug("Init ");
- try {
- param = new SimulationParameter();
- List<String> resultNames = getResultNames();
- // put default value in param
- param.setSimulatorName(IsisFish.config.getSimulatorClassfile());
- param.setTagValue(IsisFish.config.getDefaultTagValueAsMap());
- param.setExportDirectory(IsisFish.config
- .getDefaultExportDirectory().toString());
- param.setExportNames(IsisFish.config.getDefaultExportNamesAsList());
- analysePlan = AnalysePlanStorage.getAnalysePlanNames();
- List<String> defaultResultNames = IsisFish.config
- .getDefaultResultNamesAsList();
- if (defaultResultNames != null) {
- param.setResultEnabled(defaultResultNames);
- } else {
- param.setResultEnabled(resultNames);
- }
- } catch (Exception eee) {
- log.error("Can't init SimulationParameter", eee);
- showMsgBox(eee);
- }
- }
-
- protected void setName(String name) {
- simulName = name;
- }
-
- protected void importSimulation(File f) {
- FileInputStream fos = null;
- try {
- fos = new FileInputStream(f);
- Properties proper = new Properties();
- proper.load(fos);
- param.fromProperties(SimulationStorage.getSimulationDirectory(),
- proper);
- } catch (Exception ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- } finally {
- try {
- fos.close();
- } catch (IOException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- }
-
- protected void saveSimulation(File f) {
- FileOutputStream fos = null;
- try {
- fos = new FileOutputStream(f);
- param.copy().toProperties().store(fos, simulName);
- } catch (Exception ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- } finally {
- try {
- fos.close();
- } catch (IOException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- }
-
- /**
- * Looking for ResultName.java script and read all fields and fill
- * list of field value and doc
- * @return the list of result names found in ResultName script
- */
- protected List<String> getResultNames() {
- List<String> result = new ArrayList<String>();
- try {
- ScriptStorage storage = ScriptStorage.getScript("ResultName.java");
- Class resultNameClass = storage.getCodeClass();
- // TODO: if we can't find class, perhaps try to parser Java source ?
- Field[] fields = resultNameClass.getFields();
- for (Field f : fields) {
- String fieldName = (String) f.get(null);
- result.add(fieldName);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't find result name script", eee);
- showMsgBox(eee);
- }
- }
- return result;
- }
-
- protected void stopSimulation(SimulationJob job) {
- job.stop();
- log.info(_("User stop simulation %s", job.getItem().getControl()
- .getId()));
- }
-
- protected void viewLog(SimulationJob job) {
- String id = job.getItem().getControl().getId();
- try {
- SimulationLoggerUtil.showSimulationLogConsole(id);
- } catch (Exception eee) {
- UserLog.error(_("Can't open log for %s", id), eee);
- showMsgBox(eee);
- }
- }
-
- protected void clearDoneJobs() {
- SimulationService ss = SimulationService.getService();
- ss.clearJobDone();
- }
-
- /**
- * Change region in simulation launcher
- *
- * @param regionName SimulationParameter/description
- */
- public void regionChange(String regionName) {
- try {
- regionStorage = RegionStorage.getRegion(regionName);
- param.setRegionName(regionName);
- for (Rule r : param.getRules()) {
- rules.put(r, RuleStorage.getName(r));
- }
- } catch (Exception eee) {
- showMsgBox(eee);
- }
- }
-
- /**
- * Change region in simulation launcher
- *
- * @param simulName name of simulation to load
- */
- public void loadOldSimulation(String simulName) {
- log.debug("call loadOldSimulation: " + simulName);
- try {
- this.simulName = simulName;
- simulStorage = SimulationStorage.getSimulation(simulName);
- param = simulStorage.getParameter().copy();
- // all time reset number after load
- param.setAnalysePlanNumber(-1);
- regionStorage = param.getRegion();
-
- // Chargement des sensibilites
- sensitivityCalculator = param.getSensitivityCalculator();
-
- // Chargement des exports de sensibilites
- for (SensitivityExport ex : param.getSensitivityExport()){
- sensitivityExports.put(ex, ex.getExportFilename());
- }
-
- // Chargement des facteurs
- File f = simulStorage.getMexicoDesignPlan(SimulationStorage.getSimulationDirectory(simulName));
- if (f != null){
- log.debug("Import design plan from : " + f.getPath());
- designPlan = MexicoHelper.getDesignPlanFromXML(f.getPath());
- factors.clear();
- for (Factor factor : designPlan.getFactors()){
- log.debug("Find factor : " + factor.getName());
- factors.put(factor.getPath() + factor.getName(), factor);
- }
- }
- } catch (Exception eee) {
- log.error("Can't load old Simulation: " + simulName, eee);
- showMsgBox(eee);
- }
- }
-
- /*
- ************
- * ParamsUI
- ************
- */
-
- // Gestion des rules
- public void addRules(String name) {
- ruleStorage = RuleStorage.getRule(name);
- try {
- Rule ruleTmp = ruleStorage.getNewRuleInstance();
- rules.put(ruleTmp, name);
- param.addRule(ruleTmp);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
-
- public List<String> getRuleNames() {
- List<String> result = new ArrayList<String>();
- for (String r : RuleStorage.getRuleNames()) {
- result.add(r.substring(0, r.length() - 5));
- }
- return result;
- }
-
- public List<String> getRules() {
- List<String> result = new ArrayList<String>();
- for (Rule r : param.getRules()) {
- try {
- result.add(RuleStorage.getName(r));
- } catch (Exception ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- return result;
- }
-
- public void removeRules(String name) {
- if (name != null) {
- for (Map.Entry<Rule, String> entry : rules.entrySet()) {
- if (entry.getValue().equals(name)) {
- param.removeRule(entry.getKey());
- rules.remove(entry.getKey());
- }
- }
- }
- }
-
- public Rule getRule(String ruleName) {
- Rule r = null;
- for (Map.Entry<Rule, String> entry : rules.entrySet()) {
- if (entry.getValue().equals(ruleName)) {
- r = entry.getKey();
- }
- }
- return r;
- }
-
- public Map<String, Class> getRuleParameterName(String ruleName) {
- Map<String, Class> result = null;
- if (ruleName != null) {
- Rule r = getRule(ruleName);
- if (r != null) {
- result = RuleStorage.getParameterNames(r);
- }
- }
- return result;
- }
-
- public Object getRuleParameterValue(String paramName, String ruleName) {
- Object result = null;
- if (ruleName != null) {
- try {
- result = RuleStorage.getParameterValue(getRule(ruleName),
- paramName);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- return result;
- }
-
- public void setRuleParameterValue(String paramName, String ruleName,
- Object o) {
- if (ruleName != null) {
- try {
- RuleStorage.setParameterValue(getRule(ruleName), paramName, o);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- }
-
- // Strategies
-
- public List<Strategy> getStrategies() {
- List<Strategy> result = new ArrayList<Strategy>();
- try {
- TopiaContext tx = param.getRegion().getStorage().beginTransaction();
- result = RegionStorage.getFisheryRegion(tx).getStrategy();
- tx.rollbackTransaction();
- tx.closeContext();
- } catch (Exception ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- return result;
- }
-
- public void setStrategies(Object[] strategies) {
- List<Strategy> result = new ArrayList<Strategy>();
- for (Object o : strategies) {
- result.add((Strategy) o);
- }
- param.setStrategies(result);
- }
-
- // Population
-
- public List<Population> getPopulations() {
-
- List<Population> result = new ArrayList<Population>();
- try {
- TopiaContext tx = param.getRegion().getStorage().beginTransaction();
- List<Species> species = RegionStorage.getFisheryRegion(tx)
- .getSpecies();
- for (Species s : species) {
- Collection<Population> populations = s.getPopulation();
-
- // FIXME initialiaze lazy hibernate collection
- for (Population p : populations) {
- p.getPopulationGroup().size();
- p.getPopulationZone().size();
- }
-
- result.addAll(populations);
- }
- tx.rollbackTransaction();
- tx.closeContext();
- } catch (Exception ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- return result;
- }
-
- public void setPopulations(Object[] populations) {
- List<Population> result = new ArrayList<Population>();
- for (Object o : populations) {
- result.add((Population) o);
- }
- param.setPopulations(result);
- }
-
- // Years
-
- public void setNbAnnees(String years) {
- param.setNumberOfYear(Integer.parseInt(years));
- }
-
- public List<String> getSimulatorNames() {
- return SimulatorStorage.getSimulatorNames();
- }
-
- /*
- * Return old simulations
- *
- * @param
- * @return old simulations
- *
- * @deprecated use fr.ifremer.isisfish.ui.Common.getOldSimulationItem()
- */
- public List<String> getOldSimulationItem() {
-
- try {
- oldSimulNames = new ArrayList<String>();
-
- FilterModel<SimulationProperties, String> filterModel;
- // keep in context list of old simulation names (for filter process)
- oldSimulNames.addAll(SimulationStorage.getSimulationNames());
- // create filter model
- filterModel = SimulationFilterUtil.createFilterModel(oldSimulNames);
- // to used directly model.getFilteredResult() in xml
- // we must fill filterModel result with original items
- filterModel.selectAll();
-
- // chatellier : Ajout d'une entrée vide pour forcer la sélection
- // et que le changement lance un evenement sur la liste
- // Add empty item after, otherwise, un " " directory
- // will be created
- oldSimulNames.add(0, " ");
-
- return oldSimulNames;
- } catch (ParseException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- } catch (IOException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- return null;
- }
-
- public List<String> getFilteredOldSimulatorNames() {
- return getFilteredOldSimulatorNames(false);
- }
-
- public List<String> getFilteredOldSimulatorNames(boolean force) {
- if (oldSimulNames == null || force) {
- oldSimulNames = getOldSimulationItem();
- }
- return oldSimulNames;
- }
-
- public void setOldSimulatorNames(List<String> sn) {
- oldSimulNames = sn;
- }
-
- public void resetOldSimulatorNames() {
- oldSimulNames = getOldSimulationItem();
- }
-
- /*
- ************
- * AdvancedParameterUI
- ************
- */
-
- // Gestion des TagValues
- public void addTagValue(String tag, String value) {
- param.getTagValue().put(tag, value);
- }
-
- public void removeTagValue(String tag) {
- log.debug("removeTagValue: " + tag);
- param.getTagValue().remove(tag);
- }
-
- public void saveTagValue(String simulatorName) {
- Map<String, String> tagValues = param.getTagValue();
- log.debug("call saveTagValue: " + tagValues);
- IsisFish.config.setDefaultTagValues(tagValues);
-
- IsisFish.config.setSimulatorClassfile(simulatorName);
- }
-
- /*
- * ExportUI
- */
-
- public List<String> getExportNames() {
- List<String> result = new ArrayList<String>();
- List<String> exportNames = ExportStorage.getExportNames();
- for (String export : exportNames) {
- try {
- ExportStorage storage = ExportStorage.getExport(export);
- Export exInstance = storage.getNewExportInstance();
- if (!SensitivityExport.class.isInstance(exInstance)) {
- result.add(export);
- }
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- }
- }
- return result;
- }
-
- public void updateDirectory() {
- param.setExportDirectory(org.codelutin.util.FileUtil.getDirectory());
- }
-
- public void saveExport() {
- IsisFish.config.setDefaultExportDirectory(param.getExportDirectory());
- if (param.getExportNames() != null) {
- IsisFish.config.setDefaultExportNames(param.getExportNames());
- }
- }
-
- /*
- * ResultUI
- */
-
- public void saveResultNames(Object[] resultNames) {
- List<String> resultNamesString = new ArrayList<String>();
- for (Object o : resultNames) {
- resultNamesString.add(o.toString());
- }
- param.setResultEnabled(resultNamesString);
- IsisFish.config.setDefaultResultNames(resultNamesString);
- }
-
- public List<String> getDefaultResultNames() {
- return IsisFish.config.getDefaultResultNamesAsList();
- }
-
- /*
- * SensUI
- */
-
- // Gestion des analysePlans
- public List<String> getAnalysePlanNames() {
- return analysePlan;
- }
-
- public List<AnalysePlan> getParamAnalysePlans() {
- return param.getAnalysePlans();
- }
-
- public void addAnalysePlan(String name) {
- try {
- AnalysePlan ap = AnalysePlanStorage.getAnalysePlan(name)
- .getNewAnalysePlanInstance();
- getSimulationParameter().addAnalysePlan(ap);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
-
- public void removeAnalysePlan(AnalysePlan ap) {
- getSimulationParameter().removeAnalysePlan(ap);
- }
-
- public void clearAnalysePlan() {
- getSimulationParameter().clearPlans();
- }
-
- public Map<String, Class> getAnalysePlanParameterName(AnalysePlan ap) {
- Map<String, Class> result = null;
- if (ap != null) {
- result = AnalysePlanStorage.getParameterNames(ap);
- }
- return result;
- }
-
- public Object getAnalysePlanParameterValue(String paramName, AnalysePlan ap) {
- Object result = null;
- if (ap != null) {
- try {
- result = AnalysePlanStorage.getParameterValue(ap, paramName);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
- return result;
- }
-
- public void setAnalysePlanParameterValue(String paramName, AnalysePlan ap,
- Object value) {
- if (log.isDebugEnabled()) {
- log.debug("paramName : " + paramName + " analysePlanName : " + ap
- + " value : " + value);
- }
- try {
- AnalysePlanStorage.setParameterValue(ap, paramName, value);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
-
- /*
- * Sensitivity
- */
-
- public List<String> getSensitivityExportNames() {
- List<String> result = new ArrayList<String>();
- List<String> exportNames = ExportStorage.getExportNames();
- for (String export : exportNames) {
- try {
- ExportStorage storage = ExportStorage.getExport(export);
- Export exInstance = storage.getNewExportInstance();
- if (SensitivityExport.class.isInstance(exInstance)) {
- result.add(export);
- }
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- }
- }
- return result;
- }
-
- public List<SensitivityExport> getSensitivityExportList() {
- List<SensitivityExport> result = new ArrayList<SensitivityExport>();
- for (Map.Entry<SensitivityExport, String> entry : sensitivityExports
- .entrySet()) {
- result.add(entry.getKey());
- }
- return result;
- }
-
- public void addSensitivityExport(String name) {
- try {
- ExportStorage storage = ExportStorage.getExport(name);
- SensitivityExport exInstance = (SensitivityExport) storage
- .getNewExportInstance();
- sensitivityExports.put(exInstance, name);
- param.setSensitivityExport(getSensitivityExportList());
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- }
- }
-
- /**
- * Remove an export.
- *
- * @param export export to remove
- */
- public void removeSensitivityExport(SensitivityExport export) {
- sensitivityExports.remove(export);
- param.setSensitivityExport(getSensitivityExportList());
- }
-
- public void clearSensitivityExport() {
- sensitivityExports.clear();
- param.setSensitivityExport(getSensitivityExportList());
- }
-
- public Map<String, Class<?>> getSensitivityExportParameterNames(
- SensitivityExport export) {
- return ExportStorage.getParameterNames(export);
- }
-
- public void setSensitivityExportParameterValue(Export export,
- String paramName, Object value) {
- if (value != null) {
- try {
- ExportStorage.setParameterValue(export, paramName, value);
- } catch (IsisFishException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't set sensitivity export param value", e);
- }
- }
- }
- }
-
- public Object getSensitivityExportParameterValue(Export export, String paramName) {
- Object result = null;
- try {
- result = ExportStorage.getParameterValue(export, paramName);
- } catch (IsisFishException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't get sensitivity export param value", e);
- }
- }
- return result;
- }
-
- public List<String> getSensitivityNames() {
- return SensitivityStorage.getSensitivityNames();
- }
-
- public Map<String, Class<?>> getSensitivityParameterNames(String name) {
- Map<String, Class<?>> result = null;
- try {
- SensitivityStorage sens = SensitivityStorage.getSensitivity(name);
- result = sens.getParameterNames();
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- }
- return result;
- }
-
- public Object getSensitivityCalculatorParameterValue(String paramName) {
- Object result = null;
- try {
- result = SensitivityStorage.getParameterValue(param
- .getSensitivityCalculator(), paramName);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- return result;
- }
-
- public void setSensitivityCalculatorParameterValue(String paramName,
- Object value) {
- try {
- if (value != null) {
- SensitivityStorage.setParameterValue(param
- .getSensitivityCalculator(), paramName, value);
- }
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- showMsgBox(ex);
- }
- }
-
- public SensitivityStorage getSensitivity(String name) {
- return SensitivityStorage.getSensitivity(name);
- }
-
- public void setSensitivity(String name) {
- try {
- sensitivityStorage = SensitivityStorage.getSensitivity(name);
- SensitivityCalculator sensCal = sensitivityStorage
- .getNewSensitivityInstance();
- sensitivityCalculator = sensCal;
- param.setSensitivityCalculator(sensitivityCalculator);
- } catch (IsisFishException ex) {
- Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE,
- null, ex);
- }
- }
-
- public List<Factor<? extends Serializable>> getFactors() {
- List<Factor<? extends Serializable>> result = new ArrayList<Factor<? extends Serializable>>();
- for (Map.Entry entry : factors.entrySet()) {
- result.add((Factor<? extends Serializable>) entry.getValue());
- }
- return result;
- }
-
- public void addFactor(Factor f, JComponent c) {
- factors.put(f.getPath() + f.getName(), f);
- factorComponent.put(f.getPath() + f.getName(), c);
- designPlan.setFactors(getFactors());
- }
-
- public Factor<? extends Serializable> getFactor(String name) {
- return factors.get(name);
- }
-
- public void addContinuousFactor(String name, String comment, String path, Double min,
- Double max, JComponent c, boolean exist) {
- Factor f = new Factor(name);
- ContinuousDomain<Serializable> domain = new ContinuousDomain<Serializable>();
- domain.setMinBound(min);
- domain.setMaxBound(max);
- f.setDomain(domain);
- f.setComment(comment);
- f.setPath(path);
- if (exist)
- removeFactor(f);
- addFactor(f, c);
- }
-
- public void addDiscreteFactor(String name, String comment, String path,
- List<Serializable> values, JComponent c, boolean exist) {
- Factor f = new Factor(name);
- DiscreteDomain<Serializable> domain = new DiscreteDomain<Serializable>();
- int i = 0;
- for (Serializable value : values) {
- // FIXME test when integer
- // Don't work with String ;(
- domain.getValues().put(i, value);
- // and start at 0
- i++;
- }
- f.setDomain(domain);
- f.setComment(comment);
- f.setPath(path);
- if (exist)
- removeFactor(f);
- addFactor(f, c);
- }
-
- public void addContinuousEquationFactor(String name, String comment, String path,
- EquationContinuousDomain domain, JComponent c,
- boolean exist) {
- Factor f = new Factor(name);
- f.setDomain(domain);
- f.setComment(comment);
- f.setPath(path + domain.getVariableName());
- if (exist)
- removeFactor(f);
- addFactor(f, c);
- }
-
- public void addContinuousMatrixFactor(String name, String comment, String path,
- Double coef, MatrixND matrix,
- String operateur, JComponent c, boolean exist) {
- Factor f = new Factor(name);
- MatrixContinuousDomain<Serializable> domain = new MatrixContinuousDomain<Serializable>();
- domain.setMatrix(matrix);
- domain.setOperator(operateur);
- domain.setCoefficient(coef);
- f.setComment(comment);
- f.setDomain(domain);
- f.setPath(path);
- if (exist)
- removeFactor(f);
- addFactor(f, c);
- }
-
- public JComponent getFactorComponent(Factor f) {
- return factorComponent.get(f.getPath() + f);
- }
-
- public void removeFactor(Factor f) {
- factors.remove(f.getPath() + f.getName());
- factorComponent.remove(f.getPath() + f.getName());
- designPlan.setFactors(getFactors());
- }
-
- /*
- ************
- * General
- ************
- */
-
- public SimulationParameter getSimulationParameter() {
- return param;
- }
-
- public void setSimulationParameter(SimulationParameter p) {
- param = p;
- }
-
- public SimulationStorage getSimulationStorage() {
- return simulStorage;
- }
-
- public RegionStorage getRegionStorage() {
- return regionStorage;
- }
-
- public List<SimulatorLauncher> getSimulationLauncher() {
- return SimulationService.getService().getSimulationLaunchers();
- }
-
- /**
- * Launch automatically the simulation, when is possible (no other simulation)
- * or wait for the last automatically simulation ended.
- *
- * @param simulationId id of the simulation to simulate
- * @param launcher launcher to use
- *
- * @see SimulatorLauncher
- */
- public void launchSimulation(String simulationId, SimulatorLauncher launcher) {
-
- String fullSimulationId = "sim_" + simulationId + "_"
- + DATEFORMAT.format(new java.util.Date());
-
- // log
- if (log.isDebugEnabled()) {
- log.debug("Launch simulation with custom launcher "
- + launcher.toString());
- }
-
- try {
- if ("".equals(fullSimulationId)
- || SimulationStorage.localyExists(fullSimulationId)
- || SimulationService.getService().exists(fullSimulationId)) {
- UserLog.error(_("isisfish.simulator.simulaction.badid",
- fullSimulationId));
- } else {
- SimulationParameter p = param.copy();
-
- SimulationService.getService().submit(fullSimulationId, p,
- launcher, 0);
- }
- } catch (Exception eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't start simulation", eee);
- }
- showMsgBox(eee);
- }
- }
-
- /**
- * Launch simulation with factors variations parameters.
- *
- * @param simulationId id of the simulation to simulate
- * @param launcher launcher to use
- * @param sensitivityCalculator sensitivity calculator to use
- * @param designPlan design plan for this simulation
- *
- * @see SimulatorLauncher
- * @see SensitivityCalculator
- * @see DesignPlan
- */
- public void launchSimulation(String simulationId,
- SimulatorLauncher launcher,
- SensitivityCalculator sensitivityCalculator, DesignPlan designPlan) {
-
- String fullSimulationId = "as_" + simulationId + "_"
- + DATEFORMAT.format(new java.util.Date());
-
- // log
- if (log.isDebugEnabled()) {
- log.debug("Launch factor simulation with custom launcher "
- + launcher.toString());
- log.debug("Using sensitivityCalculator : "
- + sensitivityCalculator.getDescription());
- }
-
- try {
- if ("".equals(fullSimulationId)
- || SimulationStorage.localyExists(fullSimulationId)
- || SimulationService.getService().exists(fullSimulationId)) {
- UserLog.error(_("isisfish.simulator.simulaction.badid",
- fullSimulationId));
- } else {
- SimulationParameter p = param.copy();
- SimulationService.getService().submit(fullSimulationId, p,
- launcher, 0, sensitivityCalculator, designPlan);
- }
- } catch (Exception eee) {
- if (log.isErrorEnabled()) {
- log.error("Can't start simulation", eee);
- }
- showMsgBox(eee);
- }
- }
-
- public void launchSimulationWhithSensibility(String simulationId,
- SimulatorLauncher launcher) {
- launchSimulation(simulationId, launcher, sensitivityCalculator,
- designPlan);
- }
-
- /**
- * Lance la second passe d'une analyse de sensibilité.
- *
- * @param masterSensitivitySimulationName nom du prefix de toutes les simulations (without _)
- */
- public void runSensitivitySecondPass(String masterSensitivitySimulationName) {
-
- // calculator found
- SensitivityCalculator sensitivityCalculator = null;
- //List<SimulationStorage> simulationStorageForAnalyze = new ArrayList<SimulationStorage>();
- SortedMap<Integer, SimulationStorage> simulationStorageForAnalyze = new TreeMap<Integer, SimulationStorage>();
- File simuationDirectory = SimulationStorage.getSimulationDirectory();
- for (File simuation : simuationDirectory.listFiles()) {
- if (simuation.isDirectory()
- && simuation.getName().startsWith(
- masterSensitivitySimulationName + "_")) {
- SimulationStorage storage = SimulationStorage
- .getSimulation(simuation.getName());
- String suffix = simuation.getName().substring(
- simuation.getName().lastIndexOf("_") + 1);
- simulationStorageForAnalyze.put(Integer.valueOf(suffix),
- storage);
-
- if (sensitivityCalculator == null) {
- // try to find find calculator name in one storage
- SimulationParameter params = storage.getParameter();
- sensitivityCalculator = params.getSensitivityCalculator();
- }
- }
- }
-
- if (sensitivityCalculator != null) {
- try {
- // build master sensitivity export directory
- File masterExportDirectory = new File(IsisFish.config
- .getDefaultExportDirectory(),
- masterSensitivitySimulationName);
- if (!masterExportDirectory.isDirectory()) {
- masterExportDirectory.mkdirs();
- }
- List<SimulationStorage> simulationStorageForAnalyzeList = new ArrayList<SimulationStorage>(
- simulationStorageForAnalyze.values());
- sensitivityCalculator.analyzeResult(
- simulationStorageForAnalyzeList, masterExportDirectory);
- } catch (SensitivityException e) {
- if (log.isErrorEnabled()) {
- log.error("Can't call analyse result", e);
- }
- }
- } else {
- if (log.isWarnEnabled()) {
- log.warn("Can't run sensitivity second pass");
- }
- }
- }
-
- /**
- * Renvoie les resultats de la seconde pass.
- *
- * @param masterSensitivitySimulationName nom du prefix de toutes les simulations (without _)
- *
- * @return les fichiers genere lors de la seconde passe (seulement ceux qui ne commence pas par ".")
- */
- public List<File> getSensitivitySecondPassResults(
- String masterSensitivitySimulationName) {
-
- List<File> result = new ArrayList<File>();
-
- // build master sensitivity export directory
- File masterExportDirectory = new File(IsisFish.config
- .getDefaultExportDirectory(), masterSensitivitySimulationName);
- if (masterExportDirectory.isDirectory()) {
- for (File exportFile : masterExportDirectory.listFiles()) {
- if (exportFile.isFile()
- && !exportFile.getName().startsWith(".")) {
- result.add(exportFile);
- }
- }
- }
-
- return result;
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java (from rev 2093, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,1158 @@
+/* *##%
+ * 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 static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import javax.swing.JComponent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.log.UserLog;
+import org.codelutin.math.matrix.MatrixND;
+import org.codelutin.topia.TopiaContext;
+
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SensitivityStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.Strategy;
+import fr.ifremer.isisfish.export.Export;
+import fr.ifremer.isisfish.export.SensitivityExport;
+import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
+import fr.ifremer.isisfish.mexico.MexicoHelper;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.simulator.AnalysePlan;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.simulator.SimulationProperties;
+import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
+import fr.ifremer.isisfish.simulator.launcher.SimulationService;
+import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
+import fr.ifremer.isisfish.simulator.sensitivity.DesignPlan;
+import fr.ifremer.isisfish.simulator.sensitivity.Factor;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator;
+import fr.ifremer.isisfish.simulator.sensitivity.SensitivityException;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.DiscreteDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.EquationContinuousDomain;
+import fr.ifremer.isisfish.simulator.sensitivity.domain.MatrixContinuousDomain;
+import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
+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$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SimulAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ private static Log log = LogFactory.getLog(SimulAction.class);
+
+ private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd-HH-mm");
+
+ protected SimulationParameter param = null;
+ protected RegionStorage regionStorage = null;
+ protected SimulationStorage simulStorage = null;
+ protected RuleStorage ruleStorage = null;
+ protected List<String> analysePlan = null;
+ protected Map<Rule, String> rules = new HashMap<Rule, String>();
+ protected Map<SensitivityExport, String> sensitivityExports = new HashMap<SensitivityExport, String>();
+
+ protected List<String> oldSimulNames = null;
+ protected String simulName = null;
+ protected SensitivityStorage sensitivityStorage = null;
+ protected Map<String, Factor<? extends Serializable>> factors = new HashMap<String, Factor<? extends Serializable>>();
+ protected Map<String, JComponent> factorComponent = new HashMap<String, JComponent>();
+ protected DesignPlan designPlan = new DesignPlan();
+ protected SensitivityCalculator sensitivityCalculator = null;
+
+ /*
+ ************
+ * Init
+ ************
+ */
+
+ public SimulAction() {
+ init();
+ }
+
+ protected void showMsgBox(Exception eee) {
+ ErrorDialogUI.showError(eee);
+ }
+
+ public void init() {
+ log.debug("Init ");
+ try {
+ param = new SimulationParameter();
+ List<String> resultNames = getResultNames();
+ // put default value in param
+ param.setSimulatorName(IsisFish.config.getSimulatorClassfile());
+ param.setTagValue(IsisFish.config.getDefaultTagValueAsMap());
+ param.setExportDirectory(IsisFish.config
+ .getDefaultExportDirectory().toString());
+ param.setExportNames(IsisFish.config.getDefaultExportNamesAsList());
+ analysePlan = AnalysePlanStorage.getAnalysePlanNames();
+ List<String> defaultResultNames = IsisFish.config
+ .getDefaultResultNamesAsList();
+ if (defaultResultNames != null) {
+ param.setResultEnabled(defaultResultNames);
+ } else {
+ param.setResultEnabled(resultNames);
+ }
+ } catch (Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't init SimulationParameter", eee);
+ }
+ showMsgBox(eee);
+ }
+ }
+
+ protected void setName(String name) {
+ simulName = name;
+ }
+
+ protected void importSimulation(File f) {
+ FileInputStream fos = null;
+ try {
+ fos = new FileInputStream(f);
+ Properties proper = new Properties();
+ proper.load(fos);
+ param.fromProperties(SimulationStorage.getSimulationDirectory(),
+ proper);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't import simulation", e);
+ }
+ showMsgBox(e);
+ } finally {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't import simulation", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ }
+
+ protected void saveSimulation(File f) {
+ FileOutputStream fos = null;
+ try {
+ fos = new FileOutputStream(f);
+ param.copy().toProperties().store(fos, simulName);
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't save simulation", e);
+ }
+ showMsgBox(e);
+ } finally {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't save simulation", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ }
+
+ /**
+ * Looking for ResultName.java script and read all fields and fill
+ * list of field value and doc
+ * @return the list of result names found in ResultName script
+ */
+ protected List<String> getResultNames() {
+ List<String> result = new ArrayList<String>();
+ try {
+ ScriptStorage storage = ScriptStorage.getScript("ResultName.java");
+ Class resultNameClass = storage.getCodeClass();
+ // TODO: if we can't find class, perhaps try to parser Java source ?
+ Field[] fields = resultNameClass.getFields();
+ for (Field f : fields) {
+ String fieldName = (String) f.get(null);
+ result.add(fieldName);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't find result name script", eee);
+ showMsgBox(eee);
+ }
+ }
+ return result;
+ }
+
+ protected void stopSimulation(SimulationJob job) {
+ job.stop();
+ if (log.isInfoEnabled()) {
+ log.info(_("User stop simulation %s", job.getItem().getControl()
+ .getId()));
+ }
+ }
+
+ protected void viewLog(SimulationJob job) {
+ String id = job.getItem().getControl().getId();
+ try {
+ SimulationLoggerUtil.showSimulationLogConsole(id);
+ } catch (Exception eee) {
+ UserLog.error(_("Can't open log for %s", id), eee);
+ showMsgBox(eee);
+ }
+ }
+
+ protected void clearDoneJobs() {
+ SimulationService ss = SimulationService.getService();
+ ss.clearJobDone();
+ }
+
+ /**
+ * Change region in simulation launcher
+ *
+ * @param regionName SimulationParameter/description
+ */
+ public void regionChange(String regionName) {
+ try {
+ regionStorage = RegionStorage.getRegion(regionName);
+ param.setRegionName(regionName);
+ for (Rule r : param.getRules()) {
+ rules.put(r, RuleStorage.getName(r));
+ }
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't change region", e);
+ }
+ showMsgBox(e);
+ }
+ }
+
+ /**
+ * Change region in simulation launcher
+ *
+ * @param simulName name of simulation to load
+ */
+ public void loadOldSimulation(String simulName) {
+ log.debug("call loadOldSimulation: " + simulName);
+ try {
+ this.simulName = simulName;
+ simulStorage = SimulationStorage.getSimulation(simulName);
+ param = simulStorage.getParameter().copy();
+ // all time reset number after load
+ param.setAnalysePlanNumber(-1);
+ regionStorage = param.getRegion();
+
+ // Chargement des sensibilites
+ sensitivityCalculator = param.getSensitivityCalculator();
+
+ // Chargement des exports de sensibilites
+ for (SensitivityExport ex : param.getSensitivityExport()){
+ sensitivityExports.put(ex, ex.getExportFilename());
+ }
+
+ // Chargement des facteurs
+ File f = simulStorage.getMexicoDesignPlan(SimulationStorage.getSimulationDirectory(simulName));
+ if (f != null){
+ log.debug("Import design plan from : " + f.getPath());
+ designPlan = MexicoHelper.getDesignPlanFromXML(f.getPath());
+ factors.clear();
+ for (Factor factor : designPlan.getFactors()){
+ log.debug("Find factor : " + factor.getName());
+ factors.put(factor.getPath() + factor.getName(), factor);
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't load old Simulation: " + simulName, eee);
+ }
+ showMsgBox(eee);
+ }
+ }
+
+ /*
+ ************
+ * ParamsUI
+ ************
+ */
+
+ // Gestion des rules
+ public void addRules(String name) {
+ ruleStorage = RuleStorage.getRule(name);
+ try {
+ Rule ruleTmp = ruleStorage.getNewRuleInstance();
+ rules.put(ruleTmp, name);
+ param.addRule(ruleTmp);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add rule", e);
+ }
+ showMsgBox(e);
+ }
+ }
+
+ public List<String> getRuleNames() {
+ List<String> result = new ArrayList<String>();
+ for (String r : RuleStorage.getRuleNames()) {
+ result.add(r.substring(0, r.length() - 5));
+ }
+ return result;
+ }
+
+ public List<String> getRules() {
+ List<String> result = new ArrayList<String>();
+ for (Rule r : param.getRules()) {
+ try {
+ result.add(RuleStorage.getName(r));
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get rules", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ return result;
+ }
+
+ public void removeRules(String name) {
+ if (name != null) {
+ for (Map.Entry<Rule, String> entry : rules.entrySet()) {
+ if (entry.getValue().equals(name)) {
+ param.removeRule(entry.getKey());
+ rules.remove(entry.getKey());
+ }
+ }
+ }
+ }
+
+ public Rule getRule(String ruleName) {
+ Rule r = null;
+ for (Map.Entry<Rule, String> entry : rules.entrySet()) {
+ if (entry.getValue().equals(ruleName)) {
+ r = entry.getKey();
+ }
+ }
+ return r;
+ }
+
+ public Map<String, Class> getRuleParameterName(String ruleName) {
+ Map<String, Class> result = null;
+ if (ruleName != null) {
+ Rule r = getRule(ruleName);
+ if (r != null) {
+ result = RuleStorage.getParameterNames(r);
+ }
+ }
+ return result;
+ }
+
+ public Object getRuleParameterValue(String paramName, String ruleName) {
+ Object result = null;
+ if (ruleName != null) {
+ try {
+ result = RuleStorage.getParameterValue(getRule(ruleName),
+ paramName);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get rule param value", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ return result;
+ }
+
+ public void setRuleParameterValue(String paramName, String ruleName,
+ Object o) {
+ if (ruleName != null) {
+ try {
+ RuleStorage.setParameterValue(getRule(ruleName), paramName, o);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set rule param value", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ }
+
+ // Strategies
+
+ public List<Strategy> getStrategies() {
+ List<Strategy> result = new ArrayList<Strategy>();
+ try {
+ TopiaContext tx = param.getRegion().getStorage().beginTransaction();
+ result = RegionStorage.getFisheryRegion(tx).getStrategy();
+ tx.rollbackTransaction();
+ tx.closeContext();
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get strategies", e);
+ }
+ showMsgBox(e);
+ }
+ return result;
+ }
+
+ public void setStrategies(Object[] strategies) {
+ List<Strategy> result = new ArrayList<Strategy>();
+ for (Object o : strategies) {
+ result.add((Strategy) o);
+ }
+ param.setStrategies(result);
+ }
+
+ // Population
+
+ public List<Population> getPopulations() {
+
+ List<Population> result = new ArrayList<Population>();
+ try {
+ TopiaContext tx = param.getRegion().getStorage().beginTransaction();
+ List<Species> species = RegionStorage.getFisheryRegion(tx)
+ .getSpecies();
+ for (Species s : species) {
+ Collection<Population> populations = s.getPopulation();
+
+ // FIXME initialiaze lazy hibernate collection
+ for (Population p : populations) {
+ p.getPopulationGroup().size();
+ p.getPopulationZone().size();
+ }
+
+ result.addAll(populations);
+ }
+ tx.rollbackTransaction();
+ tx.closeContext();
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get population", e);
+ }
+ showMsgBox(e);
+ }
+ return result;
+ }
+
+ public void setPopulations(Object[] populations) {
+ List<Population> result = new ArrayList<Population>();
+ for (Object o : populations) {
+ result.add((Population) o);
+ }
+ param.setPopulations(result);
+ }
+
+ // Years
+
+ public void setNbAnnees(String years) {
+ param.setNumberOfYear(Integer.parseInt(years));
+ }
+
+ public List<String> getSimulatorNames() {
+ return SimulatorStorage.getSimulatorNames();
+ }
+
+ /**
+ * Return old simulations.
+ *
+ * @return old simulations
+ *
+ * @deprecated use fr.ifremer.isisfish.ui.Common.getOldSimulationItem()
+ */
+ public List<String> getOldSimulationItem() {
+
+ try {
+ oldSimulNames = new ArrayList<String>();
+
+ FilterModel<SimulationProperties, String> filterModel;
+ // keep in context list of old simulation names (for filter process)
+ oldSimulNames.addAll(SimulationStorage.getSimulationNames());
+ // create filter model
+ filterModel = SimulationFilterUtil.createFilterModel(oldSimulNames);
+ // to used directly model.getFilteredResult() in xml
+ // we must fill filterModel result with original items
+ filterModel.selectAll();
+
+ // chatellier : Ajout d'une entrée vide pour forcer la sélection
+ // et que le changement lance un evenement sur la liste
+ // Add empty item after, otherwise, un " " directory
+ // will be created
+ oldSimulNames.add(0, " ");
+
+ return oldSimulNames;
+ } catch (ParseException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get old simulation item", e);
+ }
+ showMsgBox(e);
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get old simulation item", e);
+ }
+ showMsgBox(e);
+ }
+ return null;
+ }
+
+ public List<String> getFilteredOldSimulatorNames() {
+ return getFilteredOldSimulatorNames(false);
+ }
+
+ public List<String> getFilteredOldSimulatorNames(boolean force) {
+ if (oldSimulNames == null || force) {
+ oldSimulNames = getOldSimulationItem();
+ }
+ return oldSimulNames;
+ }
+
+ public void setOldSimulatorNames(List<String> sn) {
+ oldSimulNames = sn;
+ }
+
+ public void resetOldSimulatorNames() {
+ oldSimulNames = getOldSimulationItem();
+ }
+
+ /*
+ ************
+ * AdvancedParameterUI
+ ************
+ */
+
+ // Gestion des TagValues
+ public void addTagValue(String tag, String value) {
+ param.getTagValue().put(tag, value);
+ }
+
+ public void removeTagValue(String tag) {
+ log.debug("removeTagValue: " + tag);
+ param.getTagValue().remove(tag);
+ }
+
+ public void saveTagValue(String simulatorName) {
+ Map<String, String> tagValues = param.getTagValue();
+ log.debug("call saveTagValue: " + tagValues);
+ IsisFish.config.setDefaultTagValues(tagValues);
+
+ IsisFish.config.setSimulatorClassfile(simulatorName);
+ }
+
+ /*
+ * ExportUI
+ */
+
+ public List<String> getExportNames() {
+ List<String> result = new ArrayList<String>();
+ List<String> exportNames = ExportStorage.getExportNames();
+ for (String export : exportNames) {
+ try {
+ ExportStorage storage = ExportStorage.getExport(export);
+ Export exInstance = storage.getNewExportInstance();
+ if (!SensitivityExport.class.isInstance(exInstance)) {
+ result.add(export);
+ }
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get export names", e);
+ }
+ }
+ }
+ return result;
+ }
+
+ public void updateDirectory() {
+ param.setExportDirectory(org.codelutin.util.FileUtil.getDirectory());
+ }
+
+ public void saveExport() {
+ IsisFish.config.setDefaultExportDirectory(param.getExportDirectory());
+ if (param.getExportNames() != null) {
+ IsisFish.config.setDefaultExportNames(param.getExportNames());
+ }
+ }
+
+ /*
+ * ResultUI
+ */
+
+ public void saveResultNames(Object[] resultNames) {
+ List<String> resultNamesString = new ArrayList<String>();
+ for (Object o : resultNames) {
+ resultNamesString.add(o.toString());
+ }
+ param.setResultEnabled(resultNamesString);
+ IsisFish.config.setDefaultResultNames(resultNamesString);
+ }
+
+ public List<String> getDefaultResultNames() {
+ return IsisFish.config.getDefaultResultNamesAsList();
+ }
+
+ /*
+ * SensUI
+ */
+
+ // Gestion des analysePlans
+ public List<String> getAnalysePlanNames() {
+ return analysePlan;
+ }
+
+ public List<AnalysePlan> getParamAnalysePlans() {
+ return param.getAnalysePlans();
+ }
+
+ public void addAnalysePlan(String name) {
+ try {
+ AnalysePlan ap = AnalysePlanStorage.getAnalysePlan(name)
+ .getNewAnalysePlanInstance();
+ getSimulationParameter().addAnalysePlan(ap);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add analyse plan", e);
+ }
+ showMsgBox(e);
+ }
+ }
+
+ public void removeAnalysePlan(AnalysePlan ap) {
+ getSimulationParameter().removeAnalysePlan(ap);
+ }
+
+ public void clearAnalysePlan() {
+ getSimulationParameter().clearPlans();
+ }
+
+ public Map<String, Class<?>> getAnalysePlanParameterName(AnalysePlan ap) {
+ Map<String, Class<?>> result = null;
+ if (ap != null) {
+ result = AnalysePlanStorage.getParameterNames(ap);
+ }
+ return result;
+ }
+
+ public Object getAnalysePlanParameterValue(String paramName, AnalysePlan ap) {
+ Object result = null;
+ if (ap != null) {
+ try {
+ result = AnalysePlanStorage.getParameterValue(ap, paramName);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get analyse plan param value", e);
+ }
+ showMsgBox(e);
+ }
+ }
+ return result;
+ }
+
+ public void setAnalysePlanParameterValue(String paramName, AnalysePlan ap,
+ Object value) {
+ if (log.isDebugEnabled()) {
+ log.debug("paramName : " + paramName + " analysePlanName : " + ap
+ + " value : " + value);
+ }
+ try {
+ AnalysePlanStorage.setParameterValue(ap, paramName, value);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set analyse plan param value", e);
+ }
+ showMsgBox(e);
+ }
+ }
+
+ /*
+ * Sensitivity
+ */
+
+ public List<String> getSensitivityExportNames() {
+ List<String> result = new ArrayList<String>();
+ List<String> exportNames = ExportStorage.getExportNames();
+ for (String export : exportNames) {
+ try {
+ ExportStorage storage = ExportStorage.getExport(export);
+ Export exInstance = storage.getNewExportInstance();
+ if (SensitivityExport.class.isInstance(exInstance)) {
+ result.add(export);
+ }
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get sensitivity export names", e);
+ }
+ }
+ }
+ return result;
+ }
+
+ public List<SensitivityExport> getSensitivityExportList() {
+ List<SensitivityExport> result = new ArrayList<SensitivityExport>();
+ for (Map.Entry<SensitivityExport, String> entry : sensitivityExports
+ .entrySet()) {
+ result.add(entry.getKey());
+ }
+ return result;
+ }
+
+ public void addSensitivityExport(String name) {
+ try {
+ ExportStorage storage = ExportStorage.getExport(name);
+ SensitivityExport exInstance = (SensitivityExport) storage
+ .getNewExportInstance();
+ sensitivityExports.put(exInstance, name);
+ param.setSensitivityExport(getSensitivityExportList());
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't add sensitivity export", e);
+ }
+ }
+ }
+
+ /**
+ * Remove an export.
+ *
+ * @param export export to remove
+ */
+ public void removeSensitivityExport(SensitivityExport export) {
+ sensitivityExports.remove(export);
+ param.setSensitivityExport(getSensitivityExportList());
+ }
+
+ public void clearSensitivityExport() {
+ sensitivityExports.clear();
+ param.setSensitivityExport(getSensitivityExportList());
+ }
+
+ public Map<String, Class<?>> getSensitivityExportParameterNames(
+ SensitivityExport export) {
+ return ExportStorage.getParameterNames(export);
+ }
+
+ public void setSensitivityExportParameterValue(Export export,
+ String paramName, Object value) {
+ if (value != null) {
+ try {
+ ExportStorage.setParameterValue(export, paramName, value);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set sensitivity export param value", e);
+ }
+ }
+ }
+ }
+
+ public Object getSensitivityExportParameterValue(Export export, String paramName) {
+ Object result = null;
+ try {
+ result = ExportStorage.getParameterValue(export, paramName);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get sensitivity export param value", e);
+ }
+ }
+ return result;
+ }
+
+ public List<String> getSensitivityNames() {
+ return SensitivityStorage.getSensitivityNames();
+ }
+
+ public Map<String, Class<?>> getSensitivityParameterNames(String name) {
+ Map<String, Class<?>> result = null;
+ try {
+ SensitivityStorage sens = SensitivityStorage.getSensitivity(name);
+ result = sens.getParameterNames();
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get sensitivity sensitivity params names", e);
+ }
+ }
+ return result;
+ }
+
+ public Object getSensitivityCalculatorParameterValue(String paramName) {
+ Object result = null;
+ try {
+ result = SensitivityStorage.getParameterValue(param
+ .getSensitivityCalculator(), paramName);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't get sensitivity param value", e);
+ }
+ showMsgBox(e);
+ }
+ return result;
+ }
+
+ public void setSensitivityCalculatorParameterValue(String paramName,
+ Object value) {
+ try {
+ if (value != null) {
+ SensitivityStorage.setParameterValue(param
+ .getSensitivityCalculator(), paramName, value);
+ }
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set sensitivity param value", e);
+ }
+ showMsgBox(e);
+ }
+ }
+
+ public SensitivityStorage getSensitivity(String name) {
+ return SensitivityStorage.getSensitivity(name);
+ }
+
+ public void setSensitivity(String name) {
+ try {
+ sensitivityStorage = SensitivityStorage.getSensitivity(name);
+ SensitivityCalculator sensCal = sensitivityStorage
+ .getNewSensitivityInstance();
+ sensitivityCalculator = sensCal;
+ param.setSensitivityCalculator(sensitivityCalculator);
+ } catch (IsisFishException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't set sensitivity", e);
+ }
+ }
+ }
+
+ public List<Factor<? extends Serializable>> getFactors() {
+ List<Factor<? extends Serializable>> result = new ArrayList<Factor<? extends Serializable>>();
+ for (Map.Entry entry : factors.entrySet()) {
+ result.add((Factor<? extends Serializable>) entry.getValue());
+ }
+ return result;
+ }
+
+ public void addFactor(Factor f, JComponent c) {
+ factors.put(f.getPath() + f.getName(), f);
+ factorComponent.put(f.getPath() + f.getName(), c);
+ designPlan.setFactors(getFactors());
+ }
+
+ public Factor<? extends Serializable> getFactor(String name) {
+ return factors.get(name);
+ }
+
+ public void addContinuousFactor(String name, String comment, String path, Double min,
+ Double max, JComponent c, boolean exist) {
+ Factor f = new Factor(name);
+ ContinuousDomain<Serializable> domain = new ContinuousDomain<Serializable>();
+ domain.setMinBound(min);
+ domain.setMaxBound(max);
+ f.setDomain(domain);
+ f.setComment(comment);
+ f.setPath(path);
+ if (exist)
+ removeFactor(f);
+ addFactor(f, c);
+ }
+
+ public void addDiscreteFactor(String name, String comment, String path,
+ List<Serializable> values, JComponent c, boolean exist) {
+ Factor f = new Factor(name);
+ DiscreteDomain<Serializable> domain = new DiscreteDomain<Serializable>();
+ int i = 0;
+ for (Serializable value : values) {
+ // FIXME test when integer
+ // Don't work with String ;(
+ domain.getValues().put(i, value);
+ // and start at 0
+ i++;
+ }
+ f.setDomain(domain);
+ f.setComment(comment);
+ f.setPath(path);
+ if (exist) {
+ removeFactor(f);
+ }
+ addFactor(f, c);
+ }
+
+ public void addContinuousEquationFactor(String name, String comment, String path,
+ EquationContinuousDomain domain, JComponent c,
+ boolean exist) {
+ Factor f = new Factor(name);
+ f.setDomain(domain);
+ f.setComment(comment);
+ f.setPath(path + domain.getVariableName());
+ if (exist)
+ removeFactor(f);
+ addFactor(f, c);
+ }
+
+ public void addContinuousMatrixFactor(String name, String comment, String path,
+ Double coef, MatrixND matrix,
+ String operateur, JComponent c, boolean exist) {
+ Factor f = new Factor(name);
+ MatrixContinuousDomain<Serializable> domain = new MatrixContinuousDomain<Serializable>();
+ domain.setMatrix(matrix);
+ domain.setOperator(operateur);
+ domain.setCoefficient(coef);
+ f.setComment(comment);
+ f.setDomain(domain);
+ f.setPath(path);
+ if (exist) {
+ removeFactor(f);
+ }
+ addFactor(f, c);
+ }
+
+ public JComponent getFactorComponent(Factor f) {
+ return factorComponent.get(f.getPath() + f);
+ }
+
+ public void removeFactor(Factor f) {
+ factors.remove(f.getPath() + f.getName());
+ factorComponent.remove(f.getPath() + f.getName());
+ designPlan.setFactors(getFactors());
+ }
+
+ /*
+ ************
+ * General
+ ************
+ */
+
+ public SimulationParameter getSimulationParameter() {
+ return param;
+ }
+
+ public void setSimulationParameter(SimulationParameter p) {
+ param = p;
+ }
+
+ public SimulationStorage getSimulationStorage() {
+ return simulStorage;
+ }
+
+ public RegionStorage getRegionStorage() {
+ return regionStorage;
+ }
+
+ public List<SimulatorLauncher> getSimulationLauncher() {
+ return SimulationService.getService().getSimulationLaunchers();
+ }
+
+ /**
+ * Launch automatically the simulation, when is possible (no other simulation)
+ * or wait for the last automatically simulation ended.
+ *
+ * @param simulationId id of the simulation to simulate
+ * @param launcher launcher to use
+ *
+ * @see SimulatorLauncher
+ */
+ public void launchSimulation(String simulationId, SimulatorLauncher launcher) {
+
+ String fullSimulationId = "sim_" + simulationId + "_"
+ + DATEFORMAT.format(new java.util.Date());
+
+ // log
+ if (log.isDebugEnabled()) {
+ log.debug("Launch simulation with custom launcher "
+ + launcher.toString());
+ }
+
+ try {
+ if ("".equals(fullSimulationId)
+ || SimulationStorage.localyExists(fullSimulationId)
+ || SimulationService.getService().exists(fullSimulationId)) {
+ UserLog.error(_("isisfish.simulator.simulaction.badid",
+ fullSimulationId));
+ } else {
+ SimulationParameter p = param.copy();
+
+ SimulationService.getService().submit(fullSimulationId, p,
+ launcher, 0);
+ }
+ } catch (Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't start simulation", eee);
+ }
+ showMsgBox(eee);
+ }
+ }
+
+ /**
+ * Launch simulation with factors variations parameters.
+ *
+ * @param simulationId id of the simulation to simulate
+ * @param launcher launcher to use
+ * @param sensitivityCalculator sensitivity calculator to use
+ * @param designPlan design plan for this simulation
+ *
+ * @see SimulatorLauncher
+ * @see SensitivityCalculator
+ * @see DesignPlan
+ */
+ public void launchSimulation(String simulationId,
+ SimulatorLauncher launcher,
+ SensitivityCalculator sensitivityCalculator, DesignPlan designPlan) {
+
+ String fullSimulationId = "as_" + simulationId + "_"
+ + DATEFORMAT.format(new java.util.Date());
+
+ // log
+ if (log.isDebugEnabled()) {
+ log.debug("Launch factor simulation with custom launcher "
+ + launcher.toString());
+ log.debug("Using sensitivityCalculator : "
+ + sensitivityCalculator.getDescription());
+ }
+
+ try {
+ if ("".equals(fullSimulationId)
+ || SimulationStorage.localyExists(fullSimulationId)
+ || SimulationService.getService().exists(fullSimulationId)) {
+ UserLog.error(_("isisfish.simulator.simulaction.badid",
+ fullSimulationId));
+ } else {
+ SimulationParameter p = param.copy();
+ SimulationService.getService().submit(fullSimulationId, p,
+ launcher, 0, sensitivityCalculator, designPlan);
+ }
+ } catch (Exception eee) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't start simulation", eee);
+ }
+ showMsgBox(eee);
+ }
+ }
+
+ public void launchSimulationWhithSensibility(String simulationId,
+ SimulatorLauncher launcher) {
+ launchSimulation(simulationId, launcher, sensitivityCalculator,
+ designPlan);
+ }
+
+ /**
+ * Lance la second passe d'une analyse de sensibilité.
+ *
+ * @param masterSensitivitySimulationName nom du prefix de toutes les simulations (without _)
+ */
+ public void runSensitivitySecondPass(String masterSensitivitySimulationName) {
+
+ // calculator found
+ SensitivityCalculator sensitivityCalculator = null;
+ //List<SimulationStorage> simulationStorageForAnalyze = new ArrayList<SimulationStorage>();
+ SortedMap<Integer, SimulationStorage> simulationStorageForAnalyze = new TreeMap<Integer, SimulationStorage>();
+ File simuationDirectory = SimulationStorage.getSimulationDirectory();
+ for (File simuation : simuationDirectory.listFiles()) {
+ if (simuation.isDirectory()
+ && simuation.getName().startsWith(
+ masterSensitivitySimulationName + "_")) {
+ SimulationStorage storage = SimulationStorage
+ .getSimulation(simuation.getName());
+ String suffix = simuation.getName().substring(
+ simuation.getName().lastIndexOf("_") + 1);
+ simulationStorageForAnalyze.put(Integer.valueOf(suffix),
+ storage);
+
+ if (sensitivityCalculator == null) {
+ // try to find find calculator name in one storage
+ SimulationParameter params = storage.getParameter();
+ sensitivityCalculator = params.getSensitivityCalculator();
+ }
+ }
+ }
+
+ if (sensitivityCalculator != null) {
+ try {
+ // build master sensitivity export directory
+ File masterExportDirectory = new File(IsisFish.config
+ .getDefaultExportDirectory(),
+ masterSensitivitySimulationName);
+ if (!masterExportDirectory.isDirectory()) {
+ masterExportDirectory.mkdirs();
+ }
+ List<SimulationStorage> simulationStorageForAnalyzeList = new ArrayList<SimulationStorage>(
+ simulationStorageForAnalyze.values());
+ sensitivityCalculator.analyzeResult(
+ simulationStorageForAnalyzeList, masterExportDirectory);
+ } catch (SensitivityException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't call analyse result", e);
+ }
+ }
+ } else {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't run sensitivity second pass");
+ }
+ }
+ }
+
+ /**
+ * Renvoie les resultats de la seconde pass.
+ *
+ * @param masterSensitivitySimulationName nom du prefix de toutes les simulations (without _)
+ *
+ * @return les fichiers genere lors de la seconde passe (seulement ceux qui ne commence pas par ".")
+ */
+ public List<File> getSensitivitySecondPassResults(
+ String masterSensitivitySimulationName) {
+
+ List<File> result = new ArrayList<File>();
+
+ // build master sensitivity export directory
+ File masterExportDirectory = new File(IsisFish.config
+ .getDefaultExportDirectory(), masterSensitivitySimulationName);
+ if (masterExportDirectory.isDirectory()) {
+ for (File exportFile : masterExportDirectory.listFiles()) {
+ if (exportFile.isFile()
+ && !exportFile.getName().startsWith(".")) {
+ result.add(exportFile);
+ }
+ }
+ }
+
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,114 +0,0 @@
-<!--
-/* *##%
- * Copyright (C) 2005
- * 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.
- *##%*/
-
-/* *
- * 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 $
- */
- -->
-<JPanel size='{new Dimension(800,600)}' id="simul" layout='{new BorderLayout()}'>
- <script><![CDATA[
- import org.dom4j.DocumentHelper;
- import org.dom4j.Element;
- import jaxx.runtime.JAXXInitialContext;
- import fr.ifremer.isisfish.ui.input.InputAction;
- import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
- import fr.ifremer.isisfish.datastore.StorageException;
- import fr.ifremer.isisfish.entities.FisheryRegionImpl;
-
- public SimulUI(SimulAction action){
- setContextValue(action);
- }
- protected void enablePreSimul(){
- simulTabs.setEnabledAt(1,true);
- selTab(1);
- }
- protected void enableAnalysePlan(){
- simulTabs.setEnabledAt(2,true);
- selTab(2);
- }
- protected void selTab(int i){
- simulTabs.setSelectedIndex(i);
- }
- protected void refreshAll(){
- paramsUI.refresh();
- preSciptUI.refresh();
- sensUI.refresh();
- exportUI.refresh();
- resultChoiceUI.refresh();
- advencedParamsUI.refresh();
- }
- protected void importSimulation(){
- JFileChooser fc = new JFileChooser();
- int returnVal = fc.showOpenDialog(null);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = fc.getSelectedFile();
- //This is where a real application would open the file.
- getContextValue(SimulAction.class).importSimulation(file);
- refreshAll();
- }
- }
- protected void saveSimulation(){
- JFileChooser fc = new JFileChooser();
- int returnVal = fc.showSaveDialog(null);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File file = fc.getSelectedFile();
- //This is where a real application would open the file.
- getContextValue(SimulAction.class).saveSimulation(file);
- }
- }
- ]]>
- </script>
- <JMenuBar id="simulMenuBar" constraints='BorderLayout.NORTH'>
- <JMenu id="simulMenu" text="isisfish.simulation.menu.simulation">
- <JMenuItem id="siSave" text="isisfish.simulation.menu.save" onActionPerformed="saveSimulation()"/>
- <JMenuItem id="siImport" text="isisfish.simulation.menu.import" onActionPerformed="importSimulation()"/>
- </JMenu>
- </JMenuBar>
- <JTabbedPane id="simulTabs" constraints='BorderLayout.CENTER'>
- <tab id="paramsUITab" title='isisfish.params.title'>
- <ParamsUI id="paramsUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- <tab id="preScriptUITab" title='isisfish.preScript.title' enabled='false'>
- <PreScriptsUI id="preSciptUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- <tab id="sensUITab" title='isisfish.sens.title' enabled='false'>
- <SensUI id="sensUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- <tab id="exportUITab" title='isisfish.export.title'>
- <ExportUI id="exportUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- <tab id="resultChoiceUITab" title='isisfish.resultChoice.title'>
- <ResultChoiceUI id="resultChoiceUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- <tab id="advancedParamsUITab" title='isisfish.advancedParameters.title'>
- <AdvancedParamsUI id="advencedParamsUI" constructorParams='getContextValue(SimulAction.class)'/>
- </tab>
- </JTabbedPane>
-</JPanel>
\ No newline at end of file
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,120 @@
+<!--
+/* *##%
+ * 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.
+ *##%*/
+
+/**
+ * SimulUI.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 $
+ */
+ -->
+<JPanel size='{new Dimension(800,600)}' id="simul" layout='{new BorderLayout()}'>
+ <script><![CDATA[
+ import org.dom4j.DocumentHelper;
+ import org.dom4j.Element;
+ import jaxx.runtime.JAXXInitialContext;
+ import fr.ifremer.isisfish.ui.input.InputAction;
+ import fr.ifremer.isisfish.ui.input.InputSaveVerifier;
+ import fr.ifremer.isisfish.datastore.StorageException;
+ import fr.ifremer.isisfish.entities.FisheryRegionImpl;
+ import javax.swing.ToolTipManager;
+
+ public SimulUI(SimulAction action) {
+ setContextValue(action);
+
+ // increase tooltip display time
+ ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
+ toolTipManager.setInitialDelay(0);
+ toolTipManager.setDismissDelay(60000);
+ }
+ protected void enablePreSimul() {
+ simulTabs.setEnabledAt(1,true);
+ selTab(1);
+ }
+ protected void enableAnalysePlan() {
+ simulTabs.setEnabledAt(2,true);
+ selTab(2);
+ }
+ protected void selTab(int i) {
+ simulTabs.setSelectedIndex(i);
+ }
+ protected void refreshAll() {
+ paramsUI.refresh();
+ preSciptUI.refresh();
+ sensUI.refresh();
+ exportUI.refresh();
+ resultChoiceUI.refresh();
+ advencedParamsUI.refresh();
+ }
+ protected void importSimulation() {
+ JFileChooser fc = new JFileChooser();
+ int returnVal = fc.showOpenDialog(null);
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fc.getSelectedFile();
+ //This is where a real application would open the file.
+ getContextValue(SimulAction.class).importSimulation(file);
+ refreshAll();
+ }
+ }
+ protected void saveSimulation() {
+ JFileChooser fc = new JFileChooser();
+ int returnVal = fc.showSaveDialog(null);
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fc.getSelectedFile();
+ //This is where a real application would open the file.
+ getContextValue(SimulAction.class).saveSimulation(file);
+ }
+ }
+ ]]>
+ </script>
+ <JMenuBar id="simulMenuBar" constraints='BorderLayout.NORTH'>
+ <JMenu id="simulMenu" text="isisfish.simulation.menu.simulation">
+ <JMenuItem id="siSave" text="isisfish.simulation.menu.save" onActionPerformed="saveSimulation()"/>
+ <JMenuItem id="siImport" text="isisfish.simulation.menu.import" onActionPerformed="importSimulation()"/>
+ </JMenu>
+ </JMenuBar>
+ <JTabbedPane id="simulTabs" constraints='BorderLayout.CENTER'>
+ <tab id="paramsUITab" title='isisfish.params.title'>
+ <ParamsUI id="paramsUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="preScriptUITab" title='isisfish.preScript.title' enabled='false'>
+ <PreScriptsUI id="preSciptUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="sensUITab" title='isisfish.sens.title' enabled='false'>
+ <SensUI id="sensUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="exportUITab" title='isisfish.export.title'>
+ <ExportUI id="exportUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="resultChoiceUITab" title='isisfish.resultChoice.title'>
+ <ResultChoiceUI id="resultChoiceUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ <tab id="advancedParamsUITab" title='isisfish.advancedParameters.title'>
+ <AdvancedParamsUI id="advencedParamsUI" constructorParams='getContextValue(SimulAction.class)'/>
+ </tab>
+ </JTabbedPane>
+</JPanel>
\ No newline at end of file
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,497 +0,0 @@
-/* *##%
- * 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 static org.codelutin.i18n.I18n._;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.swing.JButton;
-import javax.swing.JList;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
-import fr.ifremer.isisfish.datastore.ExportStorage;
-import fr.ifremer.isisfish.datastore.RuleStorage;
-import fr.ifremer.isisfish.datastore.ScriptStorage;
-import fr.ifremer.isisfish.datastore.SensitivityStorage;
-import fr.ifremer.isisfish.export.Export;
-import fr.ifremer.isisfish.rule.Rule;
-import fr.ifremer.isisfish.simulator.AnalysePlan;
-import fr.ifremer.isisfish.ui.widget.renderer.ToolTipListModel;
-import fr.ifremer.isisfish.util.Doc;
-import fr.ifremer.isisfish.util.DocHelper;
-
-/**
- * This is a factory of {@link ToolTipListModel} used in simulator ui
- *
- * @author chemit
- * @version $Revision$
- *
- * Mise a jour: $Date$
- */
-public class ToolTipListModelFactory {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- private static Log log = LogFactory.getLog(SimulAction.class);
-
- /**
- * Build a new {@link ToolTipListModel} for for @Doc'field of all given
- * 'Result' script field value (we must find back the field name... :
- * <ul>
- * <li>text : the value of the field</li>
- * <li>tooltip : the nicely printed version of the @Doc associated
- * to field</li>
- * </ul>
- *
- * @param names Result script field names
- * @return the model builded
- */
- public static ToolTipListModel createResultFieldsModel(List<String> names) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!names.isEmpty()) {
- try {
- ScriptStorage storage =
- ScriptStorage.getScript("ResultName.java");
- Class resultNameClass = storage.getCodeClass();
- // TODO: if we can't find class, perhaps try to parser Java source ?
- Field[] fields = resultNameClass.getFields();
- Map<String, String> map = new TreeMap<String, String>();
- for (Field f : fields) {
- String fieldName = f.getName();
- String fieldValue = (String) f.get(null);
- if (names.contains(fieldValue)) {
- map.put(fieldValue, fieldName);
- }
- }
- for (String name : names) {
- String fieldName = map.get(name);
- texts.add(name);
- Doc fieldDoc = storage.getFieldDoc(fieldName);
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.doc.resultName"), eee);
- }
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for @Doc'class of all given Export:
- * <ul>
- * <li>text : the name fo the export</li>
- * <li>tooltip : the nicely printed version of the @Doc associated to
- * class of the Export</li>
- * </ul>
- *
- * @param names Export names to use
- * @return the model builded
- */
- public static ToolTipListModel createExportClassDocsModel(List<String> names) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!names.isEmpty()) {
- try {
- for (String name : names) {
- ExportStorage storage = ExportStorage.getExport(name);
- Doc fieldDoc = storage.getClassDoc();
- // suppress .java extension ?
- texts.add(name.substring(0, name.length() - 5));
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.doc.export"), eee);
- }
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for descriptions of given Rule names :
- * <ul>
- * <li>text : the name of the Rule</li>
- * <li>tooltip : the description of the Rule</li>
- * </ul>
- *
- * @param names Rule names
- * @return the model builded
- */
- public static ToolTipListModel createRuleDescriptionsModel(List<String> names) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!names.isEmpty()) {
- try {
- for (String name : names) {
- RuleStorage storage = RuleStorage.getRule(name);
- String description = storage.getDescription();
- // suppress .java extension ?
- texts.add(name.substring(0, name.length() - 5));
- toolTips.add(description);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.doc.rule"), eee);
- }
- }
- }
- // we are using this in Combo and due to bug (I think) with index
- // that is not filled, when coming in getListCellRendererComponent
- // we must also give to model the objects of the model...
- // TODO Fix this
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for descriptions of given Rules :
- * <ul>
- * <li>text : the name of the Rule</li>
- * <li>tooltip : the description of the Rule</li>
- * </ul>
- *
- * @param rules rules to use
- * @param clearButton the clear button linked with list
- * @param list the list containing the renderer
- * @return the model builded
- */
- public static ToolTipListModel createRuleDescriptionsModel2(List<Rule> rules, JButton clearButton, JList list) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!rules.isEmpty()) {
- try {
- for (Rule rule : rules) {
- String name = RuleStorage.getName(rule);
- RuleStorage storage = RuleStorage.getRule(name);
- String description = storage.getDescription();
- // suppress .java extension ?
- texts.add(name);
- toolTips.add(description);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.doc.rule"), eee);
- }
- }
- }
- ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
- // should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
- return listModel;
- }
-
- /**
- * Build a new {@link ToolTipListModel} for params of a given Rule :
- * <ul>
- * <li>text : the name fo the param fo the Rule</li>
- * <li>tooltip : the nicely printed version of the @Doc associated to
- * the param in the Rule</li>
- * </ul>
- *
- * @param ruleName the selected rule name (we only use the first one)
- * @return the model builded
- */
- public static ToolTipListModel createRuleParamsModel(String ruleName) {
-
- if (log.isDebugEnabled()) {
- log.debug("createRuleParamsModel for rules : " + ruleName);
- }
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (StringUtils.isEmpty(ruleName)) {
- return new ToolTipListModel(texts, toolTips);
- }
-
- try {
- RuleStorage storage = RuleStorage.getRule(ruleName);
- Map<String, Class> mapParams = storage.getParameterNames();
-
- if (!mapParams.isEmpty()) {
- for (String paramName : mapParams.keySet()) {
- Doc fieldDoc = storage.getParamDoc(paramName);
- texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field", ruleName), eee);
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for descriptions of given
- * AnalysePlans names :
- * <ul>
- * <li>text : the name of the AnalysePlan</li>
- * <li>tooltip : the description of the AnalysePlan</li>
- * </ul>
- *
- * @param names AnalysePlan names to use
- * @return the model builded
- */
- public static ToolTipListModel createAnalysePlanDescriptionsModel(
- List<String> names) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (names.isEmpty()) {
- return new ToolTipListModel(texts, toolTips);
- }
-
- try {
- for (String name : names) {
- AnalysePlanStorage storage =
- AnalysePlanStorage.getAnalysePlan(name);
- String description = storage.getDescription();
- // suppress .java extension ?
- texts.add(name.substring(0, name.length() - 5));
- toolTips.add(description);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.analyseplan"), eee);
- }
- }
- // we are using this in Combo and due to bug (I think) with index
- // that is not filled, when coming in getListCellRendererComponent
- // we must also give to model the objects of the model...
- // TODO Fix this
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for descriptions of given
- * AnalysePlans :
- * <ul>
- * <li>text : the name of the AnalysePlan</li>
- * <li>tooltip : the description of the AnalysePlan</li>
- * </ul>
- *
- * @param plans plans to use
- * @param clearButton clear button linked to list
- * @param list list containing the renderer
- * @return the model builded
- */
- public static ToolTipListModel createAnalysePlanDescriptionsModel2(
- List<AnalysePlan> plans, JButton clearButton, JList list) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!plans.isEmpty()) {
- try {
- // we are dealing with AnalysePlan objects
- for (AnalysePlan analysePlan : plans) {
- String name = AnalysePlanStorage.getName(analysePlan);
- AnalysePlanStorage storage = AnalysePlanStorage.getAnalysePlan(name);
- String description = storage.getDescription();
- // suppress .java extension ?
- texts.add(name);
- toolTips.add(description);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.analyseplan"), eee);
- }
- }
- }
- ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
- // should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
- return listModel;
- }
-
- /**
- * Build a new {@link ToolTipListModel} for params of a given AnalysePlan :
- * <ul>
- * <li>text : the name fo the param fo the AnalysePlan</li>
- * <li>tooltip : the nicely printed version of the @Doc associated to
- * the param in the AnalysePlan</li>
- * </ul>
- *
- * @param name the selected analyze plan name
- * @return the model builded
- */
- public static ToolTipListModel createAnalysePlanParamsModel(String name) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
- if (name != null && !name.equals("")) {
- try {
- AnalysePlanStorage storage =
- AnalysePlanStorage.getAnalysePlan(name);
- Map<String, Class> mapParams = storage.getParameterNames();
-
- if (!mapParams.isEmpty()) {
- for (String paramName : mapParams.keySet()) {
- Doc fieldDoc = storage.getParamDoc(paramName);
- texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.analyseplan", name), eee);
- }
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for params of a given {link SensitivityCalculator} :
- * <ul>
- * <li>text : the name fo the param fo the AnalysePlan</li>
- * <li>tooltip : the nicely printed version of the @Doc associated to
- * the param in the {link SensitivityCalculator}</li>
- * </ul>
- *
- * @param sensitivityName the sensitivity calculator name
- * @return the model builded
- */
- public static ToolTipListModel createSensitivityParamsModel(String sensitivityName) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
- if (!StringUtils.isEmpty(sensitivityName)) {
- try {
- SensitivityStorage storage =
- SensitivityStorage.getSensitivity(sensitivityName);
- Map<String, Class<?>> mapParams = storage.getParameterNames();
-
- if (!mapParams.isEmpty()) {
- for (String paramName : mapParams.keySet()) {
- Doc fieldDoc = storage.getParamDoc(paramName);
- texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.sensitivitycalculator", sensitivityName), eee);
- }
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for params of a given {@link Export} :
- * <ul>
- * <li>text : the name fo the param fo the AnalysePlan</li>
- * <li>tooltip : the nicely printed version of the @Doc associated to
- * the param in the AnalysePlan</li>
- * </ul>
- *
- * @param exportName the selected export name
- * @return the model builded
- */
- public static ToolTipListModel createExportParamsModel(String exportName) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
- if (!StringUtils.isEmpty(exportName)) {
- try {
- ExportStorage storage =
- ExportStorage.getExport(exportName);
- Map<String, Class<?>> mapParams = storage.getParameterNames();
-
- if (!mapParams.isEmpty()) {
- for (String paramName : mapParams.keySet()) {
- Doc fieldDoc = storage.getParamDoc(paramName);
- texts.add(paramName);
- toolTips.add(DocHelper.asString(fieldDoc));
- }
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.field.export", exportName), eee);
- }
- }
- }
- return new ToolTipListModel(texts, toolTips);
- }
-
- /**
- * Build a new {@link ToolTipListModel} for descriptions of given
- * {@link Export} :
- * <ul>
- * <li>text : the name of the AnalysePlan</li>
- * <li>tooltip : the description of the AnalysePlan</li>
- * </ul>
- *
- * @param exports export to use
- * @param clearButton clear button linked to list
- * @param list list containing the renderer
- * @return the model builded
- */
- public static ToolTipListModel createExportDescriptionsModel2(
- List<? extends Export> exports, JButton clearButton, JList list) {
-
- List<String> texts = new ArrayList<String>();
- List<String> toolTips = new ArrayList<String>();
-
- if (!exports.isEmpty()) {
- try {
- // we are dealing with Export objects
- for (Export export : exports) {
- String name = ExportStorage.getName(export);
- ExportStorage storage = ExportStorage.getExport(name);
- String description = storage.getDescription();
- texts.add(name);
- toolTips.add(description);
- }
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.obtain.analyseplan"), eee);
- }
- }
- }
- ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
- // should check if there is an already listener ?
- SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list.getModel());
- return listModel;
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/ui/simulator/ToolTipListModelFactory.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,556 @@
+/* *##%
+ * 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 static org.codelutin.i18n.I18n._;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.swing.JButton;
+import javax.swing.JList;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SensitivityStorage;
+import fr.ifremer.isisfish.export.Export;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.simulator.AnalysePlan;
+import fr.ifremer.isisfish.ui.widget.renderer.ToolTipListModel;
+import fr.ifremer.isisfish.util.Doc;
+
+/**
+ * This is a factory of {@link ToolTipListModel} used in simulator ui
+ *
+ * @author chemit
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ */
+public class ToolTipListModelFactory {
+
+ /** Class logger. */
+ private static Log log = LogFactory.getLog(ToolTipListModelFactory.class);
+
+ /**
+ * Build a new {@link ToolTipListModel} for for @Doc'field of all given
+ * 'Result' script field value (we must find back the field name... :
+ * <ul>
+ * <li>text : the value of the field</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated
+ * to field</li>
+ * </ul>
+ *
+ * @param names Result script field names
+ * @return the model builded
+ */
+ public static ToolTipListModel createResultFieldsModel(List<String> names) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!names.isEmpty()) {
+ try {
+ ScriptStorage storage = ScriptStorage
+ .getScript("ResultName.java");
+ Class resultNameClass = storage.getCodeClass();
+ // TODO: if we can't find class, perhaps try to parser Java source ?
+ Field[] fields = resultNameClass.getFields();
+ Map<String, String> map = new TreeMap<String, String>();
+ for (Field f : fields) {
+ String fieldName = f.getName();
+ String fieldValue = (String) f.get(null);
+ if (names.contains(fieldValue)) {
+ map.put(fieldValue, fieldName);
+ }
+ }
+ for (String name : names) {
+ String fieldName = map.get(name);
+ texts.add(name);
+ Doc fieldDoc = storage.getFieldDoc(fieldName);
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.doc.resultName"), eee);
+ }
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for @Doc'class of all given Export:
+ * <ul>
+ * <li>text : the name fo the export</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * class of the Export</li>
+ * </ul>
+ *
+ * @param names Export names to use
+ * @return the model builded
+ */
+ public static ToolTipListModel createExportClassDocsModel(List<String> names) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!names.isEmpty()) {
+ try {
+ for (String name : names) {
+ ExportStorage storage = ExportStorage.getExport(name);
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ // suppress .java extension
+ texts.add(name.substring(0, name.length() - 5));
+ toolTips.add(ToolTipListModelFactory.asString(classDoc,
+ description));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.doc.export"), eee);
+ }
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for descriptions of given Rule names :
+ * <ul>
+ * <li>text : the name of the Rule</li>
+ * <li>tooltip : the description of the Rule</li>
+ * </ul>
+ *
+ * @param names Rule names
+ * @return the model builded
+ */
+ public static ToolTipListModel createRuleDescriptionsModel(
+ List<String> names) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!names.isEmpty()) {
+ try {
+ for (String name : names) {
+ RuleStorage storage = RuleStorage.getRule(name);
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ // suppress .java extension ?
+ texts.add(name.substring(0, name.length() - 5));
+ toolTips.add(ToolTipListModelFactory.asString(classDoc,
+ description));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.doc.rule"), eee);
+ }
+ }
+ }
+ // we are using this in Combo and due to bug (I think) with index
+ // that is not filled, when coming in getListCellRendererComponent
+ // we must also give to model the objects of the model...
+ // TODO Fix this
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for descriptions of given Rules :
+ * <ul>
+ * <li>text : the name of the Rule</li>
+ * <li>tooltip : the description of the Rule</li>
+ * </ul>
+ *
+ * @param rules rules to use
+ * @param clearButton the clear button linked with list
+ * @param list the list containing the renderer
+ * @return the model builded
+ */
+ public static ToolTipListModel createRuleDescriptionsModel2(
+ List<Rule> rules, JButton clearButton, JList list) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!rules.isEmpty()) {
+ try {
+ for (Rule rule : rules) {
+ String name = RuleStorage.getName(rule);
+ RuleStorage storage = RuleStorage.getRule(name);
+ String description = storage.getDescription();
+ // suppress .java extension ?
+ texts.add(name);
+ toolTips.add(description);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.doc.rule"), eee);
+ }
+ }
+ }
+ ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
+ // should check if there is an already listener ?
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
+ return listModel;
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for params of a given Rule :
+ * <ul>
+ * <li>text : the name fo the param fo the Rule</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the Rule</li>
+ * </ul>
+ *
+ * @param ruleName the selected rule name (we only use the first one)
+ * @return the model builded
+ */
+ public static ToolTipListModel createRuleParamsModel(String ruleName) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("createRuleParamsModel for rules : " + ruleName);
+ }
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (StringUtils.isEmpty(ruleName)) {
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ try {
+ RuleStorage storage = RuleStorage.getRule(ruleName);
+ Map<String, Class> mapParams = storage.getParameterNames();
+
+ if (!mapParams.isEmpty()) {
+ for (String paramName : mapParams.keySet()) {
+ Doc fieldDoc = storage.getParamDoc(paramName);
+ texts.add(paramName);
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.field", ruleName), eee);
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for descriptions of given
+ * AnalysePlans names :
+ * <ul>
+ * <li>text : the name of the AnalysePlan</li>
+ * <li>tooltip : the description of the AnalysePlan</li>
+ * </ul>
+ *
+ * @param names AnalysePlan names to use
+ * @return the model builded
+ */
+ public static ToolTipListModel createAnalysePlanDescriptionsModel(
+ List<String> names) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (names.isEmpty()) {
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ try {
+ for (String name : names) {
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ // suppress .java extension ?
+ texts.add(name.substring(0, name.length() - 5));
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.analyseplan"), eee);
+ }
+ }
+ // we are using this in Combo and due to bug (I think) with index
+ // that is not filled, when coming in getListCellRendererComponent
+ // we must also give to model the objects of the model...
+ // TODO Fix this
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for descriptions of given
+ * AnalysePlans :
+ * <ul>
+ * <li>text : the name of the AnalysePlan</li>
+ * <li>tooltip : the description of the AnalysePlan</li>
+ * </ul>
+ *
+ * @param plans plans to use
+ * @param clearButton clear button linked to list
+ * @param list list containing the renderer
+ * @return the model builded
+ */
+ public static ToolTipListModel createAnalysePlanDescriptionsModel2(
+ List<AnalysePlan> plans, JButton clearButton, JList list) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!plans.isEmpty()) {
+ try {
+ // we are dealing with AnalysePlan objects
+ for (AnalysePlan analysePlan : plans) {
+ String name = AnalysePlanStorage.getName(analysePlan);
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ // suppress .java extension ?
+ texts.add(name);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.analyseplan"), eee);
+ }
+ }
+ }
+ ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
+ // should check if there is an already listener ?
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
+ return listModel;
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for params of a given AnalysePlan :
+ * <ul>
+ * <li>text : the name fo the param fo the AnalysePlan</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the AnalysePlan</li>
+ * </ul>
+ *
+ * @param name the selected analyze plan name
+ * @return the model builded
+ */
+ public static ToolTipListModel createAnalysePlanParamsModel(String name) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+ if (name != null && !name.equals("")) {
+ try {
+ AnalysePlanStorage storage = AnalysePlanStorage
+ .getAnalysePlan(name);
+ Map<String, Class<?>> mapParams = storage.getParameterNames();
+
+ if (!mapParams.isEmpty()) {
+ for (String paramName : mapParams.keySet()) {
+ Doc fieldDoc = storage.getParamDoc(paramName);
+ texts.add(paramName);
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.field.analyseplan", name),
+ eee);
+ }
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for params of a given {link SensitivityCalculator} :
+ * <ul>
+ * <li>text : the name fo the param fo the AnalysePlan</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the {link SensitivityCalculator}</li>
+ * </ul>
+ *
+ * @param sensitivityName the sensitivity calculator name
+ * @return the model builded
+ */
+ public static ToolTipListModel createSensitivityParamsModel(
+ String sensitivityName) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+ if (!StringUtils.isEmpty(sensitivityName)) {
+ try {
+ SensitivityStorage storage = SensitivityStorage
+ .getSensitivity(sensitivityName);
+ Map<String, Class<?>> mapParams = storage.getParameterNames();
+
+ if (!mapParams.isEmpty()) {
+ for (String paramName : mapParams.keySet()) {
+ Doc fieldDoc = storage.getParamDoc(paramName);
+ texts.add(paramName);
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.field.sensitivitycalculator",
+ sensitivityName), eee);
+ }
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for params of a given {@link Export} :
+ * <ul>
+ * <li>text : the name fo the param fo the AnalysePlan</li>
+ * <li>tooltip : the nicely printed version of the @Doc associated to
+ * the param in the AnalysePlan</li>
+ * </ul>
+ *
+ * @param exportName the selected export name
+ * @return the model builded
+ */
+ public static ToolTipListModel createExportParamsModel(String exportName) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+ if (!StringUtils.isEmpty(exportName)) {
+ try {
+ ExportStorage storage = ExportStorage.getExport(exportName);
+ Map<String, Class<?>> mapParams = storage.getParameterNames();
+
+ if (!mapParams.isEmpty()) {
+ for (String paramName : mapParams.keySet()) {
+ Doc fieldDoc = storage.getParamDoc(paramName);
+ texts.add(paramName);
+ toolTips.add(ToolTipListModelFactory.asString(fieldDoc));
+ }
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.field.export",
+ exportName), eee);
+ }
+ }
+ }
+ return new ToolTipListModel(texts, toolTips);
+ }
+
+ /**
+ * Build a new {@link ToolTipListModel} for descriptions of given
+ * {@link Export} :
+ * <ul>
+ * <li>text : the name of the AnalysePlan</li>
+ * <li>tooltip : the description of the AnalysePlan</li>
+ * </ul>
+ *
+ * @param exports export to use
+ * @param clearButton clear button linked to list
+ * @param list list containing the renderer
+ * @return the model builded
+ */
+ public static ToolTipListModel createExportDescriptionsModel2(
+ List<? extends Export> exports, JButton clearButton, JList list) {
+
+ List<String> texts = new ArrayList<String>();
+ List<String> toolTips = new ArrayList<String>();
+
+ if (!exports.isEmpty()) {
+ try {
+ // we are dealing with Export objects
+ for (Export export : exports) {
+ String name = ExportStorage.getName(export);
+ ExportStorage storage = ExportStorage.getExport(name);
+ Doc classDoc = storage.getClassDoc();
+ String description = storage.getDescription();
+ texts.add(name);
+ toolTips.add(ToolTipListModelFactory.asString(classDoc, description));
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.obtain.analyseplan"), eee);
+ }
+ }
+ }
+ ToolTipListModel listModel = new ToolTipListModel(texts, toolTips);
+ // should check if there is an already listener ?
+ SimulatorListeners.initButtonClearIfListNotEmpty(clearButton, list
+ .getModel());
+ return listModel;
+ }
+
+ /**
+ * Return HTML formatted tooltip.
+ *
+ * Use optional documentation (if any) or use @Doc's class doc.
+ *
+ * @param doc the doc to use
+ * @param optionalDocumentations optional documentation
+ * @return a string nicely print version
+ */
+ protected static String asString(Doc doc, String... optionalDocumentations) {
+
+ String tooltip = null;
+
+ if (doc != null) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<html>");
+ if (!ArrayUtils.isEmpty(optionalDocumentations)) {
+ for (String optionalDocumentation : optionalDocumentations) {
+ sb.append("<p>" + optionalDocumentation + "</p>");
+ }
+ } else {
+ sb.append("<p>" + doc.value() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.author())) {
+ sb.append("<p><b>author: </b>" + doc.author() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.date())) {
+ sb.append("<p><b>date: </b>" + doc.date() + "</p>");
+ }
+ if (!StringUtils.isEmpty(doc.version())) {
+ sb.append("<p><b>version: </b>" + doc.version() + "</p>");
+ }
+ sb.append("</html>");
+ tooltip = sb.toString();
+
+ // replace all \n by <br/>
+ tooltip = tooltip.replace("\n", "<br/>");
+ }
+ return tooltip;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,314 +0,0 @@
-/* *##%
- * 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 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.util;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-
-import org.apache.commons.lang.StringUtils;
-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.datastore.JavaSourceStorage;
-
-/**
- * Compile helper used to compile Java code.
- *
- * JDK must be installed to use compilation.
- * (JRE won't work).
- *
- * Created: 12 janv. 2006 15:29:53
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class CompileHelper {
-
- /** Logger for this class. */
- private static final Log log = LogFactory.getLog(CompileHelper.class);
-
- /**
- * Recherche tous les fichiers qui un source plus recent que la version compilé.
- *
- * @param srcDir
- * @param destDir
- * @return File list
- */
- public static List<File> searchSrcToCompile(File srcDir, File destDir) {
- List<File> result = new ArrayList<File>();
- for (File src : srcDir.listFiles()) {
- File dest = new File(FileUtil.basename(src, ".java"), ".class");
- if (src.getName().endsWith(".java") && FileUtil.isNewer(src, dest)) {
- result.add(src);
- }
- }
- return result;
- }
-
- /**
- * Load la class demandé
- * @param fqn le nom complet de la classe a charger
- * @return la classe souhaité ou null si la class n'est pas trouvée
- */
- public static Class loadClass(String fqn) {
- Class result = null;
- try {
- ClassLoader cl = IsisFish.config.getScriptClassLoader();
- result = cl.loadClass(fqn);
- } catch (ClassNotFoundException eee) {
- log.info(_("isisfish.error.load.class", fqn), eee);
- }
- return result;
- }
-
- public static Object newInstance(String fqn) {
- Object result = null;
- try {
- Class clazz = loadClass(fqn);
-
- if (clazz != null) {
- result = clazz.newInstance();
- }
- } catch (Exception eee) {
- log.warn(_("isisfish.error.instanciate", fqn), eee);
- }
- return result;
- }
-
- /**
- * Compile le fichier source en .class si le source est plus recent que
- * le .class
- * @param source le CodeSourceStorage a compiler
- * @param destDir le repertoire destination de la compilation
- * @param force si vrai alors meme si le fichier destination est plus
- * recent la compilation aura lieu
- * @param out le flux sur lequel le resultat de la compilation doit
- * apparaitre. Peut-etre null, dans ce cas les sorties standards sont
- * utilisées.
- * @return 0 si la compilation a reussi une autre valeur sinon
- */
- public static int compile(JavaSourceStorage source, File destDir,
- boolean force, PrintWriter out) {
- File src = source.getFile();
- File dst = new File(destDir, source.getFQN().replace('.',
- File.separatorChar)
- + ".class");
- if (force || FileUtil.isNewer(src, dst)) {
- return CompileHelper.compile(source.getRoot(), src, destDir, out);
- }
- return 0;
- }
-
- /**
- * Methode permettant de compiler un script, une regle ou un export
- * @param rootSrc le répertoire ou se trouve les sources
- * @param src Le fichier source a compiler, il doit etre dans un sous
- * répertoire de rootSrc en fonction du package
- * @param dest le repertoire destination de la compilation
- * @param out l'objet sur lequel on ecrit la sortie (erreur) de la
- * compilation
- * @return un nombre different de 0 s'il y a une erreur
- * <li> -1000 si l'exception vient de la recherche du compilateur par
- * introspection
- * <li> -10000 si une autre exception
- * <li> sinon les valeurs retourné par le compilateur java
- */
- public static int compile(File rootSrc, File src, File dest, PrintWriter out) {
- int result = compile(rootSrc, Collections.singletonList(src), dest, out);
- return result;
- }
-
- public static int compile(File rootSrc, Collection<File> src, File dest,
- PrintWriter out) {
- int result = -10000;
- try {
- List<File> classpath = new ArrayList<File>();
- classpath.add(rootSrc.getAbsoluteFile());
-
- result = compile(classpath, src, dest, out);
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Compilation faild", eee);
- }
- }
- return result;
- }
-
- /**
- * Compile un fichier java
- * @param src les fichiers java source
- * @param dest le repertoire destination
- */
- protected static int compile(List<File> classpath, Collection<File> src,
- File dest, PrintWriter out) {
- dest.mkdirs();
-
- int result = -1000;
- try {
- //JavaCompiler compiler = JavacTool.create();
- // Use system compiler
- JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
- StandardJavaFileManager fileManager = compiler
- .getStandardFileManager(null, null, null);
- Iterable<? extends JavaFileObject> compilationUnits = fileManager
- .getJavaFileObjectsFromFiles(src);
-
- // Options de compilations
- String classpathAsString = getClassPathAsString(classpath);
- List<String> args = new ArrayList<String>();
- args.add("-g");
- args.add("-classpath");
- args.add(classpathAsString);
- args.add("-d");
- args.add(dest.getAbsolutePath());
-
- // Compilation
- boolean b = compiler.getTask(out, fileManager, null, args, null,
- compilationUnits).call();
- // on retourne 0 si tout s'est bien déroulé et -1 sinon
- result = b ? 0 : -1;
-
- fileManager.close();
- } catch (Exception eee) {
- if (log.isWarnEnabled()) {
- log.warn("Can't get compiler", eee);
- }
- }
- return result;
- }
-
- /**
- * @return
- */
- private static String getClassPathAsString(List<File> classpath)
- throws Exception {
- String result = StringUtils.join(classpath.iterator(),
- File.pathSeparator)
- + File.pathSeparator + System.getProperty("java.class.path");
-
- // Ajout des jars
- for (Enumeration<?> e = CompileHelper.class.getClassLoader()
- .getResources("META-INF/MANIFEST.MF"); e.hasMoreElements();) {
- URL url = (URL) e.nextElement();
- if ((url != null) && url.getFile().startsWith("file:/")) {
- String jarName = url.getPath().substring(5,
- url.getPath().indexOf("!"));
- if (!result.contains(jarName)) {
- result += File.pathSeparator + jarName;
- }
- }
- }
-
- // FIXME just for test to run in maven
- // In this case, current project in not packaged ad jar
- // and no META-INF/MANIFEST.MF could be found...
- File targetClassesFile = new File("target", "classes");
- if (targetClassesFile.isDirectory()) {
- result += File.pathSeparator + targetClassesFile.getAbsolutePath();
- }
-
- if (log.isDebugEnabled()) {
- log.debug("CLASSPATH : " + result);
- }
-
- return result;
- }
-
- /**
- * Extract documentation from interface (Equation)
- * @param category
- * @param name
- * @param javaInterface
- * @return doc
- */
- public static String extractDoc(String category, String name,
- Class javaInterface) {
- String content = "";
- content = "<p>Equation : "
- + createHREF(javaInterface.getName(), category) + " - " + name
- + "</p>";
- content += "<h3>Parameter: name and type</h3>";
-
- Method[] methods = javaInterface.getDeclaredMethods();
- Method interfaceMethod = methods[0];
-
- Args args = interfaceMethod.getAnnotation(Args.class);
- String[] names = args.value();
-
- String[] stringTypes = null;
- ArgTypes argTypes = interfaceMethod.getAnnotation(ArgTypes.class);
- if (argTypes != null) {
- stringTypes = argTypes.value();
- } else {
- stringTypes = new String[names.length];
- Class[] types = interfaceMethod.getParameterTypes();
- for (int i = 0; i < types.length; i++) {
- stringTypes[i] = types[i].getName();
- }
- }
-
- for (int i = 0; i < names.length; i++) {
- content += "<li>" + names[i] + " : " + createHREF(stringTypes[i]);
- // if (i+1<names.length) {
- // content += "\n";
- // }
- }
-
- try {
- FileUtil.writeString(new File("/tmp/testDoc.html"), content);
- } catch (IOException eee) {
- if (log.isWarnEnabled()) {
- log.warn("TODO untreated error", eee);
- }
- }
- return content;
- }
-
- private static String createHREF(String type, String... texts) {
- String ref = IsisFish.config.getJavadocURL()
- + type.replaceAll("\\.", "/") + ".html";
- String text = type;
- if (texts.length > 0) {
- text = texts[0];
- }
- String result = "<a href='" + ref + "'>" + text + "</a>";
- return result;
- }
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java (from rev 2090, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/CompileHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,335 @@
+/* *##%
+ * 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 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.util;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import org.apache.commons.lang.StringUtils;
+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.datastore.JavaSourceStorage;
+
+/**
+ * Compile helper used to compile Java code.
+ *
+ * JDK must be installed to use compilation.
+ * (JRE won't work).
+ *
+ * Created: 12 janv. 2006 15:29:53
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class CompileHelper {
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(CompileHelper.class);
+
+ /**
+ * Recherche tous les fichiers qui un source plus recent que la version compilé.
+ *
+ * @param srcDir
+ * @param destDir
+ * @return File list
+ */
+ public static List<File> searchSrcToCompile(File srcDir, File destDir) {
+ List<File> result = new ArrayList<File>();
+ for (File src : srcDir.listFiles()) {
+ File dest = new File(FileUtil.basename(src, ".java"), ".class");
+ if (src.getName().endsWith(".java") && FileUtil.isNewer(src, dest)) {
+ result.add(src);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Load la class demandé
+ * @param fqn le nom complet de la classe a charger
+ * @return la classe souhaité ou null si la class n'est pas trouvée
+ */
+ public static Class loadClass(String fqn) {
+ Class result = null;
+ try {
+ ClassLoader cl = IsisFish.config.getScriptClassLoader();
+ result = cl.loadClass(fqn);
+ } catch (ClassNotFoundException eee) {
+ log.info(_("isisfish.error.load.class", fqn), eee);
+ }
+ return result;
+ }
+
+ public static Object newInstance(String fqn) {
+ Object result = null;
+ try {
+ Class clazz = loadClass(fqn);
+
+ if (clazz != null) {
+ result = clazz.newInstance();
+ }
+ } catch (Exception eee) {
+ log.warn(_("isisfish.error.instanciate", fqn), eee);
+ }
+ return result;
+ }
+
+ /**
+ * Compile le fichier source en .class si le source est plus recent que
+ * le .class
+ * @param source le JavaSourceStorage a compiler
+ * @param destDir le repertoire destination de la compilation
+ * @param force si vrai alors meme si le fichier destination est plus
+ * recent la compilation aura lieu
+ * @param out le flux sur lequel le resultat de la compilation doit
+ * apparaitre. Peut-etre null, dans ce cas les sorties standards sont
+ * utilisées.
+ * @return 0 si la compilation a reussi une autre valeur sinon
+ */
+ public static int compile(JavaSourceStorage source, File destDir,
+ boolean force, PrintWriter out) {
+ File src = source.getFile();
+ File dst = new File(destDir, source.getFQN().replace('.',
+ File.separatorChar)
+ + ".class");
+ if (force || FileUtil.isNewer(src, dst)) {
+ return compile(source.getRoot(), src, destDir, out);
+ }
+ return 0;
+ }
+
+ /**
+ * Methode permettant de compiler un fichier Java.
+ *
+ * @param rootSrc le répertoire ou se trouve les sources
+ * @param src Le fichier source a compiler, il doit etre dans un sous
+ * répertoire de rootSrc en fonction du package
+ * @param dest le repertoire destination de la compilation
+ * @param out l'objet sur lequel on ecrit la sortie (erreur) de la
+ * compilation
+ * @return un nombre different de 0 s'il y a une erreur
+ * <li> -1000 si l'exception vient de la recherche du compilateur par
+ * introspection
+ * <li> -10000 si une autre exception
+ * <li> sinon les valeurs retourné par le compilateur java
+ */
+ public static int compile(File rootSrc, File src, File dest, PrintWriter out) {
+ int result = compile(rootSrc, Collections.singletonList(src), dest, out);
+ return result;
+ }
+
+ /**
+ * Methode permettant de compiler un ensemble de fichiers Java.
+ *
+ * @param rootSrc le répertoire ou se trouve les sources
+ * @param src Le fichier source a compiler, il doit etre dans un sous
+ * répertoire de rootSrc en fonction du package
+ * @param dest le repertoire destination de la compilation
+ * @param out l'objet sur lequel on ecrit la sortie (erreur) de la
+ * compilation
+ * @return un nombre different de 0 s'il y a une erreur
+ * <li> -1000 si l'exception vient de la recherche du compilateur par
+ * introspection
+ * <li> -10000 si une autre exception
+ * <li> sinon les valeurs retourné par le compilateur java
+ */
+ public static int compile(File rootSrc, Collection<File> src, File dest,
+ PrintWriter out) {
+ int result = -10000;
+ try {
+ List<File> classpath = new ArrayList<File>();
+ classpath.add(rootSrc.getAbsoluteFile());
+
+ result = compile(classpath, src, dest, out);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Compilation failed", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Compile un fichier java.
+ *
+ * @param src les fichiers java source
+ * @param dest le repertoire destination
+ */
+ protected static int compile(List<File> classpath, Collection<File> src,
+ File dest, PrintWriter out) {
+ dest.mkdirs();
+
+ int result = -1000;
+ try {
+ //JavaCompiler compiler = JavacTool.create();
+ // Use system compiler
+ JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+ StandardJavaFileManager fileManager = compiler
+ .getStandardFileManager(null, null, null);
+ Iterable<? extends JavaFileObject> compilationUnits = fileManager
+ .getJavaFileObjectsFromFiles(src);
+
+ // Options de compilations
+ String classpathAsString = getClassPathAsString(classpath);
+ List<String> args = new ArrayList<String>();
+ args.add("-g");
+ args.add("-classpath");
+ args.add(classpathAsString);
+ args.add("-d");
+ args.add(dest.getAbsolutePath());
+
+ // Compilation
+ boolean b = compiler.getTask(out, fileManager, null, args, null,
+ compilationUnits).call();
+ // on retourne 0 si tout s'est bien déroulé et -1 sinon
+ result = b ? 0 : -1;
+
+ fileManager.close();
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get compiler", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Return full classpath (for compilation or javadoc) as string.
+ * Separated by {@link File.pathSeparator}.
+ *
+ * Add :
+ * <ul>
+ * <li>System.getProperty("java.class.path")
+ * <li>All first jar dependency (META-INF/MANIFEST.MF)
+ * <li>target/classes (if exists : for maven tests)
+ * </ul>
+ * @return classptah as string
+ */
+ protected static String getClassPathAsString(List<File> classpath)
+ throws Exception {
+ String result = StringUtils.join(classpath.iterator(),
+ File.pathSeparator)
+ + File.pathSeparator + System.getProperty("java.class.path");
+
+ // Ajout des jars
+ for (Enumeration<?> e = CompileHelper.class.getClassLoader()
+ .getResources("META-INF/MANIFEST.MF"); e.hasMoreElements();) {
+ URL url = (URL) e.nextElement();
+ if (log.isDebugEnabled()) {
+ log.debug("Found manifest : " + url);
+ }
+ if ((url != null) && url.getFile().startsWith("file:/")) {
+ String jarName = url.getPath().substring(5,
+ url.getPath().indexOf("!"));
+ if (!result.contains(jarName)) {
+ result += File.pathSeparator + jarName;
+ }
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("CLASSPATH : " + result);
+ }
+
+ return result;
+ }
+
+ /**
+ * Extract documentation from interface (Equation)
+ * @param category
+ * @param name
+ * @param javaInterface
+ * @return doc
+ */
+ public static String extractDoc(String category, String name,
+ Class javaInterface) {
+ String content = "";
+ content = "<p>Equation : "
+ + createHREF(javaInterface.getName(), category) + " - " + name
+ + "</p>";
+ content += "<h3>Parameter: name and type</h3>";
+
+ Method[] methods = javaInterface.getDeclaredMethods();
+ Method interfaceMethod = methods[0];
+
+ Args args = interfaceMethod.getAnnotation(Args.class);
+ String[] names = args.value();
+
+ String[] stringTypes = null;
+ ArgTypes argTypes = interfaceMethod.getAnnotation(ArgTypes.class);
+ if (argTypes != null) {
+ stringTypes = argTypes.value();
+ } else {
+ stringTypes = new String[names.length];
+ Class[] types = interfaceMethod.getParameterTypes();
+ for (int i = 0; i < types.length; i++) {
+ stringTypes[i] = types[i].getName();
+ }
+ }
+
+ for (int i = 0; i < names.length; i++) {
+ content += "<li>" + names[i] + " : " + createHREF(stringTypes[i]);
+ // if (i+1<names.length) {
+ // content += "\n";
+ // }
+ }
+
+ try {
+ FileUtil.writeString(new File("/tmp/testDoc.html"), content);
+ } catch (IOException eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("TODO untreated error", eee);
+ }
+ }
+ return content;
+ }
+
+ private static String createHREF(String type, String... texts) {
+ String ref = IsisFish.config.getJavadocURL()
+ + type.replaceAll("\\.", "/") + ".html";
+ String text = type;
+ if (texts.length > 0) {
+ text = texts[0];
+ }
+ String result = "<a href='" + ref + "'>" + text + "</a>";
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,40 +0,0 @@
-package fr.ifremer.isisfish.util;
-
- at java.lang.annotation.Retention(value =
- java.lang.annotation.RetentionPolicy.RUNTIME
-)
-
- at java.lang.annotation.Target(value = {
- java.lang.annotation.ElementType.FIELD,
- java.lang.annotation.ElementType.TYPE
- }
-)
-
-/**
- * used by user to add informations about a code he wrote.
- * @see Rule
- * @see AnalysePlan
- * @see Export
- */
-
-public @interface Doc {
- /**
- * @return the content of the documentation
- */
- String value();
-
- /**
- * @return optional date
- */
- String date() default "";
-
- /**
- * @return optional version
- */
- String version() default "";
-
- /**
- * @return optional author of the documentation
- */
- String author() default "";
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Doc.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Doc.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,58 @@
+/* *##%
+ * 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.util;
+
+/**
+ * Used by user to add informations about a code he wrote.
+ *
+ * @author chemit
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+ at java.lang.annotation.Retention(value =
+ java.lang.annotation.RetentionPolicy.RUNTIME)
+ at java.lang.annotation.Target(value = {
+ java.lang.annotation.ElementType.FIELD,
+ java.lang.annotation.ElementType.TYPE
+ })
+public @interface Doc {
+
+ /**
+ *
+ * @return the content of the documentation
+ */
+ String value();
+
+ /**
+ * @return optional date
+ */
+ String date() default "";
+
+ /**
+ * @return optional version
+ */
+ String version() default "";
+
+ /**
+ * @return optional author of the documentation
+ */
+ String author() default "";
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,148 +0,0 @@
-/* *##%
- * Copyright (C) 2007 - 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.util;
-
-import static org.codelutin.i18n.I18n._;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.lang.reflect.Field;
-
-/**
- * Class containg usefull methods to obtain @Doc informations
- * for a class,field,method...
- *
- * @author chemit
- */
-public class DocHelper {
- /** Logger for this class */
- private static final Log log = LogFactory.getLog(DocHelper.class);
-
- /**
- * @param klazz class to use
- * @return the @Doc associated with the class of null if klazz is null or
- * there is no Doc for this klazz
- */
- public static Doc getClassDoc(Class<?> klazz) {
- return klazz == null ? null : klazz.getAnnotation(Doc.class);
- }
-
- /**
- * @param value object given
- * @return the @Doc associated to the class of the given object, or null if value is
- * null or no doc found for his class
- */
- public static Doc getClassDoc(Object value) {
- return value == null ? null : getClassDoc(value.getClass());
- }
-
- /**
- * @param f file to use
- * @return the @Doc associated to the field, or null
- * if field is null of no @doc found
- */
- public static Doc getFieldDoc(Field f) {
- return f == null ? null : f.getAnnotation(Doc.class);
- }
-
- /**
- * @param klazz klazz to use
- * @param fieldName flied name ot use
- * @return the @Doc asosciated with e filed of the given class,
- * or null if clazz is null, field does not exist, or no
- * Doc for the field
- */
- public static Doc getFieldDoc(Class klazz, String fieldName) {
- Field f = null;
- try {
- f = klazz == null ? null : klazz.getField(fieldName);
- } catch (NoSuchFieldException e) {
- // should never appear
- log.warn(_("isisfish.error.not.found.field.class", fieldName,
- klazz));
- //throw new IsisFishRuntimeException(e);
- }
- return f == null ? null : f.getAnnotation(Doc.class);
- }
-
- /**
- * @param doc doc to use
- * @return the {@link Doc#value()} of the given @Doc
- */
- public static String getValue(Doc doc) {
- return doc == null ? "" : doc.value();
- }
-
- /**
- * @param doc doc to use
- * @return the {@link Doc#author()}} of the given @Doc
- */
- public static String getAuthor(Doc doc) {
- return doc == null ? "" : doc.author();
- }
-
- /**
- * @param doc doc to use
- * @return the {@link Doc#date()} of the given @Doc
- */
- public static String getDate(Doc doc) {
- return doc == null ? "" : doc.date();
- }
-
- /**
- * @param doc doc to use
- * @return the {@link Doc#version()} of the given @Doc
- */
- public static String getVersion(Doc doc) {
- return doc == null ? "" : doc.version();
- }
-
- /**
- * @param doc the doc to use
- * @return a string nicely print version
- */
- public static String asString(Doc doc) {
- StringBuilder sb = new StringBuilder();
- if (doc == null) {
- return "";
- }
- sb.append(doc.value());
- boolean more = false;
- StringBuilder sb2 = new StringBuilder();
- if (!"".equals(doc.author())) {
- sb2.append(", author: ").append(doc.author());
- more = true;
- }
- if (!"".equals(doc.date())) {
- sb2.append(", date: ").append(doc.date());
- more = true;
- }
- if (!"".equals(doc.version())) {
- sb2.append(", version: ").append(doc.version());
- more = true;
- }
- if (more) {
- sb.append(" <").append(sb2.toString().substring(2)).append(">");
- }
- return sb.toString();
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/DocHelper.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/DocHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,134 @@
+/* *##%
+ * Copyright (C) 2007 - 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.util;
+
+import static org.codelutin.i18n.I18n._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.lang.reflect.Field;
+
+/**
+ * Class containing usefull methods to obtain @Doc informations
+ * for a class,field,method...
+ *
+ * @author chemit
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class DocHelper {
+
+ /** Logger for this class */
+ private static final Log log = LogFactory.getLog(DocHelper.class);
+
+ /**
+ * @param klazz class to use
+ * @return the @Doc associated with the class of null if klazz is null or
+ * there is no Doc for this klazz
+ */
+ public static Doc getClassDoc(Class<?> klazz) {
+ return klazz == null ? null : klazz.getAnnotation(Doc.class);
+ }
+
+ /**
+ * @param value object given
+ * @return the @Doc associated to the class of the given object, or null if value is
+ * null or no doc found for his class
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static Doc getClassDoc(Object value) {
+ return value == null ? null : getClassDoc(value.getClass());
+ }
+
+ /**
+ * @param f file to use
+ * @return the @Doc associated to the field, or null
+ * if field is null of no @doc found
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static Doc getFieldDoc(Field f) {
+ return f == null ? null : f.getAnnotation(Doc.class);
+ }
+
+ /**
+ * @param klazz class to use
+ * @param fieldName field name to use
+ * @return the @Doc associated with e filed of the given class,
+ * or null if class is null, field does not exist, or no
+ * Doc for the field
+ */
+ public static Doc getFieldDoc(Class<?> klazz, String fieldName) {
+ Field f = null;
+ try {
+ f = klazz == null ? null : klazz.getField(fieldName);
+ } catch (NoSuchFieldException e) {
+ // should never appear
+ log.warn(_("isisfish.error.not.found.field.class", fieldName,
+ klazz));
+ //throw new IsisFishRuntimeException(e);
+ }
+ return f == null ? null : f.getAnnotation(Doc.class);
+ }
+
+ /**
+ * @param doc doc to use
+ * @return the {@link Doc#value()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static String getValue(Doc doc) {
+ return doc == null ? "" : doc.value();
+ }
+
+ /**
+ * @param doc doc to use
+ * @return the {@link Doc#author()}} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static String getAuthor(Doc doc) {
+ return doc == null ? "" : doc.author();
+ }
+
+ /**
+ * @param doc doc to use
+ * @return the {@link Doc#date()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static String getDate(Doc doc) {
+ return doc == null ? "" : doc.date();
+ }
+
+ /**
+ * @param doc doc to use
+ * @return the {@link Doc#version()} of the given @Doc
+ *
+ * @deprecated as of 20090408 never used
+ */
+ public static String getVersion(Doc doc) {
+ return doc == null ? "" : doc.version();
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,23 +0,0 @@
-package fr.ifremer.isisfish.util;
-
-/**
- * This is the contract to be realize by any class wich wanted to have a @Doc support.
- *
- * @author chemit
- * @see Doc
- * @see DocHelper
- */
-public interface Docable {
-
- /** @return the @Doc of the class, or null if none */
- Doc getClassDoc();
-
- /**
- * @param fieldName name of the field to use
- * @return the @Doc of the field, or null if none
- */
- Doc getFieldDoc(String fieldName);
-
- /** @return the description of the class, or null if none */
- String getDescription();
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java (from rev 2088, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Docable.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Docable.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,55 @@
+/* *##%
+ * 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.util;
+
+/**
+ * This is the contract to be realize by any class which wanted to have a @Doc support.
+ *
+ * @author chemit
+ * @see Doc
+ * @see DocHelper
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public interface Docable {
+
+ /**
+ * Class documentation (if any).
+ *
+ * @return the @Doc of the class, or null if none
+ */
+ Doc getClassDoc();
+
+ /**
+ * Field documentation (if any).
+ *
+ * @param fieldName name of the field to use
+ * @return the @Doc of the field, or null if none
+ */
+ Doc getFieldDoc(String fieldName);
+
+ /**
+ * Class documentation (if any).
+ *
+ * @return the description of the class, or null if none
+ */
+ String getDescription();
+}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java (from rev 2090, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/JavadocHelper.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,147 @@
+/* *##%
+ * Copyright (C) 2009 Ifremer, Code Lutin
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+package fr.ifremer.isisfish.util;
+
+import static org.codelutin.i18n.I18n._;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import org.apache.commons.lang.StringUtils;
+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.datastore.JavaSourceStorage;
+
+/**
+ * Helper for javadoc.
+ *
+ * Use "javadoc" executable tools located in JAVA_HOME.
+ *
+ * @author chatellier
+ * @version $Revision: 2087 $
+ *
+ * Last update: $Date: 2009-04-08 12:22:41 +0200 (mer. 08 avril 2009) $
+ * by : $Author: chatellier $
+ *
+ * @see CompileHelper for classpath purpose
+ * @since 3.2.0.4
+ */
+public class JavadocHelper {
+
+ /** Logger for this class. */
+ private static final Log log = LogFactory.getLog(JavadocHelper.class);
+
+ /** Java home. */
+ private static final String JAVA_HOME = System.getProperty("java.home");
+
+
+ public static int generateJavadoc(JavaSourceStorage source, File destDir,
+ boolean force, PrintWriter out) {
+ File src = source.getFile();
+ File dst = new File(destDir, source.getFQN().replace('.', File.separatorChar) + ".html");
+ if (force || FileUtil.isNewer(src, dst)) {
+ return generateJavadoc(source.getRoot(), src, destDir, out);
+ }
+ return 0;
+ }
+
+ /**
+ * Generate single file javadoc.
+ *
+ * @param rootSrc le repertoire de toutes les sources
+ * @param fileSrc le fichier dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ public static int generateJavadoc(File rootSrc, File fileSrc, File dest, PrintWriter out) {
+ int result = generateJavadoc(rootSrc, Collections.singletonList(fileSrc), dest, out);
+ return result;
+ }
+
+ /**
+ * Generate file collection javadoc.
+ *
+ * @param rootSrc le repertoire de toutes les sources
+ * @param filesSrc les fichiers dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ public static int generateJavadoc(File rootSrc, Collection<File> filesSrc, File dest,
+ PrintWriter out) {
+ int result = -1;
+ try {
+ List<File> classpath = new ArrayList<File>();
+ classpath.add(rootSrc.getAbsoluteFile());
+ result = generateJavadoc(classpath, filesSrc, dest, out);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Javadoc failed", eee);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Generate file collection javadoc.
+ *
+ * @param classpath common classpath
+ * @param filesSrc les fichiers dont on veut la javadoc
+ * @param dest le répertoire de destination de la javadoc
+ * @param out le flux de sortie (peut etre null)
+ * @return le resulat de sortie de l'executable javadoc (0 si ok)
+ */
+ protected static int generateJavadoc(List<File> classpath, Collection<File> filesSrc,
+ File dest, PrintWriter out) {
+
+ int result = 0;
+
+ // make destination directory
+ dest.mkdirs();
+
+ try {
+ // Options de compilations
+ String classpathAsString = CompileHelper.getClassPathAsString(classpath);
+
+
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't get compiler", eee);
+ }
+ }
+ return result;
+ }
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,198 +0,0 @@
-/* *##%
- * Copyright (C) 2002-2008 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
- * 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.util;
-
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Stack;
-import org.apache.commons.lang.time.DurationFormatUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Permet de tracer les appels aux methodes utilisateur ainsi que l'execution
- * a ces methodes. La difference entre les deux est lors de l'utilisation du
- * cache les appels seront superieur a l'execution car certaine valeur seront
- * reutilisé dans le cache
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-public class Trace {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(Trace.class);
-
- /** nombre d'appel Cache inclus*/
- final static public int STAT_CALL = 0;
- /** nombre d'appel reel qui a fait le calcul*/
- final static public int STAT_COMPUTATION = 1;
- /** nombre d'appel vers une autre e depuis cette methode */
- final static public int STAT_CALL_NEST_METHOD = 2;
- /** temps mini d'execution de cette methode (sans le temps des autres methodes) */
- final static public int STAT_TIME_MIN = 3;
- /** temps max d'execution de cette methode (sans le temps des autres methodes) */
- final static public int STAT_TIME_MAX = 4;
- /** temps total d'execution de cette methode (sans le temps des autres methodes) */
- final static public int STAT_TIME_TOTAL = 5;
- /** temps total d'execution de cette methode (avec le temps des autres methodes) */
- final static public int STAT_TIME_TOTAL_NEST_METHOD = 6;
-
- /** nombre d'appel vers une autre e depuis cette methode */
- final static private int STACK_CALL_NEST_METHOD = 0;
- /** heure de depart de l'appel a la methode (sans le temps des autres methodes) */
- final static private int STACK_TIME_START = 1;
- /** heure de depart de l'appel a la methode (avec le temps des autres methodes) */
- final static private int STACK_TIME_START_NEST_METHOD = 2;
-
-
- protected String name = "";
-
- /** array : [call's numbers, call do, min time, max time, total time, total time with child]*/
- protected Map<String, long[]> statistics = new LinkedHashMap<String, long[]>();
-
- /** array : [nest e call, start time, start time with child] */
- protected Stack<long[]> callStack = new Stack<long[]>();
-
- public Trace(String name) {
- this.name = name;
- }
-
- public long[] getStatistics(Object e) {
- String key = String.valueOf(e);
- long [] result = statistics.get(key);
- if (result == null) {
- result = new long[]{0, 0, 0, 0, 0, 0, 0};
- statistics.put(key, result);
- }
- return result;
- }
-
- public void traceBefore () {
- // ajout dans le stack
- long current = System.nanoTime();
- long [] stackItem = new long[]{0, current, current};
- callStack.push(stackItem);
- }
-
- public void traceAfterCall (Object e) {
- traceAfter(e, false);
- }
- public void traceAfterComputation (Object e) {
- traceAfter(e, true);
- }
-
- protected void traceAfter(Object e, boolean computation) {
- long current = System.nanoTime();
-
- if (callStack.isEmpty()) {
- log.warn("Empty stack in after for " + e);
- } else {
- long [] stackItem = callStack.pop();
- long timeSpent = current - stackItem[STACK_TIME_START];
- long timeSpentNestMethod = current - stackItem[STACK_TIME_START_NEST_METHOD];
-
- long [] stat = getStatistics(e);
- if (computation) {
- stat[STAT_COMPUTATION]++; // add +1 to computation number
- } else {
- // on incremente pas tout le temps STAT_CALL, car le plus
- // souvent lors de l'utilisation de l'objet Trace dans un cache
- // on a deja compte l'appel et reappelle lui meme computation
- // ce qui ferait 2 appel alors qu'il n'y en a qu'un en realite
- stat[STAT_CALL]++; // add +1 to call number
- }
- stat[STAT_CALL_NEST_METHOD] += stackItem[STACK_CALL_NEST_METHOD];
- stat[STAT_TIME_TOTAL] += timeSpent;
- stat[STAT_TIME_TOTAL_NEST_METHOD] += timeSpentNestMethod;
- if (stat[STAT_TIME_MIN] > timeSpent) {
- stat[STAT_TIME_MIN] = timeSpent;
- }
- if (stat[STAT_TIME_MAX] < timeSpent) {
- stat[STAT_TIME_MAX] = timeSpent;
- }
-
- if (!callStack.isEmpty()) {
- long [] parent = callStack.peek();
- parent[STACK_CALL_NEST_METHOD]++; // add +1 to call number nest e
- parent[STACK_TIME_START] += timeSpentNestMethod; // remove to time all time spent in nest e (yes + to remove :)
- }
- }
-
- // ajouter le delta de temps dans le temps passé dans la méthod
-
- // il faud garder le temps passé dans l'appel d'autre methode de la stack
- // --> A
- // =========
- // --> B
- // <-- B
- // =========
- // --> C
- // --> D
- // <-- D
- // <-- C
- // =========
- // <-- A
-
- // le temps reellement passé dans A est representé par les =====
- }
-
- public String printStatisticAndClear() {
- long call = 0;
- long computation = 0;
- StringBuffer result = new StringBuffer();
- result.append("--- " + name + " Statistics ---\n");
- for (String e : statistics.keySet()) {
- long[] stat = getStatistics(e);
- long meanTime = stat[STAT_TIME_TOTAL] / stat[STAT_COMPUTATION];
- call += stat[STAT_CALL];
- computation += stat[STAT_COMPUTATION];
- result.append(
- e +
- " call: " + stat[STAT_CALL] +
- " computation: " + stat[STAT_COMPUTATION] +
- // usage du cache
- "(" + (100*stat[STAT_COMPUTATION]/stat[STAT_CALL]) + "%)" +
- // Time is in nano not millis, we must divide by 1000000
- " min: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_MIN] / 1000000, "s'.'S") +
- " mean: " + DurationFormatUtils.formatDuration(meanTime / 1000000, "s'.'S") +
- " max: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_MAX] / 1000000, "s'.'S") +
- " total: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_TOTAL] / 1000000, "s'.'S") +
- " call_nest: " + stat[STAT_CALL_NEST_METHOD] +
- " total_with_nest: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_TOTAL_NEST_METHOD] / 1000000, "s'.'S") +
- "\n");
- }
- result.append("--------------------\n");
- result.append("Total call: " + call + "\n");
- result.append("Total computation: " + computation + "\n");
- result.append("Cache usage: " + (100 * (call-computation) / (call+1/*+1 pour la / par 0 */) ) + "%" + "\n");
- result.append("--------------------\n");
- callStack.clear();
- statistics.clear();
-
- System.out.println(result.toString());
- return result.toString();
- }
-
-}
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java (from rev 2092, isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/Trace.java)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/java/fr/ifremer/isisfish/util/Trace.java 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,204 @@
+/* *##%
+ * 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
+ * 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.util;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Stack;
+import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Permet de tracer les appels aux methodes utilisateur ainsi que l'execution
+ * a ces methodes. La difference entre les deux est lors de l'utilisation du
+ * cache les appels seront superieur a l'execution car certaine valeur seront
+ * reutilisé dans le cache.
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class Trace {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(Trace.class);
+
+ /** nombre d'appel Cache inclus*/
+ final static public int STAT_CALL = 0;
+ /** nombre d'appel reel qui a fait le calcul*/
+ final static public int STAT_COMPUTATION = 1;
+ /** nombre d'appel vers une autre e depuis cette methode */
+ final static public int STAT_CALL_NEST_METHOD = 2;
+ /** temps mini d'execution de cette methode (sans le temps des autres methodes) */
+ final static public int STAT_TIME_MIN = 3;
+ /** temps max d'execution de cette methode (sans le temps des autres methodes) */
+ final static public int STAT_TIME_MAX = 4;
+ /** temps total d'execution de cette methode (sans le temps des autres methodes) */
+ final static public int STAT_TIME_TOTAL = 5;
+ /** temps total d'execution de cette methode (avec le temps des autres methodes) */
+ final static public int STAT_TIME_TOTAL_NEST_METHOD = 6;
+
+ /** nombre d'appel vers une autre e depuis cette methode */
+ final static private int STACK_CALL_NEST_METHOD = 0;
+ /** heure de depart de l'appel a la methode (sans le temps des autres methodes) */
+ final static private int STACK_TIME_START = 1;
+ /** heure de depart de l'appel a la methode (avec le temps des autres methodes) */
+ final static private int STACK_TIME_START_NEST_METHOD = 2;
+
+
+ protected String name = "";
+
+ /** array : [call's numbers, call do, min time, max time, total time, total time with child]*/
+ protected Map<String, long[]> statistics = new LinkedHashMap<String, long[]>();
+
+ /** array : [nest e call, start time, start time with child] */
+ protected Stack<long[]> callStack = new Stack<long[]>();
+
+ public Trace(String name) {
+ this.name = name;
+ }
+
+ public long[] getStatistics(Object e) {
+ String key = String.valueOf(e);
+ long [] result = statistics.get(key);
+ if (result == null) {
+ result = new long[]{0, 0, 0, 0, 0, 0, 0};
+ statistics.put(key, result);
+ }
+ return result;
+ }
+
+ public void traceBefore () {
+ // ajout dans le stack
+ long current = System.nanoTime();
+ long [] stackItem = new long[]{0, current, current};
+ callStack.push(stackItem);
+ }
+
+ public void traceAfterCall (Object e) {
+ traceAfter(e, false);
+ }
+ public void traceAfterComputation (Object e) {
+ traceAfter(e, true);
+ }
+
+ protected void traceAfter(Object e, boolean computation) {
+ long current = System.nanoTime();
+
+ if (callStack.isEmpty()) {
+ log.warn("Empty stack in after for " + e);
+ } else {
+ long [] stackItem = callStack.pop();
+ long timeSpent = current - stackItem[STACK_TIME_START];
+ long timeSpentNestMethod = current - stackItem[STACK_TIME_START_NEST_METHOD];
+
+ long [] stat = getStatistics(e);
+ if (computation) {
+ stat[STAT_COMPUTATION]++; // add +1 to computation number
+ } else {
+ // on incremente pas tout le temps STAT_CALL, car le plus
+ // souvent lors de l'utilisation de l'objet Trace dans un cache
+ // on a deja compte l'appel et reappelle lui meme computation
+ // ce qui ferait 2 appel alors qu'il n'y en a qu'un en realite
+ stat[STAT_CALL]++; // add +1 to call number
+ }
+ stat[STAT_CALL_NEST_METHOD] += stackItem[STACK_CALL_NEST_METHOD];
+ stat[STAT_TIME_TOTAL] += timeSpent;
+ stat[STAT_TIME_TOTAL_NEST_METHOD] += timeSpentNestMethod;
+ if (stat[STAT_TIME_MIN] > timeSpent) {
+ stat[STAT_TIME_MIN] = timeSpent;
+ }
+ if (stat[STAT_TIME_MAX] < timeSpent) {
+ stat[STAT_TIME_MAX] = timeSpent;
+ }
+
+ if (!callStack.isEmpty()) {
+ long [] parent = callStack.peek();
+ parent[STACK_CALL_NEST_METHOD]++; // add +1 to call number nest e
+ parent[STACK_TIME_START] += timeSpentNestMethod; // remove to time all time spent in nest e (yes + to remove :)
+ }
+ }
+
+ // ajouter le delta de temps dans le temps passé dans la méthod
+
+ // il faud garder le temps passé dans l'appel d'autre methode de la stack
+ // --> A
+ // =========
+ // --> B
+ // <-- B
+ // =========
+ // --> C
+ // --> D
+ // <-- D
+ // <-- C
+ // =========
+ // <-- A
+
+ // le temps reellement passé dans A est representé par les =====
+ }
+
+ public String printStatisticAndClear() {
+ long call = 0;
+ long computation = 0;
+ StringBuffer result = new StringBuffer();
+ result.append("--- " + name + " Statistics ---\n");
+ for (String e : statistics.keySet()) {
+ long[] stat = getStatistics(e);
+
+ // fix / by zero
+ // FIXME need to be fixed in aspect !!!
+ if (stat[STAT_COMPUTATION] == 0) {
+ stat[STAT_COMPUTATION] = stat[STAT_CALL];
+ }
+
+ long meanTime = stat[STAT_TIME_TOTAL] / stat[STAT_COMPUTATION];
+ call += stat[STAT_CALL];
+ computation += stat[STAT_COMPUTATION];
+ result.append(
+ e +
+ " call: " + stat[STAT_CALL] +
+ " computation: " + stat[STAT_COMPUTATION] +
+ // usage du cache
+ "(" + (100*stat[STAT_COMPUTATION]/stat[STAT_CALL]) + "%)" +
+ // Time is in nano not millis, we must divide by 1000000
+ " min: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_MIN] / 1000000, "s'.'S") +
+ " mean: " + DurationFormatUtils.formatDuration(meanTime / 1000000, "s'.'S") +
+ " max: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_MAX] / 1000000, "s'.'S") +
+ " total: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_TOTAL] / 1000000, "s'.'S") +
+ " call_nest: " + stat[STAT_CALL_NEST_METHOD] +
+ " total_with_nest: " + DurationFormatUtils.formatDuration(stat[STAT_TIME_TOTAL_NEST_METHOD] / 1000000, "s'.'S") +
+ "\n");
+ }
+ result.append("--------------------\n");
+ result.append("Total call: " + call + "\n");
+ result.append("Total computation: " + computation + "\n");
+ result.append("Cache usage: " + (100 * (call-computation) / (call+1/*+1 pour la / par 0 */) ) + "%" + "\n");
+ result.append("--------------------\n");
+ callStack.clear();
+ statistics.clear();
+
+ System.out.println(result.toString());
+ return result.toString();
+ }
+
+}
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,1046 +0,0 @@
-Add\ to\ %s\ queue=
-Add\ to\ default\ queue=
-Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s=
-Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
-Can't\ add\ simulation\:\ =
-Can't\ create\ simulation\ logger=Can't create simulation logger
-Can't\ delete\ simulation\ %s\ =
-Can't\ do\ post\ action\ %s=
-Can't\ do\ simulation\ %s=
-Can't\ download\ file=
-Can't\ evaluate\ simulation\ prescript=
-Can't\ export\ simulation\ %s=
-Can't\ get\ changlog=
-Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
-Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
-Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
-Can't\ instantiate\ %s=
-Can't\ open\ log\ for\ %s=
-Can't\ simulate\ %s=
-Check\ state\ of\ local\ repository\:\ %s=
-Check\ syntax\ of\ the\ current\ script=
-Checkout\ pom.xml\ to\ %s=
-Command\ '%s'\ fail\ to\ execute=
-Commit\ script\ to\ CVS\ server=
-Copy\ current\ selection\ (Ctrl-c)=
-Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
-Create\ a\ new\ script=
-Cut\ current\ selection\ (Ctrl-x)=
-Error\ during\ vcs\ initialisation=
-Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
-Export\ selected\ script(s)\ to\ zip\ archive=
-Generate\ next\ simulation=
-Import\ one\ java\ file\ script\ source=
-Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
-Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure=
-Info=Info
-Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s=
-Last\ entry\ was\ %s\ extract\ name\ %s=
-Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)=
-Local\ repository\ don't\ exist=
-Local\ repository\ exists\ but\ it's\ not\ valide\ for\ current\ vcs\:\ %s=
-Master\ plan=
-Month\ Gap\ BetweenRepro\ Recruitment=
-Normal\ stop\ thread,\ this\ is\ not\ an\ error=
-Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Paste\ current\ selection\ (Ctrl-v)=
-Process\ template\ error=
-Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
-Region\ %s\ already\ inited=
-Remote\ IsisFish\ server=
-Remote\ control\ file\ doesn't\ exists\ %s=
-Rename\ data\ directory\ to\ %s=
-Save\ current\ script=
-Show\ help=
-SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
-Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
-Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
-Stop\ the\ process=
-SubProcess\ start\:\ %s\ %s=
-Switch\ repository\ type\ to\ none=
-The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
-Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
-Try\ to\ log\ on\ %s@%s\:%d=
-Use\ branches,\ switch\ not\ needed=
-User\ stop\ simulation\ %s=
-cant\ start\ nimbus=
-could\ not\ close\ reader\ %1$s=could not close reader %1$s
-could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
-could\ not\ filter\ on\ simulations=could not filter on simulations
-could\ not\ found\ %s=
-could\ not\ found\ log\ file\ %1$s=could not found log file %1$s
-could\ not\ found\ region\ %s=
-could\ not\ found\ simulation\ %s=
-could\ not\ read\ at\ offset\ %1$s\ for\ reason\ %2$s=could not read at offset %1$s for reason %2$s
-destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
-directory\ %s\ must\ be\ a\ directory=
-filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
-in\ hour=
-isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Please, report any bug you can found.<html>
-isisfish.about.licensetext=You can modify and redistribute the program under the conditions of the GNU General Public License (version 2 or later). A copy of the GPL is in the file "LICENSE.txt" provided with Isis-Fish. All rights reserved. No guarantees are provided for use of this program.
-isisfish.about.title=About Isis-Fish...
-isisfish.advancedParameters.title=advanced Parameters
-isisfish.advancedParams.freeParameters=
-isisfish.advancedParams.libLevelLogger=libLevelLogger
-isisfish.advancedParams.scriptLevelLogger=scriptLevelLogger
-isisfish.advancedParams.simulLevelLogger=simulLevelLogger
-isisfish.advancedParams.simulationCache=cache simulation
-isisfish.advancedParams.simulationStatistique=static simulation
-isisfish.advancedParams.simulatorUse=simulator to Use
-isisfish.cell.comments=comments
-isisfish.cell.land=land
-isisfish.cell.latitude=latitude
-isisfish.cell.longitude=longitude
-isisfish.cell.name=name
-isisfish.change.equation=Can't change equation
-isisfish.commit.message=Enter commit message
-isisfish.common.add=add
-isisfish.common.add.short=add
-isisfish.common.alert=alert
-isisfish.common.apply=apply
-isisfish.common.blank=\
-isisfish.common.cancel=cancel
-isisfish.common.check=check
-isisfish.common.clear=clear
-isisfish.common.date=Date
-isisfish.common.debug=debug
-isisfish.common.ellipsis=ellipsis
-isisfish.common.emigration=emigration
-isisfish.common.empty=vide
-isisfish.common.error=error
-isisfish.common.finish=finish
-isisfish.common.gear=gear
-isisfish.common.immigration=immigration
-isisfish.common.info=info
-isisfish.common.migration=migration
-isisfish.common.month=month %1$s
-isisfish.common.name=Name
-isisfish.common.new=new
-isisfish.common.newMatrix=new Matrix
-isisfish.common.next=next
-isisfish.common.ok=ok
-isisfish.common.openEditor=openEditor
-isisfish.common.populationGroup=populationGroup
-isisfish.common.populations=populations
-isisfish.common.port=port
-isisfish.common.prev=previous
-isisfish.common.region=region
-isisfish.common.remove=remove
-isisfish.common.reset=reset
-isisfish.common.rules=rules
-isisfish.common.save=save
-isisfish.common.saveModel=saveModel
-isisfish.common.saveNextSimulation=saveNextSimulation
-isisfish.common.season=season
-isisfish.common.setOfVessels=setOfVessels
-isisfish.common.simulate=simulate
-isisfish.common.stop=stop
-isisfish.common.strategies=strategies
-isisfish.common.sum=somme
-isisfish.common.tag=tag
-isisfish.common.tripType=tripType
-isisfish.common.value=Value
-isisfish.common.warn=warn
-isisfish.common.year=annee
-isisfish.common.zone=zone
-isisfish.config.main.compileDirectory.description=
-isisfish.config.main.configFileName.description=
-isisfish.config.main.defaultBackupDirectory.description=
-isisfish.config.main.defaultExportDirectory.description=
-isisfish.config.main.defaultExportNames.description=
-isisfish.config.main.defaultMapFile.description=
-isisfish.config.main.defaultResultNames.description=
-isisfish.config.main.defaultSimulator.description=
-isisfish.config.main.defaultTagValue.description=
-isisfish.config.main.encoding.description=encoding used on system
-isisfish.config.main.javadocURL.description=
-isisfish.config.main.launchUI.description=
-isisfish.config.main.localSimulator.description=
-isisfish.config.main.locale.description=user locale
-isisfish.config.main.login.description=
-isisfish.config.main.password.description=
-isisfish.config.main.projectName.description=name of project
-isisfish.config.main.regionMap.description=
-isisfish.config.main.remoteCaparmor.description=
-isisfish.config.main.resultExport.description=
-isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
-isisfish.config.main.simulation.ssh.control.check.interval.description=
-isisfish.config.main.simulation.ssh.datapath.description=
-isisfish.config.main.simulation.ssh.isis.home.description=
-isisfish.config.main.simulation.ssh.login.description=
-isisfish.config.main.simulation.ssh.server.description=
-isisfish.config.main.simulation.ssh.tmppath.description=
-isisfish.config.main.simulationServer.description=
-isisfish.config.main.simulationShowOnlyError.description=
-isisfish.config.main.simulationShowOnlyQueue.description=
-isisfish.config.main.smtpServer.description=
-isisfish.config.main.subSimulator.description=
-isisfish.config.main.userMail.description=
-isisfish.config.main.userName.description=
-isisfish.config.vcs.hostName.description=
-isisfish.config.vcs.keyFile.description=
-isisfish.config.vcs.localDatabasePath.description=
-isisfish.config.vcs.noPassPhrase.description=
-isisfish.config.vcs.passphrase.description=
-isisfish.config.vcs.remoteDatabase.description=
-isisfish.config.vcs.remotePath.description=
-isisfish.config.vcs.type.description=
-isisfish.config.vcs.typeRepo.description=
-isisfish.config.vcs.useSshConnexion.description=
-isisfish.config.vcs.userName.description=
-isisfish.config.vcs.userPassword.description=
-isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
-isisfish.dataResult.export.csv=Export to CSV
-isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
-isisfish.dataResult.label=label9
-isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
-isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
-isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
-isisfish.date.toString=%1$s %2$s
-isisfish.effortDescription.crewFoodCost=isisfish.effortDescription.crewFoodCost
-isisfish.effortDescription.crewShareRate=isisfish.effortDescription.crewShareRate
-isisfish.effortDescription.crewSize=isisfish.effortDescription.crewSize
-isisfish.effortDescription.fishingOperation=isisfish.effortDescription.fishingOperation
-isisfish.effortDescription.fishingOperationDuration=isisfish.effortDescription.fishingOperationDuration
-isisfish.effortDescription.fixedCrewSalary=isisfish.effortDescription.fixedCrewSalary
-isisfish.effortDescription.gearsNumberPerOperation=isisfish.effortDescription.gearsNumberPerOperation
-isisfish.effortDescription.landingCosts=isisfish.effortDescription.landingCosts
-isisfish.effortDescription.otherRunningCost=isisfish.effortDescription.otherRunningCost
-isisfish.effortDescription.repairAndMaintenanceGearCost=isisfish.effortDescription.repairAndMaintenanceGearCost
-isisfish.effortDescription.title=isisfish.effortDescription.title
-isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
-isisfish.effortDescription.unitCostOfFishing=isisfish.effortDescription.unitCostOfFishing
-isisfish.equation.editor.title=Equation Editor
-isisfish.error.acceptable.population=New value isn't acceptable value for this population
-isisfish.error.add.card=Error while adding of result to the map.
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
-isisfish.error.add.result.data=Error while adding result ot data.
-isisfish.error.add.result.graph=Error while adding result to graph
-isisfish.error.add.tray=Can't add system tray icon
-isisfish.error.change.classloader=Can't change classloader because can't create URL from file %1$s
-isisfish.error.change.equation=Can't change equation
-isisfish.error.check.region=
-isisfish.error.compile.script=Can't compile script\: %1$s
-isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
-isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
-isisfish.error.create.equation=Can't create equation
-isisfish.error.delete.database=Can't delete database
-isisfish.error.delete.file=could not delete file %1$s
-isisfish.error.delete.vcs.files=Can't delete vcs files
-isisfish.error.dialog.message=Some errors have been detected
-isisfish.error.dialog.title=Error
-isisfish.error.during.simulation=Error during simulation
-isisfish.error.emigration.negative=emigration negative
-isisfish.error.empty.code.rubbin=rubbin's code is empty
-isisfish.error.empty.emigration=emigration empty
-isisfish.error.empty.id.geographic=goegraphic identifier is empty
-isisfish.error.empty.immigration=immigration empty
-isisfish.error.empty.migration=Migration empty
-isisfish.error.empty.name=The name is empty
-isisfish.error.empty.params.name=Parameter name is empty
-isisfish.error.empty.population=Population is empty
-isisfish.error.empty.scientific.name=scentific name is empty
-isisfish.error.empty.season=info season empty
-isisfish.error.empty.selectivity=selectivity is empty
-isisfish.error.empty.species=specie capturable empty
-isisfish.error.empty.species.name=specie's name is empty
-isisfish.error.empty.unit=measure unit is empty
-isisfish.error.emty.emigration=emigration empty
-isisfish.error.emty.migration=Migration empty
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: %1$s
-isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
-isisfish.error.evalute.plan.script=Can't evaluate plan script
-isisfish.error.factor.coefValueIsOne=Coefficient can't be equal to 1
-isisfish.error.factor.invalid=Factor is not valid
-isisfish.error.file.already.exists=The file %1$s already exist
-isisfish.error.get.fisheryRegion=Can't get FisheryRegion
-isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
-isisfish.error.immigration.negative=immigration negative
-isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
-isisfish.error.import.file=Can't import file %1$s
-isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
-isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
-isisfish.error.instanciate=Can't instanciate %1$s
-isisfish.error.instanciate.export=Can't instanciate export %1$s
-isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
-isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
-isisfish.error.invalid.equation=Equation invalid
-isisfish.error.invalid.equation.name=Invalid equation name
-isisfish.error.invalid.file.name=The script name %1$s is not valid.
-isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
-isisfish.error.invalid.mean.weight=poids moyen invalide
-isisfish.error.invalid.natural.death=natural mortality on classes naissantes invalide
-isisfish.error.invalid.number=the number is invalid
-isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
-isisfish.error.invalid.values.params=Parametre controlable hors valeurs possibles
-isisfish.error.invalidate.natural.death=natural mortality invalid
-isisfish.error.invoke.method=Can't invoke method '%1$s' for class %2$s
-isisfish.error.load.class=Can't load class\: %1$s
-isisfish.error.load.classloader=Can't create ClassLoader for script, bad directory\: %1$s for reason %2$s
-isisfish.error.load.file=could not load file %1$s
-isisfish.error.load.map=Can't load map file\: %1$s
-isisfish.error.log.closeAppender=could not close appender %1$s for category %2$s
-isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
-isisfish.error.log.createAppender=could not create appender [%1$s] \: %2$s for reason %3$s
-isisfish.error.log.foundAppender=\=could not found log appender %1$s for category %2$s
-isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
-isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
-isisfish.error.no.null.time.step=Error, the time step should not be null
-isisfish.error.no.sector=No sector defined
-isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.target.species=no target species in %1$s for %2$s
-isisfish.error.not.found.class=this class does not
-isisfish.error.not.found.code=could not found codeclass for %1$s
-isisfish.error.not.found.description=could not found description for %1$s
-isisfish.error.not.found.field=could not found field %1$s doc for %2$s
-isisfish.error.not.found.field.class=could not found field %1$s for class %2$s
-isisfish.error.not.null.class.grown=classe mature vaut nul
-isisfish.error.not.null.mean.weight=poids moyen nul
-isisfish.error.not.null.natiral.death=natural mortality null
-isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.support.class=this class does not support
-isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
-isisfish.error.obtain.doc.export=Can't obtain @Doc on class export
-isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
-isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
-isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
-isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
-isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
-isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
-isisfish.error.out.memory=Out of memory try with more memory (option -mx)
-isisfish.error.overlap.season=Cette saison chevauche une autre saison
-isisfish.error.parse.date=Can't parse date %1$s
-isisfish.error.parse.long=Can't parse long %1$s
-isisfish.error.plan.parameter=Can't get plan parameter from compiled class
-isisfish.error.prepare.data=Can't prepare data
-isisfish.error.prepare.information.simulation=Can't prepare information for simulation
-isisfish.error.read.simulation=Can't read simulation information %1$s
-isisfish.error.read.simulation.parameters=Can't read simulation parameters from file %1$s
-isisfish.error.region.already.exists=This region already exists
-isisfish.error.region.name.empty=Region name is empty
-isisfish.error.remove.directory=Can't remove directory %1$s
-isisfish.error.rename.region=Can't rename region to %1$s
-isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: %1$s
-isisfish.error.save.region=
-isisfish.error.save.script.compilation=Can't save script to compilation\: %1$s
-isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
-isisfish.error.script.create=isisfish.error.script.create
-isisfish.error.script.delete=Can't delete file %1$s for reason %2$s
-isisfish.error.script.import=Can't import file for reason %1$s
-isisfish.error.script.load=Can't load file %1$s for reason %2$s
-isisfish.error.script.save=Can't save file %1$s for reason %2$s
-isisfish.error.sensitivity.parameter=
-isisfish.error.simulation.log.openAppender=could not open appender of simulation %1$s for reason %2$s
-isisfish.error.simulation.remote.global=Can't launch a simulation on remote server
-isisfish.error.simulation.remote.wrongportvalue=Connection port value is incorrect \: %s
-isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason %1$s
-isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason %1$s
-isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason %1$s
-isisfish.error.source.parameter=Can't get parameter from source
-isisfish.error.strategy.order=Strategy %1$s don't have 12 StrategyMonthInfo but %2$s. Recreate them
-isisfish.error.undefined.classes=No classes defined
-isisfish.error.undefined.correspondence.zones.reproduction.recruitment=pas de correspondance entre les zones de reproduction et les zones de recrutement
-isisfish.error.undefined.gear=The engin is not defined
-isisfish.error.undefined.mesh=No mesh defined
-isisfish.error.undefined.mesh.sector=No maille defined in sector
-isisfish.error.undefined.meta.population=No population defined
-isisfish.error.undefined.natural.death=No natural mortality on classes naissantes
-isisfish.error.undefined.sector=No sector defined
-isisfish.error.undefined.stategy=No strategy defined
-isisfish.error.undefined.stategy.months=The strategy is not defined for some mounths
-isisfish.error.undefined.zone.population=No population's zone defined
-isisfish.error.undefined.zone.recruitment=No recrutment's zone defined
-isisfish.error.undefined.zone.reproduction=No reprodution's zone defined
-isisfish.error.unsupported.equation.langage=unsupported langage '%1$s' for equation\: %2$s
-isisfish.error.wait.simThread=Can't wait SimThread
-isisfish.error.warning.title=Warning
-isisfish.error.write.simulation=Can't write information %1$s
-isisfish.exit.text=Something has change, please enter a comment
-isisfish.exit.title=Exit
-isisfish.export.directory=Export directory
-isisfish.export.saved=Export saved
-isisfish.export.title=Results export
-isisfish.factor.coefficient=Coefficient (in %)
-isisfish.factor.comment=Comment
-isisfish.factor.continue=Continue factor
-isisfish.factor.discret=Discret factor
-isisfish.factor.factor=Factor
-isisfish.factor.firstValue=First value
-isisfish.factor.increment=Cardinality
-isisfish.factor.lastValue=Last value
-isisfish.factor.name=Factor name
-isisfish.factor.operateur=Operator
-isisfish.factor.selectDiscretNumber=Number of factors
-isisfish.factor.title=Factor input
-isisfish.factor.validDiscretNumber=Ok
-isisfish.factor.value=Value
-isisfish.filter=Filter
-isisfish.filter.apply=Apply filter
-isisfish.filter.cancel=Cancel
-isisfish.filter.log.levelDebug=Debug
-isisfish.filter.log.levelError=Error
-isisfish.filter.log.levelFatal=Fatal
-isisfish.filter.log.levelInfo=Info
-isisfish.filter.log.levelTrace=Trace
-isisfish.filter.log.levelWarn=Warn
-isisfish.filter.log.tooltip.levelDebug=Debug
-isisfish.filter.log.tooltip.levelError=Error
-isisfish.filter.log.tooltip.levelFatal=Fatal
-isisfish.filter.log.tooltip.levelInfo=Info
-isisfish.filter.log.tooltip.levelTrace=Trace
-isisfish.filter.log.tooltip.levelWarn=Warn
-isisfish.filter.log.tooltip.message=Enter a term to search and press Enter
-isisfish.filter.reset=Reset
-isisfish.filter.result=Results
-isisfish.filter.result.found=Results (%d/%d)
-isisfish.filter.select=filter.select
-isisfish.filter.select.simulation=select.simulation
-isisfish.filter.simulation=filter.simulation
-isisfish.filter.simulation.analysePlanNumber=analysePlanNumber
-isisfish.filter.simulation.description=description
-isisfish.filter.simulation.local=local
-isisfish.filter.simulation.numberOfYear=numberOfYear
-isisfish.filter.simulation.regionName=regionName
-isisfish.filter.simulation.simulationEnd=simulationEnd
-isisfish.filter.simulation.simulationName=simulationName
-isisfish.filter.simulation.simulationStart=simulationStart
-isisfish.filter.simulation.simulatorName=simulatorName
-isisfish.filter.simulation.tooltip.analysePlanNumber=filter.simulation.tooltip.analysePlanNumber
-isisfish.filter.simulation.tooltip.description=filter.simulation.tooltip.description
-isisfish.filter.simulation.tooltip.local=filter.simulation.tooltip.local
-isisfish.filter.simulation.tooltip.numberOfYear=filter.simulation.tooltip.numberOfYear
-isisfish.filter.simulation.tooltip.regionName=filter.simulation.tooltip.regionName
-isisfish.filter.simulation.tooltip.simulationEnd=filter.simulation.tooltip.simulationEnd
-isisfish.filter.simulation.tooltip.simulationName=filter.simulation.tooltip.simulationName
-isisfish.filter.simulation.tooltip.simulationStart=filter.simulation.tooltip.simulationStart
-isisfish.filter.simulation.tooltip.simulatorName=filter.simulation.tooltip.simulatorName
-isisfish.filter.simulation.tooltip.useAnalysePlan=filter.simulation.tooltip.useAnalysePlan
-isisfish.filter.simulation.tooltip.useOptimization=filter.simulation.tooltip.useOptimization
-isisfish.filter.simulation.tooltip.usePreScript=filter.simulation.tooltip.usePreScript
-isisfish.filter.simulation.tooltip.useStatistic=filter.simulation.tooltip.useStatistic
-isisfish.filter.simulation.useAnalysePlan=filter.simulation.useAnalysePlan
-isisfish.filter.simulation.useOptimization=filter.simulation.useOptimization
-isisfish.filter.simulation.usePreScript=filter.simulation.usePreScript
-isisfish.filter.simulation.useStatistic=filter.simulation.useStatistic
-isisfish.fisheryRegion.addMap=Add map
-isisfish.fisheryRegion.area=Fishery area boundaries
-isisfish.fisheryRegion.comments=Comments
-isisfish.fisheryRegion.delMap=Delete map
-isisfish.fisheryRegion.latitude=Lat.
-isisfish.fisheryRegion.latitude.max=Lat. max.
-isisfish.fisheryRegion.latitude.min=Lat. min.
-isisfish.fisheryRegion.longitude=Long.
-isisfish.fisheryRegion.longitude.max=Long. max.
-isisfish.fisheryRegion.longitude.min=Long. min.
-isisfish.fisheryRegion.name=Region name
-isisfish.fisheryRegion.ofCells=of cells (option)
-isisfish.fisheryRegion.selectFile=Select a file
-isisfish.fisheryRegion.spatial=Spatial resolution
-isisfish.gear.comments=Comments
-isisfish.gear.effortUnit=Effort Unit
-isisfish.gear.name=Name
-isisfish.gear.rangeValues=Range of values
-isisfish.gear.standardisationFactor=Standardisation factor
-isisfish.gear.technicalParameter=Technical parameter
-isisfish.gear.title=Gear
-isisfish.graphBean.graph.render=Choose a graph render
-isisfish.graphBean.graphPanel=defaultToolTip-fr.ifremer.graph.GraphBean.graphPanel
-isisfish.graphBean.graphRendererCombo=defaultToolTip-fr.ifremer.graph.GraphBean.graphRendererCombo
-isisfish.graphBean.graphSplitPane=defaultToolTip-fr.ifremer.graph.GraphBean.graphSplitPane
-isisfish.graphBean.label=defaultToolTip-fr.ifremer.graph.GraphBean.label1
-isisfish.graphBean.palettePanel=defaultToolTip-fr.ifremer.graph.GraphBean.palettePanel
-isisfish.graphBean.scrolledwindow=defaultToolTip-fr.ifremer.graph.GraphBean.scrolledwindow1
-isisfish.graphBean.table=defaultToolTip-fr.ifremer.graph.GraphBean.table2
-isisfish.graphBean.table3=defaultToolTip-fr.ifremer.graph.GraphBean.table3
-isisfish.graphCombo.render.bar.horizontal=Rendu en barre horizontale
-isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empilee
-isisfish.graphCombo.render.bar.vertical=Rendu en barre verticale
-isisfish.graphCombo.render.bar.vertical.3d=Rendu en barre verticale 3D
-isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empilee
-isisfish.graphCombo.render.line=Rendu en ligne
-isisfish.graphCombo.render.min.max=Rendu en MinMax
-isisfish.graphCombo.render.surface=Rendu en Aire
-isisfish.infoItem..table=defaultToolTip-fr.ifremer.resultat.InfoItem.table29
-isisfish.infoItem.label=defaultToolTip-fr.ifremer.resultat.InfoItem.label
-isisfish.infoItem.list=defaultToolTip-fr.ifremer.resultat.InfoItem.list
-isisfish.infoItem.scrolledwindow=defaultToolTip-fr.ifremer.resultat.InfoItem.scrolledwindow1
-isisfish.infoItem.sum=defaultToolTip-fr.ifremer.resultat.InfoItemDate.sumButton
-isisfish.infoItem.sum.year=Sum elements per year
-isisfish.infoItem.table=defaultToolTip-fr.ifremer.resultat.InfoItem.table30
-isisfish.input.continueCells=Continue to cells
-isisfish.input.continueGears=Continue to gears
-isisfish.input.continueMetiers=Continue to metiers
-isisfish.input.continuePopulations=Continue to populations
-isisfish.input.continuePorts=Continue to ports
-isisfish.input.continueSetOfVessels=Continue to set of vessels
-isisfish.input.continueSpecies=
-isisfish.input.continueStrategies=Continue to strategies
-isisfish.input.continueTripTypes=Continue to trip type
-isisfish.input.continueVesselTypes=Continue to vessel types
-isisfish.input.continueZones=Continue to zones
-isisfish.input.menu.addRegion=Add region
-isisfish.input.menu.commit=Commit change
-isisfish.input.menu.copyRegion=Copy Region
-isisfish.input.menu.exportRegion=Export Region
-isisfish.input.menu.importRegion=Import Region
-isisfish.input.menu.importRegionSimulation=Import Region from simulation
-isisfish.input.menu.importRegionV2=Import Region from v2
-isisfish.input.menu.importRenameRegion=Import Region and rename
-isisfish.input.menu.removeLocaly=Remove localy
-isisfish.input.menu.removeLocalyRemotely=Remove localy and remotely
-isisfish.input.menu.server=Server
-isisfish.input.newRegion=New region
-isisfish.input.selectRegion=Select region
-isisfish.input.title=Fishery input
-isisfish.launch.anonymous=read only
-isisfish.launch.debugMode=debug mode
-isisfish.launch.email=email
-isisfish.launch.firstname=firstname
-isisfish.launch.init.done=init done in %1$s.
-isisfish.launch.lasstname=lasstname
-isisfish.launch.server.authenticationMethod=server access
-isisfish.launch.server.login=server login
-isisfish.launch.server.ssh.confirm.passphrase=confirm passphrase
-isisfish.launch.server.ssh.key.change=Change your ssh key
-isisfish.launch.server.ssh.key.generate=Generate ssh key
-isisfish.launch.server.ssh.no.passphrase=no passphrase
-isisfish.launch.server.ssh.passphrase=passphrase
-isisfish.launch.server.ssh.privateKeyFile=private ssh key
-isisfish.launch.server.ssh.publicKeyFile=public ssh key
-isisfish.launch.ssh=read-write (ssh)
-isisfish.launch.start=Launching Isis-fish ... %1$s
-isisfish.launch.stop=Stopping simulation...
-isisfish.launching=after init done in %1$s.
-isisfish.log.addAppender=add appender [%1$s]
-isisfish.log.body=Message to add
-isisfish.log.closeAppender=closing appender %1$s for category %2$s
-isisfish.log.mail.failed=Can't send report by mail. Is your mail server up ? (I'm trying to contact the < %1$s > smtp server)
-isisfish.log.mail.send=A report has been sent to %1$s
-isisfish.log.mail.send.title=Send simulation %1$s by email
-isisfish.log.mailTo=Destination adress
-isisfish.log.removeAppender=remove appender [%1$s]
-isisfish.log.restoreLogLevel=swap back level for logger %1$s from level %2$s to level %3$s
-isisfish.log.sendAll=Send the complete simulation archive
-isisfish.log.sendMail=Send by email
-isisfish.log.simulation.name=IsisFish simulation %1$s
-isisfish.log.swapLogLevel=swap level for logger %1$s from level %2$s to level%3$s
-isisfish.log.tooltip.body=The message will be join to email
-isisfish.log.tooltip.mailTo=Enter destination adress
-isisfish.log.tooltip.sendAll=Send the complete simulation archive, or just the log file
-isisfish.log.tooltip.sendMail=Click here to send the email with files
-isisfish.message.add.objets.simulation=Add new objets simulation
-isisfish.message.backup.database.finished=backup database finished
-isisfish.message.backup.database.progress=backup database in progress
-isisfish.message.cancel.finished=Cancel finished
-isisfish.message.check.finished=check finished
-isisfish.message.check.region=
-isisfish.message.checking.cell=
-isisfish.message.choose.archive=choose archive file or directory
-isisfish.message.commit.cancelled=commit cancelled
-isisfish.message.commit.finished=commit finished
-isisfish.message.commit.region.canceled=Commit region canceled
-isisfish.message.commiting.region=Commiting region %1$s ...
-isisfish.message.compilation.time=Compilation time %1$ss
-isisfish.message.confirm.delete.object=Do you really want delete object %1$s
-isisfish.message.confirm.remove.region=Do you really want to remove the region %1$s ?
-isisfish.message.confirm.remove.script=Do you want to remove script '%1$s' ?
-isisfish.message.copy.finished=Copy finished
-isisfish.message.copy.region=Copy region to %1$s
-isisfish.message.creating.region=Creating region %1$s
-isisfish.message.creation.done=creation done %1$s
-isisfish.message.creation.finished=Creation finished
-isisfish.message.delete.canceled=delete canceled
-isisfish.message.delete.entities=Delete entities
-isisfish.message.delete.entity=Delete entity
-isisfish.message.delete.finished=delete finished
-isisfish.message.delete.object=To delete object %1$s, all next object will be deleted\n\n
-isisfish.message.evaluation.finished=evaluation finished
-isisfish.message.export.done=export done
-isisfish.message.export.zip=Export to zip file %1$s
-isisfish.message.file.overwrite=File exists, do you want overwrite it ?
-isisfish.message.import=Import %1$s
-isisfish.message.import.equation.convert=Manual equation convertion
-isisfish.message.import.finished=Import finished
-isisfish.message.import.region.name=Enter name for imported region
-isisfish.message.import.region.xml=XMLed Region
-isisfish.message.import.region.zipped=Zipped Region
-isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
-isisfish.message.import.xml.v2.file=Import xml v2 file
-isisfish.message.import.zip=Import zip file
-isisfish.message.launchui.notlaunch=
-isisfish.message.load.finished=load finished
-isisfish.message.load.map=Try to load map file\: %1$s (%2$s, %3$s)
-isisfish.message.loading.old.simulation=Loading old simulation ...
-isisfish.message.loading.region=Loading region ...
-isisfish.message.name.imported.region=Enter name for imported region
-isisfish.message.new.filename=Enter the name of the new file. (use only chars and _ and start with uppercase)
-isisfish.message.new.region.name=Enter new region name
-isisfish.message.old.simulation.loaded=Old simulation loaded
-isisfish.message.page.modified=This page has been modified, do you want to save it ?
-isisfish.message.presimulation.script.execution=Presimulation Script execution
-isisfish.message.recruitment.number.month=Input the number of month of recruitment
-isisfish.message.region.commited=Region commited
-isisfish.message.region.loaded=Region loaded
-isisfish.message.region.remove.canceled=Region remove canceled
-isisfish.message.region.removed=Region removed
-isisfish.message.remove.canceled=Remove canceled
-isisfish.message.remove.finished=Remove finished
-isisfish.message.removing.region=Removing region %1$s ...
-isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
-isisfish.message.save.finished=Save finished
-isisfish.message.saveModel.finished=Save model finished
-isisfish.message.script.commit=Enter commit message
-isisfish.message.setting.cache.aspects=Setting Cache aspects
-isisfish.message.setting.trace.aspects=Setting Trace aspects
-isisfish.message.simulation.ended=Simulation ended
-isisfish.message.simulation.execution=Simulation execution
-isisfish.message.simulation.prepare=Preparing simulation
-isisfish.message.tray.disabled=SystemTray disabled
-isisfish.message.update.finished=update finished
-isisfish.metier.comments=Comments
-isisfish.metier.name=Name
-isisfish.metier.rangeValues=Range of values
-isisfish.metier.title=Metier
-isisfish.metierMonitor.metiers=Metiers
-isisfish.metierMonitor.strategies=Strategies
-isisfish.metierSeasonInfo.toString=%1$s season %2$s-%3$s
-isisfish.metierSeasonInfoSpecies.mainSpecies=Main species for the metier
-isisfish.metierSeasonInfoSpecies.selectSeason=Select a season
-isisfish.metierSeasonInfoSpecies.selectSpecies=Select a species
-isisfish.metierSeasonInfoSpecies.species=Species
-isisfish.metierSeasonInfoSpecies.targetFactor=Target factor
-isisfish.metierSeasonInfoSpecies.title=Catchable species
-isisfish.metierSeasonInfoZone.comments=Comments
-isisfish.metierSeasonInfoZone.season=Season
-isisfish.metierSeasonInfoZone.selectSeason=Select a season
-isisfish.metierSeasonInfoZone.title=Seasons / Zones
-isisfish.monitor.title=Application Monitor
-isisfish.month.april=april
-isisfish.month.august=august
-isisfish.month.december=december
-isisfish.month.february=february
-isisfish.month.january=january
-isisfish.month.july=july
-isisfish.month.june=june
-isisfish.month.march=march
-isisfish.month.may=may
-isisfish.month.november=november
-isisfish.month.october=october
-isisfish.month.september=september
-isisfish.params.changeLogLev=Change from level '%1$s' to level '%2$s'
-isisfish.params.clearFilter=Clear filter
-isisfish.params.description=Description
-isisfish.params.filter=Filter
-isisfish.params.lblLauncher=Simulation launcher
-isisfish.params.loadOldSimulation=Load old simulation
-isisfish.params.numberYear=Number of year
-isisfish.params.onlyExportSimulation=Only export simulation
-isisfish.params.populationNumbers=Population numbers input
-isisfish.params.ruleParameters=Rule's parameters
-isisfish.params.sensitivityName=Sensitivity name
-isisfish.params.simulationName=Simulation name
-isisfish.params.title=Parameters
-isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\n\n
-isisfish.params.toString.lib.logger.level=Level of libraries' logger %1$s
-isisfish.params.toString.number.years=Number of years\: %1$s\n\n
-isisfish.params.toString.plan=Plan\: %1$s
-isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\n\n
-isisfish.params.toString.populations=Populations\:
-isisfish.params.toString.rule=Rule\: %1$s
-isisfish.params.toString.script.logger.level=Level of scripts' logger %1$s
-isisfish.params.toString.script.presimulation=Script de presimulation
-isisfish.params.toString.simul.logger.level=Level of simulator's logger %1$s
-isisfish.params.toString.simulation.done=Simulation done with %1$s\:
-isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
-isisfish.params.useAnalysePlan=Use simulation plan
-isisfish.params.usePreSimulationScript=Use pre simulation script
-isisfish.population.capturability=Capturability
-isisfish.population.comments=Comments
-isisfish.population.group=Group
-isisfish.population.groups=Groups
-isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
-isisfish.population.matrixAbundance=matrixAbundance
-isisfish.population.matrixAbundance1D=matrixAbundance1D
-isisfish.population.recruitment=Recruitment
-isisfish.population.reproduction=Reproduction
-isisfish.population.season=Season
-isisfish.population.zones=Zones
-isisfish.populationBasics.geographicID=geographicID
-isisfish.populationBasics.growth=growth
-isisfish.populationBasics.growthReverse=growthReverse
-isisfish.populationBasics.maturityGroup=maturity group
-isisfish.populationBasics.name=name
-isisfish.populationBasics.numberGroup=Number of group
-isisfish.populationBasics.plusGroup=plusGroup
-isisfish.populationBasics.recreateClasses=Recreate the classes
-isisfish.populationBasics.title=inputPopulationBasics
-isisfish.populationCapturability.comments=Comments
-isisfish.populationCapturability.selectCoefficient=Select a coefficient per season and per class
-isisfish.populationCapturability.title=inputPopulationCapturability
-isisfish.populationEquation.meanWeight=Mean weight
-isisfish.populationEquation.naturalDeathRate=Natural death rate
-isisfish.populationEquation.price=Price
-isisfish.populationEquation.title=Equations input
-isisfish.populationGroup.age=Age
-isisfish.populationGroup.comments=Comments
-isisfish.populationGroup.length=Length
-isisfish.populationGroup.meanWeigth=Mean Weigth
-isisfish.populationGroup.naturalDeathRate=Natural death rate
-isisfish.populationGroup.price=Price
-isisfish.populationGroup.reproductionRate=Reproduction rate
-isisfish.populationGroup.title=Population group input
-isisfish.populationGroup.toString=%1$s Group %2$s
-isisfish.populationMigration.comments=Comments
-isisfish.populationMigration.selectSeason=Select a season
-isisfish.populationMigration.title=Migration
-isisfish.populationMigration.useEquation=Use equation
-isisfish.populationMigrationEmigration.coefficient=Coefficient
-isisfish.populationMigrationEmigration.departureZone=Departure Zone
-isisfish.populationMigrationEmigration.title=Population emigration
-isisfish.populationMigrationImmigration.arrivalZone=Arrival Zone
-isisfish.populationMigrationImmigration.coefficient=Coefficient
-isisfish.populationMigrationImmigration.title=Population immigration
-isisfish.populationMigrationMigration.arrivalZone=Arrival Zone
-isisfish.populationMigrationMigration.coefficient=Coefficient
-isisfish.populationMigrationMigration.departureZone=Departure Zone
-isisfish.populationMigrationMigration.title=Population migration
-isisfish.populationRecruitment.comments=Comments
-isisfish.populationRecruitment.recruitmentDistribution=Recruitment Distribution
-isisfish.populationRecruitment.reproductionEquation=ReproductionEquation
-isisfish.populationRecruitment.title=inputPopulationRecruitment
-isisfish.populationSeasonInfo.arrival=Arrival
-isisfish.populationSeasonInfo.departure=Departure
-isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
-isisfish.populationSeasonInfo.emigration=Emigration
-isisfish.populationSeasonInfo.group=Group
-isisfish.populationSeasonInfo.immigration=Immigration
-isisfish.populationSeasonInfo.migration=Migration
-isisfish.populationSeasonInfo.months=Months
-isisfish.populationSeasonInfo.toString=%1$s season %2$s-%3$s
-isisfish.populationSeasons.changeGroup=Change of group
-isisfish.populationSeasons.comments=Comments
-isisfish.populationSeasons.distributionSpawning=Distribution of spawning
-isisfish.populationSeasons.selectSeason=Select a season
-isisfish.populationSeasons.title=Saisons
-isisfish.populationZones.betweenSpawningRecruitmentAreas=Match between spawning and recruitment areas
-isisfish.populationZones.selectPopulationAreas=Select the population areas
-isisfish.populationZones.selectRecruitmentAreas=Select the recruitment areas
-isisfish.populationZones.selectSpawningAreas=Select the spawning areas
-isisfish.populationZones.title=inputPopulationZones
-isisfish.port.cell=Port cell
-isisfish.port.comments=Comments
-isisfish.port.name=Name
-isisfish.preScript.backParameter=Back to parameter tab
-isisfish.preScript.title=Pre simulation script
-isisfish.queue.clearDone=Clear done jobs
-isisfish.queue.id=Id
-isisfish.queue.launcher=Simulation launcher
-isisfish.queue.plan=Plan
-isisfish.queue.progression=Progression
-isisfish.queue.showLog=Show simulation log
-isisfish.queue.simulationLaunch=Simulation queue launch
-isisfish.queue.status=Status
-isisfish.queue.stopSimulation=Stop simulation
-isisfish.queue.title=Queue
-isisfish.result.abundance=Abondance
-isisfish.result.add=Add a result
-isisfish.result.begin.simulation=En debut de Simulation\:
-isisfish.result.capture=Capture
-isisfish.result.capture.metier=Capture par metier
-isisfish.result.choose.simulation=Choose a Simulation
-isisfish.result.datas=Datas
-isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
-isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension=Dimension
-isisfish.result.end.simulation=Simuation end \:
-isisfish.result.export=Export
-isisfish.result.export.file=Export text file
-isisfish.result.file=File
-isisfish.result.graph=Graph
-isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
-isisfish.result.hpaned=defaultToolTip-fr.ifremer.resultat.ResultatEdit.hpaned2
-isisfish.result.infoPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.infoPanel
-isisfish.result.label=defaultToolTip-fr.ifremer.resultat.ResultatView.label9
-isisfish.result.map=Map
-isisfish.result.mapRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.mapRadioButton
-isisfish.result.menuExport=defaultToolTip-fr.ifremer.resultat.ResultatEdit.menuExport
-isisfish.result.menubar=defaultToolTip-fr.ifremer.resultat.ResultatView.menubar1
-isisfish.result.menuitem=defaultToolTip-fr.ifremer.resultat.ResultatView.menuitem2
-isisfish.result.new.window=Open a new window
-isisfish.result.openWindowButton=defaultToolTip-fr.ifremer.resultat.ResultatView.openWindowButton
-isisfish.result.quit=Quitter
-isisfish.result.reject.metier=Rejet par metier
-isisfish.result.remove.simulation=Supprimer Simulation
-isisfish.result.removeSimulationButton=defaultToolTip-fr.ifremer.resultat.ResultatView.supprimerSimulationButton
-isisfish.result.resultat=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resultat
-isisfish.result.scroll=defaultToolTip-fr.ifremer.resultat.ResultatEdit.scroll
-isisfish.result.show.simulation.log=Show logs
-isisfish.result.simulation=defaultToolTip-fr.ifremer.resultat.ResultatView.simulation
-isisfish.result.statusBar=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusbar1
-isisfish.result.statusImage=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusImage
-isisfish.result.stress.metier=Effort par metier
-isisfish.result.summary=R\u00E9sum\u00E9
-isisfish.result.summaryRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resumeRadioButton
-isisfish.result.table=defaultToolTip-fr.ifremer.resultat.ResultatView.table33
-isisfish.result.title=Resultat
-isisfish.result.tooltip.show.simulation.log=Click to display the log console of the simulation
-isisfish.result.unload.metier=Debarquement par metier
-isisfish.result.vbox=defaultToolTip-fr.ifremer.resultat.ResultatView.vbox1
-isisfish.result.viewPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.viewPanel
-isisfish.resultChoice.save=Results to save
-isisfish.resultChoice.saved=Results saved
-isisfish.resultChoice.title=Result choice
-isisfish.resume.matrixInfoGrid=defaultToolTip-fr.ifremer.resultat.ResumePanel.matriceInfoGrid
-isisfish.resume.resumeTextArea=defaultToolTip-fr.ifremer.resultat.ResumePanel.resumeTextArea
-isisfish.resume.scrolledwindow=defaultToolTip-fr.ifremer.resultat.ResumePanel.scrolledwindow2
-isisfish.resume.table=defaultToolTip-fr.ifremer.resultat.ResumePanel.table1
-isisfish.script.check=Check
-isisfish.script.commit=Commit
-isisfish.script.copy=Copy
-isisfish.script.cut=Cut
-isisfish.script.evaluate=Evaluate
-isisfish.script.export=export
-isisfish.script.export.cancel=cancel
-isisfish.script.export.checkAll=checkAll
-isisfish.script.export.chooseDir=chooseDir
-isisfish.script.export.ok=ok
-isisfish.script.export.tooltip.checkAll=
-isisfish.script.export.tooltip.chooseDir=
-isisfish.script.import=import
-isisfish.script.import.cancel=cancel
-isisfish.script.import.checkAll=checkAll
-isisfish.script.import.labelAdd=labelAdd
-isisfish.script.import.labelOverwrite=labelOverwrite
-isisfish.script.import.ok=ok
-isisfish.script.import.tooltip.checkAll=
-isisfish.script.menu.checkSyntax=CheckSyntax
-isisfish.script.menu.code=Code
-isisfish.script.menu.commit=Commit script to server
-isisfish.script.menu.copy=Copy
-isisfish.script.menu.cut=Cut
-isisfish.script.menu.deleteLocaly=Delete localy
-isisfish.script.menu.deleteLocalyServer=Delete localy and on server
-isisfish.script.menu.diff=Display diff with server version
-isisfish.script.menu.edit=Edit
-isisfish.script.menu.evaluate=Evaluate
-isisfish.script.menu.file=File
-isisfish.script.menu.new=New
-isisfish.script.menu.paste=Paste
-isisfish.script.menu.save=Save
-isisfish.script.menu.txtEditorHelp=Online help
-isisfish.script.menu.txtExport=Export
-isisfish.script.menu.txtHelp=Help
-isisfish.script.menu.txtImport=Import
-isisfish.script.menu.txtJavaHelp=Java help
-isisfish.script.menu.txtNewAnalysePlan=New analyse plan
-isisfish.script.menu.txtNewEquationModel=New Equation model
-isisfish.script.menu.txtNewExport=New Export
-isisfish.script.menu.txtNewRule=New rule
-isisfish.script.menu.txtNewScript=New script
-isisfish.script.menu.txtNewSensitivity=New sensitivity calculator
-isisfish.script.menu.txtNewSimulator=New simulator
-isisfish.script.menu.txtVCS=Server
-isisfish.script.menu.update=Update from server
-isisfish.script.new=New
-isisfish.script.paste=Paste
-isisfish.script.save=Save
-isisfish.script.title=Script Editor
-isisfish.script.txtExport=txtExport
-isisfish.season.toString=season %1$s-%2$s
-isisfish.selectivity.equation=Equation
-isisfish.selectivity.selectPopulation=Select a population
-isisfish.selectivity.title=Selectivity
-isisfish.sens.backParameter=Back to parameter tab
-isisfish.sens.title=Sensibility analysis
-isisfish.sensitivity.displaysecondpass=Display results
-isisfish.sensitivity.export=Export
-isisfish.sensitivity.secondpass=Analyze results
-isisfish.sensitivity.secondpass.title=Analyze results
-isisfish.sensitivity.select=Method
-isisfish.sensitivity.title=Factors input
-isisfish.sensitivityChooser.title=Sensitivities input
-isisfish.server.ssh.generateKey.title=Generate Ssh key
-isisfish.setOfVessels.comments=Comments
-isisfish.setOfVessels.fixedCosts=Fixed costs
-isisfish.setOfVessels.name=Name
-isisfish.setOfVessels.numberOfVessels=Number of vessels
-isisfish.setOfVessels.technicalEfficiency=
-isisfish.setOfVessels.title=Caracteristics
-isisfish.setOfVessels.vesselType=vesselType
-isisfish.simpleResult.legendPanel=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.legendPanel
-isisfish.simpleResult.more.information=Clic a cell for more information...
-isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
-isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
-isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
-isisfish.simulation.log.console.title=Log console for simulation '%1$s'
-isisfish.simulation.log.showConsole=display log console for simulation %1$s
-isisfish.simulation.menu.import=Restor simulation parameter
-isisfish.simulation.menu.save=Save simulation parameter
-isisfish.simulation.menu.simulation=Simulation
-isisfish.simulation.name=Simulation name
-isisfish.simulation.remote.message.connection=Connecting to Caparmor
-isisfish.simulation.remote.message.downloadresults=Downloading results
-isisfish.simulation.remote.message.upload=Uploading simulation
-isisfish.simulation.remote.message.waitingstart=Waiting for simulation start
-isisfish.simulation.title=Simulation launcher
-isisfish.simulator.launcher.inprocess=in current process
-isisfish.simulator.launcher.remote=on Caparmor server
-isisfish.simulator.launcher.subprocess=in subprocess
-isisfish.simulator.simulaction.badid=Can't start simulation, bad id\: %s
-isisfish.simulator.subprocess.readoutput.error=
-isisfish.species.age=Age
-isisfish.species.cee=CEE
-isisfish.species.comments=Comments
-isisfish.species.length=Length
-isisfish.species.name=Species name
-isisfish.species.rubbinCode=Rubbin code
-isisfish.species.scientificName=Scientific name
-isisfish.species.structured=Structured
-isisfish.ssh.askpassphrase.message=Enter passphrase for key '%s' \:
-isisfish.ssh.askpassphrase.title=SSH key unlocking
-isisfish.ssh.askpassphrase.wrongpassphrase=Wrong passphrase, enter a new one for key '%s' \:
-isisfish.strategy.comments=Comments
-isisfish.strategy.inactivity=
-isisfish.strategy.inactivityEquationUsed=Use inactivity equation
-isisfish.strategy.name=Name
-isisfish.strategy.proportionSetOfVessels=Set of vessels proportion
-isisfish.strategy.title=Caracteristics
-isisfish.strategyMonthInfo.metier=Metier
-isisfish.strategyMonthInfo.minInactivityDays=minInactivityDays
-isisfish.strategyMonthInfo.numberOfTrips=numberOfTrips
-isisfish.strategyMonthInfo.proportion=Proportion
-isisfish.strategyMonthInfo.title=StrategyMonthInfo
-isisfish.strategyMonthInfo.toString=%1$s %2$s
-isisfish.timeUnit.day=Day
-isisfish.timeUnit.hours=Hours
-isisfish.tray.simulation=Isis-fish - %1$s \: %2$s/%3$s
-isisfish.tray.simulation.no=Isis-fish - No simulation
-isisfish.tripType.comments=Comments
-isisfish.tripType.duration=Duration
-isisfish.tripType.minTime=Minimum time between trips
-isisfish.tripType.name=Name
-isisfish.vcs.ask.passphrase=Enter your pass phrase (if your private key have one).
-isisfish.vcs.ask.passphrase.title=Ask your pass phrase
-isisfish.vcs.commit=vcs.commit
-isisfish.vcs.commit.cancel=vcs.commit.cancel
-isisfish.vcs.commit.label=vcs.commit.label
-isisfish.vcs.commit.ok=vcs.commit.ok
-isisfish.vcs.init.notfoundcantdownload=No database version %s found and can't get it.\nYou must go to ISIS-Fish web site and download database manually.
-isisfish.vcs.init.wrongprotocol=Your database repository\: %s\n don't use correct protocol.\nDo you want to make backup of your database and take the correct one ?
-isisfish.vcs.switchprotocol.confirm=Protocol to access repository script has changed.\nDo you want to switch your repository ?
-isisfish.vcs.switchtag.warningconflict=Your repository is now up-to-date, but following files are conflicted, you may check them \:\n%s
-isisfish.vcs.switchversion.confirm=You don't use correct repository script for your application version %s.\nDo you want to switch your repository ?
-isisfish.vcs.update=vcs.update
-isisfish.vcs.update.cancel=cancel
-isisfish.vcs.update.checkAll=checkAll
-isisfish.vcs.update.local=local
-isisfish.vcs.update.local.modified=modified
-isisfish.vcs.update.local.outofdateAndModified=outofdateAndModified
-isisfish.vcs.update.local.tooltip.modified=
-isisfish.vcs.update.local.tooltip.outofdateAndModified=
-isisfish.vcs.update.local.tooltip.unversionned=
-isisfish.vcs.update.local.unversionned=unversionned
-isisfish.vcs.update.ok=ok
-isisfish.vcs.update.remote=remote
-isisfish.vcs.update.remote.missing=missing
-isisfish.vcs.update.remote.outofdate=outofdate
-isisfish.vcs.update.remote.tooltip.missing=
-isisfish.vcs.update.remote.tooltip.outofdate=
-isisfish.vcs.update.tooltip.checkAll=checkAll
-isisfish.vcs.update.tooltip.local=
-isisfish.vcs.update.tooltip.remote=
-isisfish.vcs.updateconfirm=updateconfirm
-isisfish.vcs.updateconfirm.cancel=cancel
-isisfish.vcs.updateconfirm.checkAll=checkAll
-isisfish.vcs.updateconfirm.label=
-isisfish.vcs.updateconfirm.label2=
-isisfish.vcs.updateconfirm.ok=ok
-isisfish.vcs.updateconfirm.tooltip.checkAll=
-isisfish.vcs.updaterepository.confirm=Your repository is not up to date.\nDo you want to update following files ?
-isisfish.vcs.vcssvn.add.error=Can't add file
-isisfish.vcs.vcssvn.add.errorreadonly=You can't add file, this repository is readonly
-isisfish.vcs.vcssvn.checkProtocol.error=Can't get address on serveur of local repository
-isisfish.vcs.vcssvn.checkProtocol.relocate=Relocate repository %s from %s to %s
-isisfish.vcs.vcssvn.checkout.error=Can't checkout
-isisfish.vcs.vcssvn.cleanup.error=Can't cleanup working copy
-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.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
-isisfish.vcs.vcssvn.gettag.error=Can't get address on serveur of local repository
-isisfish.vcs.vcssvn.getupdate.error=Can't status file
-isisfish.vcs.vcssvn.global.filelocalandremotestatus=file %s status is (l\:%s/r\:%s)
-isisfish.vcs.vcssvn.global.filestatus=status for %s is %s
-isisfish.vcs.vcssvn.global.foundUpdatedFile=add %s as updated file
-isisfish.vcs.vcssvn.global.torevision=At revision \: %d
-isisfish.vcs.vcssvn.isconnected.switchoff=Can't connect to serveur, switch to off line\: %s
-isisfish.vcs.vcssvn.isconnected.switchto=Connection to serveur available, switch on line\: %s
-isisfish.vcs.vcssvn.isonremote.error=file %s is not on server
-isisfish.vcs.vcssvn.istag.notexist=Tag %s don't exist
-isisfish.vcs.vcssvn.isuptodate.error=Can't get file status
-isisfish.vcs.vcssvn.list.error=Can't list files
-isisfish.vcs.vcssvn.localstatus.error=Can't status file
-isisfish.vcs.vcssvn.remotestatus.error=Can't status file
-isisfish.vcs.vcssvn.setTag.error=Can't get address on server of local repository
-isisfish.vcs.vcssvn.settag.switchfromto=Switch repository tag from %s to %s
-isisfish.vcs.vcssvn.update.error=Can't update files
-isisfish.vcs.vcssvn.update.notinlocal=Can't update file that not in local repository
-isisfish.versionStorage.removed=Removed
-isisfish.vesselType.activityRange=Activity range
-isisfish.vesselType.comments=Comments
-isisfish.vesselType.fuelCost=Fuel cost of travel
-isisfish.vesselType.length=Length
-isisfish.vesselType.maxDuration=Maximum trip duration
-isisfish.vesselType.miniCrew=Minimum crew size
-isisfish.vesselType.name=Name
-isisfish.vesselType.speed=Speed
-isisfish.welcome.menu.about=About
-isisfish.welcome.menu.close=Close
-isisfish.welcome.menu.configuration=Configuration
-isisfish.welcome.menu.file=File
-isisfish.welcome.menu.frame=Frame
-isisfish.welcome.menu.help=Help
-isisfish.welcome.menu.input=Input
-isisfish.welcome.menu.monitor=Logs frame
-isisfish.welcome.menu.queue=Simulation queue
-isisfish.welcome.menu.result=Result
-isisfish.welcome.menu.script=Script
-isisfish.welcome.menu.simulation=Simulation Launcher
-isisfish.welcome.menu.synchro=Server Synchronisation
-isisfish.welcome.menu.vcs.configuration=Configuration vcs
-isisfish.welcome.title=Ifremer Simulation
-isisfish.wizardGroupCreation.allGroupsSameSize=All groups have the same size
-isisfish.wizardGroupCreation.allValues=Input all the values
-isisfish.wizardGroupCreation.computedGrowthCurve=Computed by a growth curve
-isisfish.wizardGroupCreation.firstAge=First age
-isisfish.wizardGroupCreation.firstAgeHelp=First age \= minimal age
-isisfish.wizardGroupCreation.firstGroup=First group
-isisfish.wizardGroupCreation.firstLength=First length
-isisfish.wizardGroupCreation.firstLengthHelp=First length \= minimal length of first group
-isisfish.wizardGroupCreation.gapBetweenGroupsHelp=gap between to group is 1 year.
-isisfish.wizardGroupCreation.groupNumberHelp=number of Group \= number of group wanted
-isisfish.wizardGroupCreation.groupWidth=Group width
-isisfish.wizardGroupCreation.groupWidthHelp=Group width \= width of group
-isisfish.wizardGroupCreation.lastAge=Last age
-isisfish.wizardGroupCreation.lastAgeHelp=Last age \= maximal age
-isisfish.wizardGroupCreation.maxGroupsLength=Maximal groups length
-isisfish.wizardGroupCreation.maxGroupsLengthHelp=A semicolon ';' must separe maximal length of each group
-isisfish.wizardGroupCreation.numberGroup=Number of group
-isisfish.wizardGroupCreation.numberGroups=Number of groups
-isisfish.wizardGroupCreation.populationCharacteristics=Input the population characteristics
-isisfish.wizardGroupCreation.selectGroupLengthType=Select group length type
-isisfish.wizardGroupCreation.timeStep=Time step (in month)
-isisfish.wizardGroupCreation.title=Group creation
-isisfish.zone.cells=Zone cells
-isisfish.zone.comments=Comments
-isisfish.zone.name=Name
-maximum\ length=
-minimum\ length=
-not\ started=
-region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-simulate\ %s\ with\ file\ %s=
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties (from rev 2088, isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-en_GB.properties 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,1050 @@
+Add\ to\ %s\ queue=
+Add\ to\ default\ queue=
+Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s=
+Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
+Can't\ add\ simulation\:\ =
+Can't\ create\ simulation\ logger=Can't create simulation logger
+Can't\ delete\ simulation\ %s\ =
+Can't\ do\ post\ action\ %s=
+Can't\ do\ simulation\ %s=
+Can't\ download\ file=
+Can't\ evaluate\ simulation\ prescript=
+Can't\ export\ simulation\ %s=
+Can't\ get\ changlog=
+Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
+Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
+Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
+Can't\ instantiate\ %s=
+Can't\ open\ log\ for\ %s=
+Can't\ simulate\ %s=
+Check\ state\ of\ local\ repository\:\ %s=
+Check\ syntax\ of\ the\ current\ script=
+Checkout\ pom.xml\ to\ %s=
+Command\ '%s'\ fail\ to\ execute=
+Commit\ script\ to\ CVS\ server=
+Copy\ current\ selection\ (Ctrl-c)=
+Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
+Create\ a\ new\ script=
+Cut\ current\ selection\ (Ctrl-x)=
+Error\ during\ vcs\ initialisation=
+Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
+Export\ selected\ script(s)\ to\ zip\ archive=
+Generate\ next\ simulation=
+Import\ one\ java\ file\ script\ source=
+Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
+Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure=
+Info=Info
+Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s=
+Last\ entry\ was\ %s\ extract\ name\ %s=
+Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)=
+Local\ repository\ don't\ exist=
+Local\ repository\ exists\ but\ it's\ not\ valide\ for\ current\ vcs\:\ %s=
+Master\ plan=
+Month\ Gap\ BetweenRepro\ Recruitment=
+Normal\ stop\ thread,\ this\ is\ not\ an\ error=
+Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
+Paste\ current\ selection\ (Ctrl-v)=
+Process\ template\ error=
+Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
+Region\ %s\ already\ inited=
+Remote\ IsisFish\ server=
+Remote\ control\ file\ doesn't\ exists\ %s=
+Rename\ data\ directory\ to\ %s=
+Save\ current\ script=
+Show\ help=
+SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
+Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
+Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
+Stop\ the\ process=
+SubProcess\ start\:\ %s\ %s=
+Switch\ repository\ type\ to\ none=
+The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
+Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
+Try\ to\ log\ on\ %s@%s\:%d=
+Use\ branches,\ switch\ not\ needed=
+User\ stop\ simulation\ %s=
+cant\ start\ nimbus=
+could\ not\ close\ reader\ %1$s=could not close reader %1$s
+could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
+could\ not\ filter\ on\ simulations=could not filter on simulations
+could\ not\ found\ %s=
+could\ not\ found\ log\ file\ %1$s=could not found log file %1$s
+could\ not\ found\ region\ %s=
+could\ not\ found\ simulation\ %s=
+could\ not\ read\ at\ offset\ %1$s\ for\ reason\ %2$s=could not read at offset %1$s for reason %2$s
+destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
+destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
+directory\ %s\ must\ be\ a\ directory=
+filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
+in\ hour=
+isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Please, report any bug you can found.<html>
+isisfish.about.licensetext=You can modify and redistribute the program under the conditions of the GNU General Public License (version 2 or later). A copy of the GPL is in the file "LICENSE.txt" provided with Isis-Fish. All rights reserved. No guarantees are provided for use of this program.
+isisfish.about.title=About Isis-Fish...
+isisfish.advancedParameters.title=advanced Parameters
+isisfish.advancedParams.freeParameters=
+isisfish.advancedParams.libLevelLogger=libLevelLogger
+isisfish.advancedParams.scriptLevelLogger=scriptLevelLogger
+isisfish.advancedParams.simulLevelLogger=simulLevelLogger
+isisfish.advancedParams.simulationCache=cache simulation
+isisfish.advancedParams.simulationStatistique=static simulation
+isisfish.advancedParams.simulatorUse=simulator to Use
+isisfish.cell.comments=comments
+isisfish.cell.land=land
+isisfish.cell.latitude=latitude
+isisfish.cell.longitude=longitude
+isisfish.cell.name=name
+isisfish.change.equation=Can't change equation
+isisfish.commit.message=Enter commit message
+isisfish.common.add=add
+isisfish.common.add.short=add
+isisfish.common.alert=alert
+isisfish.common.apply=apply
+isisfish.common.blank=\
+isisfish.common.cancel=cancel
+isisfish.common.check=check
+isisfish.common.clear=clear
+isisfish.common.date=Date
+isisfish.common.debug=debug
+isisfish.common.ellipsis=ellipsis
+isisfish.common.emigration=emigration
+isisfish.common.empty=vide
+isisfish.common.error=error
+isisfish.common.finish=finish
+isisfish.common.gear=gear
+isisfish.common.immigration=immigration
+isisfish.common.info=info
+isisfish.common.migration=migration
+isisfish.common.month=month %1$s
+isisfish.common.name=Name
+isisfish.common.new=new
+isisfish.common.newMatrix=new Matrix
+isisfish.common.next=next
+isisfish.common.ok=ok
+isisfish.common.openEditor=openEditor
+isisfish.common.populationGroup=populationGroup
+isisfish.common.populations=populations
+isisfish.common.port=port
+isisfish.common.prev=previous
+isisfish.common.region=region
+isisfish.common.remove=remove
+isisfish.common.reset=reset
+isisfish.common.rules=rules
+isisfish.common.save=save
+isisfish.common.saveModel=saveModel
+isisfish.common.saveNextSimulation=saveNextSimulation
+isisfish.common.season=season
+isisfish.common.setOfVessels=setOfVessels
+isisfish.common.simulate=simulate
+isisfish.common.stop=stop
+isisfish.common.strategies=strategies
+isisfish.common.sum=somme
+isisfish.common.tag=tag
+isisfish.common.tripType=tripType
+isisfish.common.value=Value
+isisfish.common.warn=warn
+isisfish.common.year=annee
+isisfish.common.zone=zone
+isisfish.config.main.compileDirectory.description=
+isisfish.config.main.configFileName.description=
+isisfish.config.main.defaultBackupDirectory.description=
+isisfish.config.main.defaultExportDirectory.description=
+isisfish.config.main.defaultExportNames.description=
+isisfish.config.main.defaultMapFile.description=
+isisfish.config.main.defaultResultNames.description=
+isisfish.config.main.defaultSimulator.description=
+isisfish.config.main.defaultTagValue.description=
+isisfish.config.main.encoding.description=encoding used on system
+isisfish.config.main.javadocDirectory.description=
+isisfish.config.main.javadocURL.description=
+isisfish.config.main.launchUI.description=
+isisfish.config.main.localSimulator.description=
+isisfish.config.main.locale.description=user locale
+isisfish.config.main.login.description=
+isisfish.config.main.password.description=
+isisfish.config.main.projectName.description=name of project
+isisfish.config.main.regionMap.description=
+isisfish.config.main.remoteCaparmor.description=
+isisfish.config.main.resultExport.description=
+isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
+isisfish.config.main.simulation.ssh.control.check.interval.description=
+isisfish.config.main.simulation.ssh.datapath.description=
+isisfish.config.main.simulation.ssh.isis.home.description=
+isisfish.config.main.simulation.ssh.login.description=
+isisfish.config.main.simulation.ssh.server.description=
+isisfish.config.main.simulation.ssh.tmppath.description=
+isisfish.config.main.simulationServer.description=
+isisfish.config.main.simulationShowOnlyError.description=
+isisfish.config.main.simulationShowOnlyQueue.description=
+isisfish.config.main.smtpServer.description=
+isisfish.config.main.subSimulator.description=
+isisfish.config.main.userMail.description=
+isisfish.config.main.userName.description=
+isisfish.config.vcs.hostName.description=
+isisfish.config.vcs.keyFile.description=
+isisfish.config.vcs.localDatabasePath.description=
+isisfish.config.vcs.noPassPhrase.description=
+isisfish.config.vcs.passphrase.description=
+isisfish.config.vcs.remoteDatabase.description=
+isisfish.config.vcs.remotePath.description=
+isisfish.config.vcs.type.description=
+isisfish.config.vcs.typeRepo.description=
+isisfish.config.vcs.useSshConnexion.description=
+isisfish.config.vcs.userName.description=
+isisfish.config.vcs.userPassword.description=
+isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
+isisfish.dataResult.export.csv=Export to CSV
+isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
+isisfish.dataResult.label=label9
+isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
+isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
+isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
+isisfish.date.toString=%1$s %2$s
+isisfish.effortDescription.crewFoodCost=isisfish.effortDescription.crewFoodCost
+isisfish.effortDescription.crewShareRate=isisfish.effortDescription.crewShareRate
+isisfish.effortDescription.crewSize=isisfish.effortDescription.crewSize
+isisfish.effortDescription.fishingOperation=isisfish.effortDescription.fishingOperation
+isisfish.effortDescription.fishingOperationDuration=isisfish.effortDescription.fishingOperationDuration
+isisfish.effortDescription.fixedCrewSalary=isisfish.effortDescription.fixedCrewSalary
+isisfish.effortDescription.gearsNumberPerOperation=isisfish.effortDescription.gearsNumberPerOperation
+isisfish.effortDescription.landingCosts=isisfish.effortDescription.landingCosts
+isisfish.effortDescription.otherRunningCost=isisfish.effortDescription.otherRunningCost
+isisfish.effortDescription.repairAndMaintenanceGearCost=isisfish.effortDescription.repairAndMaintenanceGearCost
+isisfish.effortDescription.title=isisfish.effortDescription.title
+isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
+isisfish.effortDescription.unitCostOfFishing=isisfish.effortDescription.unitCostOfFishing
+isisfish.equation.editor.title=Equation Editor
+isisfish.error.acceptable.population=New value isn't acceptable value for this population
+isisfish.error.add.card=Error while adding of result to the map.
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.result.data=Error while adding result ot data.
+isisfish.error.add.result.graph=Error while adding result to graph
+isisfish.error.add.tray=Can't add system tray icon
+isisfish.error.change.classloader=Can't change classloader because can't create URL from file %1$s
+isisfish.error.change.equation=Can't change equation
+isisfish.error.check.region=
+isisfish.error.compile.script=Can't compile script\: %1$s
+isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
+isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
+isisfish.error.create.equation=Can't create equation
+isisfish.error.delete.database=Can't delete database
+isisfish.error.delete.file=could not delete file %1$s
+isisfish.error.delete.vcs.files=Can't delete vcs files
+isisfish.error.dialog.message=Some errors have been detected
+isisfish.error.dialog.title=Error
+isisfish.error.during.simulation=Error during simulation
+isisfish.error.emigration.negative=emigration negative
+isisfish.error.empty.code.rubbin=rubbin's code is empty
+isisfish.error.empty.emigration=emigration empty
+isisfish.error.empty.id.geographic=goegraphic identifier is empty
+isisfish.error.empty.immigration=immigration empty
+isisfish.error.empty.migration=Migration empty
+isisfish.error.empty.name=The name is empty
+isisfish.error.empty.params.name=Parameter name is empty
+isisfish.error.empty.population=Population is empty
+isisfish.error.empty.scientific.name=scentific name is empty
+isisfish.error.empty.season=info season empty
+isisfish.error.empty.selectivity=selectivity is empty
+isisfish.error.empty.species=specie capturable empty
+isisfish.error.empty.species.name=specie's name is empty
+isisfish.error.empty.unit=measure unit is empty
+isisfish.error.equation.return.number=EquationImpl must retun a number\: %1$s
+isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
+isisfish.error.evalute.plan.script=Can't evaluate plan script
+isisfish.error.factor.coefValueIsOne=Coefficient can't be equal to 1
+isisfish.error.factor.invalid=Factor is not valid
+isisfish.error.file.already.exists=The file %1$s already exist
+isisfish.error.get.fisheryRegion=Can't get FisheryRegion
+isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
+isisfish.error.immigration.negative=immigration negative
+isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
+isisfish.error.import.file=Can't import file %1$s
+isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
+isisfish.error.init.map=Can't init map.
+isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
+isisfish.error.instanciate=Can't instanciate %1$s
+isisfish.error.instanciate.export=Can't instanciate export %1$s
+isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
+isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
+isisfish.error.invalid.equation=Equation invalid
+isisfish.error.invalid.equation.name=Invalid equation name
+isisfish.error.invalid.file.name=The script name %1$s is not valid.
+isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
+isisfish.error.invalid.mean.weight=poids moyen invalide
+isisfish.error.invalid.natural.death=natural mortality on classes naissantes invalide
+isisfish.error.invalid.number=the number is invalid
+isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
+isisfish.error.invalid.values.params=Parametre controlable hors valeurs possibles
+isisfish.error.invalidate.natural.death=natural mortality invalid
+isisfish.error.invoke.method=Can't invoke method '%1$s' for class %2$s
+isisfish.error.load.class=Can't load class\: %1$s
+isisfish.error.load.classloader=Can't create ClassLoader for script, bad directory\: %1$s for reason %2$s
+isisfish.error.load.file=could not load file %1$s
+isisfish.error.load.map=Can't load map file\: %1$s
+isisfish.error.log.closeAppender=could not close appender %1$s for category %2$s
+isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
+isisfish.error.log.createAppender=could not create appender [%1$s] \: %2$s for reason %3$s
+isisfish.error.log.foundAppender=\=could not found log appender %1$s for category %2$s
+isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
+isisfish.error.migration.negative=Migration negative
+isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.null.time.step=Error, the time step should not be null
+isisfish.error.no.sector=No sector defined
+isisfish.error.no.select.simulation=could not select simulation
+isisfish.error.no.target.species=no target species in %1$s for %2$s
+isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.code=could not found codeclass for %1$s
+isisfish.error.not.found.description=could not found description for %1$s
+isisfish.error.not.found.field=could not found field %1$s doc for %2$s
+isisfish.error.not.found.field.class=could not found field %1$s for class %2$s
+isisfish.error.not.null.class.grown=classe mature vaut nul
+isisfish.error.not.null.mean.weight=poids moyen nul
+isisfish.error.not.null.natiral.death=natural mortality null
+isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
+isisfish.error.not.support.class=this class does not support
+isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
+isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
+isisfish.error.obtain.doc.export=Can't obtain @Doc on class export
+isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
+isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
+isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
+isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
+isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
+isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
+isisfish.error.out.memory=Out of memory try with more memory (option -mx)
+isisfish.error.overlap.season=Cette saison chevauche une autre saison
+isisfish.error.parse.date=Can't parse date %1$s
+isisfish.error.parse.long=Can't parse long %1$s
+isisfish.error.plan.parameter=Can't get plan parameter from compiled class
+isisfish.error.prepare.data=Can't prepare data
+isisfish.error.prepare.information.simulation=Can't prepare information for simulation
+isisfish.error.read.simulation=Can't read simulation information %1$s
+isisfish.error.read.simulation.parameters=Can't read simulation parameters from file %1$s
+isisfish.error.region.already.exists=This region already exists
+isisfish.error.region.name.empty=Region name is empty
+isisfish.error.remove.directory=Can't remove directory %1$s
+isisfish.error.rename.region=Can't rename region to %1$s
+isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: %1$s
+isisfish.error.save.region=
+isisfish.error.save.script.compilation=Can't save script to compilation\: %1$s
+isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
+isisfish.error.script.create=isisfish.error.script.create
+isisfish.error.script.delete=Can't delete file %1$s for reason %2$s
+isisfish.error.script.import=Can't import file for reason %1$s
+isisfish.error.script.load=Can't load file %1$s for reason %2$s
+isisfish.error.script.save=Can't save file %1$s for reason %2$s
+isisfish.error.sensitivity.parameter=
+isisfish.error.simulation.log.openAppender=could not open appender of simulation %1$s for reason %2$s
+isisfish.error.simulation.remote.global=Can't launch a simulation on remote server
+isisfish.error.simulation.remote.wrongportvalue=Connection port value is incorrect \: %s
+isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason %1$s
+isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason %1$s
+isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason %1$s
+isisfish.error.source.parameter=Can't get parameter from source
+isisfish.error.strategy.order=Strategy %1$s don't have 12 StrategyMonthInfo but %2$s. Recreate them
+isisfish.error.undefined.classes=No classes defined
+isisfish.error.undefined.correspondence.zones.reproduction.recruitment=pas de correspondance entre les zones de reproduction et les zones de recrutement
+isisfish.error.undefined.gear=The engin is not defined
+isisfish.error.undefined.mesh=No mesh defined
+isisfish.error.undefined.mesh.sector=No maille defined in sector
+isisfish.error.undefined.meta.population=No population defined
+isisfish.error.undefined.natural.death=No natural mortality on classes naissantes
+isisfish.error.undefined.sector=No sector defined
+isisfish.error.undefined.stategy=No strategy defined
+isisfish.error.undefined.stategy.months=The strategy is not defined for some mounths
+isisfish.error.undefined.zone.population=No population's zone defined
+isisfish.error.undefined.zone.recruitment=No recrutment's zone defined
+isisfish.error.undefined.zone.reproduction=No reprodution's zone defined
+isisfish.error.unsupported.equation.langage=unsupported langage '%1$s' for equation\: %2$s
+isisfish.error.wait.simThread=Can't wait SimThread
+isisfish.error.warning.title=Warning
+isisfish.error.write.simulation=Can't write information %1$s
+isisfish.exit.text=Something has change, please enter a comment
+isisfish.exit.title=Exit
+isisfish.export.directory=Export directory
+isisfish.export.saved=Export saved
+isisfish.export.title=Results export
+isisfish.factor.coefficient=Coefficient (in %)
+isisfish.factor.comment=Comment
+isisfish.factor.continue=Continue factor
+isisfish.factor.discret=Discret factor
+isisfish.factor.factor=Factor
+isisfish.factor.firstValue=First value
+isisfish.factor.increment=Cardinality
+isisfish.factor.lastValue=Last value
+isisfish.factor.name=Factor name
+isisfish.factor.operateur=Operator
+isisfish.factor.selectDiscretNumber=Number of factors
+isisfish.factor.title=Factor input
+isisfish.factor.validDiscretNumber=Ok
+isisfish.factor.value=Value
+isisfish.filter=Filter
+isisfish.filter.apply=Apply filter
+isisfish.filter.cancel=Cancel
+isisfish.filter.log.levelDebug=Debug
+isisfish.filter.log.levelError=Error
+isisfish.filter.log.levelFatal=Fatal
+isisfish.filter.log.levelInfo=Info
+isisfish.filter.log.levelTrace=Trace
+isisfish.filter.log.levelWarn=Warn
+isisfish.filter.log.tooltip.levelDebug=Debug
+isisfish.filter.log.tooltip.levelError=Error
+isisfish.filter.log.tooltip.levelFatal=Fatal
+isisfish.filter.log.tooltip.levelInfo=Info
+isisfish.filter.log.tooltip.levelTrace=Trace
+isisfish.filter.log.tooltip.levelWarn=Warn
+isisfish.filter.log.tooltip.message=Enter a term to search and press Enter
+isisfish.filter.reset=Reset
+isisfish.filter.result=Results
+isisfish.filter.result.found=Results (%d/%d)
+isisfish.filter.select=filter.select
+isisfish.filter.select.simulation=select.simulation
+isisfish.filter.simulation=filter.simulation
+isisfish.filter.simulation.analysePlanNumber=analysePlanNumber
+isisfish.filter.simulation.description=description
+isisfish.filter.simulation.local=local
+isisfish.filter.simulation.numberOfYear=numberOfYear
+isisfish.filter.simulation.regionName=regionName
+isisfish.filter.simulation.simulationEnd=simulationEnd
+isisfish.filter.simulation.simulationName=simulationName
+isisfish.filter.simulation.simulationStart=simulationStart
+isisfish.filter.simulation.simulatorName=simulatorName
+isisfish.filter.simulation.tooltip.analysePlanNumber=filter.simulation.tooltip.analysePlanNumber
+isisfish.filter.simulation.tooltip.description=filter.simulation.tooltip.description
+isisfish.filter.simulation.tooltip.local=filter.simulation.tooltip.local
+isisfish.filter.simulation.tooltip.numberOfYear=filter.simulation.tooltip.numberOfYear
+isisfish.filter.simulation.tooltip.regionName=filter.simulation.tooltip.regionName
+isisfish.filter.simulation.tooltip.simulationEnd=filter.simulation.tooltip.simulationEnd
+isisfish.filter.simulation.tooltip.simulationName=filter.simulation.tooltip.simulationName
+isisfish.filter.simulation.tooltip.simulationStart=filter.simulation.tooltip.simulationStart
+isisfish.filter.simulation.tooltip.simulatorName=filter.simulation.tooltip.simulatorName
+isisfish.filter.simulation.tooltip.useAnalysePlan=filter.simulation.tooltip.useAnalysePlan
+isisfish.filter.simulation.tooltip.useOptimization=filter.simulation.tooltip.useOptimization
+isisfish.filter.simulation.tooltip.usePreScript=filter.simulation.tooltip.usePreScript
+isisfish.filter.simulation.tooltip.useStatistic=filter.simulation.tooltip.useStatistic
+isisfish.filter.simulation.useAnalysePlan=filter.simulation.useAnalysePlan
+isisfish.filter.simulation.useOptimization=filter.simulation.useOptimization
+isisfish.filter.simulation.usePreScript=filter.simulation.usePreScript
+isisfish.filter.simulation.useStatistic=filter.simulation.useStatistic
+isisfish.fisheryRegion.addMap=Add map
+isisfish.fisheryRegion.area=Fishery area boundaries
+isisfish.fisheryRegion.comments=Comments
+isisfish.fisheryRegion.delMap=Delete map
+isisfish.fisheryRegion.latitude=Lat.
+isisfish.fisheryRegion.latitude.max=Lat. max.
+isisfish.fisheryRegion.latitude.min=Lat. min.
+isisfish.fisheryRegion.longitude=Long.
+isisfish.fisheryRegion.longitude.max=Long. max.
+isisfish.fisheryRegion.longitude.min=Long. min.
+isisfish.fisheryRegion.name=Region name
+isisfish.fisheryRegion.ofCells=of cells (option)
+isisfish.fisheryRegion.selectFile=Select a file
+isisfish.fisheryRegion.spatial=Spatial resolution
+isisfish.gear.comments=Comments
+isisfish.gear.effortUnit=Effort Unit
+isisfish.gear.name=Name
+isisfish.gear.rangeValues=Range of values
+isisfish.gear.standardisationFactor=Standardisation factor
+isisfish.gear.technicalParameter=Technical parameter
+isisfish.gear.title=Gear
+isisfish.graphBean.graph.render=Choose a graph render
+isisfish.graphBean.graphPanel=defaultToolTip-fr.ifremer.graph.GraphBean.graphPanel
+isisfish.graphBean.graphRendererCombo=defaultToolTip-fr.ifremer.graph.GraphBean.graphRendererCombo
+isisfish.graphBean.graphSplitPane=defaultToolTip-fr.ifremer.graph.GraphBean.graphSplitPane
+isisfish.graphBean.label=defaultToolTip-fr.ifremer.graph.GraphBean.label1
+isisfish.graphBean.palettePanel=defaultToolTip-fr.ifremer.graph.GraphBean.palettePanel
+isisfish.graphBean.scrolledwindow=defaultToolTip-fr.ifremer.graph.GraphBean.scrolledwindow1
+isisfish.graphBean.table=defaultToolTip-fr.ifremer.graph.GraphBean.table2
+isisfish.graphBean.table3=defaultToolTip-fr.ifremer.graph.GraphBean.table3
+isisfish.graphCombo.render.bar.horizontal=Rendu en barre horizontale
+isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empilee
+isisfish.graphCombo.render.bar.vertical=Rendu en barre verticale
+isisfish.graphCombo.render.bar.vertical.3d=Rendu en barre verticale 3D
+isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empilee
+isisfish.graphCombo.render.line=Rendu en ligne
+isisfish.graphCombo.render.min.max=Rendu en MinMax
+isisfish.graphCombo.render.surface=Rendu en Aire
+isisfish.infoItem..table=defaultToolTip-fr.ifremer.resultat.InfoItem.table29
+isisfish.infoItem.label=defaultToolTip-fr.ifremer.resultat.InfoItem.label
+isisfish.infoItem.list=defaultToolTip-fr.ifremer.resultat.InfoItem.list
+isisfish.infoItem.scrolledwindow=defaultToolTip-fr.ifremer.resultat.InfoItem.scrolledwindow1
+isisfish.infoItem.sum=defaultToolTip-fr.ifremer.resultat.InfoItemDate.sumButton
+isisfish.infoItem.sum.year=Sum elements per year
+isisfish.infoItem.table=defaultToolTip-fr.ifremer.resultat.InfoItem.table30
+isisfish.input.continueCells=Continue to cells
+isisfish.input.continueGears=Continue to gears
+isisfish.input.continueMetiers=Continue to metiers
+isisfish.input.continuePopulations=Continue to populations
+isisfish.input.continuePorts=Continue to ports
+isisfish.input.continueSetOfVessels=Continue to set of vessels
+isisfish.input.continueSpecies=
+isisfish.input.continueStrategies=Continue to strategies
+isisfish.input.continueTripTypes=Continue to trip type
+isisfish.input.continueVesselTypes=Continue to vessel types
+isisfish.input.continueZones=Continue to zones
+isisfish.input.menu.addRegion=Add region
+isisfish.input.menu.commit=Commit change
+isisfish.input.menu.copyRegion=Copy Region
+isisfish.input.menu.exportRegion=Export Region
+isisfish.input.menu.importRegion=Import Region
+isisfish.input.menu.importRegionSimulation=Import Region from simulation
+isisfish.input.menu.importRegionV2=Import Region from v2
+isisfish.input.menu.importRenameRegion=Import Region and rename
+isisfish.input.menu.removeLocaly=Remove localy
+isisfish.input.menu.removeLocalyRemotely=Remove localy and remotely
+isisfish.input.menu.server=Server
+isisfish.input.newRegion=New region
+isisfish.input.selectRegion=Select region
+isisfish.input.title=Fishery input
+isisfish.launch.anonymous=read only
+isisfish.launch.debugMode=debug mode
+isisfish.launch.email=email
+isisfish.launch.firstname=firstname
+isisfish.launch.init.done=init done in %1$s.
+isisfish.launch.lasstname=lasstname
+isisfish.launch.server.authenticationMethod=server access
+isisfish.launch.server.login=server login
+isisfish.launch.server.ssh.confirm.passphrase=confirm passphrase
+isisfish.launch.server.ssh.key.change=Change your ssh key
+isisfish.launch.server.ssh.key.generate=Generate ssh key
+isisfish.launch.server.ssh.no.passphrase=no passphrase
+isisfish.launch.server.ssh.passphrase=passphrase
+isisfish.launch.server.ssh.privateKeyFile=private ssh key
+isisfish.launch.server.ssh.publicKeyFile=public ssh key
+isisfish.launch.ssh=read-write (ssh)
+isisfish.launch.start=Launching Isis-fish ... %1$s
+isisfish.launch.stop=Stopping simulation...
+isisfish.launching=after init done in %1$s.
+isisfish.log.addAppender=add appender [%1$s]
+isisfish.log.body=Message to add
+isisfish.log.closeAppender=closing appender %1$s for category %2$s
+isisfish.log.mail.failed=Can't send report by mail. Is your mail server up ? (I'm trying to contact the < %1$s > smtp server)
+isisfish.log.mail.send=A report has been sent to %1$s
+isisfish.log.mail.send.title=Send simulation %1$s by email
+isisfish.log.mailTo=Destination adress
+isisfish.log.removeAppender=remove appender [%1$s]
+isisfish.log.restoreLogLevel=swap back level for logger %1$s from level %2$s to level %3$s
+isisfish.log.sendAll=Send the complete simulation archive
+isisfish.log.sendMail=Send by email
+isisfish.log.simulation.name=IsisFish simulation %1$s
+isisfish.log.swapLogLevel=swap level for logger %1$s from level %2$s to level%3$s
+isisfish.log.tooltip.body=The message will be join to email
+isisfish.log.tooltip.mailTo=Enter destination adress
+isisfish.log.tooltip.sendAll=Send the complete simulation archive, or just the log file
+isisfish.log.tooltip.sendMail=Click here to send the email with files
+isisfish.message.add.objets.simulation=Add new objets simulation
+isisfish.message.backup.database.finished=backup database finished
+isisfish.message.backup.database.progress=backup database in progress
+isisfish.message.cancel.finished=Cancel finished
+isisfish.message.check.finished=check finished
+isisfish.message.check.region=
+isisfish.message.checking.cell=
+isisfish.message.choose.archive=choose archive file or directory
+isisfish.message.commit.cancelled=commit cancelled
+isisfish.message.commit.finished=commit finished
+isisfish.message.commit.region.canceled=Commit region canceled
+isisfish.message.commiting.region=Commiting region %1$s ...
+isisfish.message.compilation.time=Compilation time %1$ss
+isisfish.message.confirm.delete.object=Do you really want delete object %1$s
+isisfish.message.confirm.remove.region=Do you really want to remove the region %1$s ?
+isisfish.message.confirm.remove.script=Do you want to remove script '%1$s' ?
+isisfish.message.copy.finished=Copy finished
+isisfish.message.copy.region=Copy region to %1$s
+isisfish.message.creating.region=Creating region %1$s
+isisfish.message.creation.done=creation done %1$s
+isisfish.message.creation.finished=Creation finished
+isisfish.message.delete.canceled=delete canceled
+isisfish.message.delete.entities=Delete entities
+isisfish.message.delete.entity=Delete entity
+isisfish.message.delete.finished=delete finished
+isisfish.message.delete.object=To delete object %1$s, all next object will be deleted\n\n
+isisfish.message.evaluation.finished=evaluation finished
+isisfish.message.export.done=export done
+isisfish.message.export.zip=Export to zip file %1$s
+isisfish.message.file.overwrite=File exists, do you want overwrite it ?
+isisfish.message.import=Import %1$s
+isisfish.message.import.equation.convert=Manual equation convertion
+isisfish.message.import.finished=Import finished
+isisfish.message.import.region.name=Enter name for imported region
+isisfish.message.import.region.xml=XMLed Region
+isisfish.message.import.region.zipped=Zipped Region
+isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
+isisfish.message.import.xml.v2.file=Import xml v2 file
+isisfish.message.import.zip=Import zip file
+isisfish.message.launchui.notlaunch=
+isisfish.message.load.finished=load finished
+isisfish.message.load.map=Try to load map file\: %1$s (%2$s, %3$s)
+isisfish.message.loading.old.simulation=Loading old simulation ...
+isisfish.message.loading.region=Loading region ...
+isisfish.message.name.imported.region=Enter name for imported region
+isisfish.message.new.filename=Enter the name of the new file. (use only chars and _ and start with uppercase)
+isisfish.message.new.region.name=Enter new region name
+isisfish.message.old.simulation.loaded=Old simulation loaded
+isisfish.message.page.modified=This page has been modified, do you want to save it ?
+isisfish.message.presimulation.script.execution=Presimulation Script execution
+isisfish.message.recruitment.number.month=Input the number of month of recruitment
+isisfish.message.region.commited=Region commited
+isisfish.message.region.loaded=Region loaded
+isisfish.message.region.remove.canceled=Region remove canceled
+isisfish.message.region.removed=Region removed
+isisfish.message.remove.canceled=Remove canceled
+isisfish.message.remove.finished=Remove finished
+isisfish.message.removing.region=Removing region %1$s ...
+isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
+isisfish.message.save.finished=Save finished
+isisfish.message.saveModel.finished=Save model finished
+isisfish.message.script.commit=Enter commit message
+isisfish.message.setting.cache.aspects=Setting Cache aspects
+isisfish.message.setting.trace.aspects=Setting Trace aspects
+isisfish.message.simulation.ended=Simulation ended
+isisfish.message.simulation.execution=Simulation execution
+isisfish.message.simulation.prepare=Preparing simulation
+isisfish.message.tray.disabled=SystemTray disabled
+isisfish.message.update.finished=update finished
+isisfish.metier.comments=Comments
+isisfish.metier.name=Name
+isisfish.metier.rangeValues=Range of values
+isisfish.metier.title=Metier
+isisfish.metierMonitor.metiers=Metiers
+isisfish.metierMonitor.strategies=Strategies
+isisfish.metierSeasonInfo.toString=%1$s season %2$s-%3$s
+isisfish.metierSeasonInfoSpecies.mainSpecies=Main species for the metier
+isisfish.metierSeasonInfoSpecies.selectSeason=Select a season
+isisfish.metierSeasonInfoSpecies.selectSpecies=Select a species
+isisfish.metierSeasonInfoSpecies.species=Species
+isisfish.metierSeasonInfoSpecies.targetFactor=Target factor
+isisfish.metierSeasonInfoSpecies.title=Catchable species
+isisfish.metierSeasonInfoZone.comments=Comments
+isisfish.metierSeasonInfoZone.season=Season
+isisfish.metierSeasonInfoZone.selectSeason=Select a season
+isisfish.metierSeasonInfoZone.title=Seasons / Zones
+isisfish.monitor.title=Application Monitor
+isisfish.month.april=april
+isisfish.month.august=august
+isisfish.month.december=december
+isisfish.month.february=february
+isisfish.month.january=january
+isisfish.month.july=july
+isisfish.month.june=june
+isisfish.month.march=march
+isisfish.month.may=may
+isisfish.month.november=november
+isisfish.month.october=october
+isisfish.month.september=september
+isisfish.params.changeLogLev=Change from level '%1$s' to level '%2$s'
+isisfish.params.clearFilter=Clear filter
+isisfish.params.description=Description
+isisfish.params.filter=Filter
+isisfish.params.lblLauncher=Simulation launcher
+isisfish.params.loadOldSimulation=Load old simulation
+isisfish.params.numberYear=Number of year
+isisfish.params.onlyExportSimulation=Only export simulation
+isisfish.params.populationNumbers=Population numbers input
+isisfish.params.ruleParameters=Rule's parameters
+isisfish.params.sensitivityName=Sensitivity name
+isisfish.params.simulationName=Simulation name
+isisfish.params.title=Parameters
+isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\n\n
+isisfish.params.toString.lib.logger.level=Level of libraries' logger %1$s
+isisfish.params.toString.number.years=Number of years\: %1$s\n\n
+isisfish.params.toString.plan=Plan\: %1$s
+isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\n\n
+isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.rule=Rule\: %1$s
+isisfish.params.toString.script.logger.level=Level of scripts' logger %1$s
+isisfish.params.toString.script.presimulation=Script de presimulation
+isisfish.params.toString.simul.logger.level=Level of simulator's logger %1$s
+isisfish.params.toString.simulation.done=Simulation done with %1$s\:
+isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
+isisfish.params.useAnalysePlan=Use simulation plan
+isisfish.params.usePreSimulationScript=Use pre simulation script
+isisfish.population.capturability=Capturability
+isisfish.population.comments=Comments
+isisfish.population.group=Group
+isisfish.population.groups=Groups
+isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
+isisfish.population.matrixAbundance=matrixAbundance
+isisfish.population.matrixAbundance1D=matrixAbundance1D
+isisfish.population.recruitment=Recruitment
+isisfish.population.reproduction=Reproduction
+isisfish.population.season=Season
+isisfish.population.zones=Zones
+isisfish.populationBasics.geographicID=geographicID
+isisfish.populationBasics.growth=growth
+isisfish.populationBasics.growthReverse=growthReverse
+isisfish.populationBasics.maturityGroup=maturity group
+isisfish.populationBasics.name=name
+isisfish.populationBasics.numberGroup=Number of group
+isisfish.populationBasics.plusGroup=plusGroup
+isisfish.populationBasics.recreateClasses=Recreate the classes
+isisfish.populationBasics.title=inputPopulationBasics
+isisfish.populationCapturability.comments=Comments
+isisfish.populationCapturability.selectCoefficient=Select a coefficient per season and per class
+isisfish.populationCapturability.title=inputPopulationCapturability
+isisfish.populationEquation.meanWeight=Mean weight
+isisfish.populationEquation.naturalDeathRate=Natural death rate
+isisfish.populationEquation.price=Price
+isisfish.populationEquation.title=Equations input
+isisfish.populationGroup.age=Age
+isisfish.populationGroup.comments=Comments
+isisfish.populationGroup.length=Length
+isisfish.populationGroup.meanWeigth=Mean Weigth
+isisfish.populationGroup.naturalDeathRate=Natural death rate
+isisfish.populationGroup.price=Price
+isisfish.populationGroup.reproductionRate=Reproduction rate
+isisfish.populationGroup.title=Population group input
+isisfish.populationGroup.toString=%1$s Group %2$s
+isisfish.populationMigration.comments=Comments
+isisfish.populationMigration.selectSeason=Select a season
+isisfish.populationMigration.title=Migration
+isisfish.populationMigration.useEquation=Use equation
+isisfish.populationMigrationEmigration.coefficient=Coefficient
+isisfish.populationMigrationEmigration.departureZone=Departure Zone
+isisfish.populationMigrationEmigration.title=Population emigration
+isisfish.populationMigrationImmigration.arrivalZone=Arrival Zone
+isisfish.populationMigrationImmigration.coefficient=Coefficient
+isisfish.populationMigrationImmigration.title=Population immigration
+isisfish.populationMigrationMigration.arrivalZone=Arrival Zone
+isisfish.populationMigrationMigration.coefficient=Coefficient
+isisfish.populationMigrationMigration.departureZone=Departure Zone
+isisfish.populationMigrationMigration.title=Population migration
+isisfish.populationRecruitment.comments=Comments
+isisfish.populationRecruitment.recruitmentDistribution=Recruitment Distribution
+isisfish.populationRecruitment.reproductionEquation=ReproductionEquation
+isisfish.populationRecruitment.title=inputPopulationRecruitment
+isisfish.populationSeasonInfo.arrival=Arrival
+isisfish.populationSeasonInfo.departure=Departure
+isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
+isisfish.populationSeasonInfo.emigration=Emigration
+isisfish.populationSeasonInfo.group=Group
+isisfish.populationSeasonInfo.immigration=Immigration
+isisfish.populationSeasonInfo.migration=Migration
+isisfish.populationSeasonInfo.months=Months
+isisfish.populationSeasonInfo.toString=%1$s season %2$s-%3$s
+isisfish.populationSeasons.changeGroup=Change of group
+isisfish.populationSeasons.comments=Comments
+isisfish.populationSeasons.distributionSpawning=Distribution of spawning
+isisfish.populationSeasons.selectSeason=Select a season
+isisfish.populationSeasons.title=Saisons
+isisfish.populationZones.betweenSpawningRecruitmentAreas=Match between spawning and recruitment areas
+isisfish.populationZones.selectPopulationAreas=Select the population areas
+isisfish.populationZones.selectRecruitmentAreas=Select the recruitment areas
+isisfish.populationZones.selectSpawningAreas=Select the spawning areas
+isisfish.populationZones.title=inputPopulationZones
+isisfish.port.cell=Port cell
+isisfish.port.comments=Comments
+isisfish.port.name=Name
+isisfish.preScript.backParameter=Back to parameter tab
+isisfish.preScript.title=Pre simulation script
+isisfish.queue.clearDone=Clear done jobs
+isisfish.queue.id=Id
+isisfish.queue.launcher=Simulation launcher
+isisfish.queue.plan=Plan
+isisfish.queue.progression=Progression
+isisfish.queue.showLog=Show simulation log
+isisfish.queue.simulationLaunch=Simulation queue launch
+isisfish.queue.status=Status
+isisfish.queue.stopSimulation=Stop simulation
+isisfish.queue.title=Queue
+isisfish.result.abundance=Abondance
+isisfish.result.add=Add a result
+isisfish.result.begin.simulation=En debut de Simulation\:
+isisfish.result.capture=Capture
+isisfish.result.capture.metier=Capture par metier
+isisfish.result.choose.simulation=Choose a Simulation
+isisfish.result.datas=Datas
+isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
+isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
+isisfish.result.dimension=Dimension
+isisfish.result.end.simulation=Simuation end \:
+isisfish.result.export=Export
+isisfish.result.export.file=Export text file
+isisfish.result.file=File
+isisfish.result.graph=Graph
+isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
+isisfish.result.hpaned=defaultToolTip-fr.ifremer.resultat.ResultatEdit.hpaned2
+isisfish.result.infoPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.infoPanel
+isisfish.result.label=defaultToolTip-fr.ifremer.resultat.ResultatView.label9
+isisfish.result.map=Map
+isisfish.result.mapRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.mapRadioButton
+isisfish.result.menuExport=defaultToolTip-fr.ifremer.resultat.ResultatEdit.menuExport
+isisfish.result.menubar=defaultToolTip-fr.ifremer.resultat.ResultatView.menubar1
+isisfish.result.menuitem=defaultToolTip-fr.ifremer.resultat.ResultatView.menuitem2
+isisfish.result.new.window=Open a new window
+isisfish.result.openWindowButton=defaultToolTip-fr.ifremer.resultat.ResultatView.openWindowButton
+isisfish.result.quit=Quitter
+isisfish.result.reject.metier=Rejet par metier
+isisfish.result.remove.simulation=Supprimer Simulation
+isisfish.result.removeSimulationButton=defaultToolTip-fr.ifremer.resultat.ResultatView.supprimerSimulationButton
+isisfish.result.resultat=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resultat
+isisfish.result.scroll=defaultToolTip-fr.ifremer.resultat.ResultatEdit.scroll
+isisfish.result.show.simulation.log=Show logs
+isisfish.result.simulation=defaultToolTip-fr.ifremer.resultat.ResultatView.simulation
+isisfish.result.statusBar=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusbar1
+isisfish.result.statusImage=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusImage
+isisfish.result.stress.metier=Effort par metier
+isisfish.result.summary=R\u00E9sum\u00E9
+isisfish.result.summaryRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resumeRadioButton
+isisfish.result.table=defaultToolTip-fr.ifremer.resultat.ResultatView.table33
+isisfish.result.title=Resultat
+isisfish.result.tooltip.show.simulation.log=Click to display the log console of the simulation
+isisfish.result.unload.metier=Debarquement par metier
+isisfish.result.vbox=defaultToolTip-fr.ifremer.resultat.ResultatView.vbox1
+isisfish.result.viewPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.viewPanel
+isisfish.resultChoice.save=Results to save
+isisfish.resultChoice.saved=Results saved
+isisfish.resultChoice.title=Result choice
+isisfish.resume.matrixInfoGrid=defaultToolTip-fr.ifremer.resultat.ResumePanel.matriceInfoGrid
+isisfish.resume.resumeTextArea=defaultToolTip-fr.ifremer.resultat.ResumePanel.resumeTextArea
+isisfish.resume.scrolledwindow=defaultToolTip-fr.ifremer.resultat.ResumePanel.scrolledwindow2
+isisfish.resume.table=defaultToolTip-fr.ifremer.resultat.ResumePanel.table1
+isisfish.script.check=Check
+isisfish.script.commit=Commit
+isisfish.script.copy=Copy
+isisfish.script.cut=Cut
+isisfish.script.evaluate=Evaluate
+isisfish.script.export=export
+isisfish.script.export.cancel=cancel
+isisfish.script.export.checkAll=checkAll
+isisfish.script.export.chooseDir=chooseDir
+isisfish.script.export.ok=ok
+isisfish.script.export.tooltip.checkAll=
+isisfish.script.export.tooltip.chooseDir=
+isisfish.script.import=import
+isisfish.script.import.cancel=cancel
+isisfish.script.import.checkAll=checkAll
+isisfish.script.import.labelAdd=labelAdd
+isisfish.script.import.labelOverwrite=labelOverwrite
+isisfish.script.import.ok=ok
+isisfish.script.import.tooltip.checkAll=
+isisfish.script.menu.checkSyntax=CheckSyntax
+isisfish.script.menu.code=Code
+isisfish.script.menu.commit=Commit script to server
+isisfish.script.menu.copy=Copy
+isisfish.script.menu.cut=Cut
+isisfish.script.menu.deleteLocaly=Delete localy
+isisfish.script.menu.deleteLocalyServer=Delete localy and on server
+isisfish.script.menu.diff=Display diff with server version
+isisfish.script.menu.edit=Edit
+isisfish.script.menu.evaluate=Evaluate
+isisfish.script.menu.file=File
+isisfish.script.menu.new=New
+isisfish.script.menu.paste=Paste
+isisfish.script.menu.save=Save
+isisfish.script.menu.txtEditorHelp=Online help
+isisfish.script.menu.txtExport=Export
+isisfish.script.menu.txtHelp=Help
+isisfish.script.menu.txtImport=Import
+isisfish.script.menu.txtJavaHelp=Java help
+isisfish.script.menu.txtNewAnalysePlan=New analyse plan
+isisfish.script.menu.txtNewEquationModel=New Equation model
+isisfish.script.menu.txtNewExport=New Export
+isisfish.script.menu.txtNewRule=New rule
+isisfish.script.menu.txtNewScript=New script
+isisfish.script.menu.txtNewSensitivity=New sensitivity calculator
+isisfish.script.menu.txtNewSimulator=New simulator
+isisfish.script.menu.txtVCS=Server
+isisfish.script.menu.update=Update from server
+isisfish.script.new=New
+isisfish.script.paste=Paste
+isisfish.script.save=Save
+isisfish.script.title=Script Editor
+isisfish.script.txtExport=txtExport
+isisfish.season.toString=season %1$s-%2$s
+isisfish.selectivity.equation=Equation
+isisfish.selectivity.selectPopulation=Select a population
+isisfish.selectivity.title=Selectivity
+isisfish.sens.backParameter=Back to parameter tab
+isisfish.sens.title=Sensibility analysis
+isisfish.sensitivity.displaysecondpass=Display results
+isisfish.sensitivity.export=Export
+isisfish.sensitivity.secondpass=Analyze results
+isisfish.sensitivity.secondpass.title=Analyze results
+isisfish.sensitivity.select=Method
+isisfish.sensitivity.title=Factors input
+isisfish.sensitivityChooser.title=Sensitivities input
+isisfish.server.ssh.generateKey.title=Generate Ssh key
+isisfish.setOfVessels.comments=Comments
+isisfish.setOfVessels.fixedCosts=Fixed costs
+isisfish.setOfVessels.name=Name
+isisfish.setOfVessels.numberOfVessels=Number of vessels
+isisfish.setOfVessels.technicalEfficiency=
+isisfish.setOfVessels.title=Caracteristics
+isisfish.setOfVessels.vesselType=vesselType
+isisfish.simpleResult.legendPanel=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.legendPanel
+isisfish.simpleResult.more.information=Clic a cell for more information...
+isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
+isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
+isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
+isisfish.simulation.log.console.title=Log console for simulation '%1$s'
+isisfish.simulation.log.showConsole=display log console for simulation %1$s
+isisfish.simulation.menu.import=Restor simulation parameter
+isisfish.simulation.menu.save=Save simulation parameter
+isisfish.simulation.menu.simulation=Simulation
+isisfish.simulation.name=Simulation name
+isisfish.simulation.remote.message.connection=Connecting to Caparmor
+isisfish.simulation.remote.message.downloadresults=Downloading results
+isisfish.simulation.remote.message.upload=Uploading simulation
+isisfish.simulation.remote.message.waitingstart=Waiting for simulation start
+isisfish.simulation.title=Simulation launcher
+isisfish.simulator.launcher.inprocess=in current process
+isisfish.simulator.launcher.remote=on Caparmor server
+isisfish.simulator.launcher.subprocess=in subprocess
+isisfish.simulator.simulaction.badid=Can't start simulation, bad id\: %s
+isisfish.simulator.subprocess.readoutput.error=
+isisfish.species.age=Age
+isisfish.species.cee=CEE
+isisfish.species.comments=Comments
+isisfish.species.length=Length
+isisfish.species.name=Species name
+isisfish.species.rubbinCode=Rubbin code
+isisfish.species.scientificName=Scientific name
+isisfish.species.structured=Structured
+isisfish.ssh.askpassphrase.message=Enter passphrase for key '%s' \:
+isisfish.ssh.askpassphrase.title=SSH key unlocking
+isisfish.ssh.askpassphrase.wrongpassphrase=Wrong passphrase, enter a new one for key '%s' \:
+isisfish.strategy.comments=Comments
+isisfish.strategy.inactivity=
+isisfish.strategy.inactivityEquationUsed=Use inactivity equation
+isisfish.strategy.name=Name
+isisfish.strategy.proportionSetOfVessels=Set of vessels proportion
+isisfish.strategy.title=Caracteristics
+isisfish.strategyMonthInfo.metier=Metier
+isisfish.strategyMonthInfo.minInactivityDays=minInactivityDays
+isisfish.strategyMonthInfo.numberOfTrips=numberOfTrips
+isisfish.strategyMonthInfo.proportion=Proportion
+isisfish.strategyMonthInfo.title=StrategyMonthInfo
+isisfish.strategyMonthInfo.toString=%1$s %2$s
+isisfish.timeUnit.day=Day
+isisfish.timeUnit.hours=Hours
+isisfish.tray.simulation=Isis-fish - %1$s \: %2$s/%3$s
+isisfish.tray.simulation.no=Isis-fish - No simulation
+isisfish.tripType.comments=Comments
+isisfish.tripType.duration=Duration
+isisfish.tripType.minTime=Minimum time between trips
+isisfish.tripType.name=Name
+isisfish.vcs.ask.passphrase=Enter your pass phrase (if your private key have one).
+isisfish.vcs.ask.passphrase.title=Ask your pass phrase
+isisfish.vcs.commit=vcs.commit
+isisfish.vcs.commit.cancel=vcs.commit.cancel
+isisfish.vcs.commit.label=vcs.commit.label
+isisfish.vcs.commit.ok=vcs.commit.ok
+isisfish.vcs.init.notfoundcantdownload=No database version %s found and can't get it.\nYou must go to ISIS-Fish web site and download database manually.
+isisfish.vcs.init.wrongprotocol=Your database repository\: %s\n don't use correct protocol.\nDo you want to make backup of your database and take the correct one ?
+isisfish.vcs.switchprotocol.confirm=Protocol to access repository script has changed.\nDo you want to switch your repository ?
+isisfish.vcs.switchtag.warningconflict=Your repository is now up-to-date, but following files are conflicted, you may check them \:\n%s
+isisfish.vcs.switchversion.confirm=You don't use correct repository script for your application version %s.\nDo you want to switch your repository ?
+isisfish.vcs.update=vcs.update
+isisfish.vcs.update.cancel=cancel
+isisfish.vcs.update.checkAll=checkAll
+isisfish.vcs.update.local=local
+isisfish.vcs.update.local.modified=modified
+isisfish.vcs.update.local.outofdateAndModified=outofdateAndModified
+isisfish.vcs.update.local.tooltip.modified=
+isisfish.vcs.update.local.tooltip.outofdateAndModified=
+isisfish.vcs.update.local.tooltip.unversionned=
+isisfish.vcs.update.local.unversionned=unversionned
+isisfish.vcs.update.ok=ok
+isisfish.vcs.update.remote=remote
+isisfish.vcs.update.remote.missing=missing
+isisfish.vcs.update.remote.outofdate=outofdate
+isisfish.vcs.update.remote.tooltip.missing=
+isisfish.vcs.update.remote.tooltip.outofdate=
+isisfish.vcs.update.tooltip.checkAll=checkAll
+isisfish.vcs.update.tooltip.local=
+isisfish.vcs.update.tooltip.remote=
+isisfish.vcs.updateconfirm=updateconfirm
+isisfish.vcs.updateconfirm.cancel=cancel
+isisfish.vcs.updateconfirm.checkAll=checkAll
+isisfish.vcs.updateconfirm.label=
+isisfish.vcs.updateconfirm.label2=
+isisfish.vcs.updateconfirm.ok=ok
+isisfish.vcs.updateconfirm.tooltip.checkAll=
+isisfish.vcs.updaterepository.confirm=Your repository is not up to date.\nDo you want to update following files ?
+isisfish.vcs.vcssvn.add.error=Can't add file
+isisfish.vcs.vcssvn.add.errorreadonly=You can't add file, this repository is readonly
+isisfish.vcs.vcssvn.checkProtocol.error=Can't get address on serveur of local repository
+isisfish.vcs.vcssvn.checkProtocol.relocate=Relocate repository %s from %s to %s
+isisfish.vcs.vcssvn.checkout.error=Can't checkout
+isisfish.vcs.vcssvn.cleanup.error=Can't cleanup working copy
+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.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
+isisfish.vcs.vcssvn.gettag.error=Can't get address on serveur of local repository
+isisfish.vcs.vcssvn.getupdate.error=Can't status file
+isisfish.vcs.vcssvn.global.filelocalandremotestatus=file %s status is (l\:%s/r\:%s)
+isisfish.vcs.vcssvn.global.filestatus=status for %s is %s
+isisfish.vcs.vcssvn.global.foundUpdatedFile=add %s as updated file
+isisfish.vcs.vcssvn.global.torevision=At revision \: %d
+isisfish.vcs.vcssvn.isconnected.switchoff=Can't connect to serveur, switch to off line\: %s
+isisfish.vcs.vcssvn.isconnected.switchto=Connection to serveur available, switch on line\: %s
+isisfish.vcs.vcssvn.isonremote.error=file %s is not on server
+isisfish.vcs.vcssvn.istag.notexist=Tag %s don't exist
+isisfish.vcs.vcssvn.isuptodate.error=Can't get file status
+isisfish.vcs.vcssvn.list.error=Can't list files
+isisfish.vcs.vcssvn.localstatus.error=Can't status file
+isisfish.vcs.vcssvn.remotestatus.error=Can't status file
+isisfish.vcs.vcssvn.setTag.error=Can't get address on server of local repository
+isisfish.vcs.vcssvn.settag.switchfromto=Switch repository tag from %s to %s
+isisfish.vcs.vcssvn.update.error=Can't update files
+isisfish.vcs.vcssvn.update.notinlocal=Can't update file that not in local repository
+isisfish.versionStorage.removed=Removed
+isisfish.vesselType.activityRange=Activity range
+isisfish.vesselType.comments=Comments
+isisfish.vesselType.fuelCost=Fuel cost of travel
+isisfish.vesselType.length=Length
+isisfish.vesselType.maxDuration=Maximum trip duration
+isisfish.vesselType.miniCrew=Minimum crew size
+isisfish.vesselType.name=Name
+isisfish.vesselType.speed=Speed
+isisfish.welcome.menu.about=About
+isisfish.welcome.menu.close=Close
+isisfish.welcome.menu.configuration=Configuration
+isisfish.welcome.menu.file=File
+isisfish.welcome.menu.frame=Frame
+isisfish.welcome.menu.help=Help
+isisfish.welcome.menu.help.isisfish=Isis-Fish Website
+isisfish.welcome.menu.help.isisfishapi=Isis-Fish API
+isisfish.welcome.menu.help.javaapi=Java API
+isisfish.welcome.menu.help.lutinmatrixapi=LutinMatrix API
+isisfish.welcome.menu.help.topiaapi=ToPIA API
+isisfish.welcome.menu.input=Input
+isisfish.welcome.menu.monitor=Logs frame
+isisfish.welcome.menu.queue=Simulation queue
+isisfish.welcome.menu.result=Result
+isisfish.welcome.menu.script=Script
+isisfish.welcome.menu.simulation=Simulation Launcher
+isisfish.welcome.menu.synchro=Server Synchronisation
+isisfish.welcome.menu.vcs.configuration=Configuration vcs
+isisfish.welcome.title=Ifremer Simulation
+isisfish.wizardGroupCreation.allGroupsSameSize=All groups have the same size
+isisfish.wizardGroupCreation.allValues=Input all the values
+isisfish.wizardGroupCreation.computedGrowthCurve=Computed by a growth curve
+isisfish.wizardGroupCreation.firstAge=First age
+isisfish.wizardGroupCreation.firstAgeHelp=First age \= minimal age
+isisfish.wizardGroupCreation.firstGroup=First group
+isisfish.wizardGroupCreation.firstLength=First length
+isisfish.wizardGroupCreation.firstLengthHelp=First length \= minimal length of first group
+isisfish.wizardGroupCreation.gapBetweenGroupsHelp=gap between to group is 1 year.
+isisfish.wizardGroupCreation.groupNumberHelp=number of Group \= number of group wanted
+isisfish.wizardGroupCreation.groupWidth=Group width
+isisfish.wizardGroupCreation.groupWidthHelp=Group width \= width of group
+isisfish.wizardGroupCreation.lastAge=Last age
+isisfish.wizardGroupCreation.lastAgeHelp=Last age \= maximal age
+isisfish.wizardGroupCreation.maxGroupsLength=Maximal groups length
+isisfish.wizardGroupCreation.maxGroupsLengthHelp=A semicolon ';' must separe maximal length of each group
+isisfish.wizardGroupCreation.numberGroup=Number of group
+isisfish.wizardGroupCreation.numberGroups=Number of groups
+isisfish.wizardGroupCreation.populationCharacteristics=Input the population characteristics
+isisfish.wizardGroupCreation.selectGroupLengthType=Select group length type
+isisfish.wizardGroupCreation.timeStep=Time step (in month)
+isisfish.wizardGroupCreation.title=Group creation
+isisfish.zone.cells=Zone cells
+isisfish.zone.comments=Comments
+isisfish.zone.name=Name
+maximum\ length=
+minimum\ length=
+not\ started=
+region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
+simulate\ %s\ with\ file\ %s=
Deleted: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-06 13:55:51 UTC (rev 2073)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-09 10:58:50 UTC (rev 2097)
@@ -1,1046 +0,0 @@
-Add\ to\ %s\ queue=
-Add\ to\ default\ queue=
-Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s=
-Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
-Can't\ add\ simulation\:\ =
-Can't\ create\ simulation\ logger=Can't create simulation logger
-Can't\ delete\ simulation\ %s\ =
-Can't\ do\ post\ action\ %s=
-Can't\ do\ simulation\ %s=
-Can't\ download\ file=
-Can't\ evaluate\ simulation\ prescript=
-Can't\ export\ simulation\ %s=
-Can't\ get\ changlog=Impossible d'obtenir de changelog
-Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
-Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
-Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
-Can't\ instantiate\ %s=
-Can't\ open\ log\ for\ %s=
-Can't\ simulate\ %s=
-Check\ state\ of\ local\ repository\:\ %s=
-Check\ syntax\ of\ the\ current\ script=
-Checkout\ pom.xml\ to\ %s=
-Command\ '%s'\ fail\ to\ execute=
-Commit\ script\ to\ CVS\ server=
-Copy\ current\ selection\ (Ctrl-c)=
-Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
-Create\ a\ new\ script=
-Cut\ current\ selection\ (Ctrl-x)=
-Error\ during\ vcs\ initialisation=
-Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
-Export\ selected\ script(s)\ to\ zip\ archive=
-Generate\ next\ simulation=
-Import\ one\ java\ file\ script\ source=
-Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
-Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure=
-Info=Info
-Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s=
-Last\ entry\ was\ %s\ extract\ name\ %s=
-Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)=
-Local\ repository\ don't\ exist=
-Local\ repository\ exists\ but\ it's\ not\ valide\ for\ current\ vcs\:\ %s=
-Master\ plan=
-Month\ Gap\ BetweenRepro\ Recruitment=
-Normal\ stop\ thread,\ this\ is\ not\ an\ error=
-Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Paste\ current\ selection\ (Ctrl-v)=
-Process\ template\ error=
-Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
-Region\ %s\ already\ inited=La r\u00E9gion %s a d\u00E9j\u00E0 \u00E9t\u00E9 initialis\u00E9e
-Remote\ IsisFish\ server=
-Remote\ control\ file\ doesn't\ exists\ %s=
-Rename\ data\ directory\ to\ %s=
-Save\ current\ script=
-Show\ help=
-SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
-Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
-Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
-Stop\ the\ process=
-SubProcess\ start\:\ %s\ %s=
-Switch\ repository\ type\ to\ none=
-The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
-Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
-Try\ to\ log\ on\ %s@%s\:%d=
-Use\ branches,\ switch\ not\ needed=
-User\ stop\ simulation\ %s=
-cant\ start\ nimbus=
-could\ not\ close\ reader\ %1$s=could not close reader %1$s
-could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
-could\ not\ filter\ on\ simulations=could not filter on simulations
-could\ not\ found\ %s=
-could\ not\ found\ log\ file\ %1$s=could not found log file %1$s
-could\ not\ found\ region\ %s=
-could\ not\ found\ simulation\ %s=
-could\ not\ read\ at\ offset\ %1$s\ for\ reason\ %2$s=could not read at offset %1$s for reason %2$s
-destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
-directory\ %s\ must\ be\ a\ directory=
-filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
-in\ hour=
-isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Merci de rapporter les bugs.<html>
-isisfish.about.licensetext=Vous pouvez modifier et redistribuer ce programme sous les conditions \u00E9nonc\u00E9es par la licence GNU GPL (version 2 ou ult\u00E9rieure). Une copie de la licence GPL est dans le fichier \u00AB\u00A0LICENSE.txt\u00A0\u00BB fourni avec Isis-Fish. Tous droits r\u00E9serv\u00E9s. Aucune garantie n'est fournie pour l'utilisation de ce programme.
-isisfish.about.title=\u00C0 propos de Isis-Fish...
-isisfish.advancedParameters.title=Param\u00E8tres avanc\u00E9s
-isisfish.advancedParams.freeParameters=Param\u00E8tres libres
-isisfish.advancedParams.libLevelLogger=Niveau de tracage des librairies
-isisfish.advancedParams.scriptLevelLogger=Niveau de tracage des scripts
-isisfish.advancedParams.simulLevelLogger=Niveau de tracage du simulateur
-isisfish.advancedParams.simulationCache=Simulation cache
-isisfish.advancedParams.simulationStatistique=Simulation statistique
-isisfish.advancedParams.simulatorUse=Simulateur \u00E0 utiliser
-isisfish.cell.comments=Commentaires
-isisfish.cell.land=Terre
-isisfish.cell.latitude=Latitude
-isisfish.cell.longitude=Longitude
-isisfish.cell.name=Nom
-isisfish.change.equation=Ne peut pas changer l'\u00E9quation
-isisfish.commit.message=Entrer un message de commit
-isisfish.common.add=Ajouter
-isisfish.common.add.short=Aj.
-isisfish.common.alert=alerte
-isisfish.common.apply=Appliquer
-isisfish.common.blank=\
-isisfish.common.cancel=Annuler
-isisfish.common.check=V\u00E9rifier
-isisfish.common.clear=Effacer
-isisfish.common.date=Date
-isisfish.common.debug=Debug
-isisfish.common.ellipsis=...
-isisfish.common.emigration=\u00E9migration
-isisfish.common.empty=vide
-isisfish.common.error=Erreur
-isisfish.common.finish=Terminer
-isisfish.common.gear=Engin
-isisfish.common.immigration=immigration
-isisfish.common.info=Info
-isisfish.common.migration=migration
-isisfish.common.month=mois %1$s
-isisfish.common.name=Nom
-isisfish.common.new=Nouveau
-isisfish.common.newMatrix=Nouvelle matrice
-isisfish.common.next=Suivant
-isisfish.common.ok=Ok
-isisfish.common.openEditor=Ouvrir l'\u00E9diteur
-isisfish.common.populationGroup=Groupe de population
-isisfish.common.populations=Populations
-isisfish.common.port=port
-isisfish.common.prev=Pr\u00E9c\u00E9dent
-isisfish.common.region=R\u00E9gion
-isisfish.common.remove=Supprimer
-isisfish.common.reset=reset
-isisfish.common.rules=R\u00E8gles
-isisfish.common.save=Sauver
-isisfish.common.saveModel=Sauver comme mod\u00E8le
-isisfish.common.saveNextSimulation=Sauver pour la prochaine simulation
-isisfish.common.season=Saison
-isisfish.common.setOfVessels=Ensemble de navires
-isisfish.common.simulate=Simuler
-isisfish.common.stop=Arr\u00EAter
-isisfish.common.strategies=Strat\u00E9gies
-isisfish.common.sum=somme
-isisfish.common.tag=Tag
-isisfish.common.tripType=Type de trajet
-isisfish.common.value=Valeur
-isisfish.common.warn=Warn
-isisfish.common.year=ann\u00E9e
-isisfish.common.zone=Zone
-isisfish.config.main.compileDirectory.description=le r\u00E9pertoire o\u00F9 sont compil\u00E9s les scripts
-isisfish.config.main.configFileName.description=le fichier de configuration \u00E0 utiliser
-isisfish.config.main.defaultBackupDirectory.description=le r\u00E9pertoire o\u00F9 stocker les backups des donn\u00E9es
-isisfish.config.main.defaultExportDirectory.description=le r\u00E9pertoire o\u00F9 exporter les r\u00E9sultats des simulations
-isisfish.config.main.defaultExportNames.description=les noms des exports \u00E0 effectuer apr\u00E8s une simulation
-isisfish.config.main.defaultMapFile.description=TODO
-isisfish.config.main.defaultResultNames.description=les noms des r\u00E9sultats \u00E0 traiter apr\u00E8s une simulation
-isisfish.config.main.defaultSimulator.description=le nom du simulateur par d\u00E9faut \u00E0 utiliser lors d'une simulation
-isisfish.config.main.defaultTagValue.description=TODO
-isisfish.config.main.encoding.description=l'encoding du syst\u00E8me
-isisfish.config.main.javadocURL.description=l'url de la javadoc des scripts
-isisfish.config.main.launchUI.description=
-isisfish.config.main.localSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement
-isisfish.config.main.locale.description=la locale utilisateur
-isisfish.config.main.login.description=le login pour se connecter au serveur de simulations distant
-isisfish.config.main.password.description=le mot de passe pour se connecter au serveur de simulations distant
-isisfish.config.main.projectName.description=le nom du projet
-isisfish.config.main.regionMap.description=le nom du r\u00E9pertoire contenant les maps d'une r\u00E9gion
-isisfish.config.main.remoteCaparmor.description=lance les simulations sur un serveur distant
-isisfish.config.main.resultExport.description=TODO
-isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
-isisfish.config.main.simulation.ssh.control.check.interval.description=
-isisfish.config.main.simulation.ssh.datapath.description=
-isisfish.config.main.simulation.ssh.isis.home.description=
-isisfish.config.main.simulation.ssh.login.description=
-isisfish.config.main.simulation.ssh.server.description=
-isisfish.config.main.simulation.ssh.tmppath.description=
-isisfish.config.main.simulationServer.description=l'url du serveur de simulations distant
-isisfish.config.main.simulationShowOnlyError.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles avec erreur
-isisfish.config.main.simulationShowOnlyQueue.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles effectu\u00E9es localement
-isisfish.config.main.smtpServer.description=le nom du serveur smpt \u00E0 utiliser pour envoyer les courriels
-isisfish.config.main.subSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement dans un sous process
-isisfish.config.main.userMail.description=le courriel de l'utilisateur
-isisfish.config.main.userName.description=le nom - pr\u00E9nom de l'utilisateur
-isisfish.config.vcs.hostName.description=le nom du serveur vcs \u00E0 utiliser
-isisfish.config.vcs.keyFile.description=le chemin complet du fichier de clef priv\u00E9e ssh2 \u00E0 utiliser lors d'une connexion s\u00E9curis\u00E9e
-isisfish.config.vcs.localDatabasePath.description=
-isisfish.config.vcs.noPassPhrase.description=pour indiquer si la clef priv\u00E9e ssh2 utilis\u00E9e pour communiquer avec le serveur vcs contient est prot\u00E9g\u00E9 par une passe-phrase
-isisfish.config.vcs.passphrase.description=la passe-phrase utilis\u00E9e pour prot\u00E9ger la clef priv\u00E9e ssh
-isisfish.config.vcs.remoteDatabase.description=le nom du module de donn\u00E9es sur le serveur vcs
-isisfish.config.vcs.remotePath.description=le chemin jusqu'au parent du module de donn\u00E9es sur le serveur vcs
-isisfish.config.vcs.type.description=le type de communication vcs utilis\u00E9
-isisfish.config.vcs.typeRepo.description=le type de r\u00E9pository vcs utilis\u00E9
-isisfish.config.vcs.useSshConnexion.description=pour indiquer si l'on utilise une connexion s\u00E9curis\u00E9e pour communiquer avec le serveur vcs (ssh2)
-isisfish.config.vcs.userName.description=le login de l'utilisateur sur le serveur vcs
-isisfish.config.vcs.userPassword.description=
-isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
-isisfish.dataResult.export.csv=Exporter en CSV
-isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
-isisfish.dataResult.label=label9
-isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
-isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
-isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
-isisfish.date.toString=%1$s %2$s
-isisfish.effortDescription.crewFoodCost=Co\u00FBt de l'alimentation pour l'\u00E9quipage
-isisfish.effortDescription.crewShareRate=Taux de partage de l'\u00E9quipage
-isisfish.effortDescription.crewSize=Taille de l'\u00E9quipage
-isisfish.effortDescription.fishingOperation=Op\u00E9ration de p\u00EAche
-isisfish.effortDescription.fishingOperationDuration=Dur\u00E9e de la p\u00EAche
-isisfish.effortDescription.fixedCrewSalary=Salaire d'\u00E9quipage fixe
-isisfish.effortDescription.gearsNumberPerOperation=Nombre d'engins par op\u00E9ration
-isisfish.effortDescription.landingCosts=landingCosts
-isisfish.effortDescription.otherRunningCost=Autres co\u00FBts
-isisfish.effortDescription.repairAndMaintenanceGearCost=repairAndMaintenanceGearCost
-isisfish.effortDescription.title=inputEffortDescription
-isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
-isisfish.effortDescription.unitCostOfFishing=Co\u00FBt unitaire de la p\u00EAche
-isisfish.equation.editor.title=Editeur d'\u00E9quation
-isisfish.error.acceptable.population=New value isn't acceptable value for this population
-isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
-isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
-isisfish.error.add.result.graph=Erreur lors de l'ajout du r\u00E9sultat au graph.
-isisfish.error.add.tray=Impossible d'ajouter une icone de notification
-isisfish.error.change.classloader=Can't change classloader because can't create URL from file %1$s
-isisfish.error.change.equation=Can't change equation
-isisfish.error.check.region=
-isisfish.error.compile.script=Can't compile script\: %1$s
-isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
-isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
-isisfish.error.create.equation=Can't create equation
-isisfish.error.delete.database=Can't delete database
-isisfish.error.delete.file=could not delete file %1$s
-isisfish.error.delete.vcs.files=Can't delete vcs files
-isisfish.error.dialog.message=Une erreur a \u00E9t\u00E9 d\u00E9tect\u00E9e
-isisfish.error.dialog.title=Erreur
-isisfish.error.during.simulation=Error during simulation
-isisfish.error.emigration.negative=emigration negative
-isisfish.error.empty.code.rubbin=le code rubbin est vide
-isisfish.error.empty.emigration=emigration vide
-isisfish.error.empty.id.geographic=l'identifiant g\u00E9ographique est vide
-isisfish.error.empty.immigration=immigration vide
-isisfish.error.empty.migration=Migration vide
-isisfish.error.empty.name=le nom est vide
-isisfish.error.empty.params.name=le nom du param\u00E8tre est vide
-isisfish.error.empty.population=Population est vide
-isisfish.error.empty.scientific.name=le nom scientifique est vide
-isisfish.error.empty.season=info saison vide
-isisfish.error.empty.selectivity=s\u00E9lectivit\u00E9 est vide
-isisfish.error.empty.species=espece capturable vide
-isisfish.error.empty.species.name=le nom d'espece est vide
-isisfish.error.empty.unit=l'unit\u00E9 de mesure est vide
-isisfish.error.emty.emigration=emigration vide
-isisfish.error.emty.migration=Migration vide
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: %1$s
-isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
-isisfish.error.evalute.plan.script=Can't evaluate plan script
-isisfish.error.factor.coefValueIsOne=Un co\u00E9fficient ne peux pas \u00EAtre \u00E9gual \u00E0 1
-isisfish.error.factor.invalid=Le facteur n'est pas valide
-isisfish.error.file.already.exists=The file %1$s already exist
-isisfish.error.get.fisheryRegion=Can't get FisheryRegion
-isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
-isisfish.error.immigration.negative=immigration negative
-isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
-isisfish.error.import.file=Can't import file %1$s
-isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
-isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
-isisfish.error.instanciate=Can't instanciate %1$s
-isisfish.error.instanciate.export=Can't instanciate export %1$s
-isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
-isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
-isisfish.error.invalid.equation=Equation invalide
-isisfish.error.invalid.equation.name=Nom d'\u00E9quation invalide
-isisfish.error.invalid.file.name=Le nom du script %1$s n'est pas valide.
-isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
-isisfish.error.invalid.mean.weight=poids moyen invalide
-isisfish.error.invalid.natural.death=mortalit\u00E9 naturelle sur les classes naissantes invalide
-isisfish.error.invalid.number=le nombre est invalide
-isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
-isisfish.error.invalid.values.params=Param\u00E8tre controlable hors valeurs possibles
-isisfish.error.invalidate.natural.death=mortalite naturelle invalide
-isisfish.error.invoke.method=Can't invoke method '%1$s' for class %2$s
-isisfish.error.load.class=Can't load class\: %1$s
-isisfish.error.load.classloader=Can't create ClassLoader for script, bad directory\: %1$s for reason %2$s
-isisfish.error.load.file=could not load file %1$s
-isisfish.error.load.map=Can't load map file\: %1$s
-isisfish.error.log.closeAppender=n'a pas pu ferme l'appender %1$s et la categorie %2$s
-isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
-isisfish.error.log.createAppender=n'a pas pu creer l'appender [%1$s] \: %2$s pour la raison %3$s
-isisfish.error.log.foundAppender=n'a pas trouve l'appender %1$s pour la categorie %2$s
-isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
-isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
-isisfish.error.no.null.time.step=Error, the time step should not be null
-isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
-isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.target.species=no target species in %1$s for %2$s
-isisfish.error.not.found.class=this class does not
-isisfish.error.not.found.code=could not found codeclass for %1$s
-isisfish.error.not.found.description=could not found description for %1$s
-isisfish.error.not.found.field=could not found field %1$s doc for %2$s
-isisfish.error.not.found.field.class=could not found field %1$s for class %2$s
-isisfish.error.not.null.class.grown=classe mature vaut nul
-isisfish.error.not.null.mean.weight=poids moyen nul
-isisfish.error.not.null.natiral.death=mortalite naturelle nulle
-isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.support.class=La classe %s ne supporte pas les descritions
-isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
-isisfish.error.obtain.doc.export=Can't obtain @Doc on class Export
-isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
-isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
-isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
-isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
-isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
-isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
-isisfish.error.out.memory=Out of memory try with more memory (option -mx)
-isisfish.error.overlap.season=Cette saison chevauche une autre saison
-isisfish.error.parse.date=Can't parse date %1$s
-isisfish.error.parse.long=Can't parse long %1$s
-isisfish.error.plan.parameter=Can't get plan parameter from compiled class
-isisfish.error.prepare.data=Can't prepare data
-isisfish.error.prepare.information.simulation=Can't prepare information for simulation
-isisfish.error.read.simulation=Can't read simulation information %1$s
-isisfish.error.read.simulation.parameters=Impossible de lire les param\u00EAtres du fichier \: %1$s
-isisfish.error.region.already.exists=Cette r\u00E9gion existe d\u00E9j\u00E0
-isisfish.error.region.name.empty=Le nom de la R\u00E9gion est vide
-isisfish.error.remove.directory=Can't remove directory %1$s
-isisfish.error.rename.region=Can't rename region to %1$s
-isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: %1$s
-isisfish.error.save.region=
-isisfish.error.save.script.compilation=Can't save script to compilation\: %1$s
-isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
-isisfish.error.script.create=isisfish.error.script.create
-isisfish.error.script.delete=N'a pas pu supprimer le fichier %1$s pour la raison suivante %2$s
-isisfish.error.script.import=N'a pas pu importer pour la raison suivante %1$s
-isisfish.error.script.load=N'a pas pu charger le fichier %1$s pour la raison suivante %2$s
-isisfish.error.script.save=N'a pas pu sauver le fichier %1$s pour la raison suivante %2$s
-isisfish.error.sensitivity.parameter=
-isisfish.error.simulation.log.openAppender=n'a pas pu ouvrir l'appender de la simulation %1$s pour la raison %2$s
-isisfish.error.simulation.remote.global=Impossible de lancer une simulation sur serveur distant
-isisfish.error.simulation.remote.wrongportvalue=Le port de connexion a une valeur incorrecte \: %s
-isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason %1$s
-isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason %1$s
-isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason %1$s
-isisfish.error.source.parameter=Can't get parameter from source
-isisfish.error.strategy.order=Strategy %1$s don't have 12 StrategyMonthInfo but %2$s. Recreate them
-isisfish.error.undefined.classes=pas de classes d\u00E9finies
-isisfish.error.undefined.correspondence.zones.reproduction.recruitment=pas de correspondance entre les zones de reproduction et les zones de recrutement
-isisfish.error.undefined.gear=l'engin n'est pas d\u00E9fini
-isisfish.error.undefined.mesh=aucune maille de d\u00E9fini
-isisfish.error.undefined.mesh.sector=aucune maille dans le secteur
-isisfish.error.undefined.meta.population=aucune meta population de d\u00E9fini
-isisfish.error.undefined.natural.death=pas de mortalit\u00E9 naturelle sur les classes naissantes
-isisfish.error.undefined.sector=aucun secteur de d\u00E9fini
-isisfish.error.undefined.stategy=aucune strat\u00E9gie de d\u00E9fini
-isisfish.error.undefined.stategy.months=La strat\u00E9gie n'est pas d\u00E9finie pour certain mois
-isisfish.error.undefined.zone.population=il n'y a pas de zone de population de d\u00E9finit
-isisfish.error.undefined.zone.recruitment=il n'y a pas de zone de recrutement de d\u00E9finit
-isisfish.error.undefined.zone.reproduction=il n'y a pas de zone de reproduction de d\u00E9finit
-isisfish.error.unsupported.equation.langage=unsupported langage '%1$s' for equation\: %2$s
-isisfish.error.wait.simThread=Can't wait SimThread
-isisfish.error.warning.title=Attention
-isisfish.error.write.simulation=Can't write information %1$s
-isisfish.exit.text=Quelque chose a chang\u00E9, merci de saisir un commentaire
-isisfish.exit.title=Exit
-isisfish.export.directory=Dossier d'export
-isisfish.export.saved=Exports des r\u00E9sultats sauvegard\u00E9s
-isisfish.export.title=Export des r\u00E9sultats
-isisfish.factor.coefficient=Co\u00E9fficient (en %)
-isisfish.factor.comment=Commentaires
-isisfish.factor.continue=Facteur continu
-isisfish.factor.discret=Facteur discret
-isisfish.factor.factor=Facteur
-isisfish.factor.firstValue=Premi\u00E8re valeur
-isisfish.factor.increment=Cardinalit\u00E9
-isisfish.factor.lastValue=Derni\u00E8re valeur
-isisfish.factor.name=Nom du facteur
-isisfish.factor.operateur=Op\u00E9rateur
-isisfish.factor.selectDiscretNumber=Nombre de facteurs
-isisfish.factor.title=Saisie d'un facteur
-isisfish.factor.validDiscretNumber=Valider
-isisfish.factor.value=Valeur
-isisfish.filter=Filtrer
-isisfish.filter.apply=Appliquer le filtre
-isisfish.filter.cancel=Annuler
-isisfish.filter.log.levelDebug=debug
-isisfish.filter.log.levelError=erreur
-isisfish.filter.log.levelFatal=fatale
-isisfish.filter.log.levelInfo=info
-isisfish.filter.log.levelTrace=trace
-isisfish.filter.log.levelWarn=warning
-isisfish.filter.log.tooltip.levelDebug=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.levelError=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.levelFatal=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.levelInfo=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.levelTrace=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.levelWarn=s\u00E9lectionner pour filtrer ce niveau
-isisfish.filter.log.tooltip.message=Entrer un terme \u00E0 rechercher et appuyer sur Entr\u00E9e
-isisfish.filter.reset=R\u00E9initialiser
-isisfish.filter.result=R\u00E9sultats
-isisfish.filter.result.found=R\u00E9sultats (%d/%d)
-isisfish.filter.select=S\u00E9lectionner
-isisfish.filter.select.simulation=S\u00E9lectionner une simulation
-isisfish.filter.simulation=Filtrer les simulations
-isisfish.filter.simulation.analysePlanNumber=num\u00E9ro d'analyse
-isisfish.filter.simulation.description=description
-isisfish.filter.simulation.local=locale
-isisfish.filter.simulation.numberOfYear=nombre d'ann\u00E9e(s)
-isisfish.filter.simulation.regionName=nom de r\u00E9gion
-isisfish.filter.simulation.simulationEnd=date de fin (dd/MM/yyyy)
-isisfish.filter.simulation.simulationName=nom de simulation
-isisfish.filter.simulation.simulationStart=date de d\u00E9but (dd/MM/yyyy)
-isisfish.filter.simulation.simulatorName=nom du simulateur
-isisfish.filter.simulation.tooltip.analysePlanNumber=filter sur le num\u00E9ro d'analyse (uniquement pour les simulations avec plan d'analyse)
-isisfish.filter.simulation.tooltip.description=filtrer sur la description (format regex)
-isisfish.filter.simulation.tooltip.local=filter uniquement les simulations locales
-isisfish.filter.simulation.tooltip.numberOfYear=filter sur le nombre d'ann\u00E9e(s) (recherche extacte)
-isisfish.filter.simulation.tooltip.regionName=filtrer sur le nom de la r\u00E9gion (format regex)
-isisfish.filter.simulation.tooltip.simulationEnd=filtrer sur la date de fin de simulation (format dd/MM/yyyy)
-isisfish.filter.simulation.tooltip.simulationName=filtrer sur le nom de simulation (format regex)
-isisfish.filter.simulation.tooltip.simulationStart=filtrer sur la date de d\u00E9but de simulation (format dd/MM/yyyy)
-isisfish.filter.simulation.tooltip.simulatorName=filter sur le nom du simulateur utilis\u00E9 (format regex)
-isisfish.filter.simulation.tooltip.useAnalysePlan=filter uniquement les simulations avec plan d'analyse
-isisfish.filter.simulation.tooltip.useOptimization=filter uniquement les simulations avec optimisation
-isisfish.filter.simulation.tooltip.usePreScript=filter uniquement les simulations avec Prescript
-isisfish.filter.simulation.tooltip.useStatistic=filter uniquement les simulations avec statistiques
-isisfish.filter.simulation.useAnalysePlan=plan d'analyse
-isisfish.filter.simulation.useOptimization=optimisation
-isisfish.filter.simulation.usePreScript=prescript
-isisfish.filter.simulation.useStatistic=statistiques
-isisfish.fisheryRegion.addMap=Ajouter une carte
-isisfish.fisheryRegion.area=Extr\u00E9mit\u00E9s de la zone de p\u00EAche
-isisfish.fisheryRegion.comments=Commentaires
-isisfish.fisheryRegion.delMap=Supprimer la carte
-isisfish.fisheryRegion.latitude=Lat.
-isisfish.fisheryRegion.latitude.max=Lat. max.
-isisfish.fisheryRegion.latitude.min=Lat. min.
-isisfish.fisheryRegion.longitude=Long.
-isisfish.fisheryRegion.longitude.max=Long. max.
-isisfish.fisheryRegion.longitude.min=Long. min.
-isisfish.fisheryRegion.name=Nom de la r\u00E9gion
-isisfish.fisheryRegion.ofCells=de mailles (option)
-isisfish.fisheryRegion.selectFile=S\u00E9lectionnez un fichier
-isisfish.fisheryRegion.spatial=R\u00E9solution spatiale
-isisfish.gear.comments=Commentaires
-isisfish.gear.effortUnit=Unit\u00E9 d'effort
-isisfish.gear.name=Nom
-isisfish.gear.rangeValues=Range of values
-isisfish.gear.standardisationFactor=Facteur de standardisation
-isisfish.gear.technicalParameter=Technical parameter
-isisfish.gear.title=Engin
-isisfish.graphBean.graph.render=Choisir un rendu de graphe
-isisfish.graphBean.graphPanel=defaultToolTip-fr.ifremer.graph.GraphBean.graphPanel
-isisfish.graphBean.graphRendererCombo=defaultToolTip-fr.ifremer.graph.GraphBean.graphRendererCombo
-isisfish.graphBean.graphSplitPane=defaultToolTip-fr.ifremer.graph.GraphBean.graphSplitPane
-isisfish.graphBean.label=defaultToolTip-fr.ifremer.graph.GraphBean.label1
-isisfish.graphBean.palettePanel=defaultToolTip-fr.ifremer.graph.GraphBean.palettePanel
-isisfish.graphBean.scrolledwindow=defaultToolTip-fr.ifremer.graph.GraphBean.scrolledwindow1
-isisfish.graphBean.table=defaultToolTip-fr.ifremer.graph.GraphBean.table2
-isisfish.graphBean.table3=defaultToolTip-fr.ifremer.graph.GraphBean.table3
-isisfish.graphCombo.render.bar.horizontal=Rendu en barre horizontale
-isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empilee
-isisfish.graphCombo.render.bar.vertical=Rendu en barre verticale
-isisfish.graphCombo.render.bar.vertical.3d=Rendu en barre verticale 3D
-isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empilee
-isisfish.graphCombo.render.line=Rendu en ligne
-isisfish.graphCombo.render.min.max=Rendu en MinMax
-isisfish.graphCombo.render.surface=Rendu en Aire
-isisfish.infoItem..table=defaultToolTip-fr.ifremer.resultat.InfoItem.table29
-isisfish.infoItem.label=defaultToolTip-fr.ifremer.resultat.InfoItem.label
-isisfish.infoItem.list=defaultToolTip-fr.ifremer.resultat.InfoItem.list
-isisfish.infoItem.scrolledwindow=defaultToolTip-fr.ifremer.resultat.InfoItem.scrolledwindow1
-isisfish.infoItem.sum=defaultToolTip-fr.ifremer.resultat.InfoItemDate.sumButton
-isisfish.infoItem.sum.year=Somme de \u00E9l\u00E9ment par ann\u00E9e
-isisfish.infoItem.table=defaultToolTip-fr.ifremer.resultat.InfoItem.table30
-isisfish.input.continueCells=Continuer vers les cells
-isisfish.input.continueGears=Continuer vers les materiaux
-isisfish.input.continueMetiers=Continuer vers les metiers
-isisfish.input.continuePopulations=Continuer vers les populations
-isisfish.input.continuePorts=Continuer vers les ports
-isisfish.input.continueSetOfVessels=Continuer vers les ensembles de navires
-isisfish.input.continueSpecies=Continuer vers les esp\u00E8ces
-isisfish.input.continueStrategies=Continuer vers les strategies
-isisfish.input.continueTripTypes=Continuer vers les types de trajets
-isisfish.input.continueVesselTypes=Continuer vers les types de navires
-isisfish.input.continueZones=Continuer vers les zones
-isisfish.input.menu.addRegion=Ajouter une r\u00E9gion
-isisfish.input.menu.commit=Sauvegarder les changements
-isisfish.input.menu.copyRegion=Copier r\u00E9gion
-isisfish.input.menu.exportRegion=Exporter la r\u00E9gion
-isisfish.input.menu.importRegion=Importer une r\u00E9gion
-isisfish.input.menu.importRegionSimulation=Importer la r\u00E9gion d'une simulation
-isisfish.input.menu.importRegionV2=Importer une r\u00E9gion de la v2 d'IsisFish
-isisfish.input.menu.importRenameRegion=Importer une r\u00E9gion et la renommer
-isisfish.input.menu.removeLocaly=Supprimer localement
-isisfish.input.menu.removeLocalyRemotely=Supprimer localement et \u00E0 distance
-isisfish.input.menu.server=Serveur
-isisfish.input.newRegion=Nouvelle r\u00E9gion
-isisfish.input.selectRegion=S\u00E9lectionnez une r\u00E9gion
-isisfish.input.title=Saisie de la p\u00EAcherie
-isisfish.launch.anonymous=lecture seule
-isisfish.launch.debugMode=debug mode
-isisfish.launch.email=courriel
-isisfish.launch.firstname=nom
-isisfish.launch.init.done=init done in %1$s.
-isisfish.launch.lasstname=pr\u00E9nom
-isisfish.launch.server.authenticationMethod=droit d'acc\u00E8s au serveur
-isisfish.launch.server.login=nom utilisateur
-isisfish.launch.server.ssh.confirm.passphrase=confirmer la passphrase
-isisfish.launch.server.ssh.key.change=Changer la clef ssh
-isisfish.launch.server.ssh.key.generate=G\u00E9n\u00E9rer la clef ssh
-isisfish.launch.server.ssh.no.passphrase=pas de passphrase
-isisfish.launch.server.ssh.passphrase=passphrase
-isisfish.launch.server.ssh.privateKeyFile=clef priv\u00E9e ssh
-isisfish.launch.server.ssh.publicKeyFile=clef publique ssh
-isisfish.launch.ssh=lecture-\u00E9criture (ssh)
-isisfish.launch.start=Lancement Isis-fish... %1$s
-isisfish.launch.stop=Stopping simulation...
-isisfish.launching=after init done in %1$s.
-isisfish.log.addAppender=ajoute un appender [%1$s]
-isisfish.log.body=Message \u00E0 joindre
-isisfish.log.closeAppender=ferme l'appender [%1$s] pour la categorie %2$s
-isisfish.log.mail.failed=Impossible d'envoyer le rapport par courriel. Le serveur smtp fonctionne ? (J'essaye de contacter < %1$s > smtp server)
-isisfish.log.mail.send=Un rapport a \u00E9t\u00E9 envoy\u00E9 \u00E0 %1$s
-isisfish.log.mail.send.title=Send simulation %1$s by email
-isisfish.log.mailTo=Adresse du destinataire
-isisfish.log.removeAppender=supprime l'appender [%1$s]
-isisfish.log.restoreLogLevel=repositionne le niveau du logger %1$s du niveau %2$s au niveau %3$s
-isisfish.log.sendAll=Envoyer la simulation complete
-isisfish.log.sendMail=Envoyer par email
-isisfish.log.simulation.name=IsisFish simulation %1$s
-isisfish.log.swapLogLevel=permute le niveau du logger %1$s du niveau %2$s au niveau %3$s
-isisfish.log.tooltip.body=Le message saisi sera joint au courriel envoy\u00E9
-isisfish.log.tooltip.mailTo=Entrer l'adresse du destinataire du courriel
-isisfish.log.tooltip.sendAll=Envoyer toute la simulation, ou uniquement le fichier de log
-isisfish.log.tooltip.sendMail=Cliquer pour envoyer le courriel contentant les fichiers
-isisfish.message.add.objets.simulation=Ajout des nouveaux objets cr\u00E9\u00E9s durant la simulation
-isisfish.message.backup.database.finished=backup database finished
-isisfish.message.backup.database.progress=backup database in progress
-isisfish.message.cancel.finished=Cancel finished
-isisfish.message.check.finished=v\u00E9rification termin\u00E9e
-isisfish.message.check.region=
-isisfish.message.checking.cell=
-isisfish.message.choose.archive=choose archive file or directory
-isisfish.message.commit.cancelled=commit annul\u00E9
-isisfish.message.commit.finished=commit termin\u00E9
-isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
-isisfish.message.commiting.region=En train de commiter la r\u00E9gion %1$s ...
-isisfish.message.compilation.time=Temps de compilation %1$ss
-isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet %1$s
-isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion %1$s ?
-isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script '%1$s' ?
-isisfish.message.copy.finished=Copie termin\u00E9e
-isisfish.message.copy.region=Copier la r\u00E9gion vers %1$s
-isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion %1$s
-isisfish.message.creation.done=cr\u00E9ation termin\u00E9e %1$s
-isisfish.message.creation.finished=Cr\u00E9ation termin\u00E9e
-isisfish.message.delete.canceled=supression annul\u00E9e
-isisfish.message.delete.entities=Supprimer les entit\u00E9s
-isisfish.message.delete.entity=Supprimer l'entit\u00E9
-isisfish.message.delete.finished=Suppression termin\u00E9e
-isisfish.message.delete.object=Pour supprimer l'objet %1$s, tous les objets suivants seront aussi supprim\u00E9s \n\n
-isisfish.message.evaluation.finished=\u00E9valuation termin\u00E9e
-isisfish.message.export.done=Export termin\u00E9
-isisfish.message.export.zip=Exporter dans le fichier zip %1$s
-isisfish.message.file.overwrite=Le fichier existe, Voulez-vous l'\u00E9craser ?
-isisfish.message.import=Importer %1$s
-isisfish.message.import.equation.convert=Conversion manuelle de l'\u00E9quation
-isisfish.message.import.finished=Import termin\u00E9
-isisfish.message.import.region.name=Entre le nom de la r\u00E9egion \u00E0 importer
-isisfish.message.import.region.xml=R\u00E9gion XML (Isis-Fish V2.x)
-isisfish.message.import.region.zipped=Zipped Region
-isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
-isisfish.message.import.xml.v2.file=Import xml v2 file
-isisfish.message.import.zip=Import zip file
-isisfish.message.launchui.notlaunch=
-isisfish.message.load.finished=Chargement termin\u00E9
-isisfish.message.load.map=Chargement de la carte \: %1$s (%2$s, %3$s)
-isisfish.message.loading.old.simulation=Chargement d'une ancienne simulation ...
-isisfish.message.loading.region=Chargement de la r\u00E9gion
-isisfish.message.name.imported.region=Entrez le nom de la r\u00E9gion \u00E0 importer
-isisfish.message.new.filename=Entrer le nom du nouveau du fichier.\n\t (utiliser uniquemment des caract\u00E8res et _ en commencant avec une majuscule)
-isisfish.message.new.region.name=Entrer le nom de la nouvell r\u00E9gion
-isisfish.message.old.simulation.loaded=Ancienne simulation charg\u00E9e
-isisfish.message.page.modified=Cette page a \u00E9t\u00E9 modifi\u00E9, voulez-vous la sauvegarder ?
-isisfish.message.presimulation.script.execution=Ex\u00E9cution des scripts de Presimulation
-isisfish.message.recruitment.number.month=Input the number of month of recruitment
-isisfish.message.region.commited=R\u00E9gion commit\u00E9e
-isisfish.message.region.loaded=R\u00E9gion charg\u00E9e
-isisfish.message.region.remove.canceled=Suppression de r\u00E9gion annul\u00E9
-isisfish.message.region.removed=R\u00E9gion supprim\u00E9e
-isisfish.message.remove.canceled=Suppression annul\u00E9e
-isisfish.message.remove.finished=Suppresison termin\u00E9
-isisfish.message.removing.region=Suppression de la r\u00E9gion %1$s ...
-isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
-isisfish.message.save.finished=Sauvegarde termin\u00E9e
-isisfish.message.saveModel.finished=Sauvegarde du mod\u00E8le termin\u00E9e
-isisfish.message.script.commit=Indiquez vos modifications
-isisfish.message.setting.cache.aspects=Mise en place des aspects Cache
-isisfish.message.setting.trace.aspects=Mise en place des aspects Trace
-isisfish.message.simulation.ended=Simulation termin\u00E9e
-isisfish.message.simulation.execution=Simulation execution
-isisfish.message.simulation.prepare=Pr\u00E9paration de la simulation
-isisfish.message.tray.disabled=Icone de notification d\u00E9sactiv\u00E9e
-isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e
-isisfish.metier.comments=Commentaires
-isisfish.metier.name=Nom
-isisfish.metier.rangeValues=Range of values
-isisfish.metier.title=M\u00E9tier
-isisfish.metierMonitor.metiers=M\u00E9tiers
-isisfish.metierMonitor.strategies=Strat\u00E9gies
-isisfish.metierSeasonInfo.toString=%1$s saison %2$s-%3$s
-isisfish.metierSeasonInfoSpecies.mainSpecies=Esp\u00E8ces principales pour le m\u00E9tier
-isisfish.metierSeasonInfoSpecies.selectSeason=S\u00E9lectionnez une saison
-isisfish.metierSeasonInfoSpecies.selectSpecies=Choix de l'esp\u00E8ce
-isisfish.metierSeasonInfoSpecies.species=Esp\u00E8ce
-isisfish.metierSeasonInfoSpecies.targetFactor=Facteur cible
-isisfish.metierSeasonInfoSpecies.title=Esp\u00E8ces capturables
-isisfish.metierSeasonInfoZone.comments=Commentaires
-isisfish.metierSeasonInfoZone.season=Saison
-isisfish.metierSeasonInfoZone.selectSeason=S\u00E9lectionnez une saison
-isisfish.metierSeasonInfoZone.title=Saison / Zones
-isisfish.monitor.title=Application Monitor
-isisfish.month.april=avril
-isisfish.month.august=ao\u00FBt
-isisfish.month.december=d\u00E9cembre
-isisfish.month.february=f\u00E9vrier
-isisfish.month.january=janvier
-isisfish.month.july=juillet
-isisfish.month.june=juin
-isisfish.month.march=mars
-isisfish.month.may=mai
-isisfish.month.november=novembre
-isisfish.month.october=octobre
-isisfish.month.september=septembre
-isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
-isisfish.params.clearFilter=Reset filtre
-isisfish.params.description=Description
-isisfish.params.filter=Filtrer
-isisfish.params.lblLauncher=Lanceur de simulation
-isisfish.params.loadOldSimulation=Charger une ancienne simulation
-isisfish.params.numberYear=Nombre d'ann\u00E9es
-isisfish.params.onlyExportSimulation=Exporter uniquement des simulations
-isisfish.params.populationNumbers=Donn\u00E9es de population
-isisfish.params.ruleParameters=Param\u00E8tres des r\u00E8gles
-isisfish.params.sensitivityName=Nom de l'analyse de sensibilit\u00E9
-isisfish.params.simulationName=Nom de la simulation
-isisfish.params.title=Param\u00E8tres
-isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\n\n
-isisfish.params.toString.lib.logger.level=niveau du logger de librairies %1$s
-isisfish.params.toString.number.years=Nombre d'ann\u00E9\u00E9s \: %1$s\n\n
-isisfish.params.toString.plan=Plan\: %1$s
-isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\n\n
-isisfish.params.toString.populations=Populations\:
-isisfish.params.toString.rule=Rule\: %1$s
-isisfish.params.toString.script.logger.level=niveau du logger de scripts %1$s
-isisfish.params.toString.script.presimulation=Script de presimulation
-isisfish.params.toString.simul.logger.level=niveau du logger de simulateur %1$s
-isisfish.params.toString.simulation.done=Simulation r\u00E9alis\u00E9e avec %1$s\:
-isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
-isisfish.params.useAnalysePlan=Utiliser le plan de simulation
-isisfish.params.usePreSimulationScript=Utiliser un script de pr\u00E9-simulation
-isisfish.population.capturability=Capturabilit\u0E009e
-isisfish.population.comments=Commentaires
-isisfish.population.group=Groupe
-isisfish.population.groups=Groupes
-isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
-isisfish.population.matrixAbundance=Matrice d'abondance
-isisfish.population.matrixAbundance1D=matrixAbundance1D
-isisfish.population.recruitment=Recrutement
-isisfish.population.reproduction=Reproduction
-isisfish.population.season=Saison
-isisfish.population.zones=Zones
-isisfish.populationBasics.geographicID=Identifiant g\u00E9ographique
-isisfish.populationBasics.growth=Croissance
-isisfish.populationBasics.growthReverse=Croissance inverse
-isisfish.populationBasics.maturityGroup=Groupe de maturit\u00E9
-isisfish.populationBasics.name=nom
-isisfish.populationBasics.numberGroup=Nombre de groupes
-isisfish.populationBasics.plusGroup=plusGroup
-isisfish.populationBasics.recreateClasses=Recruter les classes
-isisfish.populationBasics.title=Saisie des Populations
-isisfish.populationCapturability.comments=Commentaires
-isisfish.populationCapturability.selectCoefficient=S\u00E9lectionnez un coefficient par saison et par classe
-isisfish.populationCapturability.title=Saisie de la capturabilit\u00E9
-isisfish.populationEquation.meanWeight=Poids principal
-isisfish.populationEquation.naturalDeathRate=Taux de mortalit\u00E9 naturelle
-isisfish.populationEquation.price=Prix
-isisfish.populationEquation.title=Saisie des \u00E9quations
-isisfish.populationGroup.age=Age
-isisfish.populationGroup.comments=Commentaires
-isisfish.populationGroup.length=Longueur
-isisfish.populationGroup.meanWeigth=Poids principal
-isisfish.populationGroup.naturalDeathRate=Taux de mortalit\u00E9 naturelle
-isisfish.populationGroup.price=Prix
-isisfish.populationGroup.reproductionRate=Taux de reproduction
-isisfish.populationGroup.title=Saisie des groupes de population
-isisfish.populationGroup.toString=%1$s Groupe %2$s
-isisfish.populationMigration.comments=Commentaires
-isisfish.populationMigration.selectSeason=S\u00E9lectionnez une saison
-isisfish.populationMigration.title=Migration
-isisfish.populationMigration.useEquation=Utiliser l'\u00E9quation
-isisfish.populationMigrationEmigration.coefficient=Coefficient
-isisfish.populationMigrationEmigration.departureZone=Zone de d\u00E9part
-isisfish.populationMigrationEmigration.title=Population emmigration
-isisfish.populationMigrationImmigration.arrivalZone=Zone d'arriv\u00E9e
-isisfish.populationMigrationImmigration.coefficient=Coefficient
-isisfish.populationMigrationImmigration.title=Population immigration
-isisfish.populationMigrationMigration.arrivalZone=Zone d'arriv\u00E9e
-isisfish.populationMigrationMigration.coefficient=Coefficient
-isisfish.populationMigrationMigration.departureZone=Zone de d\u00E9part
-isisfish.populationMigrationMigration.title=Population migration
-isisfish.populationRecruitment.comments=Commentaires
-isisfish.populationRecruitment.recruitmentDistribution=Distribution du recrutement
-isisfish.populationRecruitment.reproductionEquation=Equation de reproduction
-isisfish.populationRecruitment.title=Saisie des recrutements
-isisfish.populationSeasonInfo.arrival=Arriv\u00E9e
-isisfish.populationSeasonInfo.departure=D\u00E9part
-isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
-isisfish.populationSeasonInfo.emigration=Emigration
-isisfish.populationSeasonInfo.group=Groupe
-isisfish.populationSeasonInfo.immigration=Immigration
-isisfish.populationSeasonInfo.migration=Migration
-isisfish.populationSeasonInfo.months=Mois
-isisfish.populationSeasonInfo.toString=%1$s saison %2$s-%3$s
-isisfish.populationSeasons.changeGroup=Changement de groupe
-isisfish.populationSeasons.comments=Commentaires
-isisfish.populationSeasons.distributionSpawning=R\u00E9partition des apparitions
-isisfish.populationSeasons.selectSeason=S\u00E9lectionnez une saison
-isisfish.populationSeasons.title=Saisons
-isisfish.populationZones.betweenSpawningRecruitmentAreas=Correspondance entre les zones d'apparitions et de recrutement
-isisfish.populationZones.selectPopulationAreas=S\u00E9lectionnez les zones des populations
-isisfish.populationZones.selectRecruitmentAreas=S\u00E9lectionnez les zones de recrutement
-isisfish.populationZones.selectSpawningAreas=S\u00E9lectionnez les zones d'apparition
-isisfish.populationZones.title=Zones
-isisfish.port.cell=Maille du port
-isisfish.port.comments=Commentaires
-isisfish.port.name=Nom
-isisfish.preScript.backParameter=Retour aux param\u00E8tres
-isisfish.preScript.title=Script de pr\u00E9-simulation
-isisfish.queue.clearDone=Retirer les simulations termin\u00E9es
-isisfish.queue.id=Identifiant
-isisfish.queue.launcher=Lanceur de simulation
-isisfish.queue.plan=Plan
-isisfish.queue.progression=Progression
-isisfish.queue.showLog=Voir les logs de la simulation
-isisfish.queue.simulationLaunch=Lanceur de la queue des simulations
-isisfish.queue.status=\u00C9tat
-isisfish.queue.stopSimulation=Arr\u00EAter la simulation
-isisfish.queue.title=Queue
-isisfish.result.abundance=Abondance
-isisfish.result.add=Ajouter un r\u00E9sultat
-isisfish.result.begin.simulation=En d\u00E9but de simulation\:
-isisfish.result.capture=Capturer
-isisfish.result.capture.metier=Capturer par m\u00E9tier
-isisfish.result.choose.simulation=Choisir une simulation
-isisfish.result.datas=Donn\u00E9es
-isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
-isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension=Dimension
-isisfish.result.end.simulation=En fin de Simulation\:
-isisfish.result.export=Export
-isisfish.result.export.file=Exporter un fichier texte
-isisfish.result.file=Fichier
-isisfish.result.graph=Graphe
-isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
-isisfish.result.hpaned=defaultToolTip-fr.ifremer.resultat.ResultatEdit.hpaned2
-isisfish.result.infoPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.infoPanel
-isisfish.result.label=defaultToolTip-fr.ifremer.resultat.ResultatView.label9
-isisfish.result.map=Carte
-isisfish.result.mapRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.mapRadioButton
-isisfish.result.menuExport=defaultToolTip-fr.ifremer.resultat.ResultatEdit.menuExport
-isisfish.result.menubar=defaultToolTip-fr.ifremer.resultat.ResultatView.menubar1
-isisfish.result.menuitem=defaultToolTip-fr.ifremer.resultat.ResultatView.menuitem2
-isisfish.result.new.window=Ouvrir une nouvelle fen\u00EAtre
-isisfish.result.openWindowButton=defaultToolTip-fr.ifremer.resultat.ResultatView.openWindowButton
-isisfish.result.quit=Quitter
-isisfish.result.reject.metier=Rejet par metier
-isisfish.result.remove.simulation=Supprimer Simulation
-isisfish.result.removeSimulationButton=defaultToolTip-fr.ifremer.resultat.ResultatView.supprimerSimulationButton
-isisfish.result.resultat=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resultat
-isisfish.result.scroll=defaultToolTip-fr.ifremer.resultat.ResultatEdit.scroll
-isisfish.result.show.simulation.log=Voir les logs
-isisfish.result.simulation=defaultToolTip-fr.ifremer.resultat.ResultatView.simulation
-isisfish.result.statusBar=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusbar1
-isisfish.result.statusImage=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusImage
-isisfish.result.stress.metier=Effort par metier
-isisfish.result.summary=R\u00E9sum\u00E9
-isisfish.result.summaryRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resumeRadioButton
-isisfish.result.table=defaultToolTip-fr.ifremer.resultat.ResultatView.table33
-isisfish.result.title=R\u00E9sultat
-isisfish.result.tooltip.show.simulation.log=Cliquer pour afficher la console des logs de la simulation
-isisfish.result.unload.metier=Debarquement par metier
-isisfish.result.vbox=defaultToolTip-fr.ifremer.resultat.ResultatView.vbox1
-isisfish.result.viewPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.viewPanel
-isisfish.resultChoice.save=R\u00E9sultats \u00E0 sauvegarder
-isisfish.resultChoice.saved=R\u00E9sultats sauvegard\u00E9
-isisfish.resultChoice.title=Choix de r\u00E9sultats
-isisfish.resume.matrixInfoGrid=defaultToolTip-fr.ifremer.resultat.ResumePanel.matriceInfoGrid
-isisfish.resume.resumeTextArea=defaultToolTip-fr.ifremer.resultat.ResumePanel.resumeTextArea
-isisfish.resume.scrolledwindow=defaultToolTip-fr.ifremer.resultat.ResumePanel.scrolledwindow2
-isisfish.resume.table=defaultToolTip-fr.ifremer.resultat.ResumePanel.table1
-isisfish.script.check=V\u00E9rifier
-isisfish.script.commit=Commit
-isisfish.script.copy=Copier
-isisfish.script.cut=Couper
-isisfish.script.evaluate=\u00C9valuer
-isisfish.script.export=Exporter des scripts dans une archive zip
-isisfish.script.export.cancel=annuler
-isisfish.script.export.checkAll=(de)-select tout
-isisfish.script.export.chooseDir=...
-isisfish.script.export.ok=exporter
-isisfish.script.export.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts \u00E0 exporter
-isisfish.script.export.tooltip.chooseDir=Choisir le r\u00E9pertoire o\u00F9 exporter les scripts
-isisfish.script.import=Importer des scripts depuis une archive zip
-isisfish.script.import.cancel=annuler
-isisfish.script.import.checkAll=(de)-select tout
-isisfish.script.import.labelAdd=Le(s) fichier(s) suivant(s) sera(ont) ajout\u00E9(s), Confirmer l'ajout
-isisfish.script.import.labelOverwrite=Le(s) fichier(s) suivant(s) existe(nt) d\u00E9j\u00E0, Confirmer pour l'\u00E9crasement
-isisfish.script.import.ok=importer
-isisfish.script.import.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts \u00E0 importer
-isisfish.script.menu.checkSyntax=V\u00E9rifier la syntaxe
-isisfish.script.menu.code=Code
-isisfish.script.menu.commit=Commiter des scripts sur le serveur
-isisfish.script.menu.copy=Copier
-isisfish.script.menu.cut=Couper
-isisfish.script.menu.deleteLocaly=Supprimer localement
-isisfish.script.menu.deleteLocalyServer=Supprimer localement et sur le serveur
-isisfish.script.menu.diff=Voir les diff\u00E9rences avec la version du serveur
-isisfish.script.menu.edit=\u00C9dition
-isisfish.script.menu.evaluate=Evaluer
-isisfish.script.menu.file=Fichier
-isisfish.script.menu.new=Nouveau
-isisfish.script.menu.paste=Coller
-isisfish.script.menu.save=Sauver
-isisfish.script.menu.txtEditorHelp=Aide en ligne...
-isisfish.script.menu.txtExport=Exporter
-isisfish.script.menu.txtHelp=Aide
-isisfish.script.menu.txtImport=Importer
-isisfish.script.menu.txtJavaHelp=Aide Java...
-isisfish.script.menu.txtNewAnalysePlan=Nouveau plan d'analyse
-isisfish.script.menu.txtNewEquationModel=Nouvelle formule
-isisfish.script.menu.txtNewExport=Nouveau script d'export
-isisfish.script.menu.txtNewRule=Nouvelle r\u00E8gle
-isisfish.script.menu.txtNewScript=Nouveau script
-isisfish.script.menu.txtNewSensitivity=Nouveau calculateur de sensibilit\u00E9
-isisfish.script.menu.txtNewSimulator=Nouveau simulateur
-isisfish.script.menu.txtVCS=Serveur
-isisfish.script.menu.update=Synchronisation
-isisfish.script.new=Nouveau
-isisfish.script.paste=Coller
-isisfish.script.save=Sauver
-isisfish.script.title=Editeur de scripts
-isisfish.script.txtExport=Exporter
-isisfish.season.toString=saison %1$s-%2$s
-isisfish.selectivity.equation=Equation
-isisfish.selectivity.selectPopulation=S\u00E9lectionnez une population
-isisfish.selectivity.title=S\u00E9lectivit\u00E9
-isisfish.sens.backParameter=Retour aux param\u00E8tres
-isisfish.sens.title=Plan de simulation
-isisfish.sensitivity.displaysecondpass=Afficher les r\u00E9sultats
-isisfish.sensitivity.export=Export
-isisfish.sensitivity.secondpass=Analyse des r\u00E9sultats
-isisfish.sensitivity.secondpass.title=Analyse des r\u00E9sultats
-isisfish.sensitivity.select=M\u00E9thode
-isisfish.sensitivity.title=S\u00E9lection des facteurs
-isisfish.sensitivityChooser.title=M\u00E9thode de la sensibilit\u00E9
-isisfish.server.ssh.generateKey.title=G\u00E9n\u00E9rer une cl\u00E9 SSH
-isisfish.setOfVessels.comments=Commentaires
-isisfish.setOfVessels.fixedCosts=Co\u00FBts fixes
-isisfish.setOfVessels.name=Nom
-isisfish.setOfVessels.numberOfVessels=Nombre de navires
-isisfish.setOfVessels.technicalEfficiency=
-isisfish.setOfVessels.title=Caract\u00E9ristiques
-isisfish.setOfVessels.vesselType=Type de navire
-isisfish.simpleResult.legendPanel=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.legendPanel
-isisfish.simpleResult.more.information=Cliquer sur une cellule pour plus d'informations...
-isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
-isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
-isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
-isisfish.simulation.log.console.title=Console de log simulation '%1$s'
-isisfish.simulation.log.showConsole=affichage de la console de log pour la simulation %1$s
-isisfish.simulation.menu.import=Restaurer les param\u00E9tres d'une simulation
-isisfish.simulation.menu.save=Sauver les param\u00E8tres de la simulation
-isisfish.simulation.menu.simulation=Simulation
-isisfish.simulation.name=Nom de la simulation
-isisfish.simulation.remote.message.connection=Connexion \u00E0 Caparmor
-isisfish.simulation.remote.message.downloadresults=T\u00E9l\u00E9chargement des r\u00E9sultats
-isisfish.simulation.remote.message.upload=Upload de la simulation
-isisfish.simulation.remote.message.waitingstart=Attente du d\u00E9marrage de la simulation
-isisfish.simulation.title=Lanceur de simulation
-isisfish.simulator.launcher.inprocess=dans le m\u00EAme processus
-isisfish.simulator.launcher.remote=sur le serveur Caparmor
-isisfish.simulator.launcher.subprocess=dans un sous processus
-isisfish.simulator.simulaction.badid=Impossible de lancer la simulation '%s' \: l'identifiant existe d\u00E9j\u00E0 \!
-isisfish.simulator.subprocess.readoutput.error=
-isisfish.species.age=Age
-isisfish.species.cee=CEE
-isisfish.species.comments=Commentaires
-isisfish.species.length=Longueur
-isisfish.species.name=Nom des esp\u00E8ces
-isisfish.species.rubbinCode=Code Rubbin
-isisfish.species.scientificName=Scientific name
-isisfish.species.structured=Structur\u00E9
-isisfish.ssh.askpassphrase.message=Entrez la passphrase pour la cl\u00E9 '%s' \:
-isisfish.ssh.askpassphrase.title=D\u00E9verrouillage de cl\u00E9 SSH
-isisfish.ssh.askpassphrase.wrongpassphrase=Mauvaise cl\u00E9, entrez une nouvelle passphrase '%s' \:
-isisfish.strategy.comments=Commentaires
-isisfish.strategy.inactivity=Equation d'inactivit\u00E9
-isisfish.strategy.inactivityEquationUsed=Utiliser une \u00E9quation d'inactivit\u00E9
-isisfish.strategy.name=Nom
-isisfish.strategy.proportionSetOfVessels=Proportion des ensembles de navires
-isisfish.strategy.title=Caract\u00E9ristiques
-isisfish.strategyMonthInfo.metier=M\u00E9tier
-isisfish.strategyMonthInfo.minInactivityDays=Jour minimums d'inactivit\u00E9
-isisfish.strategyMonthInfo.numberOfTrips=Nombre de trajets
-isisfish.strategyMonthInfo.proportion=Proportion
-isisfish.strategyMonthInfo.title=StrategyMonthInfo
-isisfish.strategyMonthInfo.toString=%1$s %2$s
-isisfish.timeUnit.day=Jour
-isisfish.timeUnit.hours=Heures
-isisfish.tray.simulation=Isis-fish - %1$s \: %2$s/%3$s
-isisfish.tray.simulation.no=Isis-fish - Pas de simulation
-isisfish.tripType.comments=Commentaires
-isisfish.tripType.duration=Dur\u00E9e
-isisfish.tripType.minTime=Temps minimal entre deux voyages
-isisfish.tripType.name=Nom
-isisfish.vcs.ask.passphrase=Entrez votre passe phrase (si votre clef ssh en contient une).
-isisfish.vcs.ask.passphrase.title=Demande de passe phrase
-isisfish.vcs.commit=Message de sauvegarde
-isisfish.vcs.commit.cancel=annuler
-isisfish.vcs.commit.label=Entrer quelques mots concernant la modification des scripts
-isisfish.vcs.commit.ok=confirmer
-isisfish.vcs.init.notfoundcantdownload=La base de donn\u00E9es pour la version %s n'a ni pu \u00EAtre trouv\u00E9e, ni t\u00E9l\u00E9charg\u00E9e.\nVous devez la t\u00E9l\u00E9charger manullement \u00E0 partir du site d'Isis-Fish.
-isisfish.vcs.init.wrongprotocol=Votre base de donn\u00E9es locale \: %s n'utilise pas un protocole correct.\nVoulez-vous faire une sauvegarde de cette base et r\u00E9cup\u00E9rer une meilleure version ?
-isisfish.vcs.switchprotocol.confirm=Le protocole d'acc\u00E8s au d\u00E9p\u00F4t des scripts a chang\u00E9.\nVoulez-vous changer vers le nouveau d\u00E9p\u00F4t ?
-isisfish.vcs.switchtag.warningconflict=Votre base de donn\u00E9es a \u00E9t\u00E9 mise \u00E0 jour\nmais les fichiers suivants sont en conflit, merci de les v\u00E9rifier \:\n%s
-isisfish.vcs.switchversion.confirm=Vous n'utilisez pas le d\u00E9p\u00F4t correct pour votre version d'Isis-Fish \: %s.\nVoulez-vous changer de d\u00E9p\u00F4t ?
-isisfish.vcs.update=R\u00E9sultats de la synchronisation avec le serveur
-isisfish.vcs.update.cancel=annuler
-isisfish.vcs.update.checkAll=(de)-select tout
-isisfish.vcs.update.local=Systeme local
-isisfish.vcs.update.local.modified=Fichiers modifi\u00E9s
-isisfish.vcs.update.local.outofdateAndModified=Fichiers localement modifi\u00E9s en conflit avec le serveur
-isisfish.vcs.update.local.tooltip.modified=Fichiers localement modifi\u00E9s \n(confirmer pour revenir \u00E0 la version avant modification ou soum\u00EAtre au serveur)
-isisfish.vcs.update.local.tooltip.outofdateAndModified=Fichiers localement modifi\u00E9s mais ayant une version plus r\u00E9cente sur le serveur\n (confirmer pour revenir \u00E0 la version avant modification ou r\u00E9cup\u00E9rer la nouvelle version du serveur)
-isisfish.vcs.update.local.tooltip.unversionned=Fichiers uniquement pr\u00E9sents sur votre systeme \n(confirmer pour les enregister sur le serveur)
-isisfish.vcs.update.local.unversionned=Nouveaux fichiers
-isisfish.vcs.update.ok=continuer
-isisfish.vcs.update.remote=Serveur distant
-isisfish.vcs.update.remote.missing=Nouveaux fichiers
-isisfish.vcs.update.remote.outofdate=Fichiers plus r\u00E9cents sur le serveur
-isisfish.vcs.update.remote.tooltip.missing=Nouveaux fichiers uniquement pr\u00E9sents sur le serveur \n(confirmer pour les r\u00E9cup\u00E9rer)
-isisfish.vcs.update.remote.tooltip.outofdate=Fichiers dont il existe une version plus r\u00E9cente sur le serveur \n(confirmer pour les r\u00E9cup\u00E9rer)
-isisfish.vcs.update.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les fichiers (\u00E0 action unique) que vous voulez traiter
-isisfish.vcs.update.tooltip.local=vcs.update.tooltip.local
-isisfish.vcs.update.tooltip.remote=vcs.update.tooltip.remote
-isisfish.vcs.updateconfirm=Confirmation des ope\u00E9rations de synchronisation avec le serveur
-isisfish.vcs.updateconfirm.cancel=annuler
-isisfish.vcs.updateconfirm.checkAll=(de)-select tout
-isisfish.vcs.updateconfirm.label=Confirmer les op\u00E9rations qui pourraient \u00E9craser vos fichiers
-isisfish.vcs.updateconfirm.label2='Etes vous sur de vouloir effectuer ces op\u00E9rations ?'
-isisfish.vcs.updateconfirm.ok=confirmer
-isisfish.vcs.updateconfirm.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts que vous voulez traiter
-isisfish.vcs.updaterepository.confirm=Votre d\u00E9p\u00F4t des scripts n'est pas \u00E0 jour. Voulez-vous mettre \u00E0 jour les fichiers suivants ?
-isisfish.vcs.vcssvn.add.error=Impossible d'ajouter un fichier
-isisfish.vcs.vcssvn.add.errorreadonly=Vous ne pouver pas ajouter de fichier, ce d\u00E9p\u00F4t est en lecture seule \!
-isisfish.vcs.vcssvn.checkProtocol.error=Impossible d'obtenir l'adresse correspondant au d\u00E9p\u00F4t local
-isisfish.vcs.vcssvn.checkProtocol.relocate=Transfert du d\u00E9p\u00F4t %s de %s vers %s
-isisfish.vcs.vcssvn.checkout.error=Impossible de mettre \u00E0 jour
-isisfish.vcs.vcssvn.cleanup.error=Impossible de d\u00E9verrouiller la copie locale
-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.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
-isisfish.vcs.vcssvn.gettag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
-isisfish.vcs.vcssvn.getupdate.error=Impossible d'obtenir le statut des fichiers
-isisfish.vcs.vcssvn.global.filelocalandremotestatus=Le statut du fichier %s est (l\:%s/d\:%s)
-isisfish.vcs.vcssvn.global.filestatus=Le statut de %s est %s
-isisfish.vcs.vcssvn.global.foundUpdatedFile=Ajout de %s comme fichier mis \u00E0 jour
-isisfish.vcs.vcssvn.global.torevision=\u00C0 la r\u00E9vision \: %d
-isisfish.vcs.vcssvn.isconnected.switchoff=Impossible de se connecter au serveur, passage en mode d\u00E9connect\u00E9 \: %s
-isisfish.vcs.vcssvn.isconnected.switchto=Connexion au serveur disponible, passage en mode connect\u00E9 \: %s
-isisfish.vcs.vcssvn.isonremote.error=Le fichier %s n'est pas sur le serveur
-isisfish.vcs.vcssvn.istag.notexist=Le tag %s n'existe pas
-isisfish.vcs.vcssvn.isuptodate.error=Impossible d'obtenir le statut de fichier
-isisfish.vcs.vcssvn.list.error=Impossible de lister
-isisfish.vcs.vcssvn.localstatus.error=Impossible d'obtenir le statut local de fichier
-isisfish.vcs.vcssvn.remotestatus.error=Impossible d'obtenir le statut distant de fichier
-isisfish.vcs.vcssvn.setTag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
-isisfish.vcs.vcssvn.settag.switchfromto=Switch du tag du d\u00E9p\u00F4t de %s \u00E0 %s
-isisfish.vcs.vcssvn.update.error=Impossible de mettre \u00E0 jour
-isisfish.vcs.vcssvn.update.notinlocal=Impossible de mettre \u00E0 jour des fichiers qui ne sont pas pas dans le d\u00E9p\u00F4t
-isisfish.versionStorage.removed=Supprim\u00E9
-isisfish.vesselType.activityRange=Intervalle d'activit\u00E9
-isisfish.vesselType.comments=Commentaires
-isisfish.vesselType.fuelCost=Co\u00FBt d'un trajet en fuel
-isisfish.vesselType.length=Longueur
-isisfish.vesselType.maxDuration=Dur\u00E9e maximale du trajet
-isisfish.vesselType.miniCrew=Taille minimale d'\u00E9quipage
-isisfish.vesselType.name=Nom
-isisfish.vesselType.speed=Vitesse
-isisfish.welcome.menu.about=\u00C0 propos
-isisfish.welcome.menu.close=Fermer
-isisfish.welcome.menu.configuration=Configuration
-isisfish.welcome.menu.file=Fichier
-isisfish.welcome.menu.frame=Fen\u00EAtre
-isisfish.welcome.menu.help=Aide
-isisfish.welcome.menu.input=Saisie
-isisfish.welcome.menu.monitor=Fen\u00EAtre de logs
-isisfish.welcome.menu.queue=Liste des simulations
-isisfish.welcome.menu.result=R\u00E9sultat
-isisfish.welcome.menu.script=Script
-isisfish.welcome.menu.simulation=Lanceur de simulations
-isisfish.welcome.menu.synchro=Synchronisation Serveur
-isisfish.welcome.menu.vcs.configuration=Configuration vcs
-isisfish.welcome.title=Simulation Ifremer
-isisfish.wizardGroupCreation.allGroupsSameSize=Tous les groupes ont la m\u00EAme taille
-isisfish.wizardGroupCreation.allValues=Input all the values
-isisfish.wizardGroupCreation.computedGrowthCurve=Calcul\u00E9 par une courbe de croissance
-isisfish.wizardGroupCreation.firstAge=Premier age
-isisfish.wizardGroupCreation.firstAgeHelp=First age \= minimal age
-isisfish.wizardGroupCreation.firstGroup=Premier groupe
-isisfish.wizardGroupCreation.firstLength=Premi\u00E8re taille
-isisfish.wizardGroupCreation.firstLengthHelp=First length \= minimal length of first group
-isisfish.wizardGroupCreation.gapBetweenGroupsHelp=gap between to group is 1 year.
-isisfish.wizardGroupCreation.groupNumberHelp=number of Group \= number of group wanted
-isisfish.wizardGroupCreation.groupWidth=Longueur du groupe
-isisfish.wizardGroupCreation.groupWidthHelp=Group width \= width of group
-isisfish.wizardGroupCreation.lastAge=Dernier age
-isisfish.wizardGroupCreation.lastAgeHelp=Last age \= maximal age
-isisfish.wizardGroupCreation.maxGroupsLength=Taille maximale de groupes
-isisfish.wizardGroupCreation.maxGroupsLengthHelp=A semicolon ';' must separe maximal length of each group
-isisfish.wizardGroupCreation.numberGroup=Nombre de groupes
-isisfish.wizardGroupCreation.numberGroups=Nombre de groupes
-isisfish.wizardGroupCreation.populationCharacteristics=Input the population characteristics
-isisfish.wizardGroupCreation.selectGroupLengthType=Choisir la longueur du groupe
-isisfish.wizardGroupCreation.timeStep=Pas de temps (en mois)
-isisfish.wizardGroupCreation.title=Cr\u00E9ation du groupe
-isisfish.zone.cells=cellules de la Zone
-isisfish.zone.comments=Commentaires
-isisfish.zone.name=Nom
-maximum\ length=
-minimum\ length=
-not\ started=
-region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
-simulate\ %s\ with\ file\ %s=
Copied: isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties (from rev 2088, isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties)
===================================================================
--- isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties (rev 0)
+++ isis-fish/tags/isis-fish-3.2.0.4-rc2/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-04-09 10:58:50 UTC (rev 2097)
@@ -0,0 +1,1050 @@
+Add\ to\ %s\ queue=
+Add\ to\ default\ queue=
+Analyse\ plan\ error,\ too\ many\ simulation\ for\ %s\ \:\ %s=
+Can't\ add\ result\ '%1$s'\ at\ date\ %2$s=Can't add result '%1$s' at date %2$s
+Can't\ add\ simulation\:\ =
+Can't\ create\ simulation\ logger=Can't create simulation logger
+Can't\ delete\ simulation\ %s\ =
+Can't\ do\ post\ action\ %s=
+Can't\ do\ simulation\ %s=
+Can't\ download\ file=
+Can't\ evaluate\ simulation\ prescript=
+Can't\ export\ simulation\ %s=
+Can't\ get\ changlog=Impossible d'obtenir de changelog
+Can't\ get\ result\:\ %1$s=Can't get result\: %1$s
+Can't\ instanciate\ export\ %1$s=Can't instanciate export %1$s
+Can't\ instanciate\ wanted\ VCS\ (%s),\ use\ default=
+Can't\ instantiate\ %s=
+Can't\ open\ log\ for\ %s=
+Can't\ simulate\ %s=
+Check\ state\ of\ local\ repository\:\ %s=
+Check\ syntax\ of\ the\ current\ script=
+Checkout\ pom.xml\ to\ %s=
+Command\ '%s'\ fail\ to\ execute=
+Commit\ script\ to\ CVS\ server=
+Copy\ current\ selection\ (Ctrl-c)=
+Could\ not\ found\ formule\ type\ %s\ autorised\ type\ are\ %s=
+Create\ a\ new\ script=
+Cut\ current\ selection\ (Ctrl-x)=
+Error\ during\ vcs\ initialisation=
+Error\ while\ uploading\ public\ key\ to\ remote\ serveur\ authorized_keys=
+Export\ selected\ script(s)\ to\ zip\ archive=
+Generate\ next\ simulation=
+Import\ one\ java\ file\ script\ source=
+Import\ simulation\ file\ %s\ in\ directory\ %s\ and\ rename\ from\ %s\ to\ %s=
+Import\ zipped\ file\ containing\ all\ scripts\ directory\ structure=
+Info=Info
+Jobs\ submited\ is\ not\ ItemSimulation\ but\ was\ %s=
+Last\ entry\ was\ %s\ extract\ name\ %s=
+Launcher\ %s\ will\ be\ stopped\ because\ there\ are\ too\ many\ error\ (%s)=
+Local\ repository\ don't\ exist=
+Local\ repository\ exists\ but\ it's\ not\ valide\ for\ current\ vcs\:\ %s=
+Master\ plan=
+Month\ Gap\ BetweenRepro\ Recruitment=
+Normal\ stop\ thread,\ this\ is\ not\ an\ error=
+Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
+Paste\ current\ selection\ (Ctrl-v)=
+Process\ template\ error=
+Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
+Region\ %s\ already\ inited=La r\u00E9gion %s a d\u00E9j\u00E0 \u00E9t\u00E9 initialis\u00E9e
+Remote\ IsisFish\ server=
+Remote\ control\ file\ doesn't\ exists\ %s=
+Rename\ data\ directory\ to\ %s=
+Save\ current\ script=
+Show\ help=
+SimulationExecutor\ started\ with\ %s\ thread\ for\ %s=
+Ssh\ key\ found\ '%s'\ will\ be\ used\ to\ connect\ to=
+Stop\ simulation\ plan,\ because\ can't\ call\ afterSimulation\ correctly\ on\ plan\ %s=
+Stop\ the\ process=
+SubProcess\ start\:\ %s\ %s=
+Switch\ repository\ type\ to\ none=
+The\ equation\ used\ is\ the\ population's\ growth\ curve,\ it\ needs\ to\ be\ defined\ first.=
+Try\ to\ eval\ current\ script\ (must\ be\ have\ main\ method)=
+Try\ to\ log\ on\ %s@%s\:%d=
+Use\ branches,\ switch\ not\ needed=
+User\ stop\ simulation\ %s=
+cant\ start\ nimbus=
+could\ not\ close\ reader\ %1$s=could not close reader %1$s
+could\ not\ create\ simulation\ filter\ model\ for\ reason\ %1$s=could not create simulation filter model for reason %1$s
+could\ not\ filter\ on\ simulations=could not filter on simulations
+could\ not\ found\ %s=
+could\ not\ found\ log\ file\ %1$s=could not found log file %1$s
+could\ not\ found\ region\ %s=
+could\ not\ found\ simulation\ %s=
+could\ not\ read\ at\ offset\ %1$s\ for\ reason\ %2$s=could not read at offset %1$s for reason %2$s
+destination\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
+destination\ already\ exists\ %s\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
+directory\ %s\ must\ be\ a\ directory=
+filter\ loaded\ in\ %1$s\ ms\ \:\ found\ %2$s\ lines.=filter loaded in %1$s ms \: found %2$s lines.
+in\ hour=
+isisfish.about.abouthtmltext=<html><b>Isis-Fish (%s)</b><br /><br />Copyright IFREMER-MAERHA 2000-2009.<br /><br /><a href\="http\://isis-fish.labs.libre-entreprise.org">http\://isis-fish.labs.libre-entreprise.org</a><br /><br />Merci de rapporter les bugs.<html>
+isisfish.about.licensetext=Vous pouvez modifier et redistribuer ce programme sous les conditions \u00E9nonc\u00E9es par la licence GNU GPL (version 2 ou ult\u00E9rieure). Une copie de la licence GPL est dans le fichier \u00AB\u00A0LICENSE.txt\u00A0\u00BB fourni avec Isis-Fish. Tous droits r\u00E9serv\u00E9s. Aucune garantie n'est fournie pour l'utilisation de ce programme.
+isisfish.about.title=\u00C0 propos de Isis-Fish...
+isisfish.advancedParameters.title=Param\u00E8tres avanc\u00E9s
+isisfish.advancedParams.freeParameters=Param\u00E8tres libres
+isisfish.advancedParams.libLevelLogger=Niveau de tracage des librairies
+isisfish.advancedParams.scriptLevelLogger=Niveau de tracage des scripts
+isisfish.advancedParams.simulLevelLogger=Niveau de tracage du simulateur
+isisfish.advancedParams.simulationCache=Simulation cache
+isisfish.advancedParams.simulationStatistique=Simulation statistique
+isisfish.advancedParams.simulatorUse=Simulateur \u00E0 utiliser
+isisfish.cell.comments=Commentaires
+isisfish.cell.land=Terre
+isisfish.cell.latitude=Latitude
+isisfish.cell.longitude=Longitude
+isisfish.cell.name=Nom
+isisfish.change.equation=Ne peut pas changer l'\u00E9quation
+isisfish.commit.message=Entrer un message de commit
+isisfish.common.add=Ajouter
+isisfish.common.add.short=Aj.
+isisfish.common.alert=alerte
+isisfish.common.apply=Appliquer
+isisfish.common.blank=\
+isisfish.common.cancel=Annuler
+isisfish.common.check=V\u00E9rifier
+isisfish.common.clear=Effacer
+isisfish.common.date=Date
+isisfish.common.debug=Debug
+isisfish.common.ellipsis=...
+isisfish.common.emigration=\u00E9migration
+isisfish.common.empty=vide
+isisfish.common.error=Erreur
+isisfish.common.finish=Terminer
+isisfish.common.gear=Engin
+isisfish.common.immigration=immigration
+isisfish.common.info=Info
+isisfish.common.migration=migration
+isisfish.common.month=mois %1$s
+isisfish.common.name=Nom
+isisfish.common.new=Nouveau
+isisfish.common.newMatrix=Nouvelle matrice
+isisfish.common.next=Suivant
+isisfish.common.ok=Ok
+isisfish.common.openEditor=Ouvrir l'\u00E9diteur
+isisfish.common.populationGroup=Groupe de population
+isisfish.common.populations=Populations
+isisfish.common.port=port
+isisfish.common.prev=Pr\u00E9c\u00E9dent
+isisfish.common.region=R\u00E9gion
+isisfish.common.remove=Supprimer
+isisfish.common.reset=reset
+isisfish.common.rules=R\u00E8gles
+isisfish.common.save=Sauver
+isisfish.common.saveModel=Sauver comme mod\u00E8le
+isisfish.common.saveNextSimulation=Sauver pour la prochaine simulation
+isisfish.common.season=Saison
+isisfish.common.setOfVessels=Ensemble de navires
+isisfish.common.simulate=Simuler
+isisfish.common.stop=Arr\u00EAter
+isisfish.common.strategies=Strat\u00E9gies
+isisfish.common.sum=somme
+isisfish.common.tag=Tag
+isisfish.common.tripType=Type de trajet
+isisfish.common.value=Valeur
+isisfish.common.warn=Warn
+isisfish.common.year=ann\u00E9e
+isisfish.common.zone=Zone
+isisfish.config.main.compileDirectory.description=le r\u00E9pertoire o\u00F9 sont compil\u00E9s les scripts
+isisfish.config.main.configFileName.description=le fichier de configuration \u00E0 utiliser
+isisfish.config.main.defaultBackupDirectory.description=le r\u00E9pertoire o\u00F9 stocker les backups des donn\u00E9es
+isisfish.config.main.defaultExportDirectory.description=le r\u00E9pertoire o\u00F9 exporter les r\u00E9sultats des simulations
+isisfish.config.main.defaultExportNames.description=les noms des exports \u00E0 effectuer apr\u00E8s une simulation
+isisfish.config.main.defaultMapFile.description=TODO
+isisfish.config.main.defaultResultNames.description=les noms des r\u00E9sultats \u00E0 traiter apr\u00E8s une simulation
+isisfish.config.main.defaultSimulator.description=le nom du simulateur par d\u00E9faut \u00E0 utiliser lors d'une simulation
+isisfish.config.main.defaultTagValue.description=TODO
+isisfish.config.main.encoding.description=l'encoding du syst\u00E8me
+isisfish.config.main.javadocDirectory.description=
+isisfish.config.main.javadocURL.description=l'url de la javadoc des scripts
+isisfish.config.main.launchUI.description=
+isisfish.config.main.localSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement
+isisfish.config.main.locale.description=la locale utilisateur
+isisfish.config.main.login.description=le login pour se connecter au serveur de simulations distant
+isisfish.config.main.password.description=le mot de passe pour se connecter au serveur de simulations distant
+isisfish.config.main.projectName.description=le nom du projet
+isisfish.config.main.regionMap.description=le nom du r\u00E9pertoire contenant les maps d'une r\u00E9gion
+isisfish.config.main.remoteCaparmor.description=lance les simulations sur un serveur distant
+isisfish.config.main.resultExport.description=TODO
+isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
+isisfish.config.main.simulation.ssh.control.check.interval.description=
+isisfish.config.main.simulation.ssh.datapath.description=
+isisfish.config.main.simulation.ssh.isis.home.description=
+isisfish.config.main.simulation.ssh.login.description=
+isisfish.config.main.simulation.ssh.server.description=
+isisfish.config.main.simulation.ssh.tmppath.description=
+isisfish.config.main.simulationServer.description=l'url du serveur de simulations distant
+isisfish.config.main.simulationShowOnlyError.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles avec erreur
+isisfish.config.main.simulationShowOnlyQueue.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles effectu\u00E9es localement
+isisfish.config.main.smtpServer.description=le nom du serveur smpt \u00E0 utiliser pour envoyer les courriels
+isisfish.config.main.subSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement dans un sous process
+isisfish.config.main.userMail.description=le courriel de l'utilisateur
+isisfish.config.main.userName.description=le nom - pr\u00E9nom de l'utilisateur
+isisfish.config.vcs.hostName.description=le nom du serveur vcs \u00E0 utiliser
+isisfish.config.vcs.keyFile.description=le chemin complet du fichier de clef priv\u00E9e ssh2 \u00E0 utiliser lors d'une connexion s\u00E9curis\u00E9e
+isisfish.config.vcs.localDatabasePath.description=
+isisfish.config.vcs.noPassPhrase.description=pour indiquer si la clef priv\u00E9e ssh2 utilis\u00E9e pour communiquer avec le serveur vcs contient est prot\u00E9g\u00E9 par une passe-phrase
+isisfish.config.vcs.passphrase.description=la passe-phrase utilis\u00E9e pour prot\u00E9ger la clef priv\u00E9e ssh
+isisfish.config.vcs.remoteDatabase.description=le nom du module de donn\u00E9es sur le serveur vcs
+isisfish.config.vcs.remotePath.description=le chemin jusqu'au parent du module de donn\u00E9es sur le serveur vcs
+isisfish.config.vcs.type.description=le type de communication vcs utilis\u00E9
+isisfish.config.vcs.typeRepo.description=le type de r\u00E9pository vcs utilis\u00E9
+isisfish.config.vcs.useSshConnexion.description=pour indiquer si l'on utilise une connexion s\u00E9curis\u00E9e pour communiquer avec le serveur vcs (ssh2)
+isisfish.config.vcs.userName.description=le login de l'utilisateur sur le serveur vcs
+isisfish.config.vcs.userPassword.description=
+isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
+isisfish.dataResult.export.csv=Exporter en CSV
+isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
+isisfish.dataResult.label=label9
+isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
+isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
+isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
+isisfish.date.toString=%1$s %2$s
+isisfish.effortDescription.crewFoodCost=Co\u00FBt de l'alimentation pour l'\u00E9quipage
+isisfish.effortDescription.crewShareRate=Taux de partage de l'\u00E9quipage
+isisfish.effortDescription.crewSize=Taille de l'\u00E9quipage
+isisfish.effortDescription.fishingOperation=Op\u00E9ration de p\u00EAche
+isisfish.effortDescription.fishingOperationDuration=Dur\u00E9e de la p\u00EAche
+isisfish.effortDescription.fixedCrewSalary=Salaire d'\u00E9quipage fixe
+isisfish.effortDescription.gearsNumberPerOperation=Nombre d'engins par op\u00E9ration
+isisfish.effortDescription.landingCosts=landingCosts
+isisfish.effortDescription.otherRunningCost=Autres co\u00FBts
+isisfish.effortDescription.repairAndMaintenanceGearCost=repairAndMaintenanceGearCost
+isisfish.effortDescription.title=inputEffortDescription
+isisfish.effortDescription.toString=EffortDescription for %1$s with %2$s
+isisfish.effortDescription.unitCostOfFishing=Co\u00FBt unitaire de la p\u00EAche
+isisfish.equation.editor.title=Editeur d'\u00E9quation
+isisfish.error.acceptable.population=New value isn't acceptable value for this population
+isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
+isisfish.error.add.result.graph=Erreur lors de l'ajout du r\u00E9sultat au graph.
+isisfish.error.add.tray=Impossible d'ajouter une icone de notification
+isisfish.error.change.classloader=Can't change classloader because can't create URL from file %1$s
+isisfish.error.change.equation=Can't change equation
+isisfish.error.check.region=
+isisfish.error.compile.script=Can't compile script\: %1$s
+isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
+isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
+isisfish.error.create.equation=Can't create equation
+isisfish.error.delete.database=Can't delete database
+isisfish.error.delete.file=could not delete file %1$s
+isisfish.error.delete.vcs.files=Can't delete vcs files
+isisfish.error.dialog.message=Une erreur a \u00E9t\u00E9 d\u00E9tect\u00E9e
+isisfish.error.dialog.title=Erreur
+isisfish.error.during.simulation=Error during simulation
+isisfish.error.emigration.negative=emigration negative
+isisfish.error.empty.code.rubbin=le code rubbin est vide
+isisfish.error.empty.emigration=emigration vide
+isisfish.error.empty.id.geographic=l'identifiant g\u00E9ographique est vide
+isisfish.error.empty.immigration=immigration vide
+isisfish.error.empty.migration=Migration vide
+isisfish.error.empty.name=le nom est vide
+isisfish.error.empty.params.name=le nom du param\u00E8tre est vide
+isisfish.error.empty.population=Population est vide
+isisfish.error.empty.scientific.name=le nom scientifique est vide
+isisfish.error.empty.season=info saison vide
+isisfish.error.empty.selectivity=s\u00E9lectivit\u00E9 est vide
+isisfish.error.empty.species=espece capturable vide
+isisfish.error.empty.species.name=le nom d'espece est vide
+isisfish.error.empty.unit=l'unit\u00E9 de mesure est vide
+isisfish.error.equation.return.number=EquationImpl must retun a number\: %1$s
+isisfish.error.evaluate.equation=Can't evaluate equation\: %1$s
+isisfish.error.evalute.plan.script=Can't evaluate plan script
+isisfish.error.factor.coefValueIsOne=Un co\u00E9fficient ne peux pas \u00EAtre \u00E9gual \u00E0 1
+isisfish.error.factor.invalid=Le facteur n'est pas valide
+isisfish.error.file.already.exists=The file %1$s already exist
+isisfish.error.get.fisheryRegion=Can't get FisheryRegion
+isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
+isisfish.error.immigration.negative=immigration negative
+isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
+isisfish.error.import.file=Can't import file %1$s
+isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
+isisfish.error.init.map=Can't init map.
+isisfish.error.init.remove.button=could not init remove button (button or list is null) button \: %1$s, list \: %2$s
+isisfish.error.instanciate=Can't instanciate %1$s
+isisfish.error.instanciate.export=Can't instanciate export %1$s
+isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
+isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
+isisfish.error.invalid.equation=Equation invalide
+isisfish.error.invalid.equation.name=Nom d'\u00E9quation invalide
+isisfish.error.invalid.file.name=Le nom du script %1$s n'est pas valide.
+isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
+isisfish.error.invalid.mean.weight=poids moyen invalide
+isisfish.error.invalid.natural.death=mortalit\u00E9 naturelle sur les classes naissantes invalide
+isisfish.error.invalid.number=le nombre est invalide
+isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
+isisfish.error.invalid.values.params=Param\u00E8tre controlable hors valeurs possibles
+isisfish.error.invalidate.natural.death=mortalite naturelle invalide
+isisfish.error.invoke.method=Can't invoke method '%1$s' for class %2$s
+isisfish.error.load.class=Can't load class\: %1$s
+isisfish.error.load.classloader=Can't create ClassLoader for script, bad directory\: %1$s for reason %2$s
+isisfish.error.load.file=could not load file %1$s
+isisfish.error.load.map=Can't load map file\: %1$s
+isisfish.error.log.closeAppender=n'a pas pu ferme l'appender %1$s et la categorie %2$s
+isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console %1$s de log, raison %2$s
+isisfish.error.log.createAppender=n'a pas pu creer l'appender [%1$s] \: %2$s pour la raison %3$s
+isisfish.error.log.foundAppender=n'a pas trouve l'appender %1$s pour la categorie %2$s
+isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\nS\u00E9lectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
+isisfish.error.migration.negative=Migration negative
+isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.null.time.step=Error, the time step should not be null
+isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
+isisfish.error.no.select.simulation=could not select simulation
+isisfish.error.no.target.species=no target species in %1$s for %2$s
+isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.code=could not found codeclass for %1$s
+isisfish.error.not.found.description=could not found description for %1$s
+isisfish.error.not.found.field=could not found field %1$s doc for %2$s
+isisfish.error.not.found.field.class=could not found field %1$s for class %2$s
+isisfish.error.not.null.class.grown=classe mature vaut nul
+isisfish.error.not.null.mean.weight=poids moyen nul
+isisfish.error.not.null.natiral.death=mortalite naturelle nulle
+isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
+isisfish.error.not.support.class=La classe %s ne supporte pas les descritions
+isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
+isisfish.error.obtain.analyseplan=Can't obtain description of AnalysePlan
+isisfish.error.obtain.doc.export=Can't obtain @Doc on class Export
+isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
+isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
+isisfish.error.obtain.field=Can't obtain field @Doc for Rule %1$s
+isisfish.error.obtain.field.analyseplan=Can't obtain field @Doc for AnalysePlan %1$s
+isisfish.error.obtain.field.export=Can't obtain field @Doc for Export %1$s
+isisfish.error.obtain.field.sensitivitycalculator=Can't obtain field @Doc for Calculator %1$s
+isisfish.error.out.memory=Out of memory try with more memory (option -mx)
+isisfish.error.overlap.season=Cette saison chevauche une autre saison
+isisfish.error.parse.date=Can't parse date %1$s
+isisfish.error.parse.long=Can't parse long %1$s
+isisfish.error.plan.parameter=Can't get plan parameter from compiled class
+isisfish.error.prepare.data=Can't prepare data
+isisfish.error.prepare.information.simulation=Can't prepare information for simulation
+isisfish.error.read.simulation=Can't read simulation information %1$s
+isisfish.error.read.simulation.parameters=Impossible de lire les param\u00EAtres du fichier \: %1$s
+isisfish.error.region.already.exists=Cette r\u00E9gion existe d\u00E9j\u00E0
+isisfish.error.region.name.empty=Le nom de la R\u00E9gion est vide
+isisfish.error.remove.directory=Can't remove directory %1$s
+isisfish.error.rename.region=Can't rename region to %1$s
+isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: %1$s
+isisfish.error.save.region=
+isisfish.error.save.script.compilation=Can't save script to compilation\: %1$s
+isisfish.error.save.simulation.parameters=Can't save simulation parameters in file %1$s
+isisfish.error.script.create=isisfish.error.script.create
+isisfish.error.script.delete=N'a pas pu supprimer le fichier %1$s pour la raison suivante %2$s
+isisfish.error.script.import=N'a pas pu importer pour la raison suivante %1$s
+isisfish.error.script.load=N'a pas pu charger le fichier %1$s pour la raison suivante %2$s
+isisfish.error.script.save=N'a pas pu sauver le fichier %1$s pour la raison suivante %2$s
+isisfish.error.sensitivity.parameter=
+isisfish.error.simulation.log.openAppender=n'a pas pu ouvrir l'appender de la simulation %1$s pour la raison %2$s
+isisfish.error.simulation.remote.global=Impossible de lancer une simulation sur serveur distant
+isisfish.error.simulation.remote.wrongportvalue=Le port de connexion a une valeur incorrecte \: %s
+isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason %1$s
+isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason %1$s
+isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason %1$s
+isisfish.error.source.parameter=Can't get parameter from source
+isisfish.error.strategy.order=Strategy %1$s don't have 12 StrategyMonthInfo but %2$s. Recreate them
+isisfish.error.undefined.classes=pas de classes d\u00E9finies
+isisfish.error.undefined.correspondence.zones.reproduction.recruitment=pas de correspondance entre les zones de reproduction et les zones de recrutement
+isisfish.error.undefined.gear=l'engin n'est pas d\u00E9fini
+isisfish.error.undefined.mesh=aucune maille de d\u00E9fini
+isisfish.error.undefined.mesh.sector=aucune maille dans le secteur
+isisfish.error.undefined.meta.population=aucune meta population de d\u00E9fini
+isisfish.error.undefined.natural.death=pas de mortalit\u00E9 naturelle sur les classes naissantes
+isisfish.error.undefined.sector=aucun secteur de d\u00E9fini
+isisfish.error.undefined.stategy=aucune strat\u00E9gie de d\u00E9fini
+isisfish.error.undefined.stategy.months=La strat\u00E9gie n'est pas d\u00E9finie pour certain mois
+isisfish.error.undefined.zone.population=il n'y a pas de zone de population de d\u00E9finit
+isisfish.error.undefined.zone.recruitment=il n'y a pas de zone de recrutement de d\u00E9finit
+isisfish.error.undefined.zone.reproduction=il n'y a pas de zone de reproduction de d\u00E9finit
+isisfish.error.unsupported.equation.langage=unsupported langage '%1$s' for equation\: %2$s
+isisfish.error.wait.simThread=Can't wait SimThread
+isisfish.error.warning.title=Attention
+isisfish.error.write.simulation=Can't write information %1$s
+isisfish.exit.text=Quelque chose a chang\u00E9, merci de saisir un commentaire
+isisfish.exit.title=Exit
+isisfish.export.directory=Dossier d'export
+isisfish.export.saved=Exports des r\u00E9sultats sauvegard\u00E9s
+isisfish.export.title=Export des r\u00E9sultats
+isisfish.factor.coefficient=Co\u00E9fficient (en %)
+isisfish.factor.comment=Commentaires
+isisfish.factor.continue=Facteur continu
+isisfish.factor.discret=Facteur discret
+isisfish.factor.factor=Facteur
+isisfish.factor.firstValue=Premi\u00E8re valeur
+isisfish.factor.increment=Cardinalit\u00E9
+isisfish.factor.lastValue=Derni\u00E8re valeur
+isisfish.factor.name=Nom du facteur
+isisfish.factor.operateur=Op\u00E9rateur
+isisfish.factor.selectDiscretNumber=Nombre de facteurs
+isisfish.factor.title=Saisie d'un facteur
+isisfish.factor.validDiscretNumber=Valider
+isisfish.factor.value=Valeur
+isisfish.filter=Filtrer
+isisfish.filter.apply=Appliquer le filtre
+isisfish.filter.cancel=Annuler
+isisfish.filter.log.levelDebug=debug
+isisfish.filter.log.levelError=erreur
+isisfish.filter.log.levelFatal=fatale
+isisfish.filter.log.levelInfo=info
+isisfish.filter.log.levelTrace=trace
+isisfish.filter.log.levelWarn=warning
+isisfish.filter.log.tooltip.levelDebug=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.levelError=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.levelFatal=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.levelInfo=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.levelTrace=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.levelWarn=s\u00E9lectionner pour filtrer ce niveau
+isisfish.filter.log.tooltip.message=Entrer un terme \u00E0 rechercher et appuyer sur Entr\u00E9e
+isisfish.filter.reset=R\u00E9initialiser
+isisfish.filter.result=R\u00E9sultats
+isisfish.filter.result.found=R\u00E9sultats (%d/%d)
+isisfish.filter.select=S\u00E9lectionner
+isisfish.filter.select.simulation=S\u00E9lectionner une simulation
+isisfish.filter.simulation=Filtrer les simulations
+isisfish.filter.simulation.analysePlanNumber=num\u00E9ro d'analyse
+isisfish.filter.simulation.description=description
+isisfish.filter.simulation.local=locale
+isisfish.filter.simulation.numberOfYear=nombre d'ann\u00E9e(s)
+isisfish.filter.simulation.regionName=nom de r\u00E9gion
+isisfish.filter.simulation.simulationEnd=date de fin (dd/MM/yyyy)
+isisfish.filter.simulation.simulationName=nom de simulation
+isisfish.filter.simulation.simulationStart=date de d\u00E9but (dd/MM/yyyy)
+isisfish.filter.simulation.simulatorName=nom du simulateur
+isisfish.filter.simulation.tooltip.analysePlanNumber=filter sur le num\u00E9ro d'analyse (uniquement pour les simulations avec plan d'analyse)
+isisfish.filter.simulation.tooltip.description=filtrer sur la description (format regex)
+isisfish.filter.simulation.tooltip.local=filter uniquement les simulations locales
+isisfish.filter.simulation.tooltip.numberOfYear=filter sur le nombre d'ann\u00E9e(s) (recherche extacte)
+isisfish.filter.simulation.tooltip.regionName=filtrer sur le nom de la r\u00E9gion (format regex)
+isisfish.filter.simulation.tooltip.simulationEnd=filtrer sur la date de fin de simulation (format dd/MM/yyyy)
+isisfish.filter.simulation.tooltip.simulationName=filtrer sur le nom de simulation (format regex)
+isisfish.filter.simulation.tooltip.simulationStart=filtrer sur la date de d\u00E9but de simulation (format dd/MM/yyyy)
+isisfish.filter.simulation.tooltip.simulatorName=filter sur le nom du simulateur utilis\u00E9 (format regex)
+isisfish.filter.simulation.tooltip.useAnalysePlan=filter uniquement les simulations avec plan d'analyse
+isisfish.filter.simulation.tooltip.useOptimization=filter uniquement les simulations avec optimisation
+isisfish.filter.simulation.tooltip.usePreScript=filter uniquement les simulations avec Prescript
+isisfish.filter.simulation.tooltip.useStatistic=filter uniquement les simulations avec statistiques
+isisfish.filter.simulation.useAnalysePlan=plan d'analyse
+isisfish.filter.simulation.useOptimization=optimisation
+isisfish.filter.simulation.usePreScript=prescript
+isisfish.filter.simulation.useStatistic=statistiques
+isisfish.fisheryRegion.addMap=Ajouter une carte
+isisfish.fisheryRegion.area=Extr\u00E9mit\u00E9s de la zone de p\u00EAche
+isisfish.fisheryRegion.comments=Commentaires
+isisfish.fisheryRegion.delMap=Supprimer la carte
+isisfish.fisheryRegion.latitude=Lat.
+isisfish.fisheryRegion.latitude.max=Lat. max.
+isisfish.fisheryRegion.latitude.min=Lat. min.
+isisfish.fisheryRegion.longitude=Long.
+isisfish.fisheryRegion.longitude.max=Long. max.
+isisfish.fisheryRegion.longitude.min=Long. min.
+isisfish.fisheryRegion.name=Nom de la r\u00E9gion
+isisfish.fisheryRegion.ofCells=de mailles (option)
+isisfish.fisheryRegion.selectFile=S\u00E9lectionnez un fichier
+isisfish.fisheryRegion.spatial=R\u00E9solution spatiale
+isisfish.gear.comments=Commentaires
+isisfish.gear.effortUnit=Unit\u00E9 d'effort
+isisfish.gear.name=Nom
+isisfish.gear.rangeValues=Range of values
+isisfish.gear.standardisationFactor=Facteur de standardisation
+isisfish.gear.technicalParameter=Technical parameter
+isisfish.gear.title=Engin
+isisfish.graphBean.graph.render=Choisir un rendu de graphe
+isisfish.graphBean.graphPanel=defaultToolTip-fr.ifremer.graph.GraphBean.graphPanel
+isisfish.graphBean.graphRendererCombo=defaultToolTip-fr.ifremer.graph.GraphBean.graphRendererCombo
+isisfish.graphBean.graphSplitPane=defaultToolTip-fr.ifremer.graph.GraphBean.graphSplitPane
+isisfish.graphBean.label=defaultToolTip-fr.ifremer.graph.GraphBean.label1
+isisfish.graphBean.palettePanel=defaultToolTip-fr.ifremer.graph.GraphBean.palettePanel
+isisfish.graphBean.scrolledwindow=defaultToolTip-fr.ifremer.graph.GraphBean.scrolledwindow1
+isisfish.graphBean.table=defaultToolTip-fr.ifremer.graph.GraphBean.table2
+isisfish.graphBean.table3=defaultToolTip-fr.ifremer.graph.GraphBean.table3
+isisfish.graphCombo.render.bar.horizontal=Rendu en barre horizontale
+isisfish.graphCombo.render.bar.horizontal.stacked=Rendu en barre horizontale empilee
+isisfish.graphCombo.render.bar.vertical=Rendu en barre verticale
+isisfish.graphCombo.render.bar.vertical.3d=Rendu en barre verticale 3D
+isisfish.graphCombo.render.bar.vertical.stacked=Rendu en barre verticale empilee
+isisfish.graphCombo.render.line=Rendu en ligne
+isisfish.graphCombo.render.min.max=Rendu en MinMax
+isisfish.graphCombo.render.surface=Rendu en Aire
+isisfish.infoItem..table=defaultToolTip-fr.ifremer.resultat.InfoItem.table29
+isisfish.infoItem.label=defaultToolTip-fr.ifremer.resultat.InfoItem.label
+isisfish.infoItem.list=defaultToolTip-fr.ifremer.resultat.InfoItem.list
+isisfish.infoItem.scrolledwindow=defaultToolTip-fr.ifremer.resultat.InfoItem.scrolledwindow1
+isisfish.infoItem.sum=defaultToolTip-fr.ifremer.resultat.InfoItemDate.sumButton
+isisfish.infoItem.sum.year=Somme de \u00E9l\u00E9ment par ann\u00E9e
+isisfish.infoItem.table=defaultToolTip-fr.ifremer.resultat.InfoItem.table30
+isisfish.input.continueCells=Continuer vers les cells
+isisfish.input.continueGears=Continuer vers les materiaux
+isisfish.input.continueMetiers=Continuer vers les metiers
+isisfish.input.continuePopulations=Continuer vers les populations
+isisfish.input.continuePorts=Continuer vers les ports
+isisfish.input.continueSetOfVessels=Continuer vers les ensembles de navires
+isisfish.input.continueSpecies=Continuer vers les esp\u00E8ces
+isisfish.input.continueStrategies=Continuer vers les strategies
+isisfish.input.continueTripTypes=Continuer vers les types de trajets
+isisfish.input.continueVesselTypes=Continuer vers les types de navires
+isisfish.input.continueZones=Continuer vers les zones
+isisfish.input.menu.addRegion=Ajouter une r\u00E9gion
+isisfish.input.menu.commit=Sauvegarder les changements
+isisfish.input.menu.copyRegion=Copier r\u00E9gion
+isisfish.input.menu.exportRegion=Exporter la r\u00E9gion
+isisfish.input.menu.importRegion=Importer une r\u00E9gion
+isisfish.input.menu.importRegionSimulation=Importer la r\u00E9gion d'une simulation
+isisfish.input.menu.importRegionV2=Importer une r\u00E9gion de la v2 d'IsisFish
+isisfish.input.menu.importRenameRegion=Importer une r\u00E9gion et la renommer
+isisfish.input.menu.removeLocaly=Supprimer localement
+isisfish.input.menu.removeLocalyRemotely=Supprimer localement et \u00E0 distance
+isisfish.input.menu.server=Serveur
+isisfish.input.newRegion=Nouvelle r\u00E9gion
+isisfish.input.selectRegion=S\u00E9lectionnez une r\u00E9gion
+isisfish.input.title=Saisie de la p\u00EAcherie
+isisfish.launch.anonymous=lecture seule
+isisfish.launch.debugMode=debug mode
+isisfish.launch.email=courriel
+isisfish.launch.firstname=nom
+isisfish.launch.init.done=init done in %1$s.
+isisfish.launch.lasstname=pr\u00E9nom
+isisfish.launch.server.authenticationMethod=droit d'acc\u00E8s au serveur
+isisfish.launch.server.login=nom utilisateur
+isisfish.launch.server.ssh.confirm.passphrase=confirmer la passphrase
+isisfish.launch.server.ssh.key.change=Changer la clef ssh
+isisfish.launch.server.ssh.key.generate=G\u00E9n\u00E9rer la clef ssh
+isisfish.launch.server.ssh.no.passphrase=pas de passphrase
+isisfish.launch.server.ssh.passphrase=passphrase
+isisfish.launch.server.ssh.privateKeyFile=clef priv\u00E9e ssh
+isisfish.launch.server.ssh.publicKeyFile=clef publique ssh
+isisfish.launch.ssh=lecture-\u00E9criture (ssh)
+isisfish.launch.start=Lancement Isis-fish... %1$s
+isisfish.launch.stop=Stopping simulation...
+isisfish.launching=after init done in %1$s.
+isisfish.log.addAppender=ajoute un appender [%1$s]
+isisfish.log.body=Message \u00E0 joindre
+isisfish.log.closeAppender=ferme l'appender [%1$s] pour la categorie %2$s
+isisfish.log.mail.failed=Impossible d'envoyer le rapport par courriel. Le serveur smtp fonctionne ? (J'essaye de contacter < %1$s > smtp server)
+isisfish.log.mail.send=Un rapport a \u00E9t\u00E9 envoy\u00E9 \u00E0 %1$s
+isisfish.log.mail.send.title=Send simulation %1$s by email
+isisfish.log.mailTo=Adresse du destinataire
+isisfish.log.removeAppender=supprime l'appender [%1$s]
+isisfish.log.restoreLogLevel=repositionne le niveau du logger %1$s du niveau %2$s au niveau %3$s
+isisfish.log.sendAll=Envoyer la simulation complete
+isisfish.log.sendMail=Envoyer par email
+isisfish.log.simulation.name=IsisFish simulation %1$s
+isisfish.log.swapLogLevel=permute le niveau du logger %1$s du niveau %2$s au niveau %3$s
+isisfish.log.tooltip.body=Le message saisi sera joint au courriel envoy\u00E9
+isisfish.log.tooltip.mailTo=Entrer l'adresse du destinataire du courriel
+isisfish.log.tooltip.sendAll=Envoyer toute la simulation, ou uniquement le fichier de log
+isisfish.log.tooltip.sendMail=Cliquer pour envoyer le courriel contentant les fichiers
+isisfish.message.add.objets.simulation=Ajout des nouveaux objets cr\u00E9\u00E9s durant la simulation
+isisfish.message.backup.database.finished=backup database finished
+isisfish.message.backup.database.progress=backup database in progress
+isisfish.message.cancel.finished=Cancel finished
+isisfish.message.check.finished=v\u00E9rification termin\u00E9e
+isisfish.message.check.region=
+isisfish.message.checking.cell=
+isisfish.message.choose.archive=choose archive file or directory
+isisfish.message.commit.cancelled=commit annul\u00E9
+isisfish.message.commit.finished=commit termin\u00E9
+isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
+isisfish.message.commiting.region=En train de commiter la r\u00E9gion %1$s ...
+isisfish.message.compilation.time=Temps de compilation %1$ss
+isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet %1$s
+isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion %1$s ?
+isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script '%1$s' ?
+isisfish.message.copy.finished=Copie termin\u00E9e
+isisfish.message.copy.region=Copier la r\u00E9gion vers %1$s
+isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion %1$s
+isisfish.message.creation.done=cr\u00E9ation termin\u00E9e %1$s
+isisfish.message.creation.finished=Cr\u00E9ation termin\u00E9e
+isisfish.message.delete.canceled=supression annul\u00E9e
+isisfish.message.delete.entities=Supprimer les entit\u00E9s
+isisfish.message.delete.entity=Supprimer l'entit\u00E9
+isisfish.message.delete.finished=Suppression termin\u00E9e
+isisfish.message.delete.object=Pour supprimer l'objet %1$s, tous les objets suivants seront aussi supprim\u00E9s \n\n
+isisfish.message.evaluation.finished=\u00E9valuation termin\u00E9e
+isisfish.message.export.done=Export termin\u00E9
+isisfish.message.export.zip=Exporter dans le fichier zip %1$s
+isisfish.message.file.overwrite=Le fichier existe, Voulez-vous l'\u00E9craser ?
+isisfish.message.import=Importer %1$s
+isisfish.message.import.equation.convert=Conversion manuelle de l'\u00E9quation
+isisfish.message.import.finished=Import termin\u00E9
+isisfish.message.import.region.name=Entre le nom de la r\u00E9egion \u00E0 importer
+isisfish.message.import.region.xml=R\u00E9gion XML (Isis-Fish V2.x)
+isisfish.message.import.region.zipped=Zipped Region
+isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
+isisfish.message.import.xml.v2.file=Import xml v2 file
+isisfish.message.import.zip=Import zip file
+isisfish.message.launchui.notlaunch=
+isisfish.message.load.finished=Chargement termin\u00E9
+isisfish.message.load.map=Chargement de la carte \: %1$s (%2$s, %3$s)
+isisfish.message.loading.old.simulation=Chargement d'une ancienne simulation ...
+isisfish.message.loading.region=Chargement de la r\u00E9gion
+isisfish.message.name.imported.region=Entrez le nom de la r\u00E9gion \u00E0 importer
+isisfish.message.new.filename=Entrer le nom du nouveau du fichier.\n\t (utiliser uniquemment des caract\u00E8res et _ en commencant avec une majuscule)
+isisfish.message.new.region.name=Entrer le nom de la nouvell r\u00E9gion
+isisfish.message.old.simulation.loaded=Ancienne simulation charg\u00E9e
+isisfish.message.page.modified=Cette page a \u00E9t\u00E9 modifi\u00E9, voulez-vous la sauvegarder ?
+isisfish.message.presimulation.script.execution=Ex\u00E9cution des scripts de Presimulation
+isisfish.message.recruitment.number.month=Input the number of month of recruitment
+isisfish.message.region.commited=R\u00E9gion commit\u00E9e
+isisfish.message.region.loaded=R\u00E9gion charg\u00E9e
+isisfish.message.region.remove.canceled=Suppression de r\u00E9gion annul\u00E9
+isisfish.message.region.removed=R\u00E9gion supprim\u00E9e
+isisfish.message.remove.canceled=Suppression annul\u00E9e
+isisfish.message.remove.finished=Suppresison termin\u00E9
+isisfish.message.removing.region=Suppression de la r\u00E9gion %1$s ...
+isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
+isisfish.message.save.finished=Sauvegarde termin\u00E9e
+isisfish.message.saveModel.finished=Sauvegarde du mod\u00E8le termin\u00E9e
+isisfish.message.script.commit=Indiquez vos modifications
+isisfish.message.setting.cache.aspects=Mise en place des aspects Cache
+isisfish.message.setting.trace.aspects=Mise en place des aspects Trace
+isisfish.message.simulation.ended=Simulation termin\u00E9e
+isisfish.message.simulation.execution=Simulation execution
+isisfish.message.simulation.prepare=Pr\u00E9paration de la simulation
+isisfish.message.tray.disabled=Icone de notification d\u00E9sactiv\u00E9e
+isisfish.message.update.finished=Mise \u00E0 jour termin\u00E9e
+isisfish.metier.comments=Commentaires
+isisfish.metier.name=Nom
+isisfish.metier.rangeValues=Range of values
+isisfish.metier.title=M\u00E9tier
+isisfish.metierMonitor.metiers=M\u00E9tiers
+isisfish.metierMonitor.strategies=Strat\u00E9gies
+isisfish.metierSeasonInfo.toString=%1$s saison %2$s-%3$s
+isisfish.metierSeasonInfoSpecies.mainSpecies=Esp\u00E8ces principales pour le m\u00E9tier
+isisfish.metierSeasonInfoSpecies.selectSeason=S\u00E9lectionnez une saison
+isisfish.metierSeasonInfoSpecies.selectSpecies=Choix de l'esp\u00E8ce
+isisfish.metierSeasonInfoSpecies.species=Esp\u00E8ce
+isisfish.metierSeasonInfoSpecies.targetFactor=Facteur cible
+isisfish.metierSeasonInfoSpecies.title=Esp\u00E8ces capturables
+isisfish.metierSeasonInfoZone.comments=Commentaires
+isisfish.metierSeasonInfoZone.season=Saison
+isisfish.metierSeasonInfoZone.selectSeason=S\u00E9lectionnez une saison
+isisfish.metierSeasonInfoZone.title=Saison / Zones
+isisfish.monitor.title=Application Monitor
+isisfish.month.april=avril
+isisfish.month.august=ao\u00FBt
+isisfish.month.december=d\u00E9cembre
+isisfish.month.february=f\u00E9vrier
+isisfish.month.january=janvier
+isisfish.month.july=juillet
+isisfish.month.june=juin
+isisfish.month.march=mars
+isisfish.month.may=mai
+isisfish.month.november=novembre
+isisfish.month.october=octobre
+isisfish.month.september=septembre
+isisfish.params.changeLogLev=Passe du niveau '%1$s' au niveau '%2$s'
+isisfish.params.clearFilter=Reset filtre
+isisfish.params.description=Description
+isisfish.params.filter=Filtrer
+isisfish.params.lblLauncher=Lanceur de simulation
+isisfish.params.loadOldSimulation=Charger une ancienne simulation
+isisfish.params.numberYear=Nombre d'ann\u00E9es
+isisfish.params.onlyExportSimulation=Exporter uniquement des simulations
+isisfish.params.populationNumbers=Donn\u00E9es de population
+isisfish.params.ruleParameters=Param\u00E8tres des r\u00E8gles
+isisfish.params.sensitivityName=Nom de l'analyse de sensibilit\u00E9
+isisfish.params.simulationName=Nom de la simulation
+isisfish.params.title=Param\u00E8tres
+isisfish.params.toString.fishery=P\u00EAcherie\: %1$s\n\n
+isisfish.params.toString.lib.logger.level=niveau du logger de librairies %1$s
+isisfish.params.toString.number.years=Nombre d'ann\u00E9\u00E9s \: %1$s\n\n
+isisfish.params.toString.plan=Plan\: %1$s
+isisfish.params.toString.plan.number=Analyse plan sequence number\: %1$s\n\n
+isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.rule=Rule\: %1$s
+isisfish.params.toString.script.logger.level=niveau du logger de scripts %1$s
+isisfish.params.toString.script.presimulation=Script de presimulation
+isisfish.params.toString.simul.logger.level=niveau du logger de simulateur %1$s
+isisfish.params.toString.simulation.done=Simulation r\u00E9alis\u00E9e avec %1$s\:
+isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
+isisfish.params.useAnalysePlan=Utiliser le plan de simulation
+isisfish.params.usePreSimulationScript=Utiliser un script de pr\u00E9-simulation
+isisfish.population.capturability=Capturabilit\u0E009e
+isisfish.population.comments=Commentaires
+isisfish.population.group=Groupe
+isisfish.population.groups=Groupes
+isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
+isisfish.population.matrixAbundance=Matrice d'abondance
+isisfish.population.matrixAbundance1D=matrixAbundance1D
+isisfish.population.recruitment=Recrutement
+isisfish.population.reproduction=Reproduction
+isisfish.population.season=Saison
+isisfish.population.zones=Zones
+isisfish.populationBasics.geographicID=Identifiant g\u00E9ographique
+isisfish.populationBasics.growth=Croissance
+isisfish.populationBasics.growthReverse=Croissance inverse
+isisfish.populationBasics.maturityGroup=Groupe de maturit\u00E9
+isisfish.populationBasics.name=nom
+isisfish.populationBasics.numberGroup=Nombre de groupes
+isisfish.populationBasics.plusGroup=plusGroup
+isisfish.populationBasics.recreateClasses=Recruter les classes
+isisfish.populationBasics.title=Saisie des Populations
+isisfish.populationCapturability.comments=Commentaires
+isisfish.populationCapturability.selectCoefficient=S\u00E9lectionnez un coefficient par saison et par classe
+isisfish.populationCapturability.title=Saisie de la capturabilit\u00E9
+isisfish.populationEquation.meanWeight=Poids principal
+isisfish.populationEquation.naturalDeathRate=Taux de mortalit\u00E9 naturelle
+isisfish.populationEquation.price=Prix
+isisfish.populationEquation.title=Saisie des \u00E9quations
+isisfish.populationGroup.age=Age
+isisfish.populationGroup.comments=Commentaires
+isisfish.populationGroup.length=Longueur
+isisfish.populationGroup.meanWeigth=Poids principal
+isisfish.populationGroup.naturalDeathRate=Taux de mortalit\u00E9 naturelle
+isisfish.populationGroup.price=Prix
+isisfish.populationGroup.reproductionRate=Taux de reproduction
+isisfish.populationGroup.title=Saisie des groupes de population
+isisfish.populationGroup.toString=%1$s Groupe %2$s
+isisfish.populationMigration.comments=Commentaires
+isisfish.populationMigration.selectSeason=S\u00E9lectionnez une saison
+isisfish.populationMigration.title=Migration
+isisfish.populationMigration.useEquation=Utiliser l'\u00E9quation
+isisfish.populationMigrationEmigration.coefficient=Coefficient
+isisfish.populationMigrationEmigration.departureZone=Zone de d\u00E9part
+isisfish.populationMigrationEmigration.title=Population emmigration
+isisfish.populationMigrationImmigration.arrivalZone=Zone d'arriv\u00E9e
+isisfish.populationMigrationImmigration.coefficient=Coefficient
+isisfish.populationMigrationImmigration.title=Population immigration
+isisfish.populationMigrationMigration.arrivalZone=Zone d'arriv\u00E9e
+isisfish.populationMigrationMigration.coefficient=Coefficient
+isisfish.populationMigrationMigration.departureZone=Zone de d\u00E9part
+isisfish.populationMigrationMigration.title=Population migration
+isisfish.populationRecruitment.comments=Commentaires
+isisfish.populationRecruitment.recruitmentDistribution=Distribution du recrutement
+isisfish.populationRecruitment.reproductionEquation=Equation de reproduction
+isisfish.populationRecruitment.title=Saisie des recrutements
+isisfish.populationSeasonInfo.arrival=Arriv\u00E9e
+isisfish.populationSeasonInfo.departure=D\u00E9part
+isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
+isisfish.populationSeasonInfo.emigration=Emigration
+isisfish.populationSeasonInfo.group=Groupe
+isisfish.populationSeasonInfo.immigration=Immigration
+isisfish.populationSeasonInfo.migration=Migration
+isisfish.populationSeasonInfo.months=Mois
+isisfish.populationSeasonInfo.toString=%1$s saison %2$s-%3$s
+isisfish.populationSeasons.changeGroup=Changement de groupe
+isisfish.populationSeasons.comments=Commentaires
+isisfish.populationSeasons.distributionSpawning=R\u00E9partition des apparitions
+isisfish.populationSeasons.selectSeason=S\u00E9lectionnez une saison
+isisfish.populationSeasons.title=Saisons
+isisfish.populationZones.betweenSpawningRecruitmentAreas=Correspondance entre les zones d'apparitions et de recrutement
+isisfish.populationZones.selectPopulationAreas=S\u00E9lectionnez les zones des populations
+isisfish.populationZones.selectRecruitmentAreas=S\u00E9lectionnez les zones de recrutement
+isisfish.populationZones.selectSpawningAreas=S\u00E9lectionnez les zones d'apparition
+isisfish.populationZones.title=Zones
+isisfish.port.cell=Maille du port
+isisfish.port.comments=Commentaires
+isisfish.port.name=Nom
+isisfish.preScript.backParameter=Retour aux param\u00E8tres
+isisfish.preScript.title=Script de pr\u00E9-simulation
+isisfish.queue.clearDone=Retirer les simulations termin\u00E9es
+isisfish.queue.id=Identifiant
+isisfish.queue.launcher=Lanceur de simulation
+isisfish.queue.plan=Plan
+isisfish.queue.progression=Progression
+isisfish.queue.showLog=Voir les logs de la simulation
+isisfish.queue.simulationLaunch=Lanceur de la queue des simulations
+isisfish.queue.status=\u00C9tat
+isisfish.queue.stopSimulation=Arr\u00EAter la simulation
+isisfish.queue.title=Queue
+isisfish.result.abundance=Abondance
+isisfish.result.add=Ajouter un r\u00E9sultat
+isisfish.result.begin.simulation=En d\u00E9but de simulation\:
+isisfish.result.capture=Capturer
+isisfish.result.capture.metier=Capturer par m\u00E9tier
+isisfish.result.choose.simulation=Choisir une simulation
+isisfish.result.datas=Donn\u00E9es
+isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
+isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
+isisfish.result.dimension=Dimension
+isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.export=Export
+isisfish.result.export.file=Exporter un fichier texte
+isisfish.result.file=Fichier
+isisfish.result.graph=Graphe
+isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
+isisfish.result.hpaned=defaultToolTip-fr.ifremer.resultat.ResultatEdit.hpaned2
+isisfish.result.infoPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.infoPanel
+isisfish.result.label=defaultToolTip-fr.ifremer.resultat.ResultatView.label9
+isisfish.result.map=Carte
+isisfish.result.mapRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.mapRadioButton
+isisfish.result.menuExport=defaultToolTip-fr.ifremer.resultat.ResultatEdit.menuExport
+isisfish.result.menubar=defaultToolTip-fr.ifremer.resultat.ResultatView.menubar1
+isisfish.result.menuitem=defaultToolTip-fr.ifremer.resultat.ResultatView.menuitem2
+isisfish.result.new.window=Ouvrir une nouvelle fen\u00EAtre
+isisfish.result.openWindowButton=defaultToolTip-fr.ifremer.resultat.ResultatView.openWindowButton
+isisfish.result.quit=Quitter
+isisfish.result.reject.metier=Rejet par metier
+isisfish.result.remove.simulation=Supprimer Simulation
+isisfish.result.removeSimulationButton=defaultToolTip-fr.ifremer.resultat.ResultatView.supprimerSimulationButton
+isisfish.result.resultat=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resultat
+isisfish.result.scroll=defaultToolTip-fr.ifremer.resultat.ResultatEdit.scroll
+isisfish.result.show.simulation.log=Voir les logs
+isisfish.result.simulation=defaultToolTip-fr.ifremer.resultat.ResultatView.simulation
+isisfish.result.statusBar=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusbar1
+isisfish.result.statusImage=defaultToolTip-fr.ifremer.resultat.ResultatEdit.statusImage
+isisfish.result.stress.metier=Effort par metier
+isisfish.result.summary=R\u00E9sum\u00E9
+isisfish.result.summaryRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.resumeRadioButton
+isisfish.result.table=defaultToolTip-fr.ifremer.resultat.ResultatView.table33
+isisfish.result.title=R\u00E9sultat
+isisfish.result.tooltip.show.simulation.log=Cliquer pour afficher la console des logs de la simulation
+isisfish.result.unload.metier=Debarquement par metier
+isisfish.result.vbox=defaultToolTip-fr.ifremer.resultat.ResultatView.vbox1
+isisfish.result.viewPanel=defaultToolTip-fr.ifremer.resultat.ResultatEdit.viewPanel
+isisfish.resultChoice.save=R\u00E9sultats \u00E0 sauvegarder
+isisfish.resultChoice.saved=R\u00E9sultats sauvegard\u00E9
+isisfish.resultChoice.title=Choix de r\u00E9sultats
+isisfish.resume.matrixInfoGrid=defaultToolTip-fr.ifremer.resultat.ResumePanel.matriceInfoGrid
+isisfish.resume.resumeTextArea=defaultToolTip-fr.ifremer.resultat.ResumePanel.resumeTextArea
+isisfish.resume.scrolledwindow=defaultToolTip-fr.ifremer.resultat.ResumePanel.scrolledwindow2
+isisfish.resume.table=defaultToolTip-fr.ifremer.resultat.ResumePanel.table1
+isisfish.script.check=V\u00E9rifier
+isisfish.script.commit=Commit
+isisfish.script.copy=Copier
+isisfish.script.cut=Couper
+isisfish.script.evaluate=\u00C9valuer
+isisfish.script.export=Exporter des scripts dans une archive zip
+isisfish.script.export.cancel=annuler
+isisfish.script.export.checkAll=(de)-select tout
+isisfish.script.export.chooseDir=...
+isisfish.script.export.ok=exporter
+isisfish.script.export.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts \u00E0 exporter
+isisfish.script.export.tooltip.chooseDir=Choisir le r\u00E9pertoire o\u00F9 exporter les scripts
+isisfish.script.import=Importer des scripts depuis une archive zip
+isisfish.script.import.cancel=annuler
+isisfish.script.import.checkAll=(de)-select tout
+isisfish.script.import.labelAdd=Le(s) fichier(s) suivant(s) sera(ont) ajout\u00E9(s), Confirmer l'ajout
+isisfish.script.import.labelOverwrite=Le(s) fichier(s) suivant(s) existe(nt) d\u00E9j\u00E0, Confirmer pour l'\u00E9crasement
+isisfish.script.import.ok=importer
+isisfish.script.import.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts \u00E0 importer
+isisfish.script.menu.checkSyntax=V\u00E9rifier la syntaxe
+isisfish.script.menu.code=Code
+isisfish.script.menu.commit=Commiter des scripts sur le serveur
+isisfish.script.menu.copy=Copier
+isisfish.script.menu.cut=Couper
+isisfish.script.menu.deleteLocaly=Supprimer localement
+isisfish.script.menu.deleteLocalyServer=Supprimer localement et sur le serveur
+isisfish.script.menu.diff=Voir les diff\u00E9rences avec la version du serveur
+isisfish.script.menu.edit=\u00C9dition
+isisfish.script.menu.evaluate=Evaluer
+isisfish.script.menu.file=Fichier
+isisfish.script.menu.new=Nouveau
+isisfish.script.menu.paste=Coller
+isisfish.script.menu.save=Sauver
+isisfish.script.menu.txtEditorHelp=Aide en ligne...
+isisfish.script.menu.txtExport=Exporter
+isisfish.script.menu.txtHelp=Aide
+isisfish.script.menu.txtImport=Importer
+isisfish.script.menu.txtJavaHelp=Aide Java...
+isisfish.script.menu.txtNewAnalysePlan=Nouveau plan d'analyse
+isisfish.script.menu.txtNewEquationModel=Nouvelle formule
+isisfish.script.menu.txtNewExport=Nouveau script d'export
+isisfish.script.menu.txtNewRule=Nouvelle r\u00E8gle
+isisfish.script.menu.txtNewScript=Nouveau script
+isisfish.script.menu.txtNewSensitivity=Nouveau calculateur de sensibilit\u00E9
+isisfish.script.menu.txtNewSimulator=Nouveau simulateur
+isisfish.script.menu.txtVCS=Serveur
+isisfish.script.menu.update=Synchronisation
+isisfish.script.new=Nouveau
+isisfish.script.paste=Coller
+isisfish.script.save=Sauver
+isisfish.script.title=Editeur de scripts
+isisfish.script.txtExport=Exporter
+isisfish.season.toString=saison %1$s-%2$s
+isisfish.selectivity.equation=Equation
+isisfish.selectivity.selectPopulation=S\u00E9lectionnez une population
+isisfish.selectivity.title=S\u00E9lectivit\u00E9
+isisfish.sens.backParameter=Retour aux param\u00E8tres
+isisfish.sens.title=Plan de simulation
+isisfish.sensitivity.displaysecondpass=Afficher les r\u00E9sultats
+isisfish.sensitivity.export=Export
+isisfish.sensitivity.secondpass=Analyse des r\u00E9sultats
+isisfish.sensitivity.secondpass.title=Analyse des r\u00E9sultats
+isisfish.sensitivity.select=M\u00E9thode
+isisfish.sensitivity.title=S\u00E9lection des facteurs
+isisfish.sensitivityChooser.title=M\u00E9thode de la sensibilit\u00E9
+isisfish.server.ssh.generateKey.title=G\u00E9n\u00E9rer une cl\u00E9 SSH
+isisfish.setOfVessels.comments=Commentaires
+isisfish.setOfVessels.fixedCosts=Co\u00FBts fixes
+isisfish.setOfVessels.name=Nom
+isisfish.setOfVessels.numberOfVessels=Nombre de navires
+isisfish.setOfVessels.technicalEfficiency=
+isisfish.setOfVessels.title=Caract\u00E9ristiques
+isisfish.setOfVessels.vesselType=Type de navire
+isisfish.simpleResult.legendPanel=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.legendPanel
+isisfish.simpleResult.more.information=Cliquer sur une cellule pour plus d'informations...
+isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
+isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
+isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
+isisfish.simulation.log.console.title=Console de log simulation '%1$s'
+isisfish.simulation.log.showConsole=affichage de la console de log pour la simulation %1$s
+isisfish.simulation.menu.import=Restaurer les param\u00E9tres d'une simulation
+isisfish.simulation.menu.save=Sauver les param\u00E8tres de la simulation
+isisfish.simulation.menu.simulation=Simulation
+isisfish.simulation.name=Nom de la simulation
+isisfish.simulation.remote.message.connection=Connexion \u00E0 Caparmor
+isisfish.simulation.remote.message.downloadresults=T\u00E9l\u00E9chargement des r\u00E9sultats
+isisfish.simulation.remote.message.upload=Upload de la simulation
+isisfish.simulation.remote.message.waitingstart=Attente du d\u00E9marrage de la simulation
+isisfish.simulation.title=Lanceur de simulation
+isisfish.simulator.launcher.inprocess=dans le m\u00EAme processus
+isisfish.simulator.launcher.remote=sur le serveur Caparmor
+isisfish.simulator.launcher.subprocess=dans un sous processus
+isisfish.simulator.simulaction.badid=Impossible de lancer la simulation '%s' \: l'identifiant existe d\u00E9j\u00E0 \!
+isisfish.simulator.subprocess.readoutput.error=
+isisfish.species.age=Age
+isisfish.species.cee=CEE
+isisfish.species.comments=Commentaires
+isisfish.species.length=Longueur
+isisfish.species.name=Nom des esp\u00E8ces
+isisfish.species.rubbinCode=Code Rubbin
+isisfish.species.scientificName=Scientific name
+isisfish.species.structured=Structur\u00E9
+isisfish.ssh.askpassphrase.message=Entrez la passphrase pour la cl\u00E9 '%s' \:
+isisfish.ssh.askpassphrase.title=D\u00E9verrouillage de cl\u00E9 SSH
+isisfish.ssh.askpassphrase.wrongpassphrase=Mauvaise cl\u00E9, entrez une nouvelle passphrase '%s' \:
+isisfish.strategy.comments=Commentaires
+isisfish.strategy.inactivity=Equation d'inactivit\u00E9
+isisfish.strategy.inactivityEquationUsed=Utiliser une \u00E9quation d'inactivit\u00E9
+isisfish.strategy.name=Nom
+isisfish.strategy.proportionSetOfVessels=Proportion des ensembles de navires
+isisfish.strategy.title=Caract\u00E9ristiques
+isisfish.strategyMonthInfo.metier=M\u00E9tier
+isisfish.strategyMonthInfo.minInactivityDays=Jour minimums d'inactivit\u00E9
+isisfish.strategyMonthInfo.numberOfTrips=Nombre de trajets
+isisfish.strategyMonthInfo.proportion=Proportion
+isisfish.strategyMonthInfo.title=StrategyMonthInfo
+isisfish.strategyMonthInfo.toString=%1$s %2$s
+isisfish.timeUnit.day=Jour
+isisfish.timeUnit.hours=Heures
+isisfish.tray.simulation=Isis-fish - %1$s \: %2$s/%3$s
+isisfish.tray.simulation.no=Isis-fish - Pas de simulation
+isisfish.tripType.comments=Commentaires
+isisfish.tripType.duration=Dur\u00E9e
+isisfish.tripType.minTime=Temps minimal entre deux voyages
+isisfish.tripType.name=Nom
+isisfish.vcs.ask.passphrase=Entrez votre passe phrase (si votre clef ssh en contient une).
+isisfish.vcs.ask.passphrase.title=Demande de passe phrase
+isisfish.vcs.commit=Message de sauvegarde
+isisfish.vcs.commit.cancel=annuler
+isisfish.vcs.commit.label=Entrer quelques mots concernant la modification des scripts
+isisfish.vcs.commit.ok=confirmer
+isisfish.vcs.init.notfoundcantdownload=La base de donn\u00E9es pour la version %s n'a ni pu \u00EAtre trouv\u00E9e, ni t\u00E9l\u00E9charg\u00E9e.\nVous devez la t\u00E9l\u00E9charger manullement \u00E0 partir du site d'Isis-Fish.
+isisfish.vcs.init.wrongprotocol=Votre base de donn\u00E9es locale \: %s n'utilise pas un protocole correct.\nVoulez-vous faire une sauvegarde de cette base et r\u00E9cup\u00E9rer une meilleure version ?
+isisfish.vcs.switchprotocol.confirm=Le protocole d'acc\u00E8s au d\u00E9p\u00F4t des scripts a chang\u00E9.\nVoulez-vous changer vers le nouveau d\u00E9p\u00F4t ?
+isisfish.vcs.switchtag.warningconflict=Votre base de donn\u00E9es a \u00E9t\u00E9 mise \u00E0 jour\nmais les fichiers suivants sont en conflit, merci de les v\u00E9rifier \:\n%s
+isisfish.vcs.switchversion.confirm=Vous n'utilisez pas le d\u00E9p\u00F4t correct pour votre version d'Isis-Fish \: %s.\nVoulez-vous changer de d\u00E9p\u00F4t ?
+isisfish.vcs.update=R\u00E9sultats de la synchronisation avec le serveur
+isisfish.vcs.update.cancel=annuler
+isisfish.vcs.update.checkAll=(de)-select tout
+isisfish.vcs.update.local=Systeme local
+isisfish.vcs.update.local.modified=Fichiers modifi\u00E9s
+isisfish.vcs.update.local.outofdateAndModified=Fichiers localement modifi\u00E9s en conflit avec le serveur
+isisfish.vcs.update.local.tooltip.modified=Fichiers localement modifi\u00E9s \n(confirmer pour revenir \u00E0 la version avant modification ou soum\u00EAtre au serveur)
+isisfish.vcs.update.local.tooltip.outofdateAndModified=Fichiers localement modifi\u00E9s mais ayant une version plus r\u00E9cente sur le serveur\n (confirmer pour revenir \u00E0 la version avant modification ou r\u00E9cup\u00E9rer la nouvelle version du serveur)
+isisfish.vcs.update.local.tooltip.unversionned=Fichiers uniquement pr\u00E9sents sur votre systeme \n(confirmer pour les enregister sur le serveur)
+isisfish.vcs.update.local.unversionned=Nouveaux fichiers
+isisfish.vcs.update.ok=continuer
+isisfish.vcs.update.remote=Serveur distant
+isisfish.vcs.update.remote.missing=Nouveaux fichiers
+isisfish.vcs.update.remote.outofdate=Fichiers plus r\u00E9cents sur le serveur
+isisfish.vcs.update.remote.tooltip.missing=Nouveaux fichiers uniquement pr\u00E9sents sur le serveur \n(confirmer pour les r\u00E9cup\u00E9rer)
+isisfish.vcs.update.remote.tooltip.outofdate=Fichiers dont il existe une version plus r\u00E9cente sur le serveur \n(confirmer pour les r\u00E9cup\u00E9rer)
+isisfish.vcs.update.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les fichiers (\u00E0 action unique) que vous voulez traiter
+isisfish.vcs.update.tooltip.local=vcs.update.tooltip.local
+isisfish.vcs.update.tooltip.remote=vcs.update.tooltip.remote
+isisfish.vcs.updateconfirm=Confirmation des ope\u00E9rations de synchronisation avec le serveur
+isisfish.vcs.updateconfirm.cancel=annuler
+isisfish.vcs.updateconfirm.checkAll=(de)-select tout
+isisfish.vcs.updateconfirm.label=Confirmer les op\u00E9rations qui pourraient \u00E9craser vos fichiers
+isisfish.vcs.updateconfirm.label2='Etes vous sur de vouloir effectuer ces op\u00E9rations ?'
+isisfish.vcs.updateconfirm.ok=confirmer
+isisfish.vcs.updateconfirm.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts que vous voulez traiter
+isisfish.vcs.updaterepository.confirm=Votre d\u00E9p\u00F4t des scripts n'est pas \u00E0 jour. Voulez-vous mettre \u00E0 jour les fichiers suivants ?
+isisfish.vcs.vcssvn.add.error=Impossible d'ajouter un fichier
+isisfish.vcs.vcssvn.add.errorreadonly=Vous ne pouver pas ajouter de fichier, ce d\u00E9p\u00F4t est en lecture seule \!
+isisfish.vcs.vcssvn.checkProtocol.error=Impossible d'obtenir l'adresse correspondant au d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.checkProtocol.relocate=Transfert du d\u00E9p\u00F4t %s de %s vers %s
+isisfish.vcs.vcssvn.checkout.error=Impossible de mettre \u00E0 jour
+isisfish.vcs.vcssvn.cleanup.error=Impossible de d\u00E9verrouiller la copie locale
+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.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
+isisfish.vcs.vcssvn.gettag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.getupdate.error=Impossible d'obtenir le statut des fichiers
+isisfish.vcs.vcssvn.global.filelocalandremotestatus=Le statut du fichier %s est (l\:%s/d\:%s)
+isisfish.vcs.vcssvn.global.filestatus=Le statut de %s est %s
+isisfish.vcs.vcssvn.global.foundUpdatedFile=Ajout de %s comme fichier mis \u00E0 jour
+isisfish.vcs.vcssvn.global.torevision=\u00C0 la r\u00E9vision \: %d
+isisfish.vcs.vcssvn.isconnected.switchoff=Impossible de se connecter au serveur, passage en mode d\u00E9connect\u00E9 \: %s
+isisfish.vcs.vcssvn.isconnected.switchto=Connexion au serveur disponible, passage en mode connect\u00E9 \: %s
+isisfish.vcs.vcssvn.isonremote.error=Le fichier %s n'est pas sur le serveur
+isisfish.vcs.vcssvn.istag.notexist=Le tag %s n'existe pas
+isisfish.vcs.vcssvn.isuptodate.error=Impossible d'obtenir le statut de fichier
+isisfish.vcs.vcssvn.list.error=Impossible de lister
+isisfish.vcs.vcssvn.localstatus.error=Impossible d'obtenir le statut local de fichier
+isisfish.vcs.vcssvn.remotestatus.error=Impossible d'obtenir le statut distant de fichier
+isisfish.vcs.vcssvn.setTag.error=Erreur lors de la r\u00E9cup\u00E9ration de l'adresse du d\u00E9p\u00F4t local
+isisfish.vcs.vcssvn.settag.switchfromto=Switch du tag du d\u00E9p\u00F4t de %s \u00E0 %s
+isisfish.vcs.vcssvn.update.error=Impossible de mettre \u00E0 jour
+isisfish.vcs.vcssvn.update.notinlocal=Impossible de mettre \u00E0 jour des fichiers qui ne sont pas pas dans le d\u00E9p\u00F4t
+isisfish.versionStorage.removed=Supprim\u00E9
+isisfish.vesselType.activityRange=Intervalle d'activit\u00E9
+isisfish.vesselType.comments=Commentaires
+isisfish.vesselType.fuelCost=Co\u00FBt d'un trajet en fuel
+isisfish.vesselType.length=Longueur
+isisfish.vesselType.maxDuration=Dur\u00E9e maximale du trajet
+isisfish.vesselType.miniCrew=Taille minimale d'\u00E9quipage
+isisfish.vesselType.name=Nom
+isisfish.vesselType.speed=Vitesse
+isisfish.welcome.menu.about=\u00C0 propos
+isisfish.welcome.menu.close=Fermer
+isisfish.welcome.menu.configuration=Configuration
+isisfish.welcome.menu.file=Fichier
+isisfish.welcome.menu.frame=Fen\u00EAtre
+isisfish.welcome.menu.help=Aide
+isisfish.welcome.menu.help.isisfish=Site d'Isis-Fish
+isisfish.welcome.menu.help.isisfishapi=API Isis-Fish
+isisfish.welcome.menu.help.javaapi=API Java
+isisfish.welcome.menu.help.lutinmatrixapi=API LutinMatrix
+isisfish.welcome.menu.help.topiaapi=API ToPIA
+isisfish.welcome.menu.input=Saisie
+isisfish.welcome.menu.monitor=Fen\u00EAtre de logs
+isisfish.welcome.menu.queue=Liste des simulations
+isisfish.welcome.menu.result=R\u00E9sultat
+isisfish.welcome.menu.script=Script
+isisfish.welcome.menu.simulation=Lanceur de simulations
+isisfish.welcome.menu.synchro=Synchronisation Serveur
+isisfish.welcome.menu.vcs.configuration=Configuration vcs
+isisfish.welcome.title=Simulation Ifremer
+isisfish.wizardGroupCreation.allGroupsSameSize=Tous les groupes ont la m\u00EAme taille
+isisfish.wizardGroupCreation.allValues=Input all the values
+isisfish.wizardGroupCreation.computedGrowthCurve=Calcul\u00E9 par une courbe de croissance
+isisfish.wizardGroupCreation.firstAge=Premier age
+isisfish.wizardGroupCreation.firstAgeHelp=First age \= minimal age
+isisfish.wizardGroupCreation.firstGroup=Premier groupe
+isisfish.wizardGroupCreation.firstLength=Premi\u00E8re taille
+isisfish.wizardGroupCreation.firstLengthHelp=First length \= minimal length of first group
+isisfish.wizardGroupCreation.gapBetweenGroupsHelp=gap between to group is 1 year.
+isisfish.wizardGroupCreation.groupNumberHelp=number of Group \= number of group wanted
+isisfish.wizardGroupCreation.groupWidth=Longueur du groupe
+isisfish.wizardGroupCreation.groupWidthHelp=Group width \= width of group
+isisfish.wizardGroupCreation.lastAge=Dernier age
+isisfish.wizardGroupCreation.lastAgeHelp=Last age \= maximal age
+isisfish.wizardGroupCreation.maxGroupsLength=Taille maximale de groupes
+isisfish.wizardGroupCreation.maxGroupsLengthHelp=A semicolon ';' must separe maximal length of each group
+isisfish.wizardGroupCreation.numberGroup=Nombre de groupes
+isisfish.wizardGroupCreation.numberGroups=Nombre de groupes
+isisfish.wizardGroupCreation.populationCharacteristics=Input the population characteristics
+isisfish.wizardGroupCreation.selectGroupLengthType=Choisir la longueur du groupe
+isisfish.wizardGroupCreation.timeStep=Pas de temps (en mois)
+isisfish.wizardGroupCreation.title=Cr\u00E9ation du groupe
+isisfish.zone.cells=cellules de la Zone
+isisfish.zone.comments=Commentaires
+isisfish.zone.name=Nom
+maximum\ length=
+minimum\ length=
+not\ started=
+region\ already\ exists\ %s\ use\ 'force'\ argument\ to\ force\ overwrite=
+simulate\ %s\ with\ file\ %s=
1
0
Author: chatellier
Date: 2009-04-09 10:58:45 +0000 (Thu, 09 Apr 2009)
New Revision: 2096
Modified:
isis-fish/trunk/pom.xml
Log:
[maven-release-plugin] prepare release isis-fish-3.2.0.4-rc2
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-09 10:51:34 UTC (rev 2095)
+++ isis-fish/trunk/pom.xml 2009-04-09 10:58:45 UTC (rev 2096)
@@ -13,7 +13,7 @@
<groupId>ifremer</groupId>
<artifactId>isis-fish</artifactId>
- <version>3.2.0.4-rc2-SNAPSHOT</version>
+ <version>3.2.0.4-rc2</version>
<!-- POM Relationships : Inheritance : Dependencies -->
<dependencies>
@@ -542,9 +542,9 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<scm>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
- <url>${maven.scm.url}</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</connection>
+ <developerConnection>scm:svn:svn+ssh://chatellier at labs.libre-entreprise.org/svnroot/isis-fish/isis-fish/tags/isis-fish-3.2.0.…</developerConnection>
+ <url>http://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/isis-fish/tags/…</url>
</scm>
<!--Code Lutin Repository-->
1
0
Author: chatellier
Date: 2009-04-09 10:51:34 +0000 (Thu, 09 Apr 2009)
New Revision: 2095
Modified:
isis-fish/trunk/pom.xml
Log:
Update version
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-04-09 10:04:59 UTC (rev 2094)
+++ isis-fish/trunk/pom.xml 2009-04-09 10:51:34 UTC (rev 2095)
@@ -345,15 +345,15 @@
<labs.project>isis-fish</labs.project>
<!-- Custom version -->
- <jaxx.version>1.3-SNAPSHOT</jaxx.version>
- <topia.version>2.1.4-SNAPSHOT</topia.version>
+ <jaxx.version>1.3</jaxx.version>
+ <topia.version>2.1.4</topia.version>
<topia.service.version>1.0.2</topia.service.version>
- <lutinmatrix.version>1.3-SNAPSHOT</lutinmatrix.version>
- <lutinutil.version>1.0.3</lutinutil.version>
+ <lutinmatrix.version>1.3</lutinmatrix.version>
+ <lutinutil.version>1.0.4</lutinutil.version>
<i18n.version>0.9</i18n.version>
- <lutinwidget.version>0.14-SNAPSHOT</lutinwidget.version>
+ <lutinwidget.version>0.14</lutinwidget.version>
<generator.version>0.64</generator.version>
- <lutinj2r.version>0.3-SNAPSHOT</lutinj2r.version>
+ <lutinj2r.version>0.3</lutinj2r.version>
<jrst.version>0.8.4</jrst.version>
<license-switcher.version>0.6</license-switcher.version>
<openmap.version>4.6.4</openmap.version>
1
0
r2094 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 10:04:59 +0000 (Thu, 09 Apr 2009)
New Revision: 2094
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx
Log:
Rafraichit la liste des simulations quand une simulation se termine
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx 2009-04-09 09:41:54 UTC (rev 2093)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/SensitivitySecondPassUI.jaxx 2009-04-09 10:04:59 UTC (rev 2094)
@@ -36,7 +36,34 @@
import org.codelutin.util.FileUtil;
import fr.ifremer.isisfish.ui.simulator.SimulAction;
import fr.ifremer.isisfish.datastore.SimulationStorage;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationService;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationJob;
+ import fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener;
+ // declaration sépérée de la variable d'instance (jaxx)
+ SimulationServiceListener simulationListener;
+
+ // permet de rafaichir la liste les simulations
+ // des qu'une simulation se termine
+ simulationListener = new SimulationServiceListener() {
+ @Override
+ public void simulationStart(SimulationService simService, SimulationJob job) {
+ }
+
+ @Override
+ public void simulationStop(SimulationService simService, SimulationJob job) {
+ if (log.isDebugEnabled()) {
+ log.debug("Refresh second pass UI simulations list");
+ }
+ fieldSensitivitySimulationSelect.setModel(getSensitivitySimulationModel());
+ }
+
+ @Override
+ public void clearJobDone(SimulationService simService) {
+ }
+ }
+ SimulationService.getService().addSimulationServiceListener(simulationListener);
+
/**
* Model de contenu de la liste des nom de simulations
*/
1
0
r2093 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
by chatellier@users.labs.libre-entreprise.org 09 Apr '09
09 Apr '09
Author: chatellier
Date: 2009-04-09 09:41:54 +0000 (Thu, 09 Apr 2009)
New Revision: 2093
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
Log:
Update comment
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-04-09 08:12:20 UTC (rev 2092)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2009-04-09 09:41:54 UTC (rev 2093)
@@ -499,10 +499,9 @@
return SimulatorStorage.getSimulatorNames();
}
- /*
- * Return old simulations
+ /**
+ * Return old simulations.
*
- * @param
* @return old simulations
*
* @deprecated use fr.ifremer.isisfish.ui.Common.getOldSimulationItem()
1
0