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
- 3175 discussions
r1679 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs
by chatellier@users.labs.libre-entreprise.org 17 Dec '08
by chatellier@users.labs.libre-entreprise.org 17 Dec '08
17 Dec '08
Author: chatellier
Date: 2008-12-17 17:18:41 +0000 (Wed, 17 Dec 2008)
New Revision: 1679
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
Log:
Update cvs svn, return conflit file on switch
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java 2008-12-17 13:40:51 UTC (rev 1678)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCS.java 2008-12-17 17:18:41 UTC (rev 1679)
@@ -338,9 +338,10 @@
* trunk.
* @param version version to go, if null trunk is used, otherwize
* tags/version is used
+ * @return a list of all file in conflict
* @throws VCSException
*/
- void setTag(VersionNumber version) throws VCSException;
+ List<File> setTag(VersionNumber version) throws VCSException;
/**
* Change host.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java 2008-12-17 13:40:51 UTC (rev 1678)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSNone.java 2008-12-17 17:18:41 UTC (rev 1679)
@@ -196,8 +196,9 @@
return false;
}
- public void setTag(VersionNumber version) throws VCSException {
+ public List<File> setTag(VersionNumber version) throws VCSException {
// do nothing
+ return null;
}
public String getTag() throws VCSException {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2008-12-17 13:40:51 UTC (rev 1678)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2008-12-17 17:18:41 UTC (rev 1679)
@@ -1,4 +1,4 @@
-/* *##% IsisFish
+/* *##% GeSi
* Copyright (C) 2008 CodeLutin
*
* This program is free software: you can redistribute it and/or modify
@@ -165,15 +165,15 @@
getSVNManager().getWCClient().doGetProperty(url, "",
SVNRevision.HEAD, SVNRevision.HEAD);
connectionState = ConnectionState.ON_LINE;
-
- if (log.isInfoEnabled()) {
+
+ if(log.isInfoEnabled()) {
log.info(_("isisfish.vcs.vcssvn.isconnected.switchto",
- getRemoteRepository()));
+ getRemoteRepository()));
}
} catch (SVNException eee) {
- if (log.isWarnEnabled()) {
+ if(log.isWarnEnabled()) {
log.warn(_("isisfish.vcs.vcssvn.isconnected.switchoff",
- getRemoteRepository()));
+ getRemoteRepository()));
}
connectionState = ConnectionState.OFF_LINE;
}
@@ -191,41 +191,39 @@
*/
@Override
public void checkProtocol() throws VCSException {
-
+
// on doit verifier ici que seul le protocole a change
// le doRelocate de svn, ne permet de ne change que
// le protocol ou host par exemple
// dans le cas d'un changement de path, le do relocate
// echoue (operation non permise)
-
+
try {
// test que les protocoles, userInfo, host, port sont egaux.
-
+
// copies locales
File localRoot = getLocalRepository();
SVNInfo info = getSVNManager().getWCClient().doInfo(localRoot,
SVNRevision.WORKING);
SVNURL url = info.getURL();
-
+
// url distante (suposée)
SVNURL newUrl = getRemoteURL();
-
+
// hack just for doRelocate to work
newUrl = newUrl.setPath(url.getPath(), false);
-
+
if (!url.getProtocol().equals(newUrl.getProtocol()) // http, svn ...
- || (url.getUserInfo() == null && newUrl.getUserInfo() != url
- .getUserInfo()) // username
- || (url.getUserInfo() != null && !url.getUserInfo().equals(
- newUrl.getUserInfo())) // username
+ || (url.getUserInfo() == null && newUrl.getUserInfo() != url.getUserInfo()) // username
+ || (url.getUserInfo() != null && !url.getUserInfo().equals(newUrl.getUserInfo())) // username
|| url.getPort() != newUrl.getPort() // 80
|| !url.getHost().equals(newUrl.getHost())) {
if (fireAction(VCSActionEvent.SWITCH_PROTOCOL)) {
- if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.checkProtocol.relocate",
- localRoot, url, newUrl));
+ if(log.isInfoEnabled()) {
+ log.info(_("isisfish.vcs.vcssvn.checkProtocol.relocate", localRoot,
+ url, newUrl));
}
-
+
// le relocate de SVNKit
// ne supporte que le changement de protocole/host/port
// pas le path
@@ -234,7 +232,8 @@
}
}
} catch (SVNException e) {
- throw new VCSException(_("isisfish.vcs.vcssvn.checkProtocol.error"), e);
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.checkProtocol.error"), e);
}
}
@@ -346,7 +345,8 @@
// if can't commit
if (!isWriteable()) {
- throw new VCSException(_("isisfish.vcs.vcssvn.commit.errorreadonly"));
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.commit.errorreadonly"));
}
// list to array
@@ -390,8 +390,7 @@
SVNDepth.INFINITY); // depth
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision", commitInfo
- .getNewRevision()));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", commitInfo.getNewRevision()));
}
} catch (SVNException e) {
throw new VCSException(_("isisfish.vcs.vcssvn.commit.error"), e);
@@ -400,7 +399,8 @@
public void add(List<File> files, String msg) throws VCSException {
if (!isWriteable()) {
- throw new VCSException(_("isisfish.vcs.vcssvn.add.errorreadonly"));
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.add.errorreadonly"));
}
try {
if (fireAction(VCSActionEvent.ADD, files.toArray(new File[files
@@ -463,9 +463,7 @@
true); // boolean allowUnversionedObstructions
if (log.isInfoEnabled()) {
- log
- .info(_("isisfish.vcs.vcssvn.global.torevision",
- newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
}
}
} catch (SVNException eee) {
@@ -475,7 +473,8 @@
public void delete(List<File> files, String msg) throws VCSException {
if (!isWriteable()) {
- throw new VCSException(_("isisfish.vcs.vcssvn.delete.errorreadonly"));
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.delete.errorreadonly"));
}
try {
if (fireAction(VCSActionEvent.DELETE, files.toArray(new File[files
@@ -639,7 +638,7 @@
public Map<File, String> getChanglog(List<File> files) throws VCSException {
throw new UnsupportedOperationException("Not supported yet.");
-
+
/*final Map<File, String> changLog = new HashMap<File, String>();
try {
@@ -649,7 +648,7 @@
// Handler
ISVNLogEntryHandler handler = new ISVNLogEntryHandler() {
-
+
@Override
public void handleLogEntry(SVNLogEntry logEntry)
throws SVNException {
@@ -795,8 +794,8 @@
// log
if (log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.global.filestatus", status
- .getFile().getAbsolutePath(), status
+ log.debug(_("isisfish.vcs.vcssvn.global.filestatus", status.getFile()
+ .getAbsolutePath(), status
.getRemoteContentsStatus().toString()));
}
@@ -805,9 +804,8 @@
// log
if (log.isDebugEnabled()) {
- log.debug(_(
- "isisfish.vcs.vcssvn.global.foundUpdatedFile",
- status.getFile().getAbsolutePath()));
+ log.debug(_("isisfish.vcs.vcssvn.global.foundUpdatedFile", status
+ .getFile().getAbsolutePath()));
}
result.add(status.getFile());
@@ -839,13 +837,13 @@
* @throws VCSException
*/
public boolean haveUpdate() throws VCSException {
-
+
// c'est juste si la liste renvoyé par getUpdatedFile() n'est pas vide ?
List<File> updatedFiles = getUpdatedFile();
-
+
boolean result = false;
-
- if (updatedFiles != null && !updatedFiles.isEmpty()) {
+
+ if(updatedFiles != null && !updatedFiles.isEmpty()) {
result = true;
}
return result;
@@ -859,35 +857,29 @@
* @throws VCSException
*/
public boolean isOnRemote(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient
- .doStatus(localFile, true /*remote*/);
-
+ SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
+
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
- if (log.isDebugEnabled()) {
- log
- .debug(_(
- "isisfish.vcs.vcssvn.global.filelocalandremotestatus",
- localFile.getAbsolutePath(), localStatus,
- remoteStatus));
+
+ if(log.isDebugEnabled()) {
+ log.debug(_("isisfish.vcs.vcssvn.global.filelocalandremotestatus",localFile.getAbsolutePath(),localStatus, remoteStatus));
}
-
+
// don't return true if:
// - file is locally added
// - file is remotely deleted
- if (!localStatus.equals(SVNStatusType.STATUS_ADDED)
- && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
+ if(!localStatus.equals(SVNStatusType.STATUS_ADDED) && !remoteStatus.equals(SVNStatusType.STATUS_DELETED)) {
result = true;
}
@@ -895,12 +887,11 @@
// catch exception
// if exception, file doesn't exists on server
// result is still 'false'
- if (log.isDebugEnabled()) {
- log.debug(_("isisfish.vcs.vcssvn.isonremote.error", localFile
- .getAbsolutePath()), e);
+ if(log.isDebugEnabled()) {
+ log.debug(_("isisfish.vcs.vcssvn.isonremote.error",localFile.getAbsolutePath()),e);
}
}
-
+
return result;
}
@@ -913,33 +904,31 @@
*/
@Override
public boolean isUpToDate(File file) throws VCSException {
-
+
File localFile = file;
if (localFile == null) {
localFile = getLocalRepository();
}
-
+
boolean result = false;
-
+
try {
SVNStatusClient statusClient = getSVNManager().getStatusClient();
- SVNStatus status = statusClient
- .doStatus(localFile, true /*remote*/);
+ SVNStatus status = statusClient.doStatus(localFile, true /*remote*/);
SVNStatusType localStatus = status.getContentsStatus();
SVNStatusType remoteStatus = status.getRemoteContentsStatus();
-
+
// TODO peut on dire que le fichier est à jour
// si le status local est normal et le distant est none
- if (localStatus == SVNStatusType.STATUS_NORMAL
- && remoteStatus == SVNStatusType.STATUS_NONE) {
+ if (localStatus == SVNStatusType.STATUS_NORMAL && remoteStatus == SVNStatusType.STATUS_NONE) {
result = true;
}
} catch (SVNException eee) {
throw new VCSException(_("isisfish.vcs.vcssvn.isuptodate.error"), eee);
}
-
+
return result;
}
@@ -956,7 +945,8 @@
localFile = getLocalRepository();
}
if (!accept(localFile)) {
- throw new VCSException(_("isisfish.vcs.vcssvn.update.notinlocal"));
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.update.notinlocal"));
}
if (fireAction(VCSActionEvent.UPDATE, localFile)) {
// si le repertoire pere, n'est pas encore dans le repo local
@@ -976,8 +966,7 @@
false); // boolean depthIsSticky
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision",
- newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
}
// recherche de tous les fichiers locaux en conflit
@@ -1070,7 +1059,8 @@
}
return result;
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.gettag.error"), eee);
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.gettag.error"), eee);
}
}
@@ -1078,8 +1068,12 @@
* @see org.codelutin.isisfish.vcs.VCS#setTag(org.codelutin.util.VersionNumber)
*/
@Override
- public void setTag(VersionNumber version) throws VCSException {
+ public List<File> setTag(VersionNumber version) throws VCSException {
+
+ List<File> filesInConflict = null;
+
try {
+
String tag = "/trunk";
if (version != null) {
tag = "/tags/" + version;
@@ -1115,14 +1109,35 @@
true);// boolean depthIsSticky
if (log.isInfoEnabled()) {
- log.info(_("isisfish.vcs.vcssvn.global.torevision",
- newRevision));
+ log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
}
+
+ // recherche de tous les fichiers locaux en conflit apres le switch
+ Map<File, SVNStatus> status = getLocalStatus(localRoot,
+ true, SVNStatusType.STATUS_CONFLICTED);
+ if (status.size() > 0) {
+ filesInConflict = new ArrayList<File>();
+ filesInConflict.addAll(status.keySet());
+ // on supprime les conflits pour pouvoir commiter convenablement
+ // les fichiers
+ //getSVNManager().getWCClient().doResolve(localFile, recurse);
+
+ // FIXME use conflit resolution choice ?
+ //SVNWCClient wcClient = getSVNManager().getWCClient();
+ //wcClient.doResolve(localFile, // File file
+ // recurse ? SVNDepth.INFINITY : SVNDepth.FILES, // depth
+ // SVNConflictChoice.MERGED); // ConflictChoice
+ }
}
}
+
+
} catch (SVNException eee) {
- throw new VCSException(_("isisfish.vcs.vcssvn.setTag.error"), eee);
+ throw new VCSException(
+ _("isisfish.vcs.vcssvn.setTag.error"), eee);
}
+
+ return filesInConflict;
}
}
\ No newline at end of file
1
0
r1678 - in isis-fish/trunk/src/main: java/fr/ifremer/isisfish/actions java/fr/ifremer/isisfish/datastore java/fr/ifremer/isisfish/simulator java/fr/ifremer/isisfish/simulator/launcher java/fr/ifremer/isisfish/ui/simulator resources resources/i18n
by chatellier@users.labs.libre-entreprise.org 17 Dec '08
by chatellier@users.labs.libre-entreprise.org 17 Dec '08
17 Dec '08
Author: chatellier
Date: 2008-12-17 13:40:51 +0000 (Wed, 17 Dec 2008)
New Revision: 1678
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/SimulationAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ScriptStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationInformation.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationJob.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/SimulationServiceTableModel.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/SubProcessSimulationLauncher.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.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
isis-fish/trunk/src/main/resources/log4j.properties
Log:
Corection du lancement des simulations par sous process
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/SimulationAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/SimulationAction.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/actions/SimulationAction.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -21,6 +21,13 @@
import static org.codelutin.i18n.I18n._;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import fr.ifremer.isisfish.IsisConfig;
import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.RegionStorage;
@@ -30,16 +37,11 @@
import fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher;
import fr.ifremer.isisfish.simulator.launcher.SimulationService;
import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
-import java.io.File;
-import java.io.FileInputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Properties;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import fr.ifremer.isisfish.types.Month;
/**
- *
+ * Action des simulations.
+ *
* @author poussin
* @version $Revision$
*
@@ -56,48 +58,66 @@
public SimulationAction(IsisConfig config) {
this.config = config;
}
-
- public static void simulateWithRegion(String simulId, File parameterFile, File region) throws Exception {
- Properties props = new Properties();
- FileInputStream inStream = new FileInputStream(parameterFile);
- props.load(inStream);
- inStream.close();
- SimulationParameter params = new SimulationParameter();
- params.fromProperties(SimulationStorage.getSimulationDirectory(), props);
+ /**
+ *
+ * @param simulId
+ * @param parameterFile
+ * @param region
+ * @throws Exception
+ */
+ public static void simulateWithRegion(String simulId, File parameterFile,
+ File region) throws Exception {
+ Properties props = new Properties();
+ FileInputStream inStream = new FileInputStream(parameterFile);
+ props.load(inStream);
+ inStream.close();
- // try to import region if needed
- String regionName = params.getRegionName();
- if (region != null) {
- if (!RegionStorage.exists(regionName)) {
- RegionStorage.importAndRenameZip(region, regionName);
- } else {
- log.warn(_("Region %s allready exist in repository. Cant import", regionName));
- }
+ SimulationParameter params = new SimulationParameter();
+ params.fromProperties(SimulationStorage.getSimulationDirectory(),
+ props);
+
+ // try to import region if needed
+ String regionName = params.getRegionName();
+ if (region != null) {
+ if (!RegionStorage.exists(regionName)) {
+ RegionStorage.importAndRenameZip(region, regionName);
+ } else {
+ log.warn(_(
+ "Region %s allready exist in repository. Can't import",
+ regionName));
}
+ }
- SimulationService.getService().submit(simulId, params, null, 0);
+ SimulationService.getService().submit(simulId, params, null, 0);
}
-
+
/**
*
* @param simulId id de simulation
- * @param zip Zip de la simulation
- * @param parameterFile parametre optionnel pour la simulation
+ * @param simulationZip Zip de la simulation
+ * @throws Exception
*/
- public static void simulateWithSimulation(String simulId, File simulationZip) throws Exception {
+ public static void simulateWithSimulation(String simulId, File simulationZip)
+ throws Exception {
log.info("id:" + simulId + ", zip:" + simulationZip);
String name = simulId; // ne pas mettre la date, car le sub process la met deja + " " + new SimpleDateFormat("yyyy-MM-dd-HH-mm").format(new Date());
+
+ SimulationControl control = new SimulationControl(name);
- SimulationControl control = new SimulationControl(name);
+ // pour forcer le fichier de control a être sauver
+ // pour ensuite être lu par le processus parent
+ control.setAutoSaveState(true);
+
// lancement de la simulation
SimulatorLauncher launcher = new InProcessSimulatorLauncher();
- SimulationStorage simulation = launcher.simulate(null, control, simulationZip);
+ SimulationStorage simulation = launcher.simulate(null, control,
+ simulationZip);
simulation.getStorage().closeContext();
+
// FIXME integrer ca dans le process normal d'init
IsisFish.quit();
}
-
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ScriptStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ScriptStorage.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/ScriptStorage.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -50,10 +50,8 @@
import java.util.Map;
/**
- *
- * Gestion des fichers CVS de type scripts (appratenant au module scripts).
+ * Gestion des fichers CVS de type scripts (appartenant au module scripts).
*/
-
public class ScriptStorage extends JavaSourceStorage implements Docable {
static final public String SCRIPT_PATH = "scripts";
@@ -207,7 +205,6 @@
* @see Docable
*/
public String getDescription() {
- throw new IsisFishRuntimeException(_("isisfish.error.not.support.class" +
- "Docable#getDescription() method %1$s",this));
+ throw new IsisFishRuntimeException(_("isisfish.error.not.support.class",this));
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationInformation.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationInformation.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationInformation.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -292,5 +292,3 @@
setInfo(OTHER_INFO, getInfomation() + value + "\n");
}
}
-
-
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -104,7 +104,7 @@
}
/**
- * Retourne le repertoire de base de stockage des simultions
+ * Retourne le repertoire de base de stockage des simulations
* @return
*/
static public File getSimulationDirectory() {
@@ -251,6 +251,11 @@
}
control.updateFromProperties(prop);
}
+ else {
+ if(log.isDebugEnabled()) {
+ log.debug("Control file '" + file.getAbsolutePath() + "'doesn't exists");
+ }
+ }
} catch (Exception eee) {
log.warn("Can't read control", eee);
}
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -31,17 +31,18 @@
package fr.ifremer.isisfish.simulator;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.Hashtable;
+import java.util.Map;
+import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
-import java.util.Properties;
/**
* Permit to communicate with user interface from simulation thread
@@ -67,10 +68,11 @@
protected int progress = 0;
protected String text = "";
- protected Hashtable<String, Object> update = new Hashtable<String, Object>();
+ protected Map<String, Object> update = new Hashtable<String, Object>();
/**
*
+ * @param id simulation id
*/
public SimulationControl(String id) {
this.id = id;
@@ -121,14 +123,15 @@
/**
* 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 running The running to set.
+ *
+ * @param started The running to set.
*/
public void setStarted(boolean started) {
boolean oldValue = this.started;
this.started = started;
listeners.firePropertyChange("started", oldValue, this.started);
}
-
+
/**
* Method running
*
@@ -208,11 +211,15 @@
public void setProgress(int progress) {
int oldValue = this.progress;
this.progress = 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
*/
public void setStopSimulationRequest(boolean val){
boolean oldValue = this.stop;
@@ -261,7 +268,7 @@
* that contains last modified field
* @return
*/
- public Hashtable getUpdateHashtable() {
+ public Hashtable<String, Object> getUpdateHashtable() {
Hashtable<String, Object> result = new Hashtable<String, Object>(update);
update.clear();
@@ -290,37 +297,46 @@
/**
* update current object from Properties representation
- *
+ *
+ * @param props new properties to update from
*/
- public void updateFromProperties(Properties h) {
+ public void updateFromProperties(Properties props) {
inUpdateFromHashtable = true;
+
+ if(log.isTraceEnabled()) {
+ log.trace("updateFromProperties properties = " + props.toString());
+ }
+
+ // warning : props.contains("started")
+ // seems to not works on properties :(
+ // use containsKey()
try {
- if (h.contains("started")) {
- boolean started = "true".equalsIgnoreCase(h.getProperty("started"));
+ if (props.containsKey("started")) {
+ boolean started = "true".equalsIgnoreCase(props.getProperty("started"));
setStarted(started);
}
- if (h.contains("running")) {
- boolean running = "true".equalsIgnoreCase(h.getProperty("running"));
+ if (props.containsKey("running")) {
+ boolean running = "true".equalsIgnoreCase(props.getProperty("running"));
setRunning(running);
}
- if (h.contains("stop")) {
- boolean stop = "true".equalsIgnoreCase(h.getProperty("stop"));
+ if (props.containsKey("stop")) {
+ boolean stop = "true".equalsIgnoreCase(props.getProperty("stop"));
setStopSimulationRequest(stop);
}
- if (h.contains("date")) {
- Date date = new Date(Integer.parseInt(h.getProperty("date")));
+ if (props.containsKey("date")) {
+ Date date = new Date(Integer.parseInt(props.getProperty("date")));
setDate(date);
}
- if (h.contains("progressMax")) {
- int progressMax = Integer.parseInt(h.getProperty("progressMax"));
+ if (props.containsKey("progressMax")) {
+ int progressMax = Integer.parseInt(props.getProperty("progressMax"));
setProgressMax(progressMax);
}
- if (h.contains("progress")) {
- int progress = Integer.parseInt(h.getProperty("progress"));
+ if (props.containsKey("progress")) {
+ int progress = Integer.parseInt(props.getProperty("progress"));
setProgress(progress);
}
- if (h.contains("text")) {
- String text = h.getProperty("text");
+ if (props.containsKey("text")) {
+ String text = props.getProperty("text");
setText(text);
}
} finally {
@@ -333,34 +349,34 @@
* update current object from hashtable representation
*
*/
- public void updateFromHashtable(Hashtable h) {
+ public void updateFromHashtable(Hashtable<String, Object> h) {
inUpdateFromHashtable = true;
try {
- if (h.contains("started")) {
+ if (h.containsKey("started")) {
boolean started = (Boolean)h.get("started");
setStarted(started);
}
- if (h.contains("running")) {
+ if (h.containsKey("running")) {
boolean running = (Boolean)h.get("running");
setRunning(running);
}
- if (h.contains("stop")) {
+ if (h.containsKey("stop")) {
boolean stop = (Boolean)h.get("stop");
setStopSimulationRequest(stop);
}
- if (h.contains("date")) {
+ if (h.containsKey("date")) {
Date date = new Date((Integer)h.get("date"));
setDate(date);
}
- if (h.contains("progressMax")) {
+ if (h.containsKey("progressMax")) {
int progressMax = (Integer)h.get("progressMax");
setProgressMax(progressMax);
}
- if (h.contains("progress")) {
+ if (h.containsKey("progress")) {
int progress = (Integer)h.get("progress");
setProgress(progress);
}
- if (h.contains("text")) {
+ if (h.containsKey("text")) {
String text = (String)h.get("text");
setText(text);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -60,6 +60,8 @@
import fr.ifremer.isisfish.simulator.SimulationParameter;
import fr.ifremer.isisfish.simulator.SimulationPreScript;
import fr.ifremer.isisfish.simulator.Simulator;
+import fr.ifremer.isisfish.types.Date;
+import fr.ifremer.isisfish.types.Month;
/**
* Fait une simulation dans la meme jvm
@@ -75,22 +77,42 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(InProcessSimulatorLauncher.class);
+ /*
+ * @see fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher#simulate(fr.ifremer.isisfish.simulator.launcher.SimulationService, fr.ifremer.isisfish.simulator.SimulationControl, java.io.File)
+ */
public SimulationStorage simulate(SimulationService simulationService,
SimulationControl control, File simulationZip)
throws RemoteException{
+
String id = control.getId();
log.info(_("simulate %s with file %s", id, simulationZip));
SimulationStorage simulation = null;
+
try {
simulation = SimulationStorage.importAndRenameZip(simulationZip, id);
+
+ // add missing control informations
+ SimulationParameter param = simulation.getParameter();
+ control.setDate(new Date());
+ control.setProgress(0);
+ control.setStarted(true);
+ int lastYear = param.getNumberOfYear();
+ int lastDate = lastYear * Month.NUMBER_OF_MONTH;
+ control.setProgressMax(lastDate);
+
simulation = localSimulate(control, simulation);
} catch (Exception eee) {
log.error(_("Can't do simulation %s", id), eee);
- simulation.getInformation().setException(eee);
+ if(simulation != null) {
+ simulation.getInformation().setException(eee);
+ }
}
return simulation;
}
+ /*
+ * @see fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher#maxSimulationThread()
+ */
public int maxSimulationThread() {
return 1;
}
@@ -162,7 +184,7 @@
}
}
- /**
+ /**
* Modifie le classloader du thread passé en paramètre.
* <p>
* Sert pour les simulations pour qu'elles puissent trouver les
@@ -175,8 +197,8 @@
protected AspectClassLoader changeClassLoader(Thread thread, File directory) {
try {
URL [] classpath = new URL[]{directory.toURI().toURL(),
- // poussin 20080821
- // il semble ne plus trouve les formules, est-ce mieux avec le compile dir ?
+ // poussin 20080821
+ // il semble ne plus trouve les formules, est-ce mieux avec le compile dir ?
IsisFish.config.getCompileDirectory().toURI().toURL()
};
//URL [] classpath = new URL[]{directory.toURL()};
@@ -293,7 +315,7 @@
simulatorObject.simulate(context);
//
- // Ajout des nouveaux objets créées durant la simulation
+ // Ajout des nouveaux objets créés durant la simulation
//
message(control, _("isisfish.message.add.objets.simulation"));
// on ajoute sur le DBResult car pour les exports peut-etre auront
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationJob.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationJob.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationJob.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -184,6 +184,8 @@
} else {
// on est sur une simple simulation, ou le resultat d'un plan
+ /* code moved to
+ fr.ifremer.isisfish.simulator.launcher.InProcessSimulatorLauncher.simulate(SimulationService, SimulationControl, File)
// set date to 0 at beginning of simulation
control.setDate(new Date());
control.setProgress(0);
@@ -191,7 +193,7 @@
int lastYear = param.getNumberOfYear();
int lastDate = lastYear * Month.NUMBER_OF_MONTH;
- control.setProgressMax(lastDate);
+ control.setProgressMax(lastDate);*/
File zip = item.getSimulationZip();
SimulationStorage simulation = launcher.simulate(simulationService, control, zip);
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -324,6 +324,7 @@
*
* @param id l'identifiant de la simulation
* @param param les parametres de la simulation
+ * @param launcher
* @param priority la priorite de la simulation
*/
public void submit(String id, SimulationParameter param,
@@ -590,26 +591,26 @@
}
/**
- * Prepare les fichiers qui seront utils ? la simulation:
+ * Prepare les fichiers qui seront utilsé à la simulation:
* <li> scripts
* <li> rules
* <li> exports
* <li> simulators
* <li> export de la database de la region
* <p>
- * Le tout est zipp? et le zip est retourn?, il peut-?tre directement
- * import? dans le SimulationStorage (en le renomant comme il faut
+ * Le tout est zippé et le zip est retourné, il peut-être directement
+ * importé dans le SimulationStorage (en le renomant comme il faut
* importAndRenameZip).
* <p>
- * Ce zip est automatiquement supprim? a la fin de l'application.
+ * Ce zip est automatiquement supprimé à la fin de l'application.
*
* @param control le controleur
* @param param les parametre de la simulation
* @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...)
+ * @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, boolean compile) throws SimulationException {
@@ -695,16 +696,16 @@
}
/**
- * Compile les fichiers pr?sent dans le r?pertoire pass? en
- * parametre, ce r?pertoire est hi?rarchis? en: rules, exports, simulators
- * et scripts. Seul les fichiers des 3 premiers r?pertoire sont compil?
- * les fichiers du dernier sont compil? par les d?pendances qu'on les autres
+ * 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
+ * @param directory le répertoire où compiler
*/
protected void compileAllFile(SimulationControl control, File directory) {
@@ -713,9 +714,9 @@
//
// 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?
+ // 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>();
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationServiceTableModel.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -50,6 +50,9 @@
*/
public class SimulationServiceTableModel extends AbstractTableModel {
+ /** serialVersionUID */
+ private static final long serialVersionUID = 2414926794815727974L;
+
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(SimulationServiceTableModel.class);
@@ -60,8 +63,9 @@
_("isisfish.queue.status"),
_("isisfish.queue.progression"),
};
+
/** columns types */
- protected Class[] columnClass = new Class[]{
+ protected Class<?>[] columnClass = new Class[]{
String.class, // id
String.class, // analyse plan number
String.class, // local, remote, batch
@@ -157,27 +161,48 @@
return result;
}
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
public int getRowCount() {
int result = jobs.size();
return result;
}
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
public int getColumnCount() {
int result = columnHeader.length;
return result;
}
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
+ */
@Override
public Class<?> getColumnClass(int columnIndex) {
return columnClass[columnIndex];
}
+ /*
+ * @see javax.swing.table.AbstractTableModel#getColumnName(int)
+ */
@Override
public String getColumnName(int column) {
return columnHeader[column];
}
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
public Object getValueAt(int rowIndex, int columnIndex) {
+
+ // FIXME ArrayIndexOutOfBoundException here
+ if(rowIndex >= jobs.size()) {
+ return null;
+ }
+
SimulationJob job = jobs.get(rowIndex);
SimulationControl control = job.getItem().getControl();
String id = control.getId();
@@ -185,6 +210,14 @@
Object result = "";
+ if(log.isDebugEnabled()) {
+ log.debug("Update table model : " +
+ "id = " + control.getId() + ", " +
+ "control.getProgress() = " + control.getProgress() + ", " +
+ "control.getProgressMax() = " + control.getProgressMax() + ", "+
+ "control.getDate() = " + control.getDate());
+ }
+
switch (columnIndex) {
case 0:
result = id;
@@ -209,21 +242,17 @@
}
break;
case 3:
- if (control != null) {
- if (control.isStopSimulationRequest()) {
- result = _("isisfish.launch.stop");
- } else {
- result = control.getText();
- }
+ if (control.isStopSimulationRequest()) {
+ result = _("isisfish.launch.stop");
+ } else {
+ result = control.getText();
}
break;
case 4:
JProgressBar pb = getProgressBar(job);
- if (control != null) {
- pb.setMaximum(control.getProgressMax());
- pb.setValue(control.getProgress());
- pb.setString(control.getDate().getMonth() + "/" + control.getDate().getYear());
- }
+ pb.setMaximum(control.getProgressMax());
+ pb.setValue(control.getProgress());
+ pb.setString(control.getDate().getMonth() + "/" + control.getDate().getYear());
result = pb;
break;
}
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncher.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -197,7 +197,73 @@
}
}
+
+ protected class NonInteractiveUserInfo implements UserInfo {
+ protected String passphrase;
+ protected JTextField passphraseField = new JPasswordField(20);
+ protected String passwd;
+ protected JTextField passwordField = new JPasswordField(20);
+
+ /**
+ * Constructor with password.
+ *
+ * @param passwd password
+ */
+ public NonInteractiveUserInfo(String passwd) {
+ this.passwd = passwd;
+ }
+
+ public boolean promptYesNo(String str) {
+ log.debug("promptYesNo");
+ Object[] options = { "yes", "no" };
+ int foo = JOptionPane.showOptionDialog(null, str, "Warning",
+ JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
+ null, options, options[0]);
+ return foo == 0;
+ }
+
+ public String getPassphrase() {
+ log.debug("getPassphrase");
+ return passphrase;
+ }
+
+ public boolean promptPassphrase(String message) {
+ log.debug("promptPassphrase");
+ Object[] ob = { passphraseField };
+ int result = JOptionPane.showConfirmDialog(null, ob, message,
+ JOptionPane.OK_CANCEL_OPTION);
+ boolean bResult = false;
+ if (result == JOptionPane.OK_OPTION) {
+ passphrase = passphraseField.getText();
+ bResult = true;
+ }
+ return bResult;
+ }
+
+ public String getPassword() {
+ log.debug("getPassword");
+ return passwd;
+ }
+
+ public boolean promptPassword(String message) {
+ log.debug("promptPassword");
+ Object[] ob = { passwordField };
+ int result = JOptionPane.showConfirmDialog(null, ob, message,
+ JOptionPane.OK_CANCEL_OPTION);
+ boolean bResult = false;
+ if (result == JOptionPane.OK_OPTION) {
+ passwd = passwordField.getText();
+ bResult = true;
+ }
+ return bResult;
+ }
+
+ public void showMessage(String message) {
+ JOptionPane.showMessageDialog(null, message);
+ }
+ }
+
/*
* @see fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher#maxSimulationThread()
*/
@@ -276,9 +342,9 @@
Session session = jsch.getSession(username, host, port);
// username and password will be given via UserInfo interface.
- UserInfo ui = new MyUserInfo(password);
+ UserInfo ui = new NonInteractiveUserInfo(password);
session.setUserInfo(ui);
- session.connect(60000);
+ session.connect(60000); // timeout
return session;
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SubProcessSimulationLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SubProcessSimulationLauncher.java 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SubProcessSimulationLauncher.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -20,6 +20,8 @@
package fr.ifremer.isisfish.simulator.launcher;
import static org.codelutin.i18n.I18n._;
+
+import java.beans.PropertyChangeListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -87,9 +89,24 @@
return result;
}
+ /**
+ * Display both message on UI (listeners and log).
+ *
+ * @param control
+ * @param message
+ */
+ protected void message(SimulationControl control, String message) {
+ log.info(message);
+ if (control != null) {
+ control.setText(message);
+ }
+ }
+
public SimulationStorage subProcessSimulate(SimulationControl control,
File simulationZip) throws Exception {
+ message(control, _("isisfish.message.simulation.prepare"));
+
String simulationId = control.getId();
// on ferme le SimulationStorage pour ne pas interferer avec le process
//simulation.closeStorage();
@@ -104,20 +121,17 @@
IsisFish.class.getName(), "--option", "launch.ui", "false",
"--simulateWithSimulation", simulationId, simulationZip.getAbsolutePath());
processBuilder.redirectErrorStream(true);
-
+
// demarrage du process
Process process = processBuilder.start();
if(log.isInfoEnabled()) {
log.info(_("SubProcess start: %s %s", process, processBuilder.command()));
}
- // FIXME control can't be null here
- if (control != null) {
- // prepare de thread de surveillance du process si control n'est pas null
- Thread monitor = new SimulationCheckpointExternalProcessThread(
- control, simulationId, process);
- monitor.start();
- }
+ // prepare de thread de surveillance du process si control n'est pas null
+ Thread monitor = new SimulationCheckpointExternalProcessThread(
+ control, simulationId, process);
+ monitor.start();
// on attend que la simulation soit fini
process.waitFor();
@@ -156,7 +170,6 @@
this.simulationId = simulationId;
this.process = process;
this.out = process.getInputStream();
-
}
@Override
@@ -189,14 +202,11 @@
// passe artificiellement le control a fini
control.stopSimulation();
}
+
if (!control.isRunning()) {
return;
}
}
- //} catch (InterruptedException eee) {
- // if(log.isDebugEnabled()) {
- // log.debug("Can't update control for " + control.getId(), eee);
- // }
} catch (IOException e) {
if(log.isErrorEnabled()) {
log.error(_("isisfish.simulator.subprocess.readoutput.error"), e);
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-17 13:40:51 UTC (rev 1678)
@@ -615,11 +615,11 @@
return SimulationService.getService().getSimulationLaunchers();
}
/**
- * Launch automaticaly the simulation, when is possible (no other simulation)
- * or wait for the last automaticaly simulation ended.
+ * Launch automatically the simulation, when is possible (no other simulation)
+ * or wait for the last automatically simulation ended.
*
* @param simulId id of the simulation to simulate
- * @param inQueue flag to say put in queue
+ * @param launcher launcher to use
*/
public void simul(String simulId, SimulatorLauncher launcher) {
simulId += " " + dateFormat.format(new java.util.Date());
@@ -628,7 +628,7 @@
if (simulId == null || "".equals(simulId) ||
SimulationStorage.localyExists(simulId) ||
SimulationService.getService().exists(simulId)) {
- UserLog.error(_("Can't start simulation, bad id: %s", simulId));
+ UserLog.error(_("isisfish.simulator.simulaction.badid", simulId));
} else {
SimulationParameter p = param.copy();
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2008-12-17 13:40:51 UTC (rev 1678)
@@ -16,7 +16,6 @@
Can't\ instantiate\ %s=
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
-Can't\ start\ simulation,\ bad\ id\:\ %s=
Check\ state\ of\ local\ repository\:\ %s=
Checkout\ pom.xml\ to\ %s=
Clear\ done\ jobs=
@@ -38,7 +37,7 @@
No\ database\ version\ %s\ found\ and\ can't\ get\ it.\\n=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Region\ %s\ allready\ exist\ in\ repository.\ Cant\ import=
+Region\ %s\ allready\ exist\ in\ repository.\ Can't\ import=
Region\ %s\ already\ inited=
Rename\ data\ directory\ to\ %s=
Show\ help=
@@ -276,7 +275,7 @@
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 %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
@@ -563,6 +562,7 @@
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
@@ -695,14 +695,14 @@
isisfish.port.name=Name
isisfish.preScript.backParameter=Back to parameter tab
isisfish.preScript.title=Pre simulation script
-isisfish.queue.id=id
+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=
+isisfish.queue.stopSimulation=Stop simulation
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
isisfish.result.add=Add a result
@@ -714,7 +714,7 @@
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.end.simulation=Simuation end \:
isisfish.result.export=Export
isisfish.result.export.file=Export text file
isisfish.result.file=File
@@ -850,10 +850,7 @@
isisfish.simulator.launcher.inprocess=in current process
isisfish.simulator.launcher.remote=on remote server
isisfish.simulator.launcher.subprocess=in subprocess
-isisfish.simulator.simulaction.init=Error during simulation init \: %s
-isisfish.simulator.simulaction.loadOldSimulation=Can't load old simulation \: %s
-isisfish.simulator.simulaction.regionChange=Can't change region \: %s
-isisfish.simulator.simulaction.viewlogerror=Can't view log \: %s
+isisfish.simulator.simulaction.badid=Can't start simulation, bad id\: %s
isisfish.simulator.subprocess.readoutput.error=
isisfish.species.age=age
isisfish.species.cee=CEE
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 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2008-12-17 13:40:51 UTC (rev 1678)
@@ -16,7 +16,6 @@
Can't\ instantiate\ %s=
Can't\ open\ log\ for\ %s=
Can't\ simulate\ %s=
-Can't\ start\ simulation,\ bad\ id\:\ %s=
Check\ state\ of\ local\ repository\:\ %s=
Checkout\ pom.xml\ to\ %s=
Clear\ done\ jobs=
@@ -38,7 +37,7 @@
No\ database\ version\ %s\ found\ and\ can't\ get\ it.\\n=
Normal\ stop\ thread,\ this\ is\ not\ an\ error=
Not\ start\ simulation\ %s\ because\ user\ ask\ stop=
-Region\ %s\ allready\ exist\ in\ repository.\ Cant\ import=
+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
Rename\ data\ directory\ to\ %s=
Show\ help=
@@ -276,13 +275,13 @@
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 %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=this class does not support
+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
@@ -497,7 +496,7 @@
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=Add new objets simulation
+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
@@ -563,6 +562,7 @@
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
@@ -695,20 +695,20 @@
isisfish.port.name=Nom
isisfish.preScript.backParameter=Retour aux param\u00E8tres
isisfish.preScript.title=Script de pr\u00E9-simulation
-isisfish.queue.id=identifiant
+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=Etat
-isisfish.queue.stopSimulation=Arreter la simulation
+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 debut de Simulation\:
+isisfish.result.begin.simulation=En d\u00E9but de simulation\:
isisfish.result.capture=Capturer
-isisfish.result.capture.metier=Capturer par metier
+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
@@ -716,7 +716,7 @@
isisfish.result.dimension=Dimension
isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
-isisfish.result.export.file=Exporter text file
+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
@@ -850,10 +850,7 @@
isisfish.simulator.launcher.inprocess=dans le m\u00EAme processus
isisfish.simulator.launcher.remote=sur un serveur distant
isisfish.simulator.launcher.subprocess=dans un sous processus
-isisfish.simulator.simulaction.init=Erreur d'initialisation de la simulation \: %s
-isisfish.simulator.simulaction.loadOldSimulation=Erreur lors du chargement d'une ancienne simulation \: %s
-isisfish.simulator.simulaction.regionChange=Erreur lors du changement de region \: %s
-isisfish.simulator.simulaction.viewlogerror=Erreur de visualisation des logs \: %s
+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
Modified: isis-fish/trunk/src/main/resources/log4j.properties
===================================================================
--- isis-fish/trunk/src/main/resources/log4j.properties 2008-12-17 13:11:32 UTC (rev 1677)
+++ isis-fish/trunk/src/main/resources/log4j.properties 2008-12-17 13:40:51 UTC (rev 1678)
@@ -6,12 +6,11 @@
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n
# package level
-log4j.logger.fr.ifremer.isisfish=INFO
+log4j.logger.fr.ifremer.isisfish=DEBUG
log4j.logger.org.codelutin=INFO
-log4j.logger.analyseplans=INFO
-log4j.logger.exports=INFO
-log4j.logger.formules=INFO
-log4j.logger.rules=INFO
-log4j.logger.scripts=INFO
-log4j.logger.simulators=INFO
-log4j.logger.fr.ifremer.isisfish.ui.input.InputNavigationTreeSelectionAdapter=DEBUG
+log4j.logger.analyseplans=DEBUG
+log4j.logger.exports=DEBUG
+log4j.logger.formules=DEBUG
+log4j.logger.rules=DEBUG
+log4j.logger.scripts=DEBUG
+log4j.logger.simulators=DEBUG
1
0
Author: chatellier
Date: 2008-12-17 13:11:32 +0000 (Wed, 17 Dec 2008)
New Revision: 1677
Modified:
isis-fish/trunk/pom.xml
Log:
Use topia-persistence 2.1.2
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-17 08:56:59 UTC (rev 1676)
+++ isis-fish/trunk/pom.xml 2008-12-17 13:11:32 UTC (rev 1677)
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinmatrix</artifactId>
- <version>1.2-SNAPSHOT</version>
+ <version>${lutinmatrix.version}</version>
<scope>compile</scope>
</dependency>
@@ -314,10 +314,12 @@
<generator.version>0.63</generator.version>
<!-- topia version -->
- <topia.version>2.1.1</topia.version>
+ <topia.version>2.1.2-SNAPSHOT</topia.version>
<!-- lutinwidget version -->
<lutinwidget.version>0.11</lutinwidget.version>
+ <!-- lutinmatrix version -->
+ <lutinmatrix.version>1.2-SNAPSHOT</lutinmatrix.version>
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
@@ -410,7 +412,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinmatrix</artifactId>
- <version>1.1</version>
+ <version>${lutinmatrix.version}</version>
</dependency>
</dependencies>
</plugin>
1
0
Author: chatellier
Date: 2008-12-17 08:56:59 +0000 (Wed, 17 Dec 2008)
New Revision: 1676
Modified:
isis-fish/trunk/pom.xml
Log:
Passage de lutinmatrix en snapshot pour test
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-16 16:01:32 UTC (rev 1675)
+++ isis-fish/trunk/pom.xml 2008-12-17 08:56:59 UTC (rev 1676)
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinmatrix</artifactId>
- <version>1.1</version>
+ <version>1.2-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
1
0
r1675 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 16 Dec '08
by sletellier@users.labs.libre-entreprise.org 16 Dec '08
16 Dec '08
Author: sletellier
Date: 2008-12-16 16:01:32 +0000 (Tue, 16 Dec 2008)
New Revision: 1675
Added:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
Log:
Interaction avec openMap
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-16 16:01:32 UTC (rev 1675)
@@ -54,10 +54,19 @@
import org.codelutin.topia.persistence.TopiaEntity;
import fr.ifremer.isisfish.entities.Zone;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
+import com.bbn.openmap.event.MapMouseListener;
+import com.bbn.openmap.event.SelectMouseMode;
+import fr.ifremer.isisfish.map.CellSelectionLayer;
+import java.util.logging.Level;
+import com.bbn.openmap.omGraphics.OMGraphic;
+import java.util.logging.Logger;
+import org.codelutin.topia.TopiaException;
+
protected IsisMapBean cellMap = new IsisMapBean();
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
+protected OpenMapEvents mapListener = null;
addPropertyChangeListener("bean", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -87,6 +96,9 @@
cellMap.setFisheryRegion(action.getFisheryRegion());
toolSet.setupListeners(cellMap);
toolMap.add((Component)toolSet);
+// cellMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
+// cellMap.setActiveMouseMode(new SelectMouseMode());
+ setMapListener();
cellMapPanel.add(toolMap, BorderLayout.NORTH);
cellMapPanel.add(cellMap, BorderLayout.CENTER);
@@ -95,7 +107,20 @@
}
setChanged(false);
}
+protected void setMapListener(){
+ if (mapListener == null){
+ mapListener = new OpenMapEvents(cellMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
+ @Override
+ public boolean onMouseClicked() {
+ for (Cell c : cellMap.getSelectedCells()){
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells/" + c.getTopiaId());
+ }
+ return true;
+ }
+ };
+ }
+}
protected void save() {
TopiaEntity topia = getContextValue(InputAction.class).save();
getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java (rev 0)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/OpenMapEvents.java 2008-12-16 16:01:32 UTC (rev 1675)
@@ -0,0 +1,252 @@
+/* *##%
+* Copyright (C) 2005
+* 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.
+*##%*/
+
+/* *
+* OpenMapEvents.java
+*
+* Created: 5 septembre 2005 03:21:41 CEST
+*
+* @author Benjamin POUSSIN <poussin at codelutin.com>
+* @version $Revision: 202 $
+*
+* Last update: $Date: 2006-06-30 18:39:09 +0200 (ven, 30 jun 2006) $
+* by : $Author: bpoussin $
+*/
+
+package fr.ifremer.isisfish.ui.input;
+
+import java.awt.event.MouseEvent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.bbn.openmap.Layer;
+import com.bbn.openmap.event.DistanceMouseMode;
+import com.bbn.openmap.event.MapMouseListener;
+import com.bbn.openmap.event.MapMouseMode;
+import com.bbn.openmap.event.NullMouseMode;
+import com.bbn.openmap.event.ProjectionEvent;
+import com.bbn.openmap.event.SelectMouseMode;
+
+import fr.ifremer.isisfish.map.IsisMapBean;
+
+public abstract class OpenMapEvents extends Layer implements MapMouseListener { // OpenMapEvents
+
+ /** */
+ private static final long serialVersionUID = -8365120112075269288L;
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(OpenMapEvents.class);
+
+ public OpenMapEvents (IsisMapBean map, MapMouseMode mouseMode, int selectMode){
+ super();
+ this.mouseMode = mouseMode;
+ this.map = map;
+ this.selectMode = selectMode;
+ map.setSelectionMode(selectMode);
+ map.setActiveMouseMode(mouseMode);
+ map.addMapMouseListener(this);
+
+ }
+ public void projectionChanged(ProjectionEvent e){
+ // do nothing, it's not reel layer
+ }
+
+ /**
+ * SelectMouseMode property: Null, Distance, Nav, Select
+ */
+ protected MapMouseMode mouseMode = null;
+ protected IsisMapBean map = null;
+ protected int selectMode = 1;
+
+ /**
+ * OnMouseDragged property.
+ */
+ protected String onMouseDragged = null;
+
+ /**
+ * Get onMouseDragged property.
+ *
+ *@return OnMouseDragged property.
+ */
+ public String getOnMouseDragged() {
+ return this.onMouseDragged;
+ }
+
+ /**
+ * Set onMouseDragged property.
+ *
+ *@param onMouseDragged New onMouseDragged property.
+ */
+ public void setOnMouseDragged(String onMouseDragged) {
+ this.onMouseDragged = onMouseDragged;
+ }
+
+ /**
+ * OnMouseEntered property.
+ */
+ protected String onMouseEntered = null;
+
+ /**
+ * Get onMouseEntered property.
+ *
+ *@return OnMouseEntered property.
+ */
+ public String getOnMouseEntered() {
+ return this.onMouseEntered;
+ }
+
+ /**
+ * Set onMouseEntered property.
+ *
+ *@param onMouseEntered New onMouseEntered property.
+ */
+ public void setOnMouseEntered(String onMouseEntered) {
+ this.onMouseEntered = onMouseEntered;
+ }
+
+ /**
+ * OnMouseExited property.
+ */
+ protected String onMouseExited = null;
+
+ /**
+ * Get onMouseExited property.
+ *
+ *@return OnMouseExited property.
+ */
+ public String getOnMouseExited() {
+ return this.onMouseExited;
+ }
+
+ /**
+ * Set onMouseExited property.
+ *
+ *@param onMouseExited New onMouseExited property.
+ */
+ public void setOnMouseExited(String onMouseExited) {
+ this.onMouseExited = onMouseExited;
+ }
+
+ /**
+ * OnMouseMoved property.
+ */
+ protected String onMouseMoved = null;
+
+ /**
+ * Get onMouseMoved property.
+ *
+ *@return OnMouseMoved property.
+ */
+ public String getOnMouseMoved() {
+ return this.onMouseMoved;
+ }
+
+ /**
+ * Set onMouseMoved property.
+ *
+ *@param onMouseMoved New onMouseMoved property.
+ */
+ public void setOnMouseMoved(String onMouseMoved) {
+ this.onMouseMoved = onMouseMoved;
+ }
+
+ /**
+ * OnMousePressed property.
+ */
+ protected String onMousePressed = null;
+
+ /**
+ * Get onMousePressed property.
+ *
+ *@return OnMousePressed property.
+ */
+ public String getOnMousePressed() {
+ return this.onMousePressed;
+ }
+
+ /**
+ * Set onMousePressed property.
+ *
+ *@param onMousePressed New onMousePressed property.
+ */
+ public void setOnMousePressed(String onMousePressed) {
+ this.onMousePressed = onMousePressed;
+ }
+
+ /**
+ * OnMouseReleased property.
+ */
+ protected String onMouseReleased = null;
+
+ /**
+ * Get onMouseReleased property.
+ *
+ *@return OnMouseReleased property.
+ */
+ public String getOnMouseReleased() {
+ return this.onMouseReleased;
+ }
+
+ /**
+ * Set onMouseReleased property.
+ *
+ *@param onMouseReleased New onMouseReleased property.
+ */
+ public void setOnMouseReleased(String onMouseReleased) {
+ this.onMouseReleased = onMouseReleased;
+ }
+
+ public String[] getMouseModeServiceList() {
+ return new String[] {
+ SelectMouseMode.modeID
+ };
+ }
+
+ public boolean mouseClicked(MouseEvent e){
+ onMouseClicked();
+ return true;
+ }
+
+ public boolean mouseDragged(MouseEvent e){
+ return false;
+ }
+
+ public void mouseEntered(MouseEvent e){
+ }
+
+ public void mouseExited(MouseEvent e) {
+ }
+
+ public void mouseMoved(){
+ }
+
+ public boolean mouseMoved(MouseEvent e){
+ return false;
+ }
+
+ public boolean mousePressed(MouseEvent e){
+ return false;
+ }
+
+ public boolean mouseReleased(MouseEvent e){
+ return false;
+ }
+
+ public abstract boolean onMouseClicked();
+} // OpenMapEvents
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2008-12-16 16:01:32 UTC (rev 1675)
@@ -51,12 +51,15 @@
import fr.ifremer.isisfish.map.OpenMapToolPanel;
import com.bbn.openmap.gui.OMToolSet;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
+ import fr.ifremer.isisfish.map.CellSelectionLayer;
+ import com.bbn.openmap.event.SelectMouseMode;
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.topia.TopiaException;
protected IsisMapBean portMap = new IsisMapBean();
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
+ protected OpenMapEvents mapListener = null;
public PortUI (InputAction action){
setContextValue(action);
@@ -75,13 +78,6 @@
portCell.setSelectedValue(port.getCell());
fieldPortComment.setText(getContextValue(InputAction.class).getPort().getComment());
-
- portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- toolSet.setupListeners(portMap);
- toolMap.add((Component)toolSet);
- portMapPanel.add(toolMap, BorderLayout.NORTH);
- portMapPanel.add(portMap, BorderLayout.CENTER);
- refreshMap();
}
else{
fieldPortName.setText("");
@@ -95,14 +91,15 @@
fieldPortComment.setText("");
- portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- toolSet.setupListeners(portMap);
- toolMap.add((Component)toolSet);
- portMapPanel.add(toolMap, BorderLayout.NORTH);
- portMapPanel.add(portMap, BorderLayout.CENTER);
- refreshMap();
}
+ portMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
+ toolSet.setupListeners(portMap);
+ toolMap.add((Component)toolSet);
+ setMapListener();
+ portMapPanel.add(toolMap, BorderLayout.NORTH);
+ portMapPanel.add(portMap, BorderLayout.CENTER);
+ refreshMap();
}
protected void refreshMap(){
java.util.List<Cell> cells = new ArrayList<Cell>();
@@ -110,6 +107,25 @@
portMap.setSelectedCells(cells);
portMap.setSelectedCells(cells);
}
+ protected void setMapListener(){
+ if (mapListener == null){
+ mapListener = new OpenMapEvents(portMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
+
+ @Override
+ public boolean onMouseClicked() {
+ for (Cell c : portMap.getSelectedCells()){
+ Port port = getContextValue(InputAction.class).getPort();
+ if (port != null){
+ port.setCell(c);
+ }
+ }
+ valueChanged(true);
+ refresh();
+ return true;
+ }
+ };
+ }
+ }
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Port");
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-16 16:01:32 UTC (rev 1675)
@@ -64,49 +64,10 @@
protected MapMouseListener mapListener = null;
public ZoneUI (InputAction action){
-
setContextValue(action);
- this.addFocusListener(new FocusListener() {
-
- @Override
- public void focusGained(FocusEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void focusLost(FocusEvent e) {;
- if (changed){
- if (!askAndSave()){
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones"+getContextValue(InputAction.class).getZone().getTopiaId());
- }
- }
- }
- });
}
- protected boolean askAndSave(){
- boolean result = true;
- try {
- int choice = JOptionPane.showConfirmDialog(null, _("isisfish.message.page.modified"));
- switch (choice) {
- case JOptionPane.YES_OPTION:
- getContextValue(InputAction.class).getIsisContext().commitTransaction();
- result = true;
- break;
- case JOptionPane.NO_OPTION:
- getContextValue(InputAction.class).getIsisContext().rollbackTransaction();
- result = true;
- break;
- case JOptionPane.CANCEL_OPTION:
- result = false;
- break;
- };
- } catch (TopiaException ex) {
- Logger.getLogger(InputUI.class.getName()).log(Level.SEVERE, null, ex);
- }
- return result;
- }
- public void refresh() {
- if (! getContextValue(InputAction.class).isNull()){
+ public void refresh() {
+ if (!getContextValue(InputAction.class).isNull()){
Zone z = getContextValue(InputAction.class).getZone();
DefaultListModel zoneCellsModel = new DefaultListModel();
java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
@@ -143,79 +104,26 @@
zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
toolSet.setupListeners(zoneMap);
toolMap.add((Component)toolSet);
- zoneMap.setActiveMouseMode(new SelectMouseMode());
- zoneMap.setSelectionMode(CellSelectionLayer.MULT_SELECTION);
setMapListener();
zoneMapPanel.add(toolMap, BorderLayout.NORTH);
zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
- valueChanged(false);
refreshMap();
}
protected void setMapListener(){
if (mapListener == null){
- mapListener = new MapMouseListener() {
+ mapListener = new OpenMapEvents(zoneMap, new SelectMouseMode(false), CellSelectionLayer.MULT_SELECTION) {
@Override
- public boolean mouseClicked(MouseEvent e) {
- java.util.List<Cell> cells = (java.util.List<Cell>) zoneMap.getSelectedCells();
- if (cells != null){
- int[] indexs = new int[cells.size()];
- int i = 0;
- for (Cell c : cells){
- indexs[i] = ((DefaultListModel)zoneCells.getModel()).indexOf(c);
- if (log.isDebugEnabled()) {
- log.debug("refresh " + c + " " + i);
- }
- i++;
- }
- zoneCells.setSelectedIndices(indexs);
+ public boolean onMouseClicked() {
+ java.util.List<Cell> selectedCell = zoneMap.getSelectedCells();
+ if (!getContextValue(InputAction.class).isNull()){
+ getContextValue(InputAction.class).getZone().setCell(selectedCell);
+ valueChanged(true);
+ refresh();
return true;
}
return false;
}
-
- @Override
- public String[] getMouseModeServiceList() {
- return new String[] {
- SelectMouseMode.modeID
- };
- }
-
- @Override
- public boolean mousePressed(MouseEvent arg0) {
- return false;
- }
-
- @Override
- public boolean mouseReleased(MouseEvent arg0) {
- return false;
- }
-
- @Override
- public void mouseEntered(MouseEvent arg0) {
-
- }
-
- @Override
- public void mouseExited(MouseEvent arg0) {
-
- }
-
- @Override
- public boolean mouseDragged(MouseEvent arg0) {
- return false;
- }
-
- @Override
- public boolean mouseMoved(MouseEvent arg0) {
- return false;
- }
-
- @Override
- public void mouseMoved() {
-
- }
};
- zoneMap.addMapMouseListener(mapListener);
}
}
protected void refreshMap(){
1
0
r1674 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui: . input simulator
by sletellier@users.labs.libre-entreprise.org 15 Dec '08
by sletellier@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: sletellier
Date: 2008-12-15 17:46:56 +0000 (Mon, 15 Dec 2008)
New Revision: 1674
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
Log:
Debug vol4
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/WelcomeTabUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
@@ -33,15 +33,10 @@
<JPanel id='welcomePanelUI' layout='{new BorderLayout()}'>
<script><![CDATA[
import fr.ifremer.isisfish.ui.simulator.SimulAction;
- import static javax.swing.JOptionPane.showMessageDialog;
import fr.ifremer.isisfish.ui.input.InputAction;
import fr.ifremer.isisfish.ui.result.ResultAction;
- showMsgBox(simulUI.getContextValue(SimulAction.class).init());
- protected void showMsgBox(String txt){
- if (txt != null){
- showMessageDialog(this, txt);
- }
- }
+
+ simulUI.getContextValue(SimulAction.class).init();
]]>
</script>
<JTabbedPane id="simulTabs" tabPlacement='{JTabbedPane.LEFT}' constraints="BorderLayout.CENTER">
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
@@ -30,7 +30,7 @@
* by : $Author: sletellier $
*/
-->
-<JPanel id="input" visible="true" size='{new Dimension(700,500)}' layout='{new BorderLayout()}' location='{new Point(0,139)}'>
+<JPanel id="input" layout='{new BorderLayout()}'>
<javax.swing.tree.DefaultTreeSelectionModel id='navigationSelectionModel' selectionMode='{javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION}'/>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/ZoneUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
@@ -48,6 +48,9 @@
import fr.ifremer.isisfish.entities.Port;
import fr.ifremer.isisfish.map.IsisMapBean;
import fr.ifremer.isisfish.map.OpenMapToolPanel;
+ import fr.ifremer.isisfish.map.CellSelectionLayer;
+ import com.bbn.openmap.event.SelectMouseMode;
+ import com.bbn.openmap.event.MapMouseListener;
import com.bbn.openmap.gui.OMToolSet;
import fr.ifremer.isisfish.ui.WelcomePanelUI;
import org.codelutin.topia.persistence.TopiaEntity;
@@ -58,6 +61,7 @@
protected IsisMapBean zoneMap = new IsisMapBean();
protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
protected OMToolSet toolSet = new OMToolSet();
+ protected MapMouseListener mapListener = null;
public ZoneUI (InputAction action){
@@ -116,7 +120,7 @@
int i = 0;
for (Cell c : cellsSelected){
indexs[i] = zoneCellsModel.indexOf(c);
- if (log.isDebugEnabled()) {
+ if (log.isDebugEnabled()) {
log.debug("refresh " + c + " " + i);
}
i++;
@@ -139,17 +143,85 @@
zoneMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
toolSet.setupListeners(zoneMap);
toolMap.add((Component)toolSet);
+ zoneMap.setActiveMouseMode(new SelectMouseMode());
+ zoneMap.setSelectionMode(CellSelectionLayer.MULT_SELECTION);
+ setMapListener();
zoneMapPanel.add(toolMap, BorderLayout.NORTH);
zoneMapPanel.add(zoneMap, BorderLayout.CENTER);
valueChanged(false);
refreshMap();
}
+ protected void setMapListener(){
+ if (mapListener == null){
+ mapListener = new MapMouseListener() {
+ @Override
+ public boolean mouseClicked(MouseEvent e) {
+ java.util.List<Cell> cells = (java.util.List<Cell>) zoneMap.getSelectedCells();
+ if (cells != null){
+ int[] indexs = new int[cells.size()];
+ int i = 0;
+ for (Cell c : cells){
+ indexs[i] = ((DefaultListModel)zoneCells.getModel()).indexOf(c);
+ if (log.isDebugEnabled()) {
+ log.debug("refresh " + c + " " + i);
+ }
+ i++;
+ }
+ zoneCells.setSelectedIndices(indexs);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getMouseModeServiceList() {
+ return new String[] {
+ SelectMouseMode.modeID
+ };
+ }
+
+ @Override
+ public boolean mousePressed(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public boolean mouseReleased(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public void mouseEntered(MouseEvent arg0) {
+
+ }
+
+ @Override
+ public void mouseExited(MouseEvent arg0) {
+
+ }
+
+ @Override
+ public boolean mouseDragged(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public boolean mouseMoved(MouseEvent arg0) {
+ return false;
+ }
+
+ @Override
+ public void mouseMoved() {
+
+ }
+ };
+ zoneMap.addMapMouseListener(mapListener);
+ }
+ }
protected void refreshMap(){
- java.util.List<Cell> cells = new ArrayList<Cell>();
- for (Object o : zoneCells.getSelectedValues()){
- cells.add((Cell) o );
+ if (getContextValue(InputAction.class).getZone() != null){
+ zoneMap.setSelectedCells(getContextValue(InputAction.class).getZone().getCell());
}
- zoneMap.setSelectedCells(cells);
}
protected void create(){
TopiaEntity topia = getContextValue(InputAction.class).create("Zone");
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/ParamsUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
@@ -89,7 +89,7 @@
if(selected != null && !selected.trim().isEmpty()) {
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.region"));
- showMsgBox(getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString()));
+ getContextValue(SimulAction.class).regionChange(fieldSimulParamsRegion.getSelectedItem().toString());
refresh();
root.setInfoText(_("isisfish.message.region.loaded"));
}
@@ -103,7 +103,7 @@
if (selected != null && !selected.equals(" ")){
WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
root.setInfoText(_("isisfish.message.loading.old.simulation"));
- showMsgBox(getContextValue(SimulAction.class).loadOldSimulation(selected));
+ getContextValue(SimulAction.class).loadOldSimulation(selected);
refresh();
root.setInfoText(_("isisfish.message.old.simulation.loaded"));
}
@@ -121,7 +121,7 @@
setRulesItems();
}
protected void simul(){
- showMsgBox(getContextValue(SimulAction.class).simul(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem()));
+ getContextValue(SimulAction.class).simul(fieldSimulParamsName.getText(), (SimulatorLauncher)comboSelLauncher.getSelectedItem());
SimulUI simul = getParentContainer(SimulUI.class);
simul.selTab(6);
}
@@ -148,13 +148,15 @@
}
listSimulParamsStrategies.setModel(listSimulParamsStrategiesModel);
java.util.List<Strategy> strategiesSelected = getContextValue(SimulAction.class).getSimulationParameter().getStrategies();
- int[] indexs = new int[listSimulParamsStrategiesModel.size()];
- int i = 0;
- for (Strategy s : strategiesSelected){
- indexs[i] = listSimulParamsStrategiesModel.indexOf(s);
- i++;
+ if (listSimulParamsStrategiesModel.size() != 0){
+ int[] indexs = new int[listSimulParamsStrategiesModel.size()];
+ int i = 0;
+ for (Strategy s : strategiesSelected){
+ indexs[i] = listSimulParamsStrategiesModel.indexOf(s);
+ i++;
+ }
+ listSimulParamsStrategies.setSelectedIndices(indexs);
}
- listSimulParamsStrategies.setSelectedIndices(indexs);
}
protected void setListSimulParamsPopulationsItems(){
DefaultListModel listSimulParamsPopulationsModel = new DefaultListModel();
@@ -164,14 +166,16 @@
}
listSimulParamsPopulations.setModel(listSimulParamsPopulationsModel);
java.util.List<Population> populationsSelected = getContextValue(SimulAction.class).getSimulationParameter().getPopulations();
- int[] indexs = new int[listSimulParamsPopulationsModel.size()];
- int i = 0;
- for (Population p : populationsSelected){
- indexs[i] = listSimulParamsPopulationsModel.indexOf(p);
- i++;
+ if (listSimulParamsPopulationsModel.size() != 0){
+ int[] indexs = new int[listSimulParamsPopulationsModel.size()];
+ int i = 0;
+ for (Population p : populationsSelected){
+ indexs[i] = listSimulParamsPopulationsModel.indexOf(p);
+ i++;
+ }
+ listSimulParamsPopulations.setSelectedIndices(indexs);
+ populationSelected();
}
- listSimulParamsPopulations.setSelectedIndices(indexs);
- populationSelected();
}
protected void setRulesItems(){
listSimulParamsMesuresList.setListData(getContextValue(SimulAction.class).getRules().toArray());
@@ -241,11 +245,6 @@
}
});
}
- protected void showMsgBox(String txt){
- if (txt != null){
- showMessageDialog(this, txt);
- }
- }
protected void selectFilter(){
try {
getContextValue(SimulAction.class).setOldSimulatorNames(fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.filterSimulation(getContextValue(SimulAction.class).getOldSimulationItem()));
@@ -352,7 +351,7 @@
<JLabel text="isisfish.params.simulationName" minimumSize='{new Dimension(140,25)}' preferredSize='{new Dimension(140,25)}'/>
</cell>
<cell fill="both" weightx="1.0">
- <JTextField id="fieldSimulParamsName" onKeyPressed='saveName()'/>
+ <JTextField id="fieldSimulParamsName" onFocusLost='saveName()'/>
</cell>
</row>
</Table>
@@ -387,7 +386,7 @@
<row>
<cell columns="4" fill="both" weightx="1.0" weighty="0.3">
<JScrollPane minimumSize='{new Dimension(0,0)}' preferredSize='{new Dimension(0,0)}'>
- <JTextArea id="fieldSimulParamsDesc" text='{getContextValue(SimulAction.class).getSimulationParameter().getDescription()}' onKeyPressed='saveDescription()'/>
+ <JTextArea id="fieldSimulParamsDesc" text='{getContextValue(SimulAction.class).getSimulationParameter().getDescription()}' onFocusLost='saveDescription()'/>
</JScrollPane>
</cell>
</row>
@@ -531,12 +530,15 @@
<cell>
<JLabel id="lblLauncher" text="isisfish.params.lblLauncher"/>
</cell>
- <cell fill="horizontal" weightx="0.5">
+ <cell fill="horizontal" weightx="0.4">
<JComboBox id="comboSelLauncher" model='{new DefaultComboBoxModel(getContextValue(SimulAction.class).getSimulationLauncher().toArray())}'/>
</cell>
- <cell fill="horizontal" weightx="0.5">
+ <cell fill="horizontal" weightx="0.4">
<JButton id="buttonSimulParamsSimulate" text="isisfish.common.simulate" onActionPerformed='simul()'/>
</cell>
+ <cell fill="horizontal" weightx="0.2">
+ <JButton id="saveSimul" text="isisfish.simulation.menu.save" onActionPerformed='getParentContainer(SimulUI.class).saveSimulation()'/>
+ </cell>
</row>
</Table>
</cell>
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 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-15 17:46:56 UTC (rev 1674)
@@ -62,6 +62,7 @@
import fr.ifremer.isisfish.simulator.launcher.SimulatorLauncher;
import fr.ifremer.isisfish.ui.Common;
import fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil;
+import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import fr.ifremer.isisfish.ui.widget.filter.FilterModel;
import java.io.BufferedReader;
import java.io.File;
@@ -107,7 +108,10 @@
public SimulAction() {
init();
}
- public String init(){
+ protected void showMsgBox(Exception eee){
+ ErrorDialogUI.showError(eee);
+ }
+ public void init(){
log.debug("Init ");
try {
param = new SimulationParameter();
@@ -127,39 +131,30 @@
}
catch (Exception eee) {
log.error("Can't init SimulationParameter", eee);
- return (_("isisfish.simulator.simulaction.init",eee.getMessage()));
+ showMsgBox(eee);
}
- return null;
}
protected void setName(String name){
simulName = name;
}
- protected String importSimulation(File f){
- String result = null;
+ protected void importSimulation(File f){
FileInputStream fos = null;
try {
fos = new FileInputStream(f);
- BufferedReader br = new BufferedReader(new InputStreamReader(fos));
- String line = br.readLine();
- if (line.matches("^#.*")){
- result = line.substring(1);
- }
-
Properties proper = new Properties();
proper.load(fos);
-// TODO : réparer
-// param.fromProperties(proper);
- simulName = result;
+ 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);
}
}
- return result;
}
protected void saveSimulation(File f){
FileOutputStream fos = null;
@@ -168,11 +163,13 @@
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);
}
}
}
@@ -196,6 +193,7 @@
} catch (Exception eee) {
if (log.isWarnEnabled()) {
log.warn("Can't find result name script", eee);
+ showMsgBox(eee);
}
}
return result;
@@ -206,15 +204,14 @@
log.info(_("User stop simulation %s", job.getItem().getControl().getId()));
}
- protected String viewLog(SimulationJob job) {
+ 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);
- return (_("isisfish.simulator.simulaction.viewlogerror",eee.getMessage()));
+ showMsgBox(eee);
}
- return null;
}
protected void clearDoneJobs() {
@@ -227,7 +224,7 @@
*
* @param regionName SimulationParameter/description
*/
- public String regionChange(String regionName) {
+ public void regionChange(String regionName) {
try{
regionStorage = RegionStorage.getRegion(regionName);
param.setRegionName(regionName);
@@ -236,9 +233,8 @@
}
}
catch (Exception eee){
- return (_("isisfish.simulator.simulaction.regionChange",eee.getMessage()));
+ showMsgBox(eee);
}
- return null;
}
/**
@@ -247,7 +243,7 @@
* @param simulName name of simulation to load
* @return <code>null</code> if ok, an OutputView otherwise with error
*/
- public String loadOldSimulation(String simulName) {
+ public void loadOldSimulation(String simulName) {
log.debug("call loadOldSimulation: " + simulName);
try {
this.simulName = simulName;
@@ -258,9 +254,8 @@
regionStorage = param.getRegion();
} catch (Exception eee) {
log.error("Can't load old Simulation: " + simulName, eee);
- return (_("isisfish.simulator.simulaction.loadOldSimulation",eee.getMessage()));
+ showMsgBox(eee);
}
- return null;
}
/*
@@ -279,6 +274,7 @@
param.addRule(ruleTmp);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
public List<String> getRuleNames() {
@@ -295,6 +291,7 @@
result.add(RuleStorage.getName(r));
} catch (Exception ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
return result;
@@ -335,6 +332,7 @@
result = RuleStorage.getParameterValue(getRule(ruleName), paramName);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
return result;
@@ -345,6 +343,7 @@
RuleStorage.setParameterValue(getRule(ruleName), paramName, o);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
}
@@ -357,6 +356,7 @@
result = RegionStorage.getFisheryRegion(param.getRegion().getStorage().beginTransaction()).getStrategy();
} catch (Exception ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
return result;
}
@@ -381,6 +381,7 @@
}
} catch (Exception ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
return result;
}
@@ -433,8 +434,10 @@
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;
}
@@ -533,6 +536,7 @@
getSimulationParameter().addAnalysePlan(ap);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
public void removeAnalysePlan(String name){
@@ -569,6 +573,7 @@
result = AnalysePlanStorage.getParameterValue(getAnalysePlan(analysePlanName), paramName);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
return result;
@@ -579,6 +584,7 @@
AnalysePlanStorage.setParameterValue(getAnalysePlan(analysePlanName), paramName, o);
} catch (IsisFishException ex) {
Logger.getLogger(SimulAction.class.getName()).log(Level.SEVERE, null, ex);
+ showMsgBox(ex);
}
}
}
@@ -615,7 +621,7 @@
* @param simulId id of the simulation to simulate
* @param inQueue flag to say put in queue
*/
- public String simul(String simulId, SimulatorLauncher launcher) {
+ public void simul(String simulId, SimulatorLauncher launcher) {
simulId += " " + dateFormat.format(new java.util.Date());
log.debug("call simulate");
try {
@@ -630,8 +636,7 @@
}
} catch (Exception eee) {
log.error("Can't start simulation", eee);
- return ("Error.xml" + "error" + eee.getMessage());
+ showMsgBox(eee);
}
- return null;
}
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2008-12-15 11:42:44 UTC (rev 1673)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulUI.jaxx 2008-12-15 17:46:56 UTC (rev 1674)
@@ -34,8 +34,8 @@
<script><![CDATA[
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
- public SimulUI(SimulAction action){
-
+
+ public SimulUI(SimulAction action){
setContextValue(action);
}
protected void enablePreSimul(){
@@ -65,22 +65,21 @@
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
//This is where a real application would open the file.
- String name = getContextValue(SimulAction.class).importSimulation(file);
+ getContextValue(SimulAction.class).importSimulation(file);
refreshAll();
- paramsUI.setName(name);
}
}
protected void saveSimulation(){
JFileChooser fc = new JFileChooser();
- int returnVal = fc.showOpenDialog(null);
+ 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);
- Element result = DocumentHelper.createElement("simul");
- result.add(paramsUI.save());
- System.out.println(result.asXML());
+ getContextValue(SimulAction.class).saveSimulation(file);
+// Element result = DocumentHelper.createElement("simul");
+// result.add(paramsUI.save());
+// System.out.println(result.asXML());
}
}
]]>
1
0
r1673 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: chatellier
Date: 2008-12-15 11:42:44 +0000 (Mon, 15 Dec 2008)
New Revision: 1673
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java
Log:
Add hibernate big hack to unset parameters topiaId
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2008-12-15 11:41:36 UTC (rev 1672)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2008-12-15 11:42:44 UTC (rev 1673)
@@ -21,23 +21,9 @@
import static org.codelutin.i18n.I18n._;
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisFish;
-import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.aspect.AspectClassLoader;
-import fr.ifremer.isisfish.aspect.Cache;
-import fr.ifremer.isisfish.aspect.Trace;
-import fr.ifremer.isisfish.datastore.SimulationStorage;
-import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.simulator.SimulationContext;
-import fr.ifremer.isisfish.simulator.SimulationControl;
-import fr.ifremer.isisfish.simulator.SimulationException;
-import fr.ifremer.isisfish.simulator.SimulationExportResultWrapper;
-import fr.ifremer.isisfish.simulator.SimulationListener;
-import fr.ifremer.isisfish.simulator.SimulationParameter;
-import fr.ifremer.isisfish.simulator.SimulationPreScript;
-import fr.ifremer.isisfish.simulator.Simulator;
import java.io.File;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
@@ -45,6 +31,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+
import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -56,6 +43,24 @@
import org.codelutin.util.ObjectUtil;
import org.codelutin.util.StringUtil;
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.aspect.AspectClassLoader;
+import fr.ifremer.isisfish.aspect.Cache;
+import fr.ifremer.isisfish.aspect.Trace;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.rule.Rule;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.simulator.SimulationControl;
+import fr.ifremer.isisfish.simulator.SimulationException;
+import fr.ifremer.isisfish.simulator.SimulationExportResultWrapper;
+import fr.ifremer.isisfish.simulator.SimulationListener;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import fr.ifremer.isisfish.simulator.SimulationPreScript;
+import fr.ifremer.isisfish.simulator.Simulator;
+
/**
* Fait une simulation dans la meme jvm
*
@@ -229,6 +234,26 @@
// forceReload, save all modification in parameter and reread it
parameters = simulation.getForceReloadParameter();
+ // Rule modification
+ List<Rule> rules = parameters.getRules();
+ for (Rule rule : rules) {
+ // FIXME fix hibernate bug
+ // org.hibernate.HibernateException: Found shared references to a collection
+ // to not have same loaded entity into different context !
+ Field[] fields = rule.getClass().getFields();
+ for(Field field : fields) {
+ if(Modifier.isPublic(field.getModifiers())) {
+ log.debug("change field is " + field.getName() + "(set topiaId = null)");
+ Object fieldValue = field.get(rule);
+ if(fieldValue instanceof TopiaEntity) {
+ TopiaEntity valueEntity = (TopiaEntity)fieldValue;
+ valueEntity.setTopiaId(null);
+ field.set(rule, valueEntity);
+ }
+ }
+ }
+ }
+
//
// Activation de l'OAP demandée
//
@@ -304,14 +329,13 @@
//
SimulationContext context = SimulationContext.get();
- TopiaContext tx;
context.closeDB();
context.closeDBResult();
try {
// close all transaction
- if (context != null && context.getSimulationStorage() != null) {
+ if (context.getSimulationStorage() != null) {
context.getSimulationStorage().closeMemStorage();
context.getSimulationStorage().closeStorage();
}
1
0
r1672 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish: rule simulator ui/simulator
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
by chatellier@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: chatellier
Date: 2008-12-15 11:41:36 +0000 (Mon, 15 Dec 2008)
New Revision: 1672
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java
Log:
Javadoc modification
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/rule/RuleHelper.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -62,9 +62,11 @@
* Recupere dans prop les valeurs des champs specifique a la regle et met a
* jour les champs de la regle
*
+ * @param ruleIndex l'index de la regle
* @param rule la regle dont les parametres doivent etre lu depuis les
* proprietes
- * @param prop les proprietes contenant les parametre de la regle
+ * @param region ???
+ * @param props les proprietes contenant les parametre de la regle
*/
static public void populateRule(int ruleIndex, RegionStorage region, Rule rule, Properties props) {
ConvertUtilsBean beanUtils = ConverterUtil.getConverter(region.getStorage());
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -145,7 +145,7 @@
/**
* Remove simulation listener, if listener is {@link SimulationResultListener}, it's
- * automaticaly removed as listener on {@link ResultManager}
+ * Automatically removed as listener on {@link ResultManager}
* @param l
*/
public void removeSimulationListener(SimulationListener l) {
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -177,7 +177,6 @@
return result;
}
-
/**
* @return Returns the isisFishVersion.
*/
@@ -213,7 +212,7 @@
* Cela permet de le stocker facilement sur le disque.
*
* @return L'objet Properties representant les parametres
- * @see #fromProperties(Properties)
+ * @see #fromProperties(File,Properties)
*/
public Properties toProperties() {
Properties result = new Properties();
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 2008-12-15 06:35:20 UTC (rev 1671)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/SimulAction.java 2008-12-15 11:41:36 UTC (rev 1672)
@@ -244,7 +244,7 @@
/**
* Change region in simulation launcher
*
- * @param simulationName name of simulation to load
+ * @param simulName name of simulation to load
* @return <code>null</code> if ok, an OutputView otherwise with error
*/
public String loadOldSimulation(String simulName) {
1
0
Author: tchemit
Date: 2008-12-15 06:35:20 +0000 (Mon, 15 Dec 2008)
New Revision: 1671
Added:
isis-fish/trunk/README.txt
isis-fish/trunk/changelog.txt
Removed:
isis-fish/trunk/README
isis-fish/trunk/changelog
Modified:
isis-fish/trunk/pom.xml
Log:
passage en lutinproject 3.2
Deleted: isis-fish/trunk/README
===================================================================
--- isis-fish/trunk/README 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/README 2008-12-15 06:35:20 UTC (rev 1671)
@@ -1,117 +0,0 @@
-maven target
-------------
-
-genapp
- pour generer le skelette du répertoire de projet
-
-jar
- pour compiler et générer un jar
-
-uberjar
- pour générer un jar qui contient toutes ses dépendances que l'on peut
- exécuter avec un java -jar ...
-
-site:deploy
- pour mettre à jour les pages web du site
-
-jar:deploy
- pour mettre à jour la version dans le repository
-
-jar:deploy-snapshot
- pour mettre en place une nouvelle version snapshot dans le repository
-
-dist:deploy
- pour generer des tar.gz de binaire et de sources et les mettre dans le
- repository
-
-Installation d'un plugin
-------------------------
-
-::
-
- maven -DartifactId=maven-lutinprocessor-plugin -DgroupId=lutinlib -Dversion=0.1 plugin:download
-
-Installation de maven
----------------------
-
-Récupérer la dernière version de maven sur http://maven.apache.org
-Installer le en le décompressant dans un répertoire, par exemple /opt
-
-Ajouter le répertoire de bin maven dans votre PATH (peut-etre dans le
-fichier /etc/profile ou ~/.bash_profile)::
-
- export PATH=$PATH:/opt/maven/bin
-
-modifier les droits du répertoire /opt/maven/plugin si vous souhaitez
-installer de nouveau plugin en tant qu'uilisateur normal et non pas
-seulement en root.
-
-Par exemple créez un group dev dans lequel vous mettrez tous les
-développeurs qui devront pouvoir ajouter des plugins à votre installation
-maven.
-
-ensuite::
-
- chown .dev /opt/maven/plugin
- chmod g+w /opt/maven/plugin
- chmod go+s /opt/maven/plugin
-
-Maven décompresse les plugins et download les librairies dans un répertoire.
-Normalement ce répertoire est dans le HOME de chaque utilisateur, mais il
-peut très bien être partagé, et cela permet de ne pas avoir un répertoire de
-plusieurs méga dans son HOME.
-
-Pour cela ajouté dans votre fichier ~/build.properties ceci::
-
- maven.home.local=/var/cache/maven
-
-Il faut ensuite créer ce répertoire et lui mettre les bons droits::
-
- mkdir -p /var/cache/maven
- chown .dev /var/cache/maven
- chmod g+w /var/cache/maven
- chmod go+s /var/cache/maven
-
-Exemple de fichier build.properties
------------------------------------
-
-::
-
- maven.repo.remote=http://www.ibiblio.org/maven/,http://lutinbuilder.labs.li…
-
- maven.checkstyle.format=sun
-
- # pour que le home ne soit pas submerger de .jar énorme
- maven.home.local=/var/cache/maven
-
- # pour la creation de nouveau projet
- maven.genapp.template=topia
- maven.genapp.default.id=lutinApp
- maven.genapp.default.name=Code Lutin Application
- maven.genapp.default.package=org.codelutin
-
- # login sur les sites de deployement
- maven.username=bpoussin
-
-Installation d'un template
---------------------------
-
-On voit dans l'exemple de fichier build.properties ci-dessus que le template
-utilisé est topia. Pour créer ou ajouter un template il faut le faire dans
-le répertoire ~/.maven/template/nom_du_template
-
-par exemple vous pouvez récuperer le template topia et l'installer
-(http://lutinbuilder.labs.libre-entreprise.org/maven/template/topia-0.1.tar.gz)
-
-TODO
-----
-
-labs:register
- pour enregistrer le projet sur labs (declaration des mailings lists,
- fermeture des forums, ...)
-
-labs:release
- pour publier une nouvelle version sur labs (mise à jour du site web,
- enregistrement des fichiers dowloads, ajout du jar dans le repository
- maven, update du XXX-last.jar pointant vers cette derniere version.
-
Copied: isis-fish/trunk/README.txt (from rev 1665, isis-fish/trunk/README)
===================================================================
--- isis-fish/trunk/README.txt (rev 0)
+++ isis-fish/trunk/README.txt 2008-12-15 06:35:20 UTC (rev 1671)
@@ -0,0 +1,117 @@
+maven target
+------------
+
+genapp
+ pour generer le skelette du répertoire de projet
+
+jar
+ pour compiler et générer un jar
+
+uberjar
+ pour générer un jar qui contient toutes ses dépendances que l'on peut
+ exécuter avec un java -jar ...
+
+site:deploy
+ pour mettre à jour les pages web du site
+
+jar:deploy
+ pour mettre à jour la version dans le repository
+
+jar:deploy-snapshot
+ pour mettre en place une nouvelle version snapshot dans le repository
+
+dist:deploy
+ pour generer des tar.gz de binaire et de sources et les mettre dans le
+ repository
+
+Installation d'un plugin
+------------------------
+
+::
+
+ maven -DartifactId=maven-lutinprocessor-plugin -DgroupId=lutinlib -Dversion=0.1 plugin:download
+
+Installation de maven
+---------------------
+
+Récupérer la dernière version de maven sur http://maven.apache.org
+Installer le en le décompressant dans un répertoire, par exemple /opt
+
+Ajouter le répertoire de bin maven dans votre PATH (peut-etre dans le
+fichier /etc/profile ou ~/.bash_profile)::
+
+ export PATH=$PATH:/opt/maven/bin
+
+modifier les droits du répertoire /opt/maven/plugin si vous souhaitez
+installer de nouveau plugin en tant qu'uilisateur normal et non pas
+seulement en root.
+
+Par exemple créez un group dev dans lequel vous mettrez tous les
+développeurs qui devront pouvoir ajouter des plugins à votre installation
+maven.
+
+ensuite::
+
+ chown .dev /opt/maven/plugin
+ chmod g+w /opt/maven/plugin
+ chmod go+s /opt/maven/plugin
+
+Maven décompresse les plugins et download les librairies dans un répertoire.
+Normalement ce répertoire est dans le HOME de chaque utilisateur, mais il
+peut très bien être partagé, et cela permet de ne pas avoir un répertoire de
+plusieurs méga dans son HOME.
+
+Pour cela ajouté dans votre fichier ~/build.properties ceci::
+
+ maven.home.local=/var/cache/maven
+
+Il faut ensuite créer ce répertoire et lui mettre les bons droits::
+
+ mkdir -p /var/cache/maven
+ chown .dev /var/cache/maven
+ chmod g+w /var/cache/maven
+ chmod go+s /var/cache/maven
+
+Exemple de fichier build.properties
+-----------------------------------
+
+::
+
+ maven.repo.remote=http://www.ibiblio.org/maven/,http://lutinbuilder.labs.li…
+
+ maven.checkstyle.format=sun
+
+ # pour que le home ne soit pas submerger de .jar énorme
+ maven.home.local=/var/cache/maven
+
+ # pour la creation de nouveau projet
+ maven.genapp.template=topia
+ maven.genapp.default.id=lutinApp
+ maven.genapp.default.name=Code Lutin Application
+ maven.genapp.default.package=org.codelutin
+
+ # login sur les sites de deployement
+ maven.username=bpoussin
+
+Installation d'un template
+--------------------------
+
+On voit dans l'exemple de fichier build.properties ci-dessus que le template
+utilisé est topia. Pour créer ou ajouter un template il faut le faire dans
+le répertoire ~/.maven/template/nom_du_template
+
+par exemple vous pouvez récuperer le template topia et l'installer
+(http://lutinbuilder.labs.libre-entreprise.org/maven/template/topia-0.1.tar.gz)
+
+TODO
+----
+
+labs:register
+ pour enregistrer le projet sur labs (declaration des mailings lists,
+ fermeture des forums, ...)
+
+labs:release
+ pour publier une nouvelle version sur labs (mise à jour du site web,
+ enregistrement des fichiers dowloads, ajout du jar dans le repository
+ maven, update du XXX-last.jar pointant vers cette derniere version.
+
Property changes on: isis-fish/trunk/README.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: isis-fish/trunk/changelog
===================================================================
--- isis-fish/trunk/changelog 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/changelog 2008-12-15 06:35:20 UTC (rev 1671)
@@ -1,283 +0,0 @@
-isis-fish (3.2.0.x) xxx
-
- * switch to topia-service 1.0.0
- * switch to topia-persistence 2.1.0
- * remove tools.jar (now isis need JDK !!!)
-
-isis-fish (3.2.0.2) chatellier
-
- * fix missing lutinxml dependencies
-
-isis-fish (3.2.0.1) chemit
-
- * all ui are now in src/main/java
- * use maven 2 directory layout
- * use org.codelutin:lutinproject 3.0
- * passageto UTF-8
-
-isis-fish (3.2.0.0) poussin
-
- * complete refactoring option, vcs
- * complete refactoring simulation engin
- * new launcher type (subprocess, caparmor ...) in progress
- * modify script to use cell and not zone in some computation
- * add TechnicalEfficiency equation
- * add Inactivity equation support
-
-isis-fish (3.1.3) stable; urgency=high
-
- * bug correction when migration failed, still launch application on a new database
- * bug correction changing local database in configuration ui has no effect on next launch
- * bug correction if no svn connexion, application could not start
- * use commandline 0.4 (improve init and user options)
- * improve i18n loading (lutinutil)
- * refactor init and vcs init
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 19 Mar 2008 02:02:02 +0200
-
-
- * bug correction #1605 add annotation on scripts for contextual help
- * bug correction #1617 Non prise en compte du changement de base locale
- * add new ui for configuration
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 26 Feb 2008 23:34:02 +0200
-
- * bug correction #1601 Exception et erreur apres une simulation
- * bug correction #1602 Gros probleme de mise a jour de database entre v3.0 vers 3.1 perte des pecheries
- * bug i18n (loose some translate while using Isis-Fish from a jar)
-
- -- Tony Chemit <chemit at codelutin.com> Fri, 21 Dec 2007 11:34:02 +0200
-
-
-isis-fish (3.0.22) stable; urgency=high
-
- * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
- now we don't use cglib but javassist
-
- -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
-
-isis-fish (3.0.21) stable; urgency=high
-
- * bug correction in ResultDatastore, bad database used to get result during simulation
- * add call to close method on SimulationStorage for in memory database
- * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
-
- -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
-
-isis-fish (3.0.20) stable; urgency=high
-
- * add clean temp directory simulation preparation
- * add IsisFish version number in parameter
- * add getPopulations method in PopulationMonitor
- * bug correction #1592 in totalFishingMortality during reduction of matrix
- * bug correction #1583 about too many file open
- * bug in export script template
- * bug correction in rule Cantonnement
- * modify database simulation usage, now we use in memory database for
- data, and file storage for result, to separate result and data. This
- improve performance (70%).
- * bug switch to h2 database version 1.0.60, this prevent rollback exception
- during simulation
-
- -- Benjamin Poussin <poussin at codelutin.com> Mon, 15 Oct 2007 11:34:02 +0200
-
-isis-fish (3.0.19) stable; urgency=low
-
- * bug in cache for String and number in parameter
- * bug RuleMonitor add Rule as parameter
- * add extraRules field in SimulationParameter to permit Analyse Plan to
- add rules in parameter
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Jun 2007 15:39:17 +0200
-
-isis-fish (3.0.18) stable; urgency=low
-
- * bug go.bat have correct DOS end of line
- * improve build-release.sh to send email to user and devel list after deploy
- * bug correction in delete simulation, remove close context at begin of
- clear method
- * bug permit simulation without SimulationControl
- * bug in queue model test if no more simulation to prevent Index Out of
- bound Exception
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:39:17 +0200
-
-isis-fish (3.0.17) stable; urgency=low
-
- * add support for filename and extension in export script
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:38:17 +0200
-
-isis-fish (3.0.16) stable; urgency=low
-
- * add ssj jar to have random library
- * add support to auto upgrade database (topia migration service)
- * bug force reload parameter in thread simulation to prevent class cast
- exception because same class is loaded in two different classloader
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 21 May 2007 15:38:17 +0200
-
-isis-fish (3.0.15) stable; urgency=low
-
- * change database lock_mode to permit read with out lock
- * change database version to 1.0.20070304
- * bug end line in equation editor
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Apr 2007 15:38:17 +0200
-
-isis-fish (3.0.14) stable; urgency=low
-
- * add beforeOrEquals and afterOrEquals methods to Date and Month
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 02 Apr 2007 15:38:17 +0200
-
-isis-fish (3.0.13) stable; urgency=low
-
- * add simulation information support
- * change aspect deployment classloader (not used Agent)
- * bug in cache aspect when used without trace aspect
- * add checkout maven file option
- * change MatrixPanel context menu
- * bug in datastore closeContext (nullify storage)
- * bug in datastore getStorage (if closed create new)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 30 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.12) stable; urgency=low
-
- * bug in cache, help garbage with clear on collection
- * add on matrix sumOverDim(dim, start, nb)
- * change statistic is not used by default
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.11) stable; urgency=low
-
- * add result support in analyse plan
- * bug in AnalysePlanContext values access
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 09 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.10) stable; urgency=low
-
- * Analyse Plan implementation
- * feature #1531 date automaticaly added to simulation id
- * bug in Range value inversion of integer and real
- * bug #1492 matrix index error for result matrix
- * bug #1493 simulation, region deletion
- * bug #1495 view population number with one population
- * bug #1496 simulation, region order
- * bug #1528 in min size in wizard class creation
- * bug #1535 save/cancel button activation/desactivation
- * bug #1536 simulation queue
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Mar 2007 15:38:17 +0200
-
-isis-fish (3.0.9) stable; urgency=low
-
- * add equation editor with syntaxe checking on all equation
- * implement Region checking mecanisme
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 08 Feb 2007 15:38:17 +0200
-
-isis-fish (3.0.8) stable; urgency=low
-
- * force checkout of directory not checkouted at startup
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Feb 2007 15:38:17 +0200
-
-isis-fish (3.0.7) stable; urgency=low
-
- * add import region and rename menu
- * bug in update script
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
-
-isis-fish (3.0.6) stable; urgency=low
-
- * add support for user prompt update file at startup
- * bug saisons (bad converter init)
- * simulation thread completely rewriten
- * first version of systray
- * region copy
- * bug tree refresh after delete region
- * cvs synchronisation menu
- * test de non regression
- * bug in exports
- * bug in rules
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
-
-isis-fish (3.0.5) stable; urgency=low
-
- * add support for delete prompt message and delete cascade prompt message
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.4) stable; urgency=low
-
- * improve cache key computation (use string), (gain 80%)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 17 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.3) stable; urgency=low
-
- * bug in getMonth if date is negative
- * bug in message error during equation compilation, now we show the
- equation type
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 16 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.2) stable; urgency=low
-
- * add import from isis-fish v2
- * change rules from region to root
- * improve equation frame editor (equation documentation)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 13 Nov 2006 15:38:17 +0200
-
-isis-fish (3.0.1) stable; urgency=low
-
- * bug selection cell (selected in list -> note selected in map)
- * add extension to file for model equation
- * improve refresh in input
- * add argument force to ResultStorage.addResult method
- * bug put new Population in right Species when more than one Species (tree problem)
- * bug put new Rule script in right region (tree problem)
- * add firstNull='true' for gear values types
- * bug when load gear with no values (null)
- * change method call: Input.CommitRegionInCVS -> Input.commitRegionInCVS
- * add Equation model editor
- * bug in script editor, don't used translated String for script type
- * bug in script editor, menu save/delete/deleteCVS work now
- * change use for(int i...) in GravityModel and SiMatrix for matrix access
- (gain factor 4 on matrix access and 65% on simulation)
- * change use Soft cache in ResultStorage (gain 10%)
- * improve ResultStorage keep in memory all result available to prevent unecessary
- query on database. Useful with Soft cache.
- * change use commons-collection in Cache aspect (prevent garbage bug in HashMapMultiKey)
- * bug in tools.jar search pattern for Windows
- * bug when create SetOfVessels in Effort description Add button
- was always grey
- * add getNecessaryResult in Rule to know result necessary for this rule
- and activate it automaticaly
- * improve all results are now optionnal
- * add compute and add as result discard weight if necessary
- * add TACweight in DemoRegion
- * add result MATRIX_NO_ACTIVITY
- * bug can set rule parameter
- * bug rule parameter can be saved and restored
- * improve when TopiaContext is used to read, error if another try to write
- (lock table timeout).
- * bug many correction in persistence (lock problem, load cycle problem)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 26 Sep 2006 15:38:17 +0200
-
-isis-fish (3.0.0) stable; urgency=low
-
- * Utililsation de DoubleBigVector par defaut pour les Matrix
- (gain facteur entre 2 et 8 suivant parcours (Iterator, Semantic, Index)
- * Suppression de tous les scripts utilisation de Java et compilation
- (gain facteur 1000 pour l'eval des equations donc 91% sur la simulation)
-
- -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 07 Sep 2006 15:38:17 +0200
Copied: isis-fish/trunk/changelog.txt (from rev 1665, isis-fish/trunk/changelog)
===================================================================
--- isis-fish/trunk/changelog.txt (rev 0)
+++ isis-fish/trunk/changelog.txt 2008-12-15 06:35:20 UTC (rev 1671)
@@ -0,0 +1,284 @@
+isis-fish (3.2.0.x) xxx
+
+ * switch to lutinproject 3.2
+ * switch to topia-service 1.0.1
+ * switch to topia-persistence 2.1.1
+ * remove tools.jar (now isis need JDK !!!)
+
+isis-fish (3.2.0.2) chatellier
+
+ * fix missing lutinxml dependencies
+
+isis-fish (3.2.0.1) chemit
+
+ * all ui are now in src/main/java
+ * use maven 2 directory layout
+ * use org.codelutin:lutinproject 3.0
+ * passageto UTF-8
+
+isis-fish (3.2.0.0) poussin
+
+ * complete refactoring option, vcs
+ * complete refactoring simulation engin
+ * new launcher type (subprocess, caparmor ...) in progress
+ * modify script to use cell and not zone in some computation
+ * add TechnicalEfficiency equation
+ * add Inactivity equation support
+
+isis-fish (3.1.3) stable; urgency=high
+
+ * bug correction when migration failed, still launch application on a new database
+ * bug correction changing local database in configuration ui has no effect on next launch
+ * bug correction if no svn connexion, application could not start
+ * use commandline 0.4 (improve init and user options)
+ * improve i18n loading (lutinutil)
+ * refactor init and vcs init
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 19 Mar 2008 02:02:02 +0200
+
+
+ * bug correction #1605 add annotation on scripts for contextual help
+ * bug correction #1617 Non prise en compte du changement de base locale
+ * add new ui for configuration
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 26 Feb 2008 23:34:02 +0200
+
+ * bug correction #1601 Exception et erreur apres une simulation
+ * bug correction #1602 Gros probleme de mise a jour de database entre v3.0 vers 3.1 perte des pecheries
+ * bug i18n (loose some translate while using Isis-Fish from a jar)
+
+ -- Tony Chemit <chemit at codelutin.com> Fri, 21 Dec 2007 11:34:02 +0200
+
+
+isis-fish (3.0.22) stable; urgency=high
+
+ * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
+ now we don't use cglib but javassist
+
+ -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
+
+isis-fish (3.0.21) stable; urgency=high
+
+ * bug correction in ResultDatastore, bad database used to get result during simulation
+ * add call to close method on SimulationStorage for in memory database
+ * bug correction when launch many simulation with AnalysePlan (OutOfMemory)
+
+ -- Benjamin Poussin <poussin at codelutin.com> Wed, 7 Nov 2007 21:48:31 +0100
+
+isis-fish (3.0.20) stable; urgency=high
+
+ * add clean temp directory simulation preparation
+ * add IsisFish version number in parameter
+ * add getPopulations method in PopulationMonitor
+ * bug correction #1592 in totalFishingMortality during reduction of matrix
+ * bug correction #1583 about too many file open
+ * bug in export script template
+ * bug correction in rule Cantonnement
+ * modify database simulation usage, now we use in memory database for
+ data, and file storage for result, to separate result and data. This
+ improve performance (70%).
+ * bug switch to h2 database version 1.0.60, this prevent rollback exception
+ during simulation
+
+ -- Benjamin Poussin <poussin at codelutin.com> Mon, 15 Oct 2007 11:34:02 +0200
+
+isis-fish (3.0.19) stable; urgency=low
+
+ * bug in cache for String and number in parameter
+ * bug RuleMonitor add Rule as parameter
+ * add extraRules field in SimulationParameter to permit Analyse Plan to
+ add rules in parameter
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Jun 2007 15:39:17 +0200
+
+isis-fish (3.0.18) stable; urgency=low
+
+ * bug go.bat have correct DOS end of line
+ * improve build-release.sh to send email to user and devel list after deploy
+ * bug correction in delete simulation, remove close context at begin of
+ clear method
+ * bug permit simulation without SimulationControl
+ * bug in queue model test if no more simulation to prevent Index Out of
+ bound Exception
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:39:17 +0200
+
+isis-fish (3.0.17) stable; urgency=low
+
+ * add support for filename and extension in export script
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 24 May 2007 15:38:17 +0200
+
+isis-fish (3.0.16) stable; urgency=low
+
+ * add ssj jar to have random library
+ * add support to auto upgrade database (topia migration service)
+ * bug force reload parameter in thread simulation to prevent class cast
+ exception because same class is loaded in two different classloader
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 21 May 2007 15:38:17 +0200
+
+isis-fish (3.0.15) stable; urgency=low
+
+ * change database lock_mode to permit read with out lock
+ * change database version to 1.0.20070304
+ * bug end line in equation editor
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 06 Apr 2007 15:38:17 +0200
+
+isis-fish (3.0.14) stable; urgency=low
+
+ * add beforeOrEquals and afterOrEquals methods to Date and Month
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 02 Apr 2007 15:38:17 +0200
+
+isis-fish (3.0.13) stable; urgency=low
+
+ * add simulation information support
+ * change aspect deployment classloader (not used Agent)
+ * bug in cache aspect when used without trace aspect
+ * add checkout maven file option
+ * change MatrixPanel context menu
+ * bug in datastore closeContext (nullify storage)
+ * bug in datastore getStorage (if closed create new)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 30 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.12) stable; urgency=low
+
+ * bug in cache, help garbage with clear on collection
+ * add on matrix sumOverDim(dim, start, nb)
+ * change statistic is not used by default
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.11) stable; urgency=low
+
+ * add result support in analyse plan
+ * bug in AnalysePlanContext values access
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 09 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.10) stable; urgency=low
+
+ * Analyse Plan implementation
+ * feature #1531 date automaticaly added to simulation id
+ * bug in Range value inversion of integer and real
+ * bug #1492 matrix index error for result matrix
+ * bug #1493 simulation, region deletion
+ * bug #1495 view population number with one population
+ * bug #1496 simulation, region order
+ * bug #1528 in min size in wizard class creation
+ * bug #1535 save/cancel button activation/desactivation
+ * bug #1536 simulation queue
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Mar 2007 15:38:17 +0200
+
+isis-fish (3.0.9) stable; urgency=low
+
+ * add equation editor with syntaxe checking on all equation
+ * implement Region checking mecanisme
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 08 Feb 2007 15:38:17 +0200
+
+isis-fish (3.0.8) stable; urgency=low
+
+ * force checkout of directory not checkouted at startup
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 05 Feb 2007 15:38:17 +0200
+
+isis-fish (3.0.7) stable; urgency=low
+
+ * add import region and rename menu
+ * bug in update script
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
+
+isis-fish (3.0.6) stable; urgency=low
+
+ * add support for user prompt update file at startup
+ * bug saisons (bad converter init)
+ * simulation thread completely rewriten
+ * first version of systray
+ * region copy
+ * bug tree refresh after delete region
+ * cvs synchronisation menu
+ * test de non regression
+ * bug in exports
+ * bug in rules
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 25 Jan 2007 15:38:17 +0200
+
+isis-fish (3.0.5) stable; urgency=low
+
+ * add support for delete prompt message and delete cascade prompt message
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 20 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.4) stable; urgency=low
+
+ * improve cache key computation (use string), (gain 80%)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 17 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.3) stable; urgency=low
+
+ * bug in getMonth if date is negative
+ * bug in message error during equation compilation, now we show the
+ equation type
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 16 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.2) stable; urgency=low
+
+ * add import from isis-fish v2
+ * change rules from region to root
+ * improve equation frame editor (equation documentation)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 13 Nov 2006 15:38:17 +0200
+
+isis-fish (3.0.1) stable; urgency=low
+
+ * bug selection cell (selected in list -> note selected in map)
+ * add extension to file for model equation
+ * improve refresh in input
+ * add argument force to ResultStorage.addResult method
+ * bug put new Population in right Species when more than one Species (tree problem)
+ * bug put new Rule script in right region (tree problem)
+ * add firstNull='true' for gear values types
+ * bug when load gear with no values (null)
+ * change method call: Input.CommitRegionInCVS -> Input.commitRegionInCVS
+ * add Equation model editor
+ * bug in script editor, don't used translated String for script type
+ * bug in script editor, menu save/delete/deleteCVS work now
+ * change use for(int i...) in GravityModel and SiMatrix for matrix access
+ (gain factor 4 on matrix access and 65% on simulation)
+ * change use Soft cache in ResultStorage (gain 10%)
+ * improve ResultStorage keep in memory all result available to prevent unecessary
+ query on database. Useful with Soft cache.
+ * change use commons-collection in Cache aspect (prevent garbage bug in HashMapMultiKey)
+ * bug in tools.jar search pattern for Windows
+ * bug when create SetOfVessels in Effort description Add button
+ was always grey
+ * add getNecessaryResult in Rule to know result necessary for this rule
+ and activate it automaticaly
+ * improve all results are now optionnal
+ * add compute and add as result discard weight if necessary
+ * add TACweight in DemoRegion
+ * add result MATRIX_NO_ACTIVITY
+ * bug can set rule parameter
+ * bug rule parameter can be saved and restored
+ * improve when TopiaContext is used to read, error if another try to write
+ (lock table timeout).
+ * bug many correction in persistence (lock problem, load cycle problem)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 26 Sep 2006 15:38:17 +0200
+
+isis-fish (3.0.0) stable; urgency=low
+
+ * Utililsation de DoubleBigVector par defaut pour les Matrix
+ (gain facteur entre 2 et 8 suivant parcours (Iterator, Semantic, Index)
+ * Suppression de tous les scripts utilisation de Java et compilation
+ (gain facteur 1000 pour l'eval des equations donc 91% sur la simulation)
+
+ -- Benjamin Poussin <poussin at cube.codelutin.com> Thu, 07 Sep 2006 15:38:17 +0200
Property changes on: isis-fish/trunk/changelog.txt
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-15 00:59:49 UTC (rev 1670)
+++ isis-fish/trunk/pom.xml 2008-12-15 06:35:20 UTC (rev 1671)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
</parent>
<groupId>ifremer</groupId>
@@ -94,21 +94,21 @@
<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>org.jdesktop</groupId>
<artifactId>beansbinding</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
@@ -138,7 +138,7 @@
<scope>compile</scope>
</dependency>
- <!-- encore utilise pour les pre-scripts -->
+ <!-- encore utilise pour les pre-scripts -->
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
@@ -166,7 +166,7 @@
<version>0.2.2</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
@@ -174,14 +174,14 @@
<scope>compile</scope>
</dependency>
- <!-- Utilisé dans les scripts -->
+ <!-- Utilisé dans les scripts -->
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinj2r</artifactId>
<version>0.2</version>
<scope>runtime</scope>
</dependency>
-
+
<!-- Utilisé lors de l'import xml v2 (entre autre) -->
<dependency>
<groupId>jaxen</groupId>
@@ -227,38 +227,38 @@
</dependency>
<dependency>
- <groupId>ssj</groupId>
- <artifactId>Blas</artifactId>
- <version>20081007</version>
- <scope>runtime</scope>
+ <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>
+ <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>
+ <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>
+ <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>
+ <groupId>ssj</groupId>
+ <artifactId>logger</artifactId>
+ <version>1.6.4</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
@@ -294,7 +294,7 @@
<distribution>repo</distribution>
</license>
</licenses>
-
+
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
@@ -303,16 +303,18 @@
<properties>
<!-- id du projet du labs -->
<labs.id>8</labs.id>
- <!--labs.project>isis-fish</labs.project-->
+ <!-- nom du projet du labs -->
+ <labs.project>isis-fish</labs.project>
+
<!-- jaxx version -->
<jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
- <generator.version>0.63-SNAPSHOT</generator.version>
+ <generator.version>0.63</generator.version>
<!-- topia version -->
- <topia.version>2.1.1-SNAPSHOT</topia.version>
+ <topia.version>2.1.1</topia.version>
<!-- lutinwidget version -->
<lutinwidget.version>0.11</lutinwidget.version>
@@ -351,7 +353,8 @@
<templates>org.codelutin.topia.generator.TopiaMetaGenerator</templates>
<destDirGen>${maven.gen.dir}/java</destDirGen>
<defaultPackage>fr.ifremer.isisfish</defaultPackage>
- <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%</copyVersionDir>
+ <copyVersionDir>${project.basedir}/src/main/resources/oldmappings/%MODELNAME%
+ </copyVersionDir>
<copyVersionFiles>**/*.hbm.xml</copyVersionFiles>
<copyOverwrite>true</copyOverwrite>
</configuration>
@@ -372,13 +375,13 @@
</dependency>
</dependencies>
</plugin>
-
+
<plugin>
<groupId>org.codelutin</groupId>
<artifactId>maven-jaxx-plugin</artifactId>
<version>${jaxx.version}</version>
<executions>
- <execution>
+ <execution>
<goals>
<goal>generate</goal>
</goals>
@@ -392,7 +395,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinwidget</artifactId>
- <version>${lutinwidget.version}</version>
+ <version>${lutinwidget.version}</version>
</dependency>
<dependency>
<groupId>org.codelutin.topia</groupId>
@@ -428,7 +431,7 @@
</configuration>
<executions>
<execution>
- <phase>generate-resources</phase>
+ <phase>generate-resources</phase>
<goals>
<goal>parserJava</goal>
<goal>gen</goal>
@@ -438,7 +441,6 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
@@ -451,147 +453,161 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${maven.jar.main.class}</mainClass>
- <classpathPrefix>lib/</classpathPrefix>
- </manifest>
- </archive>
+ <classpathPrefix>./lib/</classpathPrefix>
+ </manifest>
+ </archive>
</configuration>
</plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
- <execution>
- <id>JnlpSun</id>
- <phase>package</phase>
- <configuration>
+ </plugins>
+ </build>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Environment ************************************** -->
+ <!-- ************************************************************* -->
+ <scm>
+ <connection>${maven.scm.connection}</connection>
+ <developerConnection>${maven.scm.developerConnection}</developerConnection>
+ <url>${maven.scm.url}</url>
+ </scm>
+
+ <profiles>
+ <profile>
+ <id>release-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
+ <execution>
+ <id>JnlpSun</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
+ todir="${project.basedir}/target/resources/jnlp/">
+ <filterset>
+ <filter token="mail" value="mail-1.4.jar"/>
+ <filter token="activation" value="activation-1.1.jar"/>
+ </filterset>
+ </copy>
+ <copy file="${project.build.directory}/lib/mail-1.4.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ <copy file="${project.build.directory}/lib/activation-1.1.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <!--execution>
+ <id>MakeManualScreenShots</id>
+ <phase>package</phase>
+ <configuration>
<tasks>
- <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
- todir="${project.basedir}/target/resources/jnlp/">
- <filterset>
- <filter token="mail" value="mail-1.4.jar"/>
- <filter token="activation" value="activation-1.1.jar"/>
- </filterset>
- </copy>
- <copy file="${project.build.directory}/lib/mail-1.4.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
- <copy file="${project.build.directory}/lib/activation-1.1.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
+ <exec executable="${project.basedir}/doc/manual/prepareManual.sh"
+ dir="${project.basedir}/doc/manual/"/>
</tasks>
- </configuration>
- <goals>
+ </configuration>
+ <goals>
<goal>run</goal>
- </goals>
- </execution>
- <!--execution>
- <id>MakeManualScreenShots</id>
- <phase>package</phase>
+ </goals>
+ </execution-->
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
<configuration>
- <tasks>
- <exec executable="${project.basedir}/doc/manual/prepareManual.sh"
- dir="${project.basedir}/doc/manual/"/>
- </tasks>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
</configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution-->
- </executions>
- </plugin>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <!-- Java Web Start -->
- <!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
- <plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20081018</version>
- <executions>
- <execution>
- <phase>deploy</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <dependencies>
- <excludes>
- <exclude>javax.mail:mail</exclude>
- <exclude>javax.activation:activation</exclude>
- </excludes>
- </dependencies>
- <jnlp>
- <!--<resources>${project.basedir}/src/jnlp</resources>-->
- <outputFile>isis-fish-v3.jnlp</outputFile>
- <mainClass>${maven.jar.main.class}</mainClass>
- </jnlp>
+ <!-- Java Web Start -->
+ <!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <version>1.0-alpha-2-cl_20081018</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>jnlp-inline</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <dependencies>
+ <excludes>
+ <exclude>javax.mail:mail</exclude>
+ <exclude>javax.activation:activation</exclude>
+ </excludes>
+ </dependencies>
+ <jnlp>
+ <!--<resources>${project.basedir}/src/jnlp</resources>-->
+ <outputFile>isis-fish-v3.jnlp</outputFile>
+ <mainClass>${maven.jar.main.class}</mainClass>
+ </jnlp>
- <sign>
- <keystore>${keystorepath}</keystore>
- <keypass/>
- <storepass>${keystorepass}</storepass>
- <storetype/>
- <alias>${keystorealias}</alias>
- <validity/>
+ <sign>
+ <keystore>${keystorepath}</keystore>
+ <keypass/>
+ <storepass>${keystorepass}</storepass>
+ <storetype/>
+ <alias>${keystorealias}</alias>
+ <validity/>
- <dnameCn/>
- <dnameOu/>
- <dnameO/>
- <dnameL/>
- <dnameSt/>
- <dnameC/>
+ <dnameCn/>
+ <dnameOu/>
+ <dnameO/>
+ <dnameL/>
+ <dnameSt/>
+ <dnameC/>
- <verify>true</verify>
- </sign>
+ <verify>true</verify>
+ </sign>
- <keystore>
- <delete>false</delete>
- <gen>false</gen>
- </keystore>
+ <keystore>
+ <delete>false</delete>
+ <gen>false</gen>
+ </keystore>
- <pack200>false</pack200>
- <gzip>true</gzip>
- <verbose>false</verbose>
- </configuration>
- </plugin>
+ <pack200>false</pack200>
+ <gzip>true</gzip>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</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>
-
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
- <scm>
- <connection>${maven.scm.connection}</connection>
- <developerConnection>${maven.scm.developerConnection}</developerConnection>
- <url>${maven.scm.url}</url>
- </scm>
-
</project>
1
0
r1670 - in isis-fish/trunk: . src/main/java/fr/ifremer/isisfish/ui/input src/test/java/fr/ifremer/isisfish/ui
by tchemit@users.labs.libre-entreprise.org 15 Dec '08
by tchemit@users.labs.libre-entreprise.org 15 Dec '08
15 Dec '08
Author: tchemit
Date: 2008-12-15 00:59:49 +0000 (Mon, 15 Dec 2008)
New Revision: 1670
Added:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
Log:
little help to sylvain :) show how binding works on CellUI, in general we should not deal direclty with widget values but prefer data binding...
reformat Inputaction
always refresh InputAction value
bump lutingenerator and topia versions
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2008-12-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/pom.xml 2008-12-15 00:59:49 UTC (rev 1670)
@@ -309,10 +309,10 @@
<jaxx.version>0.8-SNAPSHOT</jaxx.version>
<!-- generator version -->
- <generator.version>0.62</generator.version>
+ <generator.version>0.63-SNAPSHOT</generator.version>
<!-- topia version -->
- <topia.version>2.1.0</topia.version>
+ <topia.version>2.1.1-SNAPSHOT</topia.version>
<!-- lutinwidget version -->
<lutinwidget.version>0.11</lutinwidget.version>
@@ -384,6 +384,7 @@
</goals>
<configuration>
<src>${project.basedir}/src/main/java</src>
+ <addSourcesToClassPath>true</addSourcesToClassPath>
</configuration>
</execution>
</executions>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/CellUI.jaxx 2008-12-15 00:59:49 UTC (rev 1670)
@@ -36,119 +36,92 @@
+-->
<Table implements='InputContent'>
- <!-- ui state when the activite is active -->
+ <!-- edit property -->
<Boolean id='actif' javaBean='false'/>
+ <!-- change property -->
<Boolean id='changed' javaBean='false'/>
+ <!-- bean property -->
+ <fr.ifremer.isisfish.entities.CellImpl id='bean' javaBean='null'/>
+
<script><![CDATA[
- import fr.ifremer.isisfish.entities.Cell;
- import com.bbn.openmap.gui.OMToolSet;
- import fr.ifremer.isisfish.map.IsisMapBean;
- import fr.ifremer.isisfish.map.OpenMapToolPanel;
- import org.codelutin.topia.persistence.TopiaEntity;
- import fr.ifremer.isisfish.entities.Zone;
- import fr.ifremer.isisfish.ui.WelcomePanelUI;
+import fr.ifremer.isisfish.entities.Cell;
+import fr.ifremer.isisfish.entities.CellImpl;
+import com.bbn.openmap.gui.OMToolSet;
+import fr.ifremer.isisfish.map.IsisMapBean;
+import fr.ifremer.isisfish.map.OpenMapToolPanel;
+import org.codelutin.topia.persistence.TopiaEntity;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.ui.WelcomePanelUI;
- protected IsisMapBean cellMap = new IsisMapBean();
- protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
- protected OMToolSet toolSet = new OMToolSet();
-
- public CellUI (InputAction action){
-
- setContextValue(action);
- }
- public void refresh() {
- Cell cell = getContextValue(InputAction.class).getCell();
- DefaultComboBoxModel fieldCellModel = new DefaultComboBoxModel();
- java.util.List<Cell> cells = getContextValue(InputAction.class).getFisheryRegion().getCell();
- for (Cell c : cells){
- fieldCellModel.addElement(c);
- }
- fieldCell.setModel(fieldCellModel);
- if (cell != null){
- fieldCellName.setText(cell.getName());
- fieldCellLatitude.setText(cell.getLatitude()+"");
- fieldCellLongitude.setText(cell.getLongitude()+"");
- fieldCellLand.setSelected(cell.getLand());
- fieldCellComment.setText(getContextValue(InputAction.class).getCell().getComment());
+protected IsisMapBean cellMap = new IsisMapBean();
+protected OpenMapToolPanel toolMap = new OpenMapToolPanel();
+protected OMToolSet toolSet = new OMToolSet();
- cellMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- toolSet.setupListeners(cellMap);
- toolMap.add((Component)toolSet);
- cellMapPanel.add(toolMap, BorderLayout.NORTH);
- cellMapPanel.add(cellMap, BorderLayout.CENTER);
- cellMap.setSelectedCells(cell);
- valueChanged(false);
- }
- else {
-
+addPropertyChangeListener("bean", new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getOldValue() != null || evt.getNewValue() == null) {
+ // remove previous binding on getBean()
+ jaxx.runtime.Util.removeDataBinding($Table0, "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
fieldCellName.setText("");
fieldCellLatitude.setText("");
fieldCellLongitude.setText("");
fieldCellComment.setText("");
-
- cellMap.setFisheryRegion(getContextValue(InputAction.class).getFisheryRegion());
- toolSet.setupListeners(cellMap);
- toolMap.add((Component)toolSet);
- cellMapPanel.add(toolMap, BorderLayout.NORTH);
- cellMapPanel.add(cellMap, BorderLayout.CENTER);
- valueChanged(false);
+ fieldCellLand.setSelected(false);
}
+ if (evt.getNewValue() != null) {
+ // add binding on getBean()
+ jaxx.runtime.Util.applyDataBinding($Table0, "fieldCellName.text", "fieldCellLongitude.text", "fieldCellLatitude.text", "fieldCellLand.selected", "fieldCellComment.text");
+ }
}
- protected void save(){
- TopiaEntity topia = getContextValue(InputAction.class).save();
- valueChanged(false);
- getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
- setInfoText(_("isisfish.message.save.finished"));
- refresh();
+});
+
+public void refresh() {
+ InputAction action = getContextValue(InputAction.class);
+ setBean(null);
+ Cell cell = action.getCell();
+ setBean((CellImpl) cell);
+ jaxx.runtime.swing.Utils.fillComboBox(fieldCell,action.getFisheryRegion().getCell(), cell);
+
+ cellMap.setFisheryRegion(action.getFisheryRegion());
+ toolSet.setupListeners(cellMap);
+ toolMap.add((Component)toolSet);
+ cellMapPanel.add(toolMap, BorderLayout.NORTH);
+ cellMapPanel.add(cellMap, BorderLayout.CENTER);
+
+ if (cell != null){
+ cellMap.setSelectedCells(cell);
}
- protected void cancel(){
- TopiaEntity topia = getContextValue(InputAction.class).cancel();
- valueChanged(false);
- refresh();
- setInfoText(_("isisfish.message.cancel.finished"));
+ setChanged(false);
+}
+
+protected void save() {
+ TopiaEntity topia = getContextValue(InputAction.class).save();
+ getParentContainer(InputUI.class).repaintNode("$root/$cells/" + topia.getTopiaId());
+ refresh();
+ getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.save.finished"));
+}
+
+protected void cancel() {
+ getContextValue(InputAction.class).cancel();
+ refresh();
+ getParentContainer(WelcomePanelUI.class).setInfoText(_("isisfish.message.cancel.finished"));
+}
+
+protected void fieldCellChanged() {
+ Cell c = (Cell)fieldCell.getSelectedItem();
+ if (c==null) {
+ return;
}
- protected void goToZone(){
- getParentContainer(InputUI.class).setTreeSelection("$root/$zones");
+ Cell oldC = getBean();
+ if (oldC != null && c.getTopiaId().equals(oldC.getTopiaId())) {
+ // avoid reentrant code
+ return;
}
- protected void valueChanged(boolean b){
- //TODO remove method valueChanged
- // must use the setter to fire property changes, and make possible bindings
- setChanged(b);
- }
- protected void setInfoText(String txt){
- WelcomePanelUI root = getParentContainer(WelcomePanelUI.class);
- root.setInfoText(txt);
- }
- protected void fieldCellChanged(){
- Cell c = (Cell)fieldCell.getSelectedItem();
- getContextValue(InputAction.class).setValue(c);
- getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
- //fixme no :) as you select a new node, you should not do anything more on ui ?
- refresh();
- valueChanged(true);
- }
- protected void nameChanged(){
- getContextValue(InputAction.class).getCell().setName(fieldCellName.getText());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- protected void cellLandChanged(){
- getContextValue(InputAction.class).getCell().setLand(fieldCellLand.isSelected());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- protected void commentChanged(){
- getContextValue(InputAction.class).getCell().setComment(fieldCellComment.getText());
- //fixme no :) use a propertyChangeListener on the bean
- refresh();
- valueChanged(true);
- }
- ]]>
- </script>
+ getParentContainer(InputUI.class).setTreeSelection("$root/$cells/"+c.getTopiaId());
+}
+]]></script>
<row>
<cell fill='both' weighty='1.0' weightx='1.0'>
<JSplitPane id="CellTab" name="Cells"
@@ -156,7 +129,7 @@
<Table>
<row>
<cell fill='horizontal' columns='2' weightx='1.0'>
- <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()' enabled='{isActif()}'/>
+ <JComboBox id="fieldCell" onActionPerformed='fieldCellChanged()' model='{new DefaultComboBoxModel()}'/>
</cell>
</row>
<row>
@@ -164,7 +137,7 @@
<JLabel text="isisfish.cell.name" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellName" onKeyTyped='valueChanged(true)' onFocusLost='nameChanged()' enabled='{isActif()}'/>
+ <JTextField id="fieldCellName" text='{getBean().getName()}' onKeyTyped='setChanged(true)' onFocusLost='if (isChanged()) {getBean().setName(fieldCellName.getText());}' enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -172,7 +145,7 @@
<JLabel text="isisfish.cell.latitude" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellLatitude" editable="false" enabled='{isActif()}'/>
+ <JTextField id="fieldCellLatitude" text='{getBean().getLatitude()}' editable="false" enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -180,7 +153,7 @@
<JLabel text="isisfish.cell.longitude" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JTextField id="fieldCellLongitude" editable="false" enabled='{isActif()}'/>
+ <JTextField id="fieldCellLongitude" text='{getBean().getLongitude()}' editable="false" enabled='{isActif()}'/>
</cell>
</row>
<row>
@@ -188,7 +161,7 @@
<JLabel text="isisfish.cell.land" enabled='{isActif()}'/>
</cell>
<cell fill='horizontal' weightx='1.0'>
- <JCheckBox id="fieldCellLand" onActionPerformed='cellLandChanged()' enabled='{isActif()}'/>
+ <JCheckBox id="fieldCellLand" onActionPerformed='setChanged(true); getBean().setLand(fieldCellLand.isSelected());' enabled='{isActif()}' selected='{getBean().getLand()}'/>
</cell>
</row>
<row>
@@ -199,7 +172,7 @@
<row>
<cell columns='2' fill='both' weighty='1.0' weightx='1.0'>
<JScrollPane>
- <JTextArea id="fieldCellComment" onKeyTyped='valueChanged(true)' onFocusLost='commentChanged()' enabled='{isActif()}'/>
+ <JTextArea id="fieldCellComment" text='{jaxx.runtime.Util.getStringValue(getBean().getComment())}' onKeyTyped='setChanged(true)' onFocusLost='if (isChanged()) { getBean().setComment(fieldCellComment.getText()); }' enabled='{isActif()}'/>
</JScrollPane>
</cell>
</row>
@@ -218,7 +191,7 @@
</row>
<row>
<cell fill='horizontal' weightx='1.0'>
- <JButton text="isisfish.input.continueZones" onActionPerformed='goToZone()'/>
+ <JButton text="isisfish.input.continueZones" onActionPerformed='getParentContainer(InputUI.class).setTreeSelection("$root/$zones")'/>
</cell>
</row>
</Table>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -37,58 +37,23 @@
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.IsisFishEntityEnum;
import fr.ifremer.isisfish.datastore.FormuleStorage;
-import java.util.List;
-
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.datastore.StorageException;
import fr.ifremer.isisfish.datastore.update.ImportFromV2;
-import fr.ifremer.isisfish.entities.Cell;
-import fr.ifremer.isisfish.entities.CellDAO;
-import fr.ifremer.isisfish.entities.EffortDescription;
-import fr.ifremer.isisfish.entities.EffortDescriptionDAO;
-import fr.ifremer.isisfish.entities.Equation;
-import fr.ifremer.isisfish.entities.FisheryRegion;
-import fr.ifremer.isisfish.entities.Formule;
-import fr.ifremer.isisfish.entities.Gear;
-import fr.ifremer.isisfish.entities.Metier;
-import fr.ifremer.isisfish.entities.MetierSeasonInfo;
-import fr.ifremer.isisfish.entities.MetierSeasonInfoDAO;
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationDAO;
-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.SelectivityDAO;
-import fr.ifremer.isisfish.entities.SetOfVessels;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Strategy;
-import fr.ifremer.isisfish.entities.TargetSpecies;
-import fr.ifremer.isisfish.entities.TargetSpeciesDAO;
-import fr.ifremer.isisfish.entities.TripType;
-import fr.ifremer.isisfish.entities.VesselType;
-import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.entities.*;
import fr.ifremer.isisfish.types.Month;
import fr.ifremer.isisfish.ui.input.check.CheckRegion;
import fr.ifremer.isisfish.ui.input.check.CheckResult;
import fr.ifremer.isisfish.ui.input.check.CheckResultFrame;
+import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation;
import fr.ifremer.isisfish.ui.widget.ErrorDialogUI;
import fr.ifremer.isisfish.util.CellPointcomparator;
-import java.awt.geom.Point2D;
-import java.io.File;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
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 static org.codelutin.i18n.I18n._;
import org.codelutin.math.matrix.MatrixFactory;
import org.codelutin.math.matrix.MatrixND;
import org.codelutin.topia.TopiaContext;
@@ -97,14 +62,21 @@
import org.codelutin.topia.persistence.TopiaEntity;
import org.codelutin.util.FileUtil;
import org.codelutin.widget.editor.Editor;
-import static org.codelutin.i18n.I18n._;
+
+import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.showInputDialog;
-import static fr.ifremer.isisfish.ui.simulator.filter.SimulationFilterUtil.selectSimulation;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-/**
- *
- * @author letellier
- */
+/** @author letellier */
public class InputAction {
/** to use log facility, just put in your code: log.info(\"...\"); */
@@ -132,82 +104,90 @@
log.debug("new instance");
}
}
- protected void showMsgBox(Exception eee){
+
+ protected void showMsgBox(Exception eee) {
ErrorDialogUI.showError(eee);
}
+
public void setValue(Object value) {
-// cell = null;
-// zone = null;
-// port = null;
-// species = null;
-// population = null;
-// gear = null;
-// metier = null;
-// tripType = null;
-// vesselType = null;
-// setOfVessels = null;
-// strategy = null;
-// selected=null;
- if (!(value instanceof TopiaEntity)) {
- // this is not a TopiaEntity value, so quit
- isNull = true;
- return;
- }
- isNull = false;
- switch (IsisFishEntityEnum.valueOf(value.getClass())){
- case Zone:
- zone = (Zone) value;
+ if (value == null || !(value instanceof TopiaEntity)) {
+ // this is not a TopiaEntity value, or a null value : so quit
+ isNull = true;
+ cell = null;
+ zone = null;
+ port = null;
+ species = null;
+ population = null;
+ gear = null;
+ metier = null;
+ tripType = null;
+ vesselType = null;
+ setOfVessels = null;
+ strategy = null;
+ selected = null;
+ return;
+ }
+ isNull = false;
+ switch (IsisFishEntityEnum.valueOf(value.getClass())) {
+ case Zone:
+ zone = (Zone) value;
break;
- case Cell:
- cell = (Cell) value;
+ case Cell:
+ cell = (Cell) value;
break;
- case Port:
- port = (Port) value;
+ case Port:
+ port = (Port) value;
break;
- case Species:
- species = (Species) value;
+ case Species:
+ species = (Species) value;
break;
- case Population:
- population = (Population) value;
- species = population.getSpecies();
+ case Population:
+ population = (Population) value;
+ species = population.getSpecies();
break;
- case Metier:
- metier = (Metier) value;
+ case Metier:
+ metier = (Metier) value;
break;
- case TripType:
- tripType = (TripType) value;
+ case TripType:
+ tripType = (TripType) value;
break;
- case Gear:
- gear = (Gear) value;
+ case Gear:
+ gear = (Gear) value;
break;
- case VesselType:
- vesselType = (VesselType) value;
+ case VesselType:
+ vesselType = (VesselType) value;
break;
- case SetOfVessels:
- setOfVessels = (SetOfVessels) value;
+ case SetOfVessels:
+ setOfVessels = (SetOfVessels) value;
break;
- case Strategy:
- strategy = (Strategy) value;
+ case Strategy:
+ strategy = (Strategy) value;
break;
- }
- selected = (TopiaEntity) value;
+ }
+ selected = (TopiaEntity) value;
}
- public boolean isNull(){
+
+ public boolean isNull() {
return isNull;
}
- public void setPath(String path){
+
+ public void setPath(String path) {
this.path = path;
}
- public String getPath(){
+
+ public String getPath() {
return path;
}
- public TopiaContext getIsisContext(){
+
+ public TopiaContext getIsisContext() {
return isisContext;
}
- public RegionStorage getRegionStorage(){
+
+ public RegionStorage getRegionStorage() {
return regionStorage;
}
- public void setSpecies(String topiaId){
+
+ public void setSpecies(String topiaId) {
try {
species = IsisFishDAOHelper.getSpeciesDAO(isisContext).findByTopiaId(topiaId);
} catch (TopiaException ex) {
@@ -215,75 +195,75 @@
}
}
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File importRegion() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File importRegion() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
- RegionStorage.importZip(file);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
+ RegionStorage.importZip(file);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File importRegionAndRename() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File importRegionAndRename() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
- String newName =
+ String newName =
showInputDialog(_("isisfish.message.name.imported.region"));
- RegionStorage.importAndRenameZip(file, newName);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ RegionStorage.importAndRenameZip(file, newName);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Importer la region depuis un fichier XML de la version 2
- *
- * @return
- */
- public File importV2Region() {
+ /**
+ * Importer la region depuis un fichier XML de la version 2
+ *
+ * @return TODO
+ */
+ public File importV2Region() {
File file = null;
- try {
- file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml"));
- if (file != null) {
+ try {
+ file = FileUtil.getFile(".*.xml$", _("isisfish.message.import.region.xml"));
+ if (file != null) {
- new ImportFromV2(true).importXML(file);
+ new ImportFromV2(true).importXML(file);
- }
- } catch (Exception eee) {
- log.error("Can't import region", eee);
+ }
+ } catch (Exception eee) {
+ log.error("Can't import region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Extract from a simulation the region, and rename it with name given
+ /**
+ * Extract from a simulation the region, and rename it with name given
* by user.
- *
- * return msg
- */
+ *
+ * @return msg
+ */
public String importRegionFromSimulation() {
// first step select a simulation and new region name
@@ -308,7 +288,7 @@
}
// ask new region name
- String regionName = showInputDialog(_("isisfish.message.import.region.name"),"region from "+simulationName);
+ String regionName = showInputDialog(_("isisfish.message.import.region.name"), "region from " + simulationName);
if (regionName == null || "".equals(regionName)) {
return null;
}
@@ -330,118 +310,115 @@
return regionName;
}
- /**
- * Exporter la region dans un zip
- *
- * @return
- */
- public File exportRegion() {
+ /**
+ * Exporter la region dans un zip
+ *
+ * @return TODO
+ */
+ public File exportRegion() {
File file = null;
- try {
- file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
- if (file != null) {
- int resp = JOptionPane.YES_OPTION;
- if (file.exists()) {
- resp = JOptionPane.showConfirmDialog(null,
- _("isisfish.message.file.overwrite"));
- }
- if (resp == JOptionPane.YES_OPTION) {
- regionStorage.createZip(file);
- }
- }
- } catch (Exception eee) {
- log.error("Can't export region", eee);
+ try {
+ file = FileUtil.getFile(".*.zip$", _("isisfish.message.import.region.zipped"));
+ if (file != null) {
+ int resp = JOptionPane.YES_OPTION;
+ if (file.exists()) {
+ resp = JOptionPane.showConfirmDialog(null,
+ _("isisfish.message.file.overwrite"));
+ }
+ if (resp == JOptionPane.YES_OPTION) {
+ regionStorage.createZip(file);
+ }
+ }
+ } catch (Exception eee) {
+ log.error("Can't export region", eee);
showMsgBox(eee);
- }
- return file;
- }
+ }
+ return file;
+ }
- /**
- * Copy la region avec un autre nom
- *
- * @return
- */
- public String copyRegion() {
+ /**
+ * Copy la region avec un autre nom
+ *
+ * @return TODO
+ */
+ public String copyRegion() {
String newName = null;
- try {
- newName = showInputDialog(_("isisfish.message.new.region.name"));
+ try {
+ newName = showInputDialog(_("isisfish.message.new.region.name"));
- File zip = regionStorage.createZip();
- RegionStorage.importAndRenameZip(zip, newName);
+ File zip = regionStorage.createZip();
+ RegionStorage.importAndRenameZip(zip, newName);
- } catch (Exception eee) {
- log.error("Can't copy region", eee);
+ } catch (Exception eee) {
+ log.error("Can't copy region", eee);
showMsgBox(eee);
- }
- return newName;
- }
+ }
+ return newName;
+ }
- /**
- * Remove region
- *
- * @param cvsDelete
- * if true delete region in CVS too
- * @return
- */
- public String removeRegion(boolean cvsDelete) {
+ /**
+ * Remove region
+ *
+ * @param cvsDelete if true delete region in CVS too
+ * @return TODO
+ */
+ public String removeRegion(boolean cvsDelete) {
String result = null;
- try {
- int resp = JOptionPane.showConfirmDialog(null, _(
- "isisfish.message.confirm.remove.region",
- regionStorage.getName()));
- if (resp == JOptionPane.YES_OPTION) {
- regionStorage.delete(cvsDelete);
- result = _("isisfish.message.region.removed");
+ try {
+ int resp = JOptionPane.showConfirmDialog(null, _(
+ "isisfish.message.confirm.remove.region",
+ regionStorage.getName()));
+ if (resp == JOptionPane.YES_OPTION) {
+ regionStorage.delete(cvsDelete);
+ result = _("isisfish.message.region.removed");
- } else {
- result = _("isisfish.message.region.remove.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't remove region", eee);
+ } else {
+ result = _("isisfish.message.region.remove.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't remove region", eee);
showMsgBox(eee);
- }
- return result;
- }
+ }
+ return result;
+ }
- /**
- * Remove region
- *
- * @return
- */
- public String commitRegionInCVS() {
+ /**
+ * Remove region
+ *
+ * @return TODO
+ */
+ public String commitRegionInCVS() {
String result = null;
- try {
- String msg = regionStorage.getCommentForNextCommit();
- JTextArea text = new JTextArea(msg);
- int resp = JOptionPane.showOptionDialog(null,
- new JScrollPane(text), _("isisfish.commit.message"),
- JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
- null, // icon
- null, null);
- if (resp == JOptionPane.OK_OPTION) {
- regionStorage.commit(text.getText());
- regionStorage.clearCommentForNextCommit();
- result = _("isisfish.message.region.commited");
- } else {
- result = _("isisfish.message.commit.region.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't export region", eee);
+ try {
+ String msg = regionStorage.getCommentForNextCommit();
+ JTextArea text = new JTextArea(msg);
+ int resp = JOptionPane.showOptionDialog(null,
+ new JScrollPane(text), _("isisfish.commit.message"),
+ JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
+ null, // icon
+ null, null);
+ if (resp == JOptionPane.OK_OPTION) {
+ regionStorage.commit(text.getText());
+ regionStorage.clearCommentForNextCommit();
+ result = _("isisfish.message.region.commited");
+ } else {
+ result = _("isisfish.message.commit.region.canceled");
+ }
+ } catch (Exception eee) {
+ log.error("Can't export region", eee);
showMsgBox(eee);
- }
- return result;
- }
+ }
+ return result;
+ }
/**
* load region.
- * <p>
+ * <p/>
* RegionStorage, TopiaContext, FisheryRegion are put in uiContext data.
- * <p>
+ * <p/>
* tree ans
*
- * @param name
- * name of region
- * @return if ok return null else OutView error
+ * @param name name of region
*/
public void loadRegion(String name) {
if (log.isTraceEnabled()) {
@@ -466,77 +443,75 @@
* Create new region, and select it in combo, and show input pane region in
* input area.
*
- * @param name
- * name of the new region
- * @return if ok return null else OutView error
+ * @param name name of the new region
*/
public void newRegion(String name) {
if (log.isTraceEnabled()) {
log.trace("newRegion called");
}
try {
- if ("".equals(name)) {
+ if ("".equals(name)) {
// showMsgBox("error " + _("isisfish.error.region.name.empty"));
- }
- if (RegionStorage.getRegionNames().contains(name)) {
+ }
+ if (RegionStorage.getRegionNames().contains(name)) {
// showMsgBox("Error " + _("isisfish.error.region.already.exists"));
- }
- RegionStorage.create(name);
- } catch (Exception eee) {
- log.error("Can't create region", eee);
- showMsgBox(eee);
}
+ RegionStorage.create(name);
+ } catch (Exception eee) {
+ log.error("Can't create region", eee);
+ showMsgBox(eee);
+ }
}
/**
* If some entities has been modified by the user (EntityModified state is
* true) then ask the user if he want save, don't save modification, or
* cancel current wanted action.
- *
+ * <p/>
* If this method return true, only button (save, cancel) will be refreshed
* not the current input panel
- *
+ * <p/>
* if this method return false, nothing is do
*
* @return false if user want cancel action, true otherwize
*/
protected boolean askForSave() {
- boolean result = true;
- return result;
+ return true;
}
/**
* Permet de creer simplement un nouvelle objet portant un nom par defaut.
* Le nouvel element est automatiquement selectionné dans l'arbre
*
- * @param type
- * le type de l'entite a creer, le type est compose seulement du
- * nom de l'entite et pas du package.
+ * @param type le type de l'entite a creer, le type est compose seulement du
+ * nom de l'entite et pas du package.
* @return null ou un fenetre d'erreur
*/
@SuppressWarnings("unchecked")
public TopiaEntity create(String type) {
- if (log.isTraceEnabled()) {
- log.trace("create called for " + type);
- }
- try {
- String name = type + "_new";
+ 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, new Object[] { isisContext });
+ 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();
- return entity;
+ TopiaEntity entity = dao.create("name", name);
+ entity.update();
+ isisContext.commitTransaction();
+ return entity;
- } catch (Exception eee) {
- log.error("Can't create entity", eee);
- showMsgBox(eee);
- }
- return null;
+ } catch (Exception eee) {
+ log.error("Can't create entity", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
/**
@@ -545,26 +520,26 @@
* @return the saved entity
*/
public TopiaEntity save() {
- if (log.isTraceEnabled()) {
- log.trace("save called");
+ if (log.isTraceEnabled()) {
+ log.trace("save called");
+ }
+ try {
+ if (selected == null) {
+ log.warn("Try to save null entity");
+ return null;
}
- try {
- if (selected == null) {
- log.warn("Try to save null entity");
- return null;
- }
- // on est pas en autoUpdate donc il faut faire le update avant le
- // commit
- selected.update();
+ // on est pas en autoUpdate donc il faut faire le update avant le
+ // commit
+ selected.update();
- selected.getTopiaContext().commitTransaction();
- } catch (Exception eee) {
- log.error("Can't save region", eee);
- showMsgBox(eee);
- }
- return selected;
+ selected.getTopiaContext().commitTransaction();
+ } catch (Exception eee) {
+ log.error("Can't save region", eee);
+ showMsgBox(eee);
+ }
+ return selected;
}
-
+
/**
* Cancel all modification on entity (rollback), and force reload it and
* refresh all ui component that name match 'type'Tab
@@ -572,146 +547,145 @@
* @return the roolbacked entity
*/
public TopiaEntity cancel() {
- if (log.isTraceEnabled()) {
- log.trace("cancel called");
- }
- try {
- isisContext.rollbackTransaction();
+ if (log.isTraceEnabled()) {
+ log.trace("cancel called");
+ }
+ try {
+ isisContext.rollbackTransaction();
- // reload the object
- if (selected != null) {
- selected = isisContext.findByTopiaId(selected.getTopiaId());
- setValue(selected);
- }
- } catch (Exception eee) {
- log.error("Can't cancel modification in region", eee);
- showMsgBox(eee);
+ // reload the object
+ if (selected != null) {
+ selected = isisContext.findByTopiaId(selected.getTopiaId());
+ setValue(selected);
}
- return selected;
+ } catch (Exception eee) {
+ log.error("Can't cancel modification in region", eee);
+ showMsgBox(eee);
+ }
+ return selected;
}
/**
* Delete one entity and commit the change, try to selected intelligently
* other node in tree.
- * <p>
+ * <p/>
* Refresh all ui component where name match "input<entity type without
* package >.*"
*
* @return if ok return null else OutView error
*/
public String remove() {
- if (log.isTraceEnabled()) {
- log.trace("remove called");
- }
- String msg = "";
- try {
- boolean doDelete = true;
- List<TopiaEntity> allWillBeRemoved = selected.getComposite();
- if (allWillBeRemoved.size() > 0) {
- String text = _(
- "isisfish.message.delete.object",
- selected.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", selected.toString());
- int resp = JOptionPane.showConfirmDialog(null, text,
- _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
- doDelete = resp == JOptionPane.YES_OPTION;
+ if (log.isTraceEnabled()) {
+ log.trace("remove called");
+ }
+ String msg = "";
+ try {
+ boolean doDelete;
+ List<TopiaEntity> allWillBeRemoved = selected.getComposite();
+ if (allWillBeRemoved.size() > 0) {
+ String text = _(
+ "isisfish.message.delete.object",
+ selected.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", selected.toString());
+ int resp = JOptionPane.showConfirmDialog(null, text,
+ _("isisfish.message.delete.entity"), JOptionPane.YES_NO_OPTION);
+ doDelete = resp == JOptionPane.YES_OPTION;
+ }
- if (doDelete) {
- selected.delete();
- isisContext.commitTransaction();
- msg = _("isisfish.message.remove.finished");
- } else {
- msg = _("isisfish.message.remove.canceled");
- }
- } catch (Exception eee) {
- log.error("Can't remove entity: " + selected, eee);
- showMsgBox(eee);
+ if (doDelete) {
+ selected.delete();
+ isisContext.commitTransaction();
+ msg = _("isisfish.message.remove.finished");
+ } else {
+ msg = _("isisfish.message.remove.canceled");
}
- return msg;
+ } catch (Exception eee) {
+ log.error("Can't remove entity: " + selected, eee);
+ showMsgBox(eee);
+ }
+ return msg;
}
- /**
- * Save an Equation as model, to reuse it for other equation
- *
- * @param eq
- * equation to put in models
- * @return if ok return null else OutputView error message
- */
- public Object saveEquationAsModel(Equation eq) {
- try {
- if (eq != null) {
- String name = showInputDialog("");
- if ("".equals(name)) {
+ /**
+ * Save an Equation as model, to reuse it for other equation
+ *
+ * @param eq equation to put in models
+ * @return if ok return null else OutputView error message
+ */
+ public Object saveEquationAsModel(Equation eq) {
+ try {
+ if (eq != null) {
+ String name = showInputDialog("");
+ if ("".equals(name)) {
// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
- if (name != null) {
- FormuleStorage storage = FormuleStorage.createFormule(eq
- .getCategory(), name, eq.getLanguage());
- storage.setContent(eq.getContent());
- }
- }
- } catch (Exception eee) {
- log.error("Can't save equation as model", eee);
- showMsgBox(eee);
- }
- return null;
- }
+ }
+ if (name != null) {
+ FormuleStorage storage = FormuleStorage.createFormule(eq
+ .getCategory(), name, eq.getLanguage());
+ storage.setContent(eq.getContent());
+ }
+ }
+ } catch (Exception eee) {
+ log.error("Can't save equation as model", eee);
+ showMsgBox(eee);
+ }
+ return null;
+ }
/**
* Save an Equation as model, to reuse it for other equation
*
- * @param category
- * category for this equation
- * @param language
- * equation to put in models
- * @param content content ?
+ * @param category category for this equation
+ * @param language equation to put in models
+ * @param content content ?
* @return if ok return null else OutputView error message
*/
public Object saveAsModel(String category, String language, String content) {
- try {
- String name = showInputDialog("");
- if ("".equals(name)) {
+ try {
+ String name = showInputDialog("");
+ if ("".equals(name)) {
// showMsgBox("Error " +_("isisfish.error.invalid.equation.name"));
- }
- if (name != null) {
- FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
- storage.setContent(content);
- }
-
- } catch (Exception eee) {
- log.error("Can't save equation as model", eee);
- showMsgBox(eee);
}
- return null;
+ if (name != null) {
+ FormuleStorage storage = FormuleStorage.createFormule(category, name, language);
+ storage.setContent(content);
+ }
+
+ } catch (Exception eee) {
+ log.error("Can't save equation as model", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
+
public Object openEditor(String category, String name,
- Class javaInterface, String content, Editor editor) {
- if (log.isTraceEnabled()) {
- log.trace("openEditor");
+ Class javaInterface, String content, Editor editor) {
+ if (log.isTraceEnabled()) {
+ log.trace("openEditor");
+ }
+ try {
+ EquationEditorPaneUI pane = new EquationEditorPaneUI();
+ pane.setEquation(category, name, javaInterface, content);
+ pane.setVisible(true);
+ if (pane.isOk() && editor != null) {
+ editor.setText(pane.getEditor().getText());
}
- try {
- EquationEditorPaneUI pane = new EquationEditorPaneUI();
- pane.setEquation(category, name, javaInterface, content);
- pane.setVisible(true);
- if (pane.isOk() && editor != null) {
- editor.setText(pane.getEditor().getText());
- }
- pane.dispose();
- } catch (Exception eee) {
- log.error("Can't open editor", eee);
- showMsgBox(eee);
- }
- return null;
+ pane.dispose();
+ } catch (Exception eee) {
+ log.error("Can't open editor", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
+
protected String getFisheryRegionName() {
if (fisheryRegion != null) {
return fisheryRegion.getName();
@@ -722,8 +696,8 @@
protected FisheryRegion getFisheryRegion() {
return fisheryRegion;
}
-
- protected TopiaEntity getSelected(){
+
+ protected TopiaEntity getSelected() {
return selected;
}
@@ -770,51 +744,52 @@
protected Strategy getStrategy() {
return strategy;
}
- protected List<Formule> getFormules(String name){
+
+ protected List<Formule> getFormules(String name) {
return FormuleStorage.getFormules(isisContext, name);
}
-
+
// InputGear
-
+
public Object addSelectivity(Population pop, String equation) {
try {
-
+
SelectivityDAO dao = IsisFishDAOHelper.getSelectivityDAO(isisContext);
Selectivity selectivity = dao.create();
-
+
selectivity.setGear(gear);
selectivity.setPopulation(pop);
selectivity.getEquation().setContent(equation);
selectivity.update();
-
+
gear.addPopulationSelectivity(selectivity);
gear.update();
-
+
} catch (Exception eee) {
log.error("Can't add selectivity", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object removeSelectivity(Selectivity selectivity){
- if (log.isTraceEnabled()) {
+
+ public Object removeSelectivity(Selectivity selectivity) {
+ if (log.isTraceEnabled()) {
log.trace("removeTargetSpecies called: " + selectivity);
}
try {
if (gear != null && selectivity != null) {
gear.removePopulationSelectivity(selectivity);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove TargetSpecies", eee);
showMsgBox(eee);
}
return null;
}
-
+
// InputMetier
-
- public Object createSeasonInfo(){
+
+ public Object createSeasonInfo() {
if (log.isTraceEnabled()) {
log.trace("createSeasonInfo called");
}
@@ -828,14 +803,14 @@
metier.update();
// isisContext.commitTransaction();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
return null;
}
- public Object removeSeasonInfo(MetierSeasonInfo info){
+ public Object removeSeasonInfo(MetierSeasonInfo info) {
if (log.isTraceEnabled()) {
log.trace("createSeasonInfo called");
}
@@ -843,33 +818,33 @@
metier.removeMetierSeasonInfo(info);
metier.update();
isisContext.commitTransaction();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create MetierSeasonInfo", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch){
- if (log.isTraceEnabled()) {
+
+ public Object addTargetSpecies(MetierSeasonInfo m, Species species, String targetFactorEquation, boolean primaryCatch) {
+ if (log.isTraceEnabled()) {
log.trace("addTargetSpecies called: " + metier + " " + species + " " + primaryCatch + " " + targetFactorEquation);
}
try {
TargetSpeciesDAO dao = IsisFishDAOHelper.getTargetSpeciesDAO(isisContext);
TargetSpecies targetSpecies = dao.create();
-
+
targetSpecies.setSpecies(species);
targetSpecies.getTargetFactorEquation().setContent(targetFactorEquation);
targetSpecies.setPrimaryCatch(primaryCatch);
m.addSpeciesTargetSpecies(targetSpecies);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't add TargetSpecies", eee);
showMsgBox(eee);
}
return null;
}
-
- public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies){
+
+ public Object removeTargetSpecies(MetierSeasonInfo m, TargetSpecies targetSpecies) {
if (log.isTraceEnabled()) {
log.trace("removeTargetSpecies called: " + targetSpecies);
}
@@ -877,7 +852,7 @@
if (targetSpecies != null) {
m.removeSpeciesTargetSpecies(targetSpecies);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove TargetSpecies", eee);
showMsgBox(eee);
}
@@ -886,8 +861,8 @@
// SetOfVessels
- public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
- if (log.isTraceEnabled()) {
+ public void addEffortDescription(SetOfVessels setOfVessels, Metier metier) {
+ if (log.isTraceEnabled()) {
log.trace("addEffortDescription called: " + setOfVessels + " metier: " + metier);
}
try {
@@ -897,14 +872,14 @@
effortDescription.update();
setOfVessels.addPossibleMetiers(effortDescription);
setOfVessels.update();
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't create EffortDescription", eee);
showMsgBox(eee);
}
}
-
+
public Object removeEffortDescription(SetOfVessels sov, EffortDescription effort) {
- if (log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("remove called");
}
try {
@@ -916,13 +891,13 @@
}
return null;
}
-
+
// Population
public Population createPopulation() {
if (log.isTraceEnabled()) {
- log.trace("create called");
-}
+ log.trace("create called");
+ }
try {
String name = "Population_new";
@@ -947,7 +922,7 @@
}
public Object createRecruitmentDistribution() {
- if (log.isTraceEnabled()) {
+ if (log.isTraceEnabled()) {
log.trace("createRecruitmentDistributionontext called: " + population);
}
try {
@@ -962,14 +937,14 @@
}
}
}
-
- if ( num > 0) {
+
+ if (num > 0) {
List<String> sem = new ArrayList<String>(num);
- for (int i=0; i<num; i++) {
+ for (int i = 0; i < num; i++) {
sem.add(_("isisfish.common.month", i));
}
- MatrixND newMat = MatrixFactory.getInstance().create(new List[]{sem});
-
+ MatrixND newMat = MatrixFactory.getInstance().create(new List[]{sem});
+
MatrixND mat = population.getRecruitmentDistribution();
if (mat != null) {
newMat.paste(mat);
@@ -983,67 +958,65 @@
}
return null;
}
-
+
// Migration
-
- public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addMigration called");
- }
- try {
- MatrixND mat = info.getMigrationMatrix().copy();
- mat.setValue(group, departure, arrival, coeff);
- info.setMigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add migration", eee);
- showMsgBox(eee);
- }
- return null;
+
+ public Object addMigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, Zone arrival, double coeff) {
+ if (log.isTraceEnabled()) {
+ log.trace("addMigration called");
+ }
+ try {
+ MatrixND mat = info.getMigrationMatrix().copy();
+ mat.setValue(group, departure, arrival, coeff);
+ info.setMigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add migration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
public Object addEmigration(PopulationSeasonInfo info, PopulationGroup group, Zone departure, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addEmigration called");
- }
- try {
- MatrixND mat = info.getEmigrationMatrix().copy();
- mat.setValue(group, departure, coeff);
- info.setEmigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add emigration", eee);
- showMsgBox(eee);
- }
- return null;
+ if (log.isTraceEnabled()) {
+ log.trace("addEmigration called");
+ }
+ try {
+ MatrixND mat = info.getEmigrationMatrix().copy();
+ mat.setValue(group, departure, coeff);
+ info.setEmigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add emigration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
-
+
public Object addImmigration(PopulationSeasonInfo info, PopulationGroup group, Zone arrival, double coeff) {
- if (log.isTraceEnabled()) {
- log.trace("addImmigration called");
- }
- try {
- MatrixND mat = info.getImmigrationMatrix().copy();
- mat.setValue(group, arrival, coeff);
- info.setImmigrationMatrix(mat);
-
- }catch(Exception eee){
- log.error("Can't add immigration", eee);
- showMsgBox(eee);
- }
- return null;
+ if (log.isTraceEnabled()) {
+ log.trace("addImmigration called");
+ }
+ try {
+ MatrixND mat = info.getImmigrationMatrix().copy();
+ mat.setValue(group, arrival, coeff);
+ info.setImmigrationMatrix(mat);
+
+ } catch (Exception eee) {
+ log.error("Can't add immigration", eee);
+ showMsgBox(eee);
+ }
+ return null;
}
-// FisheryRegion
- /**
- *
- * @return TODO
- */
- public Object addMap(){
- if (log.isTraceEnabled()) {
- log.trace("AddMap called");
- }
+ // FisheryRegion
+ /** @return TODO */
+ public Object addMap() {
+ if (log.isTraceEnabled()) {
+ log.trace("AddMap called");
+ }
+
File shp = FileUtil.getFile(".*\\.shp", "shp file");
try {
if (shp != null) {
@@ -1073,7 +1046,7 @@
maps.add(basename);
fisheryRegion.setMapFileList(maps);
}
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't copy .shp or .ssx file for: " + shp, eee);
showMsgBox(eee);
}
@@ -1081,11 +1054,11 @@
}
/**
- * @param selectedMaps la list dans lequel il faut retirer la carte
+ * @param selectedMaps la list dans lequel il faut retirer la carte
* @return TODO
- */
- public Object removeMap(Object[] selectedMaps){
- if (log.isTraceEnabled()) {
+ */
+ public Object removeMap(Object[] selectedMaps) {
+ if (log.isTraceEnabled()) {
log.trace("removeMap called");
}
try {
@@ -1106,7 +1079,7 @@
fisheryRegion.setMapFileList(maps);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error("Can't remove map", eee);
showMsgBox(eee);
}
@@ -1117,25 +1090,26 @@
* Affiche une boite de dialogue demandant a l'utilisateur de rentrer
* un nom de fichier, et met ce nom dans la textField.
* Passe le saveButton en enabled pour marque que la region a ete modifié
+ *
* @param cellFile file of cells
*/
- public void loadCellFile(String cellFile){
+ public void loadCellFile(String cellFile) {
if (log.isTraceEnabled()) {
log.trace("loadCell called");
}
- // FIXME todo loadCellFile
- }
+ // FIXME todo loadCellFile
+ }
- public Object saveFisheryRegion(String type){
+ public Object saveFisheryRegion(String type) {
if (log.isTraceEnabled()) {
log.trace("save called");
}
- try{
+ try {
TopiaContext isisContext = fisheryRegion.getTopiaContext();
// frame.setInfoText(_("isisfish.message.checking.cell"));
- int latNumber = (int)Math.round((fisheryRegion.getMaxLatitude() - fisheryRegion.getMinLatitude()) / fisheryRegion.getCellLengthLatitude());
- int lonNumber = (int)Math.round((fisheryRegion.getMaxLongitude() - fisheryRegion.getMinLongitude()) / fisheryRegion.getCellLengthLongitude());
+ int latNumber = (int) Math.round((fisheryRegion.getMaxLatitude() - fisheryRegion.getMinLatitude()) / fisheryRegion.getCellLengthLatitude());
+ int lonNumber = (int) Math.round((fisheryRegion.getMaxLongitude() - fisheryRegion.getMinLongitude()) / fisheryRegion.getCellLengthLongitude());
// frame.setProgressMin(0);
// frame.setProgressMax(latNumber * lonNumber);
@@ -1148,20 +1122,20 @@
Collections.sort(cells, cellPointcomparator);
Point2D.Float point = new Point2D.Float();
- for(float lati = fisheryRegion.getMinLatitude();lati<fisheryRegion.getMaxLatitude();lati+=fisheryRegion.getCellLengthLatitude()){
- lati = Math.round(lati*1000f);
- lati= lati / 1000.0f;
- for(float longi = fisheryRegion.getMinLongitude();longi<fisheryRegion.getMaxLongitude();longi+=fisheryRegion.getCellLengthLongitude()){
- longi = Math.round(longi*1000f) / 1000.0f;
+ for (float lati = fisheryRegion.getMinLatitude(); lati < fisheryRegion.getMaxLatitude(); lati += fisheryRegion.getCellLengthLatitude()) {
+ lati = Math.round(lati * 1000f);
+ lati = lati / 1000.0f;
+ for (float longi = fisheryRegion.getMinLongitude(); longi < fisheryRegion.getMaxLongitude(); longi += fisheryRegion.getCellLengthLongitude()) {
+ longi = Math.round(longi * 1000f) / 1000.0f;
point.setLocation(lati, longi);
int position = Collections.binarySearch(cells, point, cellPointcomparator);
- if(position >= 0){
+ if (position >= 0) {
// deja existant on l'enleve de la liste, et on ne cree rien
cells.remove(position);
} else {
// n'existe pas on la cree
Cell cell = cellPS.create();
- cell.setName("La"+lati+"Lo"+longi);
+ cell.setName("La" + lati + "Lo" + longi);
cell.setLatitude(lati);
cell.setLongitude(longi);
cell.setLand(false);
@@ -1180,7 +1154,7 @@
// frame.setProgressMin(0);
// frame.setProgressMax(cells.size());
progresscpt = 0;
- for(Cell cell:cells){
+ for (Cell cell : cells) {
// FIXME il faudrait aussi rechercher les objets dependants
// des mailles que l'on va supprimer et demander confirmation
// a l'utilisateur qu'il souhaite reellement supprimer tous
@@ -1195,14 +1169,14 @@
// frame.refreshView("inputFisheryRegion");
// frame.setInfoText(_("isisfish.message.save.finished"));
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error(_("isisfish.error.save.region"), eee);
showMsgBox(eee);
}
return null;
}
- public Object checkFisheryRegion(){
+ public Object checkFisheryRegion() {
try {
if (log.isTraceEnabled()) {
log.trace("check called: ");
@@ -1213,7 +1187,7 @@
CheckResultFrame dialog = new CheckResultFrame();
dialog.setCheckResult(result);
dialog.setVisible(true);
- }catch(Exception eee){
+ } catch (Exception eee) {
log.error(_("isisfish.error.check.region"), eee);
showMsgBox(eee);
}
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-13 10:24:41 UTC (rev 1669)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputNavigationTreeSelectionAdapter.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -131,7 +131,6 @@
int responce = askUser(content, _("isisfish.message.page.modified"));
if (responce == JOptionPane.NO_OPTION) {
context.getContextValue(InputAction.class).cancel();
- exit = true;
} else if (responce == JOptionPane.OK_OPTION) {
context.getContextValue(InputAction.class).save();
ui.setChanged(false);
@@ -140,7 +139,6 @@
if (currentNode != null) {
model.nodeChanged(currentNode);
}
- exit = true;
} else {
exit = false;
}
@@ -162,9 +160,10 @@
log.debug("find data for contextPath <" + node.getContextPath() + "> : " + (data == null ? null : data.getClass()));
}
InputAction action = context.getContextValue(InputAction.class);
- if (data != null) {
+ action.setValue(data);
+ /*if (data != null) {
action.setValue(data);
- }
+ }*/
action.setPath(node.getContextPath());
}
Added: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java (rev 0)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/TestJaxx.java 2008-12-15 00:59:49 UTC (rev 1670)
@@ -0,0 +1,38 @@
+package fr.ifremer.isisfish.ui;
+
+import jaxx.reflect.ClassDescriptor;
+import jaxx.reflect.JavaFileParser;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+
+/** @author chemit */
+public class TestJaxx {
+
+ @Test
+ public void testParseEntity() throws Exception {
+ URL javaSource = new File("target/generated-sources/java/fr/ifremer/isisfish/entities/Cell.java").toURI().toURL();
+
+ InputStream in = javaSource.openStream();
+ Reader reader = new InputStreamReader(in, "utf-8");
+ ClassDescriptor result = JavaFileParser.parseJavaFile(javaSource.toString(), reader, getClass().getClassLoader());
+ reader.close();
+ Assert.assertNotNull(result);
+ }
+
+ @Test
+ public void testParseEntityImpl() throws Exception {
+ URL javaSource = new File("src/main/java/fr/ifremer/isisfish/entities/CellImpl.java").toURI().toURL();
+
+ InputStream in = javaSource.openStream();
+ Reader reader = new InputStreamReader(in, "utf-8");
+ ClassDescriptor result = JavaFileParser.parseJavaFile(javaSource.toString(), reader, getClass().getClassLoader());
+ reader.close();
+ Assert.assertNotNull(result);
+ }
+}
1
0