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
December 2009
- 2 participants
- 75 discussions
r2811 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator: . launcher
by chatellier@users.labs.libre-entreprise.org 10 Dec '09
by chatellier@users.labs.libre-entreprise.org 10 Dec '09
10 Dec '09
Author: chatellier
Date: 2009-12-10 14:30:26 +0000 (Thu, 10 Dec 2009)
New Revision: 2811
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTableModel.java
Log:
Change progress type from int to long.
Update javadoc.
Format code.
Make xml-rpc only method deprecated.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2009-12-10 14:28:48 UTC (rev 2810)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2009-12-10 14:30:26 UTC (rev 2811)
@@ -1,6 +1,5 @@
/* *##%
- * Copyright (C) 2002 - 2009 Code Lutin, Cédric Pineau,
- Benjamin Poussin
+ * Copyright (C) 2002 - 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
@@ -51,18 +50,19 @@
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
protected boolean inUpdateFromHashtable = false;
protected transient SimulationStorage simulation = null;
-
+
protected String id = null;
protected boolean started = false;
protected boolean running = true;
protected boolean stop = false;
- protected Date date = new Date();
- protected int progressMax = 0;
- protected int progress = 0;
+ protected Date date;
+ protected long progressMax = 0;
+ protected long progress = 0;
protected String text = "";
-
+
+ /** @deprecated only used in isis xml-rpc server. */
protected Map<String, Object> update = new Hashtable<String, Object>();
-
+
/**
*
* @param id simulation id
@@ -79,11 +79,11 @@
started = false;
running = true;
stop = false;
- date = new Date();
+ date = null;
progressMax = 0;
progress = 0;
}
-
+
/**
* Retourne la simulation associe a ce control
* @return retourne null si la simulation n'existe pas encore
@@ -94,29 +94,30 @@
}
return simulation;
}
-
+
public void addPropertyChangeListener(String propName, PropertyChangeListener l) {
listeners.addPropertyChangeListener(propName, l);
}
-
+
public void addPropertyChangeListener(PropertyChangeListener l) {
listeners.addPropertyChangeListener(l);
}
-
- public void removePropertyChangeListener(String propName, PropertyChangeListener l) {
+
+ public void removePropertyChangeListener(String propName,
+ PropertyChangeListener l) {
listeners.removePropertyChangeListener(propName, l);
}
-
+
public void removePropertyChangeListener(PropertyChangeListener l) {
listeners.removePropertyChangeListener(l);
}
-
+
public boolean isStarted() {
return started;
}
-
+
/**
- * appelee juste avant de reellement demarrer le thread de simulation
+ * Appelee juste avant de reellement demarrer le thread de simulation
* indique que cette simulation est en cours et qu'il ne faut plus la lancer
*
* @param started The running to set.
@@ -128,7 +129,7 @@
}
/**
- * Method running
+ * Method running.
*
* @return faux une fois que stopSimulation a ete appele.
*/
@@ -146,14 +147,14 @@
}
/**
- * Method startSimulation appele lors du debut de la simulation
+ * Appele lors du debut de la simulation.
*/
public void startSimulation() {
setRunning(true);
}
/**
- * Method stopSimulation appele lors de la fin reelle de la simulation
+ * Appele lors de la fin reelle de la simulation.
*/
public void stopSimulation() {
setRunning(false);
@@ -165,7 +166,7 @@
public String getText() {
return this.text;
}
-
+
/**
* @param text The text to set.
*/
@@ -177,53 +178,63 @@
this.text = text;
listeners.firePropertyChange("text", oldValue, this.text);
}
-
+
/**
* @return Returns the progressMax.
*/
- public int getProgressMax() {
+ public long getProgressMax() {
return this.progressMax;
}
-
+
/**
- * @param progressMax The progressMax to set.
+ * Set max progress.
+ *
+ * @param progressMax progressMax to set.
*/
- public void setProgressMax(int progressMax) {
- int oldValue = this.progressMax;
+ public void setProgressMax(long progressMax) {
+ long oldValue = this.progressMax;
this.progressMax = progressMax;
listeners.firePropertyChange("progressMax", oldValue, this.progressMax);
}
-
+
/**
- * @return Returns the progress.
+ * Get current progress.
+ *
+ * @return the progress.
*/
- public int getProgress() {
+ public long getProgress() {
return this.progress;
}
-
+
/**
- * @param progress The progress to set.
+ * Set current progress.
+ *
+ * @param progress progress to set.
*/
- public void setProgress(int progress) {
- int oldValue = this.progress;
+ public void setProgress(long progress) {
+ long oldValue = this.progress;
this.progress = progress;
- if(log.isTraceEnabled()) {
- log.trace("control fire event 'progress' (" + oldValue + "/" + this.progress);
+ if (log.isTraceEnabled()) {
+ log.trace("control fire event 'progress' (" + oldValue + "/"
+ + this.progress);
}
listeners.firePropertyChange("progress", oldValue, this.progress);
}
-
+
/**
- * demande l'arret de la simulation
- * @param val
+ * Demande l'arret de la simulation.
+ *
+ * @param val {@code true} to stop
*/
- public void setStopSimulationRequest(boolean val){
+ public void setStopSimulationRequest(boolean val) {
boolean oldValue = this.stop;
this.stop = val;
listeners.firePropertyChange("stop", oldValue, this.stop);
}
-
+
/**
+ * Is stop request been asked.
+ *
* @return retourne vrai si l'arret de la simulation a ete demandee
*/
public boolean isStopSimulationRequest() {
@@ -231,7 +242,7 @@
}
/**
- * Method getId donne id de la simulation
+ * Method getId donne id de la simulation.
*
* @return l'id de la simulation
*/
@@ -240,39 +251,44 @@
}
/**
- * Method getDate donne la date utiliser par la simulation
+ * Method getDate donne la date utiliser par la simulation.
*
* @return donne la date utiliser par la simulation
*/
public Date getDate() {
return date;
}
-
/**
- * Modifie la date de la simulation
+ * Modifie la date de la simulation.
+ *
* @param d la nouvelle date
*/
public void setDate(Date d) {
- int oldValue = this.date.getDate();
+ int oldValue = 0;
+ if (this.date != null) {
+ oldValue = this.date.getDate();
+ }
this.date = d;
listeners.firePropertyChange("date", oldValue, this.date.getDate());
}
/**
* Convert current object in hashtable representation, and clear hashtable
- * that contains last modified field
+ * that contains last modified field.
+ *
* @return object hashtable representation
+ * @deprecated only used in xml-rpc isis server
*/
public Hashtable<String, Object> getUpdateHashtable() {
Hashtable<String, Object> result = new Hashtable<String, Object>(update);
update.clear();
-
+
result.put("id", getId());
-
+
return result;
}
-
+
/**
* Met dans un Properties tous les champs
* @return un Properties avec tous les champs
@@ -283,14 +299,16 @@
result.setProperty("started", String.valueOf(started));
result.setProperty("running", String.valueOf(running));
result.setProperty("stop", String.valueOf(stop));
- result.setProperty("date", String.valueOf(date.getDate()));
+ if (date != null) {
+ result.setProperty("date", String.valueOf(date.getDate()));
+ }
result.setProperty("progressMax", String.valueOf(progressMax));
result.setProperty("progress", String.valueOf(progress));
result.setProperty("text", text);
-
+
return result;
}
-
+
/**
* update current object from Properties representation
*
@@ -299,36 +317,41 @@
public void updateFromProperties(Properties props) {
inUpdateFromHashtable = true;
- if(log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("updateFromProperties properties = " + props.toString());
}
-
+
// warning : props.contains("started")
// seems to not works on properties :(
// use containsKey()
try {
if (props.containsKey("started")) {
- boolean started = "true".equalsIgnoreCase(props.getProperty("started"));
+ boolean started = "true".equalsIgnoreCase(props
+ .getProperty("started"));
setStarted(started);
}
if (props.containsKey("running")) {
- boolean running = "true".equalsIgnoreCase(props.getProperty("running"));
+ boolean running = "true".equalsIgnoreCase(props
+ .getProperty("running"));
setRunning(running);
}
if (props.containsKey("stop")) {
- boolean stop = "true".equalsIgnoreCase(props.getProperty("stop"));
+ boolean stop = "true".equalsIgnoreCase(props
+ .getProperty("stop"));
setStopSimulationRequest(stop);
}
if (props.containsKey("date")) {
- Date date = new Date(Integer.parseInt(props.getProperty("date")));
+ Date date = new Date(Integer
+ .parseInt(props.getProperty("date")));
setDate(date);
}
if (props.containsKey("progressMax")) {
- int progressMax = Integer.parseInt(props.getProperty("progressMax"));
+ long progressMax = Long.parseLong(props
+ .getProperty("progressMax"));
setProgressMax(progressMax);
}
if (props.containsKey("progress")) {
- int progress = Integer.parseInt(props.getProperty("progress"));
+ long progress = Long.parseLong(props.getProperty("progress"));
setProgress(progress);
}
if (props.containsKey("text")) {
@@ -339,41 +362,41 @@
inUpdateFromHashtable = false;
}
}
-
-
+
/**
* update current object from hashtable representation
- *
+ *
+ * @deprecated only used in xml-rpc isis server
*/
public void updateFromHashtable(Hashtable<String, Object> h) {
inUpdateFromHashtable = true;
try {
if (h.containsKey("started")) {
- boolean started = (Boolean)h.get("started");
+ boolean started = (Boolean) h.get("started");
setStarted(started);
}
if (h.containsKey("running")) {
- boolean running = (Boolean)h.get("running");
+ boolean running = (Boolean) h.get("running");
setRunning(running);
}
if (h.containsKey("stop")) {
- boolean stop = (Boolean)h.get("stop");
+ boolean stop = (Boolean) h.get("stop");
setStopSimulationRequest(stop);
}
if (h.containsKey("date")) {
- Date date = new Date((Integer)h.get("date"));
+ Date date = new Date((Integer) h.get("date"));
setDate(date);
}
if (h.containsKey("progressMax")) {
- int progressMax = (Integer)h.get("progressMax");
+ long progressMax = (Long) h.get("progressMax");
setProgressMax(progressMax);
}
if (h.containsKey("progress")) {
- int progress = (Integer)h.get("progress");
+ long progress = (Long) h.get("progress");
setProgress(progress);
}
if (h.containsKey("text")) {
- String text = (String)h.get("text");
+ String text = (String) h.get("text");
setText(text);
}
} finally {
@@ -396,5 +419,5 @@
}
}
}
-
+
} // SimulationControl
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTableModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTableModel.java 2009-12-10 14:28:48 UTC (rev 2810)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTableModel.java 2009-12-10 14:30:26 UTC (rev 2811)
@@ -21,19 +21,23 @@
import static org.nuiton.i18n.I18n._;
-import fr.ifremer.isisfish.simulator.SimulationControl;
-import fr.ifremer.isisfish.simulator.SimulationParameter;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
+
import javax.swing.JProgressBar;
import javax.swing.table.AbstractTableModel;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import fr.ifremer.isisfish.simulator.SimulationControl;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.types.Date;
+
/**
* Model de table pour suivre l'evolution des differentes simulations en cours.
*
@@ -248,10 +252,14 @@
break;
case 4:
JProgressBar pb = getProgressBar(job);
- pb.setMaximum(control.getProgressMax());
- pb.setValue(control.getProgress());
- pb.setString(control.getDate().getMonth() + "/"
- + control.getDate().getYear());
+ pb.setMaximum((int)control.getProgressMax());
+ pb.setValue((int)control.getProgress());
+
+ // progress can be used for other things
+ Date date = control.getDate();
+ if (date != null) {
+ pb.setString(date.getMonth() + "/" + date.getYear());
+ }
result = pb;
break;
}
1
0
Author: chatellier
Date: 2009-12-10 14:28:48 +0000 (Thu, 10 Dec 2009)
New Revision: 2810
Modified:
isis-fish/trunk/pom.xml
Log:
Revert beta2 use
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-12-10 14:25:19 UTC (rev 2809)
+++ isis-fish/trunk/pom.xml 2009-12-10 14:28:48 UTC (rev 2810)
@@ -435,8 +435,8 @@
<properties>
<!-- Custom version -->
<jaxx.version>1.7.1</jaxx.version>
- <eugene.version>2.0.0-beta-2-SNAPSHOT</eugene.version>
- <topia.version>2.3.0-beta-2-SNAPSHOT</topia.version>
+ <eugene.version>2.0.0-beta-SNAPSHOT</eugene.version>
+ <topia.version>2.3.0-beta-SNAPSHOT</topia.version>
<nuiton-utils.version>1.1.2-SNAPSHOT</nuiton-utils.version>
<nuiton-i18n.version>1.0.1</nuiton-i18n.version>
<nuiton-widgets.version>1.0.1-SNAPSHOT</nuiton-widgets.version>
1
0
Author: chatellier
Date: 2009-12-10 14:25:19 +0000 (Thu, 10 Dec 2009)
New Revision: 2809
Modified:
isis-fish/trunk/pom.xml
Log:
Use never snapshot
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-12-10 10:07:50 UTC (rev 2808)
+++ isis-fish/trunk/pom.xml 2009-12-10 14:25:19 UTC (rev 2809)
@@ -435,8 +435,8 @@
<properties>
<!-- Custom version -->
<jaxx.version>1.7.1</jaxx.version>
- <eugene.version>2.0.0-beta-SNAPSHOT</eugene.version>
- <topia.version>2.3.0-beta-SNAPSHOT</topia.version>
+ <eugene.version>2.0.0-beta-2-SNAPSHOT</eugene.version>
+ <topia.version>2.3.0-beta-2-SNAPSHOT</topia.version>
<nuiton-utils.version>1.1.2-SNAPSHOT</nuiton-utils.version>
<nuiton-i18n.version>1.0.1</nuiton-i18n.version>
<nuiton-widgets.version>1.0.1-SNAPSHOT</nuiton-widgets.version>
1
0
r2808 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 10 Dec '09
by chatellier@users.labs.libre-entreprise.org 10 Dec '09
10 Dec '09
Author: chatellier
Date: 2009-12-10 10:07:50 +0000 (Thu, 10 Dec 2009)
New Revision: 2808
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
Log:
Prepare to display better download ui.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-10 09:06:10 UTC (rev 2807)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-10 10:07:50 UTC (rev 2808)
@@ -388,7 +388,7 @@
log.debug("MD5 Control file have been downloaded : " + md5ControlFile.getAbsolutePath());
}
- File resultArchiveFile = downloadResultsArchive(sshSession, control.getId(), md5sum);
+ File resultArchiveFile = downloadResultsArchive(sshSession, control, md5sum);
if (resultArchiveFile != null) {
@@ -687,7 +687,7 @@
* @throws SSHException if download fail (can happen if remote file doesn't exist
* @throws IOException if download fail (can happen if remote file doesn't exist
*/
- protected File downloadResultsArchive(Session session, String simulationId, String md5sum)
+ protected File downloadResultsArchive(Session session, SimulationControl simulationControl, String md5sum)
throws SSHException, IOException {
File localFile = File.createTempFile("simulation-results", ".zip");
@@ -699,6 +699,7 @@
// build remote file path
// FIXME this path should be given by remote IsisFish app
+ String simulationId = simulationControl.getId();
String remoteFile = getRemoteResultArchivePath(simulationId);
try {
1
0
Author: chatellier
Date: 2009-12-10 09:06:10 +0000 (Thu, 10 Dec 2009)
New Revision: 2807
Modified:
isis-fish/trunk/pom.xml
Log:
Use freemarker 2.3.16
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-12-08 09:33:27 UTC (rev 2806)
+++ isis-fish/trunk/pom.xml 2009-12-10 09:06:10 UTC (rev 2807)
@@ -302,7 +302,7 @@
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
- <version>2.3.15</version>
+ <version>2.3.16</version>
</dependency>
<dependency>
1
0
r2806 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 08 Dec '09
by chatellier@users.labs.libre-entreprise.org 08 Dec '09
08 Dec '09
Author: chatellier
Date: 2009-12-08 09:33:27 +0000 (Tue, 08 Dec 2009)
New Revision: 2806
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
Log:
Fix control file been erased by setText property change
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-07 15:46:49 UTC (rev 2805)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-08 09:33:27 UTC (rev 2806)
@@ -407,14 +407,16 @@
resultArchiveFile.delete();
- // clear all simulation input/output files on remote
- // server temp directory
- clearSimulationFiles(sshSession, control);
-
// read control from downloaded simulation
synchronized (control) {
SimulationStorage.readControl(control.getId(), control, "stop");
}
+
+ // clear all simulation input/output files on remote
+ // server temp directory
+ // control need to be read before, otherwize, setText
+ // in clearSimulationFiles will erase file :(
+ clearSimulationFiles(sshSession, control);
}
else {
if (log.isWarnEnabled()) {
1
0
r2805 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: . aspect datastore entities equation map simulator simulator/launcher ui/config ui/script ui/script/model ui/sensitivity ui/widget/editor util/ssh
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
07 Dec '09
Author: chatellier
Date: 2009-12-07 15:46:49 +0000 (Mon, 07 Dec 2009)
New Revision: 2805
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ResultStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/VersionStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationMeanWeight.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/model/ScriptTreeModel.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterTableCellEditor.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/SSHUtils.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/package-info.java
Log:
Global javadoc fix (@return warning, etc...)
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -124,8 +124,9 @@
}
/**
- * le nombre global ex: 3.2.0.0
- * @return
+ * Le nombre global ex: 3.2.0.0
+ *
+ * @return full version
*/
static public String getVersion() {
String result = version.toString();
@@ -134,7 +135,8 @@
/**
* La version de la base ex: 3.2
- * @return
+ *
+ * @return database version
*/
public static Version getDatabaseVersion() {
return databaseVersion;
@@ -142,7 +144,8 @@
/**
* La version de l'api de programmation ex: 3.2.0
- * @return
+ *
+ * @return api version
*/
public static Version getApiVersion() {
return apiVersion;
@@ -189,7 +192,8 @@
/**
* Retourne le repertoire racine de toutes les donnees (script, simulation
* region, ...)
- * @return
+ *
+ * @return database directory
*/
public File getDatabaseDirectory() {
File result = getOptionAsFile(Option.DATABASE_DIRECTORY.key);
@@ -268,8 +272,9 @@
}
/**
- * Retourne l'encoding a utiliser pour les fichiers textes
- * @return
+ * Retourne l'encoding a utiliser pour les fichiers textes.
+ *
+ * @return encoding to use
*/
public String getEncoding() {
String result = getOption(Option.ENCODING.key);
@@ -277,8 +282,9 @@
}
/**
- * Retourne le serveur SMTP a utiliser pour l'envoie de mail
- * @return
+ * Retourne le serveur SMTP a utiliser pour l'envoie de mail.
+ *
+ * @return smtp server address
*/
public String getSmtpServer() {
String result = getOption(Option.SMTP_SERVER.key);
@@ -286,8 +292,9 @@
}
/**
- * Retourne le nom usuel de l'utilisateur
- * @return
+ * Retourne le nom usuel de l'utilisateur.
+ *
+ * @return username
*/
public String getUserName() {
String result = getOption(Option.USER_NAME.key);
@@ -295,8 +302,9 @@
}
/**
- * Retourne l'email de l'utilisateur
- * @return
+ * Retourne l'email de l'utilisateur.
+ *
+ * @return user email
*/
public String getUserMail() {
String result = getOption(Option.USER_MAIL.key);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/aspect/RuleAspect.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -103,8 +103,7 @@
* Effectue l'appel reel en calculant le temps pris.
*
* @param jp join point
- * @param state
- * @param aspectized class return object
+ * @param state state
* @throws Throwable
*/
protected Object makeTimedCall(JoinPoint jp, State state) throws Throwable {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ResultStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ResultStorage.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ResultStorage.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -123,19 +123,20 @@
/**
* Retourne le nom de tous les resultats disponibles le nom est constitué
- * de la date et du nom du resultat
- * @return
+ * de la date et du nom du resultat.
+ *
+ * @return available results
*/
protected Set<String> getAvailableResult() {
if (availableResult == null) {
availableResult = new HashSet<String>();
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
@@ -163,15 +164,17 @@
* Verifie si un resultat est disponible pour une date donnée
* @param date
* @param name
- * @return
+ * @return {@code true} if result is available
*/
protected boolean isAvailableResult(Date date, String name) {
String key = date.getDate() + ":" + name;
boolean result = getAvailableResult().contains(key);
return result;
}
+
/**
- * Ajoute un resultat comme etant disponible pour une date donnée
+ * Ajoute un resultat comme etant disponible pour une date donnée.
+ *
* @param date
* @param name
*/
@@ -181,9 +184,12 @@
}
/**
- * Permet de savoir si lorsque l'on ajoutera ce resultat, il sera
- * sauvé ou non.
- */
+ * Permet de savoir si lorsque l'on ajoutera ce resultat, il sera
+ * sauvé ou non.
+ *
+ * @param name result name
+ * @return {@code true} if result is enabled
+ */
public boolean isEnabled(String name){
name = name.trim();
if (enabledResult == null) {
@@ -267,12 +273,12 @@
protected void doAddResult(Date date, String name, MatrixND mat) throws IsisFishException{
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
tx = simulation.getStorage().beginTransaction();
@@ -290,9 +296,9 @@
protected void doAddResult(Date date, String name, MatrixND mat, TopiaContext tx) throws IsisFishException{
// si la matrice n'a pas de semantique on refuse
- for(int i=0; i<mat.getNbDim(); i++){
+ for (int i=0; i<mat.getNbDim(); i++) {
// la semantique n'est pas bonne des qu'il y a un null dedans
- if(mat.getSemantics(i).contains(null)){
+ if (mat.getSemantics(i).contains(null)) {
throw new SimulationException("Erreur le résultat que vous souhaitez enregistrer n'a pas d'information convenable pour la dimension: " + i + " " + mat.getDimensionName(i) );
}
}
@@ -316,12 +322,12 @@
public void addActiveRule(Date date, Rule rule) throws IsisFishException {
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
tx = simulation.getStorage().beginTransaction();
@@ -343,21 +349,20 @@
}
/**
- * Retourne la liste de tous les résultats. Si le résultat est categorisé
- * par une population alors le nom de la population est automatiquement
- * ajouté au nom du résultat
- */
- @SuppressWarnings("unchecked")
- public List<String> getResultName(){
+ * Retourne la liste de tous les résultats. Si le résultat est categorisé
+ * par une population alors le nom de la population est automatiquement
+ * ajouté au nom du résultat.
+ */
+ public List<String> getResultName() {
List<String> result = null;
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
tx = simulation.getStorage().beginTransaction();
@@ -381,14 +386,15 @@
}
return result;
}
+
/**
- * Retourne la matrice stocke pour un pas de temps
- * @param date le pas de temps que l'on souhaite
- * @param pop la population pour lequelle on souhaite le resultat
- * @param name le nom des resultats dont on veut la matrice
- * @return La matrice demandée ou null si aucune matrice ne correspond a
- * la demande.
- */
+ * Retourne la matrice stocke pour un pas de temps
+ * @param date le pas de temps que l'on souhaite
+ * @param pop la population pour lequelle on souhaite le resultat
+ * @param name le nom des resultats dont on veut la matrice
+ * @return La matrice demandée ou null si aucune matrice ne correspond a
+ * la demande.
+ */
public MatrixND getMatrix(Date date, Population pop, String name) {
String newName = name + " " + pop;
return getMatrix(date, newName);
@@ -398,12 +404,12 @@
MatrixND mat = getInCache(date, name);
if (mat == null && isAvailableResult(date, name)) {
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
tx = simulation.getStorage().beginTransaction();
@@ -428,14 +434,15 @@
}
/**
- * Retourne la matrice stocke pour un pas de temps
- * @param date le pas de temps que l'on souhaite
- * @param name le nom des resultats dont on veut la matrice
- * @param tx TopiaContext a utiliser pour recuperer les resultats et donc les semantiques
- * @return La matrice demandée ou null si aucune matrice ne correspond a
- * la demande.
- */
- public MatrixND getMatrix(Date date, String name, TopiaContext tx){
+ * Retourne la matrice stocke pour un pas de temps.
+ *
+ * @param date le pas de temps que l'on souhaite
+ * @param name le nom des resultats dont on veut la matrice
+ * @param tx TopiaContext a utiliser pour recuperer les resultats et donc les semantiques
+ * @return La matrice demandée ou {@code null} si aucune matrice ne correspond a
+ * la demande.
+ */
+ public MatrixND getMatrix(Date date, String name, TopiaContext tx) {
MatrixND mat = getInCache(date, name);
if (mat == null && isAvailableResult(date, name)) {
try {
@@ -459,7 +466,7 @@
* @param pop la population pour lequel on souhaite la matrice
* @param name le nom des resultats dont on veut une matrice globale.
*/
- public MatrixND getMatrix(Population pop, String name){
+ public MatrixND getMatrix(Population pop, String name) {
String newName = name + " " + pop;
return getMatrix(newName);
}
@@ -468,15 +475,15 @@
* Retourne une matrice contenant tous les pas de temps.
* @param name le nom des resultats dont on veut une matrice globale.
*/
- public MatrixND getMatrix(String name){
+ public MatrixND getMatrix(String name) {
MatrixND resultMat = null;
try {
- TopiaContext tx = null;
- boolean mustClose = false;
+ TopiaContext tx = null;
+ boolean mustClose = false;
- if (simulation == SimulationContext.get().getSimulationStorage()) {
- tx = SimulationContext.get().getDbResult();
- }
+ if (simulation == SimulationContext.get().getSimulationStorage()) {
+ tx = SimulationContext.get().getDbResult();
+ }
if (tx == null) {
// not in simulation, create transaction
tx = simulation.getStorage().beginTransaction();
@@ -500,12 +507,11 @@
}
/**
- * Retourne une matrice contenant tous les pas de temps.
- * @param name le nom des resultats dont on veut une matrice globale.
- * @param tx TopiaContext a utiliser pour recuperer les resultats et donc les semantiques
- */
- @SuppressWarnings("unchecked")
- public MatrixND getMatrix(String name, TopiaContext tx){
+ * Retourne une matrice contenant tous les pas de temps.
+ * @param name le nom des resultats dont on veut une matrice globale.
+ * @param tx TopiaContext a utiliser pour recuperer les resultats et donc les semantiques
+ */
+ public MatrixND getMatrix(String name, TopiaContext tx) {
log.debug("Get result: " + name);
MatrixND resultMat = getInCache(name);
@@ -525,7 +531,7 @@
}
// s'il n'y pas de resultat, on retourne null
- if(results == null || results.size() == 0){
+ if (results == null || results.size() == 0) {
return null;
}
@@ -536,12 +542,12 @@
List<Date> dates = new ArrayList<Date>();
Date date = new Date(0);
dates.add(date);
- while(date.before(lastDate)){
+ while (date.before(lastDate)) {
date = date.next();
dates.add(date);
}
- if(log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("List des dates: "+ dates);
}
@@ -551,7 +557,7 @@
// recuperation des noms des dimensions
String [] dimNames = new String[1 + mat.getNbDim()];
dimNames[0] = _("isisfish.common.date");
- for(int i=1; i<dimNames.length; i++){
+ for (int i=1; i<dimNames.length; i++) {
dimNames[i] = mat.getDimensionName(i-1);
}
@@ -560,30 +566,28 @@
List [] sem = new List[1 + mat.getNbDim()];
sem[0] = dates;
- for(int i=1; i<sem.length; i++){
+ for (int i=1; i<sem.length; i++) {
sem[i] = new HashList();
}
- for(Result result: results){
+ for (Result result: results) {
MatrixND mattmp = result.getMatrix();
- if(log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("Ajout de la semantics: "+ Arrays.asList(mattmp.getSemantics()));
}
-
- for(int s=0; s<mattmp.getNbDim(); s++){
+ for (int s=0; s<mattmp.getNbDim(); s++) {
sem[s+1].addAll(mattmp.getSemantics(s));
}
}
- if(log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("La semantique final est: "+ Arrays.asList(sem));
}
// creation de la matrice resultat
resultMat = MatrixFactory.getInstance().create(name, sem, dimNames);
-
// recuperation du resultat pour chaque date de la simulation, de Date(0) à lastDate
for(Result result: results){
Date d = result.getResultDate();
@@ -608,7 +612,9 @@
}
/**
- * @return
+ * Get last simulation date.
+ *
+ * @return last simulation date
*/
public Date getLastDate() {
int monthNumber = simulation.getParameter().getNumberOfYear() * Month.NUMBER_OF_MONTH;
@@ -616,9 +622,10 @@
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.simulator.SimulationResultListener#addResult(fr.ifremer.isisfish.simulator.SimulationContext, fr.ifremer.isisfish.types.Date, java.lang.String, org.nuiton.math.matrix.MatrixND)
*/
+ @Override
public void addResult(SimulationContext context, Date date, String name, MatrixND mat) throws IsisFishException {
try {
doAddResult(date, name, mat, context.getDbResult());
@@ -627,9 +634,10 @@
}
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.simulator.SimulationResultGetter#getMatrix(fr.ifremer.isisfish.simulator.SimulationContext, fr.ifremer.isisfish.types.Date, java.lang.String)
*/
+ @Override
public MatrixND getMatrix(SimulationContext context, Date date, String name) {
MatrixND result = null;
try {
@@ -642,9 +650,10 @@
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.simulator.SimulationResultGetter#getMatrix(fr.ifremer.isisfish.simulator.SimulationContext, java.lang.String)
*/
+ @Override
public MatrixND getMatrix(SimulationContext context, String name) {
MatrixND result = null;
try {
@@ -657,15 +666,17 @@
return result;
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.simulator.SimulationListener#afterSimulation(fr.ifremer.isisfish.simulator.SimulationContext)
*/
+ @Override
public void afterSimulation(SimulationContext context) {
}
- /* (non-Javadoc)
+ /*
* @see fr.ifremer.isisfish.simulator.SimulationListener#beforeSimulation(fr.ifremer.isisfish.simulator.SimulationContext)
*/
+ @Override
public void beforeSimulation(SimulationContext context) {
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -146,10 +146,11 @@
}
/**
- * Retourne le repertoire de stockage des exports de resulatat d'une
+ * Retourne le repertoire de stockage des exports de resultat d'une
* simulation.
+ *
* @param root le repertoire de stockage de la simulation
- * @return
+ * @return result export directory
*/
public static File getResultExportDirectory(File root) {
File result = new File(root, RESULT_EXPORT_DIRECTORY);
@@ -160,9 +161,10 @@
}
/**
- * Retourne le fichier de stockage des parametres de la simulation
+ * Retourne le fichier de stockage des parametres de la simulation.
+ *
* @param root le repertoire de stockage de la simulation
- * @return
+ * @return parameter file
*/
public static File getSimulationParametersFile(File root) {
File result = new File(root, PARAMETERS_FILENAME);
@@ -170,9 +172,10 @@
}
/**
- * Retourne le fichier de stockage des inforations de la simulation
+ * Retourne le fichier de stockage des inforations de la simulation.
+ *
* @param root le repertoire de stockage de la simulation
- * @return
+ * @return information file
*/
public static File getSimulationInformationFile(File root) {
File result = new File(root, INFORMATION_FILENAME);
@@ -184,7 +187,7 @@
* de la simulation.
*
* @param root le repertoire de stockage de la simulation
- * @return
+ * @return mexico xml file
*/
public static File getSimulationResultXmlFile(File root) {
File result = new File(root, RESULT_XML_FILENAME);
@@ -194,7 +197,7 @@
/**
* Retourne le fichier de stockage des parametres de la simulation courante.
*
- * @return
+ * @return parameter file
*/
protected File getSimulationParametersFile() {
File result = getSimulationParametersFile(getDirectory());
@@ -215,8 +218,9 @@
/**
* Retourne le fichier de stockage du fichier de control de la simulation.
* Ce fichier conserve l'etat de la simulation, cela permet a un processus
- * externe de connaitre l'etat d'une simulation distante
- * @return
+ * externe de connaitre l'etat d'une simulation distante.
+ *
+ * @return simulation control file
*/
protected File getSimulationControlFile() {
if (simulationControlFile == null) {
@@ -228,8 +232,9 @@
/**
* Retourne le fichier de stockage du fichier de control de la simulation.
* Ce fichier conserve l'etat de la simulation, cela permet a un processus
- * externe de connaitre l'etat d'une simulation distante
- * @return
+ * externe de connaitre l'etat d'une simulation distante.
+ *
+ * @return simulation control file
*/
protected static File getSimulationControlFile(String id) {
File result = new File(getSimulationDirectory(id), CONTROL_FILENAME);
@@ -256,7 +261,7 @@
}
/**
- * Reli le fichier contenant les infos de SimulationControl, en excluant
+ * Relit le fichier contenant les infos de SimulationControl, en excluant
* certain champs.
*
* @param id l'identifiant de la simulation a lire
@@ -424,8 +429,9 @@
}
/**
- * Retourne le nom du fichier contenant les informations de simulation
- * @return
+ * Retourne le nom du fichier contenant les informations de simulation.
+ *
+ * @return information file
*/
protected File getInformationFile() {
File result = new File(getDirectory(), INFORMATION_FILENAME);
@@ -433,7 +439,9 @@
}
/**
- * @return Returns the information.
+ * Get simulation informations.
+ *
+ * @return simulation information
*/
public SimulationInformation getInformation() {
if (information == null) {
@@ -443,7 +451,9 @@
}
/**
- * @return le ResultStorage a utiliser pour cette simulation
+ * Get simulation {@link ResultStorage}.
+ *
+ * @return le {@link ResultStorage} a utiliser pour cette simulation
*/
public ResultStorage getResultStorage() {
if (resultStorage == null) {
@@ -453,7 +463,8 @@
}
/**
- * Indique si la simulation demandée existe ou non
+ * Indique si la simulation demandée existe ou non.
+ *
* @param name le nom de la simulation à tester
* @return true si la simulation existe déjà
*/
@@ -465,7 +476,8 @@
}
/**
- * Indique si la simulation demandée existe ou non
+ * Indique si la simulation demandée existe ou non.
+ *
* @param name le nom de la simulation à tester
* @return true si la simulation existe déjà
*/
@@ -475,6 +487,7 @@
/**
* Retourne la simulation demandée.
+ *
* @param name name of the required simulation
* @return la simulation souhaitée ou null si la simulation n'existe pas
*/
@@ -530,7 +543,8 @@
}
/**
- * Retourne la liste des noms de toutes les régions disponible en local
+ * 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> getSimulationNames() {
@@ -540,7 +554,8 @@
/**
* Retourne la liste des noms de toutes les régions disponible en local qui
- * ne sont pas encore sur le serveur CVS
+ * ne sont pas encore sur le serveur VCS.
+ *
* @return liste de noms de simulations
*/
public static List<String> getNewSimulationNames() {
@@ -551,9 +566,10 @@
/**
* Retourne la liste des noms de toutes les régions disponible sur le
- * serveur CVS
+ * serveur VCS.
+ *
* @return la liste des noms de toutes les régions disponible sur le
- * serveur CVS. Si le serveur n'est pas disponible la liste retournée
+ * serveur VCS. Si le serveur n'est pas disponible la liste retournée
* est vide.
*/
public static List<String> getRemoteSimulationNames() {
@@ -563,7 +579,8 @@
/**
* Retourne la liste des noms de toutes les régions disponible sur le
- * serveur CVS qui ne sont pas encore en local
+ * serveur VCS qui ne sont pas encore en local.
+ *
* @return liste de noms de simulations
*/
public static List<String> getNewRemoteSimulationNames() {
@@ -573,9 +590,10 @@
}
/**
- * Retourne la {@link FisheryRegion} associee a cette simulation
- * @param context
- * @return
+ * Retourne la {@link FisheryRegion} associee a cette simulation.
+ *
+ * @param context context
+ * @return simulation's {@link FisheryRegion}
* @throws StorageException
*/
public static FisheryRegion getFisheryRegion(TopiaContext context)
@@ -810,23 +828,6 @@
}
/*
- * @see fr.ifremer.isisfish.datastore.DataStorage#prepare()
- *
- @Override
- protected void prepare() {
- super.prepare();
-
- // force parameter save
- // because they can have unsaved modification
- if (log.isDebugEnabled()) {
- log.debug("Save simulation parameters");
- }
- setParameter(parameter);
-
- this methods sometime force save of empty parameters
- }*/
-
- /*
* @see fr.ifremer.isisfish.datastore.DataStorage#createZip(java.io.File)
*/
@Override
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -47,9 +47,12 @@
/** Template freemarker pour les scripts. */
public static final String SIMULATOR_TEMPLATE = "templates/script/simulator.ftl";
-
+
+ /** Simulators cache. */
+ static private Map<String, SimulatorStorage> simulatorsCache = (Map<String, SimulatorStorage>) new ReferenceMap();
+
/**
- * Constructeur
+ * Constructeur.
*
* @param rootSrc
*/
@@ -68,7 +71,7 @@
/**
* Retourne une nouvelle instance de la regle. Compile le fichier si besoin
*
- * @return
+ * @return new rule instance
* @throws IsisFishException
*/
public Simulator getNewSimulatorInstance() throws IsisFishException {
@@ -145,8 +148,4 @@
result.removeAll(getSimulatorNames());
return result;
}
-
- @SuppressWarnings("unchecked")
- static private Map<String, SimulatorStorage> simulatorsCache = (Map<String, SimulatorStorage>) new ReferenceMap();
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/VersionStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -345,7 +345,7 @@
/**
* Fire a change event to all registred listeners.
*
- * For example, to notify, that a {@link JavaStorage} file has been added...
+ * For example, to notify, that a {@link JavaSourceStorage} file has been added...
*
* @param event event to fire
*/
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/entities/PopulationSeasonInfoImpl.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -224,7 +224,7 @@
/**
* Create not initialized no spacialized change group matrix.
*
- * @return
+ * @return not initialized no spacialized change group matrix
*/
public MatrixND createNoSpacializedChangeGroupMatrix() {
Population pop = getPopulation();
@@ -263,7 +263,7 @@
/**
* Create not initialized spacialized change group matrix.
*
- * @return
+ * @return not initialized spacialized change group matrix
*/
protected MatrixND createSpacializedChangeGroupMatrix() {
Population pop = getPopulation();
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationMeanWeight.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationMeanWeight.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/equation/PopulationMeanWeight.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -17,37 +17,32 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * PopulationMeanWeight.java
- *
- * Created: 23 août 2006 11:14:46
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
package fr.ifremer.isisfish.equation;
import fr.ifremer.isisfish.entities.PopulationGroup;
import fr.ifremer.isisfish.simulator.SimulationContext;
import fr.ifremer.isisfish.util.Args;
-
/**
+ * PopulationMeanWeight equation.
+ *
+ * Created: 23 août 2006 11:14:46
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
public interface PopulationMeanWeight {
/**
+ * Compute population mean weight.
*
- * @param context
+ * @param context simulation context
* @param group le groupe dont on souhaite le poids moyen
- * @return
+ * @return population mean weight
+ * @throws Exception
*/
@Args({"context", "group"})
public double compute(SimulationContext context, PopulationGroup group) throws Exception;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/map/IsisMapBean.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -502,7 +502,7 @@
* @param fillColor fill color
*
* @return vpf layer
- * @see vpfLayer
+ * @see VPFLayer
*/
protected Layer getVPFLayer(String layerId, String mapFile, String lineColor,
String fillColor) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/MetierMonitor.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -116,11 +116,11 @@
/**
* Metier is forbidden is can be found in {@link #forbiddenMetier} or in
- * {@link #forbiddenMetierMonth}
+ * {@link #forbiddenMetierMonth}.
*
* @param metier
* @param month
- * @return
+ * @return {@code true} if metier forbidden
*/
public boolean isForbidden(Metier metier, Month month) {
boolean result = forbiddenMetier.contains(metier);
@@ -223,7 +223,7 @@
* @param metier
* @param firstMonth
* @param lastMonth
- * @return
+ * @return limited period
*/
public boolean isLimitedPeriode(Metier metier, Month firstMonth, Month lastMonth) {
for(Month i = firstMonth; i.compareTo(lastMonth) <= 0; i = i.next()) {
@@ -254,7 +254,7 @@
/**
* @param metier
* @param i
- * @return
+ * @return proportion month
*/
private double computeProportionMonth(Metier metier, Month month) {
double prop = 0;
@@ -280,7 +280,7 @@
/**
* @param metier
* @param nbLicences
- * @return
+ * @return proportion max total
*/
private double computeProportionMaxTotal(Metier metier, int nbLicences) {
int nbBoat = 0;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -104,9 +104,10 @@
}
/**
- * Return current biomass for species
- * @param species
- * @return
+ * Return current biomass for species.
+ *
+ * @param species species
+ * @return species biomass
*/
public double getBiomass(Species species) {
double result = 0;
@@ -119,9 +120,10 @@
}
/**
- * Return current biomass for population
- * @param pop
- * @return
+ * Return current biomass for population.
+ *
+ * @param pop population
+ * @return population biomass
*/
public double getBiomass(Population pop) {
double result = 0;
@@ -140,9 +142,10 @@
}
/**
- * Return current numbers for population
- * @param pop
- * @return
+ * Return current numbers for population.
+ *
+ * @param pop population
+ * @return population numbers
*/
public MatrixND getN(Population pop) {
MatrixND result = Ns.get(pop);
@@ -162,7 +165,9 @@
}
/**
- * @return Returns the reproduction.
+ * Return reproduction.
+ *
+ * @return the reproduction.
*/
public MatrixND getReproduction(Date date, Population pop) {
return this.reproductions.get(pop).get(date);
@@ -203,14 +208,15 @@
}
/**
- * @todo les reproductions qui sont trop veille pour encore servir
+ *
+ * TODO les reproductions qui sont trop veille pour encore servir
* doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru
* Une autre facon de faire est de supprimer les repro == 0 car normalement
* toute la repro doit etre utilisé au bout d'un certain temps
*
* @param date
* @param pop
- * @return
+ * @return population recruitment
*/
public MatrixND getRecruitment(Date date, Population pop) {
MatrixND matEtalement = pop.getRecruitmentDistribution();
@@ -306,6 +312,7 @@
}
/**
+ * @param pop population
* @param catchPerStrategyMet
*/
public void holdCatch(Population pop, MatrixND catchPerStrategyMet) {
@@ -327,8 +334,10 @@
}
/**
- * @param pop
- * @return
+ * Get population catch.
+ *
+ * @param pop population
+ * @return population catch
*/
public MatrixND getCatch(Population pop) {
MatrixND result = catchs.get(pop);
@@ -336,8 +345,10 @@
}
/**
- * @param pop
- * @return
+ * Get population hold catch.
+ *
+ * @param pop population
+ * @return population hold catch
*/
public MatrixND getHoldCatch(Population pop) {
MatrixND result = holdCatchs.get(pop);
@@ -345,8 +356,10 @@
}
/**
- * @param pop
- * @return
+ * Population total hold catch.
+ *
+ * @param pop population
+ * @return population total hold catch
*/
public double getTotalHoldCatch(Population pop) {
double result = totalHoldCatch;
@@ -354,7 +367,7 @@
}
/**
- * raz capture cumulée de toutes les pops
+ * RAZ capture cumulée de toutes les pops.
*/
public void clearCatch() {
catchs.clear();
@@ -392,7 +405,7 @@
discards.get(pop).put(date, tmp);
}
}
-
+
/**
* FIXME: discards n'est jamais vider, on le conserve pour toutes les annees
* il serait bon de faire un peu le menage de temps en temps.
@@ -413,6 +426,4 @@
}
}
}
-
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -1109,7 +1109,7 @@
/**
* Get remote directory absolute path.
*
- * Don't use {@link File.separator} here, caparmor is always unix.
+ * Don't use {@link java.io.File.separator} here, caparmor is always unix.
*
* @return remote temp directory path
*/
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -232,8 +232,9 @@
}
/**
- * Retourne la liste de tous les {@link SimulatorLauncher} disponible
- * @return
+ * Retourne la liste de tous les {@link SimulatorLauncher} disponible.
+ *
+ * @return {@link SimulatorLauncher}s
*/
protected Set<SimulatorLauncher> getSimulatorLaunchers() {
return executors.keySet();
Modified: isis-fish/trunk/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-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/package-info.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -37,9 +37,9 @@
*
* <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
+ * Les simulations sont soumises au {@link fr.ifremer.isisfish.simulator.launcher.SimulationService} via sa methode
+ * submit. Un objet {@link fr.ifremer.isisfish.simulator.launcher.SimulationJob} est alors cree et ajoute a la liste
+ * des simulations presentes ({@link fr.ifremer.isisfish.simulator.launcher.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
@@ -52,8 +52,9 @@
*
* <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.
+ * fr.ifremer.isisfish.simulator.launcher.SimulationServiceListener#simulationStart(SimulationService, SimulationJob)},
+ * la simulation est alors ajoutee a la liste des simulations visibles si elle
+ * ne l'etait pas encore.
* </p>
*
* <p>
@@ -62,60 +63,65 @@
* </p>
*
* <p>
- * Le {@link SimulationService#autoLaunch} permet d'indique si le service est
+ * Le {@link fr.ifremer.isisfish.simulator.launcher.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
+ * {@link fr.ifremer.isisfish.simulator.launcher.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}
+ * Lors de sa creation le {@link fr.ifremer.isisfish.simulator.launcher.SimulationService} a initialise different
+ * {@link fr.ifremer.isisfish.simulator.launcher.SimulationExecutor} en fonction de la configuration. Ces {@link
+ * fr.ifremer.isisfish.simulator.launcher.SimulationExecutor} sont responsable de l'execution des simulations de la
+ * queue. Chaque {@link fr.ifremer.isisfish.simulator.launcher.SimulationExecutor} a un
+ * {@link fr.ifremer.isisfish.simulator.launcher.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
+ * Un {@link fr.ifremer.isisfish.simulator.launcher.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 fr.ifremer.isisfish.simulator.launcher.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
+ * <p>Si un {@link fr.ifremer.isisfish.simulator.launcher.SimulationExecutor}
+ * prend un job ayant deja un {@link fr.ifremer.isisfish.simulator.launcher.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 fr.ifremer.isisfish.simulator.launcher.SimulationService}
+ * jusqu'a ce que le bon {@link fr.ifremer.isisfish.simulator.launcher.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.
+ * consommation CPU si le seul {@link fr.ifremer.isisfish.simulator.launcher.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.
+ * fr.ifremer.isisfish.simulator.launcher.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.
+ * Si le job n'arrive pas a utilise le {@link fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher}
+ * il en notifie le {@link fr.ifremer.isisfish.simulator.launcher.SimulationService}
+ * qui resoumet le job dans la queue pour qu'un autre {@link fr.ifremer.isisfish.simulator.launcher.SimulationExecutor}
+ * prenne ce job. Si trop d'erreurs sont notifiees pour un meme {@link fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher},
+ * le {@link fr.ifremer.isisfish.simulator.launcher.SimulationService} 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.
+ * fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher} particulier en cas
+ * de notification d'erreur au {@link fr.ifremer.isisfish.simulator.launcher.SimulationService}
+ * ce {@link fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher} n'est plus pris en compte et
+ * n'importe quel {@link fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher} peut faire cette simulation.
* </p>
*/
package fr.ifremer.isisfish.simulator.launcher;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -375,7 +375,7 @@
/**
* Clear specified directory.
*
- * @param session opened session
+ * @param path path to clear
*/
protected void clearFolder(String path) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptAction.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -508,9 +508,7 @@
}
/**
- * Save script, and disply commit UI.
- *
- * @return
+ * Save script, and display commit UI.
*/
public void commitScript() {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/model/ScriptTreeModel.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/model/ScriptTreeModel.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/script/model/ScriptTreeModel.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -183,7 +183,7 @@
/**
* Filter input file array and return only sorted collection with only directories.
*
- * @param files file array
+ * @param filesArray file array
* @return sorted list
*/
protected List<File> getVersionnableSortedFiles(File[] filesArray) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EditorHelper.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -292,7 +292,7 @@
*
* @param component component
* @param entity entity
- * @return
+ * @return bound editor
*/
protected static JTextField getNewBoundEditor(JComponent component, TopiaEntity entity) {
String fieldName = getMethod(component);
@@ -379,6 +379,10 @@
public static JComponent getEditorWithValue(JComponent component, Object value) {
JComponent result = null;
+ if (log.isDebugEnabled()) {
+ log.debug("Get editor for " + component + " with value = " + value);
+ }
+
try {
result = component.getClass().newInstance();
@@ -688,7 +692,7 @@
*
* @param entity
* @param fieldName
- * @return
+ * @return method return value
*/
protected static Object getMethodValue(TopiaEntity entity, String fieldName) {
Object result = null;
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/EquationContinuousPanelUI.jaxx 2009-12-07 15:46:49 UTC (rev 2805)
@@ -220,7 +220,7 @@
}
});
}
-protected void add(){
+protected void add() {
EquationContinuousDomain domain = new EquationContinuousDomain();
// fixe NPE in table model renderer
domain.setCoefficient(1.0);
@@ -228,7 +228,7 @@
newButton();
setTable();
}
-protected void remove(){
+protected void remove() {
int i = params.getSelectedRow();
if (i != -1){
datas.remove(i);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/sensitivity/FactorWizardUI.jaxx 2009-12-07 15:46:49 UTC (rev 2805)
@@ -26,7 +26,7 @@
<Boolean id='existingValue' javaBean='false'/>
- <script><![CDATA[
+ <script><![CDATA[
import org.apache.commons.lang.StringUtils;
import org.nuiton.topia.persistence.TopiaEntity;
import fr.ifremer.isisfish.ui.simulator.SimulAction;
@@ -228,7 +228,7 @@
</cell>
</row>
<row>
- <cell fill='both' columns='4' weightx='1' weighty='0.5'>
+ <cell columns='4' fill='both' weightx='1' weighty='0.5'>
<JPanel id='continuousPanelContainer' layout='{new BorderLayout()}'/>
</cell>
</row>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterTableCellEditor.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterTableCellEditor.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/ParameterTableCellEditor.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -224,12 +224,12 @@
/**
* Get type for value.
*
- * Must be overriden (value can be null).
+ * Must be overridden (value can be null).
*
* @param value
* @param row
* @param column
- * @return
+ * @return type for value
*/
protected Class<?> getType(Object value, int row, int column) {
// default to value's class
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/SSHUtils.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/SSHUtils.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/SSHUtils.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -508,8 +508,9 @@
* Open sftp channel.
*
* @param session
- * @return
+ * @return sftp channel
* @throws JSchException
+ * @see ChannelSftp
*/
protected static ChannelSftp openSftpChannel(Session session) throws JSchException {
ChannelSftp channel = (ChannelSftp) session.openChannel("sftp");
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/package-info.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/package-info.java 2009-12-07 15:46:13 UTC (rev 2804)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/util/ssh/package-info.java 2009-12-07 15:46:49 UTC (rev 2805)
@@ -1,5 +1,5 @@
/**
- * Utility classes for {@link SSHSimulatorLauncher}.
+ * Utility classes for {@link fr.ifremer.isisfish.simulator.launcher.SSHSimulatorLauncher}.
*
* Contains :
* - SSH utility code
1
0
r2804 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/datastore/migration resources/i18n
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
07 Dec '09
Author: chatellier
Date: 2009-12-07 15:46:13 +0000 (Mon, 07 Dec 2009)
New Revision: 2804
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Add translation for database migration
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2009-12-07 11:12:57 UTC (rev 2803)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2009-12-07 15:46:13 UTC (rev 2804)
@@ -18,6 +18,8 @@
package fr.ifremer.isisfish.datastore.migration;
+import static org.nuiton.i18n.I18n._;
+
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
@@ -53,11 +55,9 @@
String dbVersion, String applicationVersion) {
int answer = JOptionPane.showConfirmDialog(
- null, "La base de donn\u00E9e est en version : " + dbVersion
- + ".\n\nUne migration en version " + applicationVersion
- + " est n\u00E9c\u00E9ssaire.\nVoulez vous migrer la base de donn\u00E9es ?",
- "Migration de base de donn\u00E9es",
- JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+ null, _("isisfish.misc.databasemigration.question", dbVersion, applicationVersion),
+ _("isisfish.misc.databasemigration.title"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
MigrationChoice result = (answer == JOptionPane.YES_OPTION) ? MigrationChoice.MIGRATION
: MigrationChoice.NO_MIGRATION;
@@ -71,10 +71,10 @@
/**
* Perform real migration.
*
- * @param dbManager
- * @param dbVersion
- * @param applicationVersion
- * @return
+ * @param dbManager database manager
+ * @param dbVersion database version
+ * @param applicationVersion application version
+ * @return {@code MigrationChoice.CUSTOM_MIGRATION} if success, {@code MigrationChoice.NO_MIGRATION} otherwise.
*/
protected MigrationChoice migrate(DatabaseManager dbManager,
String dbVersion, String applicationVersion) {
@@ -118,7 +118,10 @@
}
protected void migrateTo3_2(Connection conn) throws SQLException {
- log.info("Migrate to version 3.2");
+ if (log.isInfoEnabled()) {
+ log.info("Migrate to version 3.2");
+ }
+
//alteration du schema
// nouvelles equations dans les tables
@@ -137,9 +140,9 @@
}
protected void migrateTo3_3(Connection conn) throws SQLException {
- log.info("Migrate to version 3.3");
- //alteration du schema
- // nouvelles equations dans les tables
+ if (log.isInfoEnabled()) {
+ log.info("Migrate to version 3.3");
+ }
String[] sqls = new String[] {
// replace in equation
@@ -157,7 +160,6 @@
"update STRATEGYMONTHINFO set proportionMetier_semantics = replace(proportionMetier_semantics, 'org.codelutin.', 'org.nuiton.') where proportionMetier_semantics IS NOT null;",
// add .shp default extension
"update FISHERYREGION set MAPFILES = regexp_replace(MAPFILES, '(,|$)', '.shp$1') where MAPFILES IS NOT null;"
-
};
for (String sql : sqls) {
log.info("try " + sql);
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-12-07 11:12:57 UTC (rev 2803)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-12-07 15:46:13 UTC (rev 2804)
@@ -641,6 +641,8 @@
isisfish.metierSeasonInfoZone.season=Season
isisfish.metierSeasonInfoZone.selectSeason=Select a season
isisfish.metierSeasonInfoZone.title=Seasons / Zones
+isisfish.misc.databasemigration.question=La base de donn\u00E9e est en version \: %s.\n\nUne migration en version %s est n\u00E9c\u00E9ssaire.\nVoulez vous migrer la base de donn\u00E9es ?
+isisfish.misc.databasemigration.title=Database migration
isisfish.misc.nuitonmigration=IsisFish has detected some code based on CodeLutin libraries in following user scripts.\nDo you want to migrate those script on new nuiton libraries ?
isisfish.monitor.title=Application Monitor
isisfish.month.april=april
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-12-07 11:12:57 UTC (rev 2803)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-12-07 15:46:13 UTC (rev 2804)
@@ -641,6 +641,8 @@
isisfish.metierSeasonInfoZone.season=Saison
isisfish.metierSeasonInfoZone.selectSeason=S\u00E9lectionnez une saison
isisfish.metierSeasonInfoZone.title=Saison / Zones
+isisfish.misc.databasemigration.question=La base de donn\u00E9e est en version \: %s.\n\nUne migration en version %s est n\u00E9cessaire.\nVoulez vous migrer la base de donn\u00E9es ?
+isisfish.misc.databasemigration.title=Migration de base de donn\u00E9es
isisfish.misc.nuitonmigration=IsisFish a d\u00E9tect\u00E9 l'utilisation de librairies CodeLutin dans les scripts suivants.\nVoulez vous migrer ces scripts vers les nouvelles librairies nuiton ?
isisfish.monitor.title=Moniteur de l'application
isisfish.month.april=avril
1
0
r2803 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/simulator/launcher java/fr/ifremer/isisfish/ui/config resources/i18n
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
by chatellier@users.labs.libre-entreprise.org 07 Dec '09
07 Dec '09
Author: chatellier
Date: 2009-12-07 11:12:57 +0000 (Mon, 07 Dec 2009)
New Revision: 2803
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigUI.jaxx
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Suppression des fichiers de simulations apres un t?\195?\169l?\195?\169chargement r?\195?\169ussi des r?\195?\169sultats.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-07 08:37:23 UTC (rev 2802)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-12-07 11:12:57 UTC (rev 2803)
@@ -74,14 +74,13 @@
* - $ISIS-TMP/simulation-$id-output.txt
* - $ISIS-TMP/simulation-$id-pbs.id
*
- * TODO revome all $ISIS-TMP/simulation-$id* after simulation end ?
- *
* @see JSch
*
* @author chatellier
* @version $Revision$
*
- * Last update : $Date$ By : $Author$
+ * Last update : $Date$
+ * By : $Author$
*/
public class SSHSimulatorLauncher implements SimulatorLauncher {
@@ -297,16 +296,22 @@
*
* Se connecte au serveur distant et télécharge les résultats de la
* simulation.
+ *
+ * Simulation must have been downloaded with
+ * {@link #updateControl(SimulationService, SimulationControl)} before calling
+ * this method.
*/
@Override
public SimulationStorage getSimulationStorage(
SimulationService simulationService, SimulationControl control)
throws RemoteException {
- // TODO change, now getSimulationStorage()
- // is common to all launchers
+ // make sure that simulation has been downloaded by #updateControl()
+ // before calling this method
+ String simulationId = control.getId();
+
SimulationStorage simulationStorage = SimulationStorage
- .getSimulation(control.getId());
+ .getSimulation(simulationId);
return simulationStorage;
}
@@ -316,6 +321,11 @@
*
* Se connecte au serveur distant et télécharge le fichier de control.
* Injecte ensuite ce fichier dans le {@link SimulationControl}.
+ *
+ * Essaye aussi de telecharger le fichier md5 de la simulation, et, s'il
+ * est present, l'archive de résultat.
+ * Supprime tous les fichiers de la simulations apres avoir télécharger les
+ * résultats.
*/
@Override
public void updateControl(SimulationService simulationService,
@@ -334,7 +344,7 @@
// CONTROL file
try {
// download control file
- File controlFile = downloadControlFile(sshSession, control.getId(),
+ File controlFile = downloadSimulationFile(sshSession, control.getId(),
SimulationStorage.CONTROL_FILENAME);
if (log.isDebugEnabled()) {
log.debug("Control have been downloaded : "
@@ -357,8 +367,7 @@
// file doesn't exist
if (log.isDebugEnabled()) {
// not add ,e plz :)
- log.debug(_("Remote control file doesn't exists %s", e
- .getMessage()));
+ log.debug(_("Remote control file doesn't exists %s", e.getMessage()));
}
}
@@ -383,10 +392,6 @@
if (resultArchiveFile != null) {
- // FIXME too slow methods
- //SimulationStorage.importZip(resultZipFile);
- //ZipUtil.uncompress(resultArchiveFile, SimulationStorage.getSimulationDirectory());
-
// FIXME big hacks here, only extract non first simulation
// only for AS
if (control.getId().startsWith("as_") && !control.getId().endsWith("_0")) {
@@ -400,14 +405,16 @@
log.debug("Simulation imported : " + resultArchiveFile.getAbsolutePath());
}
+ resultArchiveFile.delete();
+
+ // clear all simulation input/output files on remote
+ // server temp directory
+ clearSimulationFiles(sshSession, control);
+
// read control from downloaded simulation
synchronized (control) {
SimulationStorage.readControl(control.getId(), control, "stop");
}
-
- resultArchiveFile.delete();
-
- // TODO remove remote md5 and zip on remote
}
else {
if (log.isWarnEnabled()) {
@@ -427,7 +434,7 @@
// INFORMATION file
try {
- File infoFile = downloadControlFile(sshSession, control.getId(),
+ File infoFile = downloadSimulationFile(sshSession, control.getId(),
SimulationStorage.INFORMATION_FILENAME);
if (log.isDebugEnabled()) {
log.debug("Information have been downloaded : "
@@ -488,23 +495,6 @@
}
/**
- * Get opened ssh session or try to open a new one.
- *
- * This method must synchronized.
- *
- * @return opened ssh session.
- * @throws JSchException
- */
- protected synchronized Session getSSHSftpSession() throws JSchException {
-
- if (sshSftpSession == null || !sshSftpSession.isConnected()) {
- sshSftpSession = openSSHSession();
- }
-
- return sshSftpSession;
- }
-
- /**
* Connect to remote server throw SSH, and return session.
*
* @return valid opened session
@@ -742,7 +732,7 @@
* @throws IOException
* @throws SSHException if remote file doesn't exists
*/
- protected File downloadControlFile(Session sshSession, String simulationId, String fileName)
+ protected File downloadSimulationFile(Session sshSession, String simulationId, String fileName)
throws IOException, SSHException {
File localFile = null;
@@ -800,6 +790,32 @@
}
/**
+ * Remove all {@code $ISIS-TMP/simulation-$id-*} files on caparmor.
+ *
+ * @param session valid opened ssh session
+ * @param control simulation control
+ */
+ protected void clearSimulationFiles(Session session,
+ SimulationControl control) throws IOException, SSHException {
+
+ control.setText(_("isisfish.simulation.remote.message.deletingfiles"));
+
+ // execute rm -f "isis-tmp/simulation-$id-"*
+ // on remote. Note * outside quotes !!!
+ String simulationId = control.getId();
+ String command = "rm -f \"" + getRemoteTempDirectory() + "simulation-" + simulationId + "-\"*";
+
+ if (log.isDebugEnabled()) {
+ log.debug("Deleting simulation files with command : " + command);
+ }
+
+ SSHUtils.exec(session, command);
+
+ // can return other things than 0
+ // but not a big deal
+ }
+
+ /**
* Upload script on remote server.
*
* @param session valid opened ssh session
@@ -1093,7 +1109,7 @@
/**
* Get remote directory absolute path.
*
- * Don't use File.separator here, caparmor is always unix.
+ * Don't use {@link File.separator} here, caparmor is always unix.
*
* @return remote temp directory path
*/
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java 2009-12-07 08:37:23 UTC (rev 2802)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigAction.java 2009-12-07 11:12:57 UTC (rev 2803)
@@ -63,7 +63,7 @@
protected SSHLauncherConfigUI configUI;
protected String currentSSHserver;
- protected String currentSSHsftpServer;
+ //protected String currentSSHsftpServer;
protected String currentSSHUsername;
protected File currentSSHKey;
protected String currentSSHUserhome;
@@ -89,7 +89,7 @@
public void resetSSHConfiguration() {
// server config
configUI.getSshServerField().setText(IsisFish.config.getSimulatorSshServer());
- configUI.getSshSftpServerField().setText(IsisFish.config.getSimulatorSshSftpServer());
+ //configUI.getSshSftpServerField().setText(IsisFish.config.getSimulatorSshSftpServer());
configUI.getUsernameField().setText(IsisFish.config.getSimulatorSshUsername());
configUI.getSshKeyField().setText(IsisFish.config.getSSHPrivateKeyFilePath().getAbsolutePath());
@@ -133,8 +133,8 @@
}
// copy values
- currentSSHsftpServer = configUI.getSshSftpServerField().getText()
- .trim();
+ //currentSSHsftpServer = configUI.getSshSftpServerField().getText().trim();
+
// can be empty (optionnal use)
currentSSHUsername = configUI.getUsernameField().getText().trim();
if (!currentSSHUsername.matches("\\w+")) {
@@ -205,7 +205,7 @@
*/
public void saveSSHConfiguration() {
IsisFish.config.setSimulatorSshServer(currentSSHserver);
- IsisFish.config.setSimulatorSshSftpServer(currentSSHsftpServer);
+ //IsisFish.config.setSimulatorSshSftpServer(currentSSHsftpServer);
IsisFish.config.setSimulatorSshUsername(currentSSHUsername);
IsisFish.config.setSSHPrivateKeyFilePath(currentSSHKey);
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigUI.jaxx 2009-12-07 08:37:23 UTC (rev 2802)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/config/SSHLauncherConfigUI.jaxx 2009-12-07 11:12:57 UTC (rev 2803)
@@ -40,7 +40,7 @@
onKeyReleased="getAction().doCheck()" />
</cell>
</row>
- <row>
+ <!-- <row>
<cell>
<JLabel id='sshSftpServerLabel' text='isisfish.config.main.simulation.ssh.sftpserver'
toolTipText='isisfish.config.main.simulation.ssh.sftpserver.description' />
@@ -49,7 +49,7 @@
<JTextField id='sshSftpServerField' toolTipText='isisfish.config.main.simulation.ssh.sftpserver.description'
onKeyReleased="getAction().doCheck()" enabled="false" />
</cell>
- </row>
+ </row> -->
<row fill='horizontal'>
<cell>
<JLabel id='usernameLabel' text='isisfish.config.main.simulation.ssh.username'
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-12-07 08:37:23 UTC (rev 2802)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-12-07 11:12:57 UTC (rev 2803)
@@ -178,7 +178,6 @@
isisfish.config.main.simulation.ssh.pbsbinpath.description=PBS executables (qsub, qdel...) directory
isisfish.config.main.simulation.ssh.server=Simulation server
isisfish.config.main.simulation.ssh.server.description=Simulation server address
-isisfish.config.main.simulation.ssh.sftpserver=Transfer server
isisfish.config.main.simulation.ssh.sftpserver.description=Transfer server address (set empty to use scp from simulation server)
isisfish.config.main.simulation.ssh.tmppath=Server temp directory
isisfish.config.main.simulation.ssh.tmppath.description=Server temp directory
@@ -920,6 +919,7 @@
isisfish.simulation.menu.simulation=Simulation
isisfish.simulation.name=Simulation name
isisfish.simulation.remote.message.connection=Connecting to Caparmor
+isisfish.simulation.remote.message.deletingfiles=Deleting simulation files
isisfish.simulation.remote.message.downloadresults=Downloading results
isisfish.simulation.remote.message.upload=Uploading simulation
isisfish.simulation.remote.message.waitingstart=Waiting for simulation start
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-12-07 08:37:23 UTC (rev 2802)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-12-07 11:12:57 UTC (rev 2803)
@@ -178,7 +178,6 @@
isisfish.config.main.simulation.ssh.pbsbinpath.description=Emplacement des commandes PBS (qsub, qdel...) sur le serveur
isisfish.config.main.simulation.ssh.server=Serveur de simulation
isisfish.config.main.simulation.ssh.server.description=Adresse du serveur de simulation
-isisfish.config.main.simulation.ssh.sftpserver=Serveur de fichier
isisfish.config.main.simulation.ssh.sftpserver.description=Adresse du serveur de transfert de fichier (laisser vide pour utiliser directement scp sur le serveur de simulation)
isisfish.config.main.simulation.ssh.tmppath=Dossier temporaire
isisfish.config.main.simulation.ssh.tmppath.description=Emplacement du dossier temporaire
@@ -920,6 +919,7 @@
isisfish.simulation.menu.simulation=Simulation
isisfish.simulation.name=Nom de la simulation
isisfish.simulation.remote.message.connection=Connexion \u00E0 Caparmor
+isisfish.simulation.remote.message.deletingfiles=Suppression des fichiers de simulation
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
1
0
Author: chatellier
Date: 2009-12-07 08:37:23 +0000 (Mon, 07 Dec 2009)
New Revision: 2802
Modified:
isis-fish/trunk/pom.xml
Log:
Update h2
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-12-07 08:37:11 UTC (rev 2801)
+++ isis-fish/trunk/pom.xml 2009-12-07 08:37:23 UTC (rev 2802)
@@ -215,7 +215,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <version>1.2.124</version>
+ <version>1.2.125</version>
<scope>compile</scope>
</dependency>
1
0